Commit 112dc875ba325cfb0b223165c20d8424698e7791
1 parent
ae06a0aa
Exists in
master
and in
4 other branches
feature: wiki -> new page
Showing
3 changed files
with
34 additions
and
1 deletions
Show diff stats
app/views/wikis/_nav.html.haml
| @@ -9,3 +9,11 @@ | @@ -9,3 +9,11 @@ | ||
| 9 | = link_to git_access_project_wikis_path(@project) do | 9 | = link_to git_access_project_wikis_path(@project) do |
| 10 | %i.icon-download-alt | 10 | %i.icon-download-alt |
| 11 | Git Access | 11 | Git Access |
| 12 | + | ||
| 13 | + - if can?(current_user, :write_wiki, @project) | ||
| 14 | + %li.pull-right | ||
| 15 | + = link_to '#', class: "add-new-wiki" do | ||
| 16 | + %i.icon-plus | ||
| 17 | + New Page | ||
| 18 | + | ||
| 19 | += render 'wikis/new' |
| @@ -0,0 +1,25 @@ | @@ -0,0 +1,25 @@ | ||
| 1 | +%div#modal-new-wiki.modal.hide | ||
| 2 | + .modal-header | ||
| 3 | + %a.close{href: "#"} × | ||
| 4 | + %h3 New Wiki Page | ||
| 5 | + .modal-body | ||
| 6 | + = label_tag :new_wiki_path do | ||
| 7 | + %span Page slug | ||
| 8 | + = text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'input-xlarge' | ||
| 9 | + .modal-footer | ||
| 10 | + = link_to 'Build', '#', class: 'build-new-wiki btn btn-create' | ||
| 11 | + | ||
| 12 | +:javascript | ||
| 13 | + $(function(){ | ||
| 14 | + var modal = $('#modal-new-wiki').modal({modal: true, show:false}); | ||
| 15 | + $('.add-new-wiki').bind("click", function(){ | ||
| 16 | + modal.show(); | ||
| 17 | + }); | ||
| 18 | + $('.build-new-wiki').bind("click", function(){ | ||
| 19 | + location.href = "#{project_wikis_path(@project)}/" + $('#new_wiki_path').val(); | ||
| 20 | + }); | ||
| 21 | + $('.modal-header .close').bind("click", function(){ | ||
| 22 | + modal.hide(); | ||
| 23 | + }) | ||
| 24 | + }) | ||
| 25 | + |
features/project/active_tab.feature
| @@ -37,7 +37,7 @@ Feature: Project active tab | @@ -37,7 +37,7 @@ Feature: Project active tab | ||
| 37 | 37 | ||
| 38 | Scenario: On Project Wall | 38 | Scenario: On Project Wall |
| 39 | Given I visit my project's wall page | 39 | Given I visit my project's wall page |
| 40 | - Then the active main tab should be Wiki | 40 | + Then the active main tab should be Wall |
| 41 | And no other main tabs should be active | 41 | And no other main tabs should be active |
| 42 | 42 | ||
| 43 | Scenario: On Project Wiki | 43 | Scenario: On Project Wiki |