Final changes to implement multi document actions

This commit is contained in:
Roberto Rosario
2011-03-18 13:22:54 -04:00
parent 102026a169
commit 001491f93b
10 changed files with 159 additions and 91 deletions
@@ -22,74 +22,84 @@
{% endifnotequal %}
</h2>
<div class="inner">
<div class="inner">
{% endif %}
<form action="#" class="form" method="">
<table class="table">
<tbody>
{% if not hide_header %}
<tr>
{% if multi_select %}
<th class="first"><input type="checkbox" class="checkbox toggle" /></th>
{% endif %}
{% if not hide_object %}
<th>{% trans "Identifier" %}</th>
{% endif %}
{% for column in object_list.0|get_model_list_columns %}
<th>{{ column.name|capfirst }}</th>
{% endfor %}
{% for column in extra_columns %}
<th>{{ column.name|capfirst }}</th>
{% endfor %}
{% if not hide_links %}
<th class="">&nbsp;</th>
{% endif %}
</tr>
{% endif %}
{% for object in object_list %}
<tr class="{% cycle 'odd' 'even2' %}">
{% if multi_select %}
<td><input type="checkbox" class="checkbox" name="id" value="{{ object.pk }}" /></td>
{% endif %}
{% if not hide_object %}
{% if main_object %}
{% with object|object_property:main_object as object %}
<td>{% if not hide_link %}<a href="{{ object.get_absolute_url }}">{{ object }}</a>{% else %}{{ object }}{% endif %}</td>
{% endwith %}
{% else %}
<td>{% if not hide_link %}<a href="{{ object.get_absolute_url }}">{{ object }}</a>{% else %}{{ object }}{% endif %}</td>
{% endif %}
{% endif %}
{% if not hide_columns %}
{% for column in object|get_model_list_columns %}
<td>{{ object|object_property:column.attribute|safe }}</td>
{% endfor %}
{% endif %}
{% for column in extra_columns %}
{% if column.keep_together %}
<td>
{{ object|object_property:column.attribute|safe|make_non_breakable }}
</td>
{% else %}
<td>{{ object|object_property:column.attribute|safe }}</td>
<form action="{% url multi_object_action_view %}" class="form" method="get">
<table class="table">
<tbody>
{% if not hide_header %}
<tr>
{% if multi_select %}
<th class="first"><input type="checkbox" class="checkbox toggle" /></th>
{% endif %}
{% if not hide_object %}
<th>{% trans "Identifier" %}</th>
{% endif %}
{% for column in object_list.0|get_model_list_columns %}
<th>{{ column.name|capfirst }}</th>
{% endfor %}
{% for column in extra_columns %}
<th>{{ column.name|capfirst }}</th>
{% endfor %}
{% if not hide_links %}
<th class="">&nbsp;</th>
{% endif %}
</tr>
{% endif %}
{% endfor %}
{% if not hide_links %}
<td class="last">
{% object_navigation_template %}
</td>
{% endif %}
</tr>
{% empty %}
<tr><td colspan=99 class="tc">{% blocktrans %}There are no {{ title }}{% endblocktrans %}</td></tr>
{% endfor %}
</tbody>
</table>
{% if multi_select %}
{% get_multi_item_links_form %}
{% endif %}
{% paginate %}
</form>
</div>
{% for object in object_list %}
<tr class="{% cycle 'odd' 'even2' %}">
{% if multi_select %}
<td><input type="checkbox" class="checkbox" name="pk_{{ object.pk }}" value="" /></td>
{% endif %}
{% if not hide_object %}
{% if main_object %}
{% with object|object_property:main_object as object %}
<td>{% if not hide_link %}<a href="{{ object.get_absolute_url }}">{{ object }}</a>{% else %}{{ object }}{% endif %}</td>
{% endwith %}
{% else %}
<td>{% if not hide_link %}<a href="{{ object.get_absolute_url }}">{{ object }}</a>{% else %}{{ object }}{% endif %}</td>
{% endif %}
{% endif %}
{% if not hide_columns %}
{% for column in object|get_model_list_columns %}
<td>{{ object|object_property:column.attribute|safe }}</td>
{% endfor %}
{% endif %}
{% for column in extra_columns %}
{% if column.keep_together %}
<td>
{{ object|object_property:column.attribute|safe|make_non_breakable }}
</td>
{% else %}
<td>{{ object|object_property:column.attribute|safe }}</td>
{% endif %}
{% endfor %}
{% if not hide_links %}
<td class="last">
{% object_navigation_template %}
</td>
{% endif %}
</tr>
{% empty %}
<tr><td colspan=99 class="tc">{% blocktrans %}There are no {{ title }}{% endblocktrans %}</td></tr>
{% endfor %}
</tbody>
</table>
{% if multi_select %}
{% get_multi_item_links_form %}
<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 %}
</button>
</div>
{% endif %}
</form>
{% paginate %}
{% if side_bar %}
</p>
{% endif %}
</div>
</div>