2013-03-18 21:08:54 +00:00
|
|
|
|
%div#modal-new-wiki.modal.hide
|
|
|
|
|
.modal-header
|
|
|
|
|
%a.close{href: "#"} ×
|
2013-04-16 19:20:35 +00:00
|
|
|
|
%h3.page_title New Wiki Page
|
2013-03-18 21:08:54 +00:00
|
|
|
|
.modal-body
|
|
|
|
|
= label_tag :new_wiki_path do
|
|
|
|
|
%span Page slug
|
2013-04-16 19:20:35 +00:00
|
|
|
|
= text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'input-xlarge', required: true
|
|
|
|
|
%p.hint
|
|
|
|
|
Please dont use spaces and slashes
|
2013-03-18 21:08:54 +00:00
|
|
|
|
.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(){
|
2013-04-16 19:20:35 +00:00
|
|
|
|
var slug = $('#new_wiki_path').val();
|
|
|
|
|
|
|
|
|
|
if(slug.length > 0) {
|
|
|
|
|
location.href = "#{project_wikis_path(@project)}/" + slug;
|
|
|
|
|
}
|
2013-03-18 21:08:54 +00:00
|
|
|
|
});
|
|
|
|
|
$('.modal-header .close').bind("click", function(){
|
|
|
|
|
modal.hide();
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|