Skip to content

Commit

Permalink
Made a smaller variant of the top bar for non logged-in users and rea…
Browse files Browse the repository at this point in the history
…rranged the user login area
  • Loading branch information
brzaik committed Apr 26, 2012
1 parent debec94 commit 45e3fcd
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 70 deletions.
41 changes: 24 additions & 17 deletions app/assets/stylesheets/application/layout/topmenu.scss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,37 @@ nav#TM {
}

a#TM-logobutton {
z-index: 100;
width: 96px;
height: 88px;
background: image-url('layout/TM/TM_logobutton.png') top left no-repeat;
background-position: 0px 0px;
border: 0px;
display: block;
position: absolute;
top: 0px;
left: 0px;

&:hover {
background-position: -96px 0px;
}

}
@include vertical-gradient($concerto-blue-1, $concerto-blue-2);
float: left;
color: $white;
padding: 4px 12px;
font-weight: bold;
vertical-align: middle;

&.full {
height: 50px;
}
}

p#TM-logintext {
float: left;
padding: 4px 12px;
margin: 0px;
color: $gray;
font-size: 0.85em;
}

// each part of the menu is a "section"
section {
border-right:solid 1px #ccc;
float: left;
margin: 0px;
padding-top: 4px;


&.right {
float: right;
}

.TM-sectop {
height: 34px;
padding: 0px 2px;
Expand Down
90 changes: 46 additions & 44 deletions app/views/elements/_topmenu_contents.html.erb
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
<!-- Begin User Login Area -->
<section>
<div class="TM-sectop">
<% if user_signed_in? %>
<p><b><%= current_user.name %></b></p>
<% else %>
<p><b>Concerto</b></p>
<% end %>
<% if user_signed_in? %>
<p><%= link_to t(:settings), edit_user_path(current_user) %>, <%= link_to t(:log_out), destroy_user_session_path %></p>
<% else %>
<p><%= link_to t(:sign_in), new_user_session_path %>, <%= link_to t(:sign_up), new_user_registration_path %></p>
<% end %>
</div>
<div class="TM-secbot">

</div>
</section>
<!-- End User Login Area -->
<nav id="show-TM">
<a href="#">-- Show Top Menu --</a>
</nav>

<% if user_signed_in? %>

<!--googleoff: all-->
<nav id="TM">
<% if not user_signed_in? %>
<%= link_to "Concerto", "/", :id => "TM-logobutton" %>
<p id="TM-logintext"><%= link_to t(:sign_in), new_user_session_path %> to upload and manage content. No account? <%= link_to t(:sign_up), new_user_registration_path %> now!</p>
<% else %>
<%= link_to "Concerto", "/", :id => "TM-logobutton", :class => "full" %>

<!-- Begin Menu for CONTENT -->
<section>
<div class="TM-sectop">
<%= link_to new_content_path, :class => "btn #{ current_page?(new_content_path) ? 'selected' : '' }" do %><%= t(:add) %><% end %>
<%= link_to contents_path, :class => "btn #{ current_page?(contents_path) || current_page?(:controller => 'submissions', :action => 'index') || current_page?(:controller => 'submissions', :action => 'show') ? 'selected' : '' }" do %><%= t(:browse) %><% end %>
<%= link_to new_content_path, :class => "btn #{ current_page?(new_content_path) ? 'selected' : '' }" do %><%= t(:add) %><% end %>
</div>
<div class="TM-secbot">
<h1><%= t(:content) %></h1>
Expand All @@ -34,40 +24,52 @@

<!-- Begin Menu for SCREENS -->
<section>
<div class="TM-sectop">
<%= link_to screens_path, :class => "btn #{ controller.controller_name == 'screens' ? 'selected' : '' }" do %><%= t(:manage) %><% end %>
<%= link_to templates_path, :class => "btn #{ controller.controller_name == 'templates' ? 'selected' : '' }" do %><%= t(:templates) %><% end %>
</div>
<div class="TM-secbot">
<h1><%= t(:screens) %></h1>
</div>
<div class="TM-sectop">
<%= link_to screens_path, :class => "btn #{ controller.controller_name == 'screens' ? 'selected' : '' }" do %><%= t(:manage) %><% end %>
<%= link_to templates_path, :class => "btn #{ controller.controller_name == 'templates' ? 'selected' : '' }" do %><%= t(:templates) %><% end %>
</div>
<div class="TM-secbot">
<h1><%= t(:screens) %></h1>
</div>
</section>
<!-- End Menu for SCREENS -->

<!-- Begin Menu for FEEDS -->
<section>
<div class="TM-sectop">
<%= link_to feeds_path, :class => "btn #{ controller.controller_name == 'feeds' ? 'selected' : '' }" do %><%= t(:manage) %><% end %>
</div>
<div class="TM-secbot">
<h1><%= t(:feeds) %></h1>
</div>
<div class="TM-sectop">
<%= link_to feeds_path, :class => "btn #{ controller.controller_name == 'feeds' ? 'selected' : '' }" do %><%= t(:manage) %><% end %>
</div>
<div class="TM-secbot">
<h1><%= t(:feeds) %></h1>
</div>
</section>
<!-- End Menu for FEEDS -->

<!-- Begin Menu for USER GROUPS -->
<section>
<div class="TM-sectop">
<%= link_to groups_path, :class => "btn #{ controller.controller_name == 'groups' ? 'selected' : '' }" do %><%= t(:groups) %><% end %>
<%= link_to users_path, :class => "btn #{ controller.controller_name == 'users' ? 'selected' : '' }" do %>Accounts<% end %>
</div>
<div class="TM-secbot">
<h1><%= t(:users) %></h1>
</div>
<div class="TM-sectop">
<%= link_to groups_path, :class => "btn #{ controller.controller_name == 'groups' ? 'selected' : '' }" do %><%= t(:groups) %><% end %>
<%= link_to users_path, :class => "btn #{ controller.controller_name == 'users' ? 'selected' : '' }" do %>Accounts<% end %>
</div>
<div class="TM-secbot">
<h1><%= t(:users) %></h1>
</div>
</section>
<!-- End Menu for USER GROUPS -->

<% end %>
<!-- Begin User Login Area -->
<section class="right">
<div class="TM-sectop">
<p><b><%= current_user.name %></b></p>
<p><%= link_to t(:settings), edit_user_path(current_user) %>, <%= link_to t(:log_out), destroy_user_session_path %></p>
</div>
<div class="TM-secbot">
</div>
</section>
<!-- End User Login Area -->

<div class="clear"></div>
<% end %>
<div class="clear"></div>
</nav>
<!--googleon: all-->

10 changes: 1 addition & 9 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@
<![endif]-->
</head>
<body>
<nav id="show-TM">
<a href="#">-- Show Top Menu --</a>
</nav>
<%= render :partial => "elements/topmenu_contents" %>

<!--googleoff: all-->
<nav id="TM">
<%= render :partial => "elements/topmenu_contents" %>
</nav>
<!--googleon: all-->

<div id="main">
<% if flash[:notice] %>
<p class="notice"><%= notice %></p>
Expand Down

0 comments on commit 45e3fcd

Please sign in to comment.