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

Fix various Bootstrap 4 and other template issues

- Hide edit link on mobile, on flatpages
- Hide column headers on mobile, on basket page "Items to buy later"
  table
- Hide edit link on mobile, on category page
- Move dislay of various elements from "sm" to "md" grid tier
- Display error icon on navigation tab, on dashboard category-form page
- Increase "z-index" of dropdown menu on dashboard, so that it appears
  above all other elements
- Remove useless "top-spacer" class from dashboard review-list page
- Fix typo in use of template tag, on dashboard category-delete page
- Remove repeated display of non-field errors, and hidden fields, on
  dashboard category-form page
master
Joseph Wayodi 5 лет назад
Родитель
Сommit
8f2111f2e7

+ 4
- 0
src/oscar/static_src/oscar/scss/dashboard/navbar.scss Просмотреть файл

@@ -1,6 +1,10 @@
1 1
 // Navigation bar
2 2
 
3 3
 .navbar {
4
+  .dropdown-menu {
5
+    z-index: 2000;
6
+  }
7
+
4 8
   &.navbar-accounts,
5 9
   &.navbar-primary {
6 10
     padding: 0;

+ 1
- 1
src/oscar/templates/flatpages/default.html Просмотреть файл

@@ -8,7 +8,7 @@
8 8
 {% block header%}
9 9
     <div class="page-header">
10 10
         {% if user.is_staff %}
11
-            <a class="float-right d-sm-none" href="{% url 'dashboard:page-update' pk=flatpage.id %}"><small><i class="fas fa-pencil-alt"></i> {% trans "Edit this page" %}</small></a>
11
+            <a class="float-right d-none d-md-block" href="{% url 'dashboard:page-update' pk=flatpage.id %}"><small><i class="fas fa-pencil-alt"></i> {% trans "Edit this page" %}</small></a>
12 12
         {% endif %}
13 13
         <h1>{{ flatpage.title }}</h1>
14 14
     </div>

+ 8
- 8
src/oscar/templates/oscar/basket/partials/basket_content.html Просмотреть файл

@@ -178,10 +178,10 @@
178 178
             <div class="sub-header">
179 179
                 <h2>{% trans "Items to buy later" %}</h2>
180 180
             </div>
181
-            <div class="row basket-title d-sm-none">
182
-                <p class="col-sm-8 h4">{% trans "Items" %}</p>
183
-                <p class="col-sm-2 h4 text-center">{% trans "Price" %}</p>
184
-                <div class="col-sm-2">&nbsp;</div>
181
+            <div class="row basket-title d-none d-md-flex">
182
+                <div class="col-md-8 h4">{% trans "Items" %}</div>
183
+                <div class="col-md-2 h4 text-center">{% trans "Price" %}</div>
184
+                <div class="col-md-2">&nbsp;</div>
185 185
             </div>
186 186
             <form action="{% url 'basket:saved' %}" method="post" id="saved_basket_formset">
187 187
                 {% csrf_token %}
@@ -190,7 +190,7 @@
190 190
                     {% purchase_info_for_product request form.instance.product as session %}
191 191
                     <div class="basket-items">
192 192
                         <div class="row">
193
-                            <div class="col-sm-2">
193
+                            <div class="col-md-2">
194 194
                                 {{ form.id }}
195 195
                                 {% with image=form.instance.product.primary_image %}
196 196
                                     {% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
@@ -199,7 +199,7 @@
199 199
                                     </a>
200 200
                                 {% endwith %}
201 201
                             </div>
202
-                            <div class="col-sm-6">
202
+                            <div class="col-md-6">
203 203
                                 <h3><a href="{{ form.instance.product.get_absolute_url }}">{{ form.instance.description }}</a></h3>
204 204
                                 <p class="availability {{ session.availability.code }}">{{ session.availability.message }}</p>
205 205
                                 <a href="#" data-id="{{ forloop.counter0 }}" data-behaviours="remove">{% trans "Remove" %}</a>
@@ -209,7 +209,7 @@
209 209
                                 </div>
210 210
                             </div>
211 211
                             {% purchase_info_for_product request form.instance.product as saved %}
212
-                            <div class="col-sm-2 text-center">
212
+                            <div class="col-md-2 text-center">
213 213
                                 <p class="price_color">
214 214
                                     {% if saved.price.is_tax_known %}
215 215
                                         {{ saved.price.incl_tax|currency:saved.price.currency }}
@@ -218,7 +218,7 @@
218 218
                                     {% endif %}
219 219
                                 </p>
220 220
                             </div>
221
-                            <div class="col-sm-2">
221
+                            <div class="col-md-2">
222 222
                                 <a href="#" data-id="{{ forloop.counter0 }}" class="btn float-right btn-block" data-behaviours="move">{% trans "Move to basket" %}</a>
223 223
                             </div>
224 224
                         </div>

+ 1
- 1
src/oscar/templates/oscar/catalogue/category.html Просмотреть файл

@@ -13,7 +13,7 @@
13 13
 {% block header%}
14 14
     <div class="page-header">
15 15
         {% if user.is_staff %}
16
-            <a class="float-right d-sm-none" href="{% url 'dashboard:catalogue-category-update' pk=category.id %}">
16
+            <a class="float-right d-none d-md-block" href="{% url 'dashboard:catalogue-category-update' pk=category.id %}">
17 17
               <small><i class="fas fa-pencil-alt"></i> {% trans "Edit this category" %}</small></a>
18 18
         {% endif %}
19 19
         <h1>{% block headertext %}{{ category.name }}{% endblock %}</h1>

+ 1
- 1
src/oscar/templates/oscar/catalogue/detail.html Просмотреть файл

@@ -61,7 +61,7 @@
61 61
                 pops out when clicked.  A bit like the Django-Debug-Toolbar button
62 62
             {% endcomment %}
63 63
             {% if user.is_staff %}
64
-                <a class="float-right d-none d-sm-block" href="{% url 'dashboard:catalogue-product' pk=product.id %}">
64
+                <a class="float-right d-none d-md-block" href="{% url 'dashboard:catalogue-product' pk=product.id %}">
65 65
                     <small><i class="fas fa-pencil-alt"></i> {% trans "Edit this product" %}</small>
66 66
                 </a>
67 67
             {% endif %}

+ 1
- 1
src/oscar/templates/oscar/dashboard/catalogue/category_delete.html Просмотреть файл

@@ -12,7 +12,7 @@
12 12
                     {% trans "Categories" %}
13 13
                 </a>
14 14
             </li>
15
-            <li class="breadcrumb-item active" aria-current="page">{% trans "Delete category?" %}}</li>
15
+            <li class="breadcrumb-item active" aria-current="page">{% trans "Delete category?" %}</li>
16 16
         </ol>
17 17
     </nav>
18 18
 {% endblock %}

+ 1
- 5
src/oscar/templates/oscar/dashboard/catalogue/category_form.html Просмотреть файл

@@ -27,7 +27,7 @@
27 27
 {% block headertext %}{{ title }}{% endblock %}
28 28
 
29 29
 {% block dashboard_content %}
30
-    <form action="{% if request.GET.urlencode %}?{{ request.GET.urlencode }}{% endif %}" method="post" class="form-stacked wysiwyg fixed-actions" enctype="multipart/form-data" data-behaviour="affix-nav-errors" autocomplete="off">
30
+    <form action="{% if request.GET.urlencode %}?{{ request.GET.urlencode }}{% endif %}" method="post" class="form-stacked wysiwyg fixed-actions" enctype="multipart/form-data" data-behaviour="tab-nav-errors" autocomplete="off">
31 31
         {% csrf_token %}
32 32
         <div class="row">
33 33
             {% block tab_nav %}
@@ -83,10 +83,6 @@
83 83
                                 </div>
84 84
                                 <div class="card card-body">
85 85
                                     {% block seo_content %}
86
-                                        <span class="error-block">{{ form.non_field_errors }}</span>
87
-                                        {% for field in form.hidden_fields %}
88
-                                            {{ field }}
89
-                                        {% endfor %}
90 86
                                         {% for field in form.seo_form_fields %}
91 87
                                             {% if 'attr' not in field.id_for_label %}
92 88
                                                 {% include 'oscar/dashboard/partials/form_field.html' with field=field %}

+ 1
- 1
src/oscar/templates/oscar/dashboard/reviews/review_list.html Просмотреть файл

@@ -31,7 +31,7 @@
31 31
     <div class="card card-body">
32 32
         <form method="get" class="form-inline">
33 33
             {% include 'oscar/dashboard/partials/form_fields_inline.html' with form=form %}
34
-            <button type="submit" class="btn btn-primary top-spacer" data-loading-text="{% trans 'Searching...' %}">{% trans "Search" %}</button>
34
+            <button type="submit" class="btn btn-primary" data-loading-text="{% trans 'Searching...' %}">{% trans "Search" %}</button>
35 35
         </form>
36 36
     </div>
37 37
 

+ 1
- 1
src/oscar/templates/oscar/partials/mini_basket.html Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 {% load currency_filters %}
2 2
 {% load i18n %}
3 3
 
4
-<div class="basket-mini col-sm-5 text-right d-none d-sm-block">
4
+<div class="basket-mini col-sm-5 text-right d-none d-md-block">
5 5
     <strong>{% trans "Basket total:" %}</strong>
6 6
     {% if request.basket.is_tax_known %}
7 7
         {{ request.basket.total_incl_tax|currency:request.basket.currency }}

+ 1
- 1
src/oscar/templates/oscar/partials/nav_primary.html Просмотреть файл

@@ -10,7 +10,7 @@
10 10
     {% endblock %}
11 11
 
12 12
     {% block navbar_basket %}
13
-        <a class="btn btn-secondary float-right btn-cart ml-auto d-inline d-sm-none" href="{% url 'basket:summary' %}">
13
+        <a class="btn btn-secondary float-right btn-cart ml-auto d-inline-block d-md-none" href="{% url 'basket:summary' %}">
14 14
             <i class="fas fa-shopping-cart"></i>
15 15
             {% trans "Basket" %}
16 16
             {% if not request.basket.is_empty %}

Загрузка…
Отмена
Сохранить