Use a single entry for navigation branding:
Allow a view to override the brand (esp. for conference splash pages), Use the app name link for the admin control panel, use the conference short title for end user content within a conference, fall back to the app name link. Visually, there are two substantial changes: (1) the conference title (or short title) serves as the brand when viewing conference content; (2) the short title isn't shown redundantly on the navbar and the top of the sidebar when editing a conf.
This commit is contained in:
parent
a33e930111
commit
3e1424dbfc
3 changed files with 27 additions and 14 deletions
|
|
@ -1,5 +1,4 @@
|
|||
module ApplicationHelper
|
||||
|
||||
def bootstrap_class_for(flash_type)
|
||||
logger.debug "flash_type is #{flash_type}"
|
||||
case flash_type
|
||||
|
|
@ -112,4 +111,23 @@ module ApplicationHelper
|
|||
|
||||
result
|
||||
end
|
||||
|
||||
def default_brand
|
||||
link_to CONFIG['name'], root_path,
|
||||
class: 'navbar-brand',
|
||||
title: 'Open Source Event Manager'
|
||||
end
|
||||
|
||||
def short_title_brand(conference)
|
||||
link_to conference.short_title, conference_path(conference.short_title),
|
||||
class: 'navbar-brand',
|
||||
title: conference.title
|
||||
end
|
||||
|
||||
def brand
|
||||
content_for(:brand) ||
|
||||
(default_brand if controller.class.parent == Admin) ||
|
||||
(short_title_brand(@conference) if @conference) ||
|
||||
default_brand
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
= content_for :splash_logo do
|
||||
= link_to @conference.title, "#", :class => 'navbar-brand'
|
||||
= content_for :brand do
|
||||
= link_to @conference.title, conference_url(@conference.short_title), class: 'navbar-brand'
|
||||
= render :partial => "home/conference_details", :locals => {:conference => @conference}
|
||||
|
|
@ -7,13 +7,8 @@
|
|||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
= yield(:splash_logo)
|
||||
= link_to CONFIG['name'], root_path, :class => 'navbar-brand', :title => "Open Source Event Manager"
|
||||
= brand
|
||||
.collapse.navbar-collapse
|
||||
= yield(:splash_header)
|
||||
- if @conference && !@conference.short_title.nil?
|
||||
%p.navbar-text
|
||||
= @conference.short_title
|
||||
-if user_signed_in?
|
||||
%ul.nav.navbar-nav.navbar-right
|
||||
%li.dropdown
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue