rosa-build/app/helpers/application_helper.rb

30 lines
872 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
2012-03-29 20:00:44 +01:00
title = if ['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
when params[:controller] == 'platforms' && params[:action] == 'show'
'right bigpadding'
when params[:controller] == 'platforms' && params[:action] == 'clone'
'right middlepadding'
else
content_for?(:sidebar) ? 'right' : 'all'
end
end
2011-03-09 13:13:36 +00:00
end