1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

new-admin: Normalized spacing in admin template tags

git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@1393 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-11-24 04:24:29 +00:00
parent 82c071539b
commit 7da863576f
12 changed files with 75 additions and 85 deletions

View File

@ -6,12 +6,12 @@
{% for js in bound_manipulator.javascript_imports %}{% include_admin_script js %}{% endfor %} {% for js in bound_manipulator.javascript_imports %}{% include_admin_script js %}{% endfor %}
{% endblock %} {% endblock %}
{% block coltype %}{{ bound_manipulator.coltype }}{% endblock %} {% block coltype %}{{ bound_manipulator.coltype }}{% endblock %}
{% block bodyclass %}{{app_label}}-{{bound_manipulator.object_name.lower}} change-form{% endblock %} {% block bodyclass %}{{ app_label }}-{{ bound_manipulator.object_name.lower }} change-form{% endblock %}
{% block breadcrumbs %}{% if not is_popup %} {% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="../../../">{% trans "Home" %}</a> &rsaquo; <a href="../../../">{% trans "Home" %}</a> &rsaquo;
<a href="../">{{bound_manipulator.verbose_name_plural|capfirst}}</a> &rsaquo; <a href="../">{{ bound_manipulator.verbose_name_plural|capfirst }}</a> &rsaquo;
{% if add %}{% trans "Add" %} {{bound_manipulator.verbose_name}}{% else %}{{bound_manipulator.original|striptags|truncatewords:"18"}}{% endif %} {% if add %}{% trans "Add" %} {{ bound_manipulator.verbose_name }}{% else %}{{ bound_manipulator.original|striptags|truncatewords:"18" }}{% endif %}
</div> </div>
{% endif %}{% endblock %} {% endif %}{% endblock %}
{% block content %}<div id="content-main"> {% block content %}<div id="content-main">
@ -20,7 +20,7 @@
{% if bound_manipulator.has_absolute_url %}<li><a href="/r/{{ bound_manipulator.content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%} {% if bound_manipulator.has_absolute_url %}<li><a href="/r/{{ bound_manipulator.content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
</ul> </ul>
{% endif %}{% endif %} {% endif %}{% endif %}
<form {{ bound_manipulator.form_enc_attrib }} action='{{ form_url }}' method="post">{% block form_top %}{%endblock%} <form {{ bound_manipulator.form_enc_attrib }} action='{{ form_url }}' method="post">{% block form_top %}{% endblock %}
{% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %}
{% if bound_manipulator.save_on_top %}{% submit_row bound_manipulator %}{% endif %} {% if bound_manipulator.save_on_top %}{% submit_row bound_manipulator %}{% endif %}
{% if form.error_dict %} {% if form.error_dict %}
@ -29,12 +29,12 @@
</p> </p>
{% endif %} {% endif %}
{% for bound_field_set in bound_manipulator.bound_field_sets %} {% for bound_field_set in bound_manipulator.bound_field_sets %}
<fieldset class="module aligned {{ bound_field_set.classes }}"> <fieldset class="module aligned {{ bound_field_set.classes }}">
{% if bound_field_set.name %}<h2>{{bound_field_set.name }}</h2>{% endif %} {% if bound_field_set.name %}<h2>{{ bound_field_set.name }}</h2>{% endif %}
{% for bound_field_line in bound_field_set %} {% for bound_field_line in bound_field_set %}
{% admin_field_line bound_field_line %} {% admin_field_line bound_field_line %}
{% for bound_field in bound_field_line %} {% for bound_field in bound_field_line %}
{% filter_interface_script_maybe bound_field %} {% filter_interface_script_maybe bound_field %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
</fieldset> </fieldset>
@ -50,24 +50,24 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% for related_object in bound_manipulator.inline_related_objects %}{% edit_inline related_object %}{% endfor %} {% for related_object in bound_manipulator.inline_related_objects %}{% edit_inline related_object %}{% endfor %}
{% block after_related_objects%}{%endblock%} {% block after_related_objects %}{% endblock %}
{% submit_row bound_manipulator %} {% submit_row bound_manipulator %}
{% if add %} {% if add %}
<script type="text/javascript">document.getElementById("{{bound_manipulator.first_form_field_id}}").focus();</script> <script type="text/javascript">document.getElementById("{{ bound_manipulator.first_form_field_id }}").focus();</script>
{% endif %} {% endif %}
{% if bound_manipulator.auto_populated_fields %} {% if bound_manipulator.auto_populated_fields %}
<script type="text/javascript"> <script type="text/javascript">
{% auto_populated_field_script bound_manipulator.auto_populated_fields change %} {% auto_populated_field_script bound_manipulator.auto_populated_fields change %}
</script> </script>
{% endif %} {% endif %}
{% if change %} {% if change %}
{% if bound_manipulator.ordered_objects %} {% if bound_manipulator.ordered_objects %}
{% if form.order_objects %}<ul id="orderthese"> {% if form.order_objects %}<ul id="orderthese">
{% for object in form.order_objects %} {% for object in form.order_objects %}
<li id="p{% object_pk bound_manipulator object %}"> <li id="p{% object_pk bound_manipulator object %}">
<span id="handlep{% object_pk bound_manipulator object %}">{{ object|truncatewords:"5" }}</span> <span id="handlep{% object_pk bound_manipulator object %}">{{ object|truncatewords:"5" }}</span>
</li> </li>
{% endfor%} {% endfor %}
</ul>{% endif %} </ul>{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}

View File

@ -2,19 +2,19 @@
{% load i18n %} {% load i18n %}
{% extends "admin/base_site" %} {% extends "admin/base_site" %}
{% block bodyclass %}change-list{% endblock %} {% block bodyclass %}change-list{% endblock %}
{% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> &rsaquo; {{cl.opts.verbose_name_plural|capfirst}} </div>{% endblock %}{% endif %} {% if not is_popup %}{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans "Home" %}</a> &rsaquo; {{ cl.opts.verbose_name_plural|capfirst }} </div>{% endblock %}{% endif %}
{% block coltype %}flex{% endblock %} {% block coltype %}flex{% endblock %}
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
{%if has_add_permission %} {% if has_add_permission %}
<ul class="object-tools"><li><a href="add/{%if is_popup%}?_popup=1{%endif%}" class="addlink">{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}</a></li></ul> <ul class="object-tools"><li><a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}</a></li></ul>
{% endif %} {% endif %}
<div class="module{%if cl.has_filters%} filtered{%endif%}" id="changelist"> <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
{% search_form cl%} {% search_form cl %}
{% date_hierarchy cl%} {% date_hierarchy cl %}
{% filters cl %} {% filters cl %}
{% result_list cl%} {% result_list cl %}
{% pagination cl%} {% pagination cl %}
</div> </div>
</div> </div>
{%endblock%} {% endblock %}

View File

@ -1,17 +1,13 @@
<table cellspacing="0"> <table cellspacing="0">
<thead> <thead>
<tr> <tr>
{% for header in result_headers %}<th{{header.class_attrib}}> {% for header in result_headers %}<th{{ header.class_attrib }}>
{%if header.sortable%}<a href="{{header.url}}" %>{%endif%} {% if header.sortable %}<a href="{{ header.url }}">{% endif %}
{{header.text|capfirst}} {{ header.text|capfirst }}
{%if header.sortable %}</a>{% endif %}</th>{% endfor %} {% if header.sortable %}</a>{% endif %}</th>{% endfor %}
</tr> </tr>
</thead> </thead>
{%for result in results %} {% for result in results %}
<tr class="{%cycle row1,row2%}" > <tr class="{% cycle row1,row2 %}">{% for item in result %}{{ item }}{% endfor %}</tr>
{%for item in result %} {% endfor %}
{{item }}
{%endfor%}
</tr>
{%endfor%}
</table> </table>

View File

@ -1,9 +1,9 @@
{% if show %} {% if show %}
<div class="xfull"> <div class="xfull">
<ul class="toplinks"> <ul class="toplinks">
{% if back %}<li class="date-back"><a href="{{back.link}}">&lsaquo; {{back.title}}</a></li>{% endif %} {% if back %}<li class="date-back"><a href="{{ back.link }}">&lsaquo; {{ back.title }}</a></li>{% endif %}
{% for choice in choices %} {% for choice in choices %}
<li> {% if choice.link%}<a href="{{choice.link}}">{%endif%}{{choice.title}}{%if choice.link%}</a>{%endif%}</li> <li> {% if choice.link %}<a href="{{ choice.link }}">{% endif %}{{ choice.title }}{% if choice.link %}</a>{% endif %}</li>
{% endfor %} {% endfor %}
</ul><br class="clear" /> </ul><br class="clear" />
</div> </div>

View File

@ -1,5 +1,5 @@
<fieldset class="module aligned"> <fieldset class="module aligned">
{% for fcw in bound_related_object.form_field_collection_wrappers %} {% for fcw in bound_related_object.form_field_collection_wrappers %}
<h2>{{ bound_related_object.relation.opts.verbose_name|capfirst }}&nbsp;#{{ forloop.counter }}</h2> <h2>{{ bound_related_object.relation.opts.verbose_name|capfirst }}&nbsp;#{{ forloop.counter }}</h2>
{% if bound_related_object.show_url %}{% if fcw.obj.original %} {% if bound_related_object.show_url %}{% if fcw.obj.original %}
<p><a href="/r/{{ fcw.obj.original.content_type_id }}/{{ fcw.obj.original.id }}/">View on site</a></p> <p><a href="/r/{{ fcw.obj.original.content_type_id }}/{{ fcw.obj.original.id }}/">View on site</a></p>
@ -11,5 +11,5 @@
{% admin_field_line bound_field %} {% admin_field_line bound_field %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{%endfor%} {% endfor %}
</fieldset> </fieldset>

View File

@ -1,33 +1,32 @@
<fieldset class="module"> <fieldset class="module">
<h2>{{bound_related_object.relation.opts.verbose_name_plural|capfirst}}</h2><table> <h2>{{ bound_related_object.relation.opts.verbose_name_plural|capfirst }}</h2><table>
<thead><tr> <thead><tr>
{% for fw in bound_related_object.field_wrapper_list %} {% for fw in bound_related_object.field_wrapper_list %}
{% if fw.needs_header %} {% if fw.needs_header %}
<th{{fw.header_class_attribute}}> {{fw.field.verbose_name|capfirst}} </th> <th{{ fw.header_class_attribute }}>{{ fw.field.verbose_name|capfirst }}</th>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for fcw in bound_related_object.form_field_collection_wrappers %} {% for fcw in bound_related_object.form_field_collection_wrappers %}
{% if change %}{% if original_row_needed %} {% if change %}{% if original_row_needed %}
{% if fcw.obj.original %} {% if fcw.obj.original %}
<tr class="row-label {% cycle row1,row2 %}"><td colspan="{{num_headers}}"><strong>{{ fcw.obj.original }}</strong></tr> <tr class="row-label {% cycle row1,row2 %}"><td colspan="{{ num_headers }}"><strong>{{ fcw.obj.original }}</strong></tr>
{% endif %} {% endif %}
{% endif %}{% endif %} {% endif %}{% endif %}
{% if fcw.obj.errors %} {% if fcw.obj.errors %}
<tr class="errorlist"><td colspan="{{num_headers}}"> <tr class="errorlist"><td colspan="{{ num_headers }}">
{{ fcw.obj.html_combined_error_list }} {{ fcw.obj.html_combined_error_list }}
</tr> </tr>
{% endif %} {% endif %}
<tr class="{% cycle row1,row2 %}"> <tr class="{% cycle row1,row2 %}">
{% for bound_field in fcw.bound_fields %} {% for bound_field in fcw.bound_fields %}
{% if not bound_field.hidden %} {% if not bound_field.hidden %}
<td {{bound_field.cell_class_attribute}}> <td {{ bound_field.cell_class_attribute }}>
{% field_widget bound_field %} {% field_widget bound_field %}
</td> </td>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if bound_related_object.show_url %}<td> {% if bound_related_object.show_url %}<td>
{% if fcw.obj.original %}<a href="/r/{{ fcw.obj.original.content_type_id }}/{{ fcw.obj.original.id }}/">View on site</a>{% endif %} {% if fcw.obj.original %}<a href="/r/{{ fcw.obj.original.content_type_id }}/{{ fcw.obj.original.id }}/">View on site</a>{% endif %}
</td>{% endif %} </td>{% endif %}
</tr> </tr>
@ -35,10 +34,9 @@
{% for fcw in bound_related_object.form_field_collection_wrappers %} {% for fcw in bound_related_object.form_field_collection_wrappers %}
{% for bound_field in fcw.bound_fields %} {% for bound_field in fcw.bound_fields %}
{% if bound_field.hidden %} {% if bound_field.hidden %}
{% field_widget bound_field %} {% field_widget bound_field %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
</fieldset> </fieldset>

View File

@ -3,19 +3,19 @@
{% for bound_field in bound_fields %} {% for bound_field in bound_fields %}
{% if bound_field.has_label_first %} {% if bound_field.has_label_first %}
{% field_label bound_field %} {% field_label bound_field %}
{% endif %} {% endif %}
{% field_widget bound_field %} {% field_widget bound_field %}
{% if not bound_field.has_label_first %} {% if not bound_field.has_label_first %}
{% field_label bound_field %} {% field_label bound_field %}
{% endif %} {% endif %}
{% if change %} {% if change %}
{% if bound_field.field.primary_key %} {% if bound_field.field.primary_key %}
{{ bound_field.original_value }} {{ bound_field.original_value }}
{% endif %} {% endif %}
{% if bound_field.raw_id_admin %} {% if bound_field.raw_id_admin %}
{% if bound_field.existing_display %}&nbsp;<strong>{{ bound_field.existing_display|truncatewords:"14" }}</strong>{% endif %} {% if bound_field.existing_display %}&nbsp;<strong>{{ bound_field.existing_display|truncatewords:"14" }}</strong>{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if bound_field.field.help_text %}<p class="help">{{bound_field.field.help_text}}</p>{% endif %} {% if bound_field.field.help_text %}<p class="help">{{ bound_field.field.help_text }}</p>{% endif %}
{% endfor %} {% endfor %}
</div> </div>

View File

@ -1,7 +1,7 @@
<h3>{%blocktrans%} By {{title}} {%endblocktrans%}</h3> <h3>{% blocktrans %} By {{ title }} {% endblocktrans %}</h3>
<ul> <ul>
{% for choice in choices %} {% for choice in choices %}
<li{%if choice.selected%} class="selected"{%endif%}> <li{% if choice.selected %} class="selected"{% endif %}>
<a href="{{choice.query_string}}">{{choice.display}}</a></li> <a href="{{ choice.query_string }}">{{ choice.display }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>

View File

@ -2,4 +2,4 @@
<h2>Filter</h2> <h2>Filter</h2>
{% for spec in cl.filter_specs %} {% for spec in cl.filter_specs %}
{% filter cl spec %} {% filter cl spec %}
{% endfor %}</div>{% endif %} {% endfor %}</div>{% endif %}

View File

@ -1,13 +1,9 @@
<p class="paginator"> <p class="paginator">
{% if pagination_required %} {% if pagination_required %}
{%for i in page_range %} {% for i in page_range %}
{% paginator_number cl i %} {% paginator_number cl i %}
{%endfor%} {% endfor %}
{%endif%} {% endif %}
{{cl.result_count}} {% ifequal cl.result_count 1 %}{{cl.opts.verbose_name}}{%else%}{{cl.opts.verbose_name_plural}}{%endifequal%} {{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %}
{% if show_all_url %}&nbsp;&nbsp;<a href="{{show_all_url}}" class="showall">Show all</a>{%endif%} {% if show_all_url %}&nbsp;&nbsp;<a href="{{ show_all_url }}" class="showall">Show all</a>{% endif %}
</p> </p>

View File

@ -1,14 +1,14 @@
{%if cl.lookup_opts.admin.search_fields %} {% if cl.lookup_opts.admin.search_fields %}
<div id="toolbar"><form id="changelist-search" action="" method="get"> <div id="toolbar"><form id="changelist-search" action="" method="get">
<label><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" /></label> <label><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" /></label>
<input type="text" size="40" name="{{search_var}}" value="{{cl.query|escape}}" id="searchbar" /> <input type="text" size="40" name="{{ search_var }}" value="{{ cl.query|escape }}" id="searchbar" />
<input type="submit" value="Go" /> <input type="submit" value="Go" />
{%if show_result_count %} {% if show_result_count %}
<span class="small quiet">{{cl.result_count}} result{{cl.result_count|pluralize}} (<a href="?">{{cl.full_result_count}} total</a>)</span> <span class="small quiet">{{ cl.result_count }} result{{ cl.result_count|pluralize }} (<a href="?">{{ cl.full_result_count }} total</a>)</span>
{%endif%} {% endif %}
{% for pair in cl.params.items %} {% for pair in cl.params.items %}
{%ifnotequal pair.0 search_var%}<input type="hidden" name="{{pair.0|escape}}" value="{{pair.1|escape}}"/>{%endifnotequal%} {% ifnotequal pair.0 search_var %}<input type="hidden" name="{{ pair.0|escape }}" value="{{ pair.1|escape }}"/>{% endifnotequal %}
{% endfor %} {% endfor %}
</form></div> </form></div>
<script type="text/javascript">document.getElementById("searchbar").focus();</script> <script type="text/javascript">document.getElementById("searchbar").focus();</script>
{%endif%} {% endif %}

View File

@ -1,8 +1,8 @@
{% load i18n %} {% load i18n %}
<div class="submit-row"> <div class="submit-row">
{% if show_delete_link %}<p class="float-left"><a href="delete/" class="deletelink">{% trans "Delete" %}</a></p>{% endif %} {% if show_delete_link %}<p class="float-left"><a href="delete/" class="deletelink">{% trans "Delete" %}</a></p>{% endif %}
{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{onclick_attrib}}/>{%endif%} {% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{ onclick_attrib }}/>{%endif%}
{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" {{onclick_attrib}} />{% endif %} {% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" {{ onclick_attrib }} />{% endif %}
{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{onclick_attrib}}/>{% endif %} {% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" {{ onclick_attrib }}/>{% endif %}
{% if show_save %}<input type="submit" value="{% trans 'Save' %}" class="default" {{onclick_attrib}}/>{% endif %} {% if show_save %}<input type="submit" value="{% trans 'Save' %}" class="default" {{ onclick_attrib }}/>{% endif %}
</div> </div>