Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
291e1fa9
Commit
291e1fa9
authored
Oct 05, 2015
by
Peter Göbel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved code style and layout option naming
parent
e2c5d08e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
7 deletions
+7
-7
app/helpers/page_layout_helper.rb
app/helpers/page_layout_helper.rb
+1
-1
app/helpers/preferences_helper.rb
app/helpers/preferences_helper.rb
+2
-2
app/models/user.rb
app/models/user.rb
+1
-1
app/views/profiles/preferences/show.html.haml
app/views/profiles/preferences/show.html.haml
+1
-1
app/views/profiles/preferences/update.js.erb
app/views/profiles/preferences/update.js.erb
+1
-1
db/migrate/20151005150751_add_layout_option_for_users.rb
db/migrate/20151005150751_add_layout_option_for_users.rb
+1
-1
No files found.
app/helpers/page_layout_helper.rb
View file @
291e1fa9
...
...
@@ -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
...
...
app/helpers/preferences_helper.rb
View file @
291e1fa9
...
...
@@ -2,8 +2,8 @@
module
PreferencesHelper
def
layout_choices
[
[
'
Small'
,
:small
],
[
'
Wide'
,
:wide
]
[
'
Fixed'
,
:fixed
],
[
'
Fluid'
,
:fluid
]
]
end
...
...
app/models/user.rb
View file @
291e1fa9
...
...
@@ -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.
...
...
app/views/profiles/preferences/show.html.haml
View file @
291e1fa9
...
...
@@ -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
...
...
app/views/profiles/preferences/update.js.erb
View file @
291e1fa9
...
...
@@ -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')
...
...
db/migrate/20151005150751_add_layout_option_for_users.rb
View file @
291e1fa9
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment