59 lines
3.5 KiB
Plaintext
59 lines
3.5 KiB
Plaintext
- page_title s_('TagsPage|New Tag')
|
|
- default_ref = params[:ref] || @project.default_branch
|
|
|
|
- if @error
|
|
.gl-alert.gl-alert-danger
|
|
= sprite_icon('error', css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title')
|
|
%button.js-close.gl-alert-dismiss{ type: 'button', 'aria-label' => _('Dismiss') }
|
|
= sprite_icon('close', css_class: 'gl-icon')
|
|
= @error
|
|
|
|
%h3.page-title
|
|
= s_('TagsPage|New Tag')
|
|
%hr
|
|
|
|
= form_tag namespace_project_tags_path, method: :post, id: "new-tag-form", class: "common-note-form tag-form js-quick-submit js-requires-input" do
|
|
.form-group.row
|
|
= label_tag :tag_name, nil, class: 'col-form-label col-sm-2'
|
|
.col-sm-10
|
|
= text_field_tag :tag_name, params[:tag_name], required: true, autofocus: true, class: 'form-control', data: { qa_selector: "tag_name_field" }
|
|
.form-group.row
|
|
= label_tag :ref, 'Create from', class: 'col-form-label col-sm-2'
|
|
.col-sm-10.create-from
|
|
.dropdown
|
|
= hidden_field_tag :ref, default_ref
|
|
= button_tag type: 'button', title: default_ref, class: 'dropdown-menu-toggle wide js-branch-select monospace', required: true, data: { toggle: 'dropdown', selected: default_ref, field_name: 'ref' } do
|
|
.text-left.dropdown-toggle-text= default_ref
|
|
= sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3')
|
|
= render 'shared/ref_dropdown', dropdown_class: 'wide'
|
|
.form-text.text-muted
|
|
= s_('TagsPage|Existing branch name, tag, or commit SHA')
|
|
.form-group.row
|
|
= label_tag :message, nil, class: 'col-form-label col-sm-2'
|
|
.col-sm-10
|
|
= text_area_tag :message, @message, required: false, class: 'form-control', rows: 5, data: { qa_selector: "tag_message_field" }
|
|
.form-text.text-muted
|
|
= tag_description_help_text
|
|
%hr
|
|
.form-group.row
|
|
= label_tag :release_description, s_('TagsPage|Release notes'), class: 'col-form-label col-sm-2'
|
|
.col-sm-10
|
|
.form-text.mb-3
|
|
- link_start = '<a href="%{url}" rel="noopener noreferrer" target="_blank">'.html_safe
|
|
- releases_page_path = project_releases_path(@project)
|
|
- releases_page_link_start = link_start % { url: releases_page_path }
|
|
- docs_url = help_page_path('user/project/releases/index.md', anchor: 'create-a-release')
|
|
- docs_link_start = link_start % { url: docs_url }
|
|
- link_end = '</a>'.html_safe
|
|
- replacements = { releases_page_link_start: releases_page_link_start, docs_link_start: docs_link_start, link_end: link_end }
|
|
= s_('TagsPage|Optionally, create a public Release of your project, based on this tag. Release notes are displayed on the %{releases_page_link_start}Releases%{link_end} page. %{docs_link_start}More information%{link_end}').html_safe % replacements
|
|
|
|
= render layout: 'shared/md_preview', locals: { url: preview_markdown_path(@project), referenced_users: true } do
|
|
= render 'shared/zen', attr: :release_description, classes: 'note-textarea', placeholder: s_('TagsPage|Write your release notes or drag files here…'), current_text: @release_description, qa_selector: 'release_notes_field'
|
|
= render 'shared/notes/hints'
|
|
.form-actions.gl-display-flex
|
|
= button_tag s_('TagsPage|Create tag'), class: 'gl-button btn btn-confirm gl-mr-3', data: { qa_selector: "create_tag_button" }
|
|
= link_to s_('TagsPage|Cancel'), project_tags_path(@project), class: 'gl-button btn btn-default btn-cancel'
|
|
-# haml-lint:disable InlineJavaScript
|
|
%script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe
|