<%= link_to root_path, class: "navbar-brand" do %> <%= image_tag 'logo.jpg', alt: t('alt_logo'), class: 'img-circle' %> <%= t('title') %> <% end %>
    <% if current_user && current_user.admin? && request.path =~ /admin/ %> <%= render 'layouts/navbar_admin' %> <% end %>
    <% if current_user && current_user.admin? %> <% if request.path =~ /admin/ %>
  • <%= link_to content_tag(:strong, 'Accueil'), root_path %>
  • <% else %>
  • <%= link_to content_tag(:strong, 'Administration'), admin_root_path %>
  • <% end %> <% end %> <% if !user_signed_in? %>
  • <%= link_to t('links.sign_in'), new_user_session_path %>
  • <%= link_to t('links.sign_up'), new_registration_path(:user) %>
  • <% else %>
    • <%= link_to edit_user_registration_path do %> <%= t('links.edit_profile') %> <% end %>
    • <%= link_to edit_email_subscriptions_path do %> <%= t('links.edit_email_subscriptions') %> <% end %>
    • <%= link_to destroy_user_session_path, data:{method: :delete} do %> <%= t('links.sign_out') %> <% end %>
  • <% end %> <% unless params[:controller] =~ /admin/ %>
  • <% if I18n.locale == :fr %> <%= link_to url_for(locale: 'en'), title: 'Switch to English' do %> <%= flag_tag(:en) %> <% end %> <% else %> <%= link_to url_for(locale: 'fr'), title: 'Voir le site en français' do %> <%= flag_tag(:fr) %> <% end %> <% end %>
  • <% end %>