More adjustments for Twitter Bootstrap. Also highlight the main navigation at the current selection.
This commit is contained in:
parent
17144c43e2
commit
e31e943ef5
5 changed files with 28 additions and 7 deletions
|
|
@ -4,6 +4,7 @@ class BirthdaysController < ApplicationController
|
|||
|
||||
def index
|
||||
@birthdays = get_next_weeks_birthdays
|
||||
@nav_active = "birthdays"
|
||||
end
|
||||
|
||||
# curl --verbose --header "Content-type: application/html" --request POST --data "" http://contactorama.dev/birthdays/do_mailing
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ class ContactsController < ApplicationController
|
|||
|
||||
def index
|
||||
@contacts = Contact.accessible_by(current_ability, :index)
|
||||
@nav_active = "overview"
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
@ -118,6 +119,7 @@ class ContactsController < ApplicationController
|
|||
@contact.fill_attributes_from_map(contact)
|
||||
end
|
||||
setup_months_and_days
|
||||
@nav_active = "new_contact"
|
||||
end
|
||||
|
||||
def setup_months_and_days
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="row">
|
||||
<div class="twelvecol">
|
||||
<div class="span12">
|
||||
<h1><%= t("birthdays.birthdays") %></h1>
|
||||
<h2><%= t("birthdays.for_next_days") %></h2>
|
||||
</div>
|
||||
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
<% @birthdays.each do |b| %>
|
||||
<div class="row">
|
||||
<div class="onecol">
|
||||
<div class="span1">
|
||||
<%= b.birth_date_string %>
|
||||
</div>
|
||||
<div class="tencol">
|
||||
<div class="span11">
|
||||
<strong><%= b.firstname + " " + b.lastname %></strong>
|
||||
</div>
|
||||
</row>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,27 @@
|
|||
<a href="#" class="brand"><span class="logo_contact">Contact</span><span class="logo_o-rama">-o-Rama</span></a>
|
||||
<ul class="nav pull-left">
|
||||
<li class="active"><%= link_to 'A..Z', contacts_path %></li>
|
||||
<li class=""><%= link_to 'Birthdays', birthdays_path %></li>
|
||||
<li class=""><%= link_to 'New', new_contact_path %></li>
|
||||
<% if nav_active == "overview" %>
|
||||
<li class="active">
|
||||
<% else %>
|
||||
<li>
|
||||
<% end %>
|
||||
<%= link_to 'A..Z', contacts_path %></li>
|
||||
|
||||
<% if nav_active == "birthdays" %>
|
||||
<li class="active">
|
||||
<% else %>
|
||||
<li>
|
||||
<% end %>
|
||||
<%= link_to 'Birthdays', birthdays_path %></li>
|
||||
|
||||
<% if nav_active == "new_contact" %>
|
||||
<li class="active">
|
||||
<% else %>
|
||||
<li>
|
||||
<% end %>
|
||||
<%= link_to 'New', new_contact_path %></li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav pull-right">
|
||||
<li class="divider-vertical"></li>
|
||||
<%# We shouldn't be seeing logged out users here, as the controller sends them to the login page first. %>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<header class="navbar navbar-fixed-top">
|
||||
<nav class="navbar-inner">
|
||||
<div class="container">
|
||||
<%= render 'layouts/navigation' %>
|
||||
<%= render :partial => 'layouts/navigation', :locals => {:nav_active => @nav_active} %>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue