BigW Consortium Gitlab

_form.html.haml 2.02 KB
Newer Older
1
%div.issue-form-holder
2
  %h3.page_title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"
3
  = form_for [@project, @issue], remote: request.xhr? do |f|
4
    -if @issue.errors.any?
5 6 7 8
      .alert-message.block-message.error
        %ul
          - @issue.errors.full_messages.each do |msg|
            %li= msg
9 10 11
    .issue_form_box
      .issue_title
        .clearfix
12
          = f.label :title do
13
            %strong= "Subject *"
14
          .input
15
            = f.text_field :title, maxlength: 255, class: "xxlarge"
16 17
      .issue_middle_block
        .issue_assignee
18
          = f.label :assignee_id do
19 20
            %i.icon-user
            Assign to
21
          .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" })
22
        .issue_milestone
23
          = f.label :milestone_id do
24 25
            %i.icon-time
            Milestone
26
          .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" })
27 28 29

      .issue_description
        .clearfix
30 31
          = f.label :label_list do
            %i.icon-tag
32 33
            Labels
          .input
34
            = f.text_field :label_list, maxlength: 2000, class: "xxlarge"
35
            %p.hint Separate with comma.
36

37
        .clearfix
38
          = f.label :description, "Details"
39
          .input
40
            = f.text_area :description, maxlength: 2000, class: "xxlarge", rows: 14
41
            %p.hint Issues are parsed with #{link_to "Gitlab Flavored Markdown", help_markdown_path, target: '_blank'}.
42

43

44
    .actions
45
      - if @issue.new_record?
46
        = f.submit 'Submit new issue', class: "primary btn"
47
      -else
48
        = f.submit 'Save changes', class: "primary btn"
49 50

      - if request.xhr?
51
        = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn"
52
      - else
53
        - if @issue.new_record?
54
          = link_to "Cancel", project_issues_path(@project), class: "btn"
55
        - else
56
          = link_to "Cancel", project_issue_path(@project, @issue), class: "btn"