Няма описание

change_form.html 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {% extends "admin/base_site.html" %}
  2. {% load i18n admin_urls static admin_modify %}
  3. {% block extrahead %}{{ block.super }}
  4. <script src="{% url 'admin:jsi18n' %}"></script>
  5. {{ media }}
  6. {% endblock %}
  7. {% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %}
  8. {% block coltype %}colM{% endblock %}
  9. {% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %}
  10. {% if not is_popup %}
  11. {% block breadcrumbs %}
  12. <div class="breadcrumbs">
  13. <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
  14. &rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
  15. &rsaquo; {% if has_view_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
  16. &rsaquo; {% if add %}{% blocktranslate with name=opts.verbose_name %}Add {{ name }}{% endblocktranslate %}{% else %}{{ original|truncatewords:"18" }}{% endif %}
  17. </div>
  18. {% endblock %}
  19. {% endif %}
  20. {% block content %}<div id="content-main">
  21. {% block object-tools %}
  22. {% if change %}{% if not is_popup %}
  23. <ul class="object-tools">
  24. {% block object-tools-items %}
  25. {% change_form_object_tools %}
  26. {% endblock %}
  27. </ul>
  28. {% endif %}{% endif %}
  29. {% endblock %}
  30. <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}" {% endif %}method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
  31. <div>
  32. {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %}
  33. {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %}
  34. {% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
  35. {% if errors %}
  36. <p class="errornote">
  37. {% if errors|length == 1 %}{% translate "Please correct the error below." %}{% else %}{% translate "Please correct the errors below." %}{% endif %}
  38. </p>
  39. {{ adminform.form.non_field_errors }}
  40. {% endif %}
  41. {% block field_sets %}
  42. {% for fieldset in adminform %}
  43. {% include "admin/includes/fieldset.html" %}
  44. {% endfor %}
  45. {% endblock %}
  46. {% block after_field_sets %}{% endblock %}
  47. {% block inline_field_sets %}
  48. {% for inline_admin_formset in inline_admin_formsets %}
  49. {% include inline_admin_formset.opts.template %}
  50. {% endfor %}
  51. {% endblock %}
  52. {% block after_related_objects %}{% endblock %}
  53. {% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
  54. {% block admin_change_form_document_ready %}
  55. <script id="django-admin-form-add-constants"
  56. src="{% static 'admin/js/change_form.js' %}"
  57. {% if adminform and add %}
  58. data-model-name="{{ opts.model_name }}"
  59. {% endif %}
  60. async>
  61. </script>
  62. {% endblock %}
  63. {# JavaScript for prepopulated fields #}
  64. {% prepopulated_fields_js %}
  65. </div>
  66. </form></div>
  67. {% endblock %}