Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDP-358 Add Vendor Panel to logged in user's main nav dropdown #129

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/views/spree/shared/_link_to_account.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<% if try_spree_current_user %>
<%= link_to Spree.t('nav_bar.my_account'), spree.account_path, class: 'dropdown-item' if spree.respond_to?(:account_path) %>
<% if try_spree_current_user.has_spree_role?(:admin) %>
<%= link_to Spree.t('nav_bar.admin_panel'), spree.admin_orders_path, class: 'dropdown-item text-uppercase' %>
<% elsif try_spree_current_user.has_spree_role?(:vendor) && try_spree_current_user.vendors.any?(&:active?) %>
<%= link_to Spree.t('nav_bar.vendor_panel'), spree.admin_orders_path, class: 'dropdown-item text-uppercase' %>
<% end %>
<%= link_to Spree.t('nav_bar.log_out'), spree_logout_path, class: 'dropdown-item', method: :get if defined?(spree_logout_path) %>
<% else %>
<%= link_to Spree.t('nav_bar.log_in'), spree_login_path, class: 'dropdown-item' if defined?(spree_login_path) %>
<%= link_to Spree.t('nav_bar.sign_up'), spree_signup_path, class: 'dropdown-item' if defined?(spree_signup_path) %>
<% end %>