Incremented version to not conflict with precise
[invirt/packages/invirt-web.git] / code / templates / list.mako
index 90953f0..e6ed39f 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,28 +81,39 @@ ${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
 </%def>
 
 <%def name="machineRow(machine, dark)">
+<%
+       on = (machine.uptime is not None)
+%>
       <tr\
 % if dark:
  class="stripedrow" \
 % endif
 > 
        <td rowspan="2">
-       % if machine.uptime and installing[machine]:
+       % if on and installing[machine]:
        <img src="static/power_installing.png" alt="Installing..." />
        % else:
-         <form action="machine/${machine.machine_id}/command/${'shutdown' if machine.uptime else 'create'}" method="post">
+         <form action="machine/${machine.machine_id}/command/${'shutdown' if on else 'create'}" method="post">
            <input type="hidden" name="back" value="list"/>
            <input type="hidden" name="machine_id"
                   value="${machine.machine_id}"/>
-<input type="submit" class="power ${'on' if machine.uptime else 'off'}" name="action" value="${'Shutdown' if machine.uptime else 'Power on'}"\
-% if machine.uptime:
+<input type="submit" class="power ${'on' if on else 'off'}" name="action" value="${'Shutdown' if on else 'Power on'}"\
+% if on:
  onclick="return confirm('Are you sure you want to power off this VM?');"
 % endif
 />
@@ -112,7 +130,7 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin
        <td></td>
 % endif
 <td>\
-% if machine.uptime:
+% if on:
 ${datetime.timedelta(seconds=int(machine.uptime))}\
 % endif
 </td>