rosa-build/app/helpers/application_helper.rb

26 lines
686 B
Ruby
Raw Normal View History

2012-01-30 20:39:34 +00:00
# -*- encoding : utf-8 -*-
2011-03-09 13:13:36 +00:00
module ApplicationHelper
def choose_title
title = if ['categories', 'personal_repositories', 'downloads'].include?(controller.controller_name)
APP_CONFIG['repo_project_name']
else
APP_CONFIG['project_name']
end
return title
end
def layout_class
case
when params[:controller] == 'issues' && params[:action] == 'new'
'right nopadding'
when params[:controller] == 'build_lists' && params[:action] == 'index'
'right slim'
when params[:controller] == 'build_lists' && ['new', 'create'].include?(params[:action])
nil
else
content_for?(:sidebar) ? 'right' : 'all'
end
end
2011-03-09 13:13:36 +00:00
end