<%= t 'num_participants' %> <%= topic.participant_count %>
+
<%= link_to t('read_full_topic'), topic_url %>
+ ]]>
+ <%= topic_url %>
+ <%= topic.created_at.rfc2822 %>
+ <%= topic_url %>
+ <%= topic.title %>
+
+ <% end %>
<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 70d390e2e..eecb2cd8b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -200,24 +200,23 @@ Discourse::Application.routes.draw do
resources :categories, :except => :show
get "category/:id/show" => "categories#show"
- post "category/:category_id/move" => "categories#move", as: "category_move"
- get "category/:category.rss" => "list#category_feed", format: :rss, as: "category_feed"
- get "category/:category" => "list#category"
- get "category/:category/none" => "list#category_none"
- get "category/:parent_category/:category" => "list#category"
+ post "category/:category_id/move" => "categories#move"
+ get "category/:category.rss" => "list#category_feed", format: :rss
+ get "category/:parent_category/:category.rss" => "list#category_feed", format: :rss
+ get "category/:category" => "list#latest_category"
+ get "category/:category/none" => "list#latest_category_none"
+ get "category/:parent_category/:category" => "list#latest_category"
- get "top" => "list#top_lists"
- get "category/:category/l/top" => "list#top_lists"
- get "category/:category/none/l/top" => "list#top_lists"
- get "category/:parent_category/:category/l/top" => "list#top_lists"
+ get "top" => "list#top"
+ get "category/:category/l/top" => "list#top_category"
+ get "category/:category/none/l/top" => "list#top_category_none"
+ get "category/:parent_category/:category/l/top" => "list#top_category"
TopTopic.periods.each do |period|
get "top/#{period}" => "list#top_#{period}"
- get "top/#{period}/more" => "list#top_#{period}"
- get "category/:category/l/top/#{period}" => "list#top_#{period}"
- get "category/:category/l/top/#{period}/more" => "list#top_#{period}"
- get "category/:parent_category/:category/l/top/#{period}" => "list#top_#{period}"
- get "category/:parent_category/:category/l/top/#{period}/more" => "list#top_#{period}"
+ get "category/:category/l/top/#{period}" => "list#top_#{period}_category"
+ get "category/:category/none/l/top/#{period}" => "list#top_#{period}_category_none"
+ get "category/:parent_category/:category/l/top/#{period}" => "list#top_#{period}_category"
end
Discourse.anonymous_filters.each do |filter|
@@ -227,10 +226,12 @@ Discourse::Application.routes.draw do
Discourse.filters.each do |filter|
get "#{filter}" => "list##{filter}"
get "#{filter}/more" => "list##{filter}"
- get "category/:category/l/#{filter}" => "list##{filter}"
- get "category/:category/l/#{filter}/more" => "list##{filter}"
- get "category/:parent_category/:category/l/#{filter}" => "list##{filter}"
- get "category/:parent_category/:category/l/#{filter}/more" => "list##{filter}"
+ get "category/:category/l/#{filter}" => "list##{filter}_category"
+ get "category/:category/l/#{filter}/more" => "list##{filter}_category"
+ get "category/:category/none/l/#{filter}" => "list##{filter}_category_none"
+ get "category/:category/none/l/#{filter}/more" => "list##{filter}_category_none"
+ get "category/:parent_category/:category/l/#{filter}" => "list##{filter}_category"
+ get "category/:parent_category/:category/l/#{filter}/more" => "list##{filter}_category"
end
get "search" => "search#query"
@@ -303,6 +304,6 @@ Discourse::Application.routes.draw do
# special case for categories
root to: "categories#index", constraints: HomePageConstraint.new("categories"), :as => "categories_index"
# special case for top
- root to: "list#top_lists", constraints: HomePageConstraint.new("top"), :as => "top_lists"
+ root to: "list#top", constraints: HomePageConstraint.new("top"), :as => "top_lists"
end
diff --git a/lib/topic_query.rb b/lib/topic_query.rb
index 2a6b58b51..accaf07f4 100644
--- a/lib/topic_query.rb
+++ b/lib/topic_query.rb
@@ -129,7 +129,11 @@ class TopicQuery
end
def list_new_in_category(category)
- create_list(:new_in_category, unordered: true) {|l| l.where(category_id: category.id).by_newest.first(25)}
+ create_list(:new_in_category, unordered: true) do |list|
+ list.where(category_id: category.id)
+ .by_newest
+ .first(25)
+ end
end
def self.new_filter(list, treat_as_new_topic_start_date)
diff --git a/spec/controllers/list_controller_spec.rb b/spec/controllers/list_controller_spec.rb
index a53e07235..467654f4a 100644
--- a/spec/controllers/list_controller_spec.rb
+++ b/spec/controllers/list_controller_spec.rb
@@ -58,7 +58,7 @@ describe ListController do
context 'with access to see the category' do
before do
- xhr :get, :category, category: category.slug
+ xhr :get, :latest_category, category: category.slug
end
it { should respond_with(:success) }
@@ -66,7 +66,7 @@ describe ListController do
context 'with a link that includes an id' do
before do
- xhr :get, :category, category: "#{category.id}-#{category.slug}"
+ xhr :get, :latest_category, category: "#{category.id}-#{category.slug}"
end
it { should respond_with(:success) }
@@ -77,7 +77,7 @@ describe ListController do
let!(:other_category) { Fabricate(:category, name: "#{category.id} name") }
before do
- xhr :get, :category, category: other_category.slug
+ xhr :get, :latest_category, category: other_category.slug
end
it { should respond_with(:success) }
@@ -92,7 +92,7 @@ describe ListController do
context 'when parent and child are requested' do
before do
- xhr :get, :category, parent_category: category.slug, category: sub_category.slug
+ xhr :get, :latest_category, parent_category: category.slug, category: sub_category.slug
end
it { should respond_with(:success) }
@@ -100,7 +100,7 @@ describe ListController do
context 'when child is requested with the wrong parent' do
before do
- xhr :get, :category, parent_category: 'not_the_right_slug', category: sub_category.slug
+ xhr :get, :latest_category, parent_category: 'not_the_right_slug', category: sub_category.slug
end
it { should_not respond_with(:success) }