Skip to content
Snippets Groups Projects
Commit 291e1fa9 authored by Peter Göbel's avatar Peter Göbel
Browse files

improved code style and layout option naming

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