new.html.haml 1.9 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

9
%h3.page-title
D
Douwe Maan 已提交
10
  New Tag
11 12
%hr

13
= form_tag namespace_project_tags_path, method: :post, id: "new-tag-form", class: "form-horizontal common-note-form tag-form js-quick-submit js-requires-input" do
D
Dmitriy Zaporozhets 已提交
14
  .form-group
15
    = label_tag :tag_name, nil, class: 'control-label'
D
Dmitriy Zaporozhets 已提交
16
    .col-sm-10
17
      = text_field_tag :tag_name, params[:tag_name], required: true, tabindex: 1, autofocus: true, class: 'form-control'
D
Dmitriy Zaporozhets 已提交
18
  .form-group
19
    = label_tag :ref, 'Create from', class: 'control-label'
D
Dmitriy Zaporozhets 已提交
20
    .col-sm-10
21
      = text_field_tag :ref, params[:ref] || @project.default_branch, required: true, tabindex: 2, class: 'form-control'
22
      .help-block  Branch name or commit SHA
23
  .form-group
24
    = label_tag :message, nil, class: 'control-label'
25
    .col-sm-10
26
      = text_field_tag :message, nil, required: false, tabindex: 3, class: 'form-control'
27
      .help-block Optionally, enter a message to create an annotated tag.
28 29
  %hr
  .form-group
30
    = label_tag :release_description, 'Release notes', class: 'control-label'
31 32
    .col-sm-10
      = render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do
33
        = render 'projects/zen', attr: :release_description, classes: 'note-textarea', placeholder: "Write your release notes or drag files here..."
34
        = render 'projects/notes/hints'
35
      .help-block Optionally, add release notes to the tag. They will be stored in the GitLab database and displayed on the tags page.
36
  .form-actions
37
    = button_tag 'Create tag', class: 'btn btn-create', tabindex: 3
V
Vinnie Okada 已提交
38
    = link_to 'Cancel', namespace_project_tags_path(@project.namespace, @project), class: 'btn btn-cancel'
39 40

:javascript
D
Douwe Maan 已提交
41
  var availableRefs = #{@project.repository.ref_names.to_json};
42 43

  $("#ref").autocomplete({
D
Douwe Maan 已提交
44
    source: availableRefs,
45 46
    minLength: 1
  });