2016-04-05 07:33:30 -04:00
|
|
|
= form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post, html: { class: 'form-horizontal wiki-form common-note-form prepend-top-default js-quick-submit' } do |f|
|
2016-04-04 21:25:38 -04:00
|
|
|
= form_errors(@page)
|
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
|
|
|
|
2015-12-02 07:59:42 -05:00
|
|
|
.form-group
|
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
|
2016-04-05 07:33:30 -04:00
|
|
|
= render 'projects/zen', f: f, attr: :content, classes: 'note-textarea', placeholder: 'Write your content or drag files here...'
|
2015-11-07 14:22:16 -05:00
|
|
|
= render 'projects/notes/hints'
|
2014-12-24 09:52:40 -05:00
|
|
|
|
2014-05-23 04:22:00 -04:00
|
|
|
.clearfix
|
|
|
|
.error-alert
|
2015-12-02 07:59:42 -05:00
|
|
|
|
|
|
|
.help-block
|
2016-05-31 06:29:16 -04:00
|
|
|
= succeed '.' do
|
|
|
|
To link to a (new) page, simply type
|
|
|
|
%code [Link Title](page-slug)
|
|
|
|
|
|
|
|
= succeed '.' do
|
|
|
|
More examples are in the
|
2016-08-02 06:42:14 -04:00
|
|
|
= link_to 'documentation', help_page_path("user/project/markdown", anchor: "wiki-specific-markdown")
|
2016-05-31 06:29:16 -04:00
|
|
|
|
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"
|