2014-04-09 07:35:01 -04:00
|
|
|
= form_for [@project, @page], method: @page.persisted? ? :put : :post, html: { class: 'form-horizontal' } do |f|
|
|
|
|
-if @page.errors.any?
|
2012-02-19 09:35:31 -05:00
|
|
|
#error_explanation
|
2014-05-20 09:22:47 -04:00
|
|
|
.alert.alert-danger
|
2014-04-09 07:35:01 -04:00
|
|
|
- @page.errors.full_messages.each do |msg|
|
2014-05-20 09:22:47 -04:00
|
|
|
%p= msg
|
2012-02-19 09:35:31 -05:00
|
|
|
|
2014-04-09 07:35:01 -04:00
|
|
|
= f.hidden_field :title, value: @page.title
|
2014-01-01 15:44:30 -05:00
|
|
|
.form-group
|
|
|
|
= f.label :format, class: 'control-label'
|
|
|
|
.col-sm-10
|
2014-04-09 07:35:01 -04:00
|
|
|
= f.select :format, options_for_select(ProjectWiki::MARKUPS, {selected: @page.format}), {}, class: "form-control"
|
2014-01-01 15:44:30 -05:00
|
|
|
|
|
|
|
.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
|
2014-05-23 04:22:00 -04:00
|
|
|
= f.text_area :content, class: 'form-control js-gfm-input markdown-area', rows: 18
|
|
|
|
.col-sm-12.hint
|
2014-05-28 09:58:02 -04:00
|
|
|
.pull-left Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}
|
2014-05-27 23:47:00 -04:00
|
|
|
.pull-right Attach images (JPG, PNG, GIF) by dragging & dropping, #{link_to "selecting them", '#', class: 'markdown-selector' } or pasting from the clipboard.
|
2014-05-23 04:22:00 -04:00
|
|
|
.clearfix
|
|
|
|
.error-alert
|
2014-01-01 15:44:30 -05:00
|
|
|
.form-group
|
|
|
|
= f.label :commit_message, class: 'control-label'
|
|
|
|
.col-sm-10= f.text_field :message, class: 'form-control', rows: 18
|
2012-07-26 07:45:17 -04:00
|
|
|
|
2013-08-07 16:35:24 -04:00
|
|
|
.form-actions
|
2014-04-09 07:35:01 -04:00
|
|
|
- if @page && @page.persisted?
|
2013-08-01 15:35:40 -04:00
|
|
|
= f.submit 'Save changes', class: "btn-save btn"
|
2014-04-09 07:35:01 -04:00
|
|
|
= link_to "Cancel", project_wiki_path(@project, @page), class: "btn btn-cancel"
|
2013-03-20 00:28:10 -04:00
|
|
|
- else
|
2013-08-01 15:35:40 -04:00
|
|
|
= f.submit 'Create page', class: "btn-create btn"
|
2013-03-20 00:28:10 -04:00
|
|
|
= link_to "Cancel", project_wiki_path(@project, :home), class: "btn btn-cancel"
|
2014-05-23 04:22:00 -04:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
window.project_image_path_upload = "#{upload_image_project_path @project}";
|
|
|
|
|