Commit 25ee66e8 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Sorting improvements and styling

parent 499bb9f3
...@@ -9,6 +9,8 @@ class @LabelManager ...@@ -9,6 +9,8 @@ class @LabelManager
@prioritizedLabels.sortable( @prioritizedLabels.sortable(
items: 'li' items: 'li'
placeholder: 'list-placeholder'
axis: 'y'
update: @onPrioritySortUpdate.bind(@) update: @onPrioritySortUpdate.bind(@)
) )
......
...@@ -141,6 +141,18 @@ ul.content-list { ...@@ -141,6 +141,18 @@ ul.content-list {
padding: 10px 14px; padding: 10px 14px;
} }
} }
// When dragging a list item
&.ui-sortable-helper {
border-bottom: none;
}
&.list-placeholder {
background-color: $gray-light;
border: dotted 1px $gray-dark;
margin: 1px 0;
min-height: 30px;
}
} }
} }
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
.label-row { .label-row {
.label-name { .label-name {
display: inline-block; display: inline-block;
width: 200px; width: 170px;
@media (max-width: $screen-xs-min) { @media (max-width: $screen-xs-min) {
display: block; display: block;
...@@ -140,8 +140,11 @@ ...@@ -140,8 +140,11 @@
} }
.prioritized-labels { .prioritized-labels {
margin-bottom: 30px;
.add-priority { .add-priority {
display: none; display: none;
color: $gray-light;
} }
} }
...@@ -150,3 +153,19 @@ ...@@ -150,3 +153,19 @@
display: none; display: none;
} }
} }
.toggle-priority {
display: inline-block;
vertical-align: middle;
button {
border-color: transparent;
padding: 5px 8px;
vertical-align: top;
font-size: 14px;
&:hover {
border-color: transparent;
}
}
}
- label_css_id = dom_id(label) - label_css_id = dom_id(label)
%li{id: label_css_id, :"data-id" => label.id} %li{id: label_css_id, :"data-id" => label.id}
%a.js-toggle-priority{:href => "#",
:"data-url" => remove_priority_namespace_project_label_path(@project.namespace, @project, label),
:"data-dom-id" => "#{label_css_id}" }
%span.add-priority
(+)
%span.remove-priority
(-)
= render "shared/label_row", label: label = render "shared/label_row", label: label
.pull-info-right .pull-info-right
%span.append-right-20 %span.append-right-20
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
New label New label
.labels .labels
.prioritized-labels .prioritized-labels{ class: ('hide' if params[:page].present?)}
%h5 Prioritized Label %h5 Prioritized Label
%ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_sorting_namespace_project_labels_path(@project.namespace, @project) } %ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_sorting_namespace_project_labels_path(@project.namespace, @project) }
- if @prioritized.present? - if @prioritized.present?
......
- label_css_id = dom_id(label)
%span.label-row %span.label-row
.js-toggle-priority.toggle-priority{ :"data-url" => remove_priority_namespace_project_label_path(@project.namespace, @project, label),
:"data-dom-id" => "#{label_css_id}" }
%button.add-priority.btn.has-tooltip{ title: 'Prioritize', :'data-placement' => 'top' }
%i.fa.fa-star-o
%button.remove-priority.btn.has-tooltip{ title: 'Remove priority', :'data-placement' => 'top' }
%i.fa.fa-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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment