_new.html.haml 753 Bytes
Newer Older
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
%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();
    })
  })