summaryrefslogtreecommitdiff
path: root/app/views/projects/wikis/edit.html.haml
blob: 8fd60216536180abd94b9832fe0dfe35127056da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout
- page_title "Edit", @page.title.capitalize, "Wiki"

- if @conflict
  .alert.alert-danger
    Someone edited the page the same time you did. Please check out
    = link_to "the page", project_wiki_path(@project, @page), target: "_blank"
    and make sure your changes will not unintentionally remove theirs.

.wiki-page-header.has-sidebar-toggle
  %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
    = icon('angle-double-left')

  .nav-text
    %h2.wiki-page-title
      - if @page.persisted?
        = link_to @page.title.capitalize, project_wiki_path(@project, @page)
      - else
        = @page.title.capitalize
      %span.light
        ·
        - if @page.persisted?
          Edit Page
        - else
          Create Page

  .nav-controls
    - if can?(current_user, :create_wiki, @project)
      = link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do
        New page
    - if @page.persisted?
      = link_to project_wiki_history_path(@project, @page), class: "btn" do
        Page history
      - if can?(current_user, :admin_wiki, @project)
        = link_to project_wiki_path(@project, @page), data: { confirm: "Are you sure you want to delete this page?"}, method: :delete, class: "btn btn-danger" do
          Delete

= render 'form'

= render 'sidebar'