|
2 | 2 | {% load i18n admin_urls static admin_modify %} |
3 | 3 |
|
4 | 4 | {% block extrahead %}{{ block.super }} |
5 | | -<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script> |
6 | | -{{ media }} |
| 5 | + <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script> |
| 6 | + {{ media }} |
7 | 7 | {% endblock %} |
8 | 8 |
|
9 | 9 | {% block extrastyle %} |
10 | | -{{ block.super }} |
11 | | -<link rel="stylesheet" href="{% static "admin/dist/css/app.css" %}"> |
| 10 | + {{ block.super }} |
| 11 | + <link rel="stylesheet" href="{% static "admin/dist/css/app.css" %}"> |
12 | 12 | {% endblock %} |
13 | 13 |
|
14 | 14 | {% block coltype %}colM{% endblock %} |
15 | 15 |
|
16 | 16 | {% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %} |
17 | 17 |
|
18 | 18 | {% if not is_popup %} |
19 | | -{% block breadcrumbs %} |
20 | | -<ol class="breadcrumb"> |
21 | | - <li><a href="{% url 'admin:index' %}"><i class="fa fa-dashboard"></i> {% trans 'Home' %}</a></li> |
22 | | - <li><a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a></li> |
23 | | - <li>{% if has_view_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}</li> |
24 | | - <li class="active">{% if add %}{% blocktrans with name=opts.verbose_name %}Add {{ name }}{% endblocktrans %}{% else %}{{ original|truncatewords:"18" }}{% endif %}</li> |
25 | | -</ol> |
26 | | -{% endblock %} |
| 19 | + {% block breadcrumbs %} |
| 20 | + <ol class="breadcrumb"> |
| 21 | + <li><a href="{% url 'admin:index' %}"><i class="fa fa-dashboard"></i> {% trans 'Home' %}</a></li> |
| 22 | + <li><a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a></li> |
| 23 | + <li>{% if has_view_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}</li> |
| 24 | + <li class="active">{% if add %}{% blocktrans with name=opts.verbose_name %}Add {{ name }}{% endblocktrans %}{% else %}{{ original|truncatewords:"18" }}{% endif %}</li> |
| 25 | + </ol> |
| 26 | + {% endblock %} |
27 | 27 | {% endif %} |
28 | 28 |
|
29 | 29 | {% block content_title %} {{ opts.verbose_name_plural|capfirst }} {% endblock %} |
30 | 30 |
|
31 | 31 |
|
32 | 32 | {% block content %} |
33 | 33 |
|
34 | | -<div class="row"> |
35 | | - <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate> |
36 | | - <div class="col-md-9"> |
37 | | - <div class="box box-primary"> |
38 | | - <div class="box-header with-border"> |
39 | | - <h4 class="box-title"> |
40 | | - {{title}}{% block pretitle %}{% endblock %} |
41 | | - </h4> |
42 | | - </div> |
| 34 | + <div class="row"> |
| 35 | + <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate> |
| 36 | + <div class="col-md-9"> |
| 37 | + <div class="box box-primary"> |
| 38 | + <div class="box-header with-border"> |
| 39 | + <h4 class="box-title"> |
| 40 | + {{title}}{% block pretitle %}{% endblock %} |
| 41 | + </h4> |
| 42 | + </div> |
43 | 43 |
|
44 | | - <div class="box-body"> |
45 | | - <div id="content-main"> |
46 | | - <div> |
47 | | - {% csrf_token %}{% block form_top %}{% endblock %} |
48 | | - {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %} |
49 | | - {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %} |
50 | | - {% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %} |
51 | | - {% if errors %} |
52 | | - <div class="errornote text-red text-center" style="margin: 20px;"> |
53 | | - {% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %} |
54 | | - </div> |
55 | | - {{ adminform.form.non_field_errors }} |
56 | | - {% endif %} |
57 | | - |
58 | | - {% block field_sets %} |
59 | | - {% for fieldset in adminform %} |
60 | | - {% include "admin/includes/fieldset.html" %} |
61 | | - {% endfor %} |
62 | | - {% endblock %} |
63 | | - |
64 | | - {% block after_field_sets %}{% endblock %} |
65 | | - |
66 | | - {% block inline_field_sets %} |
67 | | - {% for inline_admin_formset in inline_admin_formsets %} |
68 | | - {% include inline_admin_formset.opts.template %} |
69 | | - {% endfor %} |
70 | | - {% endblock %} |
71 | | - |
72 | | - {% block after_related_objects %}{% endblock %} |
73 | | - |
74 | | - {% block admin_change_form_document_ready %} |
75 | | - <script type="text/javascript" |
76 | | - id="django-admin-form-add-constants" |
77 | | - src="{% static 'admin/js/change_form.js' %}" |
78 | | - {% if adminform and add %} |
79 | | - data-model-name="{{ opts.model_name }}" |
80 | | - {% endif %}> |
81 | | - </script> |
82 | | - {% endblock %} |
83 | | - |
84 | | - {# JavaScript for prepopulated fields #} |
85 | | - {% prepopulated_fields_js %} |
86 | | - <div class="form-inline visible-sm visible-xs"> |
87 | | - <br class="clear" /> |
88 | | - {% submit_row %} |
| 44 | + <div class="box-body"> |
| 45 | + <div id="content-main"> |
| 46 | + <div> |
| 47 | + {% csrf_token %}{% block form_top %}{% endblock %} |
| 48 | + {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %} |
| 49 | + {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %} |
| 50 | + {% if errors %} |
| 51 | + <div class="errornote text-red text-center" style="margin: 20px;"> |
| 52 | + {% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %} |
| 53 | + </div> |
| 54 | + {{ adminform.form.non_field_errors }} |
| 55 | + {% endif %} |
| 56 | + |
| 57 | + {% block field_sets %} |
| 58 | + {% for fieldset in adminform %} |
| 59 | + {% include "admin/includes/fieldset.html" %} |
| 60 | + {% endfor %} |
| 61 | + {% endblock %} |
| 62 | + |
| 63 | + {% block after_field_sets %}{% endblock %} |
| 64 | + |
| 65 | + {% block inline_field_sets %} |
| 66 | + {% for inline_admin_formset in inline_admin_formsets %} |
| 67 | + {% include inline_admin_formset.opts.template %} |
| 68 | + {% endfor %} |
| 69 | + {% endblock %} |
| 70 | + |
| 71 | + {% block after_related_objects %}{% endblock %} |
| 72 | + |
| 73 | + {% block admin_change_form_document_ready %} |
| 74 | + <script type="text/javascript" |
| 75 | + id="django-admin-form-add-constants" |
| 76 | + src="{% static 'admin/js/change_form.js' %}" |
| 77 | + {% if adminform and add %} |
| 78 | + data-model-name="{{ opts.model_name }}" |
| 79 | + {% endif %}> |
| 80 | + </script> |
| 81 | + {% endblock %} |
| 82 | + |
| 83 | + {# JavaScript for prepopulated fields #} |
| 84 | + {% prepopulated_fields_js %} |
| 85 | + <div class="form-inline visible-sm visible-xs"> |
| 86 | + <br class="clear" /> |
| 87 | + {% block submit_buttons_top %}{% submit_row %}{% endblock %} |
| 88 | + </div> |
89 | 89 | </div> |
90 | 90 | </div> |
91 | 91 | </div> |
92 | 92 | </div> |
| 93 | + <br class="clear" /> |
93 | 94 | </div> |
94 | | - <br class="clear" /> |
95 | | - </div> |
96 | | - <div class="col-md-3 hidden-sm hidden-xs"> |
97 | | - <div class="box box-primary"> |
98 | | - <div class="box-header with-border"> |
99 | | - <h4 class="box-title"> |
100 | | - {% trans 'change form tools' %} |
101 | | - </h4> |
102 | | - </div> |
103 | | - |
104 | | - <div class="box-body"> |
105 | | - {% block submit_buttons_bottom %}{% submit_row %}{% endblock %} |
| 95 | + <div class="col-md-3 hidden-sm hidden-xs" style="position: fixed; width: calc(25% - 57.5px); right: 0px;"> |
| 96 | + <div class="box box-primary"> |
| 97 | + <div class="box-header with-border"> |
| 98 | + <h4 class="box-title"> |
| 99 | + {% trans 'change form tools' %} |
| 100 | + </h4> |
| 101 | + </div> |
106 | 102 |
|
107 | | - {% block object-tools %} |
108 | | - {% if change %}{% if not is_popup %} |
109 | | - <ul class="object-tools"> |
110 | | - {% block object-tools-items %} |
111 | | - {% change_form_object_tools %} |
| 103 | + <div class="box-body"> |
| 104 | + {% block submit_buttons_bottom %}{% submit_row %}{% endblock %} |
| 105 | + |
| 106 | + {% block object-tools %} |
| 107 | + {% if change %}{% if not is_popup %} |
| 108 | + <ul class="object-tools"> |
| 109 | + {% block object-tools-items %} |
| 110 | + {% change_form_object_tools %} |
| 111 | + {% endblock %} |
| 112 | + </ul> |
| 113 | + {% endif %}{% endif %} |
112 | 114 | {% endblock %} |
113 | | - </ul> |
114 | | - {% endif %}{% endif %} |
115 | | - {% endblock %} |
116 | | - </div> |
| 115 | + </div> |
117 | 116 |
|
| 117 | + </div> |
| 118 | + <br class="clear" /> |
118 | 119 | </div> |
119 | | - <br class="clear" /> |
120 | | - </div> |
121 | | - </form> |
122 | | -</div> |
| 120 | + </form> |
| 121 | + </div> |
123 | 122 |
|
124 | 123 |
|
125 | 124 | {% endblock %} |
126 | 125 |
|
127 | 126 | {% block extrajs %} |
128 | | -<script> |
129 | | -$('[required]').before('<span class="text-red" style="margin-left: -10px;">* </span>'); |
130 | | -</script> |
| 127 | + <script> |
| 128 | + $('[required]').before('<span class="text-red" style="margin-left: -10px;">* </span>'); |
| 129 | + </script> |
131 | 130 | {% endblock %} |
0 commit comments