Cleanups
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
{% for field in form.visible_fields %}
|
||||
<div class="group">
|
||||
{% if field.errors %}<div class="fieldWithErrors">{% endif %}
|
||||
<label class="label">{{ field.label_tag }}{% if field.field.required and not read_only %} ({% trans 'required' %}){% endif %}</label>
|
||||
<label class="label">{{ field.label_tag }}{% if field.field.required and not read_only %} ({% trans "required" %}){% endif %}</label>
|
||||
{% if field.errors %}<span class="error">{% for error in field.errors %}{{ error }}{% if not forloop.last %} | {% endif %}{% endfor %}</span></div>{% endif %}
|
||||
{{ field }}
|
||||
{% if field.help_text %}<span class="description">{{ field.help_text }}</span>{% endif %}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
|
||||
{% endif %}
|
||||
|
||||
{% if submit_method != 'GET' and submit_method != 'get' %}
|
||||
{% if submit_method != "GET" and submit_method != "get" %}
|
||||
{% csrf_token %}
|
||||
{% endif %}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<tr>
|
||||
{% for field in formset.forms.0.visible_fields %}
|
||||
<th>
|
||||
{{ field.label_tag }}{% if field.field.required and not read_only %} ({% trans 'required' %}){% endif %}
|
||||
{{ field.label_tag }}{% if field.field.required and not read_only %} ({% trans "required" %}){% endif %}
|
||||
</th>
|
||||
{#{% if field.help_text %}<span class="description">{{ field.help_text }}</span>{% endif %}#}
|
||||
{% endfor %}
|
||||
@@ -67,7 +67,7 @@
|
||||
{% if not read_only %}
|
||||
<div class="group navform wat-cf">
|
||||
<button class="button" type="submit" name="{{ form.prefix }}-submit">
|
||||
<img src="{{ MEDIA_URL }}web_theme_media/images/icons/tick.png" alt="{% if object %}{% trans 'Save' %}{% else %}{% trans 'Submit' %}{% endif %}" /> {% if object %}{% trans 'Save' %}{% else %}{% trans 'Submit' %}{% endif %}
|
||||
<img src="{{ MEDIA_URL }}web_theme_media/images/icons/tick.png" alt="{% if object %}{% trans 'Save' %}{% else %}{% trans 'Submit' %}{% endif %}" /> {% if object %}{% trans "Save" %}{% else %}{% trans "Submit" %}{% endif %}
|
||||
</button>
|
||||
{% comment %}
|
||||
<a href="#header" class="button">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{#{% block secondary_links %}{{ secondary_links|safe }}{% endblock %}#}
|
||||
|
||||
{% block content %}
|
||||
{% include 'generic_list_subtemplate.html' %}
|
||||
{% include "generic_list_subtemplate.html" %}
|
||||
|
||||
{% for subtemplate in subtemplates_dict %}
|
||||
{% with subtemplate.title as title %}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{% if not hide_header %}
|
||||
<tr>
|
||||
{% if not hide_object %}
|
||||
<th>{% trans 'Identifier' %}</th>
|
||||
<th>{% trans "Identifier" %}</th>
|
||||
{% endif %}
|
||||
{% for column in object_list.0|get_model_list_columns %}
|
||||
<th>{{ column.name|capfirst }}</th>
|
||||
@@ -62,7 +62,7 @@
|
||||
<td>{{ object|object_property:column.attribute|safe }}</td>
|
||||
{% endfor %}
|
||||
{% if not hide_links %}
|
||||
<td class='last'>
|
||||
<td class="last">
|
||||
{% object_navigation_template %}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
@@ -51,7 +51,7 @@ def return_attrib(obj, attrib, arguments={}):
|
||||
elif isinstance(obj, types.DictType) or isinstance(obj, types.DictionaryType):
|
||||
return obj[attrib]
|
||||
else:
|
||||
result = reduce(getattr, attrib.split("."), obj)
|
||||
result = reduce(getattr, attrib.split('.'), obj)
|
||||
if isinstance(result, types.MethodType):
|
||||
if arguments:
|
||||
return result(**arguments)
|
||||
@@ -61,7 +61,7 @@ def return_attrib(obj, attrib, arguments={}):
|
||||
return result
|
||||
except Exception, err:
|
||||
if settings.DEBUG:
|
||||
return "Attribute error: %s; %s" % (attrib, err)
|
||||
return 'Attribute error: %s; %s' % (attrib, err)
|
||||
else:
|
||||
pass
|
||||
|
||||
@@ -69,7 +69,7 @@ def return_attrib(obj, attrib, arguments={}):
|
||||
#http://snippets.dzone.com/posts/show/5434
|
||||
#http://snippets.dzone.com/user/jakob
|
||||
def pretty_size(size):
|
||||
suffixes = [("B",2**10), ("K",2**20), ("M",2**30), ("G",2**40), ("T",2**50)]
|
||||
suffixes = [('B',2**10), ('K',2**20), ('M',2**30), ('G',2**40), ('T',2**50)]
|
||||
for suf, lim in suffixes:
|
||||
if size > lim:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user