Просмотр исходного кода

Fix empty object tools navigation misplacement

Denis K 8 лет назад
Родитель
Сommit
6b6b8e2638
2 измененных файлов с 36 добавлено и 33 удалено
  1. 1 0
      jet/static/jet/css/_changeform.scss
  2. 35 33
      jet/templates/admin/change_form.html

+ 1 - 0
jet/static/jet/css/_changeform.scss

@@ -140,6 +140,7 @@
 
   &-navigation {
     float: left;
+    margin-bottom: 20px;
   }
 
   &-tabs {

+ 35 - 33
jet/templates/admin/change_form.html

@@ -29,40 +29,42 @@
 
 {% block content %}
     <div id="content-main">
-        {% jet_change_form_sibling_links_enabled as show_siblings %}
-        {% if change and show_siblings %}
-            <div class="changeform-navigation">
-                {% spaceless %}
-                    {% jet_previous_object_url as url %}
-                    <a{% if url %} href="{{ url }}"{% endif %} class="segmented-button left{% if not url %} disabled{% endif %}">
-                        {% trans "←" %}
-                    </a>
-
-                    {% jet_next_object_url as url %}
-                    <a{% if url %} href="{{ url }}"{% endif %} class="segmented-button right{% if not url %} disabled{% endif %}">
-                        {% trans "→" %}
-                    </a>
-                {% endspaceless %}
-            </div>
-        {% endif %}
-        <div class="changeform-object-tools">
-            {% block object-tools %}
-                {% if change %}
-                    {% if not is_popup %}
-                        <ul class="object-tools horizontal">
-                            {% block object-tools-items %}
-                                <li>
-                                    {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
-                                    <a href="{% jet_add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
-                                </li>
-                                {% if has_absolute_url %}
-                                    <li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>
-                                {% endif %}
-                            {% endblock %}
-                        </ul>
+        <div class="cf">
+            {% jet_change_form_sibling_links_enabled as show_siblings %}
+            {% if change and show_siblings %}
+                <div class="changeform-navigation">
+                    {% spaceless %}
+                        {% jet_previous_object_url as url %}
+                        <a{% if url %} href="{{ url }}"{% endif %} class="segmented-button left{% if not url %} disabled{% endif %}">
+                            {% trans "←" %}
+                        </a>
+
+                        {% jet_next_object_url as url %}
+                        <a{% if url %} href="{{ url }}"{% endif %} class="segmented-button right{% if not url %} disabled{% endif %}">
+                            {% trans "→" %}
+                        </a>
+                    {% endspaceless %}
+                </div>
+            {% endif %}
+            <div class="changeform-object-tools">
+                {% block object-tools %}
+                    {% if change %}
+                        {% if not is_popup %}
+                            <ul class="object-tools horizontal">
+                                {% block object-tools-items %}
+                                    <li>
+                                        {% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
+                                        <a href="{% jet_add_preserved_filters history_url %}" class="historylink">{% trans "History" %}</a>
+                                    </li>
+                                    {% if has_absolute_url %}
+                                        <li><a href="{{ absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>
+                                    {% endif %}
+                                {% endblock %}
+                            </ul>
+                        {% endif %}
                     {% endif %}
-                {% endif %}
-            {% endblock %}
+                {% endblock %}
+            </div>
         </div>
         <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>
             {% csrf_token %}