improved pool simple edit interface

This commit is contained in:
albert
2011-03-03 18:26:50 -05:00
parent 9e7efbd295
commit e431452a11
17 changed files with 150 additions and 85 deletions

View File

@@ -1,5 +1,8 @@
<%= f.input :title %>
<% if @wiki_page.new_record? || CurrentUser.is_moderator? %>
<%= f.input :title %>
<% end %>
<%= f.input :body %>
<% if CurrentUser. %>
<%= f.input :is_locked %>
<% if CurrentUser.is_janitor? %>
<%= f.input :is_locked %>
<% end %>
<%= f.button :submit, "Save" %><%= f.button :submit, "Cancel" %><%= f.button :submit "Preview" %>

View File

@@ -7,9 +7,11 @@
<li>|</li>
<li><%= link_to "Posts (#{Post.fast_count(@wiki_page.title)})", posts_path(:tags => @wiki_page.title) %></li>
<li><%= link_to "History", wiki_page_versions_path(:search => {:wiki_page_id_equals => @wiki_page.id}) %></li>
<li><%= link_to "Edit", edit_wiki_page_path(@wiki_page) %></li>
<% if CurrentUser.is_moderator? %>
<li><%= link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :confirm => "Do you want to delete this wiki page?" %></li>
<% unless @wiki_page.new_record? %>
<li><%= link_to "Edit", edit_wiki_page_path(@wiki_page) %></li>
<% if CurrentUser.is_moderator? %>
<li><%= link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :confirm => "Do you want to delete this wiki page?" %></li>
<% end %>
<% end %>
<% end %>
</menu>

View File

@@ -10,48 +10,8 @@
</div>
<div id="wiki-page-posts">
<%= @wiki_page.presenter.posts %>
<%= @wiki_page.post_set.presenter.post_previews_html %>
</div>
</section>
</div>
</div>
<div class="wiki" id="wiki-show">
<%= render :partial => "sidebar" %>
<h2 class="title"><%= @presenter.html_title %></h2>
<div id="body">
<div style="margin-bottom: 1em;">
<%= @presenter.html_body(self) %>
</div>
<div style="margin-bottom: 1em;">
<%= @presenter.html_posts(self) %>
</div>
</div>
<% content_for("footer") do %>
<li>|</li>
<% if @wiki_page.nil? %>
<li><%= link_to "Posts (#{Post.fast_count(params[:title])})", :controller => "post", :action => "index", :tags => params[:title] %></li>
<li><%= link_to "Edit", :controller => "wiki", :action => "edit", :title => params[:title] %></li>
<% else %>
<li><%= link_to "Posts (#{Post.fast_count(params[:title])})", :controller => "post", :action => "index", :tags => @title %></li>
<li><%= link_to "History", :controller => "wiki", :action => "history", :title => @wiki_page.title %></li>
<% if not @wiki_page.is_locked? %>
<li><%= link_to "Edit", :controller => "wiki", :action => "edit", :title => @wiki_page.title, :version => @wiki_page.version %></li>
<% end %>
<% if @wiki_page.is_locked? %>
<li><%= link_to "Unlock", {:controller => "wiki", :action => "unlock", :title => @wiki_page.title}, :method => "post" %></li>
<% else %>
<li><%= link_to "Revert", {:controller => "wiki", :action => "revert", :title => @wiki_page.title, :version => @wiki_page.version}, :confirm => "Are you sure you want to revert to this page?", :method => :post %></li>
<li><%= link_to "Delete", {:controller => "wiki", :action => "destroy", :title => @wiki_page.title}, :confirm => "Are you sure you want to delete this page (and all versions)?", :method => :post %></li>
<li><%= link_to "Lock", {:controller => "wiki", :action => "lock", :title => @wiki_page.title}, :method => :post %></li>
<li><%= link_to "Rename", :action => "rename", :title => @wiki_page.title %></li>
<% end %>
<% end %>
<% end %>
<%= render :partial => "footer" %>
</div>