summaryrefslogtreecommitdiff
path: root/app/views/projects/wikis/_form.html.haml
blob: 1d97479dc48cae0aaad00da4f409ad44443f1044 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
= form_for [@project, @wiki], method: @wiki.persisted? ? :put : :post do |f|
  -if @wiki.errors.any?
    #error_explanation
      %h2= "#{pluralize(@wiki.errors.count, "error")} prohibited this wiki from being saved:"
      %ul
        - @wiki.errors.full_messages.each do |msg|
          %li= msg

  .issue-box
    %h3.title
      .edit-wiki-header
        = @wiki.title.titleize
        = f.hidden_field :title, value: @wiki.title
        = f.select :format, options_for_select(GollumWiki::MARKUPS, {selected: @wiki.format}), {}, class: "pull-right input-medium"
        = f.label :format, class: "pull-right", style: "padding-right: 20px;"
    .context
      .col-sm-10
        %span.cgray
          Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
          To link to a (new) page you can just type
          %code [Link Title](page-slug)
          \.

    .description
      .form-group
        = f.label :content
        .col-sm-10= f.text_area :content, class: 'span8 js-gfm-input', rows: 18
    .description
      .form-group
        = f.label :commit_message
        .col-sm-10= f.text_field :message, class: 'span8', rows: 18
  .form-actions
    - if @wiki && @wiki.persisted?
      = f.submit 'Save changes', class: "btn-save btn"
      = link_to "Cancel", project_wiki_path(@project, @wiki), class: "btn btn-cancel"
    - else
      = f.submit 'Create page', class: "btn-create btn"
      = link_to "Cancel", project_wiki_path(@project, :home), class: "btn btn-cancel"