Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Newsletter ui: added active li tab + helper
  • Loading branch information
priit.mx.ee committed Jan 9, 2009
1 parent cdd6115 commit 158a5e6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
9 changes: 9 additions & 0 deletions engines/adva_cms/app/helpers/base_helper.rb
Expand Up @@ -95,4 +95,13 @@ def author_preselect
return current_user.id if content.nil?
content.author ? content.author.id : current_user.id
end

# Helper for adding active class to menu li
#
# Usage:
# <li <%= active_li?('issues') %>>my menu li</li>
#
def active_li?(controller_name)
'class="active"' if params[:controller] == controller_name
end
end
6 changes: 6 additions & 0 deletions engines/adva_cms/public/stylesheets/admin/styles.css
Expand Up @@ -379,6 +379,12 @@ ul.sub-nav li a span{
ul.sub-nav a:hover span{
background-position: right -40px !important;}

ul.sub-nav li.active a span{
background-position: 0 -40px !important;
text-decoration:none !important;}

ul.sub-nav li.active a:hover{
color:#4C4C4C !important;}

/* MAIN CONTENT ELEMENTS
-------------------------------------------------------------------------*/
Expand Down
@@ -1,4 +1,8 @@
<ul class='sub-nav clearfix'>
<li><%= link_to "<span>#{ t('adva.newsletter.link.issues') }</span>", admin_issues_path(@site, @newsletter) %></li>
<li><%= link_to "<span>#{ t('adva.newsletter.link.subscribers') }</span>", admin_subscriptions_path(@site, @newsletter) %></li>
<li <%= active_li?('admin/issues') %>>
<%= link_to "<span>#{ t('adva.newsletter.link.issues') }</span>", admin_issues_path(@site, @newsletter) %>
</li>
<li <%= active_li?('admin/newsletter_subscriptions') %>>
<%= link_to "<span>#{ t('adva.newsletter.link.subscribers') }</span>", admin_subscriptions_path(@site, @newsletter) %>
</li>
</ul>

0 comments on commit 158a5e6

Please sign in to comment.