Login

Admin related widget wrapper with edit / delete link (html)

Author:
nasp
Posted:
October 7, 2011
Language:
HTML/template
Version:
1.3
Score:
1 (after 1 ratings)

Here's the python code to produce an admin related widget with the edit and delete link also.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{{ widget }}
{% if can_change_related %}
	<a class="related-widget-wrapper-link related-widget-wrapper-change-link" id="edit_id_{{ name }}" data-href-template="{{ change_url_template }}"{% if change_url %} href="{{ change_url }}"{% endif %} title="{{ change_help_text }}">
		<img src="{{ media_prefix }}img/admin/icon_changelink.gif" width="10" height="10" alt="{{ change_help_text }}"/>
	</a>
{% endif %}
{% if can_add_related %}
	<a class="related-widget-wrapper-link related-widget-wrapper-add-link add-related" href="{{ add_url }}" id="add_id_{{ name }}"  title="{{ add_help_text }}">
		<img src="{{ media_prefix }}img/admin/icon_addlink.gif" width="10" height="10" alt="{{ add_help_text }}"/>
	</a>
{% endif %}
{% if can_delete_related %}
	<a class="related-widget-wrapper-link related-widget-wrapper-delete-link" id="delete_id_{{ name }}" data-href-template="{{ delete_url_template }}"{% if delete_url %} href="{{ delete_url }}"{% endif %} title="{{ delete_help_text }}">
		<img src="{{ media_prefix }}img/admin/icon_deletelink.gif" width="10" height="10" alt="{{ delete_help_text }}"/>
	</a>
{% endif %}

More like this

  1. Bootstrap Accordian by Netplay4 5 years, 11 months ago
  2. Bootstrap theme for django-endless-pagination? by se210 8 years, 11 months ago
  3. Bootstrap theme for django-endless-pagination? by se210 8 years, 11 months ago
  4. Reusable form template with generic view by roldandvg 9 years ago
  5. Pagination Django with Boostrap by guilegarcia 9 years, 2 months ago

Comments

Please login first before commenting.