Browse Source

Toolbar tweaks

Tomek Wójcik 5 months ago
parent
commit
d5cce22212

+ 2 - 1
django_changelist_inline/static/django_changelist_inline/css/changelist_inline.css

@@ -5,7 +5,8 @@
 
 .django_changelist_inline #toolbar {
     display: flex;
-    margin-bottom: 0px;
+    font-size: 12px;
+    margin-bottom: 0px !important;
 }
 
 .django_changelist_inline__toolbar a {

+ 15 - 15
django_changelist_inline/templates/django_changelist_inline/changelist_inline.html

@@ -9,26 +9,26 @@
         <div class="changelist-form-container">
           {% if cl.result_list %}
             {% result_list cl %}
-            {% if cl.has_toolbar %}
-              <div id="toolbar" class="django_changelist_inline__toolbar">
-                {% if cl.add_url %}
-                  <a class="addlink" href="{{ cl.add_url }}">
-                    {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
-                  </a>
-                {% endif %}
-                {% if cl.toolbar_links %}
-                  {{ cl.toolbar_links|safe }}
-                {% endif %}
-                {% if cl.show_all_url %}
-                  <a href="{{ cl.show_all_url }}">{% trans 'Show all' %} &raquo;</a>
-                {% endif %}
-              </div>
-            {% endif %}
           {% else %}
             <p class="paginator">
               {{ cl.model_admin.no_results_message }}
             </p>
           {% endif %}
+          {% if cl.has_toolbar %}
+            <div id="toolbar" class="django_changelist_inline__toolbar">
+              {% if cl.add_url %}
+                <a class="addlink" href="{{ cl.add_url }}">
+                  {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
+                </a>
+              {% endif %}
+              {% if cl.toolbar_links %}
+                {{ cl.toolbar_links|safe }}
+              {% endif %}
+              {% if cl.show_all_url %}
+                <a href="{{ cl.show_all_url }}">{% trans 'Show all' %} &raquo;</a>
+              {% endif %}
+            </div>
+          {% endif %}
         </div>
       </div>
     </div>