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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
6ac26a3c
Commit
6ac26a3c
authored
Jul 30, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Label views: index, new, edit
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ecabefba
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
103 additions
and
3 deletions
+103
-3
app/assets/stylesheets/sections/labels.scss
app/assets/stylesheets/sections/labels.scss
+17
-0
app/helpers/labels_helper.rb
app/helpers/labels_helper.rb
+13
-0
app/views/projects/labels/_form.html.haml
app/views/projects/labels/_form.html.haml
+48
-0
app/views/projects/labels/_label.html.haml
app/views/projects/labels/_label.html.haml
+2
-0
app/views/projects/labels/edit.html.haml
app/views/projects/labels/edit.html.haml
+8
-0
app/views/projects/labels/index.html.haml
app/views/projects/labels/index.html.haml
+9
-3
app/views/projects/labels/new.html.haml
app/views/projects/labels/new.html.haml
+6
-0
No files found.
app/assets/stylesheets/sections/labels.scss
0 → 100644
View file @
6ac26a3c
.suggest-colors
{
margin-top
:
5px
;
a
{
@include
border-radius
(
4px
);
width
:
30px
;
height
:
30px
;
display
:
inline-block
;
margin-right
:
10px
;
}
}
.manage-labels-list
{
.label
{
padding
:
9px
;
font-size
:
14px
;
}
}
app/helpers/labels_helper.rb
View file @
6ac26a3c
...
@@ -17,4 +17,17 @@ module LabelsHelper
...
@@ -17,4 +17,17 @@ module LabelsHelper
label
.
name
label
.
name
end
end
end
end
def
suggested_colors
[
'#d9534f'
,
'#f0ad4e'
,
'#428bca'
,
'#5cb85c'
,
'#34495e'
,
'#7f8c8d'
,
'#8e44ad'
,
'#FFECDB'
]
end
end
end
app/views/projects/labels/_form.html.haml
0 → 100644
View file @
6ac26a3c
=
form_for
[
@project
,
@label
],
html:
{
class:
'form-horizontal label-form'
}
do
|
f
|
-
if
@label
.
errors
.
any?
.row
.col-sm-10.col-sm-offset-2
.bs-callout.bs-callout-danger
-
@label
.
errors
.
full_messages
.
each
do
|
msg
|
%span
=
msg
%br
.form-group
=
f
.
label
:title
,
class:
'control-label'
.col-sm-10
=
f
.
text_field
:title
,
class:
"form-control"
,
required:
true
.form-group
=
f
.
label
:color
,
"Background Color"
,
class:
'control-label'
.col-sm-10
.input-group
.input-group-addon.label-color-preview
=
f
.
text_field
:color
,
placeholder:
"#AA33EE"
,
class:
"form-control"
.help-block
6 character hex values starting with a # sign.
%br
Or you can choose one of suggested colors below
.suggest-colors
-
suggested_colors
.
each
do
|
color
|
=
link_to
'#'
,
style:
"background-color:
#{
color
}
"
,
data:
{
color:
color
}
do
.form-actions
=
f
.
submit
'Save'
,
class:
'btn btn-save'
:coffeescript
updateColorPreview = ->
previewColor = $('input#label_color').val()
$('div.label-color-preview').css('background-color', previewColor)
$('.suggest-colors a').on 'click', (e) ->
color = $(this).data("color")
$('input#label_color').val(color)
updateColorPreview()
e.preventDefault()
$('input#label_color').on 'input', ->
updateColorPreview()
updateColorPreview()
app/views/projects/labels/_label.html.haml
View file @
6ac26a3c
%li
%li
=
render_colored_label
(
label
)
=
render_colored_label
(
label
)
.pull-right
=
link_to
'Edit'
,
edit_project_label_path
(
@project
,
label
),
class:
'btn'
app/views/projects/labels/edit.html.haml
0 → 100644
View file @
6ac26a3c
%h3
Edit label
%span
.light
#{
@label
.
name
}
.back-link
=
link_to
project_labels_path
(
@project
)
do
←
To labels list
%hr
=
render
'form'
app/views/projects/labels/index.html.haml
View file @
6ac26a3c
=
render
"projects/issues/head"
=
render
"projects/issues/head"
-
if
can?
current_user
,
:admin_label
,
@project
=
link_to
new_project_label_path
(
@project
),
class:
"pull-right btn btn-new"
do
New label
%h3
.page-title
Labels
%hr
-
if
@labels
.
present?
-
if
@labels
.
present?
%ul
.bordered-list.labels-table
%ul
.bordered-list.manage-labels-list
-
@labels
.
each
do
|
label
|
=
render
@labels
=
render
'label'
,
label:
label
-
else
-
else
.light-well
.light-well
...
...
app/views/projects/labels/new.html.haml
0 → 100644
View file @
6ac26a3c
%h3
New label
.back-link
=
link_to
project_labels_path
(
@project
)
do
←
To labels list
%hr
=
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