2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2011-03-09 13:13:36 +00:00
|
|
|
module ApplicationHelper
|
2011-11-01 20:18:22 +00:00
|
|
|
def choose_title
|
2012-03-29 20:00:44 +01:00
|
|
|
title = if ['personal_repositories', 'downloads'].include?(controller.controller_name)
|
2011-11-01 20:18:22 +00:00
|
|
|
APP_CONFIG['repo_project_name']
|
|
|
|
else
|
|
|
|
APP_CONFIG['project_name']
|
|
|
|
end
|
|
|
|
|
|
|
|
return title
|
|
|
|
end
|
2012-02-29 14:04:04 +00:00
|
|
|
|
|
|
|
def layout_class
|
|
|
|
case
|
|
|
|
when params[:controller] == 'issues' && params[:action] == 'new'
|
2012-03-01 17:33:46 +00:00
|
|
|
'right nopadding'
|
|
|
|
when params[:controller] == 'build_lists' && params[:action] == 'index'
|
|
|
|
'right slim'
|
|
|
|
when params[:controller] == 'build_lists' && ['new', 'create'].include?(params[:action])
|
2012-02-29 14:04:04 +00:00
|
|
|
nil
|
2012-03-11 23:08:50 +00:00
|
|
|
when params[:controller] == 'platforms' && params[:action] == 'show'
|
|
|
|
'right bigpadding'
|
2012-03-13 15:05:33 +00:00
|
|
|
when params[:controller] == 'platforms' && params[:action] == 'clone'
|
|
|
|
'right middlepadding'
|
2012-03-01 17:33:46 +00:00
|
|
|
else
|
|
|
|
content_for?(:sidebar) ? 'right' : 'all'
|
2012-02-29 14:04:04 +00:00
|
|
|
end
|
|
|
|
end
|
2011-03-09 13:13:36 +00:00
|
|
|
end
|