mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-13 22:59:19 +10:00
improved code style and layout option naming
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
module PreferencesHelper
|
||||
def layout_choices
|
||||
[
|
||||
['Small', :small],
|
||||
['Wide', :wide]
|
||||
['Fixed', :fixed],
|
||||
['Fluid', :fluid]
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class AddLayoutOptionForUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :layout, :integer, :default => 0
|
||||
add_column :users, :layout, :integer, default: 0
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user