Update Horizon for Django 1.5 compatibility

Changes made:
- Changed template url tags: {% url myview %} to {% url myview %}
- Import json instead of django.utils.simplejson
- Import django.utils.encoding.force_unicode instead of
  django.utils.translation.force_unicode
- Fixed error in tables/base.py for CheckboxInput, pass a callable
  check_test. Django 1.5 does not silently fail on this now.
- Set SECRET_KEY in test/settingspy, Django 1.5 refuse to start if it
  is not set.
- Added notes about ALLOWED_HOSTS when running Horizon in Production

Fixes bug 1147329

Change-Id: I6ac1e81498f41141dea99760922991feb310a326
This commit is contained in:
Lin Hua Cheng 2013-03-27 17:16:13 -07:00
parent 9cdee05678
commit 5d32caf3af
66 changed files with 190 additions and 121 deletions

View File

@ -451,7 +451,7 @@ class Row(html.HTMLElement):
cells = []
for column in table.columns.values():
if column.auto == "multi_select":
widget = forms.CheckboxInput(check_test=False)
widget = forms.CheckboxInput(check_test=lambda value: False)
# Convert value to string to avoid accidental type conversion
data = widget.render('object_ids',
unicode(table.get_object_id(datum)))

View File

@ -1,8 +1,9 @@
{% load i18n %}
{% load url from future %}
<div id="user_info" class="pull-right">
<span>{% trans "Logged in as" %}: {{ request.user.username }}</span>
{% if HORIZON_CONFIG.help_url %}
<a href="{{ HORIZON_CONFIG.help_url }}" target="_new">{% trans "Help" %}</a>
{% endif %}
<a href="{% url logout %}">{% trans "Sign Out" %}</a>
<a href="{% url 'logout' %}">{% trans "Sign Out" %}</a>
</div>

View File

@ -1,10 +1,11 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block modal-header %}{% trans "Log In" %}{% endblock %}
{% block modal_class %}login {% if hide %}modal hide{% endif %}{% endblock %}
{% block form_action %}{% url login %}{% endblock %}
{% block form_action %}{% url 'login' %}{% endblock %}
{% block autocomplete %}{{ HORIZON_CONFIG.password_autocomplete }}{% endblock %}
{% block modal-body %}
@ -14,7 +15,7 @@
<span class="help-inline"><p>{% trans "You don't have permissions to access:" %}</p>
<p><b>{{ request.GET.next }}</b></p>
<p>{% trans "Login as different user or go back to" %}
<a href="{% url horizon:user_home %}">{% trans "home page" %}</a></p>
<a href="{% url 'horizon:user_home' %}">{% trans "home page" %}</a></p>
</span>
</div>
{% endif %}

View File

@ -1,7 +1,8 @@
{% load compress %}
{% load url from future %}
{% comment %} Django's JavaScript i18n Implementation {% endcomment %}
<script type="text/javascript" src="{% url horizon:jsi18n 'horizon' %}"></script>
<script type="text/javascript" src="{% url 'horizon:jsi18n' 'horizon' %}"></script>
{% comment %} Compress jQuery, Plugins, Bootstrap, Hogan.js and Horizon-specific JS. {% endcomment %}
{% compress js %}

View File

@ -3,12 +3,12 @@
{% with subfolders=breadcrumb.get_subfolders %}
<ul class="breadcrumb">
<li>
Folder Path: <a href="{% url breadcrumb.url breadcrumb.root|add:'/' %}">{{ breadcrumb.root }}</a> <span class="divider">/</span>
Folder Path: <a href="{% url 'breadcrumb.url' breadcrumb.root|add:'/' %}">{{ breadcrumb.root }}</a> <span class="divider">/</span>
</li>
{% for subfolder, path in subfolders %}
<li>
{% if not forloop.last %}
<a href="{% url breadcrumb.url breadcrumb.root|add:'/' path %}">
<a href="{% url 'breadcrumb.url' breadcrumb.root|add:'/' path %}">
{% endif %}
{{ subfolder }}
{% if not forloop.last %}

View File

@ -1,3 +1,4 @@
{% load url from future %}
{% if regions.support %}
<div id="region_switcher" class="dropdown switcher_bar" tabindex='1'>
<a class="dropdown-toggle" data-toggle="dropdown" href="#region_switcher">
@ -7,7 +8,7 @@
<li class='divider'></li>
{% for region in regions.available %}
{% if region.name != regions.current.name %}
<li><a class="ajax-modal" href="{% url login %}?region={{ region.endpoint|urlencode }}">{{ region.name }}</a></li>
<li><a class="ajax-modal" href="{% url 'login' %}?region={{ region.endpoint|urlencode }}">{{ region.name }}</a></li>
{% endif %}
{% endfor %}
</ul>

View File

@ -1,7 +1,8 @@
{% load branding horizon i18n %}
{% load url from future %}
<div class='sidebar'>
<h1 class="brand clearfix"><a href="{% url horizon:user_home %}">{% site_branding %}</a></h1>
<h1 class="brand clearfix"><a href="{% url 'horizon:user_home' %}">{% site_branding %}</a></h1>
{% horizon_main_nav %}
@ -22,7 +23,7 @@
<li class='divider'></li>
{% for tenant in authorized_tenants %}
{% if tenant.enabled and tenant.id != request.user.tenant_id %}
<li><a href="{% url switch_tenants tenant.id %}?next={{ request.horizon.dashboard.get_absolute_url }}">{{ tenant.name }}</a></li>
<li><a href="{% url 'switch_tenants' tenant.id %}?next={{ request.horizon.dashboard.get_absolute_url }}">{{ tenant.name }}</a></li>
{% endif %}
{% endfor %}
</ul>

View File

@ -35,6 +35,8 @@ DEBUG = False
TEMPLATE_DEBUG = DEBUG
TESTSERVER = 'http://testserver'
SECRET_KEY = 'elj1IWiLoWHgcyYxFVLj7cM5rGOOxWl0'
USE_I18N = True
USE_L10N = True
USE_TZ = True

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_flavor_form{% endblock %}
{% block form_action %}{% url horizon:admin:flavors:create %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:flavors:create' %}{% endblock %}
{% block modal_id %}create_flavor_modal{% endblock %}
{% block modal-header %}{% trans "Create Flavor" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Flavor" %}" />
<a href="{% url horizon:admin:flavors:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:flavors:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}edit_flavor_form{% endblock %}
{% block form_action %}{% url horizon:admin:flavors:edit flavor_id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:flavors:edit' flavor_id %}{% endblock %}
{% block modal_id %}edit_flavor_modal{% endblock %}
{% block modal-header %}{% trans "Edit Flavor" %}{% endblock %}
@ -22,5 +23,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save" %}" />
<a href="{% url horizon:admin:flavors:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:flavors:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}extra_spec_create_form{% endblock %}
{% block form_action %}{% url horizon:admin:flavors:extras:create flavor.id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:flavors:extras:create' flavor.id %}{% endblock %}
{% block modal_id %}extra_spec_create_modal{% endblock %}
@ -22,6 +23,6 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create" %}" />
<a href="{% url horizon:admin:flavors:extras:index flavor.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:flavors:extras:index' flavor.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}extra_spec_edit_form{% endblock %}
{% block form_action %}{% url horizon:admin:flavors:extras:create flavor.id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:flavors:extras:create' flavor.id %}{% endblock %}
{% block modal_id %}extra_spec_edit_modal{% endblock %}
@ -22,6 +23,6 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save" %}" />
<a href="{% url horizon:admin:flavors:extras:index flavor.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:flavors:extras:index' flavor.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,5 +1,6 @@
{% extends "horizon/common/_modal.html" %}
{% load i18n %}
{% load url from future %}
{% block modal_id %}extra_specs_modal{% endblock %}
{% block modal-header %}{% trans "Flavor Extra Specs" %}{% endblock %}
@ -9,6 +10,6 @@
{% endblock %}
{% block modal-footer %}
<a href="{% url horizon:admin:flavors:index %}" class="btn secondary cancel close">{% trans "Close" %}</a>
<a href="{% url 'horizon:admin:flavors:index' %}" class="btn secondary cancel close">{% trans "Close" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_image_form{% endblock %}
{% block form_action %}{% url horizon:admin:images:create %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:images:create' %}{% endblock %}
{% block form_attrs %}enctype="multipart/form-data"{% endblock %}
{% block modal-header %}{% trans "Create An Image" %}{% endblock %}
@ -30,5 +31,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Image" %}" />
<a href="{% url horizon:admin:images:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:images:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_image_form{% endblock %}
{% block form_action %}{% url horizon:admin:images:update image.id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:images:update' image.id %}{% endblock %}
{% block modal_id %}update_image_modal{% endblock %}
{% block modal-header %}{% trans "Update Image" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Image" %}" />
<a href="{% url horizon:admin:images:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:images:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_network_form{% endblock %}
{% block form_action %}{% url horizon:admin:networks:create %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:networks:create' %}{% endblock %}
{% block modal_id %}create_network_modal{% endblock %}
{% block modal-header %}{% trans "Create Network" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Network" %}" />
<a href="{% url horizon:admin:networks:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:networks:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_network_form{% endblock %}
{% block form_action %}{% url horizon:admin:networks:update network_id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:networks:update' network_id %}{% endblock %}
{% block modal-header %}{% trans "Edit Network" %}{% endblock %}
@ -20,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url horizon:admin:networks:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:networks:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_port_form{% endblock %}
{% block form_action %}{% url horizon:admin:networks:addport network.id %}
{% block form_action %}{% url 'horizon:admin:networks:addport' network.id %}
{% endblock %}
{% block modal-header %}{% trans "Create Port" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Port" %}" />
<a href="{% url horizon:admin:networks:detail network.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:networks:detail' network.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_port_form{% endblock %}
{% block form_action %}{% url horizon:admin:networks:editport network_id port_id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:networks:editport' network_id port_id %}{% endblock %}
{% block modal-header %}{% trans "Edit Port" %}{% endblock %}
@ -25,5 +26,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url horizon:admin:networks:detail network_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:networks:detail' network_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}add_user_form{% endblock %}
{% block form_action %}{% url horizon:admin:projects:add_user tenant_id user_id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:projects:add_user' tenant_id user_id %}{% endblock %}
{% block modal_id %}add_user_modal{% endblock %}
{% block modal-header %}{% trans "Add User To Project" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Add" %}" />
<a href="{% url horizon:admin:projects:users tenant_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:projects:users' tenant_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_tenant_form{% endblock %}
{% block form_action %}{% url horizon:admin:projects:create %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:projects:create' %}{% endblock %}
{% block modal_id %}create_tenant_modal{% endblock %}
{% block modal-header %}{% trans "Create Project" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Project" %}" />
<a href="{% url horizon:admin:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:projects:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_user_form{% endblock %}
{% block form_action %}{% url horizon:admin:projects:create_user tenant_id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:projects:create_user' tenant_id %}{% endblock %}
{% block modal-header %}{% blocktrans %}Create User for project '{{ tenant_name }}'.{% endblocktrans %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create User" %}" />
<a href="{% url horizon:admin:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:projects:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}quota_update_form{% endblock %}
{% block form_action %}{% url horizon:admin:projects:quotas tenant.id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:projects:quotas' tenant.id %}{% endblock %}
{% block modal-header %}{% trans "Update Quota" %}{% endblock %}
@ -20,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Quota" %}" />
<a href="{% url horizon:admin:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:projects:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}{% endblock %}
{% block form_action %}{% url horizon:admin:projects:update tenant.id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:projects:update' tenant.id %}{% endblock %}
{% block modal_id %}update_tenant_modal{% endblock %}
{% block modal-header %}{% trans "Update Project" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Project" %}" />
<a href="{% url horizon:admin:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:projects:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -21,7 +21,8 @@
import logging
from django.forms import ValidationError
from django.utils.translation import force_unicode, ugettext_lazy as _
from django.utils.encoding import force_unicode
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.debug import sensitive_variables
from horizon import exceptions

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_user_form{% endblock %}
{% block form_action %}{% url horizon:admin:users:create %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:users:create' %}{% endblock %}
{% block modal-header %}{% trans "Create User" %}{% endblock %}
@ -30,5 +31,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create User" %}" />
<a href="{% url horizon:admin:users:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:users:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_user_form{% endblock %}
{% block form_action %}{% url horizon:admin:users:update user.id %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:users:update' user.id %}{% endblock %}
{% block modal-header %}{% trans "Update User" %}{% endblock %}
@ -30,5 +31,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update User" %}" />
<a href="{% url horizon:admin:users:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:users:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}{% endblock %}
{% block form_action %}{% url horizon:admin:volumes:create_type %}{% endblock %}
{% block form_action %}{% url 'horizon:admin:volumes:create_type' %}{% endblock %}
{% block modal_id %}create_volume_type_modal{% endblock %}
{% block modal-header %}{% trans "Create Volume Type" %}{% endblock %}
@ -25,5 +26,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Volume Type" %}" />
<a href="{% url horizon:admin:volumes:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:admin:volumes:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,9 +1,10 @@
{% extends "horizon/common/_modal_form.html" %}
{% load horizon i18n %}
{% load url from future %}
{% block form_id %}associate_floating_ip_form{% endblock %}
{% block form_action %}{% url horizon:project:access_and_security:floating_ips:allocate %}{% endblock %}
{% block form_action %}{% url 'horizon:project:access_and_security:floating_ips:allocate' %}{% endblock %}
{% block modal-header %}{% trans "Allocate Floating IP" %}{% endblock %}
@ -29,5 +30,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right {% if usages.floating_ips.used >= usages.floating_ips.quota %}disabled" type="button"{% else %}" type="submit"{% endif %} value="{% trans "Allocate IP" %}" />
<a href="{% url horizon:project:access_and_security:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_keypair_form{% endblock %}
{% block form_action %}{% url horizon:project:access_and_security:keypairs:create %}{% endblock %}
{% block form_action %}{% url 'horizon:project:access_and_security:keypairs:create' %}{% endblock %}
{% block modal-header %}{% trans "Create Keypair" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Keypair" %}" />
<a href="{% url horizon:project:access_and_security:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}import_keypair_form{% endblock %}
{% block form_action %}{% url horizon:project:access_and_security:keypairs:import %}{% endblock %}
{% block form_action %}{% url 'horizon:project:access_and_security:keypairs:import' %}{% endblock %}
{% block modal-header %}{% trans "Import Keypair" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Import Keypair" %}" />
<a href="{% url horizon:project:access_and_security:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% blocktrans %}Download Keypair{% endblocktrans %}{% endblock %}
{% block page_header %}
@ -11,11 +12,11 @@
<h3>{% blocktrans %}The keypair &quot;{{ keypair_name }}&quot; should download automatically. If not use the link below.{% endblocktrans %}</h3>
</div>
<div class="modal-body clearfix">
<a href="{% url horizon:project:access_and_security:keypairs:generate keypair_name %}">
<a href="{% url 'horizon:project:access_and_security:keypairs:generate' keypair_name %}">
{% blocktrans %}Download keypair &quot;{{ keypair_name}}&quot;{% endblocktrans %}
</a>
</div>
<script type="text/javascript" charset="utf-8">
document.location = '{% url horizon:project:access_and_security:keypairs:generate keypair_name %}';
document.location = '{% url 'horizon:project:access_and_security:keypairs:generate' keypair_name %}';
</script>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_security_group_rule_form{% endblock %}
{% block form_action %}{% url horizon:project:access_and_security:security_groups:add_rule security_group_id %}{% endblock %}
{% block form_action %}{% url 'horizon:project:access_and_security:security_groups:add_rule' security_group_id %}{% endblock %}
{% block modal-header %}{% trans "Add Rule" %}{% endblock %}
{% block modal_id %}create_security_group_rule_modal{% endblock %}
@ -24,5 +25,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Add" %}" />
<a href="{% url horizon:project:access_and_security:security_groups:detail security_group_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:security_groups:detail' security_group_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_security_group_form{% endblock %}
{% block form_action %}{% url horizon:project:access_and_security:security_groups:create %}{% endblock %}
{% block form_action %}{% url 'horizon:project:access_and_security:security_groups:create' %}{% endblock %}
{% block modal-header %}{% trans "Create Security Group" %}{% endblock %}
{% block modal_id %}create_security_group_modal{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Security Group" %}" />
<a href="{% url horizon:project:access_and_security:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:access_and_security:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}copy_object_form{% endblock %}
{% block form_action %}{% url horizon:project:containers:object_copy container_name object_name %}{% endblock %}
{% block form_action %}{% url 'horizon:project:containers:object_copy' container_name object_name %}{% endblock %}
{% block modal-header %}{% trans "Copy Object" %}: {{ object_name }}{% endblock %}
@ -20,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Copy Object" %}" />
<a href="{% url horizon:project:containers:index container_name|add:'/' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_container_form{% endblock %}
{% block form_action %}{% url horizon:project:containers:create %}{% endblock %}
{% block form_action %}{% url 'horizon:project:containers:create' %}{% endblock %}
{% block modal-header %}{% trans "Create Container" %}{% endblock %}
@ -20,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Container" %}" />
<a href="{% url horizon:project:containers:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}upload_object_form{% endblock %}
{% block form_action %}{% url horizon:project:containers:object_upload container_name %}{% endblock %}
{% block form_action %}{% url 'horizon:project:containers:object_upload' container_name %}{% endblock %}
{% block form_attrs %}enctype="multipart/form-data"{% endblock %}
{% block modal-header %}{% trans "Upload Object To Container" %}: {{ container_name }}{% endblock %}
@ -22,5 +23,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Upload Object" %}" />
<a href="{% url horizon:project:containers:index container_name|add:'/' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:containers:index' container_name|add:'/' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -84,8 +84,8 @@ class ImageViewTests(test.TestCase):
'disk_format': u'qcow2',
'minimum_disk': 15,
'minimum_ram': 512,
'is_public': 1,
'protected': 0,
'is_public': True,
'protected': False,
'method': 'CreateImageForm'}
api.glance.image_create(IsA(http.HttpRequest),
@ -118,8 +118,8 @@ class ImageViewTests(test.TestCase):
'disk_format': u'qcow2',
'minimum_disk': 15,
'minimum_ram': 512,
'is_public': 1,
'protected': 0,
'is_public': True,
'protected': False,
'method': 'CreateImageForm'}
api.glance.image_create(IsA(http.HttpRequest),

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_image_form{% endblock %}
{% block form_action %}{% url horizon:project:images_and_snapshots:images:create %}{% endblock %}
{% block form_action %}{% url 'horizon:project:images_and_snapshots:images:create' %}{% endblock %}
{% block form_attrs %}enctype="multipart/form-data"{% endblock %}
{% block modal-header %}{% trans "Create An Image" %}{% endblock %}
@ -30,5 +31,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Image" %}" />
<a href="{% url horizon:project:images_and_snapshots:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:images_and_snapshots:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_image_form{% endblock %}
{% block form_action %}{% url horizon:project:images_and_snapshots:images:update image.id %}{% endblock %}
{% block form_action %}{% url 'horizon:project:images_and_snapshots:images:update' image.id %}{% endblock %}
{% block modal-header %}{% trans "Update Image" %}{% endblock %}
@ -20,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Image" %}" />
<a href="{% url horizon:project:images_and_snapshots:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:images_and_snapshots:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_snapshot_form{% endblock %}
{% block form_action %}{% url horizon:project:images_and_snapshots:snapshots:create instance.id %}{% endblock %}
{% block form_action %}{% url 'horizon:project:images_and_snapshots:snapshots:create' instance.id %}{% endblock %}
{% block modal_id %}create_snapshot_modal{% endblock %}
{% block modal-header %}{% trans "Create Snapshot" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Snapshot" %}" />
<a href="{% url horizon:project:images_and_snapshots:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:images_and_snapshots:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,4 +1,5 @@
{% load i18n %}
{% load url from future %}
<h3>{% trans "Instance Console" %}</h3>
{% if console_url %}
@ -17,5 +18,5 @@
</script>
{% else %}
<p class='alert alert-error'>{% blocktrans %}console is currently unavailable. Please try again later.{% endblocktrans %}
<a class='btn btn-mini' href="{% url horizon:project:instances:detail instance_id %}">{% trans "Reload" %}</a></p>
<a class='btn btn-mini' href="{% url 'horizon:project:instances:detail' instance_id %}">{% trans "Reload" %}</a></p>
{% endif %}

View File

@ -1,13 +1,14 @@
{% load i18n %}
{% load url from future %}
<div class="clearfix">
<h3 class="pull-left">{% trans "Instance Console Log" %}</h3>
<form id="tail_length" action="{% url horizon:project:instances:console instance.id %}" class="form-inline pull-right">
<form id="tail_length" action="{% url 'horizon:project:instances:console' instance.id %}" class="form-inline pull-right">
<label for="tail_length_select">{% trans "Log Length" %}</label>
<input class="span1" type="text" name="length" value="35" />
<button class="btn btn-small btn-primary" type="submit">{% trans "Go" %}</button>
{% url horizon:project:instances:console instance.id as console_url %}
{% url 'horizon:project:instances:console' instance.id as console_url %}
<a class="btn btn-small" target="_blank" href="{{ console_url }}">{% trans "View Full Log" %}</a>
</form>
</div>

View File

@ -1,4 +1,5 @@
{% load i18n sizeformat %}
{% load url from future %}
<h3>{% trans "Instance Overview" %}</h3>
@ -76,7 +77,7 @@
{% with default_key_name="<em>"|add:_("None")|add:"</em>" %}
<dd>{{ instance.key_name|default:default_key_name }}</dd>
{% endwith %}
{% url horizon:project:images_and_snapshots:images:detail instance.image.id as image_url %}
{% url 'horizon:project:images_and_snapshots:images:detail' instance.image.id as image_url %}
<dt>{% trans "Image Name" %}</dt>
<dd><a href="{{ image_url }}">{{ instance.image_name }}</a></dd>
{% with default_item_value="<em>"|add:_("N/A")|add:"</em>" %}
@ -95,7 +96,7 @@
{% for volume in instance.volumes %}
<dt>{% trans "Attached To" %}</dt>
<dd>
<a href="{% url horizon:project:volumes:detail volume.volumeId %}">{{ volume.name }}</a><span> {% trans "on" %} {{ volume.device }}</span>
<a href="{% url 'horizon:project:volumes:detail' volume.volumeId %}">{{ volume.name }}</a><span> {% trans "on" %} {{ volume.device }}</span>
</dd>
{% empty %}
<dt>{% trans "Volume" %}</dt>

View File

@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans "Network Topology" %}{% endblock %}
{% block page_header %}
@ -23,14 +24,14 @@ div.network .device:hover div.port {
{% trans "This pane needs javascript support." %}
</noscript>
<div class="launchButtons">
<a href="{% url horizon:project:instances:launch %}" id="instances__action_launch" class="btn btn-small btn-launch ajax-modal">{%trans "Launch Instance" %}</a>
<a href="{% url horizon:project:networks:create %}" id="networks__action_create" class="btn btn-small ajax-modal btn-create">{%trans "Create Network" %}</a>
<a href="{% url horizon:project:routers:create %}" id="Routers__action_create" class="btn btn-small ajax-modal btn-create">{%trans "Create Router" %}</a>
<a href="{% url 'horizon:project:instances:launch' %}" id="instances__action_launch" class="btn btn-small btn-launch ajax-modal">{%trans "Launch Instance" %}</a>
<a href="{% url 'horizon:project:networks:create' %}" id="networks__action_create" class="btn btn-small ajax-modal btn-create">{%trans "Create Network" %}</a>
<a href="{% url 'horizon:project:routers:create' %}" id="Routers__action_create" class="btn btn-small ajax-modal btn-create">{%trans "Create Router" %}</a>
</div>
<div id="topologyCanvas">
<div class="networks"></div>
<div class="nodata">{% blocktrans %}There are no networks, routers, or connected instances to display. {% endblocktrans %}</div>
</div>
<span data-networktopology="{% url horizon:project:network_topology:json %}" id="networktopology"></span>
<span data-networktopology="{% url 'horizon:project:network_topology:json' %}" id="networktopology"></span>
{% endblock %}

View File

@ -18,9 +18,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.utils import simplejson
from django.views.generic import TemplateView
from django.views.generic import View
@ -95,5 +96,5 @@ class JSONView(View):
self.add_resource_url('horizon:project:routers:detail',
data['routers'])
json_string = simplejson.dumps(data, ensure_ascii=False)
json_string = json.dumps(data, ensure_ascii=False)
return HttpResponse(json_string, mimetype='text/json')

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}create_network_form{% endblock %}
{% block form_action %}{% url horizon:project:networks:create %}{% endblock %}
{% block form_action %}{% url 'horizon:project:networks:create' %}{% endblock %}
{% block modal-header %}{% trans "Create Network" %}{% endblock %}
@ -20,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Network" %}" />
<a href="{% url horizon:project:networks:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:networks:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_network_form{% endblock %}
{% block form_action %}{% url horizon:project:networks:update network_id %}{% endblock %}
{% block form_action %}{% url 'horizon:project:networks:update' network_id %}{% endblock %}
{% block modal-header %}{% trans "Edit Network" %}{% endblock %}
@ -20,5 +21,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url horizon:project:networks:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:networks:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,4 +1,5 @@
{% load i18n sizeformat %}
{% load url from future %}
<h3>{% trans "Port Overview" %}</h3>
@ -10,7 +11,7 @@
<dd>{{ port.name|default:_("None") }}</dd>
<dt>{% trans "ID" %}</dt>
<dd>{{ port.id|default:_("None") }}</dd>
{% url horizon:project:networks:detail port.network_id as network_url %}
{% url 'horizon:project:networks:detail' port.network_id as network_url %}
<dt>{% trans "Network ID" %}</dt>
<dd><a href="{{ network_url }}">{{ port.network_id|default:_("None") }}</a></dd>
<dt>{% trans "Project ID" %}</dt>

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}update_port_form{% endblock %}
{% block form_action %}{% url horizon:project:networks:editport network_id port_id %}{% endblock %}
{% block form_action %}{% url 'horizon:project:networks:editport' network_id port_id %}{% endblock %}
{% block modal-header %}{% trans "Edit Port" %}{% endblock %}
@ -25,5 +26,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url horizon:project:networks:detail network_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:networks:detail' network_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,4 +1,5 @@
{% load i18n sizeformat %}
{% load url from future %}
<h3>{% trans "Subnet Overview" %}</h3>
@ -10,7 +11,7 @@
<dd>{{ subnet.name|default:_("None") }}</dd>
<dt>{% trans "ID" %}</dt>
<dd>{{ subnet.id|default:_("None") }}</dd>
{% url horizon:project:networks:detail subnet.network_id as network_url %}
{% url 'horizon:project:networks:detail' subnet.network_id as network_url %}
<dt>{% trans "Network ID" %}</dt>
<dd><a href="{{ network_url }}">{{ subnet.network_id|default:_("None") }}</a></dd>
<dt>{% trans "IP version" %}</dt>

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n horizon humanize %}
{% load url from future %}
{% block form_id %}{% endblock %}
{% block form_action %}{% url horizon:project:routers:create %}?{{ request.GET.urlencode }}{% endblock %}
{% block form_action %}{% url 'horizon:project:routers:create' %}?{{ request.GET.urlencode }}{% endblock %}
{% block modal_id %}create_router_modal{% endblock %}
{% block modal-header %}{% trans "Create router" %}{% endblock %}
@ -17,5 +18,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create router" %}" />
<a href="{% url horizon:project:routers:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:routers:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}add_interface_form{% endblock %}
{% block form_action %}{% url horizon:project:routers:addinterface router.id %}
{% block form_action %}{% url 'horizon:project:routers:addinterface' router.id %}
{% endblock %}
{% block modal-header %}{% trans "Add Interface" %}{% endblock %}
@ -26,5 +27,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Add interface" %}" />
<a href="{% url horizon:project:routers:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:routers:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}setgateway_form{% endblock %}
{% block form_action %}{% url horizon:project:routers:setgateway router.id %}
{% block form_action %}{% url 'horizon:project:routers:setgateway' router.id %}
{% endblock %}
{% block modal-header %}{% trans "Set Gateway" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Set Gateway" %}" />
<a href="{% url horizon:project:routers:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:routers:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}attach_volume_form{% endblock %}
{% block form_action %}{% url horizon:project:volumes:attach volume.id %}{% endblock %}
{% block form_action %}{% url 'horizon:project:volumes:attach' volume.id %}{% endblock %}
{% block form_class %}{{ block.super }} horizontal {% if show_attach %}split_half{% else %} no_split{% endif %}{% endblock %}
{% block modal_id %}attach_volume_modal{% endblock %}
@ -21,5 +22,5 @@
{% if show_attach %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Attach Volume" %}" />
{% endif %}
<a href="{% url horizon:project:volumes:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:volumes:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n horizon humanize %}
{% load url from future %}
{% block form_id %}{% endblock %}
{% block form_action %}{% url horizon:project:volumes:create %}?{{ request.GET.urlencode }}{% endblock %}
{% block form_action %}{% url 'horizon:project:volumes:create' %}?{{ request.GET.urlencode }}{% endblock %}
{% block modal_id %}create_volume_modal{% endblock %}
{% block modal-header %}{% trans "Create Volume" %}{% endblock %}
@ -53,5 +54,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Volume" %}" />
<a href="{% url horizon:project:volumes:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:volumes:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}{% endblock %}
{% block form_action %}{% url horizon:project:volumes:create_snapshot volume_id %}{% endblock %}
{% block form_action %}{% url 'horizon:project:volumes:create_snapshot' volume_id %}{% endblock %}
{% block modal_id %}create_volume_snapshot_modal{% endblock %}
{% block modal-header %}{% trans "Create Volume Snapshot" %}{% endblock %}
@ -21,5 +22,5 @@
{% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Volume Snapshot" %}" />
<a href="{% url horizon:project:volumes:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
<a href="{% url 'horizon:project:volumes:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %}

View File

@ -1,4 +1,5 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<h3>{% trans "Volume Overview" %}: {{volume.display_name }}</h3>
@ -37,7 +38,7 @@
{% for attachment in volume.attachments %}
<dt>{% trans "Attached To" %}</dt>
<dd>
{% url horizon:project:instances:detail attachment.server_id as instance_url%}
{% url 'horizon:project:instances:detail' attachment.server_id as instance_url%}
<a href="{{ instance_url }}">{{ attachment.instance.name }}</a>
<span> {% trans "on" %} {{ attachment.device }}</span>
</dd>

View File

@ -1,8 +1,9 @@
{% extends "horizon/common/_modal_form.html" %}
{% load i18n %}
{% load url from future %}
{% block form_id %}user_settings_modal{% endblock %}
{% block form_action %}{% url horizon:settings:user:index %}{% endblock %}
{% block form_action %}{% url 'horizon:settings:user:index' %}{% endblock %}
{% block modal_id %}user_settings_modal{% endblock %}
{% block modal-header %}{% trans "User Settings" %}{% endblock %}
@ -21,6 +22,6 @@
{% block modal-footer %}
<button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
{% if hide %}<a href="{% url horizon:settings:user:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
{% if hide %}<a href="{% url 'horizon:settings:user:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
{% endblock %}

View File

@ -7,6 +7,13 @@ from openstack_dashboard import exceptions
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# Required for Django 1.5.
# If horizon is running in production (DEBUG is False), set this
# with the list of host/domain names that the application can serve.
# For more information see:
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
#ALLOWED_HOSTS = ['horizon.example.com', ]
# Set SSL proxy settings:
# For Django 1.4+ pass this header from the proxy after terminating the SSL,
# and don't forget to strip it from the client's request.
@ -60,8 +67,8 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
# behind a load-balancer). Either you have to make sure that a session gets all
# requests routed to the same dashboard instance or you set the same SECRET_KEY
# for all of them.
# from horizon.utils import secret_key
# SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
from horizon.utils import secret_key
SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
# We recommend you use memcached for development; otherwise after every reload
# of the django development server, you will have to login again. To use

View File

@ -1,5 +1,6 @@
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}
{% block title %} - {% trans "Forbidden" %}{% endblock %}
@ -17,11 +18,11 @@
<div id="sidebar">
<ul id="navigation">
{% block nav_home %}
<li><h3><a href="{% url index %}">{% trans "Home" %}</a></h3></li>
<li><h3><a href="{% url 'index' %}">{% trans "Home" %}</a></h3></li>
{% endblock %}
{% block nav_projects %}
<li><h3><a href="{% url index %}">{% trans "Projects" %}</a></h3></li>
<li><h3><a href="{% url 'index' %}">{% trans "Projects" %}</a></h3></li>
{% endblock %}
</ul>
</div> <!-- end sidebar -->

View File

@ -1,5 +1,6 @@
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}
{% block title %} - {% trans "Page Not Found" %}{% endblock %}
@ -16,11 +17,11 @@
<div id="sidebar">
<ul id="navigation">
{% block nav_home %}
<li><h3><a href="{% url index %}">{% trans "Home" %}</a></h3></li>
<li><h3><a href="{% url 'index' %}">{% trans "Home" %}</a></h3></li>
{% endblock %}
{% block nav_projects %}
<li><h3><a href="{% url index %}">{% trans "Projects" %}</a></h3></li>
<li><h3><a href="{% url 'index' %}">{% trans "Projects" %}</a></h3></li>
{% endblock %}
</ul>
</div> <!-- end sidebar -->

View File

@ -1,10 +1,11 @@
{% load i18n %}
{% load url from future %}
<div id="user_info" class="pull-right">
<span>{% trans "Logged in as" %}: {{ request.user.username }}</span>
<a href="{% url horizon:settings:user:index %}">{% trans "Settings" %}</a>
<a href="{% url 'horizon:settings:user:index' %}">{% trans "Settings" %}</a>
{% if HORIZON_CONFIG.help_url %}
<a href="{{ HORIZON_CONFIG.help_url }}" target="_new">{% trans "Help" %}</a>
{% endif %}
<a href="{% url logout %}">{% trans "Sign Out" %}</a>
<a href="{% url 'logout' %}">{% trans "Sign Out" %}</a>
{% include "horizon/common/_region_selector.html" %}
</div>

View File

@ -23,6 +23,8 @@ TEMPLATE_CONTEXT_PROCESSORS += (
)
INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.staticfiles',
'django.contrib.messages',

View File

@ -6,7 +6,7 @@ set -o errexit
# Increment me any time the environment should be rebuilt.
# This includes dependncy changes, directory renames, etc.
# Simple integer secuence: 1, 2, 3...
environment_version=31
environment_version=32
#--------------------------------------------------------#
function usage {

View File

@ -2,9 +2,9 @@ d2to1>=0.2.10,<0.3
pbr>=0.5,<0.6
# Horizon Core Requirements
Django>=1.4,<1.5
Django>=1.4,<1.6
django_compressor
django_openstack_auth>=1.0.7
django_openstack_auth>=1.0.8
netaddr
python-cinderclient>=1.0.2,<2.0.0
python-glanceclient<2