debian-mirror-gitlab/app/views/projects/wikis/_form.html.haml

39 lines
1.5 KiB
Text
Raw Normal View History

2015-12-23 02:04:40 +05:30
= form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post, html: { class: 'form-horizontal wiki-form gfm-form prepend-top-default' } do |f|
2014-09-02 18:07:02 +05:30
-if @page.errors.any?
#error_explanation
.alert.alert-danger
- @page.errors.full_messages.each do |msg|
%p= msg
= 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-23 02:04:40 +05:30
.form-group
2014-09-02 18:07:02 +05:30
= f.label :content, class: 'control-label'
.col-sm-10
2015-09-25 12:07:36 +05:30
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview" } do
2015-10-24 18:46:33 +05:30
= render 'projects/zen', f: f, attr: :content, classes: 'description form-control js-quick-submit'
2015-11-26 14:37:03 +05:30
= render 'projects/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
To link to a (new) page, simply type
%code [Link Title](page-slug)
\.
2014-09-02 18:07:02 +05:30
.form-group
= f.label :commit_message, class: 'control-label'
.col-sm-10= f.text_field :message, class: 'form-control', rows: 18
.form-actions
- if @page && @page.persisted?
= f.submit 'Save changes', class: "btn-save btn"
2015-04-26 12:48:37 +05:30
= link_to "Cancel", namespace_project_wiki_path(@project.namespace, @project, @page), class: "btn btn-cancel"
2014-09-02 18:07:02 +05:30
- else
= f.submit 'Create page', class: "btn-create btn"
2015-04-26 12:48:37 +05:30
= link_to "Cancel", namespace_project_wiki_path(@project.namespace, @project, :home), class: "btn btn-cancel"