diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-09 08:57:54 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-09 08:57:54 +0000 |
commit | b05cc8bc9aa5200a0fe3d2ce0afe18485a0aded5 (patch) | |
tree | 7d0cea775b4cafded2409d448aade0f369eca221 /app/views | |
parent | fbcde1aa779e56c7573cb86729e963b1bae186ff (diff) | |
parent | 6bd3d72bbdf288ecf2eee718f2943821c1401a22 (diff) | |
download | gitlab-ce-b05cc8bc9aa5200a0fe3d2ce0afe18485a0aded5.tar.gz |
Merge branch 'global_labels' into 'master'
Global labels
https://dev.gitlab.org/gitlab/gitlabhq/issues/2353
See merge request !1240
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/labels/_form.html.haml | 35 | ||||
-rw-r--r-- | app/views/admin/labels/_label.html.haml | 5 | ||||
-rw-r--r-- | app/views/admin/labels/destroy.js.haml | 2 | ||||
-rw-r--r-- | app/views/admin/labels/edit.html.haml | 9 | ||||
-rw-r--r-- | app/views/admin/labels/index.html.haml | 16 | ||||
-rw-r--r-- | app/views/admin/labels/new.html.haml | 7 | ||||
-rw-r--r-- | app/views/layouts/nav/_admin.html.haml | 6 |
7 files changed, 80 insertions, 0 deletions
diff --git a/app/views/admin/labels/_form.html.haml b/app/views/admin/labels/_form.html.haml new file mode 100644 index 00000000000..ad58a3837f6 --- /dev/null +++ b/app/views/admin/labels/_form.html.haml @@ -0,0 +1,35 @@ += form_for [:admin, @label], html: { class: 'form-horizontal label-form js-requires-input' } do |f| + -if @label.errors.any? + .row + .col-sm-offset-2.col-sm-10 + .alert.alert-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.color_field :color, class: "form-control" + .help-block + Choose any color. + %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 js-save-button' + = link_to "Cancel", admin_labels_path, class: 'btn btn-cancel' + +:coffeescript + new Labels diff --git a/app/views/admin/labels/_label.html.haml b/app/views/admin/labels/_label.html.haml new file mode 100644 index 00000000000..596e06243dd --- /dev/null +++ b/app/views/admin/labels/_label.html.haml @@ -0,0 +1,5 @@ +%li{id: dom_id(label)} + = render_colored_label(label) + .pull-right + = link_to 'Edit', edit_admin_label_path(label), class: 'btn btn-sm' + = link_to 'Remove', admin_label_path(label), class: 'btn btn-sm btn-remove remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?"} diff --git a/app/views/admin/labels/destroy.js.haml b/app/views/admin/labels/destroy.js.haml new file mode 100644 index 00000000000..9d51762890f --- /dev/null +++ b/app/views/admin/labels/destroy.js.haml @@ -0,0 +1,2 @@ +- if @labels.size == 0 + $('.labels').load(document.URL + ' .light-well').hide().fadeIn(1000) diff --git a/app/views/admin/labels/edit.html.haml b/app/views/admin/labels/edit.html.haml new file mode 100644 index 00000000000..45c62a76259 --- /dev/null +++ b/app/views/admin/labels/edit.html.haml @@ -0,0 +1,9 @@ +- page_title "Edit", @label.name, "Labels" +%h3 + Edit label + %span.light #{@label.name} +.back-link + = link_to admin_labels_path do + ← To labels list +%hr += render 'form' diff --git a/app/views/admin/labels/index.html.haml b/app/views/admin/labels/index.html.haml new file mode 100644 index 00000000000..8b11c28c56e --- /dev/null +++ b/app/views/admin/labels/index.html.haml @@ -0,0 +1,16 @@ +- page_title "Labels" += link_to new_admin_label_path, class: "pull-right btn btn-new" do + New label +%h3.page-title + Labels +%hr + +.labels + - if @labels.present? + %ul.bordered-list.manage-labels-list + = render @labels + = paginate @labels, theme: 'gitlab' + - else + .light-well + .nothing-here-block There are no any labels yet +
\ No newline at end of file diff --git a/app/views/admin/labels/new.html.haml b/app/views/admin/labels/new.html.haml new file mode 100644 index 00000000000..8d298ad20f7 --- /dev/null +++ b/app/views/admin/labels/new.html.haml @@ -0,0 +1,7 @@ +- page_title "New Label" +%h3 New label +.back-link + = link_to admin_labels_path do + ← To labels list +%hr += render 'form' diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml index 2065be3828a..3fe0127041e 100644 --- a/app/views/layouts/nav/_admin.html.haml +++ b/app/views/layouts/nav/_admin.html.haml @@ -57,6 +57,12 @@ %span Service Templates + = nav_link(controller: :labels) do + = link_to admin_labels_path, title: 'Labels', data: {placement: 'right'} do + = icon('tags fw') + %span + Labels + = nav_link(controller: :abuse_reports) do = link_to admin_abuse_reports_path, title: "Abuse reports" do = icon('exclamation-circle fw') |