2015-01-24 13:02:58 -05:00
|
|
|
= form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post, html: { class: 'form-horizontal wiki-form gfm-form' } do |f|
|
2014-04-09 07:35:01 -04:00
|
|
|
-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
|
2015-06-15 18:48:54 -04:00
|
|
|
.col-sm-offset-2.col-sm-10
|
2014-01-01 15:44:30 -05:00
|
|
|
%p.cgray
|
|
|
|
To link to a (new) page you can just type
|
|
|
|
%code [Link Title](page-slug)
|
|
|
|
\.
|
|
|
|
|
2014-12-24 09:52:40 -05:00
|
|
|
.form-group.wiki-content
|
2014-01-01 15:44:30 -05:00
|
|
|
= f.label :content, class: 'control-label'
|
|
|
|
.col-sm-10
|
2015-09-21 17:08:26 -04:00
|
|
|
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview" } do
|
2015-10-05 18:20:43 -04:00
|
|
|
= render 'projects/zen', f: f, attr: :content, classes: 'description form-control js-quick-submit'
|
2014-12-24 09:52:40 -05:00
|
|
|
.col-sm-12.hint
|
|
|
|
.pull-left Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}
|
2015-02-14 10:04:45 -05:00
|
|
|
.pull-right Attach files by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
|
2014-12-24 09:52:40 -05:00
|
|
|
|
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"
|
2015-01-24 13:02:58 -05:00
|
|
|
= link_to "Cancel", namespace_project_wiki_path(@project.namespace, @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"
|
2015-01-24 13:02:58 -05:00
|
|
|
= link_to "Cancel", namespace_project_wiki_path(@project.namespace, @project, :home), class: "btn btn-cancel"
|