3398e0a3d7
This reverts commit 2273234653
.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Conflicts:
app/views/projects/issues/_form.html.haml
app/views/projects/merge_requests/_form.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/milestones/_form.html.haml
app/views/projects/notes/_form.html.haml
app/views/projects/wikis/_form.html.haml
45 lines
1.7 KiB
Text
45 lines
1.7 KiB
Text
= form_for [@project, @page], method: @page.persisted? ? :put : :post, html: { class: 'form-horizontal' } do |f|
|
|
-if @page.errors.any?
|
|
#error_explanation
|
|
.alert.alert-danger
|
|
- @page.errors.full_messages.each do |msg|
|
|
%p= msg
|
|
|
|
= f.hidden_field :title, value: @page.title
|
|
.form-group
|
|
= f.label :format, class: 'control-label'
|
|
.col-sm-10
|
|
= f.select :format, options_for_select(ProjectWiki::MARKUPS, {selected: @page.format}), {}, class: "form-control"
|
|
|
|
.row
|
|
.col-sm-2
|
|
.col-sm-10
|
|
%p.cgray
|
|
To link to a (new) page you can just type
|
|
%code [Link Title](page-slug)
|
|
\.
|
|
|
|
.form-group
|
|
= f.label :content, class: 'control-label'
|
|
.col-sm-10
|
|
= f.text_area :content, class: 'form-control js-gfm-input markdown-area', rows: 18
|
|
.col-sm-12.hint
|
|
.pull-left Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}
|
|
.pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
|
|
.clearfix
|
|
.error-alert
|
|
.form-group
|
|
= f.label :commit_message, class: 'control-label'
|
|
.col-sm-10= f.text_field :message, class: 'form-control', rows: 18
|
|
|
|
.form-actions
|
|
- if @page && @page.persisted?
|
|
= f.submit 'Save changes', class: "btn-save btn"
|
|
= link_to "Cancel", project_wiki_path(@project, @page), 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"
|
|
|
|
:javascript
|
|
window.project_image_path_upload = "#{upload_image_project_path @project}";
|
|
|