diff --git a/app/views/admin/application_failovers/index.html.erb b/app/views/admin/application_failovers/index.html.erb index 0589c4ec1..3fe4fec3e 100644 --- a/app/views/admin/application_failovers/index.html.erb +++ b/app/views/admin/application_failovers/index.html.erb @@ -23,15 +23,14 @@ It renders the `_table` partial to display details about the resources. [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection %> -<% content_for(:title) do %> - <%= display_resource_name(page.resource_name) %> -<% end %> - - +<%= + render("index_header", + resources: resources, + search_term: search_term, + page: page, + show_search_bar: false, + ) +%>
<%= render( @@ -50,5 +49,4 @@ It renders the `_table` partial to display details about the resources.

The description text can be customized to provide additional context to users. It will be displayed once the Search button is clicked.

-
diff --git a/app/views/admin/blogs/_index_header.html.erb b/app/views/admin/blogs/_index_header.html.erb new file mode 100644 index 000000000..93580912b --- /dev/null +++ b/app/views/admin/blogs/_index_header.html.erb @@ -0,0 +1,36 @@ +<% content_for(:title) do %> + <%= display_resource_name(page.resource_name) %> +<% end %> + + diff --git a/app/views/admin/blogs/index.html.erb b/app/views/admin/blogs/index.html.erb deleted file mode 100644 index a4e1fbbfa..000000000 --- a/app/views/admin/blogs/index.html.erb +++ /dev/null @@ -1,74 +0,0 @@ -<%# -# Index - -This view is the template for the index page. -It is responsible for rendering the search bar, header and pagination. -It renders the `_table` partial to display details about the resources. - -## Local variables: - -- `page`: - An instance of [Administrate::Page::Collection][1]. - Contains helper methods to help display a table, - and knows which attributes should be displayed in the resource's table. -- `resources`: - An instance of `ActiveRecord::Relation` containing the resources - that match the user's search criteria. - By default, these resources are passed to the table partial to be displayed. -- `search_term`: - A string containing the term the user has searched for, if any. -- `show_search_bar`: - A boolean that determines if the search bar should be shown. - -[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection -%> - -<% content_for(:title) do %> - <%= display_resource_name(page.resource_name) %> -<% end %> - - - -
- <%= render( - "collection", - collection_presenter: page, - collection_field_name: resource_name, - page: page, - resources: resources, - table_title: "page-title" - ) %> - - <%= paginate resources %> -
diff --git a/app/views/admin/events/_index_header.html.erb b/app/views/admin/events/_index_header.html.erb new file mode 100644 index 000000000..bb1ac63e5 --- /dev/null +++ b/app/views/admin/events/_index_header.html.erb @@ -0,0 +1,36 @@ +<% content_for(:title) do %> + <%= display_resource_name(page.resource_name) %> +<% end %> + + diff --git a/app/views/admin/events/index.html.erb b/app/views/admin/events/index.html.erb deleted file mode 100644 index a7d1ec19e..000000000 --- a/app/views/admin/events/index.html.erb +++ /dev/null @@ -1,74 +0,0 @@ -<%# -# Index - -This view is the template for the index page. -It is responsible for rendering the search bar, header and pagination. -It renders the `_table` partial to display details about the resources. - -## Local variables: - -- `page`: - An instance of [Administrate::Page::Collection][1]. - Contains helper methods to help display a table, - and knows which attributes should be displayed in the resource's table. -- `resources`: - An instance of `ActiveRecord::Relation` containing the resources - that match the user's search criteria. - By default, these resources are passed to the table partial to be displayed. -- `search_term`: - A string containing the term the user has searched for, if any. -- `show_search_bar`: - A boolean that determines if the search bar should be shown. - -[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection -%> - -<% content_for(:title) do %> - <%= display_resource_name(page.resource_name) %> -<% end %> - - - -
- <%= render( - "collection", - collection_presenter: page, - collection_field_name: resource_name, - page: page, - resources: resources, - table_title: "page-title" - ) %> - - <%= paginate resources %> -
diff --git a/app/views/admin/library_hours/_index_header.html.erb b/app/views/admin/library_hours/_index_header.html.erb new file mode 100644 index 000000000..c449216a4 --- /dev/null +++ b/app/views/admin/library_hours/_index_header.html.erb @@ -0,0 +1,33 @@ +<% content_for(:title) do %> + <%= display_resource_name(page.resource_name) %> +<% end %> + + + +
+
+
+ <% unless @last_sync.nil? %> +

Last Library Hours Sync: + <%= @last_sync.updated_at.in_time_zone.strftime("%m/%e/%Y %l:%M %p") %> +

+ <% end %> + +

<%= link_to "Library Hours Public Page", hours_path %>

+
+ +
+
+ diff --git a/app/views/admin/library_hours/index.html.erb b/app/views/admin/library_hours/index.html.erb index 46807ba0f..eba1336d3 100644 --- a/app/views/admin/library_hours/index.html.erb +++ b/app/views/admin/library_hours/index.html.erb @@ -23,37 +23,15 @@ It renders the `_table` partial to display details about the resources. [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection %> -<% content_for(:title) do %> - <%= display_resource_name(page.resource_name) %> -<% end %> - - +<%= + render("index_header", + resources: resources, + search_term: search_term, + page: page, + show_search_bar: false, + ) +%>
-
-
- <% unless @last_sync.nil? %> -

Last Library Hours Sync: - <%= @last_sync.updated_at.in_time_zone.strftime("%m/%e/%Y %l:%M %p") %> -

- <% end %> - -

<%= link_to "Library Hours Public Page", hours_path %>

-
-