Project

General

Profile

Patch #13234 ยป create_wiki_for_layman.diff

Can be used to patch to trunk directly - Devaroop Bhattacharya, 2013-02-22 15:31

View differences:

public/javascripts/application.js (working copy)
$(document).ready(setupAjaxIndicator);
$(document).ready(hideOnLoad);
$(document).ready(addFormObserversForDoubleSubmit);
function create_new_wiki(project_name){
wiki_title = document.getElementById('create_new_wiki').value;
if(wiki_title == "")
{
alert('"Title of new wiki" cannot be blank');
return;
}
uri = '/projects/' + project_name + '/wiki/' + wiki_title;
//redirect to the page
window.location.href = uri;
}
app/views/wiki/_sidebar.html.erb (working copy)
<%= link_to l(:field_start_page), {:action => 'show', :id => nil} %><br />
<%= link_to l(:label_index_by_title), {:action => 'index'} %><br />
<%= link_to l(:label_index_by_date), {:controller => 'wiki', :project_id => @project, :action => 'date_index'} %><br />
<%= link_to l(:label_index_by_date), {:controller => 'wiki', :project_id => @project, :action => 'date_index'} %><br /><br/><br/>
<%= text_field_tag(:create_new_wiki, '', :placeholder => l(:new_page_hint), :size => "20") %> <%= button_to_function l(:field_create_page), "create_new_wiki('#{@project.identifier}')" %><br />
<em><%= l(:text_unallowed_characters) %>: , . / ? ; : |</em> <br />
config/locales/en.yml (working copy)
field_comments: Comment
field_url: URL
field_start_page: Start page
field_create_page: Create Wiki
new_page_hint: Enter Title of new wiki
field_subproject: Subproject
field_hours: Hours
field_activity: Activity
    (1-1/1)