diff --git a/app/views/_toolbar.html.erb b/app/views/_toolbar.html.erb
index ba14ea26ce..3c3d2a7887 100644
--- a/app/views/_toolbar.html.erb
+++ b/app/views/_toolbar.html.erb
@@ -1,55 +1,39 @@
<% if user_signed_in? %>
- <% if can? :manage, :all %>
- -
- <%= link_to sufia.admin_stats_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
- Admin
- <% end %>
-
-
- <% end %>
-
+ <%= render '/admin/menu' if can? :manage, :all %>
-
<%= link_to sufia.dashboard_index_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
- Dashboard
+ <%= t("sufia.toolbar.dashboard.menu") %>
<% end %>
<% if can_ever_create_works? %>
-
<%= link_to sufia.dashboard_works_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
- Works
+ <%= t("sufia.toolbar.works.menu") %>
<% end %>
<% end %>
@@ -57,11 +41,11 @@
<% if can?(:create, Collection) %>
-
<%= link_to sufia.dashboard_collections_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
- Collections
+ <%= t("sufia.toolbar.collections.menu") %>
<% end %>
<% end %>
diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb
new file mode 100644
index 0000000000..39f9864ad7
--- /dev/null
+++ b/app/views/admin/_menu.html.erb
@@ -0,0 +1,10 @@
+-
+ <%= link_to sufia.admin_stats_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
+ <%= t("sufia.toolbar.admin.menu") %>
+ <% end %>
+
+
diff --git a/config/locales/sufia.en.yml b/config/locales/sufia.en.yml
index 1ec13e65ea..772f9f339c 100644
--- a/config/locales/sufia.en.yml
+++ b/config/locales/sufia.en.yml
@@ -73,6 +73,26 @@ en:
details: 'Details'
tab_label: 'Recently Uploaded'
no_public: 'No public work has been contributed.'
+ toolbar:
+ admin:
+ menu: "Admin"
+ statistics: "Repository Statistics"
+ queues: "Message Queues"
+ dashboard:
+ menu: "Dashboard"
+ my: "My Dashboard"
+ highlights: "Highlights"
+ transfers: "Transfers"
+ shares: "Shares"
+ works:
+ menu: "Works"
+ new: "New"
+ my: "My Works"
+ batch: "Batch Create"
+ collections:
+ menu: "Collections"
+ my: "My Collections"
+ new: "New Collection"
dashboard:
title: "My Dashboard"
view_collections: "View Collections"
diff --git a/spec/views/_toolbar.html.erb_spec.rb b/spec/views/_toolbar.html.erb_spec.rb
index 30e3d615f1..5cc1b5b8f9 100644
--- a/spec/views/_toolbar.html.erb_spec.rb
+++ b/spec/views/_toolbar.html.erb_spec.rb
@@ -19,6 +19,17 @@
end
end
+ context 'with an admin user' do
+ before do
+ allow(view).to receive(:can?).with(:manage, :all).and_return(true)
+ end
+
+ it 'shows the admin menu' do
+ render
+ expect(rendered).to have_link 'Admin', sufia.admin_stats_path
+ end
+ end
+
it 'has dashboard links' do
render
expect(rendered).to have_link 'My Dashboard', sufia.dashboard_index_path