Skip to content

Commit

Permalink
Add areas sub section
Browse files Browse the repository at this point in the history
This sub section will display tabs for the zones, countries, and states
pages.
  • Loading branch information
Murph33 committed Mar 14, 2016
1 parent f4c6150 commit 5a58186
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions backend/app/views/spree/admin/shared/_areas_tabs.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<% content_for :tabs do %>
<nav>
<ul class="tabs" data-hook="admin_settings_areas_tabs">
<% if can? :display, Spree::Zone %>
<%= settings_tab_item Spree::Zone.model_name.human(count: :other), admin_zones_path %>
<% end %>
<% if can? :display, Spree::Country %>
<%= settings_tab_item Spree::Country.model_name.human(count: :other), admin_countries_path %>
<% end %>
<% if can?(:display, Spree::State) %>
<% if country = Spree::Country.find_by(iso: Spree::Config[:default_country_iso]) || Spree::Country.first %>
<%= settings_tab_item Spree::State.model_name.human(count: :other), admin_country_states_path(country) %>
<% end %>
<% end %>
</ul>
</nav>
<% end %>

0 comments on commit 5a58186

Please sign in to comment.