jjeremydiaz/OpenHouse

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

Summary

Maintainability
Test Coverage
<nav class="navbar navbar-default navbar-fixed-top">
  <div id="topbar" class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand topbar-link" href="/">
        <svg id="topbar-logo" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" viewBox="0 0 321.7 129.7" enable-background="new 0 0 321.668 129.72" xml:space="preserve">
          <switch><foreignObject requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/" x="0" y="0" width="1" height="1"/><path id="openhouse-svg" d="M94.8 39.2c-0.4 5.9 0.9 10.5 2 15 1.3 4.9-2.7 3.7-4.8 4.5 -2.3 1-3.7 0-4-2.7 -0.5-4.1-1.5-8.1-1.9-12.2 -0.3-2.7-1.3-4.1-4.1-5.1 -10.7-3.6-21.3-7.4-31.8-11.5 -5-2-8.4-1.8-12.4 2.4 -8 8.5-16.7 16.4-25.3 24.4 -2 1.9-2.8 3.4-1.5 6.2 1.7 3.9 2.5 8.2 3.8 12.3 1 3.3-1.1 4-3.6 4.3 -2 0.3-4.3 1.6-5.1-2.3 -1-5.3-3-10.4-5.2-15.4 -1.5-3.3-1.1-6.2 1.2-9.2 10.4-13.6 20.6-27.4 30.9-41 3.9-5.1 7-5.7 12.5-2.5 3.2 1.9 6.5 3.6 9.7 5.4 0.6 0.3 1.5 0.7 2 0.4 0.9-0.5 0.4-1.5 0.2-2.3 -0.2-1-0.2-2-0.6-2.9 -1.7-4.1 0.3-5.6 4.1-6.3 6.6-1.3 7.1-1.5 8 5.2 1.3 10 5 17.8 15.5 20.9 1.5 0.4 2.7 1.6 4.1 2.4C92.8 31.7 95.9 34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.8 2.8-0.1 3.2-1.3 1.7-3.5s-3.6-3.6-6.2-2.6c-2.5 0.9-4.5 2.6-3.8 5.8C119.8 103.7 119.8 104.4 119.8 105.2zM284.2 95.7c-2.5 4.6-2.2 5.9 2 8 2 1 4.1 2 6.1 3.1 2.5 1.4 4.1 3.4 4 6.5 -0.1 3.3-2.4 4.6-4.8 5.9 -3.2 1.7-9 0.7-11.6-1.8 -0.7-0.7-2.1-1.4-0.7-2.7 1.1-1.1 1.7 0 2.4 0.6 0.9 0.7 1.7 1.5 2.7 2 2.4 1.3 4.9 1.2 6.4-1.2 1.7-2.7-0.6-4.1-2.5-5.4 -2-1.3-4.1-2.4-6.2-3.4 -2.7-1.3-3.4-3.7-3.2-6.4C279.1 98.1 280.6 96.3 284.2 95.7zM128.2 103.3c-0.1 0.6-0.1 1.2-0.2 1.8 -2.7 0.5-5.5 0.3-8.2 0.1 0-0.8 0.1-1.5 0.1-2.3C122.6 103 125.4 103.1 128.2 103.3zM287.7 96.3c3.1-1 5.1 0 6.7 2.1 0.5 0.6 0.6 1.3-0.1 1.9 -0.7 0.5-1.2 0.5-1.7-0.3C291.5 98.3 289.5 97.6 287.7 96.3zM312.6 103.3c-0.1 0.6-0.1 1.2-0.2 1.8 -2.4 0.4-4.7 0.6-7-0.2 -0.1-0.6-0.3-1.1-0.4-1.7C307.5 102.9 310 102.8 312.6 103.3zM132.7 105.1c0.8-0.6 1.6-0.5 2.4 0C134.3 105.4 133.5 105.5 132.7 105.1zM315.4 101.8c-0.1-0.4-0.2-0.8-0.3-1.2C315.8 100.9 315.9 101.3 315.4 101.8z"/></switch>
          </svg>
      </a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav navbar-right">
        <% if logged_in? %>
          <li><%= link_to "About", about_path, :class => "topbar-link", :id => "topbar-login-link"%></li>
          <li><%= link_to "Us", us_path, :class => "topbar-link", :id => "topbar-login-link"%></li>
          <% if @user.first_name != ""%>
            <li><%= link_to "Hello " + @current_user.first_name  + "!", user_path(@current_user), :class => "topbar-link", :id => "topbar-login-link"%></li>
          <% else %>
            <li><%= link_to "Hello User!", user_path(@current_user), :class => "topbar-link", :id => "topbar-login-link"%></li>
          <% end %>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
              <svg id="user-icon" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" viewBox="0 0 70 70" enable-background="new 0 0 69.95 70" xml:space="preserve"><switch><foreignObject requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/" x="0" y="0" width="1" height="1"/><path fill="#fff" d="M59.7 10.4c-6.8-6.9-15.8-10.4-24.7-10.4s-17.9 3.4-24.7 10.2c-13.7 13.7-13.7 35.8 0 49.4 0.9 0.9 1.8 1.8 2.8 2.6 0 0 0 0 0 0 2.2 1.8 4.5 3.2 6.9 4.4 0.1 0.1 0.2 0.1 0.3 0.2 0.1 0 0.2 0.1 0.3 0.1C25.2 68.9 30.1 70 35 70c8.9 0 17.9-3.4 24.7-10.2C73.4 46.1 73.4 24 59.7 10.4zM55.7 55.7c-0.4 0.4-0.7 0.7-1.1 1 -2.8-4.7-7.3-8.3-12.6-9.9 -1.1-0.4-1.9-1.4-1.9-2.6 0-1 0.6-1.9 1.5-2.4 4.6-2.4 7.7-7.2 7.6-12.8 -0.1-7.3-6.1-13.4-13.4-13.8 -8.1-0.4-14.8 6.1-14.8 14.1 0 5.4 3.1 10.1 7.5 12.5 0.9 0.5 1.5 1.4 1.5 2.4 0 1.2-0.8 2.2-1.9 2.6 -5.3 1.7-9.8 5.3-12.6 10 -0.4-0.4-0.8-0.7-1.2-1.1 -11.4-11.4-11.4-30 0-41.4 5.5-5.5 12.9-8.6 20.7-8.6s15.2 3 20.7 8.6c5.5 5.5 8.6 12.9 8.6 20.7S61.3 50.2 55.7 55.7z"/></switch></svg>
            </a>
            <ul class="dropdown-menu">
              <li><%= link_to "View Profile", user_path(@current_user) %></li>
              <li><%= link_to "Edit Profile", edit_user_path %></li>
              <li><%= link_to "View Requests", conversations_path %></li>
              <li><%= link_to "Log Out", logout_path, method: :delete %></li>
            </ul>
          </li>
        <% else %>
          <li><%= link_to "About", about_path, :class => "topbar-link", :id => "topbar-login-link"%></li>
          <li><%= link_to "Us", us_path, :class => "topbar-link", :id => "topbar-login-link"%></li>
          <li><%= link_to "Sign Up", new_user_path, :class => "topbar-link", :id => "topbar-login-link"%></li>
          <li><%= link_to "Login", login_path, :class => "topbar-link", :id => "topbar-login-link"%></li>
        <% end %>
      </ul>
      
      
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>