2017-08-17 22:00:37 +05:30
|
|
|
- commit_message = @page.persisted? ? "Update #{@page.title}" : "Create #{@page.title}"
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
= 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|
|
|
|
|
= form_errors(@page)
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
- if @page.persisted?
|
|
|
|
= f.hidden_field :last_commit_sha, value: @page.last_commit_sha
|
|
|
|
|
|
|
|
.form-group
|
|
|
|
.col-sm-12= f.label :title, class: 'control-label-full-width'
|
|
|
|
.col-sm-12= f.text_field :title, class: 'form-control', value: @page.title
|
2014-09-02 18:07:02 +05:30
|
|
|
.form-group
|
2017-09-10 17:25:29 +05:30
|
|
|
.col-sm-12= f.label :format, class: 'control-label-full-width'
|
|
|
|
.col-sm-12
|
2014-09-02 18:07:02 +05:30
|
|
|
= f.select :format, options_for_select(ProjectWiki::MARKUPS, {selected: @page.format}), {}, class: "form-control"
|
|
|
|
|
2015-12-23 02:04:40 +05:30
|
|
|
.form-group
|
2017-09-10 17:25:29 +05:30
|
|
|
.col-sm-12= f.label :content, class: 'control-label-full-width'
|
|
|
|
.col-sm-12
|
|
|
|
= render layout: 'projects/md_preview', locals: { url: project_wiki_preview_markdown_path(@project, @page.slug) } do
|
2016-06-02 11:05:42 +05:30
|
|
|
= render 'projects/zen', f: f, attr: :content, classes: 'note-textarea', placeholder: 'Write your content or drag files here...'
|
2017-08-17 22:00:37 +05:30
|
|
|
= render 'shared/notes/hints'
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
.clearfix
|
|
|
|
.error-alert
|
2015-12-23 02:04:40 +05:30
|
|
|
|
|
|
|
.help-block
|
2016-09-13 17:45:13 +05:30
|
|
|
= succeed '.' do
|
|
|
|
To link to a (new) page, simply type
|
|
|
|
%code [Link Title](page-slug)
|
|
|
|
|
|
|
|
= succeed '.' do
|
|
|
|
More examples are in the
|
2016-11-03 12:29:30 +05:30
|
|
|
= link_to 'documentation', help_page_path("user/markdown", anchor: "wiki-specific-markdown")
|
2016-09-13 17:45:13 +05:30
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
.form-group
|
2017-09-10 17:25:29 +05:30
|
|
|
.col-sm-12= f.label :commit_message, class: 'control-label-full-width'
|
|
|
|
.col-sm-12= f.text_field :message, class: 'form-control', rows: 18, value: commit_message
|
2014-09-02 18:07:02 +05:30
|
|
|
|
|
|
|
.form-actions
|
|
|
|
- if @page && @page.persisted?
|
|
|
|
= f.submit 'Save changes', class: "btn-save btn"
|
2017-08-17 22:00:37 +05:30
|
|
|
.pull-right
|
2017-09-10 17:25:29 +05:30
|
|
|
= link_to "Cancel", project_wiki_path(@project, @page), class: "btn btn-cancel btn-grouped"
|
2014-09-02 18:07:02 +05:30
|
|
|
- else
|
|
|
|
= f.submit 'Create page', class: "btn-create btn"
|
2017-08-17 22:00:37 +05:30
|
|
|
.pull-right
|
2017-09-10 17:25:29 +05:30
|
|
|
= link_to "Cancel", project_wiki_path(@project, :home), class: "btn btn-cancel"
|