Added Votes filter for sorting

This commit is contained in:
Joe Buhlig 2016-08-12 11:25:56 -05:00
parent a42b8fa0e2
commit 5d9e7c0112
5 changed files with 23 additions and 2 deletions

View File

@ -20,4 +20,7 @@ en:
who_voted: "voted for this"
who_super_voted: "super voted for this"
upgrade_question: "Would you like to make that a Super Vote?"
upgrade_answer: "Yes!"
upgrade_answer: "Yes!"
filters:
votes:
title: "Votes"

View File

@ -10,3 +10,6 @@ es:
vote:
one: "voto"
multiple: "votos"
filters:
votes:
title: "Votos"

View File

@ -20,4 +20,7 @@ it:
who_voted: "hanno votato"
who_super_voted: "hanno super votato"
upgrade_question: "Ti piacerebbe dare un Super Voto?"
upgrade_answer: "Si!"
upgrade_answer: "Si!"
filters:
votes:
title: "Voti"

View File

@ -11,3 +11,6 @@ zh_CN:
one: "推荐"
multiple: "推荐"
who_voted: "已推荐"
filters:
votes:
title: "推荐"

View File

@ -11,6 +11,11 @@ enabled_site_setting :feature_voting_enabled
# load the engine
load File.expand_path('../lib/discourse_feature_voting/engine.rb', __FILE__)
Discourse.top_menu_items.push(:votes)
Discourse.anonymous_top_menu_items.push(:votes)
Discourse.filters.push(:votes)
Discourse.anonymous_filters.push(:votes)
after_initialize do
require_dependency 'topic_view_serializer'
@ -266,6 +271,10 @@ after_initialize do
topics.where(id: user.custom_fields["votes"])
end
end
def list_votes
topics = create_list(:votes, {order: "votes"})
end
end
require_dependency "jobs/base"