new.html.haml 2.3 KB
Newer Older
D
Douwe Maan 已提交
1
- page_title "New Tag"
2 3
= render "projects/commits/header_title"

4 5 6 7
- if @error
  .alert.alert-danger
    %button{ type: "button", class: "close", "data-dismiss" => "alert"} ×
    = @error
8
%h3.page-title
S
Sullivan SENECHAL 已提交
9
  %i.fa.fa-code-fork
10
  New tag
11
= form_tag namespace_project_tags_path, method: :post, id: "new-tag-form", class: "form-horizontal tag-form" do
D
Dmitriy Zaporozhets 已提交
12
  .form-group
13
    = label_tag :tag_name, 'Name for new tag', class: 'control-label'
D
Dmitriy Zaporozhets 已提交
14
    .col-sm-10
15
      = text_field_tag :tag_name, params[:tag_name], placeholder: 'v3.0.1', required: true, tabindex: 1, class: 'form-control'
D
Dmitriy Zaporozhets 已提交
16
  .form-group
17
    = label_tag :ref, 'Create from', class: 'control-label'
D
Dmitriy Zaporozhets 已提交
18
    .col-sm-10
19
      = text_field_tag :ref, params[:ref], placeholder: 'master', required: true, tabindex: 2, class: 'form-control'
20
      .light Branch name or commit SHA
21 22 23 24 25
  .form-group
    = label_tag :message, 'Message', class: 'control-label'
    .col-sm-10
      = text_field_tag :message, nil, placeholder: 'Enter message.', required: false, tabindex: 3, class: 'form-control'
      .light (Optional) Entering a message will create an annotated tag.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
  %hr
  .form-group
    = label_tag :release_description, 'Release description', class: 'control-label'
    .col-sm-10
      = render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do
        .zennable
          %input#zen-toggle-comment.zen-toggle-comment(tabindex="-1" type="checkbox")
          .zen-backdrop
            = text_area_tag :release_description, nil, class: 'js-gfm-input markdown-area description js-quick-submit form-control', placeholder: ''
            %a.zen-enter-link(tabindex="-1" href="#")
              = icon('expand')
              Edit in fullscreen
            %a.zen-leave-link(href="#")
              = icon('compress')

        = render 'projects/notes/hints'
        .help-block You can add release description to your tag. It will be stored in GitLab database and displayed on tags page
43
  .form-actions
44
    = button_tag 'Create tag', class: 'btn btn-create', tabindex: 3
V
Vinnie Okada 已提交
45
    = link_to 'Cancel', namespace_project_tags_path(@project.namespace, @project), class: 'btn btn-cancel'
46 47

:javascript
48
  disableButtonIfAnyEmptyField($("#new-tag-form"), ".form-control", ".btn-create");
49 50 51 52 53 54
  var availableTags = #{@project.repository.ref_names.to_json};

  $("#ref").autocomplete({
    source: availableTags,
    minLength: 1
  });