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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
b4e4e611
Commit
b4e4e611
authored
Jun 03, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show functionality only for users with the ability to edit labels
parent
e487b099
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
app/views/projects/labels/index.html.haml
app/views/projects/labels/index.html.haml
+14
-12
app/views/shared/_label_row.html.haml
app/views/shared/_label_row.html.haml
+7
-6
No files found.
app/views/projects/labels/index.html.haml
View file @
b4e4e611
-
page_title
"Labels"
-
page_title
"Labels"
-
hide_class
=
''
.top-area
.top-area
.nav-text
.nav-text
...
@@ -10,19 +11,20 @@
...
@@ -10,19 +11,20 @@
New label
New label
.labels
.labels
-
hide_class
=
''
-
if
can?
(
current_user
,
:admin_label
,
@project
)
-# Only show it in the first page
-# Only show it in the first page
-
if
(
params
[
:page
].
present?
and
params
[
:page
]
!=
'1'
)
or
@project
.
labels
.
blank?
or
(
params
[
:page
]
==
nil
and
@project
.
labels
.
blank?
)
-
if
(
params
[
:page
].
present?
and
params
[
:page
]
!=
'1'
)
or
@project
.
labels
.
blank?
or
(
params
[
:page
]
==
nil
and
@project
.
labels
.
blank?
)
-
hide_class
=
'hide'
-
hide_class
=
'hide'
.prioritized-labels
{
class:
hide_class
}
.prioritized-labels
{
class:
hide_class
}
%h5
Prioritized Labels
%h5
Prioritized Labels
%ul
.content-list.manage-labels-list.js-prioritized-labels
{
"data-url"
=>
set_priorities_namespace_project_labels_path
(
@project
.
namespace
,
@project
)
}
%ul
.content-list.manage-labels-list.js-prioritized-labels
{
"data-url"
=>
set_priorities_namespace_project_labels_path
(
@project
.
namespace
,
@project
)
}
-
if
@prioritized_labels
.
present?
-
if
@prioritized_labels
.
present?
=
render
@prioritized_labels
=
render
@prioritized_labels
-
else
-
else
%p
.empty-message
No prioritized labels yet
%p
.empty-message
No prioritized labels yet
.other-labels
.other-labels
%h5
{
class:
hide_class
}
Other Labels
-
if
can?
(
current_user
,
:admin_label
,
@project
)
%h5
{
class:
hide_class
}
Other Labels
-
if
@labels
.
present?
-
if
@labels
.
present?
%ul
.content-list.manage-labels-list.js-other-labels
%ul
.content-list.manage-labels-list.js-other-labels
=
render
@labels
=
render
@labels
...
...
app/views/shared/_label_row.html.haml
View file @
b4e4e611
%span
.label-row
%span
.label-row
.js-toggle-priority.toggle-priority
{
data:
{
url:
remove_priority_namespace_project_label_path
(
@project
.
namespace
,
@project
,
label
),
-
if
can?
current_user
,
:admin_label
,
@project
dom_id:
dom_id
(
label
)
}
}
.js-toggle-priority.toggle-priority
{
data:
{
url:
remove_priority_namespace_project_label_path
(
@project
.
namespace
,
@project
,
label
),
%button
.add-priority.btn.has-tooltip
{
title:
'Prioritize'
,
:'data-placement'
=>
'top'
}
dom_id:
dom_id
(
label
)
}
}
=
icon
(
'star-o'
)
%button
.add-priority.btn.has-tooltip
{
title:
'Prioritize'
,
:'data-placement'
=>
'top'
}
%button
.remove-priority.btn.has-tooltip
{
title:
'Remove priority'
,
:'data-placement'
=>
'top'
}
=
icon
(
'star-o'
)
=
icon
(
'star'
)
%button
.remove-priority.btn.has-tooltip
{
title:
'Remove priority'
,
:'data-placement'
=>
'top'
}
=
icon
(
'star'
)
%span
.label-name
%span
.label-name
=
link_to_label
(
label
,
tooltip:
false
)
=
link_to_label
(
label
,
tooltip:
false
)
%span
.prepend-left-10
%span
.prepend-left-10
...
...
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