summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-18 23:08:54 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-18 23:08:54 +0200
commit112dc875ba325cfb0b223165c20d8424698e7791 (patch)
treee76d1b7aaf8e5fbb739ef2a171d093b486572049 /app
parentae06a0aab8be3ea3bad8066d2e19c12d86b85ad8 (diff)
downloadgitlab-ce-112dc875ba325cfb0b223165c20d8424698e7791.tar.gz
feature: wiki -> new page
Diffstat (limited to 'app')
-rw-r--r--app/views/wikis/_nav.html.haml8
-rw-r--r--app/views/wikis/_new.html.haml25
2 files changed, 33 insertions, 0 deletions
diff --git a/app/views/wikis/_nav.html.haml b/app/views/wikis/_nav.html.haml
index 6a922e16d61..0dffdd8fc14 100644
--- a/app/views/wikis/_nav.html.haml
+++ b/app/views/wikis/_nav.html.haml
@@ -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'
diff --git a/app/views/wikis/_new.html.haml b/app/views/wikis/_new.html.haml
new file mode 100644
index 00000000000..50b40bff41c
--- /dev/null
+++ b/app/views/wikis/_new.html.haml
@@ -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();
+ })
+ })
+