Permalink
Browse files

Cleanup on syspanel.images code, and unuset template removal.

A lot of templates got left behind after the datatables refactor which
are no longer used or necessary.

There was also some strange behavior in the syspanel images table
where outdated javascript would try to hide other rows in the table
causing bad behavior.

Change-Id: If7aa226336f0814782522b20c76eadc39613c372
  • Loading branch information...
1 parent b63e495 commit 797c497312548e9f00f9b23e47f40729b005bb61 @gabrielhurley gabrielhurley committed Feb 10, 2012
Showing with 22 additions and 395 deletions.
  1. +0 −9 horizon/horizon/dashboards/nova/templates/nova/access_and_security/security_groups/_delete_rule.html
  2. +0 −8 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_no_instances.html
  3. +0 −9 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_pause.html
  4. +0 −9 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_reboot.html
  5. +0 −9 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_resume.html
  6. +0 −11 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_snapshot.html
  7. +0 −9 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_suspend.html
  8. +0 −9 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_terminate.html
  9. +0 −9 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_unpause.html
  10. +0 −10 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_delete.html
  11. +0 −11 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detach.html
  12. +0 −27 horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_form.html
  13. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/images/_delete.html
  14. +0 −27 horizon/horizon/dashboards/syspanel/templates/syspanel/images/_form.html
  15. +0 −46 horizon/horizon/dashboards/syspanel/templates/syspanel/images/_list.html
  16. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/images/_toggle.html
  17. +19 −5 horizon/horizon/dashboards/syspanel/templates/syspanel/images/_update.html
  18. +3 −15 horizon/horizon/dashboards/syspanel/templates/syspanel/images/update.html
  19. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/instances/_pause.html
  20. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/instances/_reboot.html
  21. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/instances/_resume.html
  22. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/instances/_suspend.html
  23. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/instances/_terminate.html
  24. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/instances/_unpause.html
  25. +0 −26 horizon/horizon/dashboards/syspanel/templates/syspanel/services/_stats.html
  26. +0 −22 horizon/horizon/dashboards/syspanel/templates/syspanel/services/_toggle.html
  27. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/users/_delete.html
  28. +0 −9 horizon/horizon/dashboards/syspanel/templates/syspanel/users/_enable_disable.html
  29. +0 −20 horizon/horizon/dashboards/syspanel/templates/syspanel/users/_toggle_enabled.html
  30. +0 −13 openstack-dashboard/dashboard/static/dashboard/js/navigation.js
  31. +0 −1 openstack-dashboard/dashboard/templates/base.html
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_delete_{{ rule.id }}" class="form-delete" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="security_group_rule_id" type="hidden" value="{{ rule.id }}" />
- <input id="delete_{{ rule.id }}" class="btn small danger delete" title="Security Group: {{ rule.id }}" type="submit" value="{% trans "Delete" %}" />
-</form>
@@ -1,8 +0,0 @@
-{% load i18n %}
-
-<div class="alert alert-block alert-info">
- <p><strong>{% trans "Info: " %}</strong>{% trans "There are no instances running. Launch an instance from the Images Page." %}</p>
- <div class="alert-actions pull-right">
- <a class="btn small primary" href='{% url horizon:nova:images_and_snapshots:index %}'>{% trans "Images Page" %}</a>
- </div>
-</div>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_pause_{{ instance.id }}" class="form-pause form-line" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="pause_{{ instance.id }}" class="btn small pause" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Pause" %}" />
-</form>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_reboot_{{ instance.id }}" class="form-reboot form-inline" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="reboot_{{ instance.id }}" class="btn small reboot" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Reboot" %}" />
-</form>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_resume_{{ instance.id }}" class="form-resume form-inline" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="resume_{{ instance.id }}" class="btn small resume" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Resume" %}" />
-</form>
@@ -1,11 +0,0 @@
-{% extends 'nova/instances_and_volumes/instances/_form.html' %}
-{% load i18n %}
-
-{% block form_action %}{% url horizon:nova:images_and_snapshots:snapshots:create instance.id %}{% endblock %}
-
-{% block modal-footer %}
-<div class="modal-footer">
- <input class="btn primary pull-right" type="submit" value="{% trans "Create Snapshot" %}" />
- <a href="#" class="btn secondary cancel close">{% trans "Cancel" %}</a>
-</div>
-{% endblock %}
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_suspend_{{ instance.id }}" class="form-suspend" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="suspend_{{ instance.id }}" class="btn small suspend" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Suspend" %}" />
-</form>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_terminate_{{ instance.id }}" class="form-terminate" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="terminate_{{instance.id}}" class="btn small danger terminate" title="{{ instance.name }}" type="submit" value="{% trans "Terminate" %}" />
-</form>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_unpause_{{ instance.id }}" class="form-unpause form-line" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="unpause_{{ instance.id }}" class="btn small unpause" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Unpause" %}" />
-</form>
@@ -1,10 +0,0 @@
-{% load i18n %}
-<form id="form_delete_{{ volume.id }}" class="form-delete" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="volume_id" type="hidden" value="{{ volume.id }}" />
- <input name="volume_name" type="hidden" value="{{ volume.displayName }}" />
- <input id="delete_{{ volume.id }}" class="btn small danger delete" title="Volume: {{ volume.displayName }}" type="submit" value="{% trans "Delete" %}" />
-</form>
@@ -1,11 +0,0 @@
-{% load i18n %}
-<form id="form_detach_{{ attachment.volumeId }}" class="form-delete" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="volume_id" type="hidden" value="{{ attachment.volumeId }}" />
- <input name="instance_id" type="hidden" value="{{ attachment.serverId }}" />
- <input name="attachment_id" type="hidden" value="{{ attachment.id }}" />
- <input id="detach_{{ attachment.volumeId }}" class="btn small detach" title="{% trans "volume" %} {{ attachment.volumeId }} {% trans "from the instance" %} {{ attachment.serverId }}" type="submit" value="{% trans "Detach" %}" />
-</form>
@@ -1,27 +0,0 @@
-{% load i18n %}
-<form id="volume_form" action="{% block form_action %}{% endblock %}" method="post">
- {% csrf_token %}
- <fieldset>
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- {% for field in form.visible_fields %}
- <div class="clearfix{% if field.errors %} error{% endif %}">
- {{ field.label_tag }}
- {% if field.errors %}
- {% for error in field.errors %}
- <span class="help-inline">{{ error }}</span>
- {% endfor %}
- {% endif %}
- <span class="help-block">{{ field.help_text }}</span>
- <div class="input">
- {{ field }}
- </div>
- </div>
- {% endfor %}
- {% block modal-footer %}
- <input type="submit" value="{% trans "Create Security Group" %}" />
- {% endblock %}
- </fieldset>
-</form>
-
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_delete_{{ image.id }}" class="form-delete" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="image_id" type="hidden" value="{{ image.id }}" />
- <input id="delete_{{ image.id }}" class="btn small delete" title="Image: {{ image.name }}" type="submit" value="{% trans "Delete" %}" />
-</form>
@@ -1,27 +0,0 @@
-{% load i18n %}
-<form action="{% block form_action %}{% endblock %}" method="post">
- {% csrf_token %}
- <fieldset>
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- {% for field in form.visible_fields %}
- <div class="clearfix{% if field.errors %} error{% endif %}">
- {{ field.label_tag }}
- {% if field.errors %}
- {% for error in field.errors %}
- <span class="help-inline">{{ error }}</span>
- {% endfor %}
- {% endif %}
- <span class="help-block">{{ field.help_text }}</span>
- <div class="input">
- {{ field }}
- </div>
- </div>
- {% endfor %}
- {% block modal-footer %}
- <input type="submit" value="{% trans "Update Image" %}" />
- {% endblock %}
- </fieldset>
-</form>
-
@@ -1,46 +0,0 @@
-{% load parse_date %}
-{% load i18n %}
-
-<table class="zebra-striped">
- <tr>
- <th>{% trans "ID" %}</th>
- <th>{% trans "Name" %}</th>
- <th>{% trans "Size" %}</th>
- <th>{% trans "Public" %}</th>
- <th>{% trans "Created" %}</th>
- <th>{% trans "Updated" %}</th>
- <th colspan="2">{% trans "Status" %}</th>
- </tr>
- {% for image in images %}
- <tr id="images" class="{% cycle 'odd' 'even' %}">
- <td>{{ image.id }}</td>
- <td>{{ image.name }}</td>
- <td>{{ image.size|filesizeformat }}</td>
- <td>{{ image.is_public }}</td>
- <td>{{ image.created_at|parse_date }}</td>
- <td>{{ image.updated_at|parse_date }}</td>
- <td>{{ image.status|capfirst }}</td>
- <td id="actions">
- <ul>
- <li class="form">{% include "syspanel/images/_delete.html" with form=delete_form %}</li>
- {# <li class="form">{% include "syspanel/images/_toggle.html" with form=toggle_form %}</li> #}
- <li><a class="btn small" href="{% url horizon:syspanel:images:update image.id %}">{% trans "Edit" %}</a></li>
- </ul>
- </td>
- </tr>
- <tr class="details">
- <td class="properties" colspan="9">
- <ul>
- <li><span>{% trans "Location" %}: </span>{{ image.properties.image_location }}</li>
- <li><span>{% trans "State" %}: </span>{{ image.properties.image_state }}</li>
- <li><span>{% trans "Kernel ID" %}: </span>{{ image.properties.kernel_id }}</li>
- <li><span>{% trans "Ramdisk ID" %}: </span>{{ image.properties.ramdisk_id }}</li>
- <li><span>{% trans "Architecture" %}: </span>{{ image.properties.architecture }}</li>
- <li><span>{% trans "Project ID" %}: </span>{{ image.properties.project_id }}</li>
- <li><span>{% trans "Container Format" %}: </span>{{ image.container_format }}</li>
- <li><span>{% trans "Disk Format" %}: </span>{{ image.disk_format }}</li>
- </ul>
- </td>
- </tr>
- {% endfor %}
-</table>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_toggle_{{ image.id }}" class="form-toggle" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="image_id" type="hidden" value="{{ image.id }}" />
- <input id="toggle_{{ image.id }}" class="toggle" type="submit" value="{% trans "Toggle Public" %}" />
-</form>
@@ -1,11 +1,25 @@
-{% extends 'syspanel/images/_form.html' %}
+{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
-{% block form_action %}{% url horizon:syspanel:images:update image.id %}{% endblock %}
+{% block form_id %}udate_image_form{% endblock %}
+{% block form_action %}{% url horizon:syspanel:images:update %}{% endblock %}
+
+{% block modal_id %}update_image_modal{% endblock %}
+{% block modal-header %}{% trans "Update Image" %}{% endblock %}
+
+{% block modal-body %}
+<div class="left">
+ <fieldset>
+ {% include "horizon/common/_form_fields.html" %}
+ </fieldset>
+</div>
+<div class="right">
+ <h3>{% trans "Description" %}:</h3>
+ <p>{% trans "From here you can modify different properties of an image." %}</p>
+</div>
+{% endblock %}
{% block modal-footer %}
-<div class="modal-footer">
<input class="btn primary pull-right" type="submit" value="{% trans "Update Image" %}" />
- <a href="#" class="btn secondary cancel close">{% trans "Cancel" %}</a>
-</div>
+ <a href="{% url horizon:syspanel:images:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}
@@ -1,24 +1,12 @@
{% extends 'syspanel/base.html' %}
{% load i18n %}
-{% block title %}Update Image{% endblock %}
+
+{% block title %}{% trans "Update Image" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Update Image") %}
{% endblock page_header %}
{% block syspanel_main %}
- <div class="modal static_page">
- <div class="modal-header">
- <h3>Update Image</h3>
- </div>
- <div class="modal-body">
- <div class="left">
- {% include 'syspanel/images/_update.html' %}
- </div>
- <div class="right">
- <h3>{% trans "Description" %}:</h3>
- <p>{% trans "From here you can modify different properties of an image." %}</p>
- </div>
- </div>
- </div>
+ {% include 'syspanel/images/_update.html' %}
{% endblock %}
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_pause_{{ instance.id }}" class="form-pause form-line" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="pause_{{ instance.id }}" class="btn small pause" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Unpause" %}" />
-</form>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_reboot_{{ instance.id }}" class="form-reboot" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="reboot_{{ instance.id }}" class="btn small reboot" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Reboot" %}" />
-</form>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_resume_{{ instance.id }}" class="form-resume form-inline" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="resume_{{ instance.id }}" class="btn small resume" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Resume" %}" />
-</form>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_suspend_{{ instance.id }}" class="form-suspend" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="suspend_{{ instance.id }}" class="suspend" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Suspend" %}" />
-</form>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_terminate_{{ instance.id }}" class="form-terminate" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="terminate_{{instance.id}}" class="btn small danger terminate" title="{{ instance.name }}" type="submit" value="{% trans "Terminate" %}" />
-</form>
@@ -1,9 +0,0 @@
-{% load i18n %}
-<form id="form_unpause_{{ instance.id }}" class="form-unpause form-line" method="post">
- {% csrf_token %}
- {% for hidden in form.hidden_fields %}
- {{ hidden }}
- {% endfor %}
- <input name="instance" type="hidden" value="{{ instance.id }}" />
- <input id="unpause_{{ instance.id }}" class="btn small unpause" title="Instance: {{ instance.name }}" type="submit" value="{% trans "Unpause" %}" />
-</form>
@@ -1,26 +0,0 @@
-{% load i18n sizeformat %}
-
-{% if service.type == 'nova-compute' %}
-<ul>
- <li>
- {% trans "Hypervisor" %}: {{ service.stats.hypervisor_type }}( {{ service.stats.cpu_info.features|join:', ' }})
- </li>
- <li>
- {% trans "Allocable Cores" %}:
- {{ service.stats.max_vcpus }}
- ({{ service.stats.vcpus_used }} Used, {{ service.stats.vcpus }} Physical/Virtual)
- </li>
- <li>
- {% trans "Allocable Storage" %}:
- {{ service.stats.max_gigabytes|diskgbformat }}
- ({{ service.stats.local_gb_used|diskgbformat }} Used, {{ service.stats.local_gb|diskgbformat }} Physical)
- </li>
- <li>
- {% trans "System Ram" %}:
- {{ service.stats.memory_mb|mbformat }}
- ({{ service.stats.memory_mb_used|mbformat }} Used)
- </li>
-</ul>
-{% else %}
-<span>&nbsp;-&nbsp;</span>
-{% endif %}
Oops, something went wrong.

0 comments on commit 797c497

Please sign in to comment.