rtopitt/bolao2014

View on GitHub
app/views/layouts/_navigation_links.html.erb

Summary

Maintainability
Test Coverage
<%# http://foundation.zurb.com/docs/components/topbar.html %>
<% if logged_in? %>
  <ul class="right">
    <li class="has-dropdown">
      <%= link_to t('my_bet.show.title'), my_bet_path %>
      <ul class="dropdown">
        <li><%= link_to t('my_bet.show.overview'), my_bet_path %></li>
        <li><%= link_to Match.model_name.human(count: 2), my_bet_matches_path %></li>
        <li><%= link_to Question.model_name.human(count: 2), my_bet_questions_path %></li>
        <li><%= link_to Payment.model_name.human(count: 1), my_bet_payment_path %></li>
      </ul>
    </li>

    <li class="has-dropdown">
      <%= link_to current_user.email, 'javascript:void(0)' %>
      <ul class="dropdown">
        <li><%= link_to t('common.settings'), 'javascript:void(0)', onclick: "alert('#{I18n.t('common.soon')}');" %></li>
        <li><%= link_to t('common.logout'), logout_path %></li>
      </ul>
    </li>
  </ul>

  <ul class="left">
    <li><%= link_to Match.model_name.human(count: 2), matches_path %></li>
    <li><%= link_to Question.model_name.human(count: 2), questions_path %></li>
    <li><%= link_to Bet.model_name.human(count: 2), bets_path %></li>
    <li><%= link_to t('pages.help.title'), help_path %></li>
  </ul>
<% else %>
  <ul class="right">
    <li><%= link_to t('common.login'), login_path %></li>
  </ul>

  <ul class="left">
    <li><%= link_to t('pages.help.title'), help_path %></li>
  </ul>
<% end %>