<%= 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 %>
+
+
+
+ <%= content_for(:title) %>
+
+
+ <% if show_search_bar %>
+ <%= render(
+ "search",
+ search_term: search_term,
+ resource_name: display_resource_name(page.resource_name)
+ ) %>
+ <% end %>
+
+
+ <%= link_to(
+ t(
+ "administrate.actions.new_resource",
+ name: display_resource_name(page.resource_name, singular: true).downcase
+ ),
+ [:new, namespace, page.resource_path.to_sym],
+ class: "button",
+ ) if accessible_action?(new_resource, :new) %>
+
+
+ <%= button_to(
+ t(
+ "manifold.admin.actions.sync_blogs",
+ name: page.resource_name.titleize.downcase
+ ),
+ action: "sync_all",
+ ) %>
+
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 %>
-
-
-
- <%= content_for(:title) %>
-
-
- <% if show_search_bar %>
- <%= render(
- "search",
- search_term: search_term,
- resource_name: display_resource_name(page.resource_name)
- ) %>
- <% end %>
-
-
- <%= link_to(
- t(
- "administrate.actions.new_resource",
- name: page.resource_name.titleize.downcase
- ),
- [:new, namespace, page.resource_path.to_sym],
- class: "button",
- ) if valid_action?(:new) && show_action?(:new, new_resource) %>
-
-
- <%= button_to(
- t(
- "manifold.admin.actions.sync_blogs",
- name: page.resource_name.titleize.downcase
- ),
- action: "sync_all",
- ) %>
-
-
-
+
+ <%= content_for(:title) %>
+
+
+ <% if show_search_bar %>
+ <%= render(
+ "search",
+ search_term: search_term,
+ resource_name: display_resource_name(page.resource_name)
+ ) %>
+ <% end %>
+
+
+ <%= link_to(
+ t(
+ "administrate.actions.new_resource",
+ name: display_resource_name(page.resource_name, singular: true).downcase
+ ),
+ [:new, namespace, page.resource_path.to_sym],
+ class: "button",
+ ) if accessible_action?(new_resource, :new) %>
+
+
+ <%= button_to(
+ t(
+ "manifold.admin.actions.sync_events",
+ name: page.resource_name.titleize.downcase
+ ),
+ action: "sync",
+ ) %>
+
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 %>
-
-
-
- <%= content_for(:title) %>
-
-
- <% if show_search_bar %>
- <%= render(
- "search",
- search_term: search_term,
- resource_name: display_resource_name(page.resource_name)
- ) %>
- <% end %>
-
-
- <%= link_to(
- t(
- "administrate.actions.new_resource",
- name: page.resource_name.titleize.downcase
- ),
- [:new, namespace, page.resource_path.to_sym],
- class: "button",
- ) if valid_action?(:new) && show_action?(:new, new_resource) %>
-
-
- <%= button_to(
- t(
- "manifold.admin.actions.sync_events",
- name: page.resource_name.titleize.downcase
- ),
- action: "sync",
- ) %>
-
-
-
-
- <%= content_for(:title) %>
-
-
-
-
- <%= button_to(
- t(
- "manifold.admin.actions.sync_library_hours",
- name: page.resource_name.titleize.downcase
- ),
- action: "sync",
- ) %>
-
+<%=
+ 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 %>
-
-