gitlab-org--gitlab-foss/app/views/projects/wikis/_form.html.haml

44 lines
1.9 KiB
Text
Raw Normal View History

2017-04-04 21:58:27 -04:00
- commit_message = @page.persisted? ? "Update #{@page.title}" : "Create #{@page.title}"
= 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)
2012-02-19 09:35:31 -05:00
= 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"
2015-12-02 07:59:42 -05:00
.form-group
= f.label :content, class: 'control-label'
.col-sm-10
= render layout: 'projects/md_preview', locals: { url: namespace_project_wiki_preview_markdown_path(@project.namespace, @project, @page.slug) } do
= render 'projects/zen', f: f, attr: :content, classes: 'note-textarea', placeholder: 'Write your content or drag files here...'
2017-05-03 04:48:01 -04:00
= render 'shared/notes/hints'
2014-12-24 09:52:40 -05:00
.clearfix
.error-alert
2015-12-02 07:59:42 -05:00
.help-block
= succeed '.' do
To link to a (new) page, simply type
%code [Link Title](page-slug)
= succeed '.' do
More examples are in the
= link_to 'documentation', help_page_path("user/markdown", anchor: "wiki-specific-markdown")
.form-group
= f.label :commit_message, class: 'control-label'
2017-04-04 21:58:27 -04:00
.col-sm-10= f.text_field :message, class: 'form-control', rows: 18, value: commit_message
2013-08-07 16:35:24 -04:00
.form-actions
- if @page && @page.persisted?
= f.submit 'Save changes', class: "btn-save btn"
2016-10-27 10:23:58 -04:00
.pull-right
= link_to "Cancel", namespace_project_wiki_path(@project.namespace, @project, @page), class: "btn btn-cancel btn-grouped"
- else
= f.submit 'Create page', class: "btn-create btn"
2016-10-27 10:23:58 -04:00
.pull-right
= link_to "Cancel", namespace_project_wiki_path(@project.namespace, @project, :home), class: "btn btn-cancel"