This commit is contained in:
albert
2013-03-18 22:02:03 -07:00
parent 70a52628dd
commit c59afe4726
8 changed files with 20 additions and 23 deletions

View File

@@ -65,6 +65,8 @@ div#page {
section#content {
overflow: visible;
margin-left: 15em;
padding-left: 1em;
}
}

View File

@@ -9,8 +9,4 @@ div#c-favorites {
margin-left: 0;
margin-right: 6.5em;
}
#content {
margin-left: 15em;
}
}

View File

@@ -266,11 +266,6 @@ div#c-posts {
}
}
#content {
margin-left: 15em;
padding-left: 1em;
}
span.close-button {
position: absolute;
top: 5px;

View File

@@ -3,11 +3,6 @@ div#c-wiki-pages {
color: #AAA;
}
div#form-content {
float: left;
width: 30em;
}
del {
background: #FCC;
text-decoration: none;

View File

@@ -1,7 +1,7 @@
class WikiPagesController < ApplicationController
respond_to :html, :xml, :json, :js
before_filter :member_only, :except => [:index, :show, :show_or_new]
before_filter :moderator_only, :only => [:destroy]
before_filter :janitor_only, :only => [:destroy]
before_filter :normalize_search_params, :only => [:index]
rescue_from ActiveRecord::StatementInvalid, :with => :rescue_exception
@@ -30,7 +30,7 @@ class WikiPagesController < ApplicationController
if params[:id] =~ /[a-zA-Z]/
@wiki_page = WikiPage.find_by_title(params[:id])
else
@wiki_page = WikiPage.find(params[:id])
@wiki_page = WikiPage.find_by_id(params[:id])
end
respond_with(@wiki_page)
end

View File

@@ -4,16 +4,16 @@
<li><%= link_to "Search", search_wiki_pages_path %></li>
<li><%= link_to "New", new_wiki_page_path %></li>
<li><%= link_to "Help", wiki_pages_path(:search => {:title => "help:wiki"}) %></li>
<% if @wiki_page && !@wiki_page.new_record? %>
<% if @wiki_page %>
<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 => @wiki_page.id}) %></li>
<% if CurrentUser.is_member? %>
<% unless @wiki_page.new_record? %>
<% unless @wiki_page.new_record? %>
<li><%= link_to "History", wiki_page_versions_path(:search => {:wiki_page_id => @wiki_page.id}) %></li>
<% if CurrentUser.is_member? %>
<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 %>
<% if CurrentUser.is_janitor? %>
<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 %>

View File

@@ -5,6 +5,14 @@
<section id="content">
<h1>New Wiki Page</h1>
<%= render "form" %>
<div id="wiki-page-posts">
<h2>Posts</h2>
<%= @wiki_page.post_set.presenter.post_previews_html(self) %>
</div>
<div class="clearfix"></div>
</section>
</div>
</div>

View File

@@ -4,6 +4,7 @@
<section id="content">
<h1 id="wiki-page-title">
<%= @wiki_page.pretty_title %>
<% if @wiki_page.is_locked? %>