fixes #208
This commit is contained in:
@@ -3,7 +3,7 @@ class FavoritesController < ApplicationController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
if params[:tags]
|
if params[:tags]
|
||||||
redirect_to(posts_path(:tags => "fav:#{CurrentUser.name} #{params[:tags]}"))
|
redirect_to(posts_path(:tags => params[:tags]))
|
||||||
else
|
else
|
||||||
@favorite_set = PostSets::Favorite.new(CurrentUser.user, params[:page])
|
@favorite_set = PostSets::Favorite.new(CurrentUser.user, params[:page])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ module PostSets
|
|||||||
end
|
end
|
||||||
|
|
||||||
def tag_string
|
def tag_string
|
||||||
tag_array.join(" ")
|
tag_array.uniq.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
def posts
|
def posts
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module PostSets
|
|||||||
end
|
end
|
||||||
|
|
||||||
def tag_string
|
def tag_string
|
||||||
@tag_string ||= tag_array.join(" ")
|
@tag_string ||= tag_array.uniq.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_wiki?
|
def has_wiki?
|
||||||
|
|||||||
@@ -7,16 +7,18 @@
|
|||||||
<li>|</li>
|
<li>|</li>
|
||||||
<li><%= link_to "Posts (#{Post.fast_count(@wiki_page.title)})", posts_path(:tags => @wiki_page.title) %></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_eq => @wiki_page.id}) %></li>
|
<li><%= link_to "History", wiki_page_versions_path(:search => {:wiki_page_id_eq => @wiki_page.id}) %></li>
|
||||||
<% unless @wiki_page.new_record? %>
|
<% if CurrentUser.is_member? %>
|
||||||
<li><%= link_to "Edit", edit_wiki_page_path(@wiki_page) %></li>
|
<% unless @wiki_page.new_record? %>
|
||||||
<% if CurrentUser.is_moderator? %>
|
<li><%= link_to "Edit", edit_wiki_page_path(@wiki_page) %></li>
|
||||||
<li><%= link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :confirm => "Do you want to delete this 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 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @wiki_page_version %>
|
<% if @wiki_page_version %>
|
||||||
<li>|</li>
|
<li>|</li>
|
||||||
<li><%= link_to "Current", wiki_page_path(@wiki_page_version.wiki_page_id) %></li>
|
<li><%= link_to "Newest", wiki_page_path(@wiki_page_version.wiki_page_id) %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</menu>
|
</menu>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -3,7 +3,13 @@
|
|||||||
<%= render "sidebar" %>
|
<%= render "sidebar" %>
|
||||||
|
|
||||||
<section id="content">
|
<section id="content">
|
||||||
<h1 id="wiki-page-title"><%= @wiki_page.pretty_title %></h1>
|
<h1 id="wiki-page-title">
|
||||||
|
<%= @wiki_page.pretty_title %>
|
||||||
|
|
||||||
|
<% if @wiki_page.is_locked? %>
|
||||||
|
(locked)
|
||||||
|
<% end %>
|
||||||
|
</h1>
|
||||||
|
|
||||||
<div id="wiki-page-body" class="prose">
|
<div id="wiki-page-body" class="prose">
|
||||||
<%= format_text(@wiki_page.body) %>
|
<%= format_text(@wiki_page.body) %>
|
||||||
|
|||||||
Reference in New Issue
Block a user