A platform for community discussion. Free, open, simple.
DEV: Move discourse-topic-voting to core (#33749)
Jarek Radosza7ad3beb0a4e
diff --git a/.github/labeler.yml b/.github/labeler.ymlindex 670353b0962..eb34da0fe97 100644--- a/.github/labeler.yml+++ b/.github/labeler.yml@@ -130,6 +130,10 @@ discourse-solved:- changed-files:- any-glob-to-any-file: plugins/discourse-solved/**/*+discourse-topic-voting:+ - changed-files:+ - any-glob-to-any-file: plugins/discourse-topic-voting/**/*+footnote:- changed-files:- any-glob-to-any-file: plugins/footnote/**/*diff --git a/.gitignore b/.gitignoreindex f06b0610d89..26dce5793e9 100644--- a/.gitignore+++ b/.gitignore@@ -75,6 +75,7 @@!/plugins/discourse-adplugin!/plugins/discourse-affiliate!/plugins/discourse-solved+!/plugins/discourse-topic-voting/plugins/*/auto_generated/spec/fixtures/plugins/my_plugin/auto_generateddiff --git a/plugins/discourse-topic-voting/README.md b/plugins/discourse-topic-voting/README.mdnew file mode 100644index 00000000000..715f3e89a9a--- /dev/null+++ b/plugins/discourse-topic-voting/README.md@@ -0,0 +1,5 @@+## Discourse Topic Voting++Adds the ability for voting on a topic within a specified category.++Topic discussing the plugin itself can be found here: [https://meta.discourse.org/t/discourse-voting/40121](https://meta.discourse.org/t/discourse-voting/40121?u=joebuhlig)diff --git a/plugins/discourse-topic-voting/app/controllers/discourse_topic_voting/votes_controller.rb b/plugins/discourse-topic-voting/app/controllers/discourse_topic_voting/votes_controller.rbnew file mode 100644index 00000000000..0832d4ee038--- /dev/null+++ b/plugins/discourse-topic-voting/app/controllers/discourse_topic_voting/votes_controller.rb@@ -0,0 +1,98 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ class VotesController < ::ApplicationController+ requires_plugin DiscourseTopicVoting::PLUGIN_NAME++ before_action :ensure_logged_in++ def who+ params.require(:topic_id)+ topic = Topic.find(params[:topic_id].to_i)+ guardian.ensure_can_see!(topic)++ render json: MultiJson.dump(who_voted(topic))+ end++ def vote+ topic_id = params["topic_id"].to_i+ topic = Topic.find_by(id: topic_id)++ raise Discourse::InvalidAccess if !topic.can_vote? || topic.user_voted?(current_user)+ guardian.ensure_can_see!(topic)++ voted = false++ unless current_user.reached_voting_limit?+ DiscourseTopicVoting::Vote.find_or_create_by(user: current_user, topic_id: topic_id)++ topic.update_vote_count+ voted = true+ end++ obj = {+ can_vote: !current_user.reached_voting_limit?,+ vote_limit: current_user.vote_limit,+ vote_count: topic.topic_vote_count&.votes_count&.to_i,+ who_voted: who_voted(topic),+ alert: current_user.alert_low_votes?,+ votes_left: [(current_user.vote_limit - current_user.vote_count), 0].max,+ }++ if WebHook.active_web_hooks(:topic_upvote).exists?+ payload = {+ topic_id: topic_id,+ topic_slug: topic.slug,+ voter_id: current_user.id,+ vote_count: obj[:vote_count],+ }+ WebHook.enqueue_topic_voting_hooks(:topic_upvote, topic, payload.to_json)+ end++ render json: obj, status: voted ? 200 : 403+ end++ def unvote+ topic_id = params["topic_id"].to_i+ topic = Topic.find_by(id: topic_id)++ guardian.ensure_can_see!(topic)++ DiscourseTopicVoting::Vote.destroy_by(user: current_user, topic_id: topic_id)++ topic.update_vote_count++ obj = {+ can_vote: !current_user.reached_voting_limit?,+ vote_limit: current_user.vote_limit,+ vote_count: topic.topic_vote_count&.votes_count&.to_i,+ who_voted: who_voted(topic),+ votes_left: [(current_user.vote_limit - current_user.vote_count), 0].max,+ }++ if WebHook.active_web_hooks(:topic_unvote).exists?+ payload = {+ topic_id: topic_id,+ topic_slug: topic.slug,+ voter_id: current_user.id,+ vote_count: obj[:vote_count],+ }+ WebHook.enqueue_topic_voting_hooks(:topic_unvote, topic, payload.to_json)+ end++ render json: obj+ end++ protected++ def who_voted(topic)+ return nil unless SiteSetting.topic_voting_show_who_voted++ ActiveModel::ArraySerializer.new(+ topic.who_voted,+ scope: guardian,+ each_serializer: BasicUserSerializer,+ )+ end+ end+enddiff --git a/plugins/discourse-topic-voting/app/jobs/regular/discourse_topic_voting/vote_reclaim.rb b/plugins/discourse-topic-voting/app/jobs/regular/discourse_topic_voting/vote_reclaim.rbnew file mode 100644index 00000000000..c08a7836410--- /dev/null+++ b/plugins/discourse-topic-voting/app/jobs/regular/discourse_topic_voting/vote_reclaim.rb@@ -0,0 +1,16 @@+# frozen_string_literal: true++module Jobs+ module DiscourseTopicVoting+ class VoteReclaim < ::Jobs::Base+ def execute(args)+ if topic = Topic.with_deleted.find_by(id: args[:topic_id])+ ActiveRecord::Base.transaction do+ ::DiscourseTopicVoting::Vote.where(topic_id: args[:topic_id]).update_all(archive: false)+ topic.update_vote_count+ end+ end+ end+ end+ end+enddiff --git a/plugins/discourse-topic-voting/app/jobs/regular/discourse_topic_voting/vote_release.rb b/plugins/discourse-topic-voting/app/jobs/regular/discourse_topic_voting/vote_release.rbnew file mode 100644index 00000000000..5fbcda5cc32--- /dev/null+++ b/plugins/discourse-topic-voting/app/jobs/regular/discourse_topic_voting/vote_release.rb@@ -0,0 +1,29 @@+# frozen_string_literal: true++module Jobs+ module DiscourseTopicVoting+ class VoteRelease < ::Jobs::Base+ def execute(args)+ if topic = Topic.with_deleted.find_by(id: args[:topic_id])+ votes = ::DiscourseTopicVoting::Vote.where(topic_id: args[:topic_id])+ votes.update_all(archive: true)++ topic.update_vote_count++ return if args[:trashed]++ votes.find_each do |vote|+ Notification.create!(+ user_id: vote.user_id,+ notification_type: Notification.types[:votes_released],+ topic_id: vote.topic_id,+ data: { message: "votes_released", title: "votes_released" }.to_json,+ )+ rescue StandardError+ # If one notification crashes, inform others+ end+ end+ end+ end+ end+enddiff --git a/plugins/discourse-topic-voting/app/models/discourse_topic_voting/category_setting.rb b/plugins/discourse-topic-voting/app/models/discourse_topic_voting/category_setting.rbnew file mode 100644index 00000000000..1d0777b5524--- /dev/null+++ b/plugins/discourse-topic-voting/app/models/discourse_topic_voting/category_setting.rb@@ -0,0 +1,54 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ class CategorySetting < ActiveRecord::Base+ self.table_name = "topic_voting_category_settings"++ belongs_to :category, inverse_of: :discourse_topic_voting_category_setting++ before_create :unarchive_votes+ before_destroy :archive_votes+ after_save :reset_voting_cache++ def unarchive_votes+ DB.exec(<<~SQL, { category_id: self.category_id })+ UPDATE topic_voting_votes+ SET archive=false+ FROM topics+ WHERE topics.category_id = :category_id+ AND topics.deleted_at is NULL+ AND NOT topics.closed+ AND NOT topics.archived+ AND topic_voting_votes.topic_id = topics.id+ SQL+ end++ def archive_votes+ DB.exec(<<~SQL, { category_id: self.category_id })+ UPDATE topic_voting_votes+ SET archive=true+ FROM topics+ WHERE topics.category_id = :category_id+ AND topic_voting_votes.topic_id = topics.id+ SQL+ end++ def reset_voting_cache+ ::Category.reset_voting_cache+ end+ end+end++# == Schema Information+#+# Table name: topic_voting_category_settings+#+# id :bigint not null, primary key+# category_id :integer+# created_at :datetime not null+# updated_at :datetime not null+#+# Indexes+#+# topic_voting_category_settings_category_id_idx (category_id) UNIQUE+#diff --git a/plugins/discourse-topic-voting/app/models/discourse_topic_voting/topic_vote_count.rb b/plugins/discourse-topic-voting/app/models/discourse_topic_voting/topic_vote_count.rbnew file mode 100644index 00000000000..5b83a3aa056--- /dev/null+++ b/plugins/discourse-topic-voting/app/models/discourse_topic_voting/topic_vote_count.rb@@ -0,0 +1,25 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ class TopicVoteCount < ActiveRecord::Base+ self.table_name = "topic_voting_topic_vote_count"++ belongs_to :topic+ end+end++# == Schema Information+#+# Table name: topic_voting_topic_vote_count+#+# id :bigint not null, primary key+# topic_id :integer+# votes_count :integer+# created_at :datetime not null+# updated_at :datetime not null+#+# Indexes+#+# index_topic_voting_topic_vote_count_on_topic_id (topic_id) UNIQUE+# topic_voting_topic_vote_count_topic_id_idx (topic_id) UNIQUE+#diff --git a/plugins/discourse-topic-voting/app/models/discourse_topic_voting/vote.rb b/plugins/discourse-topic-voting/app/models/discourse_topic_voting/vote.rbnew file mode 100644index 00000000000..5e0ccca637c--- /dev/null+++ b/plugins/discourse-topic-voting/app/models/discourse_topic_voting/vote.rb@@ -0,0 +1,26 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ class Vote < ActiveRecord::Base+ self.table_name = "topic_voting_votes"++ belongs_to :user+ belongs_to :topic+ end+end++# == Schema Information+#+# Table name: topic_voting_votes+#+# id :bigint not null, primary key+# topic_id :integer+# user_id :integer+# archive :boolean default(FALSE)+# created_at :datetime not null+# updated_at :datetime not null+#+# Indexes+#+# topic_voting_votes_user_id_topic_id_idx (user_id,topic_id) UNIQUE+#diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-box.gjs b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-box.gjsnew file mode 100644index 00000000000..012584676e5--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-box.gjs@@ -0,0 +1,125 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { hash } from "@ember/helper";+import { action } from "@ember/object";+import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import concatClass from "discourse/helpers/concat-class";+import routeAction from "discourse/helpers/route-action";+import { ajax } from "discourse/lib/ajax";+import { popupAjaxError } from "discourse/lib/ajax-error";+import closeOnClickOutside from "discourse/modifiers/close-on-click-outside";+import { i18n } from "discourse-i18n";+import VoteButton from "./vote-button";+import VoteCount from "./vote-count";+import VoteOptions from "./vote-options";++export default class VoteBox extends Component {+ @service siteSettings;+ @service currentUser;++ @tracked votesAlert;+ @tracked allowClick = true;+ @tracked initialVote = false;+ @tracked showOptions = false;++ @action+ addVote() {+ let topic = this.args.topic;+ return ajax("/voting/vote", {+ type: "POST",+ data: {+ topic_id: topic.id,+ },+ })+ .then((result) => {+ topic.vote_count = result.vote_count;+ topic.user_voted = true;+ this.currentUser.votes_exceeded = !result.can_vote;+ this.currentUser.votes_left = result.votes_left;+ if (result.alert) {+ this.votesAlert = result.votes_left;+ }+ this.allowClick = true;+ this.showOptions = false;+ })+ .catch(popupAjaxError);+ }++ @action+ removeVote() {+ const topic = this.args.topic;++ return ajax("/voting/unvote", {+ type: "POST",+ data: {+ topic_id: topic.id,+ },+ })+ .then((result) => {+ topic.vote_count = result.vote_count;+ topic.user_voted = false;+ this.currentUser.votes_exceeded = !result.can_vote;+ this.currentUser.votes_left = result.votes_left;+ this.allowClick = true;+ this.showOptions = false;+ })+ .catch(popupAjaxError);+ }++ @action+ showVoteOptions() {+ this.showOptions = true;+ }++ @action+ closeVoteOptions() {+ this.showOptions = false;+ }++ @action+ closeVotesAlert() {+ this.votesAlert = null;+ }++ <template>+ <div+ class={{concatClass+ "voting-wrapper"+ (if this.siteSettings.topic_voting_show_who_voted "show-pointer")+ }}+ >+ <VoteCount @topic={{@topic}} @showLogin={{routeAction "showLogin"}} />+ <VoteButton+ @topic={{@topic}}+ @allowClick={{this.allowClick}}+ @showVoteOptions={{this.showVoteOptions}}+ @addVote={{this.addVote}}+ @showLogin={{routeAction "showLogin"}}+ />++ {{#if this.showOptions}}+ <VoteOptions+ @topic={{@topic}}+ @removeVote={{this.removeVote}}+ {{closeOnClickOutside this.closeVoteOptions (hash)}}+ />+ {{/if}}++ {{#if this.votesAlert}}+ <div+ class="voting-popup-menu vote-options popup-menu"+ {{closeOnClickOutside this.closeVotesAlert (hash)}}+ >+ {{htmlSafe+ (i18n+ "topic_voting.votes_left"+ count=this.votesAlert+ path="/my/activity/votes"+ )+ }}+ </div>+ {{/if}}+ </div>+ </template>+}diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-button.gjs b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-button.gjsnew file mode 100644index 00000000000..ad60e5680ff--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-button.gjs@@ -0,0 +1,104 @@+import Component from "@glimmer/component";+import { action } from "@ember/object";+import { service } from "@ember/service";+import DButton from "discourse/components/d-button";+import cookie from "discourse/lib/cookie";+import { applyBehaviorTransformer } from "discourse/lib/transformer";+import { i18n } from "discourse-i18n";++export default class VoteBox extends Component {+ @service siteSettings;+ @service currentUser;++ get wrapperClasses() {+ const classes = [];+ const { topic } = this.args;+ if (topic.closed) {+ classes.push("voting-closed");+ } else {+ if (!topic.user_voted) {+ classes.push("nonvote");+ } else {+ if (this.currentUser && this.currentUser.votes_exceeded) {+ classes.push("vote-limited nonvote");+ } else {+ classes.push("vote");+ }+ }+ }+ if (this.siteSettings.topic_voting_show_who_voted) {+ classes.push("show-pointer");+ }+ return classes.join(" ");+ }++ get buttonContent() {+ const { topic } = this.args;+ if (this.currentUser) {+ if (topic.closed) {+ return i18n("topic_voting.voting_closed_title");+ }++ if (topic.user_voted) {+ return i18n("topic_voting.voted_title");+ }++ if (this.currentUser.votes_exceeded) {+ return i18n("topic_voting.voting_limit");+ }++ return i18n("topic_voting.vote_title");+ }++ if (topic.vote_count) {+ return i18n("topic_voting.anonymous_button", {+ count: topic.vote_count,+ });+ }++ return i18n("topic_voting.anonymous_button", { count: 1 });+ }++ @action+ click() {+ applyBehaviorTransformer("topic-vote-button-click", () => {+ if (!this.currentUser) {+ cookie("destination_url", window.location.href, { path: "/" });+ this.args.showLogin();+ return;+ }++ const { topic } = this.args;++ if (+ !topic.closed &&+ !topic.user_voted &&+ !this.currentUser.votes_exceeded+ ) {+ this.args.addVote();+ }++ if (topic.user_voted || this.currentUser.votes_exceeded) {+ this.args.showVoteOptions();+ }+ });+ }++ <template>+ <div class={{this.wrapperClasses}}>+ <DButton+ @translatedTitle={{if+ this.currentUser+ (i18n+ "topic_voting.votes_left_button_title"+ count=this.currentUser.votes_left+ )+ ""+ }}+ @translatedLabel={{this.buttonContent}}+ class="btn-primary vote-button"+ @action={{this.click}}+ />+ </div>+ </template>+}diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-count.gjs b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-count.gjsnew file mode 100644index 00000000000..20d9a8a3948--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-count.gjs@@ -0,0 +1,95 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";+import { action } from "@ember/object";+import { service } from "@ember/service";+import { eq } from "truth-helpers";+import AsyncContent from "discourse/components/async-content";+import SmallUserList from "discourse/components/small-user-list";+import concatClass from "discourse/helpers/concat-class";+import { ajax } from "discourse/lib/ajax";+import cookie from "discourse/lib/cookie";+import { bind } from "discourse/lib/decorators";+import getURL from "discourse/lib/get-url";+import closeOnClickOutside from "discourse/modifiers/close-on-click-outside";++export default class VoteBox extends Component {+ @service siteSettings;+ @service currentUser;++ @tracked showWhoVoted = false;++ @bind+ async loadWhoVoted() {+ return ajax("/voting/who", {+ type: "GET",+ data: {+ topic_id: this.args.topic.id,+ },+ }).then((users) =>+ users.map((user) => {+ return {+ template: user.avatar_template,+ username: user.username,+ post_url: user.post_url,+ url: getURL("/u/") + user.username.toLowerCase(),+ };+ })+ );+ }++ @action+ click(event) {+ event.preventDefault();+ event.stopPropagation();++ if (!this.currentUser) {+ cookie("destination_url", window.location.href, { path: "/" });+ this.args.showLogin();+ return;+ }++ if (this.showWhoVoted) {+ this.showWhoVoted = false;+ } else if (this.siteSettings.topic_voting_show_who_voted) {+ this.showWhoVoted = true;+ }+ }++ @action+ clickOutside() {+ this.showWhoVoted = false;+ }++ <template>+ <div+ class={{concatClass+ "vote-count-wrapper"+ (if (eq @topic.vote_count 0) "no-votes")+ }}+ {{on "click" this.click}}+ role="button"+ >+ <div class="vote-count">+ {{@topic.vote_count}}+ </div>+ </div>++ {{#if this.showWhoVoted}}+ <div+ class="who-voted popup-menu voting-popup-menu"+ {{closeOnClickOutside+ this.clickOutside+ (hash secondaryTargetSelector=".vote-count-wrapper")+ }}+ >+ <AsyncContent @asyncData={{this.loadWhoVoted}}>+ <:content as |voters|>+ <SmallUserList @users={{voters}} class="regular-votes" />+ </:content>+ </AsyncContent>+ </div>+ {{/if}}+ </template>+}diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-options.gjs b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-options.gjsnew file mode 100644index 00000000000..d634c16396f--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-options.gjs@@ -0,0 +1,29 @@+import Component from "@glimmer/component";+import { on } from "@ember/modifier";+import { service } from "@ember/service";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";++export default class VoteBox extends Component {+ @service currentUser;++ <template>+ <div class="vote-options voting-popup-menu popup-menu" ...attributes>+ {{#if @topic.user_voted}}+ <div+ role="button"+ class="remove-vote vote-option"+ {{on "click" @removeVote}}+ >+ {{icon "xmark"}}+ {{i18n "topic_voting.remove_vote"}}+ </div>+ {{else if this.currentUser.votes_exceeded}}+ <div>{{i18n "topic_voting.reached_limit"}}</div>+ <p>+ <a href="/my/activity/votes">{{i18n "topic_voting.list_votes"}}</a>+ </p>+ {{/if}}+ </div>+ </template>+}diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/connectors/category-custom-settings/feature-voting-settings.gjs b/plugins/discourse-topic-voting/assets/javascripts/discourse/connectors/category-custom-settings/feature-voting-settings.gjsnew file mode 100644index 00000000000..b5f1ff1633b--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/connectors/category-custom-settings/feature-voting-settings.gjs@@ -0,0 +1,22 @@+import Component, { Input } from "@ember/component";+import { classNames, tagName } from "@ember-decorators/component";+import { i18n } from "discourse-i18n";++@tagName("")+@classNames("category-custom-settings-outlet", "feature-voting-settings")+export default class FeatureVotingSettings extends Component {+ <template>+ <h3>{{i18n "topic_voting.title"}}</h3>+ <section class="field">+ <div class="enable-topic-voting">+ <label class="checkbox-label">+ <Input+ @type="checkbox"+ @checked={{this.category.custom_fields.enable_topic_voting}}+ />+ {{i18n "topic_voting.allow_topic_voting"}}+ </label>+ </div>+ </section>+ </template>+}diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/connectors/topic-above-post-stream/topic-title-voting.gjs b/plugins/discourse-topic-voting/assets/javascripts/discourse/connectors/topic-above-post-stream/topic-title-voting.gjsnew file mode 100644index 00000000000..d5919e81e61--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/connectors/topic-above-post-stream/topic-title-voting.gjs@@ -0,0 +1,23 @@+import Component from "@ember/component";+import { classNames, tagName } from "@ember-decorators/component";+import routeAction from "discourse/helpers/route-action";+import VoteBox from "../../components/vote-box";++@tagName("div")+@classNames("topic-above-post-stream-outlet", "topic-title-voting")+export default class TopicTitleVoting extends Component {+ <template>+ {{#if this.model.can_vote}}+ {{#if this.model.postStream.loaded}}+ {{#if this.model.postStream.firstPostPresent}}+ <div class="voting title-voting">+ <VoteBox+ @topic={{this.model}}+ @showLogin={{routeAction "showLogin"}}+ />+ </div>+ {{/if}}+ {{/if}}+ {{/if}}+ </template>+}diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/connectors/user-activity-bottom/user-voted-topics.gjs b/plugins/discourse-topic-voting/assets/javascripts/discourse/connectors/user-activity-bottom/user-voted-topics.gjsnew file mode 100644index 00000000000..48ec76d1117--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/connectors/user-activity-bottom/user-voted-topics.gjs@@ -0,0 +1,21 @@+import Component from "@glimmer/component";+import { LinkTo } from "@ember/routing";+import { service } from "@ember/service";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";++export default class UserVotedTopics extends Component {+ @service siteSettings;++ <template>+ {{#if this.siteSettings.topic_voting_show_votes_on_profile}}+ <li class="user-nav__activity-votes">++ <LinkTo @route="userActivity.votes">+ {{icon "heart"}}+ {{i18n "topic_voting.vote_title_plural"}}+ </LinkTo>+ </li>+ {{/if}}+ </template>+}diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/feature-voting-route-map.js b/plugins/discourse-topic-voting/assets/javascripts/discourse/feature-voting-route-map.jsnew file mode 100644index 00000000000..8100dabc37e--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/feature-voting-route-map.js@@ -0,0 +1,13 @@+export default {+ resource: "user",+ path: "users/:username",+ map() {+ this.route(+ "userActivity",+ { path: "activity", resetNamespace: true },+ function () {+ this.route("votes");+ }+ );+ },+};diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/initializers/discourse-topic-voting.js b/plugins/discourse-topic-voting/assets/javascripts/discourse/initializers/discourse-topic-voting.jsnew file mode 100644index 00000000000..1a0a92a8fa2--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/initializers/discourse-topic-voting.js@@ -0,0 +1,78 @@+import { withPluginApi } from "discourse/lib/plugin-api";+import NavItem from "discourse/models/nav-item";+import { i18n } from "discourse-i18n";++export default {+ name: "discourse-topic-voting",++ initialize() {+ withPluginApi((api) => {+ const siteSettings = api.container.lookup("service:site-settings");+ if (siteSettings.topic_voting_enabled) {+ const pageSearchController = api.container.lookup(+ "controller:full-page-search"+ );+ pageSearchController.sortOrders.pushObject({+ name: i18n("search.most_votes"),+ id: 5,+ term: "order:votes",+ });++ api.addNavigationBarItem({+ name: "votes",+ before: "top",+ customFilter: (category) => {+ return category && category.can_vote;+ },+ customHref: (category, args) => {+ const path = NavItem.pathFor("latest", args);+ return `${path}?order=votes`;+ },+ forceActive: (category, args, router) => {+ const queryParams = router.currentRoute.queryParams;+ return (+ queryParams &&+ Object.keys(queryParams).length === 1 &&+ queryParams["order"] === "votes"+ );+ },+ });+ api.addNavigationBarItem({+ name: "my_votes",+ before: "top",+ customFilter: (category) => {+ return category && category.can_vote && api.getCurrentUser();+ },+ customHref: (category, args) => {+ const path = NavItem.pathFor("latest", args);+ return `${path}?state=my_votes`;+ },+ forceActive: (category, args, router) => {+ const queryParams = router.currentRoute.queryParams;+ return (+ queryParams &&+ Object.keys(queryParams).length === 1 &&+ queryParams["state"] === "my_votes"+ );+ },+ });+ }++ if (siteSettings.topic_voting_enabled) {+ api.addSearchSuggestion("order:votes");+ }++ api.registerValueTransformer(+ "category-available-views",+ ({ value, context }) => {+ if (context.customFields.enable_topic_voting) {+ value.push({+ name: i18n("filters.votes.title"),+ value: "votes",+ });+ }+ }+ );+ });+ },+};diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/pre-initializers/extend-category-for-voting.js b/plugins/discourse-topic-voting/assets/javascripts/discourse/pre-initializers/extend-category-for-voting.jsnew file mode 100644index 00000000000..9476cacae73--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/pre-initializers/extend-category-for-voting.js@@ -0,0 +1,67 @@+import { tracked } from "@glimmer/tracking";+import { withPluginApi } from "discourse/lib/plugin-api";+import { i18n } from "discourse-i18n";++function initialize(api) {+ api.addPostClassesCallback((post) => {+ if (post.post_number === 1 && post.can_vote) {+ return ["voting-post"];+ }+ });+ api.addTrackedPostProperties("can_vote");+ api.addTagsHtmlCallback(+ (topic) => {+ if (!topic.can_vote) {+ return;+ }++ let buffer = [];++ let title = "";+ if (topic.user_voted) {+ title = ` title='${i18n("topic_voting.voted")}'`;+ }++ let userVotedClass = topic.user_voted ? " voted" : "";+ buffer.push(+ `<a href='${topic.url}' class='list-vote-count vote-count-${topic.vote_count} discourse-tag simple${userVotedClass}'${title}>`+ );++ buffer.push(i18n("topic_voting.votes", { count: topic.vote_count }));+ buffer.push("</a>");++ if (buffer.length > 0) {+ return buffer.join("");+ }+ },+ { priority: -100 }+ );++ api.modifyClass(+ "model:topic",+ (Superclass) =>+ class extends Superclass {+ @tracked vote_count;+ @tracked user_voted;+ }+ );+ api.modifyClass(+ "model:user",+ (Superclass) =>+ class extends Superclass {+ @tracked votes_exceeded;+ @tracked votes_left;+ }+ );+}++export default {+ name: "extend-category-for-voting",++ before: "inject-discourse-objects",++ initialize() {+ withPluginApi("0.8.4", (api) => initialize(api));+ withPluginApi("0.8.30", (api) => api.addCategorySortCriteria("votes"));+ },+};diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/pre-initializers/transformers.js b/plugins/discourse-topic-voting/assets/javascripts/discourse/pre-initializers/transformers.jsnew file mode 100644index 00000000000..f372a9e9990--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/pre-initializers/transformers.js@@ -0,0 +1,12 @@+import { withPluginApi } from "discourse/lib/plugin-api";++export default {+ name: "discourse-topic-voting-transformers",+ before: "freeze-valid-transformers",++ initialize() {+ withPluginApi("1.35.0", (api) => {+ api.addBehaviorTransformerName("topic-vote-button-click");+ });+ },+};diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/routes/user-activity-votes.js b/plugins/discourse-topic-voting/assets/javascripts/discourse/routes/user-activity-votes.jsnew file mode 100644index 00000000000..23d5c7322c4--- /dev/null+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/routes/user-activity-votes.js@@ -0,0 +1,33 @@+import UserAction from "discourse/models/user-action";+import UserTopicListRoute from "discourse/routes/user-topic-list";+import { i18n } from "discourse-i18n";++export default class UserActivityVotes extends UserTopicListRoute {+ userActionType = UserAction.TYPES.topics;++ model() {+ return this.store+ .findFiltered("topicList", {+ filter:+ "topics/voted-by/" + this.modelFor("user").get("username_lower"),+ })+ .then((model) => {+ model.set("emptyState", this.emptyState());+ return model;+ });+ }++ emptyState() {+ const user = this.modelFor("user");+ const title = this.isCurrentUser(user)+ ? i18n("topic_voting.no_votes_title_self")+ : i18n("topic_voting.no_votes_title_others", {+ username: user.username,+ });++ return {+ title,+ body: "",+ };+ }+}diff --git a/plugins/discourse-topic-voting/assets/stylesheets/common/topic-voting.scss b/plugins/discourse-topic-voting/assets/stylesheets/common/topic-voting.scssnew file mode 100644index 00000000000..8fcef181d97--- /dev/null+++ b/plugins/discourse-topic-voting/assets/stylesheets/common/topic-voting.scss@@ -0,0 +1,95 @@+.title-voting {+ padding-right: 0.75em;+ width: 6em;+ max-width: 10%;+ box-sizing: border-box;+ float: left;+ margin-top: 0.33em;+ position: relative;++ .rtl & {+ float: right;+ padding-right: 0;+ padding-left: 0.75em;+ }+}++.vote-count-wrapper {+ border: 3px solid var(--primary-low);+ font-weight: bold;+ display: flex;+ align-items: center;+ justify-content: center;+}++.voting-wrapper.show-pointer .vote-count-wrapper:not(.no-votes) {+ cursor: pointer;++ &:hover {+ background-color: var(--primary-low);+ }+}++.vote-button {+ width: 100%;+ margin-top: 0.35em;+}++.vote-options {+ text-align: left;+}++.vote-option {+ cursor: pointer;+ padding: 0.35em;++ &:hover {+ background-color: var(--primary-low);+ }+}++.vote-option.remove-vote .d-icon {+ margin-right: 0.35em;+ color: var(--danger);+}++.list-vote-count.voted {+ font-weight: bold;+}++.who-voted.popup-menu {+ a {+ margin: 0.4em 0.25em;+ display: inline-block;+ }+}++.topic-post.voting-post {+ button.like-count,+ button.toggle-like {+ display: none;+ }+}++.voting-popup-menu {+ position: absolute;+ left: 90px;+ top: 0;+ padding: 0.5em;+ line-height: var(--line-height-medium);+ z-index: z("usercard") - 1;+ cursor: initial;++ // voter avatars+ .regular-votes {+ display: flex;+ flex-wrap: wrap;+ align-items: center;+ justify-content: center;+ }++ .rtl & {+ left: unset;+ right: 80px;+ }+}diff --git a/plugins/discourse-topic-voting/assets/stylesheets/desktop/topic-voting.scss b/plugins/discourse-topic-voting/assets/stylesheets/desktop/topic-voting.scssnew file mode 100644index 00000000000..9fcd816d856--- /dev/null+++ b/plugins/discourse-topic-voting/assets/stylesheets/desktop/topic-voting.scss@@ -0,0 +1,4 @@+.vote-count-wrapper {+ font-size: $font-up-2;+ height: 40px;+}diff --git a/plugins/discourse-topic-voting/assets/stylesheets/mobile/topic-voting.scss b/plugins/discourse-topic-voting/assets/stylesheets/mobile/topic-voting.scssnew file mode 100644index 00000000000..ddecb582432--- /dev/null+++ b/plugins/discourse-topic-voting/assets/stylesheets/mobile/topic-voting.scss@@ -0,0 +1,40 @@+.title-voting {+ width: 100%;+ float: none;+ max-width: none;+ text-align: inherit;++ .rtl & {+ float: none;+ }+}++.voting-wrapper {+ display: flex;+ align-items: center;+}++.vote-count-wrapper {+ min-width: 70px;+ box-sizing: border-box;++ // match button height+ min-height: 30px;+}++.vote-button {+ max-width: 10em;+ margin-left: 0.5em;+ margin-top: 0;+ white-space: nowrap;++ .rtl & {+ margin-left: 0;+ margin-right: 0.5em;+ }+}++.voting-popup-menu {+ // 80px left positioning + 20px .wrap padding+ width: calc(100vw - 100px);+}diff --git a/plugins/discourse-topic-voting/config/locales/client.ar.yml b/plugins/discourse-topic-voting/config/locales/client.ar.ymlnew file mode 100644index 00000000000..78cf4cccbf6--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.ar.yml@@ -0,0 +1,73 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ar:+ js:+ category:+ sort_options:+ votes: "الأصوات"+ topic_voting:+ title: "التصويت على الموضوع"+ reached_limit: "لم يعُد بإمكانك التصويت الآن، يُرجى إزالة صوت حالي!"+ list_votes: "قائمة بأصواتك"+ votes_nav_help: "الموضوعات الأكثر تصويتًا"+ voted: "لقد صوَّت على هذا الموضوع"+ allow_topic_voting: "السماح للمستخدمين بالتصويت على الموضوعات في هذه الفئة"+ vote_title: "الصوت"+ vote_title_plural: "الأصوات"+ voted_title: "تم التصويت"+ voting_closed_title: "تم إغلاق التصويت"+ voting_limit: "الحد"+ votes_left:+ zero: "لديك %{count} صوت متبقٍ، اعرض <a href='%{path}'>أصواتك</a>."+ one: "لديك صوت واحد (%{count}) متبقٍ، اعرض <a href='%{path}'>أصواتك</a>."+ two: "لديك صوتان (%{count}) متبقيان، اعرض <a href='%{path}'>أصواتك</a>."+ few: "لديك %{count} أصوات متبقية، اعرض <a href='%{path}'>أصواتك</a>."+ many: "لديك %{count} صوتًا متبقيًا، اعرض <a href='%{path}'>أصواتك</a>."+ other: "لديك %{count} صوت متبقٍ، اعرض <a href='%{path}'>أصواتك</a>."+ votes_left_button_title:+ zero: "لديك %{count} صوت متبقٍ."+ one: "لديك صوت واحد (%{count}) متبقٍ."+ two: "لديك صوتان (%{count}) متبقيان."+ few: "لديك %{count} أصوات متبقية."+ many: "لديك %{count} صوتًا متبقيًا."+ other: "لديك %{count} صوت متبقٍ."+ votes:+ zero: "%{count} صوت"+ one: "صوت واحد (%{count})"+ two: "صوتان (%{count})"+ few: "%{count} أصوات"+ many: "%{count} صوتًا"+ other: "%{count} صوت"+ anonymous_button:+ zero: "تصويت"+ one: "تصويت"+ two: "تصويت"+ few: "تصويت"+ many: "تصويت"+ other: "تصويت"+ remove_vote: "إزالة الصوت"+ no_votes_title_self: "لم تصوِّت لأي موضوع حتى الآن"+ no_votes_title_others: "لم يصوِّت %{username} لأي موضوع حتى الآن"+ filters:+ votes:+ title: "الأصوات"+ help: "الموضوعات الأكثر تصويتًا"+ my_votes:+ title: "أصواتي"+ help: "الموضوعات التي صوَّت عليها"+ search:+ most_votes: "معظم الأصوات"+ advanced:+ vote:+ count:+ label: "أقل عدد من الأصوات"+ admin:+ web_hooks:+ voting_event:+ group_name: "حدث التصويت على موضوع"+ topic_upvote: "عندما يقوم المستخدم بالتصويت على موضوع"+ topic_unvote: "عندما يقوم المستخدم بإلغاء التصويت على موضوع"diff --git a/plugins/discourse-topic-voting/config/locales/client.be.yml b/plugins/discourse-topic-voting/config/locales/client.be.ymlnew file mode 100644index 00000000000..ca4bab42ab4--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.be.yml@@ -0,0 +1,32 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++be:+ js:+ category:+ sort_options:+ votes: "Галасоў"+ topic_voting:+ reached_limit: "Вы выкарысталі свае галасы, выдаліце адзін з іх для перагаласавання!"+ list_votes: "Спіс вашых галасаванняў"+ votes_nav_help: "тэмы з найбольшай кольскасцю галасоў"+ voted: "Вы прагаласавалі ў гэтай тэме"+ allow_topic_voting: "Дазвольці карыстальнікам галасаваць у тэмах гэтай катэгорыі"+ vote_title: "Галасаваць"+ vote_title_plural: "Галасоў"+ voted_title: "Прагаласавана"+ voting_closed_title: "Закрыта"+ voting_limit: "Ліміт"+ anonymous_button:+ one: "Голас"+ few: "Галасоў"+ many: "Галасоў"+ other: "Галасоў"+ remove_vote: "Выдалісь галасаванне"+ filters:+ votes:+ title: "Галасоў"+ help: "тэмы з найбольшай кольскасцю галасоў"diff --git a/plugins/discourse-topic-voting/config/locales/client.bg.yml b/plugins/discourse-topic-voting/config/locales/client.bg.ymlnew file mode 100644index 00000000000..e19ddd426de--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.bg.yml@@ -0,0 +1,51 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++bg:+ js:+ category:+ sort_options:+ votes: "Гласове"+ topic_voting:+ title: "Гласуване по тема"+ reached_limit: "Нямате достатъчно гласове, премахнете съществуващ глас!"+ list_votes: "Показване на вашите гласове"+ votes_nav_help: "теми с най-много гласове"+ voted: "Вие гласувахте по тази тема"+ allow_topic_voting: "Позволете на потребителите да гласуват по теми в тази категория"+ vote_title: "Гласуване"+ vote_title_plural: "Гласове"+ voted_title: "Гласувано"+ voting_closed_title: "Затворена"+ voting_limit: "Лимит"+ votes_left:+ one: "Остава ви %{count} глас, вижте <a href='%{path}'>вашите гласове</a>."+ other: "Остават ви %{count} гласа, вижте <a href='%{path}'>вашите гласове</a>."+ votes_left_button_title:+ one: "Остава ви %{count} глас."+ other: "Остават ви %{count} гласа."+ votes:+ one: "%{count} глас"+ other: "%{count} гласа"+ anonymous_button:+ one: "Глас"+ other: "Гласове"+ remove_vote: "Премахване на гласа"+ no_votes_title_self: "Все още не сте гласували за нито една тема"+ no_votes_title_others: "%{username} все още не е гласувал за нито една тема"+ filters:+ votes:+ title: "Гласове"+ help: "теми с най-много гласове"+ my_votes:+ title: "Моите гласове"+ help: "теми, за които сте гласували"+ search:+ most_votes: "Най-много гласове"+ advanced:+ vote:+ count:+ label: "Минимален брой гласове"diff --git a/plugins/discourse-topic-voting/config/locales/client.bs_BA.yml b/plugins/discourse-topic-voting/config/locales/client.bs_BA.ymlnew file mode 100644index 00000000000..d0d99a9109a--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.bs_BA.yml@@ -0,0 +1,52 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++bs_BA:+ js:+ category:+ sort_options:+ votes: "Glasovi"+ topic_voting:+ reached_limit: "Ostali ste bez glasova, odstrani postojeći glas!"+ list_votes: "Izlistaj svoje glasove"+ votes_nav_help: "teme s najviše glasova"+ voted: "Glasali ste na ovoj temi"+ allow_topic_voting: "Dozvolite korisnicima da glasaju na teme u ovoj kategoriji"+ vote_title: "Glasaj"+ vote_title_plural: "Glasovi"+ voted_title: "Glasano"+ voting_closed_title: "Zatvoreno"+ voting_limit: "Limit"+ votes_left:+ one: "Imate %{count} preostao glas, pogledajte <a href='%{path}'>vaši glasovi</a>."+ few: "Imate još %{count} glasa, pogledajte <a href='%{path}'>vaši glasovi</a>."+ other: "Imate još %{count} glasova, pogledajte <a href='%{path}'>vaši glasovi</a>."+ votes_left_button_title:+ one: "Ostao vam je %{count} glas."+ few: "Ostalo vam je %{count} glasa."+ other: "Ostalo vam je %{count} glasova."+ votes:+ one: "%{count} glas"+ few: "%{count} glasova"+ other: "%{count} glasova"+ anonymous_button:+ one: "Glas"+ few: "Glasa"+ other: "Glasova"+ remove_vote: "Odstrani glas"+ filters:+ votes:+ title: "Glasovi"+ help: "teme sa najviše glasova"+ my_votes:+ title: "Moji glasovi"+ help: "teme o kojima ste glasali"+ search:+ most_votes: "Većina glasova"+ advanced:+ vote:+ count:+ label: "Minimalni broj glasova"diff --git a/plugins/discourse-topic-voting/config/locales/client.ca.yml b/plugins/discourse-topic-voting/config/locales/client.ca.ymlnew file mode 100644index 00000000000..240d7594fbf--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.ca.yml@@ -0,0 +1,36 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ca:+ js:+ category:+ sort_options:+ votes: "Vots"+ topic_voting:+ reached_limit: "Us heu quedat sense vots. Elimineu un vot existent."+ list_votes: "Llista els vots"+ votes_nav_help: "temes amb més vots"+ voted: "Heu votat sobre aquest tema"+ allow_topic_voting: "Permet als usuaris votar sobre temes d'aquesta categoria"+ vote_title: "Vota"+ vote_title_plural: "Vots"+ voted_title: "Votat"+ voting_closed_title: "Tancat"+ voting_limit: "Límit"+ votes_left:+ one: "Us queda %{count} vot, mireu els <a href='%{path}'>vostres vots</a>."+ other: "Us queden %{count} vots, mireu els <a href='%{path}'>vostres vots</a>."+ votes:+ one: " %{count} vot"+ other: "%{count} vots"+ anonymous_button:+ one: "Vota"+ other: "Vots"+ remove_vote: "Elimina el vot"+ filters:+ votes:+ title: "Vots"+ help: "temes amb més vots"diff --git a/plugins/discourse-topic-voting/config/locales/client.cs.yml b/plugins/discourse-topic-voting/config/locales/client.cs.ymlnew file mode 100644index 00000000000..ee3725da281--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.cs.yml@@ -0,0 +1,65 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++cs:+ js:+ category:+ sort_options:+ votes: "Hlasy"+ topic_voting:+ title: "Hlasování o tématu"+ reached_limit: "Došly vám hlasy. Odeberte jiný hlas."+ list_votes: "Seznam vašich hlasů"+ votes_nav_help: "témata s nejvíce hlasy"+ voted: "Pro toto téma jste hlasovali"+ allow_topic_voting: "Povolit uživatelům hlasovat pro témata v této kategorii"+ vote_title: "Hlasovat"+ vote_title_plural: "Hlasy"+ voted_title: "Hlasováno"+ voting_closed_title: "Uzavřeno"+ voting_limit: "limit"+ votes_left:+ one: "Zbývá vám %{count} hlas, podívejte se <a href='%{path}'>vaše hlasy</a>."+ few: "Zbývají vám %{count} hlasy, podívejte se <a href='%{path}'>vaše hlasy</a>."+ many: "Zbývá vám %{count} hlasů, podívejte se <a href='%{path}'>vaše hlasy</a>."+ other: "Zbývá vám %{count} hlasů, podívejte se <a href='%{path}'>vaše hlasy</a>."+ votes_left_button_title:+ one: "Zbývá vám %{count} hlas."+ few: "Zbývají vám %{count} hlasy."+ many: "Zbývá vám %{count} hlasů."+ other: "Zbývá vám %{count} hlasů."+ votes:+ one: "%{count} hlas"+ few: "%{count} hlasy"+ many: "%{count} hlasů"+ other: "%{count} hlasů"+ anonymous_button:+ one: "Hlas"+ few: "Hlasy"+ many: "Hlasů"+ other: "Hlasů"+ remove_vote: "Odebrat hlas"+ no_votes_title_self: "Zatím jste nehlasovali o žádném tématu"+ no_votes_title_others: "%{username} zatím nehlasoval/a o žádném tématu"+ filters:+ votes:+ title: "Hlasy"+ help: "témata s nejvíce hlasy"+ my_votes:+ title: "Moje hlasy"+ help: "témata, o kterých jste hlasovali"+ search:+ most_votes: "Nejvíce hlasů"+ advanced:+ vote:+ count:+ label: "Minimální počet hlasů"+ admin:+ web_hooks:+ voting_event:+ group_name: "Událost hlasování o tématu"+ topic_upvote: "Když uživatel hlasuje o tématu"+ topic_unvote: "Když uživatel odebere hlas z tématu"diff --git a/plugins/discourse-topic-voting/config/locales/client.da.yml b/plugins/discourse-topic-voting/config/locales/client.da.ymlnew file mode 100644index 00000000000..22a1d918f3c--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.da.yml@@ -0,0 +1,52 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++da:+ js:+ category:+ sort_options:+ votes: "Stemmer"+ topic_voting:+ reached_limit: "Du kan ikke afgive flere stemmer, fjern venligst en og prøv igen!"+ list_votes: "Vis dine stemmer"+ votes_nav_help: "emner med flest stemmer"+ voted: "Du stemte i dette emne"+ allow_topic_voting: "Tillad brugere at stemme på emner i denne kategori"+ vote_title: "Stem"+ vote_title_plural: "Stemmer"+ voted_title: "Stemte"+ voting_closed_title: "Lukket"+ voting_limit: "Begrænset"+ votes_left:+ one: "Du har %{count} stemme tilbage, se <a href='%{path}'>dine stemmer</a>."+ other: "Du har %{count} stemmer tilbage, se <a href='%{path}'>dine stemmer</a>."+ votes_left_button_title:+ one: "Du har %{count} stemme tilbage."+ other: "Du har %{count} stemmer tilbage."+ votes:+ one: "%{count} stemme"+ other: "%{count} stemmer"+ anonymous_button:+ one: "Stemme"+ other: "Stemmer"+ remove_vote: "Fjern stemme"+ filters:+ votes:+ title: "Stemmer"+ help: "emner med flest stemmer"+ my_votes:+ title: "Mine Stemmer"+ help: "emner, du stemte på"+ search:+ most_votes: "Flest Stemmer"+ advanced:+ vote:+ count:+ label: "Minimum antal af stemmer"+ admin:+ web_hooks:+ voting_event:+ group_name: "Emne Afstemningshændelse"diff --git a/plugins/discourse-topic-voting/config/locales/client.de.yml b/plugins/discourse-topic-voting/config/locales/client.de.ymlnew file mode 100755index 00000000000..21ac6a7de02--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.de.yml@@ -0,0 +1,57 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++de:+ js:+ category:+ sort_options:+ votes: "Stimmen"+ topic_voting:+ title: "Themenabstimmung"+ reached_limit: "Du hast keine Stimmen mehr. Entferne eine bestehende Stimme!"+ list_votes: "Deine Stimmen auflisten"+ votes_nav_help: "Themen mit den meisten Stimmen"+ voted: "Du hast für dieses Thema gestimmt"+ allow_topic_voting: "Benutzern erlauben, für Themen in dieser Kategorie zu stimmen"+ vote_title: "Stimme"+ vote_title_plural: "Stimmen"+ voted_title: "Abgestimmt"+ voting_closed_title: "Geschlossen"+ voting_limit: "Limit"+ votes_left:+ one: "Du hast noch %{count} Stimme übrig, siehe <a href='%{path}'>deine Stimmen</a>."+ other: "Du hast noch %{count} Stimmen übrig, siehe <a href='%{path}'>deine Stimmen</a>."+ votes_left_button_title:+ one: "Du hast noch %{count} Stimme übrig."+ other: "Du hast noch %{count} Stimmen übrig."+ votes:+ one: "%{count} Stimme"+ other: "%{count} Stimmen"+ anonymous_button:+ one: "Stimme"+ other: "Stimmen"+ remove_vote: "Stimme entfernen"+ no_votes_title_self: "Du hast noch für kein Thema gestimmt"+ no_votes_title_others: "%{username} hat noch für kein Thema gestimmt"+ filters:+ votes:+ title: "Stimmen"+ help: "Themen mit den meisten Stimmen"+ my_votes:+ title: "Meine Stimmen"+ help: "Themen, über die du abgestimmt hast"+ search:+ most_votes: "Meiste Stimmen"+ advanced:+ vote:+ count:+ label: "Mindeststimmzahl"+ admin:+ web_hooks:+ voting_event:+ group_name: "Themenabstimmungsereignis"+ topic_upvote: "Wenn ein Benutzer über ein Thema abstimmt"+ topic_unvote: "Wenn ein Benutzer seine Stimme für ein Thema zurücknimmt"diff --git a/plugins/discourse-topic-voting/config/locales/client.el.yml b/plugins/discourse-topic-voting/config/locales/client.el.ymlnew file mode 100644index 00000000000..3cd2d61d836--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.el.yml@@ -0,0 +1,57 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++el:+ js:+ category:+ sort_options:+ votes: "Ψήφοι"+ topic_voting:+ title: "Ψηφοφορία Θέματος"+ reached_limit: "Έχετε χρησιμοποιήσει όλες τις ψήφους σας, αφαιρέστε μια υπάρχουσα ψήφο!"+ list_votes: "Λίστα των ψήφων σας"+ votes_nav_help: "θέματα με τις περισσότερες ψήφους"+ voted: "Ψηφίσατε για αυτό το θέμα"+ allow_topic_voting: "Να επιτρέπεται στους χρήστες να ψηφίζουν για θέματα αυτής της κατηγορίας"+ vote_title: "Ψήφος"+ vote_title_plural: "Ψήφοι"+ voted_title: "Ψήφισα"+ voting_closed_title: "Κλειστή"+ voting_limit: "Όριο"+ votes_left:+ one: "Απομένει %{count} ψήφος, δείτε <a href='%{path}'>τις ψήφους σας</a>."+ other: "Απομένουν %{count} ψήφοι, δείτε <a href='%{path}'>τις ψήφους σας</a>."+ votes_left_button_title:+ one: "Έχετε %{count} ψήφο ακόμη."+ other: "Έχετε %{count} ψήφους ακόμη."+ votes:+ one: "%{count} ψήφος"+ other: "%{count} ψήφοι"+ anonymous_button:+ one: "Ψήφος"+ other: "Ψήφοι"+ remove_vote: "Αφαίρεση ψήφου"+ no_votes_title_self: "Δεν έχετε ψηφίσει σε κανένα θέμα ακόμα"+ no_votes_title_others: "Ο χρήστης %{username} δεν έχει ψηφίσει σε κανένα θέμα ακόμα"+ filters:+ votes:+ title: "Ψήφοι"+ help: "θέματα με τις περισσότερες ψήφους"+ my_votes:+ title: "Οι Ψήφοι Μου"+ help: "θέματα στα οποία ψηφίσατε"+ search:+ most_votes: "Περισσότερες Ψήφοι"+ advanced:+ vote:+ count:+ label: "Ελάχιστος Αριθμός Ψήφων"+ admin:+ web_hooks:+ voting_event:+ group_name: "Εκδήλωση Ψηφοφορίας Θέματος"+ topic_upvote: "Όταν ένας χρήστης ψηφίζει σε ένα θέμα"+ topic_unvote: "Όταν ένας χρήστης αφαιρεί την ψήφο του σε ένα θέμα"diff --git a/plugins/discourse-topic-voting/config/locales/client.en.yml b/plugins/discourse-topic-voting/config/locales/client.en.ymlnew file mode 100755index 00000000000..ac996c9838a--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.en.yml@@ -0,0 +1,51 @@+en:+ js:+ category:+ sort_options:+ votes: "Votes"+ topic_voting:+ title: "Topic Voting"+ reached_limit: "You are out of votes, remove an existing vote!"+ list_votes: "List your votes"+ votes_nav_help: "topics with the most votes"+ voted: "You voted on this topic"+ allow_topic_voting: "Allow users to vote on topics in this category"+ vote_title: "Vote"+ vote_title_plural: "Votes"+ voted_title: "Voted"+ voting_closed_title: "Closed"+ voting_limit: "Limit"+ votes_left:+ one: "You have %{count} vote left, see <a href='%{path}'>your votes</a>."+ other: "You have %{count} votes left, see <a href='%{path}'>your votes</a>."+ votes_left_button_title:+ one: "You have %{count} vote left."+ other: "You have %{count} votes left."+ votes:+ one: "%{count} vote"+ other: "%{count} votes"+ anonymous_button:+ one: "Vote"+ other: "Votes"+ remove_vote: "Remove vote"+ no_votes_title_self: "You haven't voted for any topic yet"+ no_votes_title_others: "%{username} hasn't voted for any topic yet"+ filters:+ votes:+ title: "Votes"+ help: "topics with the most votes"+ my_votes:+ title: "My Votes"+ help: "topics you voted on"+ search:+ most_votes: "Most Votes"+ advanced:+ vote:+ count:+ label: "Minimum Vote Count"+ admin:+ web_hooks:+ voting_event:+ group_name: "Topic Voting Event"+ topic_upvote: "When a user votes on a topic"+ topic_unvote: "When a user unvotes on a topic"diff --git a/plugins/discourse-topic-voting/config/locales/client.en_GB.yml b/plugins/discourse-topic-voting/config/locales/client.en_GB.ymlnew file mode 100644index 00000000000..2d4fa180ec7--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.en_GB.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++en_GB:diff --git a/plugins/discourse-topic-voting/config/locales/client.es.yml b/plugins/discourse-topic-voting/config/locales/client.es.ymlnew file mode 100644index 00000000000..59b166de759--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.es.yml@@ -0,0 +1,57 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++es:+ js:+ category:+ sort_options:+ votes: "Votos"+ topic_voting:+ title: "Votación de temas"+ reached_limit: "Se te acabaron los votos, ¡elimina un voto existente!"+ list_votes: "Lista de tus votos"+ votes_nav_help: "temas con más votos"+ voted: "Votaste sobre este tema"+ allow_topic_voting: "Permitir a los usuarios votar sobre temas en esta categoría"+ vote_title: "Votar"+ vote_title_plural: "Votos"+ voted_title: "Votado"+ voting_closed_title: "Cerrado"+ voting_limit: "Límite"+ votes_left:+ one: "Te queda %{count} voto, consulta <a href='%{path}'>tus votos</a>."+ other: "Te quedan %{count} votos, consulta <a href='%{path}'>tus votos</a>."+ votes_left_button_title:+ one: "Te queda %{count} voto."+ other: "Te quedan %{count} votos."+ votes:+ one: "%{count} voto"+ other: "%{count} votos"+ anonymous_button:+ one: "Votar"+ other: "Votos"+ remove_vote: "Eliminar voto"+ no_votes_title_self: "Aún no has votado por ningún tema"+ no_votes_title_others: "%{username} aún no ha votado por ningún tema"+ filters:+ votes:+ title: "Votos"+ help: "temas con más votos"+ my_votes:+ title: "Mis votos"+ help: "temas en los que has votado"+ search:+ most_votes: "Más votos"+ advanced:+ vote:+ count:+ label: "Número mínimo de votos"+ admin:+ web_hooks:+ voting_event:+ group_name: "Evento de votación de tema"+ topic_upvote: "Cuando un usuario vota sobre un tema"+ topic_unvote: "Cuando un usuario cancela el voto sobre un tema"diff --git a/plugins/discourse-topic-voting/config/locales/client.et.yml b/plugins/discourse-topic-voting/config/locales/client.et.ymlnew file mode 100644index 00000000000..741a207482b--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.et.yml@@ -0,0 +1,23 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++et:+ js:+ category:+ sort_options:+ votes: "HInnangud"+ topic_voting:+ voted: "Sa hindasid seda teemat"+ vote_title: "Hinda"+ vote_title_plural: "HInnangud"+ voting_closed_title: "Suletud"+ voting_limit: "Limiit"+ anonymous_button:+ one: "Hinda"+ other: "HInnangud"+ filters:+ votes:+ title: "HInnangud"diff --git a/plugins/discourse-topic-voting/config/locales/client.fa_IR.yml b/plugins/discourse-topic-voting/config/locales/client.fa_IR.ymlnew file mode 100644index 00000000000..2850362342a--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.fa_IR.yml@@ -0,0 +1,33 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++fa_IR:+ js:+ category:+ sort_options:+ votes: "آرا"+ topic_voting:+ title: "رایگیری موضوع"+ list_votes: "آرای خود را فهرست کنید"+ votes_nav_help: "موضوعات با بیشترین آرا"+ voted: "شما به این موضوع رای داده اید"+ allow_topic_voting: "به کاربران برای رای دادن در موضوعات این دستهبندی اجازه دهید"+ vote_title: "رای"+ vote_title_plural: "آرا"+ voted_title: "رای داده شده"+ voting_closed_title: "بسته"+ voting_limit: "محدود کردن"+ votes:+ one: "%{count} رای"+ other: "%{count} رای"+ anonymous_button:+ one: "رای"+ other: "آرا"+ remove_vote: "حذف رای"+ filters:+ votes:+ title: "آرا"+ help: "موضوعات با بیشترین آرا"diff --git a/plugins/discourse-topic-voting/config/locales/client.fi.yml b/plugins/discourse-topic-voting/config/locales/client.fi.ymlnew file mode 100644index 00000000000..0e2a06595fb--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.fi.yml@@ -0,0 +1,57 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++fi:+ js:+ category:+ sort_options:+ votes: "Äänet"+ topic_voting:+ title: "Ketjun äänestys"+ reached_limit: "Sinulla ei ole enempää ääniä, poista antamasi ääni!"+ list_votes: "Kaikki antamasi äänet"+ votes_nav_help: "ketjut, joilla on eniten ääniä"+ voted: "Äänestit tässä ketjussa"+ allow_topic_voting: "Salli käyttäjien antaa ääniä ketjuissa tällä alueella"+ vote_title: "Ääni"+ vote_title_plural: "Äänet"+ voted_title: "Äänestetty"+ voting_closed_title: "Suljettu"+ voting_limit: "Raja"+ votes_left:+ one: "Sinulla on %{count} ääni jäljellä, katso <a href='%{path}'>äänesi</a>."+ other: "Sinulla on %{count} ääntä jäljellä, katso <a href='%{path}'>äänesi</a>."+ votes_left_button_title:+ one: "Sinulla on %{count} ääni jäljellä."+ other: "Sinulla on %{count} ääntä jäljellä."+ votes:+ one: "%{count} ääni"+ other: "%{count} ääntä"+ anonymous_button:+ one: "Ääni"+ other: "Äänet"+ remove_vote: "Poista ääni"+ no_votes_title_self: "Et ole vielä äänestänyt ketjuja"+ no_votes_title_others: "%{username} ei ole vielä äänestänyt ketjuja"+ filters:+ votes:+ title: "Äänet"+ help: "ketjut, joilla on eniten ääniä"+ my_votes:+ title: "Omat äänet"+ help: "ketjut, joissa olet äänestänyt"+ search:+ most_votes: "Eniten ääniä"+ advanced:+ vote:+ count:+ label: "Vähimmäisäänimäärä"+ admin:+ web_hooks:+ voting_event:+ group_name: "Ketjunäänestystapahtuma"+ topic_upvote: "Kun käyttäjä äänestää ketjua"+ topic_unvote: "Kun käyttäjä poistaa äänen ketjulta"diff --git a/plugins/discourse-topic-voting/config/locales/client.fr.yml b/plugins/discourse-topic-voting/config/locales/client.fr.ymlnew file mode 100644index 00000000000..c8080ecc79e--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.fr.yml@@ -0,0 +1,57 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++fr:+ js:+ category:+ sort_options:+ votes: "Votes"+ topic_voting:+ title: "Vote par sujet"+ reached_limit: "Vous n'avez plus de votes disponibles, enlevez-en un !"+ list_votes: "Lister vos votes"+ votes_nav_help: "sujets ayant reçu le plus de votes"+ voted: "Vous avez voté pour ce sujet"+ allow_topic_voting: "Autoriser les utilisateurs à voter dans cette catégorie"+ vote_title: "Voter"+ vote_title_plural: "Votes"+ voted_title: "Voté"+ voting_closed_title: "Fermé"+ voting_limit: "Limite"+ votes_left:+ one: "Il vous reste %{count} vote, consultez <a href='%{path}'>vos votes</a>."+ other: "Il vous reste %{count} votes, consultez <a href='%{path}'>vos votes</a>."+ votes_left_button_title:+ one: "Il vous reste %{count} vote."+ other: "Il vous reste %{count} votes."+ votes:+ one: "%{count} vote"+ other: "%{count} votes"+ anonymous_button:+ one: "Vote"+ other: "Votes"+ remove_vote: "Supprimer le vote"+ no_votes_title_self: "Vous n'avez encore voté pour aucun sujet"+ no_votes_title_others: "%{username} n'a encore voté pour aucun sujet"+ filters:+ votes:+ title: "Votes"+ help: "sujets ayant reçu le plus de votes"+ my_votes:+ title: "Mes votes"+ help: "sujets sur lesquels vous avez voté"+ search:+ most_votes: "Le plus de votes"+ advanced:+ vote:+ count:+ label: "Nombre minimal de votes"+ admin:+ web_hooks:+ voting_event:+ group_name: "Événement de vote du sujet"+ topic_upvote: "Lorsqu'un utilisateur vote sur un sujet"+ topic_unvote: "Lorsqu'un utilisateur retire son vote sur un sujet"diff --git a/plugins/discourse-topic-voting/config/locales/client.gl.yml b/plugins/discourse-topic-voting/config/locales/client.gl.ymlnew file mode 100644index 00000000000..218f2e797f9--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.gl.yml@@ -0,0 +1,22 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++gl:+ js:+ category:+ sort_options:+ votes: "Votos"+ topic_voting:+ vote_title: "Votar"+ vote_title_plural: "Votos"+ voting_closed_title: "Pechado"+ anonymous_button:+ one: "Voto"+ other: "Votos"+ remove_vote: "Eliminar voto"+ filters:+ votes:+ title: "Votos"diff --git a/plugins/discourse-topic-voting/config/locales/client.he.yml b/plugins/discourse-topic-voting/config/locales/client.he.ymlnew file mode 100644index 00000000000..24be67ebb85--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.he.yml@@ -0,0 +1,65 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++he:+ js:+ category:+ sort_options:+ votes: "הצבעות"+ topic_voting:+ title: "הצבעה על נושאים"+ reached_limit: "נגמרו לך ההצבעות, עליך להסיר הצבעה קיימת!"+ list_votes: "הצגת ההצבעות שלך"+ votes_nav_help: "נושאים עם הכי הרבה הצבעות"+ voted: "הצבעת לנושא זה"+ allow_topic_voting: "לאפשר למשתמשים להצביע על נושאים בקטגוריה זו"+ vote_title: "הצבעה"+ vote_title_plural: "הצבעות"+ voted_title: "התקבלה הצבעה"+ voting_closed_title: "נסגר"+ voting_limit: "מגבלה"+ votes_left:+ one: "נותרה לרשותך הצבעה %{count}, להצגת ה<a href='%{path}'>הצבעות שלך</a>."+ two: "נותרו לרשותך %{count} הצבעות, להצגת ה<a href='%{path}'>הצבעות שלך</a>."+ many: "נותרו לרשותך %{count} הצבעות, להצגת ה<a href='%{path}'>הצבעות שלך</a>."+ other: "נותרו לרשותך %{count} הצבעות, להצגת ה<a href='%{path}'>הצבעות שלך</a>."+ votes_left_button_title:+ one: "נותרה לך הצבעה %{count}."+ two: "נותרו לך %{count} הצבעות."+ many: "נותרו לך %{count} הצבעות."+ other: "נותרו לך %{count} הצבעות."+ votes:+ one: "הצבעה %{count}"+ two: "%{count} הצבעות"+ many: "%{count} הצבעות"+ other: "%{count} הצבעות"+ anonymous_button:+ one: "הצבעה"+ two: "הצבעות"+ many: "הצבעות"+ other: "הצבעות"+ remove_vote: "הסרת הצבעה"+ no_votes_title_self: "עדיין לא הצבעת לאף נושא"+ no_votes_title_others: "עדיין לא התקבלה הצבעה על נושא כלשהו מאת %{username}"+ filters:+ votes:+ title: "הצבעות"+ help: "נושאים עם הכי הרבה הצבעות"+ my_votes:+ title: "הצבעות שלי"+ help: "נושאים שהצבעת עליהם"+ search:+ most_votes: "רוב ההצבעות"+ advanced:+ vote:+ count:+ label: "ספירת הצבעות מינימלית"+ admin:+ web_hooks:+ voting_event:+ group_name: "אירוע הצבעה בנושא"+ topic_upvote: "כשמשתמש מצביע לנושא"+ topic_unvote: "כשמשתמש מבטל הצבעה לנושא"diff --git a/plugins/discourse-topic-voting/config/locales/client.hr.yml b/plugins/discourse-topic-voting/config/locales/client.hr.ymlnew file mode 100644index 00000000000..7c1381685dd--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.hr.yml@@ -0,0 +1,31 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++hr:+ js:+ category:+ sort_options:+ votes: "Glasovi"+ topic_voting:+ reached_limit: "Ponestalo vam je glasova, uklonite postojeći glas!"+ list_votes: "Prikažite svoje glasove"+ votes_nav_help: "teme s najviše glasova"+ voted: "Glasali ste na ovoj temi"+ allow_topic_voting: "Dopusti korisnicima da glasaju na temama u ovoj kategoriji?"+ vote_title: "Glasaj"+ vote_title_plural: "Glasovi"+ voted_title: "Glasovao"+ voting_closed_title: "Zatvoreno"+ voting_limit: "Limit"+ anonymous_button:+ one: "Glas"+ few: "Glasa"+ other: "Glasova"+ remove_vote: "Ukloni glas"+ filters:+ votes:+ title: "Glasovi"+ help: "teme s najviše glasova"diff --git a/plugins/discourse-topic-voting/config/locales/client.hu.yml b/plugins/discourse-topic-voting/config/locales/client.hu.ymlnew file mode 100644index 00000000000..1b639b885f0--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.hu.yml@@ -0,0 +1,30 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++hu:+ js:+ category:+ sort_options:+ votes: "Szavazatok"+ topic_voting:+ reached_limit: "Kifogytál a szavazatokból, törölj egy korábbi szavazatot!"+ list_votes: "Szavazataid listázása"+ votes_nav_help: "legtöbb szavazatot kapott témák"+ voted: "Már szavaztál erre a témára"+ allow_topic_voting: "Engedélyezi a felhasználóknak, hogy szavazannak a bejegyzésekre ebben a kategóriában. "+ vote_title: "Szavazás"+ vote_title_plural: "Szavazatok"+ voted_title: "Szavazott"+ voting_closed_title: "Zárt"+ voting_limit: "Limit"+ anonymous_button:+ one: "szavazások "+ other: "Szavazások"+ remove_vote: "Szavazat eltávolítása"+ filters:+ votes:+ title: "Szavazatok"+ help: "legtöbb szavazatot kapott témák"diff --git a/plugins/discourse-topic-voting/config/locales/client.hy.yml b/plugins/discourse-topic-voting/config/locales/client.hy.ymlnew file mode 100644index 00000000000..d3a8b7aded3--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.hy.yml@@ -0,0 +1,29 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++hy:+ js:+ category:+ sort_options:+ votes: "Քվեներ"+ topic_voting:+ reached_limit: "Դուք գերազանցել եք քվեների քանակը, հեռացրեք որևէ գոյույթուն ունեցող քվե!"+ list_votes: "Ցուցակագրել Ձեր քվեները"+ votes_nav_help: "ամենաշատ քվեներով թեմաները"+ voted: "Դուք քվեարկել եք այս թեմայում"+ allow_topic_voting: "Թույլատրել օգտատերերին քվեարկել այս կատեգորիայի թեմաներում"+ vote_title: "Քվեարկել"+ vote_title_plural: "Քվեներ"+ voted_title: "Քվեարկած"+ voting_closed_title: "Փակված է"+ voting_limit: "Սահմանափակում"+ anonymous_button:+ one: "Քվեներ"+ other: "Քվեներ"+ filters:+ votes:+ title: "Քվեներ"+ help: "ամենաշատ քվեներով թեմաները"diff --git a/plugins/discourse-topic-voting/config/locales/client.id.yml b/plugins/discourse-topic-voting/config/locales/client.id.ymlnew file mode 100644index 00000000000..9fbaedbeed5--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.id.yml@@ -0,0 +1,13 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++id:+ js:+ topic_voting:+ vote_title: "Pilih"+ voting_closed_title: "Tertutup"+ votes:+ other: "%{count} suara"diff --git a/plugins/discourse-topic-voting/config/locales/client.it.yml b/plugins/discourse-topic-voting/config/locales/client.it.ymlnew file mode 100644index 00000000000..e60ec7870c5--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.it.yml@@ -0,0 +1,57 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++it:+ js:+ category:+ sort_options:+ votes: "Voti"+ topic_voting:+ title: "Votazione per argomenti"+ reached_limit: "Hai terminato i voti, rimuovi un voto esistente!"+ list_votes: "Elenca i tuoi voti"+ votes_nav_help: "argomenti con il maggior numero di voti"+ voted: "Hai votato su questo argomento"+ allow_topic_voting: "Permetti agli utenti di votare gli argomenti in questa categoria"+ vote_title: "Voto"+ vote_title_plural: "Voti"+ voted_title: "Votato"+ voting_closed_title: "Chiuso"+ voting_limit: "Limite"+ votes_left:+ one: "Hai ancora %{count} voto, vedi i <a href='%{path}'>tuoi voti</a>."+ other: "Hai ancora %{count} voti, vedi i <a href='%{path}'>tuoi voti</a>."+ votes_left_button_title:+ one: "Hai ancora %{count} voto."+ other: "Hai ancora %{count} voti."+ votes:+ one: "%{count} voto"+ other: "%{count} voti"+ anonymous_button:+ one: "Voto"+ other: "Voti"+ remove_vote: "Rimuovi voto"+ no_votes_title_self: "Non hai ancora votato per nessun argomento"+ no_votes_title_others: "%{username} non ha ancora votato per nessun argomento"+ filters:+ votes:+ title: "Voti"+ help: "argomenti con il maggior numero di voti"+ my_votes:+ title: "I miei voti"+ help: "argomenti su cui hai votato"+ search:+ most_votes: "I più votati"+ advanced:+ vote:+ count:+ label: "Numero minimo di voti"+ admin:+ web_hooks:+ voting_event:+ group_name: "Evento di votazione dell'argomento"+ topic_upvote: "Quando un utente vota su un argomento"+ topic_unvote: "Quando un utente annulla il voto su un argomento"diff --git a/plugins/discourse-topic-voting/config/locales/client.ja.yml b/plugins/discourse-topic-voting/config/locales/client.ja.ymlnew file mode 100644index 00000000000..5aa2af7d8ec--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.ja.yml@@ -0,0 +1,53 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ja:+ js:+ category:+ sort_options:+ votes: "票数"+ topic_voting:+ title: "トピック投票"+ reached_limit: "票数が不足しています。既存の投票を削除してください!"+ list_votes: "投票をリスト"+ votes_nav_help: "票数が最も多いトピック"+ voted: "あなたはこのトピックに投票しました"+ allow_topic_voting: "ユーザーがこのカテゴリのトピックに投票することを許可する"+ vote_title: "投票"+ vote_title_plural: "投票"+ voted_title: "投票済み"+ voting_closed_title: "終了"+ voting_limit: "制限"+ votes_left:+ other: "残り %{count} 票です。<a href='%{path}'>あなたの投票</a>を確認してください。"+ votes_left_button_title:+ other: "残り %{count} 票です。"+ votes:+ other: "%{count} 票"+ anonymous_button:+ other: "投票"+ remove_vote: "投票を削除"+ no_votes_title_self: "まだトピックに一度も投票していません。"+ no_votes_title_others: "%{username} はまだトピックに投票していません"+ filters:+ votes:+ title: "票数"+ help: "投票数が最も多いトピック"+ my_votes:+ title: "自分の投票"+ help: "投票したトピック"+ search:+ most_votes: "票数の最も多い項目"+ advanced:+ vote:+ count:+ label: "最低票数"+ admin:+ web_hooks:+ voting_event:+ group_name: "トピック投票イベント"+ topic_upvote: "ユーザーがトピックに投票するとき"+ topic_unvote: "ユーザーがトピックへの投票を取り消すとき"diff --git a/plugins/discourse-topic-voting/config/locales/client.ko.yml b/plugins/discourse-topic-voting/config/locales/client.ko.ymlnew file mode 100644index 00000000000..0353a209e11--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.ko.yml@@ -0,0 +1,31 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ko:+ js:+ category:+ sort_options:+ votes: "투표"+ topic_voting:+ reached_limit: "투표권이 없습니다. 기존 투표를 제거하십시오!"+ list_votes: "내 투표 목록"+ votes_nav_help: "가장 많은 표를 얻은 주제"+ voted: "이 주제에 투표했습니다"+ allow_topic_voting: "사용자가 이 카테고리의 주제에 투표하도록 허용함"+ vote_title: "투표"+ vote_title_plural: "투표"+ voted_title: "투표함"+ voting_closed_title: "닫힘"+ voting_limit: "한도"+ votes:+ other: "%{count} 투표"+ anonymous_button:+ other: "투표"+ remove_vote: "투표 삭제"+ filters:+ votes:+ title: "투표"+ help: "가장 많은 표를 얻은 주제"diff --git a/plugins/discourse-topic-voting/config/locales/client.lt.yml b/plugins/discourse-topic-voting/config/locales/client.lt.ymlnew file mode 100644index 00000000000..9b02bb1ec14--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.lt.yml@@ -0,0 +1,12 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++lt:+ js:+ topic_voting:+ vote_title: "Balsuoti"+ voting_closed_title: "Uždaryta"+ remove_vote: "Pašalinti balsą"diff --git a/plugins/discourse-topic-voting/config/locales/client.lv.yml b/plugins/discourse-topic-voting/config/locales/client.lv.ymlnew file mode 100644index 00000000000..edbcddef928--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.lv.yml@@ -0,0 +1,10 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++lv:+ js:+ topic_voting:+ voting_closed_title: "Slēgts"diff --git a/plugins/discourse-topic-voting/config/locales/client.nb_NO.yml b/plugins/discourse-topic-voting/config/locales/client.nb_NO.ymlnew file mode 100644index 00000000000..d1d0acff2b8--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.nb_NO.yml@@ -0,0 +1,29 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++nb_NO:+ js:+ category:+ sort_options:+ votes: "Stemmer"+ topic_voting:+ reached_limit: "Du har ikke flere stemmer igjen, fjern en eksisterende stemme."+ list_votes: "List opp dine stemmer"+ votes_nav_help: "emner med flest stemmer"+ voted: "Du stemte på dette emnet"+ allow_topic_voting: "Tillat brukere å stemme på emner i denne kategorien"+ vote_title: "Stemme"+ vote_title_plural: "Stemmer"+ voted_title: "Stemt"+ voting_closed_title: "Lukket"+ voting_limit: "Grense"+ anonymous_button:+ one: "Stemme"+ other: "Stemmer"+ filters:+ votes:+ title: "Stemmer"+ help: "emner med flest stemmer"diff --git a/plugins/discourse-topic-voting/config/locales/client.nl.yml b/plugins/discourse-topic-voting/config/locales/client.nl.ymlnew file mode 100644index 00000000000..f108cb7551f--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.nl.yml@@ -0,0 +1,57 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++nl:+ js:+ category:+ sort_options:+ votes: "Stemmen"+ topic_voting:+ title: "Stemmen over topics"+ reached_limit: "Je hebt geen stemmen meer, verwijder een bestaande stem!"+ list_votes: "Je stemmen weergeven"+ votes_nav_help: "topics met de meeste stemmen"+ voted: "Je hebt op dit topic gestemd"+ allow_topic_voting: "Gebruikers mogen op topics in deze categorie stemmen"+ vote_title: "Stem"+ vote_title_plural: "Stemmen"+ voted_title: "Gestemd"+ voting_closed_title: "Gesloten"+ voting_limit: "Limiet"+ votes_left:+ one: "Je hebt nog %{count} stem, bekijk <a href='%{path}'>je stemmen</a>."+ other: "Je hebt nog %{count} stemmen, bekijk <a href='%{path}'>je stemmen</a>."+ votes_left_button_title:+ one: "Je hebt nog %{count} stem."+ other: "Je hebt nog %{count} stemmen."+ votes:+ one: "%{count} stem"+ other: "%{count} stemmen"+ anonymous_button:+ one: "Stem"+ other: "Stemmen"+ remove_vote: "Stem verwijderen"+ no_votes_title_self: "Je hebt nog niet gestemd op topics"+ no_votes_title_others: "%{username} heeft nog niet gestemd op topics"+ filters:+ votes:+ title: "Stemmen"+ help: "topics met de meeste stemmen"+ my_votes:+ title: "Mijn stemmen"+ help: "topics waarop je hebt gestemd"+ search:+ most_votes: "Meeste stemmen"+ advanced:+ vote:+ count:+ label: "Minimaal aantal stemmen"+ admin:+ web_hooks:+ voting_event:+ group_name: "Topicstemgebeurtenis"+ topic_upvote: "Wanneer een gebruiker stemt bij een topic"+ topic_unvote: "Wanneer een gebruiker een stem bij een topic intrekt"diff --git a/plugins/discourse-topic-voting/config/locales/client.pl_PL.yml b/plugins/discourse-topic-voting/config/locales/client.pl_PL.ymlnew file mode 100644index 00000000000..759de071843--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.pl_PL.yml@@ -0,0 +1,65 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++pl_PL:+ js:+ category:+ sort_options:+ votes: "Głosy"+ topic_voting:+ title: "Głosowanie na temat"+ reached_limit: "Oddałeś już maksymalną liczbę głosów!"+ list_votes: "Lista twoich głosów"+ votes_nav_help: "tematy z największą liczbą głosów"+ voted: "Oddałeś już głos"+ allow_topic_voting: "Pozwól użytkownikom głosować na tematy w tej kategorii"+ vote_title: "Głosuj"+ vote_title_plural: "Głosuj"+ voted_title: "Głosów"+ voting_closed_title: "Zamknięto"+ voting_limit: "Limit"+ votes_left:+ one: "Pozostał Ci %{count} głos, zobacz <a href='%{path}'>swoje głosy</a>."+ few: "Pozostały Ci %{count} głosy, zobacz <a href='%{path}'>swoje głosy</a>."+ many: "Pozostało Ci %{count} głosów, zobacz <a href='%{path}'>swoje głosy</a>."+ other: "Pozostało Ci %{count} głosów, zobacz <a href='%{path}'>swoje głosy</a>."+ votes_left_button_title:+ one: "Pozostał Ci %{count} głos."+ few: "Pozostały Ci %{count} głosy."+ many: "Pozostało Ci %{count} głosów."+ other: "Zostało Ci %{count} głosów."+ votes:+ one: "%{count} głos"+ few: "%{count} głosy"+ many: "%{count} głosów"+ other: "%{count} głosów"+ anonymous_button:+ one: "Głos"+ few: "Głosuj"+ many: "Głosów"+ other: "Głosuj"+ remove_vote: "Usuń głos"+ no_votes_title_self: "Nie głosowałeś jeszcze na żaden temat"+ no_votes_title_others: "%{username} nie zagłosował jeszcze na żaden temat"+ filters:+ votes:+ title: "Głosy"+ help: "tematy z największą liczbą głosów"+ my_votes:+ title: "Moje głosy"+ help: "tematy, na które głosowałeś"+ search:+ most_votes: "Najwięcej głosów"+ advanced:+ vote:+ count:+ label: "Minimalna liczba głosów"+ admin:+ web_hooks:+ voting_event:+ group_name: "Wydarzenie głosowania na temat"+ topic_upvote: "Gdy użytkownik głosuje na dany temat"+ topic_unvote: "Kiedy użytkownik cofa głos na temat"diff --git a/plugins/discourse-topic-voting/config/locales/client.pt.yml b/plugins/discourse-topic-voting/config/locales/client.pt.ymlnew file mode 100644index 00000000000..d0df6ed8dae--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.pt.yml@@ -0,0 +1,36 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++pt:+ js:+ category:+ sort_options:+ votes: "Votos"+ topic_voting:+ reached_limit: "Já não tem votos, remover um voto existente!"+ list_votes: "Listar os seus votos"+ votes_nav_help: "tópicos mais votados"+ voted: "Votou neste tópico"+ allow_topic_voting: "Permitir que os utilizadores votem nos tópicos desta categoria"+ vote_title: "Voto"+ vote_title_plural: "Votos"+ voted_title: "Votado"+ voting_closed_title: "Fechado"+ voting_limit: "Limite"+ votes_left:+ one: "Resta-me %{count} voto, veja os <a href='%{path}'>seus votos</a>."+ other: "Restam-me %{count} votos, veja os <a href='%{path}'>seus votos</a>."+ votes:+ one: "%{count} voto"+ other: "%{count} votos"+ anonymous_button:+ one: "Voto"+ other: "Votos"+ remove_vote: "Remover voto"+ filters:+ votes:+ title: "Votos"+ help: "tópicos mais votados"diff --git a/plugins/discourse-topic-voting/config/locales/client.pt_BR.yml b/plugins/discourse-topic-voting/config/locales/client.pt_BR.ymlnew file mode 100644index 00000000000..e257b69a8b5--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.pt_BR.yml@@ -0,0 +1,57 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++pt_BR:+ js:+ category:+ sort_options:+ votes: "Votos"+ topic_voting:+ title: "Votação do tópico"+ reached_limit: "Você está sem votos, remova um voto existente!"+ list_votes: "Mostrar seus votos"+ votes_nav_help: "tópicos com a maioria dos votos"+ voted: "Você votou neste tópico"+ allow_topic_voting: "Permitir que usuários(as) votem em tópicos desta categoria"+ vote_title: "Votar"+ vote_title_plural: "Votos"+ voted_title: "Votou"+ voting_closed_title: "Fechado"+ voting_limit: "Limite"+ votes_left:+ one: "Você tem %{count} voto restante, veja <a href='%{path}'>seus votos</a>."+ other: "Você tem %{count} votos restantes, veja <a href='%{path}'>seus votos</a>."+ votes_left_button_title:+ one: "Você tem %{count} voto restante."+ other: "Você tem %{count} votos restantes."+ votes:+ one: "%{count} voto"+ other: "%{count} votos"+ anonymous_button:+ one: "Votar"+ other: "Votos"+ remove_vote: "Remover voto"+ no_votes_title_self: "Você ainda não votou em nenhum tópico"+ no_votes_title_others: "%{username} ainda não votou em nenhum tópico"+ filters:+ votes:+ title: "Votos"+ help: "tópicos com a maioria dos votos"+ my_votes:+ title: "Meus votos"+ help: "tópicos em que você votou"+ search:+ most_votes: "Mais votados"+ advanced:+ vote:+ count:+ label: "Contagem mínima de votos"+ admin:+ web_hooks:+ voting_event:+ group_name: "Evento de votação no tópico"+ topic_upvote: "Quando um(a) usuário(a) votar em um tópico"+ topic_unvote: "Quando um(a) usuário(a) cancelar o voto em um tópico"diff --git a/plugins/discourse-topic-voting/config/locales/client.ro.yml b/plugins/discourse-topic-voting/config/locales/client.ro.ymlnew file mode 100644index 00000000000..e09863da7a8--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.ro.yml@@ -0,0 +1,52 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ro:+ js:+ category:+ sort_options:+ votes: "Evaluări"+ topic_voting:+ reached_limit: "Nu mai ai voturi, elimină un vot existent!"+ list_votes: "Listează-ți voturile"+ votes_nav_help: "subiecte cu cele mai multe evaluări"+ voted: "Ai evaluat acest subiect"+ allow_topic_voting: "Permite utilizatorilor să evalueze subiectele din această categorie"+ vote_title: "Evaluează"+ vote_title_plural: "Evaluări"+ voted_title: "Evaluat"+ voting_closed_title: "Închis"+ voting_limit: "Limită"+ votes_left:+ one: "Mai ai %{count} vot rămas, vezi <a href='%{path}'>voturile tale</a>."+ few: "Mai ai %{count} voturi, vezi <a href='%{path}'>voturile tale</a>."+ other: "Mai ai %{count} voturi, vezi <a href='%{path}'>voturile tale</a>."+ votes_left_button_title:+ one: "Mai ai %{count} vot."+ few: "Mai ai %{count} voturi."+ other: "Mai ai %{count} voturi."+ votes:+ one: "%{count} vot"+ few: "%{count} voturi"+ other: "%{count} voturi"+ anonymous_button:+ one: "Evaluează"+ few: "Evaluări"+ other: "Evaluări"+ remove_vote: "Eliminați votul"+ filters:+ votes:+ title: "Evaluări"+ help: "subiecte cu cele mai multe evaluări"+ my_votes:+ title: "Evaluările mele"+ help: "subiecte la care ai votat"+ search:+ most_votes: "Cele mai multe evaluări"+ advanced:+ vote:+ count:+ label: "Numărul minim de evaluări"diff --git a/plugins/discourse-topic-voting/config/locales/client.ru.yml b/plugins/discourse-topic-voting/config/locales/client.ru.ymlnew file mode 100644index 00000000000..92821132585--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.ru.yml@@ -0,0 +1,65 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ru:+ js:+ category:+ sort_options:+ votes: "Голосов"+ topic_voting:+ title: "Голосование по теме"+ reached_limit: "У вас закончились голоса. Удалите часть голосов."+ list_votes: "Показать ваши голоса"+ votes_nav_help: "Темы с наибольшим количеством голосов"+ voted: "Вы голосовали по этой теме"+ allow_topic_voting: "Разрешить пользователям голосовать по темам в этой категории"+ vote_title: "Голос"+ vote_title_plural: "Голосов"+ voted_title: "Проголосовало"+ voting_closed_title: "Закрытая"+ voting_limit: "Лимит"+ votes_left:+ one: "У вас есть %{count} голос, посмотрите <a href='%{path}'>свои голоса</a>."+ few: "У вас есть %{count} голоса, посмотрите <a href='%{path}'>свои голоса</a>."+ many: "У вас есть %{count} голосов, посмотрите <a href='%{path}'>свои голоса</a>."+ other: "У вас есть %{count} голоса, посмотрите <a href='%{path}'>свои голоса</a>."+ votes_left_button_title:+ one: "У вас остался %{count} голос."+ few: "У вас осталось %{count} голоса."+ many: "У вас осталось %{count} голосов."+ other: "У вас осталось %{count} голоса."+ votes:+ one: "%{count} голос"+ few: "%{count} голоса"+ many: "%{count} голосов"+ other: "%{count} голоса"+ anonymous_button:+ one: "Голос"+ few: "Голосов"+ many: "Голосов"+ other: "Голосов"+ remove_vote: "Удалить голос"+ no_votes_title_self: "Вы ещё не проголосовали ни за одну тему"+ no_votes_title_others: "Пользователь %{username} ещё не проголосовал ни за одну тему"+ filters:+ votes:+ title: "Голосов"+ help: "Темы с наибольшим количеством голосов"+ my_votes:+ title: "Мои голоса"+ help: "Темы, в которых вы проголосовали"+ search:+ most_votes: "Большинство голосов"+ advanced:+ vote:+ count:+ label: "Минимальное количество голосов"+ admin:+ web_hooks:+ voting_event:+ group_name: "Событие голосования по теме"+ topic_upvote: "Когда пользователь голосует за тему"+ topic_unvote: "Когда пользователь отменяет голосование по теме"diff --git a/plugins/discourse-topic-voting/config/locales/client.sk.yml b/plugins/discourse-topic-voting/config/locales/client.sk.ymlnew file mode 100644index 00000000000..55e83c104b4--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.sk.yml@@ -0,0 +1,26 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sk:+ js:+ category:+ sort_options:+ votes: "Hlasy"+ topic_voting:+ vote_title: "Hlas"+ vote_title_plural: "Hlasy"+ voted_title: "Odhlasované"+ voting_closed_title: "Hlasovanie ukončené"+ voting_limit: "Limit"+ anonymous_button:+ one: "Hlas"+ few: "Hlasy"+ many: "Hlasy"+ other: "Hlasy"+ remove_vote: "Odstrániť hlas"+ filters:+ votes:+ title: "Hlasy"diff --git a/plugins/discourse-topic-voting/config/locales/client.sl.yml b/plugins/discourse-topic-voting/config/locales/client.sl.ymlnew file mode 100644index 00000000000..bc1814fc8f4--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.sl.yml@@ -0,0 +1,32 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sl:+ js:+ category:+ sort_options:+ votes: "Glasov"+ topic_voting:+ reached_limit: "Nimate več glasov, odstranite obstoječega!"+ list_votes: "Prikaži moje glasove"+ votes_nav_help: "teme z največ glasovi"+ voted: "Glasovali ste v tej temi"+ allow_topic_voting: "Dovolite uporabnikom, da glasujejo o temah v tej kategoriji"+ vote_title: "Glasuj"+ vote_title_plural: "Glasovi"+ voted_title: "Glasovano"+ voting_closed_title: "Zaprta"+ voting_limit: "Omejitev"+ anonymous_button:+ one: "Glas"+ two: "Glasova"+ few: "Glasovi"+ other: "Glasovi"+ remove_vote: "Odstrani glas"+ filters:+ votes:+ title: "Glasovi"+ help: "teme z največ glasovi"diff --git a/plugins/discourse-topic-voting/config/locales/client.sq.yml b/plugins/discourse-topic-voting/config/locales/client.sq.ymlnew file mode 100644index 00000000000..5590dd8c35d--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.sq.yml@@ -0,0 +1,10 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sq:+ js:+ topic_voting:+ vote_title: "Voto"diff --git a/plugins/discourse-topic-voting/config/locales/client.sr.yml b/plugins/discourse-topic-voting/config/locales/client.sr.ymlnew file mode 100644index 00000000000..88d63d6ae1a--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.sr.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sr:diff --git a/plugins/discourse-topic-voting/config/locales/client.sv.yml b/plugins/discourse-topic-voting/config/locales/client.sv.ymlnew file mode 100644index 00000000000..32aff708a0d--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.sv.yml@@ -0,0 +1,50 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sv:+ js:+ category:+ sort_options:+ votes: "Röster"+ topic_voting:+ reached_limit: "Du har inga fler röster, ta bort en befintlig röst!"+ list_votes: "Visa en lista över dina röster"+ votes_nav_help: "ämnen med de flesta rösterna"+ voted: "Du röstade i detta ämne"+ allow_topic_voting: "Låt användare rösta om ämnen i denna kategori"+ vote_title: "Röst"+ vote_title_plural: "Röster"+ voted_title: "Röstade"+ voting_closed_title: "Stängd"+ voting_limit: "Begränsa"+ votes_left:+ one: "Du har %{count} röst kvar, se <a href='%{path}'>dina röster</a>."+ other: "Du har %{count} röster kvar, se <a href='%{path}'>dina röster</a>."+ votes_left_button_title:+ one: "Du har %{count} röst kvar."+ other: "Du har %{count} röster kvar."+ votes:+ one: "%{count} röst"+ other: "%{count} röster"+ anonymous_button:+ one: "Röst"+ other: "Röster"+ remove_vote: "Ta bort röst"+ no_votes_title_self: "Du har inte röstat på något ämne ännu"+ no_votes_title_others: "%{username} har inte röstat på något ämne ännu"+ filters:+ votes:+ title: "Röster"+ help: "ämnen med de flesta rösterna"+ my_votes:+ title: "Mina röster"+ help: "ämnen du röstade i"+ search:+ most_votes: "Flest röster"+ advanced:+ vote:+ count:+ label: "Minsta röstantal"diff --git a/plugins/discourse-topic-voting/config/locales/client.sw.yml b/plugins/discourse-topic-voting/config/locales/client.sw.ymlnew file mode 100644index 00000000000..c68a42fa209--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.sw.yml@@ -0,0 +1,29 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sw:+ js:+ category:+ sort_options:+ votes: "Kura"+ topic_voting:+ reached_limit: "Umetumia kura zako zote, toa kura moja uliyoitumia!"+ list_votes: "Orodha ya kura zako"+ votes_nav_help: "Mada zenye kura nyingi zaidi"+ voted: "Uliipigia kura hii mada"+ allow_topic_voting: "Ruhusu watumiaji wapige kura kwenye hiki kikundi"+ vote_title: "Piga kura"+ vote_title_plural: "Kura"+ voted_title: "Alio/Waliopiga Kura"+ voting_closed_title: "Imefungwa"+ voting_limit: "Kikomo"+ anonymous_button:+ one: "Piga kura"+ other: "Kura"+ filters:+ votes:+ title: "Kura"+ help: "Mada zenye kura nyingi zaidi"diff --git a/plugins/discourse-topic-voting/config/locales/client.te.yml b/plugins/discourse-topic-voting/config/locales/client.te.ymlnew file mode 100644index 00000000000..a845de46adb--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.te.yml@@ -0,0 +1,11 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++te:+ js:+ topic_voting:+ vote_title: "వోటు"+ voting_closed_title: "మూసివేయబడినవి"diff --git a/plugins/discourse-topic-voting/config/locales/client.th.yml b/plugins/discourse-topic-voting/config/locales/client.th.ymlnew file mode 100644index 00000000000..e53452ca724--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.th.yml@@ -0,0 +1,20 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++th:+ js:+ category:+ sort_options:+ votes: "โหวต"+ topic_voting:+ reached_limit: "คุณใช้คะแนนโหวตหมดแล้ว ลบอันที่โหวตไปแล้วออกก่อน"+ vote_title_plural: "โหวต"+ voting_closed_title: "ปิด"+ anonymous_button:+ other: "โหวต"+ filters:+ votes:+ title: "โหวต"diff --git a/plugins/discourse-topic-voting/config/locales/client.tr_TR.yml b/plugins/discourse-topic-voting/config/locales/client.tr_TR.ymlnew file mode 100644index 00000000000..520ed6ba44d--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.tr_TR.yml@@ -0,0 +1,57 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++tr_TR:+ js:+ category:+ sort_options:+ votes: "Oylar"+ topic_voting:+ title: "Konu Oylama"+ reached_limit: "Oy hakkınız kalmadı, mevcut bir oyunuzu kaldırın!"+ list_votes: "Oylarınızı listeleyin"+ votes_nav_help: "en çok oy alan konular"+ voted: "Bu konuyu oyladınız"+ allow_topic_voting: "Kullanıcıların bu kategorideki konularda oy kullanmasına izin verilsin mi?"+ vote_title: "Oyla"+ vote_title_plural: "Oylar"+ voted_title: "Oylandı"+ voting_closed_title: "Kapalı"+ voting_limit: "Sınır"+ votes_left:+ one: "%{count} oyunuz kaldı, <a href='%{path}'>oylarınıza</a> bakın."+ other: "%{count} oyunuz kaldı, <a href='%{path}'>oylarınıza</a> bakın."+ votes_left_button_title:+ one: "%{count} oyunuz kaldı."+ other: "%{count} oyunuz kaldı."+ votes:+ one: "%{count} oy"+ other: "%{count} oy"+ anonymous_button:+ one: "Oy"+ other: "Oy"+ remove_vote: "Oyu kaldır"+ no_votes_title_self: "Henüz herhangi bir konu için oy kullanmadınız"+ no_votes_title_others: "%{username} henüz herhangi bir konu için oy kullanmadı"+ filters:+ votes:+ title: "Oylar"+ help: "en çok oy alan konular"+ my_votes:+ title: "Oylarım"+ help: "oy verdiğiniz konular"+ search:+ most_votes: "En Çok Oy"+ advanced:+ vote:+ count:+ label: "En Düşük Oy Sayısı"+ admin:+ web_hooks:+ voting_event:+ group_name: "Konu Oylama Etkinliği"+ topic_upvote: "Bir kullanıcı bir konuya oy verdiğinde"+ topic_unvote: "Bir kullanıcı bir konuya ilişkin oyu iptal ettiğinde"diff --git a/plugins/discourse-topic-voting/config/locales/client.ug.yml b/plugins/discourse-topic-voting/config/locales/client.ug.ymlnew file mode 100644index 00000000000..8b46f7c926b--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.ug.yml@@ -0,0 +1,11 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ug:+ js:+ topic_voting:+ vote_title: "بېلەت تاشلاش"+ voting_closed_title: "تاقالدى"diff --git a/plugins/discourse-topic-voting/config/locales/client.uk.yml b/plugins/discourse-topic-voting/config/locales/client.uk.ymlnew file mode 100644index 00000000000..2cdd8222a80--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.uk.yml@@ -0,0 +1,32 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++uk:+ js:+ category:+ sort_options:+ votes: "Голосів"+ topic_voting:+ reached_limit: "У вас немає голосів, видаліть існуюче голосування!"+ list_votes: "Список своїх голосів"+ votes_nav_help: "теми з найбільшою кількістю голосів"+ voted: "Ви проголосували в цій темі"+ allow_topic_voting: "Дозволити користувачам голосувати в темах цієї категорії"+ vote_title: "Проголосувати"+ vote_title_plural: "Голосів"+ voted_title: "Проголосували"+ voting_closed_title: "Закриті"+ voting_limit: "Обмеження"+ anonymous_button:+ one: "Голосувати"+ few: "Голосів"+ many: "Голосів"+ other: "Голосів"+ remove_vote: "Вилучити голос"+ filters:+ votes:+ title: "Голосів"+ help: "теми з найбільшою кількістю голосів"diff --git a/plugins/discourse-topic-voting/config/locales/client.ur.yml b/plugins/discourse-topic-voting/config/locales/client.ur.ymlnew file mode 100644index 00000000000..182c18cc6e1--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.ur.yml@@ -0,0 +1,30 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ur:+ js:+ category:+ sort_options:+ votes: "ووٹ"+ topic_voting:+ reached_limit: "آپ کے ووٹ ختم ہو چکے ہیں، کسی موجودہ ووٹ کو ہٹا ئیں!"+ list_votes: "اپنے ووٹوں کی فہرست"+ votes_nav_help: "سب سے زیادہ ووٹوں والے ٹاپک"+ voted: "آپ نے اِس ٹاپک پر ووٹ کیا"+ allow_topic_voting: "صارفین کو اس زمرہ کے ٹاپکس پر ووٹ کرنے کی اجازت دیں"+ vote_title: "ووٹ"+ vote_title_plural: "ووٹ"+ voted_title: "ووٹ کیا"+ voting_closed_title: "بند"+ voting_limit: "حد"+ anonymous_button:+ one: "ووٹ"+ other: "ووٹ"+ remove_vote: "ووٹ ہٹا دیں"+ filters:+ votes:+ title: "ووٹ"+ help: "سب سے زیادہ ووٹوں والے ٹاپک"diff --git a/plugins/discourse-topic-voting/config/locales/client.vi.yml b/plugins/discourse-topic-voting/config/locales/client.vi.ymlnew file mode 100644index 00000000000..0d7097ed87e--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.vi.yml@@ -0,0 +1,44 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++vi:+ js:+ category:+ sort_options:+ votes: "Bình chọn"+ topic_voting:+ reached_limit: "Bạn đã hết lượt bình chọn, hãy xóa lượt đang có của bạn"+ list_votes: "Liệt kê bình chọn của bạn"+ votes_nav_help: "chủ đề có nhiều bình chọn nhất"+ voted: "Bạn đã bình chọn cho chủ đề này"+ allow_topic_voting: "Cho phép người dùng bình chọn chủ đề trong chuyên mục này"+ vote_title: "Bình chọn"+ vote_title_plural: "Bình chọn"+ voted_title: "Đã bình ch"+ voting_closed_title: "Đã "+ voting_limit: "Giới h"+ votes_left:+ other: "Bạn còn %{count} phiếu bầu, xem <a=href='%{path}'>phiếu bầu của bạn</a>"+ votes_left_button_title:+ other: "Bạn còn %{count} phiếu bầu"+ votes:+ other: "%{count} phiếu bầu"+ anonymous_button:+ other: "Phiếu"+ remove_vote: "Xoá Bình Chọn<br>"+ filters:+ votes:+ title: "Bình chọn"+ help: "chủ đề có nhiều bình chọn nhất"+ my_votes:+ title: "Phiếu của tôi"+ help: "Những chủ đề bạn đã bình chọn"+ search:+ most_votes: "Bình chọn nhiều nhất"+ advanced:+ vote:+ count:+ label: "Điểm bình chọn ít nhất"diff --git a/plugins/discourse-topic-voting/config/locales/client.zh_CN.yml b/plugins/discourse-topic-voting/config/locales/client.zh_CN.ymlnew file mode 100644index 00000000000..759c7514ae0--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.zh_CN.yml@@ -0,0 +1,53 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++zh_CN:+ js:+ category:+ sort_options:+ votes: "投票"+ topic_voting:+ title: "话题投票"+ reached_limit: "您无法再投票了,请移除现有投票!"+ list_votes: "列出您的投票"+ votes_nav_help: "得票最多的话题"+ voted: "您已经为为话题投过票了"+ allow_topic_voting: "允许用户为此类别中的话题投票"+ vote_title: "投票"+ vote_title_plural: "投票"+ voted_title: "已投票"+ voting_closed_title: "已关闭"+ voting_limit: "限制"+ votes_left:+ other: "您还有 %{count} 次投票机会,查看<a href='%{path}'>您的投票</a>。"+ votes_left_button_title:+ other: "您还有 %{count} 次投票机会。"+ votes:+ other: "%{count} 票"+ anonymous_button:+ other: "投票"+ remove_vote: "移除投票"+ no_votes_title_self: "您还没有为任何话题投票"+ no_votes_title_others: "%{username} 还没有为任何话题投票"+ filters:+ votes:+ title: "投票"+ help: "得票最多的话题"+ my_votes:+ title: "我的投票"+ help: "您投过票的话题"+ search:+ most_votes: "票数最多"+ advanced:+ vote:+ count:+ label: "最小投票数"+ admin:+ web_hooks:+ voting_event:+ group_name: "话题投票事件"+ topic_upvote: "当用户对某个话题投票时"+ topic_unvote: "当用户对某个话题取消投票时"diff --git a/plugins/discourse-topic-voting/config/locales/client.zh_TW.yml b/plugins/discourse-topic-voting/config/locales/client.zh_TW.ymlnew file mode 100644index 00000000000..7c9e9514b3f--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/client.zh_TW.yml@@ -0,0 +1,47 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++zh_TW:+ js:+ category:+ sort_options:+ votes: "票數"+ topic_voting:+ title: "主題投票"+ reached_limit: "您已退出投票,移除現有的投票!"+ list_votes: "列出您的投票"+ votes_nav_help: "最多票數的主題"+ voted: "您已在此主題投票過了"+ allow_topic_voting: "讓使用者可以在這個分類中的主題裡投票"+ vote_title: "投票"+ vote_title_plural: "票數"+ voted_title: "已投票"+ voting_closed_title: "已關閉"+ voting_limit: "限制"+ votes_left:+ other: "您還剩 %{count} 票,請至<a href='%{path}'> 查看您的投票</a>。"+ votes_left_button_title:+ other: "您還有 %{count} 票可投。"+ votes:+ other: "%{count} 票"+ anonymous_button:+ other: "票數"+ remove_vote: "移除投票"+ no_votes_title_self: "您還沒有投票給任何話題"+ no_votes_title_others: "%{username} 還沒有投票給任何話題"+ filters:+ votes:+ title: "票數"+ help: "最多票數的主題"+ my_votes:+ title: "我的投票"+ help: "您投過票的主題"+ search:+ most_votes: "票數最多"+ advanced:+ vote:+ count:+ label: "最低投票數"diff --git a/plugins/discourse-topic-voting/config/locales/server.ar.yml b/plugins/discourse-topic-voting/config/locales/server.ar.ymlnew file mode 100644index 00000000000..a1cbd861444--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.ar.yml@@ -0,0 +1,32 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ar:+ site_settings:+ topic_voting_enabled: 'هل تريد السماح للأعضاء بالتصويت على الموضوعات؟'+ topic_voting_tl0_vote_limit: 'ما عدد الأصوات النشطة المسموح بها للمستخدمين من مستوى الثقة 0؟'+ topic_voting_tl1_vote_limit: 'ما عدد الأصوات النشطة المسموح بها للمستخدمين من مستوى الثقة 1؟'+ topic_voting_tl2_vote_limit: 'ما عدد الأصوات النشطة المسموح بها للمستخدمين من مستوى الثقة 2؟'+ topic_voting_tl3_vote_limit: 'ما عدد الأصوات النشطة المسموح بها للمستخدمين من مستوى الثقة 3؟'+ topic_voting_tl4_vote_limit: 'ما عدد الأصوات النشطة المسموح بها للمستخدمين من مستوى الثقة 4؟'+ topic_voting_show_who_voted: 'هل تريد السماح للأعضاء برؤية من صوَّتوا؟'+ topic_voting_show_votes_on_profile: 'هل تريد السماح للأعضاء برؤية أصواتهم في موجز النشاط؟'+ topic_voting_alert_votes_left: 'تنبيه المستخدم عندما يتبقى هذا العدد من الأصوات'+ topic_voting:+ votes_moved:+ zero: "تم نقل %{count} صوت."+ one: "تم نقل صوت واحد."+ two: "تم نقل صوتين (%{count})."+ few: "تم نقل %{count} أصوات."+ many: "تم نقل %{count} صوتًا."+ other: "تم نقل %{count} صوت."+ duplicated_votes:+ zero: "تعذَّر نقل %{count} صوت لأن المستخدم قد صوَّت بالفعل في موضوع آخر."+ one: "تعذَّر نقل صوت واحد (%{count}) لأن المستخدم قد صوَّت بالفعل في موضوع آخر."+ two: "تعذَّر نقل صوتين (%{count}) لأن المستخدم قد صوَّت بالفعل في موضوع آخر."+ few: "تعذَّر نقل %{count} أصوات لأن المستخدم قد صوَّت بالفعل في موضوع آخر."+ many: "تعذَّر نقل %{count} صوتًا لأن المستخدم قد صوَّت بالفعل في موضوع آخر."+ other: "تعذَّر نقل %{count} صوت لأن المستخدم قد صوَّت بالفعل في موضوع آخر."diff --git a/plugins/discourse-topic-voting/config/locales/server.be.yml b/plugins/discourse-topic-voting/config/locales/server.be.ymlnew file mode 100644index 00000000000..2ea77a0d350--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.be.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++be:diff --git a/plugins/discourse-topic-voting/config/locales/server.bg.yml b/plugins/discourse-topic-voting/config/locales/server.bg.ymlnew file mode 100644index 00000000000..cf0a9df05a2--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.bg.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++bg:+ site_settings:+ topic_voting_enabled: 'Да се разреши ли на потребителите да гласуват по теми?'+ topic_voting_tl0_vote_limit: 'Колко активни гласа са позволени на потребителите на TL0?'+ topic_voting_tl1_vote_limit: 'Колко активни гласа са позволени на потребителите на TL1?'+ topic_voting_tl2_vote_limit: 'Колко активни гласа са позволени на потребителите на TL2?'+ topic_voting_tl3_vote_limit: 'Колко активни гласа са позволени на потребителите на TL3?'+ topic_voting_tl4_vote_limit: 'Колко активни гласа са позволени на потребителите на TL4?'+ topic_voting_show_who_voted: 'Позволяване ли на потребителите да видят кой е гласувал?'+ topic_voting_show_votes_on_profile: 'Позволяване на потребителите да виждат своите гласове в потока на активността си?'+ topic_voting_alert_votes_left: 'Уведомете потребителя, когато останат толкова гласове'+ topic_voting:+ votes_moved:+ one: "Един глас беше преместен."+ other: "%{count} гласа бяха преместени."+ duplicated_votes:+ one: "Гласуване не може да бъде преместено, защото потребителят вече е гласувал в друга тема."+ other: "%{count} гласовете не могат да бъдат преместени, тъй като техните потребители вече са гласували в другата тема."diff --git a/plugins/discourse-topic-voting/config/locales/server.bs_BA.yml b/plugins/discourse-topic-voting/config/locales/server.bs_BA.ymlnew file mode 100644index 00000000000..4c66135b32b--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.bs_BA.yml@@ -0,0 +1,26 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++bs_BA:+ site_settings:+ topic_voting_enabled: 'Dozvoli korisnicima da glasaju u temama?'+ topic_voting_tl0_vote_limit: 'Koliko aktivnih glasova je dozvoljeno korisnicima sa nivoom povjerenja 0?'+ topic_voting_tl1_vote_limit: 'Koliko aktivnih glasova je dozvoljeno korisnicima sa nivoom povjerenja 1?'+ topic_voting_tl2_vote_limit: 'Koliko aktivnih glasova je dozvoljeno korisnicima sa nivoom povjerenja 2?'+ topic_voting_tl3_vote_limit: 'Koliko aktivnih glasova je dozvoljeno korisnicima sa nivoom povjerenja 3?'+ topic_voting_tl4_vote_limit: 'Koliko aktivnih glasova je dozvoljeno korisnicima sa nivoom povjerenja 4?'+ topic_voting_show_who_voted: 'Dozvoli korisnicima da vide ko je glasao?'+ topic_voting_show_votes_on_profile: 'Dozvoli korisnicima da vide svoje glasove u svojem pregledu aktivnosti?'+ topic_voting_alert_votes_left: 'Upozorite korisnike kada do naksimalnog broja glasova ostano još'+ topic_voting:+ votes_moved:+ one: "Glas je maknut."+ few: "%{count} glasa je maknuto."+ other: "%{count} glasova je maknuto."+ duplicated_votes:+ one: "Glas nije mogao biti maknut jer njihovi korisnici su već glasali u drugoj temi."+ few: "%{count} glasa nije moglo biti maknuto jer njihovi korisnici su već glasali u drugoj temi."+ other: "%{count} glasova nije moglo biti maknuto jer njihovi korisnici su već glasali u drugoj temi."diff --git a/plugins/discourse-topic-voting/config/locales/server.ca.yml b/plugins/discourse-topic-voting/config/locales/server.ca.ymlnew file mode 100644index 00000000000..5f558463953--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.ca.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ca:+ site_settings:+ topic_voting_enabled: 'Voleu permetre als usuaris votar sobre temes?'+ topic_voting_tl0_vote_limit: 'Quants vots actius són permesos als usuaris del nivell de confiança 0?'+ topic_voting_tl1_vote_limit: 'Quants vots actius són permesos als usuaris del nivell de confiança 1?'+ topic_voting_tl2_vote_limit: 'Quants vots actius són permesos als usuaris del nivell de confiança 2?'+ topic_voting_tl3_vote_limit: 'Quants vots actius són permesos als usuaris del nivell de confiança 3?'+ topic_voting_tl4_vote_limit: 'Quants vots actius són permesos als usuaris del nivell de confiança 4?'+ topic_voting_show_who_voted: 'Voleu permetre que els usuaris vegin qui ha votat?'+ topic_voting_show_votes_on_profile: 'Voleu permetre als usuaris veure els seus vots en el seu canal d''activitat?'+ topic_voting_alert_votes_left: 'Alerta l''usuari quan quedi aquesta quantitat de vots'+ topic_voting:+ votes_moved:+ one: "S'ha mogut un vot"+ other: "S'han mogut %{count} vots."+ duplicated_votes:+ one: "No s'han pogut moure un vot perquè l'usuari ja ha votat en l'altre tema."+ other: "No s'han pogut moure %{count} vots perquè els usuaris ja han votat en l'altre tema."diff --git a/plugins/discourse-topic-voting/config/locales/server.cs.yml b/plugins/discourse-topic-voting/config/locales/server.cs.ymlnew file mode 100644index 00000000000..dd77359fa17--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.cs.yml@@ -0,0 +1,28 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++cs:+ site_settings:+ topic_voting_enabled: 'Povolit uživatelům hlasovat o tématech?'+ topic_voting_tl0_vote_limit: 'Kolik aktivních hlasů povolit TL0 uživatelům?'+ topic_voting_tl1_vote_limit: 'Kolik aktivních hlasů povolit TL1 uživatelům?'+ topic_voting_tl2_vote_limit: 'Kolik aktivních hlasů povolit TL2 uživatelům?'+ topic_voting_tl3_vote_limit: 'Kolik aktivních hlasů povolit TL3 uživatelům?'+ topic_voting_tl4_vote_limit: 'Kolik aktivních hlasů povolit TL4 uživatelům?'+ topic_voting_show_who_voted: 'Povolit uživatelům zobrazit, kdo hlasoval?'+ topic_voting_show_votes_on_profile: 'Povolit uživatelům zobrazit jejich hlasování ve přehledu aktivit?'+ topic_voting_alert_votes_left: 'Upozornit uživatele, když mu zbývá tolik hlasů'+ topic_voting:+ votes_moved:+ one: "Hlas byl přesunut."+ few: "%{count} hlasy byly přesunuty."+ many: "%{count} hlasů byly přesunuto."+ other: "%{count} hlasů byly přesunuto."+ duplicated_votes:+ one: "Hlas nelze přesunout, protože uživatel již ve druhém tématu hlasoval."+ few: "%{count} hlasy nelze přesunout, protože uživatel již ve druhém tématu hlasoval."+ many: "%{count} hlasů nelze přesunout, protože uživatel již ve druhém tématu hlasoval."+ other: "%{count} hlasů nelze přesunout, protože uživatel již ve druhém tématu hlasoval."diff --git a/plugins/discourse-topic-voting/config/locales/server.da.yml b/plugins/discourse-topic-voting/config/locales/server.da.ymlnew file mode 100644index 00000000000..51054c45394--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.da.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++da:+ site_settings:+ topic_voting_enabled: 'Tillad brugere at stemme på emner?'+ topic_voting_tl0_vote_limit: 'Hvor mange aktive stemmer er TL0-brugere tilladt?'+ topic_voting_tl1_vote_limit: 'Hvor mange aktive stemmer er TL1-brugere tilladt?'+ topic_voting_tl2_vote_limit: 'Hvor mange aktive stemmer er TL2-brugere tilladt?'+ topic_voting_tl3_vote_limit: 'Hvor mange aktive stemmer er TL3-brugere tilladt?'+ topic_voting_tl4_vote_limit: 'Hvor mange aktive stemmer er TL4-brugere tilladt?'+ topic_voting_show_who_voted: 'Tillad brugere at se, hvem der har stemt?'+ topic_voting_show_votes_on_profile: 'Tillad brugere at se deres stemmer i deres aktivitetsfeed?'+ topic_voting_alert_votes_left: 'Advar bruger når så mange stemmer er tilbage'+ topic_voting:+ votes_moved:+ one: "En stemme er blevet flyttet."+ other: "%{count} stemmer er blevet flyttet."+ duplicated_votes:+ one: "En stemme kunne ikke flyttes fordi brugeren allerede stemte i det andet emne."+ other: "%{count} stemmer kunne ikke flyttes, fordi deres brugere allerede stemte i det andet emne."diff --git a/plugins/discourse-topic-voting/config/locales/server.de.yml b/plugins/discourse-topic-voting/config/locales/server.de.ymlnew file mode 100755index 00000000000..ce26ed2affa--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.de.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++de:+ site_settings:+ topic_voting_enabled: 'Benutzern erlauben, für Themen zu stimmen?'+ topic_voting_tl0_vote_limit: 'Wie viele aktive Stimmen sind für VS0-Benutzer erlaubt?'+ topic_voting_tl1_vote_limit: 'Wie viele aktive Stimmen sind für VS1-Benutzer erlaubt?'+ topic_voting_tl2_vote_limit: 'Wie viele aktive Stimmen sind für VS2-Benutzer erlaubt?'+ topic_voting_tl3_vote_limit: 'Wie viele aktive Stimmen sind für VS3-Benutzer erlaubt?'+ topic_voting_tl4_vote_limit: 'Wie viele aktive Stimmen sind für VS4-Benutzer erlaubt?'+ topic_voting_show_who_voted: 'Benutzern erlauben, zu sehen, wer abgestimmt hat?'+ topic_voting_show_votes_on_profile: 'Benutzern erlauben, ihre Stimmen in ihrem Aktivitätsfeed zu sehen?'+ topic_voting_alert_votes_left: 'Benutzer benachrichtigen, wenn so viele Stimmen übrig sind'+ topic_voting:+ votes_moved:+ one: "Eine Stimme wurde verschoben."+ other: "%{count} Stimmen wurden verschoben."+ duplicated_votes:+ one: "Eine Stimme konnte nicht verschoben werden, weil der Benutzer bereits in einem anderen Thema abgestimmt hat."+ other: "%{count} Stimmen konnten nicht verschoben werden, weil die Benutzer bereits in einem anderen Thema abgestimmt haben."diff --git a/plugins/discourse-topic-voting/config/locales/server.el.yml b/plugins/discourse-topic-voting/config/locales/server.el.ymlnew file mode 100644index 00000000000..f028eba7c19--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.el.yml@@ -0,0 +1,15 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++el:+ site_settings:+ topic_voting_enabled: 'Να επιτρέπεται σε χρήστες να ψηφίζουν σε νήματα;'+ topic_voting_tl0_vote_limit: 'Πόσες ενεργές ψήφοι επιτρέπονται σε χρήστες ΕΕ0;'+ topic_voting_tl1_vote_limit: 'Πόσες ενεργές ψήφοι επιτρέπονται σε χρήστες ΕΕ1;'+ topic_voting_tl2_vote_limit: 'Πόσες ενεργές ψήφοι επιτρέπονται σε χρήστες ΕΕ2;'+ topic_voting_tl3_vote_limit: 'Πόσες ενεργές ψήφοι επιτρέπονται σε χρήστες ΕΕ3;'+ topic_voting_tl4_vote_limit: 'Πόσες ενεργές ψήφοι επιτρέπονται σε χρήστες ΕΕ4;'+ topic_voting_show_who_voted: 'Να επιτρέπεται σε χρήστες να βλέπουν ποιός ψήφισε;'diff --git a/plugins/discourse-topic-voting/config/locales/server.en.yml b/plugins/discourse-topic-voting/config/locales/server.en.ymlnew file mode 100755index 00000000000..13a3be931d3--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.en.yml@@ -0,0 +1,18 @@+en:+ site_settings:+ topic_voting_enabled: 'Allow users to vote on topics?'+ topic_voting_tl0_vote_limit: 'How many active votes are TL0 users allowed?'+ topic_voting_tl1_vote_limit: 'How many active votes are TL1 users allowed?'+ topic_voting_tl2_vote_limit: 'How many active votes are TL2 users allowed?'+ topic_voting_tl3_vote_limit: 'How many active votes are TL3 users allowed?'+ topic_voting_tl4_vote_limit: 'How many active votes are TL4 users allowed?'+ topic_voting_show_who_voted: 'Allow users to see who voted?'+ topic_voting_show_votes_on_profile: 'Allow users to see their votes in their activity feed?'+ topic_voting_alert_votes_left: 'Alert user when this many votes are left'+ topic_voting:+ votes_moved:+ one: "A vote has been moved."+ other: "%{count} votes have been moved."+ duplicated_votes:+ one: "A vote could not be moved because the user already voted in the other topic."+ other: "%{count} votes could not be moved because their users already voted in the other topic."diff --git a/plugins/discourse-topic-voting/config/locales/server.en_GB.yml b/plugins/discourse-topic-voting/config/locales/server.en_GB.ymlnew file mode 100644index 00000000000..bce4f669f50--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.en_GB.yml@@ -0,0 +1,17 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++en_GB:+ site_settings:+ topic_voting_enabled: 'Allow users to vote on topics?'+ topic_voting_tl0_vote_limit: 'How many active votes are TL0 users allowed?'+ topic_voting_tl1_vote_limit: 'How many active votes are TL1 users allowed?'+ topic_voting_tl2_vote_limit: 'How many active votes are TL2 users allowed?'+ topic_voting_tl3_vote_limit: 'How many active votes are TL3 users allowed?'+ topic_voting_tl4_vote_limit: 'How many active votes are TL4 users allowed?'+ topic_voting_show_who_voted: 'Allow users to see who voted?'+ topic_voting_show_votes_on_profile: 'Allow users to see their votes in their activity feed?'+ topic_voting_alert_votes_left: 'Alert user when this many votes are left'diff --git a/plugins/discourse-topic-voting/config/locales/server.es.yml b/plugins/discourse-topic-voting/config/locales/server.es.ymlnew file mode 100644index 00000000000..7f4e184ca19--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.es.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++es:+ site_settings:+ topic_voting_enabled: '¿Permitir a los usuarios votar sobre temas?'+ topic_voting_tl0_vote_limit: '¿Cuántos votos activos tienen permitidos los usuarios de NC0?'+ topic_voting_tl1_vote_limit: '¿Cuántos votos activos tienen permitidos los usuarios de NC1?'+ topic_voting_tl2_vote_limit: '¿Cuántos votos activos tienen permitidos los usuarios de NC2?'+ topic_voting_tl3_vote_limit: '¿Cuántos votos activos tienen permitidos los usuarios de NC3?'+ topic_voting_tl4_vote_limit: '¿Cuántos votos activos tienen permitidos los usuarios de NC4?'+ topic_voting_show_who_voted: '¿Permitir a los usuarios ver quién votó?'+ topic_voting_show_votes_on_profile: '¿Permitir a los usuarios ver sus votos en su feed de actividad?'+ topic_voting_alert_votes_left: 'Alertar al usuario cuando queda esta cantidad de votos'+ topic_voting:+ votes_moved:+ one: "Se ha movido un voto."+ other: "Se han movido %{count} votos."+ duplicated_votes:+ one: "No se pudo mover un voto porque el usuario ya votó en el otro tema."+ other: "No se pudieron mover %{count} votos porque los usuarios ya votaron en el otro tema."diff --git a/plugins/discourse-topic-voting/config/locales/server.et.yml b/plugins/discourse-topic-voting/config/locales/server.et.ymlnew file mode 100644index 00000000000..13f18c2a4c8--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.et.yml@@ -0,0 +1,12 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++et:+ site_settings:+ topic_voting_enabled: 'Lubada kasutajatel teemasid hinnata?'+ topic_voting_show_who_voted: 'Kas lubada kasutajatel näha, kes hindas?'+ topic_voting_show_votes_on_profile: 'Kas lubada kasutajatel näha oma hinnanguid tegevusvoos?'+ topic_voting_alert_votes_left: 'Teavita kasutajate, kui palju hinnangu andmisi tal veel järgi on'diff --git a/plugins/discourse-topic-voting/config/locales/server.fa_IR.yml b/plugins/discourse-topic-voting/config/locales/server.fa_IR.ymlnew file mode 100644index 00000000000..cc39aed7d21--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.fa_IR.yml@@ -0,0 +1,9 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++fa_IR:+ site_settings:+ topic_voting_enabled: 'به کاربران اجازه رأی در نظرسنجی موضوعات داده شود؟'diff --git a/plugins/discourse-topic-voting/config/locales/server.fi.yml b/plugins/discourse-topic-voting/config/locales/server.fi.ymlnew file mode 100644index 00000000000..3d7b9023f72--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.fi.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++fi:+ site_settings:+ topic_voting_enabled: 'Sallitaanko käyttäjien antaa ääniä ketjuille?'+ topic_voting_tl0_vote_limit: 'Kuinka monta aktiivista ääntä lt0-käyttäjällä voi olla?'+ topic_voting_tl1_vote_limit: 'Kuinka monta aktiivista ääntä lt1-käyttäjällä voi olla?'+ topic_voting_tl2_vote_limit: 'Kuinka monta aktiivista ääntä lt2-käyttäjällä voi olla?'+ topic_voting_tl3_vote_limit: 'Kuinka monta aktiivista ääntä lt3-käyttäjällä voi olla?'+ topic_voting_tl4_vote_limit: 'Kuinka monta aktiivista ääntä lt4-käyttäjällä voi olla?'+ topic_voting_show_who_voted: 'Sallitaanko käyttäjien nähdä, ketkä ovat äänestäneet?'+ topic_voting_show_votes_on_profile: 'Sallitaanko käyttäjien nähdä äänensä toimintasyötteessä?'+ topic_voting_alert_votes_left: 'Ilmoita käyttäjälle, kun näin monta ääntä on jäljellä'+ topic_voting:+ votes_moved:+ one: "Ääni siirrettiin."+ other: "%{count} ääntä siirrettiin."+ duplicated_votes:+ one: "Ääntä ei voitu siirtää, koska käyttäjä on jo äänestänyt toisessa ketjussa."+ other: "%{count} ääntä ei voitu siirtää, koska ne antaneet käyttäjät ovat jo äänestäneet toisessa ketjussa."diff --git a/plugins/discourse-topic-voting/config/locales/server.fr.yml b/plugins/discourse-topic-voting/config/locales/server.fr.ymlnew file mode 100644index 00000000000..5c2ea504ab1--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.fr.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++fr:+ site_settings:+ topic_voting_enabled: 'Autoriser les utilisateurs à voter pour les sujets ?'+ topic_voting_tl0_vote_limit: 'À combien de votes les utilisateurs de niveau de confiance 0 ont-ils droit ?'+ topic_voting_tl1_vote_limit: 'À combien de votes les utilisateurs de niveau de confiance 1 ont-ils droit ?'+ topic_voting_tl2_vote_limit: 'À combien de votes les utilisateurs de niveau de confiance 2 ont-ils droit ?'+ topic_voting_tl3_vote_limit: 'À combien de votes les utilisateurs de niveau de confiance 3 ont-ils droit ?'+ topic_voting_tl4_vote_limit: 'À combien de votes les utilisateurs de niveau de confiance 4 ont-ils droit ?'+ topic_voting_show_who_voted: 'Permettre aux utilisateurs de voir qui a voté ?'+ topic_voting_show_votes_on_profile: 'Permettre aux utilisateurs de voir leurs votes dans leur flux d''activité ?'+ topic_voting_alert_votes_left: 'Avertir l''utilisateur quand il lui reste ce nombre de votes'+ topic_voting:+ votes_moved:+ one: "Un vote a été déplacé."+ other: "%{count} votes ont été déplacés."+ duplicated_votes:+ one: "Un vote n'a pas pu être déplacé, car l'utilisateur a déjà voté dans l'autre sujet."+ other: "%{count} votes n'ont pas pu être déplacés, car leurs utilisateurs ont déjà voté dans l'autre sujet."diff --git a/plugins/discourse-topic-voting/config/locales/server.gl.yml b/plugins/discourse-topic-voting/config/locales/server.gl.ymlnew file mode 100644index 00000000000..fb911ce1635--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.gl.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++gl:diff --git a/plugins/discourse-topic-voting/config/locales/server.he.yml b/plugins/discourse-topic-voting/config/locales/server.he.ymlnew file mode 100644index 00000000000..c18ff76ba4c--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.he.yml@@ -0,0 +1,28 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++he:+ site_settings:+ topic_voting_enabled: 'לאפשר למשתמשים להצביע על נושאים?'+ topic_voting_tl0_vote_limit: 'כמה הצבעות פעילות מותר למשתמשי רמת אמון 0 לבצע?'+ topic_voting_tl1_vote_limit: 'כמה הצבעות פעילות מותר למשתמשי רמת אמון 1 לבצע?'+ topic_voting_tl2_vote_limit: 'כמה הצבעות פעילות מותר למשתמשי רמת אמון 2 לבצע?'+ topic_voting_tl3_vote_limit: 'כמה הצבעות פעילות מותר למשתמשי רמת אמון 3 לבצע?'+ topic_voting_tl4_vote_limit: 'כמה הצבעות פעילות מותר למשתמשי רמת אמון 4 לבצע?'+ topic_voting_show_who_voted: 'לאפשר למשתמשים לראות מי הצביע?'+ topic_voting_show_votes_on_profile: 'לאפשר למשתמשים לראות את ההצבעות שלהם בהזנת הפעילות?'+ topic_voting_alert_votes_left: 'להודיע למשתמש כאשר נותרו לו מספר מסוים של הצבעות'+ topic_voting:+ votes_moved:+ one: "הצבעה הועברה."+ two: "%{count} הצבעות הועברו."+ many: "%{count} הצבעות הועברו."+ other: "%{count} הצבעות הועברו."+ duplicated_votes:+ one: "לא ניתן להעביר הצבעה כיוון שהמשתמש שהצביע כבר הצביע בנושא השני."+ two: "לא ניתן להעביר %{count} הצבעות כיוון שהמשתמשים שהצביעו כבר הצביעו בנושא השני."+ many: "לא ניתן להעביר %{count} הצבעות כיוון שהמשתמשים שהצביעו כבר הצביעו בנושא השני."+ other: "לא ניתן להעביר %{count} הצבעות כיוון שהמשתמשים שהצביעו כבר הצביעו בנושא השני."diff --git a/plugins/discourse-topic-voting/config/locales/server.hr.yml b/plugins/discourse-topic-voting/config/locales/server.hr.ymlnew file mode 100644index 00000000000..762b72ddbdf--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.hr.yml@@ -0,0 +1,17 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++hr:+ site_settings:+ topic_voting_enabled: 'Dopusti korisnicima da glasaju na temama?'+ topic_voting_tl0_vote_limit: 'Koliko aktivnih glasova je dopušteno TL0 korisnicima?'+ topic_voting_tl1_vote_limit: 'Koliko aktivnih glasova je dopušteno TL1 korisnicima?'+ topic_voting_tl2_vote_limit: 'Koliko aktivnih glasova je dopušteno TL2 korisnicima?'+ topic_voting_tl3_vote_limit: 'Koliko aktivnih glasova je dopušteno TL3 korisnicima?'+ topic_voting_tl4_vote_limit: 'Koliko aktivnih glasova je dopušteno TL4 korisnicima?'+ topic_voting_show_who_voted: 'Dopusti korisnicima da vide tko je glasao?'+ topic_voting_show_votes_on_profile: 'Dopusti korisnicima da vide svoje glasove u njihovim listama aktivnosti?'+ topic_voting_alert_votes_left: 'Obavijesti korisnika kada je preostalo ovoliko glasova'diff --git a/plugins/discourse-topic-voting/config/locales/server.hu.yml b/plugins/discourse-topic-voting/config/locales/server.hu.ymlnew file mode 100644index 00000000000..84885ffb557--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.hu.yml@@ -0,0 +1,17 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++hu:+ site_settings:+ topic_voting_enabled: 'Lehetővé teszi a felhasználók számára, hogy szavazzanak témákról?'+ topic_voting_tl0_vote_limit: 'Hány aktív szavazat megengedett a TL0 felhasználók számára?'+ topic_voting_tl1_vote_limit: 'Hány aktív szavazat megengedett a TL1 felhasználók számára?'+ topic_voting_tl2_vote_limit: 'Hány aktív szavazat megengedett a TL2 felhasználók számára?'+ topic_voting_tl3_vote_limit: 'Hány aktív szavazat megengedett a TL3 felhasználók számára?'+ topic_voting_tl4_vote_limit: 'Hány aktív szavazat megengedett a TL4 felhasználók számára?'+ topic_voting_show_who_voted: 'Lehetővé teszi a felhasználók számára, hogy láthassák ki szavazott?'+ topic_voting_show_votes_on_profile: 'Lehetővé teszi a felhasználók számára, hogy szavazatukat a tevékenységi hírcsatornaikban láthassák?'+ topic_voting_alert_votes_left: 'Figyelmezteti a felhasználót amikor ennyi szavazata maradt'diff --git a/plugins/discourse-topic-voting/config/locales/server.hy.yml b/plugins/discourse-topic-voting/config/locales/server.hy.ymlnew file mode 100644index 00000000000..2deba6a22d6--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.hy.yml@@ -0,0 +1,17 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++hy:+ site_settings:+ topic_voting_enabled: 'Թույլատրե՞լ օգտատերերին քվեարկել թեմաներում:'+ topic_voting_tl0_vote_limit: 'Քանի՞ ակտիվ քվե է թույլատրվում ՎՄ-0 ունեցող օգտատերերին:'+ topic_voting_tl1_vote_limit: 'Քանի՞ ակտիվ քվե է թույլատրվում ՎՄ-1 ունեցող օգտատերերին:'+ topic_voting_tl2_vote_limit: 'Քանի՞ ակտիվ քվե է թույլատրվում ՎՄ-2 ունեցող օգտատերերին:'+ topic_voting_tl3_vote_limit: 'Քանի՞ ակտիվ քվե է թույլատրվում ՎՄ-3 ունեցող օգտատերերին:'+ topic_voting_tl4_vote_limit: 'Քանի՞ ակտիվ քվե է թույլատրվում ՎՄ-4 ունեցող օգտատերերին:'+ topic_voting_show_who_voted: 'Թույլատրել օգտատերերին տեսնել, թե ով է քվեարկել:'+ topic_voting_show_votes_on_profile: 'Թույլատրե՞լ օգտատերերին տեսնել իրեց քվեները ակտիվության լրահոսում:'+ topic_voting_alert_votes_left: 'Զգուշացնել օգտատիրոջը, երբ մնացել է այսքան հատ քվե'diff --git a/plugins/discourse-topic-voting/config/locales/server.id.yml b/plugins/discourse-topic-voting/config/locales/server.id.ymlnew file mode 100644index 00000000000..596e36b2e13--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.id.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++id:diff --git a/plugins/discourse-topic-voting/config/locales/server.it.yml b/plugins/discourse-topic-voting/config/locales/server.it.ymlnew file mode 100644index 00000000000..1c4a8597392--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.it.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++it:+ site_settings:+ topic_voting_enabled: 'Consentire agli utenti di votare sugli argomenti?'+ topic_voting_tl0_vote_limit: 'Quanti voti attivi sono consentiti agli utenti con livello di affidabilità 0?'+ topic_voting_tl1_vote_limit: 'Quanti voti attivi sono consentiti agli utenti con livello di affidabilità 1?'+ topic_voting_tl2_vote_limit: 'Quanti voti attivi sono consentiti agli utenti con livello di affidabilità 2?'+ topic_voting_tl3_vote_limit: 'Quanti voti attivi sono consentiti agli utenti con livello di affidabilità 3?'+ topic_voting_tl4_vote_limit: 'Quanti voti attivi sono consentiti agli utenti con livello di affidabilità 4?'+ topic_voting_show_who_voted: 'Consentire agli utenti di vedere chi ha votato?'+ topic_voting_show_votes_on_profile: 'Consentire agli utenti di vedere i propri voti nei feed attività?'+ topic_voting_alert_votes_left: 'Avverti l''utente quando gli rimane questo numero di voti'+ topic_voting:+ votes_moved:+ one: "Un voto è stato spostato."+ other: "%{count} voti sono stati spostati. "+ duplicated_votes:+ one: "Non è stato possibile spostare un voto perché l'utente ha già votato nell'altro argomento."+ other: "Non è stato possibile spostare %{count} voti perché i gli utenti hanno già votato nell'altro argomento."diff --git a/plugins/discourse-topic-voting/config/locales/server.ja.yml b/plugins/discourse-topic-voting/config/locales/server.ja.ymlnew file mode 100644index 00000000000..960e9a4f9de--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.ja.yml@@ -0,0 +1,22 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ja:+ site_settings:+ topic_voting_enabled: 'ユーザーがトピックに投票することを許可しますか?'+ topic_voting_tl0_vote_limit: 'いくつのアクティブ票数を TL0 ユーザーに許可しますか?'+ topic_voting_tl1_vote_limit: 'いくつのアクティブ票数を TL1 ユーザーに許可しますか?'+ topic_voting_tl2_vote_limit: 'いくつのアクティブ票数を TL2 ユーザーに許可しますか?'+ topic_voting_tl3_vote_limit: 'いくつのアクティブ票数を TL3 ユーザーに許可しますか?'+ topic_voting_tl4_vote_limit: 'いくつのアクティブ票数を TL4 ユーザーに許可しますか?'+ topic_voting_show_who_voted: 'ユーザーが投票者を閲覧することを許可しますか?'+ topic_voting_show_votes_on_profile: 'ユーザーがアクティビティフィードで投票を閲覧することを許可しますか?'+ topic_voting_alert_votes_left: '残りの票数がこの票数になったらユーザーに通知する'+ topic_voting:+ votes_moved:+ other: "%{count} 票が移動されました。"+ duplicated_votes:+ other: "ユーザーが別のトピックに投票済みであるため、%{count} 票を移動できませんでした。"diff --git a/plugins/discourse-topic-voting/config/locales/server.ko.yml b/plugins/discourse-topic-voting/config/locales/server.ko.ymlnew file mode 100644index 00000000000..478e2bf9c05--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.ko.yml@@ -0,0 +1,17 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ko:+ site_settings:+ topic_voting_enabled: '사용자가 글에 투표하도록 허용 하시겠습니까?'+ topic_voting_tl0_vote_limit: 'TL0 사용자는 얼마나 많은 투표를 할 수 있습니까?'+ topic_voting_tl1_vote_limit: 'TL1 사용자는 얼마나 많은 투표를 할 수 있습니까?'+ topic_voting_tl2_vote_limit: 'TL2 사용자는 얼마나 많은 투표를 할 수 있습니까?'+ topic_voting_tl3_vote_limit: 'TL3 사용자는 얼마나 많은 투표를 할 수 있습니까?'+ topic_voting_tl4_vote_limit: 'TL4 사용자는 얼마나 많은 투표를 할 수 있습니까?'+ topic_voting_show_who_voted: '사용자가 누가 투표를 했는지 볼 수 있도록 하시겠습니까?'+ topic_voting_show_votes_on_profile: '사용자가 활동 피드에서 자신의 투표를 볼 수 있습니까?'+ topic_voting_alert_votes_left: '이 많은 투표가 남아있을 때 사용자에게 경고'diff --git a/plugins/discourse-topic-voting/config/locales/server.lt.yml b/plugins/discourse-topic-voting/config/locales/server.lt.ymlnew file mode 100644index 00000000000..e41151e0776--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.lt.yml@@ -0,0 +1,10 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++lt:+ site_settings:+ topic_voting_enabled: 'Leisti nariams balsuoti temoje?'+ topic_voting_show_who_voted: 'Leisti nariams matyti balsavusius?'diff --git a/plugins/discourse-topic-voting/config/locales/server.lv.yml b/plugins/discourse-topic-voting/config/locales/server.lv.ymlnew file mode 100644index 00000000000..d96aea017ee--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.lv.yml@@ -0,0 +1,11 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++lv:+ site_settings:+ topic_voting_enabled: 'Atļaut lietotājiem balsot šajā tēmā?'+ topic_voting_show_who_voted: 'Atļaut lietotājiem redzēt kurš balsojis?'+ topic_voting_show_votes_on_profile: 'Atļaut lietotājiem redzēt viņu balsojumus viņu aktivitātēs?'diff --git a/plugins/discourse-topic-voting/config/locales/server.nb_NO.yml b/plugins/discourse-topic-voting/config/locales/server.nb_NO.ymlnew file mode 100644index 00000000000..c27e6452063--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.nb_NO.yml@@ -0,0 +1,17 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++nb_NO:+ site_settings:+ topic_voting_enabled: 'Tillat brukere å stemme på emner?'+ topic_voting_tl0_vote_limit: 'Hvor mange aktive stemmer er tillatt for brukere med TL0?'+ topic_voting_tl1_vote_limit: 'Hvor mange aktive stemmer er tillatt for brukere med TL1?'+ topic_voting_tl2_vote_limit: 'Hvor mange aktive stemmer er tillatt for brukere med TL2?'+ topic_voting_tl3_vote_limit: 'Hvor mange aktive stemmer er tillatt for brukere med TL3?'+ topic_voting_tl4_vote_limit: 'Hvor mange aktive stemmer er tillatt for brukere med TL4?'+ topic_voting_show_who_voted: 'Tillat brukere å se hvem som stemte?'+ topic_voting_show_votes_on_profile: 'Tillat brukere å se stemmene sine i aktivitetslisten?'+ topic_voting_alert_votes_left: 'Varsle bruker når dette antallet stemmer er igjen'diff --git a/plugins/discourse-topic-voting/config/locales/server.nl.yml b/plugins/discourse-topic-voting/config/locales/server.nl.ymlnew file mode 100644index 00000000000..0e26c42fa60--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.nl.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++nl:+ site_settings:+ topic_voting_enabled: 'Toestaan dat gebruikers op topics kunnen stemmen?'+ topic_voting_tl0_vote_limit: 'Hoeveel actieve stemmen mogen TL0-gebruikers hebben?'+ topic_voting_tl1_vote_limit: 'Hoeveel actieve stemmen mogen TL1-gebruikers hebben?'+ topic_voting_tl2_vote_limit: 'Hoeveel actieve stemmen mogen TL2-gebruikers hebben?'+ topic_voting_tl3_vote_limit: 'Hoeveel actieve stemmen mogen TL3-gebruikers hebben?'+ topic_voting_tl4_vote_limit: 'Hoeveel actieve stemmen mogen TL4-gebruikers hebben?'+ topic_voting_show_who_voted: 'Toestaan dat gebruikers kunnen zien wie er heeft gestemd?'+ topic_voting_show_votes_on_profile: 'Toestaan dat gebruikers hun stemmen zien in hun activiteitfeed?'+ topic_voting_alert_votes_left: 'Gebruiker waarschuwen als zoveel stemmen resteren'+ topic_voting:+ votes_moved:+ one: "Een stem is verplaatst."+ other: "%{count} stemmen zijn verplaatst."+ duplicated_votes:+ one: "Een stem kon niet worden verplaatst, omdat de gebruiker al in het andere topic heeft gestemd."+ other: "%{count} stemmen konden niet worden verplaatst, omdat de gebruikers ervan al in het andere topic hebben gestemd."diff --git a/plugins/discourse-topic-voting/config/locales/server.pl_PL.yml b/plugins/discourse-topic-voting/config/locales/server.pl_PL.ymlnew file mode 100644index 00000000000..9f39ba19939--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.pl_PL.yml@@ -0,0 +1,28 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++pl_PL:+ site_settings:+ topic_voting_enabled: 'Pozwolić użytkownikom głosować na tematy?'+ topic_voting_tl0_vote_limit: 'Ile głosów mogą oddać użytkownicy TL0?'+ topic_voting_tl1_vote_limit: 'Ile głosów mogą oddać użytkownicy TL1?'+ topic_voting_tl2_vote_limit: 'Ile głosów mogą oddać użytkownicy TL2?'+ topic_voting_tl3_vote_limit: 'Ile głosów mogą oddać użytkownicy TL3?'+ topic_voting_tl4_vote_limit: 'Ile głosów mogą oddać użytkownicy TL4?'+ topic_voting_show_who_voted: 'Czy użytkownicy mają widzieć, kto głosował?'+ topic_voting_show_votes_on_profile: 'Czy głosy mają być widoczne w aktywności w proflu użytkownika?'+ topic_voting_alert_votes_left: 'Ostrzeż użytkownika, jesli pozostało mu tyle głosów'+ topic_voting:+ votes_moved:+ one: "Głos został przeniesiony."+ few: "%{count} głosy zostały przeniesione."+ many: "%{count} głosów zostało przeniesionych."+ other: "%{count} głosów zostało przeniesionych."+ duplicated_votes:+ one: "Głos nie mógł zostać przeniesiony, ponieważ użytkownik zagłosował już w innym temacie."+ few: "%{count} głosy nie mogły zostać przeniesione, ponieważ użytkownicy zagłosowali już w innym temacie."+ many: "%{count} głosów nie mogło zostać przeniesionych, ponieważ użytkownicy zagłosowali już w innym temacie."+ other: "%{count} głosów nie mogło zostać przeniesionych, ponieważ użytkownicy zagłosowali już w innym temacie."diff --git a/plugins/discourse-topic-voting/config/locales/server.pt.yml b/plugins/discourse-topic-voting/config/locales/server.pt.ymlnew file mode 100644index 00000000000..b2f8e8d50aa--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.pt.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++pt:+ site_settings:+ topic_voting_enabled: 'Permitir que os utilizadores votem em tópicos?'+ topic_voting_tl0_vote_limit: 'Quantos votos activos são permitidos aos utilizadores TL0?'+ topic_voting_tl1_vote_limit: 'Quantos votos activos são permitidos aos utilizadores TL1?'+ topic_voting_tl2_vote_limit: 'Quantos votos activos são permitidos aos utilizadores TL2?'+ topic_voting_tl3_vote_limit: 'Quantos votos activos são permitidos aos utilizadores TL3?'+ topic_voting_tl4_vote_limit: 'Quantos votos activos são permitidos aos utilizadores TL4?'+ topic_voting_show_who_voted: 'Permitir aos utilizadores ver quem votou?'+ topic_voting_show_votes_on_profile: 'Permitir aos utilizadores ver os seus votos na lista de actividade?'+ topic_voting_alert_votes_left: 'Alertar o utilizador quando faltarem estes votos'+ topic_voting:+ votes_moved:+ one: "Foi movido um voto."+ other: "Foram movidos %{count}votos."+ duplicated_votes:+ one: "Não foi possível mover um voto porque o utilizador já votou em outro tópico."+ other: "Não foi possível mover %{count} votos porque os seus utilizadores já votaram em outro tópico."diff --git a/plugins/discourse-topic-voting/config/locales/server.pt_BR.yml b/plugins/discourse-topic-voting/config/locales/server.pt_BR.ymlnew file mode 100644index 00000000000..ddf4c5b1ea0--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.pt_BR.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++pt_BR:+ site_settings:+ topic_voting_enabled: 'Permitir que usuários(as) votem nos tópicos?'+ topic_voting_tl0_vote_limit: 'Quantos votos ativos de usuários(as) NC0 são permitidos?'+ topic_voting_tl1_vote_limit: 'Quantos votos ativos de usuários(as) NC1 são permitidos?'+ topic_voting_tl2_vote_limit: 'Quantos votos ativos de usuários(as) NC2 são permitidos?'+ topic_voting_tl3_vote_limit: 'Quantos votos ativos de usuários(as) NC3 são permitidos?'+ topic_voting_tl4_vote_limit: 'Quantos votos ativos de usuários(as) NC4 são permitidos?'+ topic_voting_show_who_voted: 'Permitir que usuários(as) vejam quem votou?'+ topic_voting_show_votes_on_profile: 'Permitir que usuários(as) vejam seus votos nos seus feeds de atividade?'+ topic_voting_alert_votes_left: 'Alertar usuário(a) quando houver esta quantidade de votos restantes'+ topic_voting:+ votes_moved:+ one: "Um voto foi movido."+ other: "%{count} votos foram movidos."+ duplicated_votes:+ one: "Um voto não pôde ser movido porque o(a) usuário(a) já votou no outro tópico."+ other: "%{count} votos não puderam ser movidos porque o(a) usuário(a) já votou no outro tópico."diff --git a/plugins/discourse-topic-voting/config/locales/server.ro.yml b/plugins/discourse-topic-voting/config/locales/server.ro.ymlnew file mode 100644index 00000000000..b24ec7e33ac--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.ro.yml@@ -0,0 +1,26 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ro:+ site_settings:+ topic_voting_enabled: 'Permiți utilizatorilor să voteze subiecte?'+ topic_voting_tl0_vote_limit: 'Câte voturi active permiți pentru utilizatorii cu TL0 ?'+ topic_voting_tl1_vote_limit: 'Câte voturi active permiți pentru utilizatorii cu TL1 ?'+ topic_voting_tl2_vote_limit: 'Câte voturi active permiți pentru utilizatorii cu TL2 ?'+ topic_voting_tl3_vote_limit: 'Câte voturi active permiți pentru utilizatorii cu TL3 ?'+ topic_voting_tl4_vote_limit: 'Câte voturi active permiți pentru utilizatorii cu TL4 ?'+ topic_voting_show_who_voted: 'Permiți utilizatorilor să vadă cine a votat?'+ topic_voting_show_votes_on_profile: 'Permiți utilizatorilor să vadă voturile în fluxurile lor de activități?'+ topic_voting_alert_votes_left: 'Avertizează utilizatorii când mai rămân doar atâtea voturi'+ topic_voting:+ votes_moved:+ one: "Un vot a fost mutat."+ few: "%{count} voturi au fost mutate."+ other: "%{count} voturi au fost mutate."+ duplicated_votes:+ one: "Un vot nu a putut fi mutat deoarece utilizatorul a votat deja în celălalt subiect."+ few: "%{count} voturi nu au putut fi mutate deoarece utilizatorul a votat deja în celălalt subiect."+ other: "%{count} voturi nu au putut fi mutate deoarece utilizatorul a votat deja în celălalt subiect."diff --git a/plugins/discourse-topic-voting/config/locales/server.ru.yml b/plugins/discourse-topic-voting/config/locales/server.ru.ymlnew file mode 100644index 00000000000..4e9e7bf8252--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.ru.yml@@ -0,0 +1,28 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ru:+ site_settings:+ topic_voting_enabled: 'Разрешить пользователям голосовать по темам?'+ topic_voting_tl0_vote_limit: 'Сколько активных голосов разрешено пользователям с TL0?'+ topic_voting_tl1_vote_limit: 'Сколько активных голосов разрешено пользователям с TL1?'+ topic_voting_tl2_vote_limit: 'Сколько активных голосов разрешено пользователям с TL2?'+ topic_voting_tl3_vote_limit: 'Сколько активных голосов разрешено пользователям с TL3?'+ topic_voting_tl4_vote_limit: 'Сколько активных голосов разрешено пользователям с TL4?'+ topic_voting_show_who_voted: 'Разрешить пользователям видеть проголосовавших?'+ topic_voting_show_votes_on_profile: 'Разрешить пользователям видеть свои голоса в ленте активности?'+ topic_voting_alert_votes_left: 'Предупреждать пользователя, когда осталось мало голосов'+ topic_voting:+ votes_moved:+ one: "%{count} голос был перемещен."+ few: "%{count} голоса было перемещено."+ many: "%{count} голосов было перемещено."+ other: "%{count} голоса были перемещены."+ duplicated_votes:+ one: "Невозможно переместить %{count} голос, поскольку их пользователи уже голосовали в другой теме."+ few: "Невозможно переместить %{count} голоса, поскольку их пользователи уже голосовали в другой теме."+ many: "Невозможно переместить %{count} голосов, поскольку их пользователи уже голосовали в другой теме."+ other: "Невозможно переместить %{count} голоса, поскольку их пользователи уже голосовали в другой теме."diff --git a/plugins/discourse-topic-voting/config/locales/server.sk.yml b/plugins/discourse-topic-voting/config/locales/server.sk.ymlnew file mode 100644index 00000000000..905d2bc7a8a--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.sk.yml@@ -0,0 +1,15 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sk:+ site_settings:+ topic_voting_enabled: 'Povoliť používateľom hlasovať o témach?'+ topic_voting_tl0_vote_limit: 'Koľko aktívnych hlasovaní povoliť pre TL0 používateľov? '+ topic_voting_tl1_vote_limit: 'Koľko aktívnych hlasovaní povoliť pre TL1 používateľov? '+ topic_voting_tl2_vote_limit: 'Koľko aktívnych hlasovaní povoliť pre TL2 používateľov? '+ topic_voting_tl3_vote_limit: 'Koľko aktívnych hlasovaní povoliť pre TL3 používateľov? '+ topic_voting_tl4_vote_limit: 'Koľko aktívnych hlasovaní povoliť pre TL4 používateľov? '+ topic_voting_show_who_voted: 'Povoliť používateľom vidieť kto hlasoval?'diff --git a/plugins/discourse-topic-voting/config/locales/server.sl.yml b/plugins/discourse-topic-voting/config/locales/server.sl.ymlnew file mode 100644index 00000000000..23489a48b1f--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.sl.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sl:diff --git a/plugins/discourse-topic-voting/config/locales/server.sq.yml b/plugins/discourse-topic-voting/config/locales/server.sq.ymlnew file mode 100644index 00000000000..7f051b7a7cf--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.sq.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sq:diff --git a/plugins/discourse-topic-voting/config/locales/server.sr.yml b/plugins/discourse-topic-voting/config/locales/server.sr.ymlnew file mode 100644index 00000000000..88d63d6ae1a--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.sr.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sr:diff --git a/plugins/discourse-topic-voting/config/locales/server.sv.yml b/plugins/discourse-topic-voting/config/locales/server.sv.ymlnew file mode 100644index 00000000000..2f0f0bc1f7a--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.sv.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sv:+ site_settings:+ topic_voting_enabled: 'Vill du tillåta användaromröstning på ämnen?'+ topic_voting_tl0_vote_limit: 'Hur många röster är tillgängliga för FN0-användare?'+ topic_voting_tl1_vote_limit: 'Hur många röster är tillgängliga för FN1-användare?'+ topic_voting_tl2_vote_limit: 'Hur många röster är tillgängliga för FN2-användare?'+ topic_voting_tl3_vote_limit: 'Hur många röster är tillgängliga för FN3-användare?'+ topic_voting_tl4_vote_limit: 'Hur många röster är tillgängliga för FN4-användare?'+ topic_voting_show_who_voted: 'Ska användare tillåtas se vem som har röstat?'+ topic_voting_show_votes_on_profile: 'Ska användare tillåtas se sina röstningar i aktivitetsflödet?'+ topic_voting_alert_votes_left: 'Uppmärksamma användaren när antalet röster kvar är'+ topic_voting:+ votes_moved:+ one: "En röst har flyttats."+ other: "%{count} röster har flyttats."+ duplicated_votes:+ one: "En röst kunde inte flyttas eftersom användaren redan röstade i det andra ämnet."+ other: "%{count} röster kunde inte flyttas eftersom deras användare redan röstade i det andra ämnet."diff --git a/plugins/discourse-topic-voting/config/locales/server.sw.yml b/plugins/discourse-topic-voting/config/locales/server.sw.ymlnew file mode 100644index 00000000000..e173687301a--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.sw.yml@@ -0,0 +1,17 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++sw:+ site_settings:+ topic_voting_enabled: 'Ruhusu watumiaji wapige kura kwenye mada?'+ topic_voting_tl0_vote_limit: 'Watumiaji wa TL0 wanaruhusiwa kura ngapi?'+ topic_voting_tl1_vote_limit: 'Watumiaji wenye kiwango cha kwanza cha uaminifu TL1 wanaruhusiwa kupiga kura ngapi?'+ topic_voting_tl2_vote_limit: 'Ni kura ngapi watumiaji wa TL2 wanaruhusiwa kuwapiga?'+ topic_voting_tl3_vote_limit: 'Watumiaji wa TL3 wanaruhusiwa kuwa na kura ngapi hewani?'+ topic_voting_tl4_vote_limit: 'Ni kura ngapi watumiaji wa TL4 wanaruhusiwa kupiga?'+ topic_voting_show_who_voted: 'Je unaruhusu watumiaji waone aliyepiga kura?'+ topic_voting_show_votes_on_profile: 'waruhusu watumiaji waone kura zao kwenye orodha ya shughuli zao kwenye mtandao'+ topic_voting_alert_votes_left: 'Mjulishe mtumiaji wakati kura kadhaa zikiondoka'diff --git a/plugins/discourse-topic-voting/config/locales/server.te.yml b/plugins/discourse-topic-voting/config/locales/server.te.ymlnew file mode 100644index 00000000000..03967bdbb07--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.te.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++te:diff --git a/plugins/discourse-topic-voting/config/locales/server.th.yml b/plugins/discourse-topic-voting/config/locales/server.th.ymlnew file mode 100644index 00000000000..7de85ff91c4--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.th.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++th:diff --git a/plugins/discourse-topic-voting/config/locales/server.tr_TR.yml b/plugins/discourse-topic-voting/config/locales/server.tr_TR.ymlnew file mode 100644index 00000000000..97c41757690--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.tr_TR.yml@@ -0,0 +1,24 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++tr_TR:+ site_settings:+ topic_voting_enabled: 'Kullanıcıların konularda oy kullanmasına izin verilsin mi?'+ topic_voting_tl0_vote_limit: 'GS0 kullanıcılara kaç aktif oy izni veriliyor?'+ topic_voting_tl1_vote_limit: 'GS1 kullanıcılara kaç aktif oy izni veriliyor?'+ topic_voting_tl2_vote_limit: 'GS2 kullanıcılara kaç aktif oy izni veriliyor?'+ topic_voting_tl3_vote_limit: 'GS3 kullanıcılara kaç aktif oy izni veriliyor?'+ topic_voting_tl4_vote_limit: 'GS4 kullanıcılara kaç aktif oy izni veriliyor?'+ topic_voting_show_who_voted: 'Kullanıcıların kimin oy verdiğini görmesine izin verilsin mi?'+ topic_voting_show_votes_on_profile: 'Kullanıcıların oylarını aktivite akışlarında görmelerine izin verilsin mi?'+ topic_voting_alert_votes_left: 'Şu kadar oy kaldığında kullanıcıyı uyar:'+ topic_voting:+ votes_moved:+ one: "Bir oy taşındı."+ other: "%{count} oy taşındı."+ duplicated_votes:+ one: "Kullanıcı diğer konuda zaten oy verdiği için oy taşınamadı."+ other: "%{count} oy, kullanıcıları diğer konuda zaten oy kullandığı için taşınamadı."diff --git a/plugins/discourse-topic-voting/config/locales/server.ug.yml b/plugins/discourse-topic-voting/config/locales/server.ug.ymlnew file mode 100644index 00000000000..a6bf0185ae2--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.ug.yml@@ -0,0 +1,7 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ug:diff --git a/plugins/discourse-topic-voting/config/locales/server.uk.yml b/plugins/discourse-topic-voting/config/locales/server.uk.ymlnew file mode 100644index 00000000000..45881da2c01--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.uk.yml@@ -0,0 +1,28 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++uk:+ site_settings:+ topic_voting_enabled: 'Дозволити користувачам голосувати за темами?'+ topic_voting_tl0_vote_limit: 'Скільки активних голосів дозволено користувачам TL0?'+ topic_voting_tl1_vote_limit: 'Скільки активних голосів дозволено користувачам TL1?'+ topic_voting_tl2_vote_limit: 'Скільки активних голосів дозволено користувачам TL2?'+ topic_voting_tl3_vote_limit: 'Скільки активних голосів дозволено користувачам TL3?'+ topic_voting_tl4_vote_limit: 'Скільки активних голосів дозволено користувачам TL4?'+ topic_voting_show_who_voted: 'Дозволити користувачам бачити, хто проголосував?'+ topic_voting_show_votes_on_profile: 'Дозволити користувачам бачити свої голоси у стрічці активності?'+ topic_voting_alert_votes_left: 'Попередити користувача, коли залишилося стільки голосів'+ topic_voting:+ votes_moved:+ one: "Голосування переміщено."+ few: "%{count} голосів переміщено."+ many: "%{count} голосів переміщено."+ other: "%{count} голосів переміщено."+ duplicated_votes:+ one: "Не вдалося перемістити голосування, оскільки користувач уже проголосував у іншій темі."+ few: "%{count} голосів неможливо було перемістити, оскільки їх користувачі вже проголосували в іншій темі."+ many: "%{count} голосів неможливо було перемістити, оскільки їх користувачі вже проголосували в іншій темі."+ other: "%{count} голосів неможливо було перемістити, оскільки їх користувачі вже проголосували в іншій темі."diff --git a/plugins/discourse-topic-voting/config/locales/server.ur.yml b/plugins/discourse-topic-voting/config/locales/server.ur.ymlnew file mode 100644index 00000000000..96f54aee279--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.ur.yml@@ -0,0 +1,17 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++ur:+ site_settings:+ topic_voting_enabled: 'صارفین کو ٹاپکس پر ووٹ کرنے کی اجازت دیں؟'+ topic_voting_tl0_vote_limit: 'TL0 صارفین کو کتنے فعال ووٹوں کی اجازت ہے؟'+ topic_voting_tl1_vote_limit: 'TL1 صارفین کو کتنے فعال ووٹوں کی اجازت ہے؟'+ topic_voting_tl2_vote_limit: 'TL2 صارفین کو کتنے فعال ووٹوں کی اجازت ہے؟'+ topic_voting_tl3_vote_limit: 'TL3 صارفین کو کتنے فعال ووٹوں کی اجازت ہے؟'+ topic_voting_tl4_vote_limit: 'TL4 صارفین کو کتنے فعال ووٹوں کی اجازت ہے؟'+ topic_voting_show_who_voted: 'صارفین کو، کس نے ووٹ کیا ہے، دیکھنے کی اجازت دیں؟'+ topic_voting_show_votes_on_profile: 'صارفین کو اُن کی سرگرمی فیڈ میں اُن کے ووٹ دیکھنے کی اجازت دیں؟'+ topic_voting_alert_votes_left: 'صارف کو انتباہ کردیں جب اتنے ووٹ باقی رہ جائیں'diff --git a/plugins/discourse-topic-voting/config/locales/server.vi.yml b/plugins/discourse-topic-voting/config/locales/server.vi.ymlnew file mode 100644index 00000000000..8bae4ef8ad1--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.vi.yml@@ -0,0 +1,22 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++vi:+ site_settings:+ topic_voting_enabled: 'Cho phép người dùng bình chọn chủ đề?<br>'+ topic_voting_tl0_vote_limit: 'Người dùng TL0 được phép sử dụng bao nhiêu phiếu bình chọn?'+ topic_voting_tl1_vote_limit: 'Người dùng TL1 được phép sử dụng bao nhiêu phiếu bình chọn?'+ topic_voting_tl2_vote_limit: 'Người dùng TL2 được phép sử dụng bao nhiêu phiếu bình chọn?'+ topic_voting_tl3_vote_limit: 'Người dùng TL3 được phép sử dụng bao nhiêu phiếu bình chọn?'+ topic_voting_tl4_vote_limit: 'Người dùng TL4 được phép sử dụng bao nhiêu phiếu bình chọn?'+ topic_voting_show_who_voted: 'Cho phép người dùng xem ai đã bình chọn?'+ topic_voting_show_votes_on_profile: 'Cho phép người dùng xem phiếu bình chọn của họ trong luồng hoạt động của họ?'+ topic_voting_alert_votes_left: 'Thông báo cho người dùng khi số phiếu bình chọn còn lại'+ topic_voting:+ votes_moved:+ other: "%{count} phiếu bình chọn đã được chuyển."+ duplicated_votes:+ other: "Không thể chuyển %{count} phiếu bình chọn vì họ đã bỏ phiếu trong chủ đề khác."diff --git a/plugins/discourse-topic-voting/config/locales/server.zh_CN.yml b/plugins/discourse-topic-voting/config/locales/server.zh_CN.ymlnew file mode 100644index 00000000000..cbe8ad6b1d8--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.zh_CN.yml@@ -0,0 +1,22 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++zh_CN:+ site_settings:+ topic_voting_enabled: '允许用户为话题投票?'+ topic_voting_tl0_vote_limit: '信任级别为 0 的用户有多少次投票机会?'+ topic_voting_tl1_vote_limit: '信任级别为 1 的用户有多少次投票机会?'+ topic_voting_tl2_vote_limit: '信任级别为 2 的用户有多少次投票机会?'+ topic_voting_tl3_vote_limit: '信任级别为 3 的用户有多少次投票机会?'+ topic_voting_tl4_vote_limit: '信任级别为 4 的用户有多少次投票机会?'+ topic_voting_show_who_voted: '允许用户查看投票者?'+ topic_voting_show_votes_on_profile: '允许用户在活动源中查看其投票?'+ topic_voting_alert_votes_left: '当投票机会还有此数值时通知用户'+ topic_voting:+ votes_moved:+ other: "%{count} 个投票已被移动。"+ duplicated_votes:+ other: "%{count} 个投票无法移动,因为用户已在另一个话题中投票。"diff --git a/plugins/discourse-topic-voting/config/locales/server.zh_TW.yml b/plugins/discourse-topic-voting/config/locales/server.zh_TW.ymlnew file mode 100644index 00000000000..c30e4e3c27c--- /dev/null+++ b/plugins/discourse-topic-voting/config/locales/server.zh_TW.yml@@ -0,0 +1,22 @@+# WARNING: Never edit this file.+# It will be overwritten when translations are pulled from Crowdin.+#+# To work with us on translations, join this project:+# https://translate.discourse.org/++zh_TW:+ site_settings:+ topic_voting_enabled: '允許使用者對話題投票?'+ topic_voting_tl0_vote_limit: '允許TL0 使用者有多少票可用?'+ topic_voting_tl1_vote_limit: '允許TL1 使用者有多少票可用?'+ topic_voting_tl2_vote_limit: '允許TL2 使用者有多少票可用?'+ topic_voting_tl3_vote_limit: '允許TL3 使用者有多少票可用?'+ topic_voting_tl4_vote_limit: '允許TL4 使用者有多少票可用?'+ topic_voting_show_who_voted: '允許使用者可看見有誰投票?'+ topic_voting_show_votes_on_profile: '是否允許使用者可在活動摘要中看見他們的投票?'+ topic_voting_alert_votes_left: '當剩餘這些票數時提醒使用者'+ topic_voting:+ votes_moved:+ other: "%{count} 投票已被搬移。"+ duplicated_votes:+ other: "%{count} 票無法搬移,因為他們的使用者已經在其他主題中投票過。"diff --git a/plugins/discourse-topic-voting/config/routes.rb b/plugins/discourse-topic-voting/config/routes.rbnew file mode 100644index 00000000000..d6ee6dc7eda--- /dev/null+++ b/plugins/discourse-topic-voting/config/routes.rb@@ -0,0 +1,7 @@+# frozen_string_literal: true++DiscourseTopicVoting::Engine.routes.draw do+ post "vote" => "votes#vote"+ post "unvote" => "votes#unvote"+ get "who" => "votes#who"+enddiff --git a/plugins/discourse-topic-voting/config/settings.yml b/plugins/discourse-topic-voting/config/settings.ymlnew file mode 100755index 00000000000..5fbee837ca4--- /dev/null+++ b/plugins/discourse-topic-voting/config/settings.yml@@ -0,0 +1,22 @@+plugins:+ topic_voting_alert_votes_left:+ default: 10+ topic_voting_enabled:+ default: true+ client: true+ topic_voting_show_who_voted:+ default: true+ client: true+ topic_voting_show_votes_on_profile:+ default: true+ client: true+ topic_voting_tl0_vote_limit:+ default: 2+ topic_voting_tl1_vote_limit:+ default: 4+ topic_voting_tl2_vote_limit:+ default: 6+ topic_voting_tl3_vote_limit:+ default: 8+ topic_voting_tl4_vote_limit:+ default: 10diff --git a/plugins/discourse-topic-voting/db/migrate/20190625085735_add_vote_count_index_to_topic_custom_fields.rb b/plugins/discourse-topic-voting/db/migrate/20190625085735_add_vote_count_index_to_topic_custom_fields.rbnew file mode 100644index 00000000000..bc49f1d5fde--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20190625085735_add_vote_count_index_to_topic_custom_fields.rb@@ -0,0 +1,15 @@+# frozen_string_literal: true++class AddVoteCountIndexToTopicCustomFields < ActiveRecord::Migration[5.2]+ def change+ execute <<~SQL+ DELETE FROM topic_custom_fields f+ WHERE name = 'vote_count' AND id > (+ SELECT MIN(f2.id) FROM topic_custom_fields f2+ WHERE f2.topic_id = f.topic_id AND f2.name = f.name+ )+ SQL++ add_index :topic_custom_fields, :topic_id, unique: true, where: "name = 'vote_count'"+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20190718152804_reclaim_from_disabled_category.rb b/plugins/discourse-topic-voting/db/migrate/20190718152804_reclaim_from_disabled_category.rbnew file mode 100644index 00000000000..c2514f99030--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20190718152804_reclaim_from_disabled_category.rb@@ -0,0 +1,27 @@+# frozen_string_literal: true++class ReclaimFromDisabledCategory < ActiveRecord::Migration[5.2]+ def up+ aliases = {+ votes: "votes",+ votes_archive: "votes_archive",+ voting_enabled: "enable_topic_voting",+ }++ # archive votes in non-voting categories+ DB.exec(<<~SQL, aliases)+ UPDATE user_custom_fields ucf+ SET name = :votes_archive+ FROM topics t+ WHERE ucf.name = :votes+ AND t.id::text = ucf.value+ AND t.category_id NOT IN (+ SELECT category_id FROM category_custom_fields WHERE name=:voting_enabled AND value='true'+ )+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20200727220143_create_discourse_voting_category_settings.rb b/plugins/discourse-topic-voting/db/migrate/20200727220143_create_discourse_voting_category_settings.rbnew file mode 100644index 00000000000..1137e5e8ec7--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20200727220143_create_discourse_voting_category_settings.rb@@ -0,0 +1,22 @@+# frozen_string_literal: true++class CreateDiscourseVotingCategorySettings < ActiveRecord::Migration[6.0]+ def up+ create_table :discourse_voting_category_settings do |t|+ t.integer :category_id+ t.timestamps+ end+ add_index :discourse_voting_category_settings, :category_id, unique: true++ DB.exec <<~SQL+ INSERT INTO discourse_voting_category_settings(category_id, created_at, updated_at)+ SELECT category_id, created_at, updated_at+ FROM category_custom_fields+ WHERE name = 'enable_topic_voting' and value = 'true'+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20200728222920_create_discourse_voting_votes.rb b/plugins/discourse-topic-voting/db/migrate/20200728222920_create_discourse_voting_votes.rbnew file mode 100644index 00000000000..c5ad74507cd--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20200728222920_create_discourse_voting_votes.rb@@ -0,0 +1,35 @@+# frozen_string_literal: true++class CreateDiscourseVotingVotes < ActiveRecord::Migration[6.0]+ def up+ create_table :discourse_voting_votes do |t|+ t.integer :topic_id+ t.integer :user_id+ t.boolean :archive, default: false+ t.timestamps+ end+ add_index :discourse_voting_votes, %i[user_id topic_id], unique: true++ DB.exec <<~SQL+ INSERT INTO discourse_voting_votes(topic_id, user_id, archive, created_at, updated_at)+ SELECT value::integer, user_id, 'false', created_at, updated_at+ FROM user_custom_fields+ WHERE name = 'votes'+ AND value <> ''+ ON CONFLICT(user_id, topic_id) DO NOTHING+ SQL++ DB.exec <<~SQL+ INSERT INTO discourse_voting_votes(topic_id, user_id, archive, created_at, updated_at)+ SELECT value::integer, user_id, 'true', created_at, updated_at+ FROM user_custom_fields+ WHERE name = 'votes_archive'+ AND value <> ''+ ON CONFLICT(user_id, topic_id) DO NOTHING+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20200729042607_create_discourse_voting_topic_vote_count.rb b/plugins/discourse-topic-voting/db/migrate/20200729042607_create_discourse_voting_topic_vote_count.rbnew file mode 100644index 00000000000..ff595715231--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20200729042607_create_discourse_voting_topic_vote_count.rb@@ -0,0 +1,24 @@+# frozen_string_literal: true++class CreateDiscourseVotingTopicVoteCount < ActiveRecord::Migration[6.0]+ def up+ create_table :discourse_voting_topic_vote_count do |t|+ t.integer :topic_id+ t.integer :votes_count+ t.timestamps+ end+ add_index :discourse_voting_topic_vote_count, :topic_id, unique: true++ DB.exec <<~SQL+ INSERT INTO discourse_voting_topic_vote_count(topic_id, votes_count, created_at, updated_at)+ SELECT topic_id::integer, value::integer, created_at, updated_at+ FROM topic_custom_fields+ WHERE name = 'vote_count'+ AND value <> ''+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20201003141123_remove_votes_of_deleted_users.rb b/plugins/discourse-topic-voting/db/migrate/20201003141123_remove_votes_of_deleted_users.rbnew file mode 100644index 00000000000..66e5f87a2c6--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20201003141123_remove_votes_of_deleted_users.rb@@ -0,0 +1,19 @@+# frozen_string_literal: true++class RemoveVotesOfDeletedUsers < ActiveRecord::Migration[6.0]+ def up+ DB.exec <<~SQL+ DELETE FROM discourse_voting_votes+ WHERE user_id IN (+ SELECT votes.user_id+ FROM discourse_voting_votes votes+ LEFT JOIN users ON users.id = votes.user_id+ WHERE users.id IS NULL+ )+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20240707170311_rename_voting_tables.rb b/plugins/discourse-topic-voting/db/migrate/20240707170311_rename_voting_tables.rbnew file mode 100644index 00000000000..ff2bdcff0cd--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20240707170311_rename_voting_tables.rb@@ -0,0 +1,73 @@+# frozen_string_literal: true++require "migration/table_dropper"++class RenameVotingTables < ActiveRecord::Migration[7.0]+ def up+ unless table_exists?(:topic_voting_topic_vote_count)+ Migration::TableDropper.read_only_table(:discourse_voting_topic_vote_count)+ execute <<~SQL+ CREATE TABLE topic_voting_topic_vote_count+ (LIKE discourse_voting_topic_vote_count INCLUDING ALL);+ SQL++ execute <<~SQL+ INSERT INTO topic_voting_topic_vote_count+ SELECT *+ FROM discourse_voting_topic_vote_count+ SQL++ execute <<~SQL+ ALTER TABLE topic_voting_topic_vote_count+ ALTER COLUMN id+ SET DEFAULT nextval('discourse_voting_topic_vote_count_id_seq')+ SQL++ add_index :topic_voting_topic_vote_count, :topic_id, unique: true+ end++ unless table_exists?(:topic_voting_votes)+ Migration::TableDropper.read_only_table(:discourse_voting_votes)+ execute <<~SQL+ CREATE TABLE topic_voting_votes+ (LIKE discourse_voting_votes INCLUDING ALL);+ SQL++ execute <<~SQL+ INSERT INTO topic_voting_votes+ SELECT *+ FROM discourse_voting_votes+ SQL++ execute <<~SQL+ ALTER TABLE topic_voting_votes+ ALTER COLUMN id+ SET DEFAULT nextval('discourse_voting_votes_id_seq')+ SQL+ end++ unless table_exists?(:topic_voting_category_settings)+ Migration::TableDropper.read_only_table(:discourse_voting_category_settings)+ execute <<~SQL+ CREATE TABLE topic_voting_category_settings+ (LIKE discourse_voting_category_settings INCLUDING ALL);+ SQL++ execute <<~SQL+ INSERT INTO topic_voting_category_settings+ SELECT *+ FROM discourse_voting_category_settings+ SQL++ execute <<~SQL+ ALTER TABLE topic_voting_category_settings+ ALTER COLUMN id+ SET DEFAULT nextval('discourse_voting_category_settings_id_seq')+ SQL+ end+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20240711102255_ensure_consistency.rb b/plugins/discourse-topic-voting/db/migrate/20240711102255_ensure_consistency.rbnew file mode 100644index 00000000000..f7867837088--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20240711102255_ensure_consistency.rb@@ -0,0 +1,69 @@+# frozen_string_literal: true++class EnsureConsistency < ActiveRecord::Migration[7.0]+ def up+ # un-archive votes to open topics+ DB.exec(<<~SQL)+ UPDATE topic_voting_votes+ SET archive=false+ FROM topics+ WHERE topics.id = topic_voting_votes.topic_id+ AND topic_voting_votes.archive IS TRUE+ AND NOT topics.closed+ AND NOT topics.archived+ AND topics.deleted_at IS NULL+ SQL++ # delete duplicate votes+ DB.exec(<<~SQL)+ DELETE FROM topic_voting_votes dvv1+ USING topic_voting_votes dvv2+ WHERE dvv1.id < dvv2.id AND+ dvv1.user_id = dvv2.user_id AND+ dvv1.topic_id = dvv2.topic_id AND+ dvv1.archive = dvv2.archive+ SQL++ # delete votes associated with no topics+ DB.exec(<<~SQL)+ DELETE FROM topic_voting_votes+ WHERE topic_voting_votes.topic_id IS NULL+ SQL++ # delete duplicate vote counts for topics+ DB.exec(<<~SQL)+ DELETE FROM topic_voting_topic_vote_count dvtvc+ USING topic_voting_topic_vote_count dvtvc2+ WHERE dvtvc.id < dvtvc2.id AND+ dvtvc.topic_id = dvtvc2.topic_id AND+ dvtvc.votes_count = dvtvc2.votes_count+ SQL++ # insert missing vote counts for topics+ # ensures we have "something" for every topic with votes+ DB.exec(<<~SQL)+ WITH missing_ids AS (+ SELECT DISTINCT t.id FROM topics t+ JOIN topic_voting_votes dvv ON t.id = dvv.topic_id+ LEFT JOIN topic_voting_topic_vote_count dvtvc ON t.id = dvtvc.topic_id+ WHERE dvtvc.topic_id IS NULL+ )+ INSERT INTO topic_voting_topic_vote_count (votes_count, topic_id, created_at, updated_at)+ SELECT '0', id, now(), now() FROM missing_ids+ SQL++ # correct topics vote counts+ DB.exec(<<~SQL)+ UPDATE topic_voting_topic_vote_count dvtvc+ SET votes_count = (+ SELECT COUNT(*) FROM topic_voting_votes dvv+ WHERE dvtvc.topic_id = dvv.topic_id+ GROUP BY dvv.topic_id+ )+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20240715021442_rename_topic_voting_site_settings.rb b/plugins/discourse-topic-voting/db/migrate/20240715021442_rename_topic_voting_site_settings.rbnew file mode 100644index 00000000000..c9c815f0e11--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20240715021442_rename_topic_voting_site_settings.rb@@ -0,0 +1,19 @@+# frozen_string_literal: true++class RenameTopicVotingSiteSettings < ActiveRecord::Migration[7.0]+ def up+ execute "UPDATE site_settings SET name = 'topic_voting_alert_votes_left' WHERE name = 'voting_alert_votes_left'"+ execute "UPDATE site_settings SET name = 'topic_voting_enabled' WHERE name = 'voting_enabled'"+ execute "UPDATE site_settings SET name = 'topic_voting_show_who_voted' WHERE name = 'voting_show_who_voted'"+ execute "UPDATE site_settings SET name = 'topic_voting_show_votes_on_profile' WHERE name = 'voting_show_votes_on_profile'"+ execute "UPDATE site_settings SET name = 'topic_voting_tl0_vote_limit' WHERE name = 'voting_tl0_vote_limit'"+ execute "UPDATE site_settings SET name = 'topic_voting_tl1_vote_limit' WHERE name = 'voting_tl1_vote_limit'"+ execute "UPDATE site_settings SET name = 'topic_voting_tl2_vote_limit' WHERE name = 'voting_tl2_vote_limit'"+ execute "UPDATE site_settings SET name = 'topic_voting_tl3_vote_limit' WHERE name = 'voting_tl3_vote_limit'"+ execute "UPDATE site_settings SET name = 'topic_voting_tl4_vote_limit' WHERE name = 'voting_tl4_vote_limit'"+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20240807020209_rename_incorrect_topic_voting_site_settings.rb b/plugins/discourse-topic-voting/db/migrate/20240807020209_rename_incorrect_topic_voting_site_settings.rbnew file mode 100644index 00000000000..08d7eb7e9d4--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20240807020209_rename_incorrect_topic_voting_site_settings.rb@@ -0,0 +1,63 @@+# frozen_string_literal: true++class RenameIncorrectTopicVotingSiteSettings < ActiveRecord::Migration[7.0]+ def up+ execute <<-SQL+ UPDATE site_settings SET name = 'topic_voting_alert_votes_left'+ WHERE name = 'voting_alert_votes_left' AND+ NOT EXISTS (SELECT 1 FROM site_settings WHERE name = 'topic_voting_alert_votes_left');+ SQL++ execute <<-SQL+ UPDATE site_settings SET name = 'topic_voting_enabled'+ WHERE name = 'voting_enabled' AND+ NOT EXISTS (SELECT 1 FROM site_settings WHERE name = 'topic_voting_enabled');+ SQL++ execute <<-SQL+ UPDATE site_settings SET name = 'topic_voting_show_who_voted'+ WHERE name = 'voting_show_who_voted' AND+ NOT EXISTS (SELECT 1 FROM site_settings WHERE name = 'topic_voting_show_who_voted');+ SQL++ execute <<-SQL+ UPDATE site_settings SET name = 'topic_voting_show_votes_on_profile'+ WHERE name = 'voting_show_votes_on_profile' AND+ NOT EXISTS (SELECT 1 FROM site_settings WHERE name = 'topic_voting_show_votes_on_profile');+ SQL++ execute <<-SQL+ UPDATE site_settings SET name = 'topic_voting_tl0_vote_limit'+ WHERE name = 'voting_tl0_vote_limit' AND+ NOT EXISTS (SELECT 1 FROM site_settings WHERE name = 'topic_voting_tl0_vote_limit');+ SQL++ execute <<-SQL+ UPDATE site_settings SET name = 'topic_voting_tl1_vote_limit'+ WHERE name = 'voting_tl1_vote_limit' AND+ NOT EXISTS (SELECT 1 FROM site_settings WHERE name = 'topic_voting_tl1_vote_limit');+ SQL++ execute <<-SQL+ UPDATE site_settings SET name = 'topic_voting_tl2_vote_limit'+ WHERE name = 'voting_tl2_vote_limit' AND+ NOT EXISTS (SELECT 1 FROM site_settings WHERE name = 'topic_voting_tl2_vote_limit');+ SQL++ execute <<-SQL+ UPDATE site_settings SET name = 'topic_voting_tl3_vote_limit'+ WHERE name = 'voting_tl3_vote_limit' AND+ NOT EXISTS (SELECT 1 FROM site_settings WHERE name = 'topic_voting_tl3_vote_limit');+ SQL++ execute <<-SQL+ UPDATE site_settings SET name = 'topic_voting_tl4_vote_limit'+ WHERE name = 'voting_tl4_vote_limit' AND+ NOT EXISTS (SELECT 1 FROM site_settings WHERE name = 'topic_voting_tl4_vote_limit');+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20241203125415_rename_reassign_sequences.rb b/plugins/discourse-topic-voting/db/migrate/20241203125415_rename_reassign_sequences.rbnew file mode 100644index 00000000000..e2dd754a830--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20241203125415_rename_reassign_sequences.rb@@ -0,0 +1,22 @@+# frozen_string_literal: true++class RenameReassignSequences < ActiveRecord::Migration[7.0]+ def up+ reassign_sequence("discourse_voting_topic_vote_count_id_seq", "topic_voting_topic_vote_count")+ reassign_sequence("discourse_voting_votes_id_seq", "topic_voting_votes")+ reassign_sequence("discourse_voting_category_settings_id_seq", "topic_voting_category_settings")+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end++ private++ def reassign_sequence(sequence_name, new_table_name)+ execute <<~SQL+ ALTER SEQUENCE #{sequence_name}+ OWNED BY #{new_table_name}.id;+ SQL+ end+enddiff --git a/plugins/discourse-topic-voting/db/migrate/20241210081242_rename_sequences.rb b/plugins/discourse-topic-voting/db/migrate/20241210081242_rename_sequences.rbnew file mode 100644index 00000000000..a73a4ff74d2--- /dev/null+++ b/plugins/discourse-topic-voting/db/migrate/20241210081242_rename_sequences.rb@@ -0,0 +1,28 @@+# frozen_string_literal: true++class RenameSequences < ActiveRecord::Migration[7.0]+ def up+ rename_sequence(+ "discourse_voting_topic_vote_count_id_seq",+ "topic_voting_topic_vote_count_id_seq",+ )+ rename_sequence("discourse_voting_votes_id_seq", "topic_voting_votes_id_seq")+ rename_sequence(+ "discourse_voting_category_settings_id_seq",+ "topic_voting_category_settings_id_seq",+ )+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end++ private++ def rename_sequence(existing_sequence_name, new_name)+ execute <<~SQL+ ALTER SEQUENCE #{existing_sequence_name}+ RENAME TO #{new_name};+ SQL+ end+enddiff --git a/plugins/discourse-topic-voting/db/post_migrate/20240717071658_update_data_explorer_topic_voting_queries.rb b/plugins/discourse-topic-voting/db/post_migrate/20240717071658_update_data_explorer_topic_voting_queries.rbnew file mode 100644index 00000000000..f7de4b18b9f--- /dev/null+++ b/plugins/discourse-topic-voting/db/post_migrate/20240717071658_update_data_explorer_topic_voting_queries.rb@@ -0,0 +1,26 @@+# frozen_string_literal: true++class UpdateDataExplorerTopicVotingQueries < ActiveRecord::Migration[7.0]+ def up+ has_data_explorer_queries = DB.query_single(<<~SQL).first+ SELECT EXISTS (+ SELECT FROM information_schema.tables+ WHERE table_name = 'data_explorer_queries'+ );+ SQL++ DB.exec(<<~SQL) if has_data_explorer_queries+ UPDATE data_explorer_queries+ SET sql = REPLACE(+ REPLACE(sql, 'discourse_voting_topic_vote_count', 'topic_voting_topic_vote_count'),+ 'discourse_voting_votes', 'topic_voting_votes'+ )+ WHERE sql LIKE '%discourse_voting_topic_vote_count%'+ OR sql LIKE '%discourse_voting_votes%';+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/db/post_migrate/20241203125523_drop_old_discourse_voting_tables.rb b/plugins/discourse-topic-voting/db/post_migrate/20241203125523_drop_old_discourse_voting_tables.rbnew file mode 100644index 00000000000..432b6e3c62d--- /dev/null+++ b/plugins/discourse-topic-voting/db/post_migrate/20241203125523_drop_old_discourse_voting_tables.rb@@ -0,0 +1,13 @@+# frozen_string_literal: true++class DropOldDiscourseVotingTables < ActiveRecord::Migration[7.0]+ def up+ drop_table :discourse_voting_topic_vote_count, if_exists: true+ drop_table :discourse_voting_votes, if_exists: true+ drop_table :discourse_voting_category_settings, if_exists: true+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-topic-voting/lib/discourse_topic_voting/categories_controller_extension.rb b/plugins/discourse-topic-voting/lib/discourse_topic_voting/categories_controller_extension.rbnew file mode 100644index 00000000000..f208dbf6f88--- /dev/null+++ b/plugins/discourse-topic-voting/lib/discourse_topic_voting/categories_controller_extension.rb@@ -0,0 +1,23 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ module CategoriesControllerExtension+ def category_params+ @vote_enabled ||=+ !!ActiveRecord::Type::Boolean.new.cast(params&.[](:custom_fields)&.[](:enable_topic_voting))++ category_params = super++ if @vote_enabled && !@category&.discourse_topic_voting_category_setting+ category_params[:discourse_topic_voting_category_setting_attributes] = {}+ elsif !@vote_enabled && @category&.discourse_topic_voting_category_setting+ category_params[:discourse_topic_voting_category_setting_attributes] = {+ id: @category.discourse_topic_voting_category_setting.id,+ _destroy: "1",+ }+ end++ category_params+ end+ end+enddiff --git a/plugins/discourse-topic-voting/lib/discourse_topic_voting/category_extension.rb b/plugins/discourse-topic-voting/lib/discourse_topic_voting/category_extension.rbnew file mode 100644index 00000000000..5cc7c85e51b--- /dev/null+++ b/plugins/discourse-topic-voting/lib/discourse_topic_voting/category_extension.rb@@ -0,0 +1,37 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ module CategoryExtension+ extend ActiveSupport::Concern++ prepended do+ has_one :discourse_topic_voting_category_setting,+ class_name: "DiscourseTopicVoting::CategorySetting",+ dependent: :destroy++ accepts_nested_attributes_for :discourse_topic_voting_category_setting, allow_destroy: true++ after_save :reset_voting_cache, if: -> { SiteSetting.topic_voting_enabled? }++ @allowed_voting_cache = DistributedCache.new("allowed_voting")+ end++ class_methods do+ def reset_voting_cache+ @allowed_voting_cache["allowed"] = DiscourseTopicVoting::CategorySetting.pluck(:category_id)+ end++ def can_vote?(category_id)+ return false if !SiteSetting.topic_voting_enabled++ (@allowed_voting_cache["allowed"] || reset_voting_cache).include?(category_id)+ end+ end++ protected++ def reset_voting_cache+ ::Category.reset_voting_cache+ end+ end+enddiff --git a/plugins/discourse-topic-voting/lib/discourse_topic_voting/engine.rb b/plugins/discourse-topic-voting/lib/discourse_topic_voting/engine.rbnew file mode 100644index 00000000000..8d98f813f7c--- /dev/null+++ b/plugins/discourse-topic-voting/lib/discourse_topic_voting/engine.rb@@ -0,0 +1,9 @@+# frozen_string_literal: true++module ::DiscourseTopicVoting+ class Engine < ::Rails::Engine+ engine_name PLUGIN_NAME+ isolate_namespace DiscourseTopicVoting+ config.autoload_paths << File.join(config.root, "lib")+ end+enddiff --git a/plugins/discourse-topic-voting/lib/discourse_topic_voting/list_controller_extension.rb b/plugins/discourse-topic-voting/lib/discourse_topic_voting/list_controller_extension.rbnew file mode 100644index 00000000000..dc67a37fbca--- /dev/null+++ b/plugins/discourse-topic-voting/lib/discourse_topic_voting/list_controller_extension.rb@@ -0,0 +1,38 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ module ListControllerExtension+ extend ActiveSupport::Concern++ prepended do+ before_action :ensure_discourse_topic_voting, only: %i[voted_by votes_feed]+ skip_before_action :ensure_logged_in, only: %i[voted_by votes_feed]+ end++ def voted_by+ list_opts = build_topic_list_options+ target_user = fetch_user_from_params(include_inactive: current_user.try(:staff?))+ list = generate_list_for("voted_by", target_user, list_opts)+ list.more_topics_url = url_for(construct_url_with(:next, list_opts))+ list.prev_topics_url = url_for(construct_url_with(:prev, list_opts))+ respond_with_list(list)+ end++ def votes_feed+ category_slug_path_with_id = params.require(:category_slug_path_with_id)++ @category = Category.find_by_slug_path_with_id(category_slug_path_with_id)+ @topic_list = TopicQuery.new(current_user, { category: @category.id }).list_votes++ render "list", formats: [:rss]+ end++ protected++ def ensure_discourse_topic_voting+ if !SiteSetting.topic_voting_enabled || !SiteSetting.topic_voting_show_votes_on_profile+ raise Discourse::NotFound+ end+ end+ end+enddiff --git a/plugins/discourse-topic-voting/lib/discourse_topic_voting/topic_extension.rb b/plugins/discourse-topic-voting/lib/discourse_topic_voting/topic_extension.rbnew file mode 100644index 00000000000..64e6e630a7c--- /dev/null+++ b/plugins/discourse-topic-voting/lib/discourse_topic_voting/topic_extension.rb@@ -0,0 +1,55 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ module TopicExtension+ extend ActiveSupport::Concern++ prepended do+ has_one :topic_vote_count,+ class_name: "DiscourseTopicVoting::TopicVoteCount",+ dependent: :destroy+ has_many :votes, class_name: "DiscourseTopicVoting::Vote", dependent: :destroy++ attribute :current_user_voted+ end++ def can_vote?+ @can_vote ||=+ SiteSetting.topic_voting_enabled && regular? && Category.can_vote?(category_id) &&+ category && category.topic_id != id+ end++ def vote_count+ self.topic_vote_count&.votes_count.to_i+ end++ def user_voted?(user)+ if self.current_user_voted+ self.current_user_voted == 1+ else+ votes.map(&:user_id).include?(user.id)+ end+ end++ def update_vote_count+ count = self.votes.count++ DB.exec(<<~SQL, topic_id: self.id, votes_count: count)+ INSERT INTO topic_voting_topic_vote_count+ (topic_id, votes_count, created_at, updated_at)+ VALUES+ (:topic_id, :votes_count, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)+ ON CONFLICT (topic_id) DO UPDATE SET+ votes_count = :votes_count,+ updated_at = CURRENT_TIMESTAMP+ WHERE topic_voting_topic_vote_count.topic_id = :topic_id+ SQL+ end++ def who_voted+ return if !SiteSetting.topic_voting_show_who_voted++ self.votes.map(&:user)+ end+ end+enddiff --git a/plugins/discourse-topic-voting/lib/discourse_topic_voting/topic_query_extension.rb b/plugins/discourse-topic-voting/lib/discourse_topic_voting/topic_query_extension.rbnew file mode 100644index 00000000000..5877dd7cc19--- /dev/null+++ b/plugins/discourse-topic-voting/lib/discourse_topic_voting/topic_query_extension.rb@@ -0,0 +1,21 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ module TopicQueryExtension+ def list_voted_by(user)+ create_list(:user_topics) do |topics|+ topics.joins(+ "INNER JOIN topic_voting_votes ON topic_voting_votes.topic_id = topics.id",+ ).where("topic_voting_votes.user_id = ?", user.id)+ end+ end++ def list_votes+ create_list(:votes, unordered: true) do |topics|+ topics.joins(+ "LEFT JOIN topic_voting_topic_vote_count dvtvc ON dvtvc.topic_id = topics.id",+ ).order("COALESCE(dvtvc.votes_count,'0')::integer DESC, topics.bumped_at DESC")+ end+ end+ end+enddiff --git a/plugins/discourse-topic-voting/lib/discourse_topic_voting/user_extension.rb b/plugins/discourse-topic-voting/lib/discourse_topic_voting/user_extension.rbnew file mode 100644index 00000000000..c3db1c2d390--- /dev/null+++ b/plugins/discourse-topic-voting/lib/discourse_topic_voting/user_extension.rb@@ -0,0 +1,33 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ module UserExtension+ extend ActiveSupport::Concern++ prepended { has_many :votes, class_name: "DiscourseTopicVoting::Vote", dependent: :destroy }++ def vote_count+ topics_with_vote.length+ end++ def alert_low_votes?+ (vote_limit - vote_count) <= SiteSetting.topic_voting_alert_votes_left+ end++ def topics_with_vote+ self.votes.where(archive: false)+ end++ def topics_with_archived_vote+ self.votes.where(archive: true)+ end++ def reached_voting_limit?+ vote_count >= vote_limit+ end++ def vote_limit+ SiteSetting.public_send("topic_voting_tl#{self.trust_level}_vote_limit")+ end+ end+enddiff --git a/plugins/discourse-topic-voting/lib/discourse_topic_voting/web_hook_extension.rb b/plugins/discourse-topic-voting/lib/discourse_topic_voting/web_hook_extension.rbnew file mode 100644index 00000000000..275e5222b14--- /dev/null+++ b/plugins/discourse-topic-voting/lib/discourse_topic_voting/web_hook_extension.rb@@ -0,0 +1,21 @@+# frozen_string_literal: true++module DiscourseTopicVoting+ module WebHookExtension+ extend ActiveSupport::Concern++ class_methods do+ def enqueue_topic_voting_hooks(event, topic, payload)+ if active_web_hooks(event).exists?+ WebHook.enqueue_hooks(+ :topic_voting,+ event,+ category_id: topic.category_id,+ tag_ids: topic.tags.pluck(:id),+ payload: payload,+ )+ end+ end+ end+ end+enddiff --git a/plugins/discourse-topic-voting/plugin.rb b/plugins/discourse-topic-voting/plugin.rbnew file mode 100755index 00000000000..0b993cc3c20--- /dev/null+++ b/plugins/discourse-topic-voting/plugin.rb@@ -0,0 +1,227 @@+# frozen_string_literal: true++# name: discourse-topic-voting+# about: Adds the ability to vote on topics in a specified category.+# meta_topic_id: 40121+# version: 0.5+# author: Joe Buhlig joebuhlig.com, Sam Saffron+# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-topic-voting++register_asset "stylesheets/common/topic-voting.scss"+register_asset "stylesheets/desktop/topic-voting.scss", :desktop+register_asset "stylesheets/mobile/topic-voting.scss", :mobile++enabled_site_setting :topic_voting_enabled++Discourse.top_menu_items.push(:votes)+Discourse.anonymous_top_menu_items.push(:votes)+Discourse.filters.push(:votes)+Discourse.anonymous_filters.push(:votes)++module ::DiscourseTopicVoting+ PLUGIN_NAME = "discourse-topic-voting"+end++require_relative "lib/discourse_topic_voting/engine"++after_initialize do+ reloadable_patch do+ CategoriesController.prepend(DiscourseTopicVoting::CategoriesControllerExtension)+ Category.prepend(DiscourseTopicVoting::CategoryExtension)+ ListController.prepend(DiscourseTopicVoting::ListControllerExtension)+ Topic.prepend(DiscourseTopicVoting::TopicExtension)+ TopicQuery.prepend(DiscourseTopicVoting::TopicQueryExtension)+ User.prepend(DiscourseTopicVoting::UserExtension)+ WebHook.prepend(DiscourseTopicVoting::WebHookExtension)+ end++ add_to_serializer(:post, :can_vote, include_condition: -> { object.post_number == 1 }) do+ object.topic&.can_vote?+ end++ add_to_serializer(:topic_view, :can_vote) { object.topic.can_vote? }+ add_to_serializer(:topic_view, :vote_count) { object.topic.vote_count }+ add_to_serializer(:topic_view, :user_voted) do+ scope.user ? object.topic.user_voted?(scope.user) : false+ end++ if TopicQuery.respond_to?(:results_filter_callbacks)+ TopicQuery.results_filter_callbacks << ->(_type, result, user, options) do+ result = result.includes(:topic_vote_count)++ if user+ result =+ result.select(+ "topics.*, COALESCE((SELECT 1 FROM topic_voting_votes WHERE user_id = #{user.id} AND topic_id = topics.id), 0) AS current_user_voted",+ )++ if options[:state] == "my_votes"+ result =+ result.joins(+ "INNER JOIN topic_voting_votes ON topic_voting_votes.topic_id = topics.id AND topic_voting_votes.user_id = #{user.id}",+ )+ end+ end++ if options[:order] == "votes"+ sort_dir = (options[:ascending] == "true") ? "ASC" : "DESC"+ result =+ result.joins(+ "LEFT JOIN topic_voting_topic_vote_count ON topic_voting_topic_vote_count.topic_id = topics.id",+ ).reorder(+ "COALESCE(topic_voting_topic_vote_count.votes_count,'0')::integer #{sort_dir}, topics.bumped_at DESC",+ )+ end++ result+ end+ end++ register_category_custom_field_type("enable_topic_voting", :boolean)+ add_to_serializer(:category, :custom_fields, respect_plugin_enabled: false) do+ return object.custom_fields if !SiteSetting.topic_voting_enabled++ object.custom_fields.merge(+ enable_topic_voting:+ DiscourseTopicVoting::CategorySetting.find_by(category_id: object.id).present?,+ )+ end++ add_to_serializer(:topic_list_item, :vote_count, include_condition: -> { object.can_vote? }) do+ object.vote_count+ end+ add_to_serializer(:topic_list_item, :can_vote, include_condition: -> { object.regular? }) do+ object.can_vote?+ end+ add_to_serializer(:topic_list_item, :user_voted, include_condition: -> { object.can_vote? }) do+ object.user_voted?(scope.user) if scope.user+ end+ add_to_serializer(+ :basic_category,+ :can_vote,+ include_condition: -> { Category.can_vote?(object.id) },+ ) { true }++ register_search_advanced_filter(/^min_vote_count:(\d+)$/) do |posts, match|+ posts.where(+ "(SELECT votes_count FROM topic_voting_topic_vote_count WHERE topic_voting_topic_vote_count.topic_id = posts.topic_id) >= ?",+ match.to_i,+ )+ end++ register_search_advanced_order(:votes) do |posts|+ posts.reorder(+ "COALESCE((SELECT dvtvc.votes_count FROM topic_voting_topic_vote_count dvtvc WHERE dvtvc.topic_id = topics.id), 0) DESC",+ )+ end++ add_to_serializer(:current_user, :votes_exceeded) { object.reached_voting_limit? }+ add_to_serializer(:current_user, :votes_count) { object.vote_count }+ add_to_serializer(:current_user, :votes_left) { [object.vote_limit - object.vote_count, 0].max }++ filter_order_votes = ->(scope, order_direction, _guardian) do+ scope.joins(:topic_vote_count).order(+ "COALESCE(topic_voting_topic_vote_count.votes_count, 0)::integer #{order_direction}",+ )+ end++ add_filter_custom_filter("order:votes", &filter_order_votes)++ on(:topic_status_updated) do |topic, status, enabled|+ next if topic.trashed?+ next if %w[closed autoclosed archived].exclude?(status)++ if enabled+ Jobs.enqueue(Jobs::DiscourseTopicVoting::VoteRelease, topic_id: topic.id)+ else+ is_closing_unarchived = %w[closed autoclosed].include?(status) && !topic.archived+ is_archiving_open = status == "archived" && !topic.closed++ if is_closing_unarchived || is_archiving_open+ Jobs.enqueue(Jobs::DiscourseTopicVoting::VoteReclaim, topic_id: topic.id)+ end+ end+ end++ on(:topic_trashed) do |topic|+ if !topic.closed && !topic.archived+ Jobs.enqueue(Jobs::DiscourseTopicVoting::VoteRelease, topic_id: topic.id, trashed: true)+ end+ end++ on(:topic_recovered) do |topic|+ if !topic.closed && !topic.archived+ Jobs.enqueue(Jobs::DiscourseTopicVoting::VoteReclaim, topic_id: topic.id)+ end+ end++ on(:post_edited) do |post, _, revisor|+ if SiteSetting.topic_voting_enabled && revisor.topic_diff.has_key?("category_id") &&+ DiscourseTopicVoting::Vote.exists?(topic_id: post.topic_id) && !post.topic.closed &&+ !post.topic.archived && !post.topic.trashed?+ new_category_id = post.reload.topic.category_id+ if Category.can_vote?(new_category_id)+ Jobs.enqueue(Jobs::DiscourseTopicVoting::VoteReclaim, topic_id: post.topic_id)+ else+ Jobs.enqueue(Jobs::DiscourseTopicVoting::VoteRelease, topic_id: post.topic_id)+ end+ end+ end++ on(:topic_merged) do |orig, dest|+ moved_votes = 0+ duplicated_votes = 0++ who_voted = orig.votes.map(&:user)+ if who_voted.present? && orig.closed+ who_voted.each do |user|+ next if user.blank?++ user_votes = user.topics_with_vote.pluck(:topic_id)+ user_archived_votes = user.topics_with_archived_vote.pluck(:topic_id)++ if user_votes.include?(orig.id) || user_archived_votes.include?(orig.id)+ if user_votes.include?(dest.id) || user_archived_votes.include?(dest.id)+ duplicated_votes += 1+ user.votes.destroy_by(topic_id: orig.id)+ else+ user+ .votes+ .find_by(topic_id: orig.id, user_id: user.id)+ .update!(topic_id: dest.id, archive: dest.closed)+ moved_votes += 1+ end+ else+ next+ end+ end+ end++ if moved_votes > 0+ orig.update_vote_count+ dest.update_vote_count++ if moderator_post = orig.ordered_posts.where(action_code: "split_topic").last+ moderator_post.raw << "\n\n#{I18n.t("topic_voting.votes_moved", count: moved_votes)}"+ if duplicated_votes > 0+ moderator_post.raw << " #{I18n.t("topic_voting.duplicated_votes", count: duplicated_votes)}"+ end+ moderator_post.save!+ end+ end+ end++ Discourse::Application.routes.prepend do+ get "c/*category_slug_path_with_id/l/votes.rss" => "list#votes_feed", :format => :rss+ end++ Discourse::Application.routes.append do+ mount ::DiscourseTopicVoting::Engine, at: "/voting"++ get "topics/voted-by/:username" => "list#voted_by",+ :as => "voted_by",+ :constraints => {+ username: RouteFormat.username,+ }+ end+enddiff --git a/plugins/discourse-topic-voting/spec/ensure_consistency_spec.rb b/plugins/discourse-topic-voting/spec/ensure_consistency_spec.rbnew file mode 100644index 00000000000..5eac26c980f--- /dev/null+++ b/plugins/discourse-topic-voting/spec/ensure_consistency_spec.rb@@ -0,0 +1,56 @@+# frozen_string_literal: true++require "rails_helper"+require Rails.root.join(+ "plugins/discourse-topic-voting/db/migrate/20240711102255_ensure_consistency.rb",+ )++describe EnsureConsistency do+ it "ensures consistency" do+ user = Fabricate(:user)+ user2 = Fabricate(:user)++ no_vote_topic = Fabricate(:topic)+ DiscourseTopicVoting::TopicVoteCount.create!(topic: no_vote_topic, votes_count: 10)++ one_vote_topic = Fabricate(:topic)+ DiscourseTopicVoting::TopicVoteCount.create!(topic: one_vote_topic, votes_count: 10)++ two_vote_topic = Fabricate(:topic)++ # one vote+ DiscourseTopicVoting::Vote.create!(user: user, topic: one_vote_topic, archive: true)++ # two votes+ DiscourseTopicVoting::Vote.create!(user: user, topic: two_vote_topic, archive: true)+ second_vote = DiscourseTopicVoting::Vote.create!(user: user2, topic: two_vote_topic)++ EnsureConsistency.new.up++ no_vote_topic.reload++ expect(DiscourseTopicVoting::Vote.where(user: user).pluck(:topic_id)).to eq(+ [one_vote_topic.id, two_vote_topic.id],+ )+ expect(DiscourseTopicVoting::Vote.where(user: user2).pluck(:topic_id)).to eq(+ [two_vote_topic.id],+ )++ one_vote_topic.reload+ expect(one_vote_topic.topic_vote_count.votes_count).to eq(1)++ two_vote_topic.reload+ expect(two_vote_topic.topic_vote_count.votes_count).to eq(2)++ # ensure deleted user has their vote deleted+ user2.destroy+ expect { second_vote.reload }.to raise_error(ActiveRecord::RecordNotFound)++ # ensure no topic vote counts if topic doesn't exist+ topic_to_delete = Fabricate(:topic)+ topic_vote_count =+ DiscourseTopicVoting::TopicVoteCount.create!(topic: topic_to_delete, votes_count: 10)+ topic_to_delete.destroy+ expect { topic_vote_count.reload }.to raise_error(ActiveRecord::RecordNotFound)+ end+enddiff --git a/plugins/discourse-topic-voting/spec/fabricators/topic_vote_count_fabricator.rb b/plugins/discourse-topic-voting/spec/fabricators/topic_vote_count_fabricator.rbnew file mode 100644index 00000000000..166f18f0464--- /dev/null+++ b/plugins/discourse-topic-voting/spec/fabricators/topic_vote_count_fabricator.rb@@ -0,0 +1,6 @@+# frozen_string_literal: true++Fabricator(:topic_voting_vote_count, class_name: "DiscourseTopicVoting::TopicVoteCount") do+ topic+ votes_count 1+enddiff --git a/plugins/discourse-topic-voting/spec/fabricators/topic_voting_hook_fabricator.rb b/plugins/discourse-topic-voting/spec/fabricators/topic_voting_hook_fabricator.rbnew file mode 100644index 00000000000..879bc5f8343--- /dev/null+++ b/plugins/discourse-topic-voting/spec/fabricators/topic_voting_hook_fabricator.rb@@ -0,0 +1,7 @@+# frozen_string_literal: true++Fabricator(:topic_voting_web_hook, from: :web_hook) do+ after_build do |web_hook|+ web_hook.web_hook_event_types = WebHookEventType.where(name: %w[topic_upvote topic_unvote])+ end+enddiff --git a/plugins/discourse-topic-voting/spec/fabricators/vote_fabricator.rb b/plugins/discourse-topic-voting/spec/fabricators/vote_fabricator.rbnew file mode 100644index 00000000000..0bd5755d673--- /dev/null+++ b/plugins/discourse-topic-voting/spec/fabricators/vote_fabricator.rb@@ -0,0 +1,6 @@+# frozen_string_literal: true++Fabricator(:topic_voting_votes, class_name: "DiscourseTopicVoting::Vote") do+ user+ topic+enddiff --git a/plugins/discourse-topic-voting/spec/lib/topic_extension_spec.rb b/plugins/discourse-topic-voting/spec/lib/topic_extension_spec.rbnew file mode 100644index 00000000000..13e824a1031--- /dev/null+++ b/plugins/discourse-topic-voting/spec/lib/topic_extension_spec.rb@@ -0,0 +1,41 @@+# frozen_string_literal: true++require "rails_helper"++describe DiscourseTopicVoting::TopicExtension do+ let(:user) { Fabricate(:user) }+ let(:user2) { Fabricate(:user) }++ let(:topic) { Fabricate(:topic) }+ let(:topic2) { Fabricate(:topic) }++ before do+ SiteSetting.topic_voting_enabled = true+ SiteSetting.topic_voting_show_who_voted = true+ end++ describe "#update_vote_count" do+ it "upserts topic votes count" do+ topic.update_vote_count+ topic2.update_vote_count++ expect(topic.reload.topic_vote_count.votes_count).to eq(0)+ expect(topic2.reload.topic_vote_count.votes_count).to eq(0)++ DiscourseTopicVoting::Vote.create!(user: user, topic: topic)+ topic.update_vote_count+ topic2.update_vote_count++ expect(topic.reload.topic_vote_count.votes_count).to eq(1)+ expect(topic2.reload.topic_vote_count.votes_count).to eq(0)++ DiscourseTopicVoting::Vote.create!(user: user2, topic: topic)+ DiscourseTopicVoting::Vote.create!(user: user, topic: topic2)+ topic.update_vote_count+ topic2.update_vote_count++ expect(topic.reload.topic_vote_count.votes_count).to eq(2)+ expect(topic2.reload.topic_vote_count.votes_count).to eq(1)+ end+ end+enddiff --git a/plugins/discourse-topic-voting/spec/lib/topic_query_spec.rb b/plugins/discourse-topic-voting/spec/lib/topic_query_spec.rbnew file mode 100644index 00000000000..f1cb5fd9a0d--- /dev/null+++ b/plugins/discourse-topic-voting/spec/lib/topic_query_spec.rb@@ -0,0 +1,47 @@+# frozen_string_literal: true++require "rails_helper"++describe TopicQuery do+ fab!(:user0) { Fabricate(:user) }+ fab!(:category1) { Fabricate(:category) }+ fab!(:topic0) { Fabricate(:topic, category: category1) }+ fab!(:topic1) { Fabricate(:topic, category: category1) }+ fab!(:vote) { DiscourseTopicVoting::Vote.create!(topic_id: topic1.id, user_id: user0.id) }+ fab!(:topic_vote_count) do+ DiscourseTopicVoting::TopicVoteCount.create!(topic_id: topic1.id, votes_count: 1)+ end++ before do+ SiteSetting.topic_voting_enabled = true+ SiteSetting.topic_voting_show_who_voted = true+ end++ it "order topic by votes" do+ expect(TopicQuery.new(user0, { order: "votes" }).list_latest.topics.map(&:id)).to eq(+ [topic1.id, topic0.id],+ )+ end++ it "returns topics voted by user" do+ expect(TopicQuery.new(user0, { state: "my_votes" }).list_latest.topics.map(&:id)).to eq(+ [topic1.id],+ )+ end++ it "orders topic by bumped_at if votes are equal" do+ topic2 = Fabricate(:topic, category: category1, bumped_at: 2.hours.ago)+ DiscourseTopicVoting::TopicVoteCount.create!(topic_id: topic2.id, votes_count: 2)+ topic3 = Fabricate(:topic, category: category1, bumped_at: 3.hours.ago)+ topic4 = Fabricate(:topic, category: category1, bumped_at: 1.hour.ago)++ opts = { order: "votes", per_page: 2, category: category1.slug }+ expect(TopicQuery.new(user0, opts).list_latest.topics.map(&:id)).to eq([topic2.id, topic1.id])+ expect(TopicQuery.new(user0, opts.merge(page: 1)).list_latest.topics.map(&:id)).to eq(+ [topic0.id, topic4.id],+ )+ expect(TopicQuery.new(user0, opts.merge(page: 2)).list_latest.topics.map(&:id)).to eq(+ [topic3.id],+ )+ end+enddiff --git a/plugins/discourse-topic-voting/spec/lib/topics_filter_spec.rb b/plugins/discourse-topic-voting/spec/lib/topics_filter_spec.rbnew file mode 100644index 00000000000..08e8e4421d7--- /dev/null+++ b/plugins/discourse-topic-voting/spec/lib/topics_filter_spec.rb@@ -0,0 +1,25 @@+# frozen_string_literal: true++RSpec.describe TopicsFilter do+ describe "adding order:votes to DiscoursePluginRegistry.custom_filter_mappings" do+ fab!(:topic_high) { Fabricate(:topic_voting_vote_count, votes_count: 10).topic }+ fab!(:topic_med) { Fabricate(:topic_voting_vote_count, votes_count: 5).topic }+ fab!(:topic_low) { Fabricate(:topic_voting_vote_count, votes_count: 0).topic }+ fab!(:topic_nil) { Fabricate(:topic_voting_vote_count, votes_count: nil).topic }++ it "sorts votes in ascending order" do+ expect(+ TopicsFilter+ .new(guardian: Guardian.new)+ .filter_from_query_string("order:votes-asc")+ .pluck(:id),+ ).to eq([topic_low.id, topic_nil.id, topic_med.id, topic_high.id])+ end++ it "sorts votes in default descending order" do+ expect(+ TopicsFilter.new(guardian: Guardian.new).filter_from_query_string("order:votes").pluck(:id),+ ).to eq([topic_high.id, topic_med.id, topic_low.id, topic_nil.id])+ end+ end+enddiff --git a/plugins/discourse-topic-voting/spec/requests/categories_controller_spec.rb b/plugins/discourse-topic-voting/spec/requests/categories_controller_spec.rbnew file mode 100644index 00000000000..d6024d3587b--- /dev/null+++ b/plugins/discourse-topic-voting/spec/requests/categories_controller_spec.rb@@ -0,0 +1,52 @@+# frozen_string_literal: true++require "rails_helper"++describe CategoriesController do+ fab!(:category)+ fab!(:topic) { Fabricate(:topic, category: category) }+ fab!(:admin) { Fabricate(:user, admin: true) }++ before do+ SiteSetting.topic_voting_enabled = true+ sign_in(admin)+ end++ it "enables voting correctly" do+ put "/categories/#{category.id}.json",+ params: {+ custom_fields: {+ "enable_topic_voting" => true,+ },+ }++ expect(Category.can_vote?(category.id)).to eq(true)+ end++ it "does not recreate database record" do+ category_setting = DiscourseTopicVoting::CategorySetting.create!(category: category)++ put "/categories/#{category.id}.json",+ params: {+ custom_fields: {+ "enable_topic_voting" => true,+ },+ }+ expect(DiscourseTopicVoting::CategorySetting.last.id).to eq(category_setting.id)+ end++ it "disables voting correctly" do+ put "/categories/#{category.id}.json",+ params: {+ custom_fields: {+ "enable_topic_voting" => false,+ },+ }+ expect(Category.can_vote?(category.id)).to eq(false)+ end++ it "works fine when `custom_fields` isn't passed " do+ put "/categories/#{category.id}.json", params: { hello: "world" }+ expect(response.status).to eq(200)+ end+enddiff --git a/plugins/discourse-topic-voting/spec/requests/lists_controller_spec.rb b/plugins/discourse-topic-voting/spec/requests/lists_controller_spec.rbnew file mode 100644index 00000000000..8f6f28796a7--- /dev/null+++ b/plugins/discourse-topic-voting/spec/requests/lists_controller_spec.rb@@ -0,0 +1,56 @@+# frozen_string_literal: true++require "rails_helper"++describe ListController do+ fab!(:user)+ fab!(:topic)+ # "topics/voted-by/:username"+ before { SiteSetting.topic_voting_enabled = true }++ it "allow anons to view votes" do+ DiscourseTopicVoting::Vote.create!(user: user, topic: topic)++ get "/topics/voted-by/#{user.username}.json"+ topic_json = response.parsed_body.dig("topic_list", "topics").first++ expect(topic_json["id"]).to eq(topic.id)+ end++ it "returns a 404 when we don't show votes on profiles" do+ DiscourseTopicVoting::Vote.create!(user: user, topic: topic)+ SiteSetting.topic_voting_show_votes_on_profile = false++ get "/topics/voted-by/#{user.username}.json"++ expect(response.status).to eq(404)+ end++ context "in a category" do+ fab!(:category1) { Fabricate(:category) }+ fab!(:category2) { Fabricate(:category) }+ fab!(:topic1) do+ Fabricate(:topic, category: category1, title: "Topic in votes-enabled category 1")+ end+ fab!(:topic2) do+ Fabricate(:topic, category: category2, title: "Topic in votes-enabled category 2")+ end++ before do+ DiscourseTopicVoting::CategorySetting.create!(category: category1)+ DiscourseTopicVoting::CategorySetting.create!(category: category2)+ end++ it "allows anons to view votes RSS feed" do+ DiscourseTopicVoting::Vote.create!(user: user, topic: topic1)+ DiscourseTopicVoting::Vote.create!(user: user, topic: topic2)++ get "/c/#{category2.slug}/#{category2.id}/l/votes.rss"++ expect(response.status).to eq(200)+ expect(response.body).to include(topic2.title)+ # ensure we don't include votes from other categories+ expect(response.body).not_to include(topic1.title)+ end+ end+enddiff --git a/plugins/discourse-topic-voting/spec/requests/search_controller_spec.rb b/plugins/discourse-topic-voting/spec/requests/search_controller_spec.rbnew file mode 100644index 00000000000..c80270919b0--- /dev/null+++ b/plugins/discourse-topic-voting/spec/requests/search_controller_spec.rb@@ -0,0 +1,44 @@+# frozen_string_literal: true++require "rails_helper"++describe SearchController do+ fab!(:user)++ fab!(:category)++ fab!(:topic) { Fabricate(:topic, category: category) }+ fab!(:topic_2) { Fabricate(:topic, category: category) }++ fab!(:post_1) do+ SearchIndexer.enable+ Fabricate(:post, topic: topic, raw: "this is an awesome topic")+ end++ fab!(:post_2) do+ SearchIndexer.enable+ Fabricate(:post, topic: topic_2, raw: "this is an awesome topic")+ end++ before do+ DiscourseTopicVoting::CategorySetting.create!(category: category)+ SiteSetting.topic_voting_enabled = true+ sign_in(user)+ end++ it "can search for posts ordered by votes" do+ post "/voting/vote.json", params: { topic_id: post_2.topic_id }++ expect(response.status).to eq(200)++ get "/search/query.json", params: { term: "awesome order:votes" }++ expect(response.status).to eq(200)++ data = response.parsed_body++ expect(data["posts"].length).to eq(2)+ expect(data["posts"][0]["id"]).to eq(post_2.id)+ expect(data["posts"][1]["id"]).to eq(post_1.id)+ end+enddiff --git a/plugins/discourse-topic-voting/spec/requests/votes_controller_spec.rb b/plugins/discourse-topic-voting/spec/requests/votes_controller_spec.rbnew file mode 100644index 00000000000..e2c8fb06ccb--- /dev/null+++ b/plugins/discourse-topic-voting/spec/requests/votes_controller_spec.rb@@ -0,0 +1,75 @@+# frozen_string_literal: true++require "rails_helper"++describe DiscourseTopicVoting::VotesController do+ let(:user) { Fabricate(:user) }+ let(:category) { Fabricate(:category) }+ let(:topic) { Fabricate(:topic, category_id: category.id) }++ before do+ DiscourseTopicVoting::CategorySetting.create!(category: category)+ Category.reset_voting_cache+ SiteSetting.topic_voting_show_who_voted = true+ SiteSetting.topic_voting_enabled = true+ sign_in(user)+ end++ it "does not allow voting if voting is not enabled" do+ SiteSetting.topic_voting_enabled = false+ post "/voting/vote.json", params: { topic_id: topic.id }+ expect(response.status).to eq(404)+ end++ it "can correctly show deal with voting workflow" do+ SiteSetting.public_send "topic_voting_tl#{user.trust_level}_vote_limit=", 2++ post "/voting/vote.json", params: { topic_id: topic.id }+ expect(response.status).to eq(200)++ post "/voting/vote.json", params: { topic_id: topic.id }+ expect(response.status).to eq(403)+ expect(topic.reload.vote_count).to eq(1)+ expect(user.reload.vote_count).to eq(1)++ get "/voting/who.json", params: { topic_id: topic.id }+ expect(response.status).to eq(200)+ json = JSON.parse(response.body)+ expect(json.length).to eq(1)+ expect(json.first.keys.sort).to eq(%w[avatar_template id name username])+ expect(json.first["id"]).to eq(user.id)++ post "/voting/unvote.json", params: { topic_id: topic.id }+ expect(response.status).to eq(200)++ expect(topic.reload.vote_count).to eq(0)+ expect(user.reload.vote_count).to eq(0)+ end++ it "triggers a topic_upvote webhook when voting" do+ Fabricate(:topic_voting_web_hook)+ post "/voting/vote.json", params: { topic_id: topic.id }+ expect(response.status).to eq(200)++ job_args = Jobs::EmitWebHookEvent.jobs[0]["args"].first+ expect(job_args["event_name"]).to eq("topic_upvote")+ payload = JSON.parse(job_args["payload"])+ expect(payload["topic_id"]).to eq(topic.id)+ expect(payload["topic_slug"]).to eq(topic.slug)+ expect(payload["voter_id"]).to eq(user.id)+ expect(payload["vote_count"]).to eq(1)+ end++ it "triggers a topic_unvote webhook when unvoting" do+ Fabricate(:topic_voting_web_hook)+ post "/voting/unvote.json", params: { topic_id: topic.id }+ expect(response.status).to eq(200)+ job_args = Jobs::EmitWebHookEvent.jobs[0]["args"].first+ expect(job_args["event_name"]).to eq("topic_unvote")+ payload = JSON.parse(job_args["payload"])+ expect(payload["topic_id"]).to eq(topic.id)+ expect(payload["topic_slug"]).to eq(topic.slug)+ expect(payload["voter_id"]).to eq(user.id)+ expect(payload["vote_count"]).to eq(0)+ end+enddiff --git a/plugins/discourse-topic-voting/spec/serializers/basic_category_serializer_spec.rb b/plugins/discourse-topic-voting/spec/serializers/basic_category_serializer_spec.rbnew file mode 100644index 00000000000..1d2d25d149d--- /dev/null+++ b/plugins/discourse-topic-voting/spec/serializers/basic_category_serializer_spec.rb@@ -0,0 +1,24 @@+# frozen_string_literal: true++require "rails_helper"++describe BasicCategorySerializer do+ fab!(:category)++ it "does not return can_vote when voting disabled" do+ SiteSetting.topic_voting_enabled = false++ json = BasicCategorySerializer.new(category, root: false).as_json++ expect(json[:can_vote]).to eq(nil)+ end++ it "does not return can_vote when voting disabled" do+ SiteSetting.topic_voting_enabled = true+ DiscourseTopicVoting::CategorySetting.create!(category: category)++ json = BasicCategorySerializer.new(category, root: false).as_json++ expect(json[:can_vote]).to eq(true)+ end+enddiff --git a/plugins/discourse-topic-voting/spec/serializers/category_serializer_spec.rb b/plugins/discourse-topic-voting/spec/serializers/category_serializer_spec.rbnew file mode 100644index 00000000000..92416d3aea1--- /dev/null+++ b/plugins/discourse-topic-voting/spec/serializers/category_serializer_spec.rb@@ -0,0 +1,23 @@+# frozen_string_literal: true++require "rails_helper"++describe CategorySerializer do+ fab!(:category)++ it "does not return enable_topic_voting voting disabled" do+ SiteSetting.topic_voting_enabled = false++ json = CategorySerializer.new(category, root: false).as_json++ expect(json[:custom_fields]).to eq({})+ end++ it "returns enable_topic_voting when voting enabled" do+ SiteSetting.topic_voting_enabled = true++ json = CategorySerializer.new(category, root: false).as_json++ expect(json[:custom_fields]).to eq({ "enable_topic_voting" => false })+ end+enddiff --git a/plugins/discourse-topic-voting/spec/serializers/current_user_serializer_spec.rb b/plugins/discourse-topic-voting/spec/serializers/current_user_serializer_spec.rbnew file mode 100644index 00000000000..d0b988f8928--- /dev/null+++ b/plugins/discourse-topic-voting/spec/serializers/current_user_serializer_spec.rb@@ -0,0 +1,65 @@+# frozen_string_literal: true++RSpec.describe CurrentUserSerializer do+ fab!(:user1) { Fabricate(:user, trust_level: 3) }+ let(:user2) { Fabricate(:user) }+ fab!(:guardian) { Guardian.new(user1) }+ fab!(:category)+ fab!(:topic1) { Fabricate(:topic, category_id: category.id) }+ let(:topic2) { Fabricate(:topic, category_id: category.id) }+ let(:topic3) { Fabricate(:topic, category_id: category.id) }+ let(:topic4) { Fabricate(:topic, category_id: category.id) }++ it "does not return attributes related to voting if disabled" do+ SiteSetting.topic_voting_enabled = false+ json = described_class.new(user1, scope: guardian, root: false).as_json++ expect(json[:votes_exceeded]).to eq(nil)+ expect(json[:vote_count]).to eq(nil)+ expect(json[:votes_left]).to eq(nil)+ end++ describe "votes_exceeded" do+ it "returns false when within voting limits" do+ SiteSetting.topic_voting_enabled = true+ SiteSetting.topic_voting_tl3_vote_limit = 1+ Fabricate(:topic_voting_votes, user: user2, topic: topic1)++ json = described_class.new(user1, scope: guardian, root: false).as_json++ expect(json[:votes_exceeded]).to eq(false)+ end++ it "returns true when hit voting limits" do+ SiteSetting.topic_voting_enabled = true+ SiteSetting.topic_voting_tl3_vote_limit = 1+ Fabricate(:topic_voting_votes, user: user1, topic: topic1)++ json = described_class.new(user1, scope: guardian, root: false).as_json++ expect(json[:votes_exceeded]).to eq(true)+ end+ end++ describe "votes_left" do+ it "returns the number of votes the user has left" do+ SiteSetting.topic_voting_tl3_vote_limit = 3++ json = described_class.new(user1, scope: guardian, root: false).as_json++ expect(json[:votes_left]).to eq(3)++ Fabricate(:topic_voting_votes, user: user1, topic: topic1)+ Fabricate(:topic_voting_votes, user: user1, topic: topic2)+ Fabricate(:topic_voting_votes, user: user1, topic: topic3)+ json = described_class.new(user1, scope: guardian, root: false).as_json++ expect(json[:votes_left]).to eq(0)++ Fabricate(:topic_voting_votes, user: user1, topic: topic4)+ json = described_class.new(user1, scope: guardian, root: false).as_json++ expect(json[:votes_left]).to eq(0)+ end+ end+enddiff --git a/plugins/discourse-topic-voting/spec/serializers/post_serializer_spec.rb b/plugins/discourse-topic-voting/spec/serializers/post_serializer_spec.rbnew file mode 100644index 00000000000..56fda688507--- /dev/null+++ b/plugins/discourse-topic-voting/spec/serializers/post_serializer_spec.rb@@ -0,0 +1,30 @@+# frozen_string_literal: true++require "rails_helper"++describe PostSerializer do+ let(:user) { Fabricate(:user) }+ let(:category) { Fabricate(:category) }+ let(:topic) { Fabricate(:topic, category_id: category.id) }++ before do+ DiscourseTopicVoting::CategorySetting.create!(category: category)+ Category.reset_voting_cache+ SiteSetting.topic_voting_show_who_voted = true+ SiteSetting.topic_voting_enabled = true+ end++ it "serializes can_vote for first posts only" do+ post = Fabricate(:post, topic: topic)+ json = PostSerializer.new(post, scope: Guardian.new(user), root: false).as_json+ expect(json[:can_vote]).to eq(true)++ post = Fabricate(:post, topic: topic)+ json = PostSerializer.new(post, scope: Guardian.new(user), root: false).as_json+ expect(json[:can_vote]).to eq(nil)++ post = Fabricate(:post)+ json = PostSerializer.new(post, scope: Guardian.new(user), root: false).as_json+ expect(json[:can_vote]).to eq(false)+ end+enddiff --git a/plugins/discourse-topic-voting/spec/serializers/topic_list_item_serializer_spec.rb b/plugins/discourse-topic-voting/spec/serializers/topic_list_item_serializer_spec.rbnew file mode 100644index 00000000000..b68eb5810d0--- /dev/null+++ b/plugins/discourse-topic-voting/spec/serializers/topic_list_item_serializer_spec.rb@@ -0,0 +1,49 @@+# frozen_string_literal: true++describe TopicListItemSerializer do+ let(:user) { Fabricate(:user) }+ let(:category) { Fabricate(:category) }+ let(:topic) { Fabricate(:topic, category_id: category.id) }+ let(:guardian) { Guardian.new(user) }++ it "excludes properties when voting disabled" do+ SiteSetting.topic_voting_enabled = false++ json = TopicListItemSerializer.new(topic, scope: guardian, root: false).as_json++ expect(json[:vote_count]).to eq nil+ expect(json[:user_voted]).to eq nil+ expect(json[:can_vote]).to eq nil+ end++ it "adds can_vote when enabled" do+ SiteSetting.topic_voting_enabled = true+ json = TopicListItemSerializer.new(topic, scope: guardian, root: false).as_json++ expect(json[:vote_count]).to eq nil+ expect(json[:user_voted]).to eq nil+ expect(json[:can_vote]).to eq false+ end++ it "updates vote count to 0 when topic is votable" do+ SiteSetting.topic_voting_enabled = true+ DiscourseTopicVoting::CategorySetting.create!(category: category)+ json = TopicListItemSerializer.new(topic, scope: guardian, root: false).as_json++ expect(json[:vote_count]).to eq 0+ expect(json[:user_voted]).to eq false+ expect(json[:can_vote]).to eq true+ end++ it "returns all the values" do+ SiteSetting.topic_voting_enabled = true+ DiscourseTopicVoting::CategorySetting.create!(category: category)+ Fabricate(:topic_voting_votes, user: user, topic: topic)+ Fabricate(:topic_voting_vote_count, topic: topic)+ json = TopicListItemSerializer.new(topic, scope: guardian, root: false).as_json++ expect(json[:vote_count]).to eq 1+ expect(json[:user_voted]).to eq true+ expect(json[:can_vote]).to eq true+ end+enddiff --git a/plugins/discourse-topic-voting/spec/serializers/topic_view_serializer_spec.rb b/plugins/discourse-topic-voting/spec/serializers/topic_view_serializer_spec.rbnew file mode 100644index 00000000000..7ac1a32b085--- /dev/null+++ b/plugins/discourse-topic-voting/spec/serializers/topic_view_serializer_spec.rb@@ -0,0 +1,67 @@+# frozen_string_literal: true++require "rails_helper"++describe TopicViewSerializer do+ let(:user) { Fabricate(:user) }+ let(:category) { Fabricate(:category) }+ let(:topic) { Fabricate(:topic, category_id: category.id) }+ let(:topic_view) { TopicView.new(topic, user) }+ let(:guardian) { Guardian.new(user) }++ describe "can_vote" do+ it "returns nil when voting disabled" do+ SiteSetting.topic_voting_enabled = false+ DiscourseTopicVoting::CategorySetting.create!(category: category)++ json = TopicViewSerializer.new(topic_view, scope: guardian, root: false).as_json++ expect(json[:can_vote]).to eq(nil)+ end++ it "returns false when topic not in category" do+ SiteSetting.topic_voting_enabled = true++ json = TopicViewSerializer.new(topic_view, scope: guardian, root: false).as_json++ expect(json[:can_vote]).to eq(false)+ end++ it "returns false when voting disabled and topic not in category" do+ json = TopicViewSerializer.new(topic_view, scope: guardian, root: false).as_json++ expect(json[:can_vote]).to eq(false)+ end++ it "returns true when voting enabled and topic in category" do+ SiteSetting.topic_voting_enabled = true+ DiscourseTopicVoting::CategorySetting.create!(category: category)++ json = TopicViewSerializer.new(topic_view, scope: guardian, root: false).as_json++ expect(json[:can_vote]).to eq(true)+ end+ end++ describe "vote_count" do+ it "returns the topic vote counts" do+ Fabricate(:topic_voting_vote_count, topic: topic, votes_count: 3)+ json = TopicViewSerializer.new(topic_view, scope: guardian, root: false).as_json++ expect(json[:vote_count]).to eq(3)+ end+ end++ describe "user_voted" do+ it "returns true if the user has voted on the topic" do+ json = TopicViewSerializer.new(topic_view, scope: guardian, root: false).as_json++ expect(json[:user_voted]).to eq(false)++ Fabricate(:topic_voting_votes, topic: topic, user: user)+ json = TopicViewSerializer.new(topic_view, scope: guardian, root: false).as_json++ expect(json[:user_voted]).to eq(false)+ end+ end+enddiff --git a/plugins/discourse-topic-voting/spec/system/core_features_spec.rb b/plugins/discourse-topic-voting/spec/system/core_features_spec.rbnew file mode 100644index 00000000000..db86db283bd--- /dev/null+++ b/plugins/discourse-topic-voting/spec/system/core_features_spec.rb@@ -0,0 +1,7 @@+# frozen_string_literal: true++RSpec.describe "Core features", type: :system do+ before { enable_current_plugin }++ it_behaves_like "having working core features"+enddiff --git a/plugins/discourse-topic-voting/spec/system/page_objects/pages/category.rb b/plugins/discourse-topic-voting/spec/system/page_objects/pages/category.rbnew file mode 100644index 00000000000..7872cec2794--- /dev/null+++ b/plugins/discourse-topic-voting/spec/system/page_objects/pages/category.rb@@ -0,0 +1,19 @@+# frozen_string_literal: true++module TopicVotingCategory+ include ::RSpec::Matchers++ def votes+ ".nav-item_votes.votes"+ end++ def topic_with_vote_count(vote_count)+ "tr.topic-list-item a.list-vote-count.vote-count-#{vote_count}"+ end++ def select_topic(topic)+ find("tr[data-topic-id=\"#{topic.id}\"] a.list-vote-count.vote-count-0").click+ end+end++PageObjects::Pages::Category.include(TopicVotingCategory)diff --git a/plugins/discourse-topic-voting/spec/system/page_objects/pages/topic.rb b/plugins/discourse-topic-voting/spec/system/page_objects/pages/topic.rbnew file mode 100644index 00000000000..46b5b9fa770--- /dev/null+++ b/plugins/discourse-topic-voting/spec/system/page_objects/pages/topic.rb@@ -0,0 +1,30 @@+# frozen_string_literal: true++module TopicVotingTopic+ include ::RSpec::Matchers++ def vote_count+ find(".voting .vote-count")+ end++ def vote_popup+ find(".voting-popup-menu")+ end++ def vote+ find("button.vote-button").click+ self+ end++ def remove_vote+ vote+ find(".remove-vote").click+ self+ end++ def click_vote_popup_activity+ find(".voting-popup-menu a").click+ end+end++PageObjects::Pages::Topic.include(TopicVotingTopic)diff --git a/plugins/discourse-topic-voting/spec/system/voting_spec.rb b/plugins/discourse-topic-voting/spec/system/voting_spec.rbnew file mode 100644index 00000000000..4236511973b--- /dev/null+++ b/plugins/discourse-topic-voting/spec/system/voting_spec.rb@@ -0,0 +1,57 @@+# frozen_string_literal: true++RSpec.describe "Topic voting", type: :system, js: true do+ fab!(:user)+ fab!(:admin) { Fabricate(:admin, trust_level: TrustLevel[4]) }+ fab!(:category1) { Fabricate(:category) }+ fab!(:category2) { Fabricate(:category) }+ fab!(:topic1) { Fabricate(:topic, category: category1) }+ fab!(:topic2) { Fabricate(:topic, category: category1) }+ fab!(:topic3) { Fabricate(:topic, category: category2) }+ fab!(:post1) { Fabricate(:post, topic: topic1) }+ fab!(:post2) { Fabricate(:post, topic: topic2) }+ fab!(:category_page) { PageObjects::Pages::Category.new }+ fab!(:topic_page) { PageObjects::Pages::Topic.new }+ fab!(:user_page) { PageObjects::Pages::User.new }+ fab!(:admin_page) { PageObjects::Pages::AdminSiteSettings.new }++ before do+ SiteSetting.topic_voting_enabled = true+ sign_in(admin)+ end++ it "enables voting in category topics and votes" do+ category_page.visit(category1)+ expect(category_page).to have_no_css(category_page.votes)++ # enable voting in category+ category_page+ .visit_settings(category1)+ .toggle_setting("enable-topic-voting", "Allow users to vote on topics in this category")+ .save_settings++ try_until_success { expect(Category.can_vote?(category1.id)).to eq(true) }++ # make a vote+ category_page.visit(category1)+ expect(category_page).to have_css(category_page.votes)+ expect(category_page).to have_css(category_page.topic_with_vote_count(0), count: 2)+ category_page.select_topic(topic1)++ expect(topic_page.vote_count).to have_text("0")+ topic_page.vote+ expect(topic_page.vote_popup).to have_text("You have 9 votes left, see your votes")+ expect(topic_page.vote_count).to have_text("1")++ # visit user activity page+ topic_page.click_vote_popup_activity+ expect(user_page.active_user_primary_navigation).to have_text("Activity")+ expect(user_page.active_user_secondary_navigation).to have_text("Votes")+ expect(page).to have_css(".topic-list-body tr[data-topic-id=\"#{topic1.id}\"]", text: "1 vote")+ find(".topic-list-body tr[data-topic-id=\"#{topic1.id}\"] a.raw-link").click++ # unvoting+ topic_page.remove_vote+ expect(topic_page.vote_count).to have_text("0")+ end+enddiff --git a/plugins/discourse-topic-voting/spec/voting_spec.rb b/plugins/discourse-topic-voting/spec/voting_spec.rbnew file mode 100644index 00000000000..22ee6d20827--- /dev/null+++ b/plugins/discourse-topic-voting/spec/voting_spec.rb@@ -0,0 +1,334 @@+# frozen_string_literal: true++require "rails_helper"++describe DiscourseTopicVoting do+ let!(:user0) { Fabricate(:user) }+ let!(:user1) { Fabricate(:user) }+ let!(:user2) { Fabricate(:user) }+ let!(:user3) { Fabricate(:user) }+ let!(:user4) { Fabricate(:user) }+ let!(:user5) { Fabricate(:user) }++ let(:category1) { Fabricate(:category) }+ let(:category2) { Fabricate(:category) }++ let!(:topic0) { Fabricate(:topic, category: category1) }+ let!(:topic1) { Fabricate(:topic, category: category2) }++ before do+ SiteSetting.topic_voting_enabled = true+ SiteSetting.topic_voting_show_who_voted = true+ end++ it "doesn't allow users to vote more than they are allowed" do+ SiteSetting.topic_voting_tl1_vote_limit = 1+ user0.update!(trust_level: 1)++ expect(user0.reached_voting_limit?).to eq(false)++ DiscourseTopicVoting::Vote.create!(user: user0, topic: topic0)++ expect(user0.reached_voting_limit?).to eq(true)+ end++ context "with two topics" do+ let(:users) { [user0, user1, user2, user3, user4, user5] }++ before do+ # ensure merging votes works regardless of voters' visibility+ SiteSetting.topic_voting_show_who_voted = false++ Fabricate(:post, topic: topic0, user: user0)+ Fabricate(:post, topic: topic0, user: user0)++ # +user0+ votes +topic0+, +user1+ votes +topic1+ and +user2+ votes both+ # topics.+ DiscourseTopicVoting::Vote.create!(user: users[0], topic: topic0)+ DiscourseTopicVoting::Vote.create!(user: users[1], topic: topic1)+ DiscourseTopicVoting::Vote.create!(user: users[2], topic: topic0)+ DiscourseTopicVoting::Vote.create!(user: users[2], topic: topic1)+ DiscourseTopicVoting::Vote.create!(user: users[4], topic: topic0, archive: true)+ DiscourseTopicVoting::Vote.create!(user: users[5], topic: topic0, archive: true)+ DiscourseTopicVoting::Vote.create!(user: users[5], topic: topic1)++ [topic0, topic1].each { |t| t.update_vote_count }+ end++ it "moves votes when entire topic is merged" do+ topic0.move_posts(+ Discourse.system_user,+ topic0.posts.pluck(:id),+ destination_topic_id: topic1.id,+ )++ users.each { |user| user.reload }+ expect(users[0].topics_with_vote.pluck(:topic_id)).to contain_exactly(topic1.id)+ expect(users[0].topics_with_archived_vote.pluck(:topic_id)).to be_blank++ expect(users[1].topics_with_vote.pluck(:topic_id)).to contain_exactly(topic1.id)+ expect(users[1].topics_with_archived_vote.pluck(:topic_id)).to be_blank++ expect(users[2].topics_with_vote.pluck(:topic_id)).to contain_exactly(topic1.id)+ expect(users[2].topics_with_archived_vote.pluck(:topic_id)).to be_blank++ expect(users[3].topics_with_vote.pluck(:topic_id)).to be_blank+ expect(users[3].topics_with_archived_vote.pluck(:topic_id)).to be_blank++ expect(users[4].topics_with_vote.pluck(:topic_id)).to contain_exactly(topic1.id)+ expect(users[4].topics_with_archived_vote.pluck(:topic_id)).to be_blank++ expect(users[5].topics_with_vote.pluck(:topic_id)).to contain_exactly(topic1.id)+ expect(users[5].topics_with_archived_vote.pluck(:topic_id)).to be_blank++ expect(topic0.reload.vote_count).to eq(0)+ expect(topic1.reload.vote_count).to eq(5)++ merged_post = topic0.posts.find_by(action_code: "split_topic")+ expect(merged_post.raw).to include(I18n.t("topic_voting.votes_moved", count: 2))+ expect(merged_post.raw).to include(I18n.t("topic_voting.duplicated_votes", count: 2))+ end++ it "does not move votes when not all posts are moved and the original topic does not get closed" do+ topic0.move_posts(+ Discourse.system_user,+ [topic0.posts.order(:post_number).first.id],+ destination_topic_id: topic1.id,+ )++ users.each { |user| user.reload }+ expect(users[0].topics_with_vote.pluck(:topic_id)).to contain_exactly(topic0.id)+ expect(users[0].topics_with_archived_vote.pluck(:topic_id)).to be_blank+ expect(users[1].topics_with_vote.pluck(:topic_id)).to contain_exactly(topic1.id)+ expect(users[1].topics_with_archived_vote.pluck(:topic_id)).to be_blank+ expect(users[2].topics_with_vote.pluck(:topic_id)).to contain_exactly(topic0.id, topic1.id)+ expect(users[2].topics_with_archived_vote.pluck(:topic_id)).to be_blank+ expect(users[3].topics_with_vote.pluck(:topic_id)).to be_blank+ expect(users[3].topics_with_archived_vote.pluck(:topic_id)).to be_blank+ expect(users[4].topics_with_vote.pluck(:topic_id)).to be_blank+ expect(users[4].topics_with_archived_vote.pluck(:topic_id)).to contain_exactly(topic0.id)++ expect(topic0.reload.vote_count).to eq(4)+ expect(topic1.reload.vote_count).to eq(3)+ end+ end++ context "when a user has an empty string as the votes custom field" do+ before { user0.votes.delete_all }++ it "returns a vote count of zero" do+ expect(user0.vote_count).to eq(0)+ expect(user0.topics_with_archived_vote.pluck(:topic_id)).to eq([])+ end+ end++ context "when topic status is changed" do+ it "enqueues a job for releasing/reclaiming votes" do+ blk = Proc.new { |topic| expect(topic).to be_instance_of(Topic) }+ DiscourseEvent.on(:topic_status_updated, &blk)++ topic1.update_status("closed", true, Discourse.system_user)+ expect(Jobs::DiscourseTopicVoting::VoteRelease.jobs.first["args"].first["topic_id"]).to eq(+ topic1.id,+ )++ topic1.update_status("closed", false, Discourse.system_user)+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.first["args"].first["topic_id"]).to eq(+ topic1.id,+ )+ ensure+ DiscourseEvent.off(:topic_status_updated, &blk)+ end++ it "doesn't enqueue a job for reclaiming votes if the topic is deleted" do+ topic1.update_status("closed", true, Discourse.system_user)+ expect(Jobs::DiscourseTopicVoting::VoteRelease.jobs.first["args"].first["topic_id"]).to eq(+ topic1.id,+ )++ topic1.trash!++ topic1.update_status("closed", false, Discourse.system_user)+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.length).to eq(0)+ end++ it "doesn't enqueue a job for reclaiming votes when opening an archived topic" do+ topic1.update_status("closed", true, Discourse.system_user)+ expect(Jobs::DiscourseTopicVoting::VoteRelease.jobs.first["args"].first["topic_id"]).to eq(+ topic1.id,+ )++ topic1.update_status("archived", true, Discourse.system_user)++ topic1.update_status("closed", false, Discourse.system_user)+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.length).to eq(0)+ end++ it "doesn't enqueue a job for reclaiming votes when un-archiving a closed topic" do+ topic1.update_status("archived", true, Discourse.system_user)+ expect(Jobs::DiscourseTopicVoting::VoteRelease.jobs.first["args"].first["topic_id"]).to eq(+ topic1.id,+ )++ topic1.update_status("closed", true, Discourse.system_user)++ topic1.update_status("archived", false, Discourse.system_user)+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.length).to eq(0)+ end++ it "creates notification that topic was completed" do+ Jobs.run_immediately!+ DiscourseTopicVoting::Vote.create!(user: user0, topic: topic1)+ expect { topic1.update_status("closed", true, user0) }.to change {+ user0.reload.notifications.count+ }.by(1)+ notification = user0.notifications.last+ expect(notification.topic_id).to eq(topic1.id)+ expect(JSON.parse(notification.data)["message"]).to eq("votes_released")+ end+ end++ context "when a topic is trashed and then recovered" do+ it "released the vote back to the user, then reclaims it on topic recovery" do+ Jobs.run_immediately!+ DiscourseTopicVoting::Vote.create!(user: user0, topic: topic1)++ topic1.reload.trash!+ expect(user0.reload.topics_with_vote.pluck(:topic_id)).to eq([])+ expect(user0.notifications.count).to eq(0)++ topic1.recover!+ expect(user0.reload.topics_with_vote.pluck(:topic_id)).to eq([topic1.id])+ end+ end++ context "when a topic is moved to a category" do+ let(:admin) { Fabricate(:admin) }+ let(:post0) { Fabricate(:post, topic: topic0, post_number: 1) }+ let(:post1) { Fabricate(:post, topic: topic1, post_number: 1) }++ before do+ DiscourseTopicVoting::CategorySetting.create!(category: category1)+ category1.save!+ Category.reset_voting_cache+ end++ it "enqueues a job to reclaim votes if voting is enabled for the new category" do+ user = post1.user+ DiscourseTopicVoting::Vote.create!(user: user, topic: post1.topic, archive: true)+ DiscourseTopicVoting::Vote.create!(user: user, topic_id: 456_456, archive: true)++ PostRevisor.new(post1).revise!(admin, category_id: category1.id)+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.first["args"].first["topic_id"]).to eq(+ post1.reload.topic_id,+ )++ Jobs::DiscourseTopicVoting::VoteReclaim.new.execute(topic_id: post1.topic_id)+ user.reload++ expect(user.topics_with_vote.pluck(:topic_id)).to eq([post1.topic_id])+ expect(user.topics_with_archived_vote.pluck(:topic_id)).to eq([456_456])+ end++ it "doesn't enqueue a job to reclaim votes if category not changed" do+ user = post1.user+ DiscourseTopicVoting::Vote.create!(user: user, topic: post0.topic, archive: true)+ DiscourseTopicVoting::Vote.create!(user: user, topic_id: 456_456, archive: true)++ PostRevisor.new(post0).revise!(admin, title: "Updated #{post0.topic.title}")+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.length).to eq(0)+ end++ it "doesn't enqueue a job to reclaim votes if topic is closed" do+ DiscourseTopicVoting::Vote.create!(user: post1.user, topic: post1.topic, archive: true)+ post1.topic.update_status("closed", true, Discourse.system_user)+ PostRevisor.new(post1).revise!(admin, category_id: category1.id)+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.length).to eq(0)+ end++ it "doesn't enqueue a job to reclaim votes if topic is archived" do+ DiscourseTopicVoting::Vote.create!(user: post1.user, topic: post1.topic, archive: true)+ post1.topic.update_status("archived", true, Discourse.system_user)+ PostRevisor.new(post1).revise!(admin, category_id: category1.id)+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.length).to eq(0)+ end++ it "doesn't enqueue a job to reclaim votes if topic is trashed" do+ DiscourseTopicVoting::Vote.create!(user: post1.user, topic: post1.topic, archive: true)+ post1.topic.trash!+ PostRevisor.new(post1).revise!(admin, category_id: category1.id)+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.length).to eq(0)+ end++ it "enqueues a job to release votes if voting is disabled for the new category" do+ user = post0.user+ DiscourseTopicVoting::Vote.create!(user: user, topic: post0.topic)+ DiscourseTopicVoting::Vote.create!(user: user, topic_id: 456_456)++ PostRevisor.new(post0).revise!(admin, category_id: category2.id)+ expect(Jobs::DiscourseTopicVoting::VoteRelease.jobs.first["args"].first["topic_id"]).to eq(+ post0.reload.topic_id,+ )++ Jobs::DiscourseTopicVoting::VoteRelease.new.execute(topic_id: post0.topic_id)+ user.reload++ expect(user.topics_with_archived_vote.pluck(:topic_id)).to eq([post0.topic_id])+ expect(user.topics_with_vote.pluck(:topic_id)).to eq([456_456])+ end++ it "doesn't enqueue a job if the topic has no votes" do+ PostRevisor.new(post0).revise!(admin, category_id: category2.id)+ expect(Jobs::DiscourseTopicVoting::VoteRelease.jobs.size).to eq(0)++ PostRevisor.new(post1).revise!(admin, category_id: category1.id)+ expect(Jobs::DiscourseTopicVoting::VoteReclaim.jobs.size).to eq(0)+ end+ end++ context "when a category has voting enabled/disabled" do+ let(:category3) { Fabricate(:category) }+ let(:topic2) { Fabricate(:topic, category: category3) }++ before do+ DiscourseTopicVoting::CategorySetting.create!(category: category1)++ DiscourseTopicVoting::CategorySetting.create!(category: category2)++ DiscourseTopicVoting::CategorySetting.destroy_by(category: category3)++ DiscourseTopicVoting::Vote.create(user: user0, topic: topic0)+ DiscourseTopicVoting::Vote.create(user: user0, topic: topic1)+ DiscourseTopicVoting::Vote.create(user: user0, topic: topic2, archive: true)+ end++ it "reclaims votes when voting is disabled on a category" do+ DiscourseTopicVoting::CategorySetting.destroy_by(category: category1)++ user0.reload++ expect(+ DiscourseTopicVoting::Vote.where(user: user0, archive: false).map(&:topic_id),+ ).to contain_exactly(topic1.id)+ expect(+ DiscourseTopicVoting::Vote.where(user: user0, archive: true).map(&:topic_id),+ ).to contain_exactly(topic0.id, topic2.id)+ end++ it "restores votes when voting is enabled on a category" do+ DiscourseTopicVoting::CategorySetting.create!(category: category3)++ user0.reload++ expect(+ DiscourseTopicVoting::Vote.where(user: user0, archive: false).map(&:topic_id),+ ).to contain_exactly(topic0.id, topic1.id, topic2.id)+ expect(DiscourseTopicVoting::Vote.where(user: user0, archive: true).map(&:topic_id)).to eq([])+ end++ it "is not erroring when topic without category" do+ topic1.category.destroy+ expect(topic1.reload.can_vote?).to be_falsey+ end+ end+enddiff --git a/plugins/discourse-topic-voting/test/javascripts/acceptance/user-activity-votes-test.js b/plugins/discourse-topic-voting/test/javascripts/acceptance/user-activity-votes-test.jsnew file mode 100644index 00000000000..a736e71acbb--- /dev/null+++ b/plugins/discourse-topic-voting/test/javascripts/acceptance/user-activity-votes-test.js@@ -0,0 +1,44 @@+/* eslint-disable qunit/no-assert-equal */+/* eslint-disable qunit/no-loose-assertions */+import { visit } from "@ember/test-helpers";+import { test } from "qunit";+import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";+import { i18n } from "discourse-i18n";++acceptance(+ "Discourse Voting Plugin | /activity/votes | empty state",+ function (needs) {+ const currentUser = "eviltrout";+ const anotherUser = "charlie";++ needs.user();++ needs.pretender((server, helper) => {+ const emptyResponse = { topic_list: { topics: [] } };++ server.get(`/topics/voted-by/${currentUser}.json`, () => {+ return helper.response(emptyResponse);+ });++ server.get(`/topics/voted-by/${anotherUser}.json`, () => {+ return helper.response(emptyResponse);+ });+ });++ test("When looking at the own activity page", async function (assert) {+ await visit(`/u/${currentUser}/activity/votes`);+ assert.equal(+ query(".empty-state .empty-state__title").innerText,+ i18n("topic_voting.no_votes_title_self")+ );+ });++ test("When looking at another user's activity page", async function (assert) {+ await visit(`/u/${anotherUser}/activity/votes`);+ assert.equal(+ query(".empty-state .empty-state__title").innerText,+ i18n("topic_voting.no_votes_title_others", { username: anotherUser })+ );+ });+ }+);diff --git a/translator.yml b/translator.ymlindex 7b343d89185..93661c90b1d 100644--- a/translator.yml+++ b/translator.yml@@ -281,3 +281,10 @@ files:- source_path: plugins/discourse-solved/config/locales/server.en.ymldestination_path: plugins/solved/server.ymllabel: solved++ - source_path: plugins/discourse-topic-voting/config/locales/client.en.yml+ destination_path: plugins/topic-voting/client.yml+ label: topic-voting+ - source_path: plugins/discourse-topic-voting/config/locales/server.en.yml+ destination_path: plugins/topic-voting/server.yml+ label: topic-voting