From d210f05aa648b85e1181e4e3212c5713d6bdfbf1 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 30 Nov 2018 04:33:45 -0400 Subject: [PATCH] Appearance: Homogenize the no-result template look Make sure the no-result template looks the same when included from all the parent templates. Signed-off-by: Roberto Rosario --- .../appearance/generic_list_horizontal.html | 2 +- .../generic_list_items_subtemplate.html | 176 +++++++------- .../appearance/generic_list_subtemplate.html | 218 +++++++++--------- 3 files changed, 198 insertions(+), 198 deletions(-) diff --git a/mayan/apps/appearance/templates/appearance/generic_list_horizontal.html b/mayan/apps/appearance/templates/appearance/generic_list_horizontal.html index 94c10d0dea..b3c91f3bd5 100644 --- a/mayan/apps/appearance/templates/appearance/generic_list_horizontal.html +++ b/mayan/apps/appearance/templates/appearance/generic_list_horizontal.html @@ -14,7 +14,7 @@ {% for object_navigation_links in resolved_links %} {% include 'navigation/generic_navigation.html' %} {% empty %} -

+

{% include 'appearance/no_results.html' %}

{% endfor %} diff --git a/mayan/apps/appearance/templates/appearance/generic_list_items_subtemplate.html b/mayan/apps/appearance/templates/appearance/generic_list_items_subtemplate.html index a8559717b4..8386f9d7f9 100644 --- a/mayan/apps/appearance/templates/appearance/generic_list_items_subtemplate.html +++ b/mayan/apps/appearance/templates/appearance/generic_list_items_subtemplate.html @@ -6,110 +6,112 @@
-

- {% if page_obj %} - {% if page_obj.paginator.num_pages != 1 %} - {% blocktrans with page_obj.start_index as start and page_obj.end_index as end and page_obj.paginator.object_list|length as total and page_obj.number as page_number and page_obj.paginator.num_pages as total_pages %}Total ({{ start }} - {{ end }} out of {{ total }}) (Page {{ page_number }} of {{ total_pages }}){% endblocktrans %} - {% else %} - {% blocktrans with page_obj.paginator.object_list|length as total %}Total: {{ total }}{% endblocktrans %} - {% endif %} - {% else %} - {% blocktrans with object_list|length as total %}Total: {{ total }}{% endblocktrans %} - {% endif %} -

-
-
-
-
-
- {% if object_list %} - {% if not hide_multi_item_actions %} - {% get_multi_item_links_form object_list %} - {% endif %} - {% if multi_item_actions %} -
-   - {{ multi_item_form }} -
- {% endif %} - {% endif %} -
-
+ {% if not object_list %} +
+ {% include 'appearance/no_results.html' %}
+ {% else %} - {% if object_list %} -
- {% endif %} +

+ {% if page_obj %} + {% if page_obj.paginator.num_pages != 1 %} + {% blocktrans with page_obj.start_index as start and page_obj.end_index as end and page_obj.paginator.object_list|length as total and page_obj.number as page_number and page_obj.paginator.num_pages as total_pages %}Total ({{ start }} - {{ end }} out of {{ total }}) (Page {{ page_number }} of {{ total_pages }}){% endblocktrans %} + {% else %} + {% blocktrans with page_obj.paginator.object_list|length as total %}Total: {{ total }}{% endblocktrans %} + {% endif %} + {% else %} + {% blocktrans with object_list|length as total %}Total: {{ total }}{% endblocktrans %} + {% endif %} +

+
+
+
+
+
+ {% if object_list %} + {% if not hide_multi_item_actions %} + {% get_multi_item_links_form object_list %} + {% endif %} + {% if multi_item_actions %} +
+   + {{ multi_item_form }} +
+ {% endif %} + {% endif %} +
+
+
-
- {% for object in object_list %} -
-
-
-
-
-
- {% endfor %} + {% include 'pagination/pagination.html' %}
- - {% include 'pagination/pagination.html' %} -
+ {% endif %}
diff --git a/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html b/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html index 8e84743df2..07a67d0085 100644 --- a/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html +++ b/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html @@ -6,126 +6,124 @@
-

- {% if page_obj %} - {% if page_obj.paginator.num_pages != 1 %} - {% blocktrans with page_obj.start_index as start and page_obj.end_index as end and page_obj.paginator.object_list|length as total and page_obj.number as page_number and page_obj.paginator.num_pages as total_pages %}Total ({{ start }} - {{ end }} out of {{ total }}) (Page {{ page_number }} of {{ total_pages }}){% endblocktrans %} + {% if not object_list %} +
+ {% include 'appearance/no_results.html' %} +
+ {% else %} +

+ {% if page_obj %} + {% if page_obj.paginator.num_pages != 1 %} + {% blocktrans with page_obj.start_index as start and page_obj.end_index as end and page_obj.paginator.object_list|length as total and page_obj.number as page_number and page_obj.paginator.num_pages as total_pages %}Total ({{ start }} - {{ end }} out of {{ total }}) (Page {{ page_number }} of {{ total_pages }}){% endblocktrans %} + {% else %} + {% blocktrans with page_obj.paginator.object_list|length as total %}Total: {{ total }}{% endblocktrans %} + {% endif %} {% else %} - {% blocktrans with page_obj.paginator.object_list|length as total %}Total: {{ total }}{% endblocktrans %} + {% blocktrans with object_list|length as total %}Total: {{ total }}{% endblocktrans %} {% endif %} - {% else %} - {% blocktrans with object_list|length as total %}Total: {{ total }}{% endblocktrans %} - {% endif %} -

-
+ +
-
-
-
-
- {% if object_list %} - {% if not hide_multi_item_actions %} - {% get_multi_item_links_form object_list %} - {% endif %} - {% if multi_item_actions %} -
- {{ multi_item_form }} -
- {% endif %} - {% endif %} -
-
-
- -
- - - {% if not hide_header %} - +
+
+
+
+ {% if object_list %} + {% if not hide_multi_item_actions %} + {% get_multi_item_links_form object_list %} + {% endif %} {% if multi_item_actions %} -
+
+ {{ multi_item_form }} +
{% endif %} + {% endif %} + + + +
+
+ + {% if not hide_header %} + + {% if multi_item_actions %} + + {% endif %} + + {% if not hide_object %} + + {% endif %} + + {% if not hide_columns %} + {% for column in object_list|get_source_columns %} + + {% endfor %} + {% endif %} + + {% for column in extra_columns %} + + {% endfor %} + + {% if not hide_links %} + + {% endif %} + + {% endif %} + {% for object in object_list %} + + {% if multi_item_actions %} + + {% endif %} {% if not hide_object %} - - {% endif %} - - {% if not hide_columns %} - {% for column in object_list|get_source_columns %} - - {% endfor %} - {% endif %} - - {% for column in extra_columns %} - - {% endfor %} - - {% if not hide_links %} - - {% endif %} - - {% endif %} - {% for object in object_list %} - - - {% if multi_item_actions %} - - {% endif %} - {% if not hide_object %} - {% if main_object %} - {% with object|object_property:main_object as object %} + {% if main_object %} + {% with object|object_property:main_object as object %} + + {% endwith %} + {% else %} - {% endwith %} - {% else %} - + {% endif %} {% endif %} - {% endif %} - {% if not hide_columns %} - {% for column in object|get_source_columns %} - + {% if not hide_columns %} + {% for column in object|get_source_columns %} + + {% endfor %} + {% endif %} + {% for column in extra_columns %} + {% endfor %} - {% endif %} - {% for column in extra_columns %} - - {% endfor %} - {% if not hide_links %} - - {% endif %} - - {% empty %} - - - - {% endfor %} - -
{% trans 'Identifier' %}{{ column.label }}{{ column.name }} 
+ {% if multi_select_item_properties %} + + {% else %} + + {% endif %} + {% trans 'Identifier' %}{{ column.label }}{{ column.name }} 
- {% if multi_select_item_properties %} - - {% else %} - - {% endif %} - {% if not hide_link %}{{ object }}{% else %}{{ object }}{% endif %}{% if not hide_link %}{{ object }}{% else %}{{ object }}{% endif %}{% if not hide_link %}{{ object }}{% else %}{{ object }}{% endif %}{% source_column_resolve column=column %}{{ column_result }}{% source_column_resolve column=column %}{{ column_result }}{{ object|object_property:column.attribute }}{{ object|object_property:column.attribute }} - {% get_menu_links 'object list facet' sort_results=True source=object as resolved_links %} - {% for object_navigation_links in resolved_links %} - {% with 'true' as horizontal %} - {% with 'true' as hide_icon %} - {% include 'navigation/generic_navigation.html' %} - {% endwith %} - {% endwith %} - {% endfor %} - {% get_menu_links 'object menu' source=object as resolved_links %} - {% for object_navigation_links in resolved_links %} - {% with 'true' as horizontal %} - {% with 'true' as hide_icon %} - {% include 'navigation/generic_navigation.html' %} - {% endwith %} - {% endwith %} - {% endfor %} -
- {% include 'appearance/no_results.html' %} -
+ {% if not hide_links %} + + {% get_menu_links 'object list facet' sort_results=True source=object as resolved_links %} + {% for object_navigation_links in resolved_links %} + {% with 'true' as horizontal %} + {% with 'true' as hide_icon %} + {% include 'navigation/generic_navigation.html' %} + {% endwith %} + {% endwith %} + {% endfor %} + {% get_menu_links 'object menu' source=object as resolved_links %} + {% for object_navigation_links in resolved_links %} + {% with 'true' as horizontal %} + {% with 'true' as hide_icon %} + {% include 'navigation/generic_navigation.html' %} + {% endwith %} + {% endwith %} + {% endfor %} + + {% endif %} + + + +
+ {% include 'pagination/pagination.html' %}
- {% include 'pagination/pagination.html' %} -
+ {% endif %}