From 6ad306b3cf26aa49af4408fbdfd8f6a3d5ed5caa Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 23 Apr 2019 23:55:37 -0400 Subject: [PATCH] Update the way the no-result template is shown Signed-off-by: Roberto Rosario --- HISTORY.rst | 3 +- docs/releases/3.2.rst | 1 + .../generic_list_items_subtemplate.html | 236 +++++++------- .../appearance/generic_list_subtemplate.html | 292 +++++++++--------- 4 files changed, 267 insertions(+), 265 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index c3eb80a40a..14a359977e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -127,7 +127,8 @@ previour sidebar menu now perform the same function. * Backport source column identifiable and sortable improvements. - +* Update the way the no-result template is shown. + 3.1.11 (2019-04-XX) =================== * Fix multiple tag selection wizard step. diff --git a/docs/releases/3.2.rst b/docs/releases/3.2.rst index 4ae92d6e40..d9e37282c3 100644 --- a/docs/releases/3.2.rst +++ b/docs/releases/3.2.rst @@ -159,6 +159,7 @@ Other changes previour sidebar menu now perform the same function. * Backport source column identifiable and sortable improvements. +* Update the way the no-result template is shown. Removals 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 ca837c505d..ebad84848d 100644 --- a/mayan/apps/appearance/templates/appearance/generic_list_items_subtemplate.html +++ b/mayan/apps/appearance/templates/appearance/generic_list_items_subtemplate.html @@ -6,138 +6,138 @@
-

- {% 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' %}
- - {% if object_list %} -
- {% endif %} - -
- {% for object in object_list %} -
-
-
-
-
- -
-
- -
-
- - {% if not hide_columns %} - {% navigation_get_source_columns source=object exclude_identifier=True as source_columns %} - {% for column in source_columns %} -
{% navigation_source_column_resolve column=column as column_value %}{% if column_value != '' %}{% if column.include_label %}{{ column.label }}: {% endif %}{{ column_value }}{% endif %}
- {% endfor %} + {% 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 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 column in extra_columns %} -
{{ column.name }}: {{ object|object_property:column.attribute }}
- {% endfor %} + {% if object_list %} +
+ {% endif %} - {% if not hide_links %} +
+ {% for object in object_list %} +
+
+
+
+
+ +
+
- {% if facet_menus_link_results %} - +
- {% with link_group.links as object_navigation_links %} - {% with 'true' as as_li %} - {% with 'true' as hide_active_anchor %} - {% with 'btn-sm' as link_classes %} - {% include 'navigation/generic_navigation.html' %} - {% endwith %} - {% endwith %} - {% endwith %} - {% endwith %} + {% if not hide_columns %} + {% navigation_get_source_columns source=object exclude_identifier=True as source_columns %} + {% for column in source_columns %} +
{% navigation_source_column_resolve column=column as column_value %}{% if column_value != '' %}{% if column.include_label %}{{ column.label }}: {% endif %}{{ column_value }}{% endif %}
+ {% endfor %} + {% endif %} + + {% for column in extra_columns %} +
{{ column.name }}: {{ object|object_property:column.attribute }}
+ {% endfor %} + + {% if not hide_links %} + + {% navigation_resolve_menus names='list facet,object' source=object as facet_menus_link_results %} + + {% if facet_menus_link_results %} + + +
+ {% endif %} {% endif %} - {% endif %} +
-
- {% empty %} -
- {% include 'appearance/no_results.html' %} -
- - {% endfor %} + {% 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 0222d858c1..da703abf86 100644 --- a/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html +++ b/mayan/apps/appearance/templates/appearance/generic_list_subtemplate.html @@ -6,172 +6,172 @@
-

- {% 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 %} +
+
+
+ + {% 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 multi_item_actions %} -
- {{ multi_item_form }} -
- {% endif %} - {% endif %} - + +
-
-
- - - {% if not hide_header %} - - {% if multi_item_actions %} - - {% endif %} - - {% if not hide_object %} - - {% else %} - {% navigation_get_source_columns source=object_list only_identifier=True as source_column %} - {% if source_column %} - +
+
{% trans 'Identifier' %} - {% if source_column.is_sortable %} - {{ source_column.label }} - {% if navigation_source_column.get_sort_field == sort_field %} - {% if icon_sort %}{{ icon_sort.render }}{% endif %} - {% endif %} - - {% else %} - {{ source_column.label }} - {% endif %} -
+ + {% if not hide_header %} + + {% if multi_item_actions %} + {% endif %} - {% endif %} - {% if not hide_columns %} - {% navigation_get_source_columns source=object_list exclude_identifier=True as source_columns %} - {% for column in source_columns %} - + {% else %} + {% navigation_get_source_columns source=object_list only_identifier=True as source_column %} + {% if source_column %} + + + {% endif %} + {% endif %} + + {% if not hide_columns %} + {% navigation_get_source_columns source=object_list exclude_identifier=True as source_columns %} + {% for column in source_columns %} + + {% endfor %} + {% endif %} + + {% for column in extra_columns %} + {% endfor %} - {% endif %} - {% for column in extra_columns %} - - {% endfor %} + {% if not hide_links %} + + {% endif %} + + {% endif %} + {% for object in object_list %} + - {% if not hide_links %} - - {% endif %} - - {% endif %} - {% for object in object_list %} - - - {% if multi_item_actions %} - - {% endif %} - - {% if not hide_object %} - - {% else %} - {% navigation_get_source_columns source=object only_identifier=True as source_column %} - {% navigation_source_column_resolve column=source_column as column_value %} - {% if column_value %} + {% if multi_item_actions %} {% endif %} - {% endif %} - {% if not hide_columns %} - {% navigation_get_source_columns source=object exclude_identifier=True as source_columns %} - {% for column in source_columns %} - + {% if not hide_object %} + + {% else %} + {% navigation_get_source_columns source=object only_identifier=True as source_column %} + {% navigation_source_column_resolve column=source_column as column_value %} + {% if column_value %} + + {% endif %} + {% endif %} + + {% if not hide_columns %} + {% navigation_get_source_columns source=object exclude_identifier=True as source_columns %} + {% for column in source_columns %} + + {% endfor %} + {% endif %} + + {% for column in extra_columns %} + {% endfor %} - {% endif %} - {% for column in extra_columns %} - - {% endfor %} - - {% if not hide_links %} - - {% endif %} - - {% empty %} - - - - {% endfor %} - -
- {% if column.is_sortable %} - {{ column.label }} - {% if column.get_sort_field == sort_field %} - {% if icon_sort %}{{ icon_sort.render }}{% endif %} + {% if not hide_object %} + {% trans 'Identifier' %} + {% if source_column.is_sortable %} + {{ source_column.label }} + {% if navigation_source_column.get_sort_field == sort_field %} + {% if icon_sort %}{{ icon_sort.render }}{% endif %} + {% endif %} + + {% else %} + {{ source_column.label }} {% endif %} - - {% else %} - {{ column.label }} - {% endif %} - + {% if column.is_sortable %} + {{ column.label }} + {% if column.get_sort_field == sort_field %} + {% if icon_sort %}{{ icon_sort.render }}{% endif %} + {% endif %} + + {% else %} + {{ column.label }} + {% endif %} + {{ column.name }}{{ column.name }} 
 
- - {% if not hide_link %}{{ object }}{% else %}{{ object }}{% endif %} - {% if source_column.is_absolute_url %} - {{ column_value }} - {% else %} - {{ column_value }} - {% endif %} + -
- {% navigation_source_column_resolve column=column as column_value %}{{ column_value }} - {# Use explicit 'as column_value ' to force date rendering #} -
-
{% if not hide_link %}{{ object }}{% else %}{{ object }}{% endif %} + {% if source_column.is_absolute_url %} + {{ column_value }} + {% else %} + {{ column_value }} + {% endif %} + +
+ {% navigation_source_column_resolve column=column as column_value %}{{ column_value }} + {# Use explicit 'as column_value ' to force date rendering #} +
+
{{ object|object_property:column.attribute }}{{ object|object_property:column.attribute }} - {% navigation_resolve_menu name='list facet' sort_results=True source=object as facet_menus_results %} - {% for facet_menu_results in facet_menus_results %} - {% for link_group in facet_menu_results.link_groups %} - {% with link_group.links as object_navigation_links %} - {% with 'true' as horizontal %} - {% with 'true' as hide_icon %} - {% include 'navigation/generic_navigation.html' %} - {% endwith %} - {% endwith %} - {% endwith %} + {% if not hide_links %} + + {% navigation_resolve_menu name='list facet' sort_results=True source=object as facet_menus_results %} + {% for facet_menu_results in facet_menus_results %} + {% for link_group in facet_menu_results.link_groups %} + {% with link_group.links as object_navigation_links %} + {% with 'true' as horizontal %} + {% with 'true' as hide_icon %} + {% include 'navigation/generic_navigation.html' %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endfor %} {% endfor %} - {% endfor %} - {% navigation_resolve_menu name='object' source=object as object_menus_results %} - {% for object_menu_results in object_menus_results %} - {% for link_group in object_menu_results.link_groups %} - {% with link_group.links as object_navigation_links %} - {% with 'true' as horizontal %} - {% with 'true' as hide_icon %} - {% include 'navigation/generic_navigation.html' %} - {% endwith %} - {% endwith %} - {% endwith %} + {% navigation_resolve_menu name='object' source=object as object_menus_results %} + {% for object_menu_results in object_menus_results %} + {% for link_group in object_menu_results.link_groups %} + {% with link_group.links as object_navigation_links %} + {% with 'true' as horizontal %} + {% with 'true' as hide_icon %} + {% include 'navigation/generic_navigation.html' %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endfor %} {% endfor %} - {% endfor %} -
- {% include 'appearance/no_results.html' %} -
+ + {% endif %} + + {% endfor %} + + +
+ {% include 'pagination/pagination.html' %}
- {% include 'pagination/pagination.html' %} -
+ {% endif %}