Adds support for conditionally disabling VM creation.
[invirt/packages/invirt-web.git] / code / templates / list.mako
index d7d320a..3d0c50c 100644 (file)
@@ -9,6 +9,12 @@
 VM List
 </%def>
 
+%if os.path.exists("/etc/invirt/motd.html"):
+<div class="result">
+<p class="error">${open('/etc/invirt/motd.html').read()|n}</p>
+</div>
+%endif
+
 <%def name="createForm()">
 % if cant_add_vm:
 <p>${cant_add_vm}</p>
@@ -19,6 +25,7 @@ VM List
 % elif new_machine:
 <p>Congratulations! You successfully created a new VM called ${new_machine}.</p>
 % endif
+
     <form action="create" method="POST">
     <input type="hidden" name="back" value="list"/>
       <table>
@@ -74,7 +81,15 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin
        </tr>
        ${self.fn.errorRow('owner', err)}
       </table>
-      <input type="submit" class="button" value="Create it!"/><br />
+      <input type="submit" class="button" value="Create it!" \
+% if disable_creation:
+ disabled="disabled" \
+% endif
+/> \
+% if disable_creation:
+&nbsp;<span style="color:red;">VM creation is currently disabled due to lack of disk space.</span> \
+%endif
+<br />
       Windows notes: ${self.fn.helppopup('Windows')}
     </form>
 % endif
@@ -126,7 +141,11 @@ ${has_vnc[machine]}
 % endif
 </td>
       </tr>
-      <tr>
+      <tr\
+% if dark:
+ class="stripedrow" \
+% endif
+>
         <td colspan="7" style="padding-left: 1em; color: #666">${machine.description|self.fn.module.nl2br}</td>
       </tr>
 </%def>