Skip to content

Commit

Permalink
Merge pull request #2739 from tulibraries/qa
Browse files Browse the repository at this point in the history
Administrate 1.18 Fallout
  • Loading branch information
cdoyle-temple authored Feb 20, 2023
2 parents 323e24e + 8555d06 commit 169a0af
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 188 deletions.
18 changes: 8 additions & 10 deletions app/views/admin/application_failovers/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>

<header class="main-content__header" role="banner">
<h1 class="main-content__page-title" id="page-title">
<%= content_for(:title).singularize %>
</h1>
</header>
<%=
render("index_header",
resources: resources,
search_term: search_term,
page: page,
show_search_bar: false,
)
%>

<section class="main-content__body main-content__body--flush">
<%= render(
Expand All @@ -50,5 +49,4 @@ It renders the `_table` partial to display details about the resources.
<p>The description text can be customized to provide additional context to users. It will be displayed once the Search button is clicked.</p>

</div>

</section>
36 changes: 36 additions & 0 deletions app/views/admin/blogs/_index_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<% content_for(:title) do %>
<%= display_resource_name(page.resource_name) %>
<% end %>

<header class="main-content__header" role="banner">
<h1 class="main-content__page-title" id="page-title">
<%= content_for(:title) %>
</h1>

<% if show_search_bar %>
<%= render(
"search",
search_term: search_term,
resource_name: display_resource_name(page.resource_name)
) %>
<% end %>

<div>
<%= 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) %>
</div>
&nbsp;
<%= button_to(
t(
"manifold.admin.actions.sync_blogs",
name: page.resource_name.titleize.downcase
),
action: "sync_all",
) %>
</header>
74 changes: 0 additions & 74 deletions app/views/admin/blogs/index.html.erb

This file was deleted.

36 changes: 36 additions & 0 deletions app/views/admin/events/_index_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<% content_for(:title) do %>
<%= display_resource_name(page.resource_name) %>
<% end %>

<header class="main-content__header" role="banner">
<h1 class="main-content__page-title" id="page-title">
<%= content_for(:title) %>
</h1>

<% if show_search_bar %>
<%= render(
"search",
search_term: search_term,
resource_name: display_resource_name(page.resource_name)
) %>
<% end %>

<div>
<%= 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) %>
</div>
&nbsp;
<%= button_to(
t(
"manifold.admin.actions.sync_events",
name: page.resource_name.titleize.downcase
),
action: "sync",
) %>
</header>
74 changes: 0 additions & 74 deletions app/views/admin/events/index.html.erb

This file was deleted.

33 changes: 33 additions & 0 deletions app/views/admin/library_hours/_index_header.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<% content_for(:title) do %>
<%= display_resource_name(page.resource_name) %>
<% end %>

<header class="main-content__header" role="banner">
<h1 class="main-content__page-title" id="page-title">
<%= content_for(:title) %>
</h1>

<%= button_to(
t(
"manifold.admin.actions.sync_library_hours",
name: page.resource_name.titleize.downcase
),
action: "sync",
) %>
</header>

<section class="main-content__body main-content__body--flush">
<div class="container">
<div id="last-sync">
<% unless @last_sync.nil? %>
<p>Last Library Hours Sync:
<%= @last_sync.updated_at.in_time_zone.strftime("%m/%e/%Y %l:%M %p") %>
</p>
<% end %>

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

</div>
</section>

38 changes: 8 additions & 30 deletions app/views/admin/library_hours/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>

<header class="main-content__header" role="banner">
<h1 class="main-content__page-title" id="page-title">
<%= content_for(:title) %>
</h1>


<div>
<%= button_to(
t(
"manifold.admin.actions.sync_library_hours",
name: page.resource_name.titleize.downcase
),
action: "sync",
) %>
</header>
<%=
render("index_header",
resources: resources,
search_term: search_term,
page: page,
show_search_bar: false,
)
%>

<section class="main-content__body main-content__body--flush">
<div class="container">
<div id="last-sync">
<% unless @last_sync.nil? %>
<p>Last Library Hours Sync:
<%= @last_sync.updated_at.in_time_zone.strftime("%m/%e/%Y %l:%M %p") %>
</p>
<% end %>

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

</div>
</section>

0 comments on commit 169a0af

Please sign in to comment.