2022-11-25 23:54:43 +05:30
|
|
|
= gitlab_ui_form_for @label, as: :label, url: url, html: { class: 'label-form js-quick-submit js-requires-input' } do |f|
|
2022-10-11 01:57:18 +05:30
|
|
|
= form_errors(@label)
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
.form-group.row
|
2022-07-23 23:45:48 +05:30
|
|
|
.col-12
|
2019-09-04 21:01:54 +05:30
|
|
|
= f.label :title
|
2022-08-27 11:52:29 +05:30
|
|
|
= f.text_field :title, class: "gl-form-input form-control js-label-title", required: true, autofocus: true, data: { qa_selector: 'label_title_field' }
|
2019-07-07 11:18:12 +05:30
|
|
|
= render_if_exists 'shared/labels/create_label_help_text'
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
.form-group.row
|
2022-07-23 23:45:48 +05:30
|
|
|
.col-12
|
2023-07-09 08:55:56 +05:30
|
|
|
= f.label :description, _("Description (optional)")
|
|
|
|
= f.text_area :description, class: "gl-form-input form-control js-quick-submit", rows: 4, data: { qa_selector: 'label_description_field' }
|
2018-11-08 19:23:39 +05:30
|
|
|
.form-group.row
|
2022-07-23 23:45:48 +05:30
|
|
|
.col-12
|
2022-03-02 08:16:31 +05:30
|
|
|
= f.label :color, _("Background color")
|
2014-09-02 18:07:02 +05:30
|
|
|
.input-group
|
2018-11-08 19:23:39 +05:30
|
|
|
.input-group-prepend
|
2023-05-27 22:25:52 +05:30
|
|
|
%input.label-color-preview.gl-w-7.gl-h-full.gl-border-1.gl-border-solid.gl-border-gray-500.gl-border-r-0.gl-rounded-top-right-none.gl-rounded-bottom-right-none{ type: "color", placeholder: _('Select color') }
|
2022-08-27 11:52:29 +05:30
|
|
|
= f.text_field :color, class: "gl-form-input form-control", data: { qa_selector: 'label_color_field' }
|
2018-11-08 19:23:39 +05:30
|
|
|
.form-text.text-muted
|
2023-06-20 00:43:36 +05:30
|
|
|
= _('Select a color from the color picker or from the presets below.')
|
2019-09-04 21:01:54 +05:30
|
|
|
= render_suggested_colors
|
2022-07-23 23:45:48 +05:30
|
|
|
.gl-display-flex.gl-justify-content-space-between
|
2022-03-02 08:16:31 +05:30
|
|
|
%div
|
|
|
|
- if @label.persisted?
|
2022-11-25 23:54:43 +05:30
|
|
|
= f.submit _('Save changes'), class: 'js-save-button gl-mr-2', pajamas_button: true
|
2022-03-02 08:16:31 +05:30
|
|
|
- else
|
2022-11-25 23:54:43 +05:30
|
|
|
= f.submit _('Create label'), class: 'js-save-button gl-mr-2', data: { qa_selector: 'label_create_button' }, pajamas_button: true
|
2023-01-13 00:05:48 +05:30
|
|
|
= render Pajamas::ButtonComponent.new(href: back_path) do
|
|
|
|
= _('Cancel')
|
|
|
|
|
2015-12-23 02:04:40 +05:30
|
|
|
- if @label.persisted?
|
2022-03-02 08:16:31 +05:30
|
|
|
- presented_label = @label.present
|
2023-01-13 00:05:48 +05:30
|
|
|
= render Pajamas::ButtonComponent.new(variant: :danger, category: :secondary, button_options: { class: 'js-delete-label-modal-button', data: { label_name: presented_label.name, subject_name: presented_label.subject_name, destroy_path: presented_label.destroy_path } }) do
|
|
|
|
= _('Delete')
|