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
b33da767
Commit
b33da767
authored
Apr 14, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Appearance scaffold
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ef73898f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
0 deletions
+70
-0
app/controllers/admin/appearances_controller.rb
app/controllers/admin/appearances_controller.rb
+36
-0
app/views/admin/appearances/_form.html.haml
app/views/admin/appearances/_form.html.haml
+33
-0
app/views/admin/appearances/show.html.haml
app/views/admin/appearances/show.html.haml
+1
-0
No files found.
app/controllers/admin/appearances_controller.rb
0 → 100644
View file @
b33da767
class
Admin::AppearancesController
<
Admin
::
ApplicationController
before_filter
:set_appearance
,
except: :create
def
show
end
def
create
@appearance
=
Appearance
.
new
(
appearance_params
)
if
@appearance
.
save
redirect_to
admin_appearances_path
,
notice:
'Appearance was successfully created.'
else
render
action:
'show'
end
end
def
update
if
@appearance
.
update
(
appearance_params
)
redirect_to
admin_appearances_path
,
notice:
'Appearance was successfully updated.'
else
render
action:
'show'
end
end
private
# Use callbacks to share common setup or constraints between actions.
def
set_appearance
@appearance
=
Appearance
.
first
||
Appearance
.
new
end
# Only allow a trusted parameter "white list" through.
def
appearance_params
params
.
require
(
:appearance
).
permit
(
:title
,
:description
,
:logo
,
:updated_by
)
end
end
app/views/admin/appearances/_form.html.haml
0 → 100644
View file @
b33da767
%h3
.page-title
Appearance settings
%p
.light
You can modify look of sign-in and sign-up pages here
%hr
=
form_for
@appearance
,
url:
admin_appearances_path
,
html:
{
class:
'form-horizontal'
}
do
|
f
|
-
if
@appearance
.
errors
.
any?
.alert.alert-danger
-
@appearance
.
errors
.
full_messages
.
each
do
|
msg
|
%p
=
msg
.form-group
=
f
.
label
:title
,
class:
'control-label'
.col-sm-10
=
f
.
text_field
:title
,
class:
"form-control"
.form-group
=
f
.
label
:description
,
class:
'control-label'
.col-sm-10
=
f
.
text_area
:description
,
class:
"form-control"
,
rows:
10
.hint
Description parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_markdown_path
,
target:
'_blank'
}
.
.form-group
=
f
.
label
:logo
,
class:
'control-label'
.col-sm-10
-
if
@appearance
.
logo
=
image_tag
@appearance
.
logo
,
class:
'appearance-logo-preview'
=
f
.
file_field
:logo
,
class:
""
.hint
Logo size is limited with 1MB
.form-actions
=
f
.
submit
'Save'
,
class:
'btn btn-save'
app/views/admin/appearances/show.html.haml
0 → 100644
View file @
b33da767
=
render
'form'
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