new.html.haml 1.9 KB
Newer Older
D
Douwe Maan 已提交
1
- page_title "New Tag"
2

3 4
- if @error
  .alert.alert-danger
5
    %button.close{ type: "button", "data-dismiss" => "alert" } ×
6
    = @error
7

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

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

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

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