docbrown/app/views/admin/admin_portals/index.html.erb
Ridhwana 05e31971cb
Navigation Items and Role access for Data Update Scripts (#12292)
* feat: add tech_menu_items to the admin helper

* feat: add the tech resources to /admin  if the user has the correct role

* feat: use a partial that will show the data update scripts in the navbar with the correct role

* chore: use a method

* test: chore

* feat: setup the data to need permission single_resource_admin with DataUpdateScript permissions

* chore: remove the if current_user.tech_admin?

* chore: remove line

* feat: add a DUS for single_resource_admin roles to be added to users with tech_admin roles

* fix: move all teh routes outside of the block where tech_admin is required.

* chore: use the constant and remove the method

* chore: add a comma

* Update config/routes.rb

Co-authored-by: rhymes <rhymes@hey.com>

* feat: add a tech admin role to the dropdown

* feat: add the tech admin role along with single_resource_admin

* chore: oops

* refactor: amend the spec to use let blocks

Co-authored-by: rhymes <rhymes@hey.com>
2021-02-09 17:41:14 +02:00

40 lines
1.4 KiB
Text

<div>
<div class="tag-card crayons-card p-4 m:p-6 m:pt-4 mb-4 flex flex-row relative">
<div class="mr-8">
<div class="crayons-field__description">Last deployed</div>
<div><%= ForemInstance.deployed_at %></div>
</div>
<div>
<div class="crayons-field__description">Latest Commit ID</div>
<div><%= ForemInstance.latest_commit_id || "Not Available" %></div>
</div>
</div>
<div class="grid gap-2 m:gap-4 l:gap-6 m:grid-cols-2 l:grid-cols-3 px-2 m:px-0">
<% admin_menu_items.each do |menu_item| %>
<div class="tag-card crayons-card branded-4 p-4 m:p-6 m:pt-4 flex flex-col relative">
<h3 class="crayons-tag crayons-tag--l mb-2">
<a href="/admin/<%= menu_item[:controller] %>" class="crayons-link">
<%= menu_item[:name].to_s.titleize %>
</a>
</h3>
</div>
<% end %>
</div>
<div class="grid gap-2 m:gap-4 l:gap-6 m:grid-cols-2 l:grid-cols-3 px-2 m:px-0">
<div>
<div class="mt-6 mb-2"> Tech Resources </div>
<% AdminHelper::TECH_MENU_ITEMS.each do |tech_menu_item| %>
<div class="tag-card crayons-card branded-4 p-4 m:p-6 m:pt-4 flex flex-col relative">
<h3 class="crayons-tag crayons-tag--l mb-2">
<a href="/admin/<%= tech_menu_item[:controller] %>" class="crayons-link">
<%= tech_menu_item[:name].to_s.titleize %>
</a>
</h3>
</div>
<% end %>
</div>
</div>
</div>