feature: wiki -> new page
This commit is contained in:
parent
ae06a0aab8
commit
112dc875ba
3 changed files with 34 additions and 1 deletions
|
@ -9,3 +9,11 @@
|
|||
= link_to git_access_project_wikis_path(@project) do
|
||||
%i.icon-download-alt
|
||||
Git Access
|
||||
|
||||
- if can?(current_user, :write_wiki, @project)
|
||||
%li.pull-right
|
||||
= link_to '#', class: "add-new-wiki" do
|
||||
%i.icon-plus
|
||||
New Page
|
||||
|
||||
= render 'wikis/new'
|
||||
|
|
25
app/views/wikis/_new.html.haml
Normal file
25
app/views/wikis/_new.html.haml
Normal file
|
@ -0,0 +1,25 @@
|
|||
%div#modal-new-wiki.modal.hide
|
||||
.modal-header
|
||||
%a.close{href: "#"} ×
|
||||
%h3 New Wiki Page
|
||||
.modal-body
|
||||
= label_tag :new_wiki_path do
|
||||
%span Page slug
|
||||
= text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'input-xlarge'
|
||||
.modal-footer
|
||||
= link_to 'Build', '#', class: 'build-new-wiki btn btn-create'
|
||||
|
||||
:javascript
|
||||
$(function(){
|
||||
var modal = $('#modal-new-wiki').modal({modal: true, show:false});
|
||||
$('.add-new-wiki').bind("click", function(){
|
||||
modal.show();
|
||||
});
|
||||
$('.build-new-wiki').bind("click", function(){
|
||||
location.href = "#{project_wikis_path(@project)}/" + $('#new_wiki_path').val();
|
||||
});
|
||||
$('.modal-header .close').bind("click", function(){
|
||||
modal.hide();
|
||||
})
|
||||
})
|
||||
|
|
@ -37,7 +37,7 @@ Feature: Project active tab
|
|||
|
||||
Scenario: On Project Wall
|
||||
Given I visit my project's wall page
|
||||
Then the active main tab should be Wiki
|
||||
Then the active main tab should be Wall
|
||||
And no other main tabs should be active
|
||||
|
||||
Scenario: On Project Wiki
|
||||
|
|
Loading…
Reference in a new issue