Commit 291e1fa9 authored by Peter Göbel's avatar Peter Göbel

improved code style and layout option naming

parent e2c5d08e
...@@ -26,7 +26,7 @@ module PageLayoutHelper ...@@ -26,7 +26,7 @@ module PageLayoutHelper
def fluid_layout(enabled = false) def fluid_layout(enabled = false)
if @fluid_layout.nil? if @fluid_layout.nil?
@fluid_layout = (current_user && current_user.layout == "wide") || enabled @fluid_layout = (current_user && current_user.layout == "fluid") || enabled
else else
@fluid_layout @fluid_layout
end end
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
module PreferencesHelper module PreferencesHelper
def layout_choices def layout_choices
[ [
['Small', :small], ['Fixed', :fixed],
['Wide', :wide] ['Fluid', :fluid]
] ]
end end
......
...@@ -173,7 +173,7 @@ class User < ActiveRecord::Base ...@@ -173,7 +173,7 @@ class User < ActiveRecord::Base
after_destroy :post_destroy_hook after_destroy :post_destroy_hook
# User's Layout preference # User's Layout preference
enum layout: [:small, :wide] enum layout: [:fixed, :fluid]
# User's Dashboard preference # User's Dashboard preference
# Note: When adding an option, it MUST go on the end of the array. # Note: When adding an option, it MUST go on the end of the array.
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
.col-sm-10 .col-sm-10
= f.select :layout, layout_choices, {}, class: 'form-control' = f.select :layout, layout_choices, {}, class: 'form-control'
.help-block .help-block
Choose between small (max. 1200px) and wide (100%) application layout Choose between fixed (max. 1200px) and fluid (100%) application layout
.form-group .form-group
= f.label :dashboard, class: 'control-label' do = f.label :dashboard, class: 'control-label' do
Default Dashboard Default Dashboard
......
...@@ -3,7 +3,7 @@ $('body').removeClass('<%= Gitlab::Themes.body_classes %>') ...@@ -3,7 +3,7 @@ $('body').removeClass('<%= Gitlab::Themes.body_classes %>')
$('body').addClass('<%= user_application_theme %>') $('body').addClass('<%= user_application_theme %>')
// Toggle container-fluid class // Toggle container-fluid class
if ('<%= current_user.layout %>' === 'wide') { if ('<%= current_user.layout %>' === 'fluid') {
$('.content-wrapper').find('.container-fluid').removeClass('container-limited') $('.content-wrapper').find('.container-fluid').removeClass('container-limited')
} else { } else {
$('.content-wrapper').find('.container-fluid').addClass('container-limited') $('.content-wrapper').find('.container-fluid').addClass('container-limited')
......
class AddLayoutOptionForUsers < ActiveRecord::Migration class AddLayoutOptionForUsers < ActiveRecord::Migration
def change def change
add_column :users, :layout, :integer, :default => 0 add_column :users, :layout, :integer, default: 0
end end
end end
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment