A platform for community discussion. Free, open, simple.
DEV: Move discourse-post-voting to core (#33570)
Jarek Radosz404810a6f1af
diff --git a/.github/labeler.yml b/.github/labeler.ymlindex ce7a26613e9..15022565d61 100644--- a/.github/labeler.yml+++ b/.github/labeler.yml@@ -82,6 +82,10 @@ discourse-data-explorer:- changed-files:- any-glob-to-any-file: plugins/discourse-data-explorer/**/*+discourse-post-voting:+ - changed-files:+ - any-glob-to-any-file: plugins/discourse-post-voting/**/*+footnote:- changed-files:- any-glob-to-any-file: plugins/footnote/**/*diff --git a/.gitignore b/.gitignoreindex 15ec2b54586..1dd54c2c286 100644--- a/.gitignore+++ b/.gitignore@@ -63,6 +63,7 @@!/plugins/discourse-math!/plugins/discourse-chat-integration!/plugins/discourse-data-explorer+!/plugins/discourse-post-voting/plugins/*/auto_generated/spec/fixtures/plugins/my_plugin/auto_generateddiff --git a/plugins/discourse-post-voting/README.md b/plugins/discourse-post-voting/README.mdnew file mode 100644index 00000000000..d75dbf2f33c--- /dev/null+++ b/plugins/discourse-post-voting/README.md@@ -0,0 +1,11 @@+# Discourse Post Voting++Discourse Post Voting allows the creation of topics with votable posts.++++Please refer to https://meta.discourse.org/t/227808 for more info!++## Contributions++Special thanks to [Pavilion](https://thepavilion.io/) for building https://github.com/paviliondev/discourse-question-answer which this plugin took inspirations from.diff --git a/plugins/discourse-post-voting/app/controllers/post_voting/comments_controller.rb b/plugins/discourse-post-voting/app/controllers/post_voting/comments_controller.rbnew file mode 100644index 00000000000..8dc46127f2d--- /dev/null+++ b/plugins/discourse-post-voting/app/controllers/post_voting/comments_controller.rb@@ -0,0 +1,140 @@+# frozen_string_literal: true++module PostVoting+ class CommentsController < ::ApplicationController+ requires_plugin PLUGIN_NAME++ before_action :find_post, only: %i[load_more_comments create]+ before_action :ensure_post_voting_enabled, only: %i[load_more_comments create]+ before_action :ensure_logged_in, only: %i[create destroy update]++ def load_more_comments+ @guardian.ensure_can_see!(@post)+ params.require(:last_comment_id)++ if @post.reply_to_post_number.present? && @post.post_number != 1+ raise Discourse::InvalidParameters+ end++ comments =+ PostVotingComment+ .includes(:user)+ .where("id > ? AND post_id = ?", comments_params[:last_comment_id], @post.id)+ .order(id: :asc)++ render_serialized(comments, PostVotingCommentSerializer, root: "comments")+ end++ def create+ raise Discourse::InvalidAccess if [email protected]_create_post_on_topic?(@post.topic)++ comment =+ PostVoting::CommentCreator.create(+ user: current_user,+ post_id: @post.id,+ raw: comments_params[:raw],+ )+ if comment.errors.present?+ render_json_error(comment.errors.full_messages, status: 403)+ else+ DiscourseEvent.trigger(:post_voting_comment_created, comment, comment.user)+ render_serialized(comment, PostVotingCommentSerializer, root: false)+ end+ end++ def update+ params.require(:comment_id)+ params.require(:raw)++ comment = find_comment(params[:comment_id])++ @guardian.ensure_can_see!(comment.post)+ raise Discourse::InvalidAccess if [email protected]_edit_comment?(comment)++ if comment.update(raw: params[:raw])+ Scheduler::Defer.later("Publish post voting comment edited") do+ comment.post.publish_change_to_clients!(+ :post_voting_post_comment_edited,+ comment_id: comment.id,+ comment_raw: comment.raw,+ comment_cooked: comment.cooked,+ )+ end+ DiscourseEvent.trigger(:post_voting_comment_edited, comment, comment.user)+ render_serialized(comment, PostVotingCommentSerializer, root: false)+ else+ render_json_error(comment.errors.full_messages, status: 403)+ end+ end++ def destroy+ params.require(:comment_id)+ comment = find_comment(params[:comment_id])++ @guardian.ensure_can_see!(comment.post)+ raise Discourse::InvalidAccess if [email protected]_delete_comment?(comment)++ comment.trash!++ Scheduler::Defer.later("Publish trash post voting comment") do+ comment.post.publish_change_to_clients!(+ :post_voting_post_comment_trashed,+ comment_id: comment.id,+ comments_count: PostVotingComment.where(post_id: comment.post_id).count,+ )+ end++ render json: success_json+ end++ def flag+ RateLimiter.new(current_user, "flag_post_voting_comment", 4, 1.minutes).performed!+ permitted_params =+ params.permit(%i[comment_id flag_type_id message is_warning take_action queue_for_review])++ comment = PostVotingComment.find(permitted_params[:comment_id])++ flag_type_id = permitted_params[:flag_type_id].to_i++ if !ReviewableScore.types.values.include?(flag_type_id)+ raise Discourse::InvalidParameters.new(:flag_type_id)+ end++ result =+ PostVoting::CommentReviewQueue.new.flag_comment(+ comment,+ guardian,+ flag_type_id,+ permitted_params,+ )++ if result[:success]+ render json: success_json+ else+ render_json_error(result[:errors])+ end+ end++ private++ def comments_params+ params.require(:post_id)+ params.permit(:post_id, :last_comment_id, :raw)+ end++ def find_comment(comment_id)+ comment = PostVotingComment.find_by(id: comment_id)+ raise Discourse::NotFound if comment.blank?+ comment+ end++ def find_post+ @post = Post.find_by(id: comments_params[:post_id])+ raise Discourse::NotFound if @post.blank?+ end++ def ensure_post_voting_enabled+ raise Discourse::InvalidAccess if [email protected]_post_voting_topic?+ end+ end+enddiff --git a/plugins/discourse-post-voting/app/controllers/post_voting/votes_controller.rb b/plugins/discourse-post-voting/app/controllers/post_voting/votes_controller.rbnew file mode 100644index 00000000000..ed324be63ba--- /dev/null+++ b/plugins/discourse-post-voting/app/controllers/post_voting/votes_controller.rb@@ -0,0 +1,175 @@+# frozen_string_literal: true++module PostVoting+ class VotesController < ::ApplicationController+ requires_plugin PLUGIN_NAME++ before_action :ensure_logged_in+ before_action :find_vote_post, only: %i[create destroy voters]+ before_action :ensure_can_see_post, only: %i[create destroy voters]+ before_action :ensure_post_voting_enabled, only: %i[create destroy]++ def create+ ensure_can_vote(@post)++ if PostVoting::VoteManager.vote(@post, current_user, direction: vote_params[:direction])+ render json: success_json+ else+ render json: failed_json, status: 422+ end+ end++ def create_comment_vote+ comment = find_comment+ ensure_can_see_comment!(comment)+ ensure_can_vote(comment)++ if PostVoting::VoteManager.vote(+ comment,+ current_user,+ direction: PostVotingVote.directions[:up],+ )+ render json: success_json+ else+ render json: failed_json, status: 422+ end+ end++ def destroy+ if !Topic.post_voting_votes(@post.topic, current_user).exists?+ raise Discourse::InvalidAccess.new(+ nil,+ nil,+ custom_message: "vote.error.user_has_not_voted",+ )+ end++ if !PostVoting::VoteManager.can_undo(@post, current_user)+ msg =+ I18n.t(+ "vote.error.undo_vote_action_window",+ count: SiteSetting.post_voting_undo_vote_action_window.to_i,+ )++ render_json_error(msg, status: 403)++ return+ end++ if PostVoting::VoteManager.remove_vote(@post, current_user)+ render json: success_json+ else+ render json: failed_json, status: 422+ end+ end++ def destroy_comment_vote+ comment = find_comment+ ensure_can_see_comment!(comment)++ if !PostVotingVote.exists?(votable: comment, user: current_user)+ raise Discourse::InvalidAccess.new(+ nil,+ nil,+ custom_message: "vote.error.user_has_not_voted",+ )+ end++ if PostVoting::VoteManager.remove_vote(comment, current_user)+ render json: success_json+ else+ render json: failed_json, status: 422+ end+ end++ VOTERS_LIMIT = 20++ def voters+ # TODO: Probably a site setting to hide/show voters+ voters =+ User+ .joins(:post_voting_votes)+ .where(post_voting_votes: { votable_id: @post.id, votable_type: "Post" })+ .order("post_voting_votes.created_at DESC")+ .select("users.*", "post_voting_votes.direction")+ .limit(VOTERS_LIMIT)++ render_json_dump(voters: serialize_data(voters, BasicVoterSerializer))+ end++ private++ def vote_params+ params.permit(:post_id, :comment_id, :direction)+ end++ def find_vote_post+ if params[:vote].present?+ post_id = vote_params[:post_id]+ else+ params.require(:post_id)+ post_id = params[:post_id]+ end++ @post = Post.find_by(id: post_id)++ raise Discourse::NotFound unless @post+ end++ def ensure_can_see_post+ @guardian.ensure_can_see!(@post)+ end++ def ensure_post_voting_enabled+ raise Discourse::InvalidAccess.new unless @post.is_post_voting_topic?+ end++ def find_comment+ comment = PostVotingComment.find_by(id: vote_params[:comment_id])+ raise Discourse::NotFound if comment.blank?+ comment+ end++ def ensure_can_see_comment!(comment)+ @guardian.ensure_can_see!(comment.post)+ end++ def ensure_can_vote(votable)+ if votable.user_id == current_user.id+ raise_error("post.post_voting.errors.self_voting_not_permitted")+ end++ if votable.class.name == "Post"+ raise_error("post.post_voting.errors.vote_archived_topic") if votable.topic.archived?++ raise_error("post.post_voting.errors.vote_closed_topic") if votable.topic.closed?++ direction = vote_params[:direction] || PostVotingVote.directions[:up]+ if PostVotingVote.exists?(votable: votable, user_id: current_user.id, direction: direction)+ raise_error("vote.error.one_vote_per_post")+ elsif !PostVoting::VoteManager.can_undo(votable, current_user)+ raise_error(+ "vote.error.undo_vote_action_window",+ { count: SiteSetting.post_voting_undo_vote_action_window.to_i },+ )+ end++ if votable.class.name == "PostVotingComment" &&+ PostVotingVote.exists?(votable: votable, user: current_user)+ raise_error("vote.error.one_vote_per_comment")+ end+ end+ end++ private++ def raise_error(error_message, error_message_params = nil)+ raise Discourse::InvalidAccess.new(+ nil,+ nil,+ custom_message: error_message,+ custom_message_params: error_message_params,+ )+ end+ end+enddiff --git a/plugins/discourse-post-voting/app/models/post_voting_comment.rb b/plugins/discourse-post-voting/app/models/post_voting_comment.rbnew file mode 100644index 00000000000..314424e1d08--- /dev/null+++ b/plugins/discourse-post-voting/app/models/post_voting_comment.rb@@ -0,0 +1,101 @@+# frozen_string_literal: true++class PostVotingComment < ActiveRecord::Base+ include Trashable+ include HasCustomFields++ # Bump this when changing MARKDOWN_FEATURES or MARKDOWN_IT_RULES+ COOKED_VERSION = 1++ belongs_to :post+ belongs_to :user++ before_save { ensure_last_editor_id }++ validates :post_id, presence: true+ validates :user_id, presence: true+ validates :raw, presence: true+ validates :cooked, presence: true+ validates :cooked_version, presence: true++ validate :ensure_can_comment, on: [:create]++ validates_with PostVotingCommentValidator++ before_validation :cook_raw, if: :will_save_change_to_raw?++ has_many :votes, class_name: "PostVotingVote", as: :votable, dependent: :delete_all++ MARKDOWN_FEATURES = %w[censored emoji]++ MARKDOWN_IT_RULES = %w[emphasis backticks linkify link]++ def self.cook(raw)+ raw.gsub!(/(\n)+/, " ")+ PrettyText.cook(raw, features_override: MARKDOWN_FEATURES, markdown_it_rules: MARKDOWN_IT_RULES)+ end++ def url+ Post.find(post_id).url+ end++ def full_url+ "#{Discourse.base_url}#{url}"+ end++ private++ def cook_raw+ self.cooked = self.class.cook(self.raw)+ self.cooked_version = COOKED_VERSION #TODO automatic rebaking once version is bumped+ end++ def ensure_can_comment+ if !post.is_post_voting_topic?+ errors.add(:base, I18n.t("post_voting.comment.errors.post_voting_not_enabled"))+ elsif post.reply_to_post_number.present?+ errors.add(:base, I18n.t("post_voting.comment.errors.not_permitted"))+ elsif self.class.where(post_id: self.post_id).count >=+ SiteSetting.post_voting_comment_limit_per_post+ errors.add(+ :base,+ I18n.t(+ "post_voting.comment.errors.limit_exceeded",+ limit: SiteSetting.post_voting_comment_limit_per_post,+ ),+ )+ end+ end++ def ensure_last_editor_id+ self.last_editor_id ||= self.user_id+ end+end++# == Schema Information+#+# Table name: post_voting_comments+#+# id :bigint not null, primary key+# post_id :integer not null+# user_id :integer not null+# raw :text not null+# cooked :text not null+# cooked_version :integer+# deleted_at :datetime+# deleted_by_id :integer+# created_at :datetime not null+# updated_at :datetime not null+# qa_vote_count :integer default(0)+# last_editor_id :integer not null+#+# Indexes+#+# index_post_voting_comments_on_deleted_by_id (deleted_by_id) WHERE (deleted_by_id IS NOT NULL)+# index_post_voting_comments_on_last_editor_id (last_editor_id)+# index_post_voting_comments_on_post_id (post_id)+# index_post_voting_comments_on_user_id (user_id)+# post_voting_comments_deleted_by_id_idx (deleted_by_id) WHERE (deleted_by_id IS NOT NULL)+# post_voting_comments_post_id_idx (post_id)+# post_voting_comments_user_id_idx (user_id)+#diff --git a/plugins/discourse-post-voting/app/models/post_voting_comment_custom_field.rb b/plugins/discourse-post-voting/app/models/post_voting_comment_custom_field.rbnew file mode 100644index 00000000000..5fdb37d1071--- /dev/null+++ b/plugins/discourse-post-voting/app/models/post_voting_comment_custom_field.rb@@ -0,0 +1,21 @@+# frozen_string_literal: true++class PostVotingCommentCustomField < ActiveRecord::Base+ belongs_to :post_voting_comment+end++# == Schema Information+#+# Table name: post_voting_comment_custom_fields+#+# id :bigint not null, primary key+# post_voting_comment_id :bigint not null+# name :string(256) not null+# value :text+# created_at :datetime not null+# updated_at :datetime not null+#+# Indexes+#+# idx_post_voting_comment_custom_fields (post_voting_comment_id,name)+#diff --git a/plugins/discourse-post-voting/app/models/post_voting_vote.rb b/plugins/discourse-post-voting/app/models/post_voting_vote.rbnew file mode 100644index 00000000000..7f29b80cf91--- /dev/null+++ b/plugins/discourse-post-voting/app/models/post_voting_vote.rb@@ -0,0 +1,77 @@+# frozen_string_literal: true++class PostVotingVote < ActiveRecord::Base+ belongs_to :votable, polymorphic: true+ belongs_to :user++ VOTABLE_TYPES = %w[Post PostVotingComment]++ validates :direction, inclusion: { in: %w[up down] }+ validates :votable_type, presence: true, inclusion: { in: VOTABLE_TYPES }+ validates :votable_id, presence: true+ validates :user_id, presence: true+ validate :ensure_valid_vote+ validate :ensure_valid_post, if: -> { votable_type == "Post" }+ validate :ensure_valid_comment, if: -> { votable_type == "PostVotingComment" }++ def self.directions+ @directions ||= { up: "up", down: "down" }+ end++ def self.reverse_direction(direction)+ if direction == directions[:up]+ directions[:down]+ elsif direction == directions[:down]+ directions[:up]+ else+ raise "Invalid direction: #{direction}"+ end+ end++ private++ def ensure_valid_comment+ comment = votable++ if direction != PostVotingVote.directions[:up]+ errors.add(:base, I18n.t("post.post_voting.errors.comment_cannot_be_downvoted"))+ end++ if !comment.post.is_post_voting_topic?+ errors.add(:base, I18n.t("post.post_voting.errors.post_voting_not_enabled"))+ end+ end++ def ensure_valid_post+ post = votable++ if !post.is_post_voting_topic?+ errors.add(:base, I18n.t("post.post_voting.errors.post_voting_not_enabled"))+ elsif post.reply_to_post_number.present?+ errors.add(:base, I18n.t("post.post_voting.errors.voting_not_permitted"))+ end+ end++ def ensure_valid_vote+ if votable.user_id == user_id+ errors.add(:base, I18n.t("post.post_voting.errors.self_voting_not_permitted"))+ end+ end+end++# == Schema Information+#+# Table name: post_voting_votes+#+# id :bigint not null, primary key+# user_id :integer not null+# created_at :datetime not null+# direction :string not null+# votable_type :string not null+# votable_id :bigint not null+#+# Indexes+#+# post_voting_votes_votable_type_and_votable_id_and_user_id_idx (votable_type,votable_id,user_id) UNIQUE+# post_voting_votes_votable_type_votable_id_user_id_idx (votable_type,votable_id,user_id) UNIQUE+#diff --git a/plugins/discourse-post-voting/app/models/reviewable_post_voting_comment.rb b/plugins/discourse-post-voting/app/models/reviewable_post_voting_comment.rbnew file mode 100644index 00000000000..a855ca9777e--- /dev/null+++ b/plugins/discourse-post-voting/app/models/reviewable_post_voting_comment.rb@@ -0,0 +1,189 @@+# frozen_string_literal: true++class ReviewablePostVotingComment < Reviewable+ def serializer+ ReviewablePostVotingCommentSerializer+ end++ def self.action_aliases+ {+ agree_and_keep_hidden: :agree_and_delete,+ agree_and_silence: :agree_and_delete,+ agree_and_suspend: :agree_and_delete,+ delete_and_agree: :agree_and_delete,+ }+ end++ def flagged_by_user_ids+ @flagged_by_user_ids ||= reviewable_scores.map(&:user_id)+ end++ def post+ nil+ end++ def comment+ @comment ||= (target || PostVotingComment.with_deleted.find_by(id: target_id))+ end++ def comment_creator+ @comment_creator ||= User.find_by(id: comment.user_id)+ end++ def build_actions(actions, guardian, args)+ return unless pending?+ return if comment.blank?++ agree =+ actions.add_bundle("#{id}-agree", icon: "thumbs-up", label: "reviewables.actions.agree.title")++ if comment.deleted_at?+ build_action(actions, :agree_and_restore, icon: "far-eye", bundle: agree)+ build_action(actions, :agree_and_keep_deleted, icon: "thumbs-up", bundle: agree)+ build_action(actions, :disagree_and_restore, icon: "thumbs-down")+ else+ build_action(actions, :agree_and_delete, icon: "far-eye-slash", bundle: agree)+ build_action(actions, :agree_and_keep_comment, icon: "thumbs-up", bundle: agree)+ build_action(actions, :disagree, icon: "thumbs-down")+ end++ if guardian.can_suspend?(comment_creator)+ build_action(+ actions,+ :agree_and_suspend,+ icon: "ban",+ bundle: agree,+ client_action: "suspend",+ )+ build_action(+ actions,+ :agree_and_silence,+ icon: "microphone-slash",+ bundle: agree,+ client_action: "silence",+ )+ end++ ignore_bundle = actions.add_bundle("#{id}-ignore", label: "reviewables.actions.ignore.title")++ build_action(actions, :ignore, icon: "up-right-from-square", bundle: ignore_bundle)++ unless comment.deleted_at?+ build_action(actions, :delete_and_agree, icon: "far-trash-can", bundle: ignore_bundle)+ end+ end++ def perform_agree_and_keep_comment(performed_by, args)+ agree+ end++ def perform_agree_and_restore(performed_by, args)+ agree { comment.recover! }+ end++ def perform_agree_and_delete(performed_by, args)+ agree { comment.trash!(performed_by) }+ end++ def perform_disagree_and_restore(performed_by, args)+ disagree { comment.recover! }+ end++ def perform_disagree(performed_by, args)+ disagree+ end++ def perform_ignore(performed_by, args)+ ignore+ end++ def perform_delete_and_ignore(performed_by, args)+ ignore { comment.trash!(performed_by) }+ end++ private++ def agree+ yield if block_given?+ create_result(:success, :approved) do |result|+ result.update_flag_stats = { status: :agreed, user_ids: flagged_by_user_ids }+ result.recalculate_score = true+ end+ end++ def disagree+ yield if block_given?++ UserSilencer.unsilence(comment_creator)++ create_result(:success, :rejected) do |result|+ result.update_flag_stats = { status: :disagreed, user_ids: flagged_by_user_ids }+ result.recalculate_score = true+ end+ end++ def ignore+ yield if block_given?+ create_result(:success, :ignored) do |result|+ result.update_flag_stats = { status: :ignored, user_ids: flagged_by_user_ids }+ end+ end++ def build_action(+ actions,+ id,+ icon:,+ button_class: nil,+ bundle: nil,+ client_action: nil,+ confirm: false+ )+ actions.add(id, bundle: bundle) do |action|+ prefix = "reviewables.actions.#{id}"+ action.icon = icon+ action.button_class = button_class+ action.label = "post_voting.comment.#{prefix}.title"+ action.description = "post_voting.comment.#{prefix}.description"+ action.client_action = client_action+ action.confirm_message = "#{prefix}.confirm" if confirm+ end+ end+end++# == Schema Information+#+# Table name: reviewables+#+# id :bigint not null, primary key+# type :string not null+# status :integer default("pending"), not null+# created_by_id :integer not null+# reviewable_by_moderator :boolean default(FALSE), not null+# category_id :integer+# topic_id :integer+# score :float default(0.0), not null+# potential_spam :boolean default(FALSE), not null+# target_id :integer+# target_type :string+# target_created_by_id :integer+# payload :json+# version :integer default(0), not null+# latest_score :datetime+# created_at :datetime not null+# updated_at :datetime not null+# force_review :boolean default(FALSE), not null+# reject_reason :text+# potentially_illegal :boolean default(FALSE)+# type_source :string default("unknown"), not null+#+# Indexes+#+# idx_reviewables_score_desc_created_at_desc (score,created_at)+# index_reviewables_on_reviewable_by_group_id (reviewable_by_group_id)+# index_reviewables_on_status_and_created_at (status,created_at)+# index_reviewables_on_status_and_score (status,score)+# index_reviewables_on_status_and_type (status,type)+# index_reviewables_on_target_id_where_post_type_eq_post (target_id) WHERE ((target_type)::text = 'Post'::text)+# index_reviewables_on_topic_id_and_status_and_created_by_id (topic_id,status,created_by_id)+# index_reviewables_on_type_and_target_id (type,target_id) UNIQUE+#diff --git a/plugins/discourse-post-voting/app/serializers/basic_voter_serializer.rb b/plugins/discourse-post-voting/app/serializers/basic_voter_serializer.rbnew file mode 100644index 00000000000..90d091627c9--- /dev/null+++ b/plugins/discourse-post-voting/app/serializers/basic_voter_serializer.rb@@ -0,0 +1,9 @@+# frozen_string_literal: true++class BasicVoterSerializer < ApplicationSerializer+ attributes :id, :username, :name, :avatar_template, :direction++ def direction+ object.direction+ end+enddiff --git a/plugins/discourse-post-voting/app/serializers/post_voting_comment_serializer.rb b/plugins/discourse-post-voting/app/serializers/post_voting_comment_serializer.rbnew file mode 100644index 00000000000..90a5944c065--- /dev/null+++ b/plugins/discourse-post-voting/app/serializers/post_voting_comment_serializer.rb@@ -0,0 +1,51 @@+# frozen_string_literal: true++class PostVotingCommentSerializer < ApplicationSerializer+ attributes :id,+ :user_id,+ :name,+ :username,+ :created_at,+ :raw,+ :cooked,+ :post_voting_vote_count,+ :user_voted,+ :available_flags,+ :reviewable_id++ attr_accessor :comments_user_voted++ def name+ object.user&.name+ end++ def username+ object.user&.username+ end++ def user_voted+ if @comments_user_voted+ @comments_user_voted[object.id]+ else+ scope.present? && object.votes.exists?(user: scope.user)+ end+ end++ def reviewable_id+ return @reviewable_id if defined?(@reviewable_id)+ return @reviewable_id = nil unless @options && @options[:reviewable_ids]++ @reviewable_id = @options[:reviewable_ids][object.id]+ end++ def available_flags+ return [] if !scope.can_flag_post_voting_comment?(object)+ return [] if reviewable_id.present? && user_flag_status == ReviewableScore.statuses[:pending]++ PostActionType.flag_types.map { |sym, id| sym }+ end++ def post_voting_vote_count+ object.qa_vote_count+ end+enddiff --git a/plugins/discourse-post-voting/app/serializers/reviewable_post_voting_comments_serializer.rb b/plugins/discourse-post-voting/app/serializers/reviewable_post_voting_comments_serializer.rbnew file mode 100644index 00000000000..7e0d32f6a18--- /dev/null+++ b/plugins/discourse-post-voting/app/serializers/reviewable_post_voting_comments_serializer.rb@@ -0,0 +1,21 @@+# frozen_string_literal: true++require_dependency "reviewable_serializer"++class ReviewablePostVotingCommentSerializer < ReviewableSerializer+ target_attributes :cooked, :raw, :comment_cooked, :post_id+ payload_attributes :comment_cooked, :transcript_topic_id, :cooked, :raw, :created_by+ attributes :target_id, :comment_cooked++ def created_from_flag?+ true+ end++ def target_id+ object.target&.id+ end++ def comment_cooked+ object.payload["comment_cooked"]+ end+enddiff --git a/plugins/discourse-post-voting/app/validators/post_voting_comment_validator.rb b/plugins/discourse-post-voting/app/validators/post_voting_comment_validator.rbnew file mode 100644index 00000000000..3b7bc8b0c06--- /dev/null+++ b/plugins/discourse-post-voting/app/validators/post_voting_comment_validator.rb@@ -0,0 +1,23 @@+# frozen_string_literal: true++class PostVotingCommentValidator < ActiveModel::Validator+ def validate(record)+ raw_validator(record)+ end++ private++ def raw_validator(record)+ StrippedLengthValidator.validate(+ record,+ :raw,+ record.raw,+ SiteSetting.min_post_length..SiteSetting.post_voting_comment_max_raw_length,+ )++ sentinel = TextSentinel.body_sentinel(record.raw)+ record.errors.add(:raw, I18n.t(:is_invalid)) unless sentinel.valid?++ WatchedWordsValidator.new(attributes: [:raw]).validate(record)+ end+enddiff --git a/plugins/discourse-post-voting/app/views/connectors/after_post_body/comments.html.erb b/plugins/discourse-post-voting/app/views/connectors/after_post_body/comments.html.erbnew file mode 100644index 00000000000..c9ce925bc8b--- /dev/null+++ b/plugins/discourse-post-voting/app/views/connectors/after_post_body/comments.html.erb@@ -0,0 +1,26 @@+<% if @topic_view.topic.is_post_voting? %>+ <div class="post-voting-comments">+ <% @topic_view.comments[post.id]&.each_with_index do |comment, i| %>+ <div class="post-voting-comment-row">+ <span class="post-voting-comment-cooked" itemprop="comment"><%= comment.cooked.html_safe %></span>+ <span class="post-voting-comment-info-separator">–</span>+ <span class="post-voting-comment-creator" itemprop="author" itemscope itemtype="http://schema.org/Person">+ <a itemprop="url" href='<%= Discourse.base_url %>/u/<%= comment.user.username %>'><span itemprop="name"><%= comment.user.username %></span></a>+ <time itemprop='datePublished' datetime='<%= comment.created_at.to_formatted_s(:iso8601) %>' class="post-voting-comment-time">+ (<%= l comment.created_at, format: :long %>)+ </time>+ </span>+ </div>+ <% end %>+ </div>++ <%+ reply_count = @topic_view.filtered_posts.count - 1+ if post.post_number == 1 && reply_count > 0+ %>+ <div class="post-voting-answer-count">+ <h3><%= t('topic.post-voting.answer_count', count: reply_count) %></h3>+ <span class="post-voting-answer-count-span" itemprop="answerCount"><%= reply_count %></span>+ </div>+ <% end %>+<% end %>diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-answer-button.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-answer-button.gjsnew file mode 100644index 00000000000..7383319cb68--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-answer-button.gjs@@ -0,0 +1,31 @@+import Component from "@glimmer/component";+import { service } from "@ember/service";+import DButton from "discourse/components/d-button";+import concatClass from "discourse/helpers/concat-class";++export default class PostVotingAnswerButton extends Component {+ static shouldRender(args) {+ return args.state.canCreatePost && args.post.post_number === 1;+ }++ @service site;++ get showLabel() {+ return this.site.desktopView;+ }++ <template>+ <DButton+ class={{concatClass+ "post-action-menu__post-voting-answer"+ "reply"+ (if this.showLabel "create fade-out")+ }}+ ...attributes+ @action={{@buttonActions.replyToPost}}+ @icon="reply"+ @label={{if this.showLabel "post_voting.topic.answer.label"}}+ @title="post_voting.topic.answer.help"+ />+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-answer-header.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-answer-header.gjsnew file mode 100644index 00000000000..f65b0e8f1f7--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-answer-header.gjs@@ -0,0 +1,87 @@+import Component from "@glimmer/component";+import { action } from "@ember/object";+import { not } from "truth-helpers";+import DButton from "discourse/components/d-button";+import concatClass from "discourse/helpers/concat-class";+import { i18n } from "discourse-i18n";++export const ORDER_BY_ACTIVITY_FILTER = "activity";++export default class PostVotingAnswerHeader extends Component {+ static shouldRender(args) {+ const post = args.post;++ if (!post?.topic?.is_post_voting) {+ return false;+ }++ const repliesToPostNumber =+ args.topicPageQueryParams.replies_to_post_number;+ const positionInStream =+ repliesToPostNumber && parseInt(repliesToPostNumber, 10) !== 1 ? 2 : 1;+ const answersCount = post.topic.posts_count - 1;++ return (+ answersCount > 0 &&+ post.id === post.topic.postStream.stream[positionInStream]+ );+ }++ get post() {+ return this.args.outletArgs.post;+ }++ get answersCount() {+ return this.post.topic.posts_count - 1;+ }++ get sortedByActivity() {+ return (+ this.args.outletArgs.topicPageQueryParams.filter ===+ ORDER_BY_ACTIVITY_FILTER+ );+ }++ @action+ async orderByVotes() {+ await this.post.topic.postStream.orderStreamByVotes();+ this.args.outletArgs.actions.updateTopicPageQueryParams();+ }++ @action+ async orderByActivity() {+ await this.post.topic.postStream.orderStreamByActivity();+ this.args.outletArgs.actions.updateTopicPageQueryParams();+ }++ <template>+ <div class="post-voting-answers-header small-action">+ <span class="post-voting-answers-headers-count">+ {{i18n "post_voting.topic.answer_count" count=this.answersCount}}+ </span>+ <span class="post-voting-answers-headers-sort">+ <span>+ {{i18n "post_voting.topic.activity"}}+ </span>+ <DButton+ class={{concatClass+ "post-voting-answers-headers-sort-votes"+ (unless this.sortedByActivity "active")+ }}+ @disabled={{not this.sortedByActivity}}+ @label="post_voting.topic.votes"+ @action={{this.orderByVotes}}+ />+ <DButton+ class={{concatClass+ "post-voting-answers-headers-sort-activity"+ (if this.sortedByActivity "active")+ }}+ @disabled={{this.sortedByActivity}}+ @label="post_voting.topic.activity"+ @action={{this.orderByActivity}}+ />+ </span>+ </div>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-button.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-button.gjsnew file mode 100644index 00000000000..ffe5fd7cdab--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-button.gjs@@ -0,0 +1,50 @@+import Component from "@glimmer/component";+import { on } from "@ember/modifier";+import { action } from "@ember/object";+import DButton from "discourse/components/d-button";+import concatClass from "discourse/helpers/concat-class";++export default class PostVotingButton extends Component {+ get buttonClasses() {+ let classes =+ this.args.direction === "up"+ ? "post-voting-button-upvote"+ : "post-voting-button-downvote";++ if (this.args.voted) {+ classes += " post-voting-button-voted";+ }++ return classes;+ }++ get disabled() {+ return this.args.disabled || this.args.loading;+ }++ get iconName() {+ return this.args.direction === "up" ? "caret-up" : "caret-down";+ }++ @action+ onClick() {+ if (this.args.loading) {+ return false;+ }++ if (this.args.voted) {+ this.args.removeVote(this.args.direction);+ } else {+ this.args.vote(this.args.direction);+ }+ }++ <template>+ <DButton+ {{on "click" this.onClick}}+ @disabled={{this.disabled}}+ @icon={{this.iconName}}+ class={{concatClass "btn-flat post-voting-button" this.buttonClasses}}+ />+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment-actions.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment-actions.gjsnew file mode 100644index 00000000000..b0d74c09b34--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment-actions.gjs@@ -0,0 +1,99 @@+import Component from "@glimmer/component";+import { action } from "@ember/object";+import { service } from "@ember/service";+import DButton from "discourse/components/d-button";+import FlagModal from "discourse/components/modal/flag";+import { ajax } from "discourse/lib/ajax";+import { popupAjaxError } from "discourse/lib/ajax-error";+import { i18n } from "discourse-i18n";+import PostVotingFlag from "../lib/post-voting-flag";++export default class PostVotingCommentActions extends Component {+ @service dialog;+ @service modal;+ @service currentUser;+ @service siteSettings;+ @service site;++ comment = this.args.comment;++ hasPermission() {+ return (+ this.comment.user_id === this.currentUser.id ||+ this.currentUser.admin ||+ this.currentUser.moderator+ );+ }++ get canEdit() {+ return this.currentUser && this.hasPermission && !this.args.disabled;+ }++ get canFlag() {+ return (+ this.currentUser &&+ (this.hasPermission || this.currentUser.can_flag_post_voting_comments) &&+ !this.args.disabled+ );+ }++ @action+ deleteConfirm() {+ this.dialog.deleteConfirm({+ message: i18n("post_voting.post.post_voting_comment.delete.confirm"),+ didConfirm: () => {+ const data = { comment_id: this.args.id };++ ajax("/post_voting/comments", {+ type: "DELETE",+ data,+ })+ .then(() => {+ this.args.removeComment(this.args.id);+ })+ .catch(popupAjaxError);+ },+ });+ }++ @action+ showFlag() {+ this.comment.availableFlags = this.comment.available_flags;+ this.modal.show(FlagModal, {+ model: {+ flagTarget: new PostVotingFlag(),+ flagModel: this.comment,+ setHidden: () => (this.comment.hidden = true),+ site: this.site,+ },+ });+ }++ <template>+ {{#if this.canEdit}}+ <span class="post-voting-comment-actions">+ <DButton+ @display="link"+ class="post-voting-comment-actions-edit-link"+ @action={{@updateComment}}+ @icon="pencil"+ />+ <DButton+ @display="link"+ class="post-voting-comment-actions-delete-link"+ @action={{this.deleteConfirm}}+ @icon="far-trash-can"+ />++ {{#if this.canFlag}}+ <DButton+ @display="link"+ class="post-voting-comment-actions-flag-link"+ @action={{this.showFlag}}+ @icon="flag"+ />+ {{/if}}+ </span>+ {{/if}}+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment-composer.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment-composer.gjsnew file mode 100644index 00000000000..7f163e21b16--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment-composer.gjs@@ -0,0 +1,66 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { on } from "@ember/modifier";+import { action } from "@ember/object";+import { service } from "@ember/service";+import { i18n } from "discourse-i18n";++export default class PostVotingCommentComposer extends Component {+ @service siteSettings;++ @tracked value = this.args.raw ?? "";++ @action+ onInput(event) {+ this.value = event.target.value;+ this.args.onInput?.(event.target.value);+ }++ get errorMessage() {+ if (this.value.length < this.siteSettings.min_post_length) {+ return i18n("post_voting.post.post_voting_comment.composer.too_short", {+ count: this.siteSettings.min_post_length,+ });+ }++ if (+ this.value.length > this.siteSettings.post_voting_comment_max_raw_length+ ) {+ return i18n("post_voting.post.post_voting_comment.composer.too_long", {+ count: this.siteSettings.post_voting_comment_max_raw_length,+ });+ }+ }++ get remainingCharacters() {+ return (+ this.siteSettings.post_voting_comment_max_raw_length - this.value.length+ );+ }++ <template>+ <div class="post-voting-comment-composer">+ <textarea+ class="post-voting-comment-composer-textarea"+ value={{this.value}}+ {{on "input" this.onInput}}+ {{on "keydown" @onKeyDown}}+ ></textarea>++ {{#if this.value.length}}+ {{#if this.errorMessage}}+ <div class="post-voting-comment-composer-flash error">+ {{this.errorMessage}}+ </div>+ {{else}}+ <div class="post-voting-comment-composer-flash">+ {{i18n+ "post_voting.post.post_voting_comment.composer.length_ok"+ count=this.remainingCharacters+ }}+ </div>+ {{/if}}+ {{/if}}+ </div>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment-editor.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment-editor.gjsnew file mode 100644index 00000000000..f473ea3803e--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment-editor.gjs@@ -0,0 +1,75 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { action } from "@ember/object";+import { service } from "@ember/service";+import DButton from "discourse/components/d-button";+import { ajax } from "discourse/lib/ajax";+import { popupAjaxError } from "discourse/lib/ajax-error";+import PostVotingCommentComposer from "./post-voting-comment-composer";++export default class PostVotingCommentEditor extends Component {+ @service siteSettings;++ @tracked value = this.args.raw;+ @tracked submitDisabled = true;++ @action+ updateValue(value) {+ this.value = value;+ this.submitDisabled =+ value.length < this.siteSettings.min_post_length ||+ value.length > this.siteSettings.post_voting_comment_max_raw_length;+ }++ @action+ onKeyDown(e) {+ if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {+ this.saveComment();+ }+ }++ @action+ saveComment() {+ this.submitDisabled = true;++ const data = {+ comment_id: this.args.id,+ raw: this.value,+ };++ return ajax("/post_voting/comments", {+ type: "PUT",+ data,+ })+ .then(this.args.onSave)+ .catch(popupAjaxError)+ .finally(() => {+ this.submitDisabled = false;+ });+ }++ <template>+ <div class="post-voting-comment-editor post-voting-comment-editor-{{@id}}">+ <PostVotingCommentComposer+ @onInput={{this.updateValue}}+ @raw={{@raw}}+ @onKeyDown={{this.onKeyDown}}+ />++ <DButton+ @action={{this.saveComment}}+ @disabled={{this.submitDisabled}}+ @label="post_voting.post.post_voting_comment.edit"+ @icon="pencil"+ class="btn-primary post-voting-comment-editor-submit"+ />++ <DButton+ @display="link"+ @action={{@onCancel}}+ @label="post_voting.post.post_voting_comment.cancel"+ class="post-voting-comment-editor-cancel"+ />+ </div>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment.gjsnew file mode 100644index 00000000000..47f51247e55--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment.gjs@@ -0,0 +1,163 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { action } from "@ember/object";+import { service } from "@ember/service";+import formatDate from "discourse/helpers/format-date";+import formatUsername from "discourse/helpers/format-username";+import htmlSafe from "discourse/helpers/html-safe";+import routeAction from "discourse/helpers/route-action";+import { ajax } from "discourse/lib/ajax";+import { popupAjaxError } from "discourse/lib/ajax-error";+import { i18n } from "discourse-i18n";+import PostVotingButton from "./post-voting-button";+import PostVotingCommentActions from "./post-voting-comment-actions";+import PostVotingCommentEditor from "./post-voting-comment-editor";++export function buildAnchorId(commentId) {+ return `post-voting-comment-${commentId}`;+}++export default class PostVotingComment extends Component {+ @service currentUser;++ @tracked isEditing = false;+ @tracked isVoting = false;+ @tracked hidden = false;++ get anchorId() {+ return buildAnchorId(this.args.comment.id);+ }++ @action+ onSave(comment) {+ this.args.updateComment(comment);+ this.collapseEditor();+ }++ @action+ onCancel() {+ this.collapseEditor();+ }++ @action+ removeVote() {+ this.isVoting = true;++ this.args.removeVote(this.args.comment.id);++ return ajax("/post_voting/vote/comment", {+ type: "DELETE",+ data: { comment_id: this.args.comment.id },+ })+ .catch((e) => {+ this.args.vote(this.args.comment.id);+ popupAjaxError(e);+ })+ .finally(() => {+ this.isVoting = false;+ });+ }++ @action+ vote(direction) {+ if (direction !== "up") {+ return;+ }++ this.isVoting = true;++ this.args.vote(this.args.comment.id);++ return ajax("/post_voting/vote/comment", {+ type: "POST",+ data: { comment_id: this.args.comment.id },+ })+ .catch((e) => {+ this.args.removeVote(this.args.comment.id);+ popupAjaxError(e);+ })+ .finally(() => {+ this.isVoting = false;+ });+ }++ @action+ expandEditor() {+ this.isEditing = true;+ }++ @action+ collapseEditor() {+ this.isEditing = false;+ }++ <template>+ <div+ id={{this.anchorId}}+ class="post-voting-comment+ {{if @comment.deleted 'post-voting-comment-deleted'}}"+ >+ {{#if this.isEditing}}+ <PostVotingCommentEditor+ @id={{@comment.id}}+ @raw={{@comment.raw}}+ @onSave={{this.onSave}}+ @onCancel={{this.onCancel}}+ />+ {{else}}+ <div class="post-voting-comment-actions-vote">+ {{#if @comment.post_voting_vote_count}}+ <span+ class="post-voting-comment-actions-vote-count"+ >{{@comment.post_voting_vote_count}}</span>+ {{/if}}++ <PostVotingButton+ @direction="up"+ @loading={{@isVoting}}+ @voted={{@comment.user_voted}}+ @removeVote={{this.removeVote}}+ @vote={{if this.currentUser this.vote (routeAction "showLogin")}}+ @disabled={{@disabled}}+ />+ </div>++ <div class="post-voting-comment-post">+ <span class="post-voting-comment-cooked">{{htmlSafe+ @comment.cooked+ }}</span>++ <span class="post-voting-comment-info-separator">–</span>++ {{#if @comment.username}}+ <a+ class="post-voting-comment-info-username"+ data-user-card={{@comment.username}}+ >+ {{formatUsername @comment.username}}+ </a>+ {{else}}+ <span+ class="post-voting-comment-info-username post-voting-comment-info-username-deleted"+ >+ {{i18n "post_voting.post.post_voting_comment.user.deleted"}}+ </span>+ {{/if}}++ <span class="post-voting-comment-info-created">+ {{formatDate @comment.created_at}}+ </span>++ <PostVotingCommentActions+ @id={{@comment.id}}+ @updateComment={{this.expandEditor}}+ @removeComment={{@removeComment}}+ @comment={{@comment}}+ @disabled={{@disabled}}+ />++ </div>+ {{/if}}+ </div>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comments-menu-composer.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comments-menu-composer.gjsnew file mode 100644index 00000000000..fee2ca5e342--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comments-menu-composer.gjs@@ -0,0 +1,72 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { action } from "@ember/object";+import { service } from "@ember/service";+import DButton from "discourse/components/d-button";+import { ajax } from "discourse/lib/ajax";+import { popupAjaxError } from "discourse/lib/ajax-error";+import PostVotingCommentComposer from "./post-voting-comment-composer";++export default class PostVotingCommentsMenuComposer extends Component {+ @service siteSettings;++ @tracked value = "";+ @tracked submitDisabled = true;++ @action+ onKeyDown(e) {+ if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {+ this.saveComment();+ }+ }++ @action+ updateValue(value) {+ this.submitDisabled =+ value.length < this.siteSettings.min_post_length ||+ value.length > this.siteSettings.post_voting_comment_max_raw_length;+ this.value = value;+ }++ @action+ saveComment() {+ this.submitDisabled = true;++ return ajax("/post_voting/comments", {+ type: "POST",+ data: { raw: this.value, post_id: this.args.id },+ })+ .then((response) => {+ this.args.onSave(response);+ this.value = "";+ })+ .catch(popupAjaxError)+ .finally(() => {+ this.submitDisabled = false;+ });+ }++ <template>+ <div class="post-voting-comments-menu-composer">+ <PostVotingCommentComposer+ @onInput={{this.updateValue}}+ @onKeyDown={{this.onKeyDown}}+ />++ <DButton+ @action={{this.saveComment}}+ @disabled={{this.submitDisabled}}+ @icon="reply"+ @label="post_voting.post.post_voting_comment.submit"+ class="btn-primary post-voting-comments-menu-composer-submit"+ />++ <DButton+ @display="link"+ @action={{@onCancel}}+ @label="post_voting.post.post_voting_comment.cancel"+ class="post-voting-comments-menu-composer-cancel"+ />+ </div>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comments-menu.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comments-menu.gjsnew file mode 100644index 00000000000..3722fd4c1cc--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comments-menu.gjs@@ -0,0 +1,112 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { action } from "@ember/object";+import { schedule } from "@ember/runloop";+import { service } from "@ember/service";+import { Promise } from "rsvp";+import DButton from "discourse/components/d-button";+import routeAction from "discourse/helpers/route-action";+import { ajax } from "discourse/lib/ajax";+import { popupAjaxError } from "discourse/lib/ajax-error";+import { i18n } from "discourse-i18n";+import PostVotingCommentsMenuComposer from "./post-voting-comments-menu-composer";++export default class PostVotingCommentsMenu extends Component {+ @service currentUser;++ @tracked expanded = false;++ get hasMoreComments() {+ return this.args.moreCommentCount > 0;+ }++ @action+ handleSave(comment) {+ this.closeComposer();+ this.args.appendComments([comment]);+ }++ @action+ expandComposer() {+ this.expanded = true;++ this.fetchComments().then(() => {+ schedule("afterRender", () => {+ const textArea = document.querySelector(+ `#post_${this.args.postNumber} .post-voting-comment-composer .post-voting-comment-composer-textarea`+ );+ textArea.focus();+ textArea.select();+ });+ });+ }++ @action+ closeComposer() {+ this.expanded = false;+ }++ @action+ fetchComments() {+ if (!this.args.id) {+ return Promise.resolve();+ }++ const data = {+ post_id: this.args.id,+ last_comment_id: this.args.lastCommentId,+ };++ return ajax("/post_voting/comments", {+ type: "GET",+ data,+ })+ .then((response) => {+ if (response.comments.length > 0) {+ this.args.appendComments(response.comments);+ }+ })+ .catch(popupAjaxError);+ }++ <template>+ <div class="post-voting-comments-menu">+ {{#if this.expanded}}+ <PostVotingCommentsMenuComposer+ @id={{@id}}+ @onSave={{this.handleSave}}+ @onCancel={{this.closeComposer}}+ />+ {{else}}+ <DButton+ @display="link"+ @action={{if+ this.currentUser+ this.expandComposer+ (routeAction "showLogin")+ }}+ @label="post_voting.post.post_voting_comment.add"+ class="post-voting-comment-add-link"+ />+ {{/if}}++ {{#if this.hasMoreComments}}+ {{#unless this.expanded}}+ <span class="post-voting-comments-menu-separator"></span>+ {{/unless}}++ <div class="post-voting-comments-menu-show-more">+ <DButton+ @display="link"+ @action={{this.fetchComments}}+ @translatedLabel={{i18n+ "post_voting.post.post_voting_comment.show"+ count=@moreCommentCount+ }}+ class="post-voting-comments-menu-show-more-link"+ />+ </div>+ {{/if}}+ </div>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comments.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comments.gjsnew file mode 100644index 00000000000..0834fcc2806--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comments.gjs@@ -0,0 +1,103 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { action } from "@ember/object";+import PostVotingComment from "./post-voting-comment";+import PostVotingCommentsMenu from "./post-voting-comments-menu";++export default class PostVotingComments extends Component {+ @tracked comments = this.args.post.comments;++ get moreCommentCount() {+ return this.args.post.comments_count - this.comments.length;+ }++ get lastCommentId() {+ return this.comments?.[this.comments.length - 1]?.id ?? 0;+ }++ get disabled() {+ return this.args.post.topic.closed || this.args.post.topic.archived;+ }++ @action+ appendComments(comments) {+ this.comments.pushObjects(comments);+ }++ @action+ removeComment(commentId) {+ const indexToRemove = this.comments.findIndex(+ (comment) => comment.id === commentId+ );++ if (indexToRemove !== -1) {+ const comment = { ...this.comments[indexToRemove], deleted: true };++ this.comments.replace(indexToRemove, 1, [comment]);+ this.args.post.comments_count--;+ }+ }++ @action+ updateComment(comment) {+ const index = this.comments.findIndex(+ (oldComment) => oldComment.id === comment.id+ );+ this.comments.replace(index, 1, [comment]);+ }++ @action+ vote(commentId) {+ const index = this.comments.findIndex(+ (oldComment) => oldComment.id === commentId+ );+ const comment = this.comments[index];++ const updatedComment = {+ ...comment,+ post_voting_vote_count: comment.post_voting_vote_count + 1,+ user_voted: true,+ };+ this.comments.replace(index, 1, [updatedComment]);+ }++ @action+ removeVote(commentId) {+ const index = this.comments.findIndex(+ (oldComment) => oldComment.id === commentId+ );+ const comment = this.comments[index];++ const updatedComment = {+ ...comment,+ post_voting_vote_count: comment.post_voting_vote_count - 1,+ user_voted: false,+ };+ this.comments.replace(index, 1, [updatedComment]);+ }++ <template>+ <div class="post-voting-comments">+ {{#each this.comments as |comment|}}+ <PostVotingComment+ @comment={{comment}}+ @removeComment={{this.removeComment}}+ @updateComment={{this.updateComment}}+ @vote={{this.vote}}+ @removeVote={{this.removeVote}}+ @disabled={{this.disabled}}+ />+ {{/each}}++ {{#if @canCreatePost}}+ <PostVotingCommentsMenu+ @id={{@post.id}}+ @postNumber={{@post.post_number}}+ @moreCommentCount={{this.moreCommentCount}}+ @lastCommentId={{this.lastCommentId}}+ @appendComments={{this.appendComments}}+ />+ {{/if}}+ </div>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-vote-controls.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-vote-controls.gjsnew file mode 100644index 00000000000..f45a5ba5e37--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-vote-controls.gjs@@ -0,0 +1,147 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { action } from "@ember/object";+import { service } from "@ember/service";+import DButton from "discourse/components/d-button";+import { popupAjaxError } from "discourse/lib/ajax-error";+import { castVote, removeVote } from "../lib/post-voting-utilities";+import PostVotingButton from "./post-voting-button";+import PostVotingWhoVotedList from "./post-voting-who-voted-list";++export default class PostVotingVoteControls extends Component {+ @service currentUser;++ @tracked loading;+ @tracked showWhoVoted = false;++ get count() {+ return this.args.post_voting_vote_count || 0;+ }++ get disabled() {+ return this.args.post.topic.archived || this.args.post.topic.closed;+ }++ get hasVotes() {+ return this.args.post.post_voting_has_votes;+ }++ get votedUp() {+ return this.args.post.post_voting_user_voted_direction === "up";+ }++ get votedDown() {+ return this.args.post.post_voting_user_voted_direction === "down";+ }++ @action+ async removeVote(direction) {+ const post = this.args.post;+ const countChange = direction === "up" ? -1 : 1;++ post.post_voting_user_voted_direction = null;+ post.post_voting_vote_count = post.post_voting_vote_count + countChange;++ const voteCount = post.post_voting_vote_count;++ this.loading = true;++ try {+ return await removeVote({ post_id: post.id });+ } catch (error) {+ post.post_voting_user_voted_direction = direction;+ post.post_voting_vote_count = voteCount - countChange;++ popupAjaxError(error);+ } finally {+ this.loading = false;+ }+ }++ @action+ async vote(direction) {+ if (!this.currentUser) {+ return this.args.showLogin();+ }++ const post = this.args.post;++ let vote = {+ post_id: post.id,+ direction,+ };++ const isUpVote = direction === "up";+ let countChange;++ if (post.post_voting_user_voted_direction) {+ countChange = isUpVote ? 2 : -2;+ } else {+ countChange = isUpVote ? 1 : -1;+ }++ post.post_voting_user_voted_direction = direction;+ post.post_voting_vote_count = post.post_voting_vote_count + countChange;++ const voteCount = post.post_voting_vote_count;++ this.loading = true;++ try {+ return await castVote(vote);+ } catch (error) {+ post.setProperties({+ post_voting_user_voted_direction: null,+ post_voting_vote_count: voteCount - countChange,+ });+ popupAjaxError(error);+ } finally {+ this.loading = false;+ }+ }++ @action+ toggleWhoVoted() {+ this.showWhoVoted = !this.showWhoVoted;+ }++ <template>+ <div class="post-voting-post">+ <PostVotingButton+ @direction="up"+ @disabled={{this.disabled}}+ @loading={{this.loading}}+ @removeVote={{this.removeVote}}+ @vote={{this.vote}}+ @voted={{this.votedUp}}+ />++ {{#if this.hasVotes}}+ <DButton+ class="post-voting-post-toggle-voters btn-flat"+ @action={{this.toggleWhoVoted}}+ @translatedLabel={{@post.post_voting_vote_count}}+ />+ {{#if this.showWhoVoted}}+ <PostVotingWhoVotedList+ @post={{@post}}+ @onClickOutside={{this.toggleWhoVoted}}+ />+ {{/if}}+ {{else}}+ <span class="post-voting-post-toggle-voters">+ {{this.count}}+ </span>+ {{/if}}++ <PostVotingButton+ @direction="down"+ @disabled={{this.disabled}}+ @loading={{this.loading}}+ @removeVote={{this.removeVote}}+ @vote={{this.vote}}+ @voted={{this.votedDown}}+ />+ </div>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-who-voted-list.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-who-voted-list.gjsnew file mode 100644index 00000000000..247f4d35fc4--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-who-voted-list.gjs@@ -0,0 +1,102 @@+import Component from "@glimmer/component";+import { hash } from "@ember/helper";+import { action, get } from "@ember/object";+import { eq } from "truth-helpers";+import AsyncContent from "discourse/components/async-content";+import SmallUserList, {+ smallUserAttrs,+} from "discourse/components/small-user-list";+import icon from "discourse/helpers/d-icon";+import { bind } from "discourse/lib/decorators";+import closeOnClickOutside from "discourse/modifiers/close-on-click-outside";+import { i18n } from "discourse-i18n";+import { whoVoted } from "../lib/post-voting-utilities";++export default class PostVotingWhoVotedList extends Component {+ @bind+ calcRemainingCount(voters) {+ return this.args.post.post_voting_vote_count - voters.length;+ }++ @bind+ splitUpAndDownLists(voters) {+ const upVoters = [];+ const downVoters = [];++ voters.forEach((voter) => {+ if (voter.direction === "up") {+ upVoters.push(voter);+ } else if (voter.direction === "down") {+ downVoters.push(voter);+ }+ });++ return { up: upVoters, down: downVoters };+ }++ @action+ async loadWhoVoted() {+ const result = await whoVoted({ post_id: this.args.post.id });++ return result.voters?.map((voter) => {+ const userAttrs = smallUserAttrs(voter);+ userAttrs.direction = voter.direction;+ return userAttrs;+ });+ }++ <template>+ <div+ class="post-voting-post-list"+ {{closeOnClickOutside+ @onClickOutside+ (hash+ targetSelector=".post-voting-post-list"+ secondaryTargetSelector=".post-voting-post-toggle-voters"+ )+ }}+ >+ <AsyncContent @asyncData={{this.loadWhoVoted}}>+ <:loading>+ {{i18n "loading"}}+ </:loading>+ <:content as |voters|>+ {{#if whoVoted}}+ {{#let (this.splitUpAndDownLists voters) as |splitVoters|}}+ <PostVotingSmallUserList+ @list={{get splitVoters "up"}}+ @direction="up"+ />+ <PostVotingSmallUserList+ @list={{get splitVoters "down"}}+ @direction="down"+ />+ {{/let}}+ {{#let (this.calcRemainingCount voters) as |remainingCount|}}+ {{#if remainingCount}}+ <span>+ {{i18n+ "post_voting.topic.voters_count_diff"+ count=remainingCount+ }}+ </span>+ {{/if}}+ {{/let}}+ {{/if}}+ </:content>+ </AsyncContent>+ </div>+ </template>+}++const PostVotingSmallUserList = <template>+ {{#if @list}}+ <div class="post-voting-post-list-voters-wrapper">+ <span class="post-voting-post-list-icon">+ {{icon (if (eq @direction "up") "caret-up" "caret-down")}}+ </span>+ <span class="post-voting-post-list-count">{{@list.length}}</span>+ <SmallUserList class="post-voting-post-list-voters" @users={{@list}} />+ </div>+ {{/if}}+</template>;diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/reviewable-post-voting-comment.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/reviewable-post-voting-comment.gjsnew file mode 100644index 00000000000..d81dbd50631--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/reviewable-post-voting-comment.gjs@@ -0,0 +1,69 @@+import Component from "@glimmer/component";+import { tracked } from "@glimmer/tracking";+import { array } from "@ember/helper";+import { LinkTo } from "@ember/routing";+import { service } from "@ember/service";+import { or } from "truth-helpers";+import ReviewableCreatedBy from "discourse/components/reviewable-created-by";+import ReviewablePostHeader from "discourse/components/reviewable-post-header";+import categoryBadge from "discourse/helpers/category-badge";+import htmlSafe from "discourse/helpers/html-safe";+import { i18n } from "discourse-i18n";++export default class ReviewablePostVotingComment extends Component {+ @service store;++ @tracked post;++ constructor() {+ super(...arguments);+ this.fetchPost();+ }++ async fetchPost() {+ const post = await this.store.find("post", this.args.reviewable.post_id);+ this.post = post;+ }++ <template>+ <div class="post-topic">+ <a class="title-text" href={{this.post.url}}>+ {{htmlSafe @reviewable.topic.fancyTitle}}</a>+ {{categoryBadge @reviewable.category}}+ </div>++ <div class="post-contents-wrapper">+ <ReviewableCreatedBy+ @user={{@reviewable.target_created_by}}+ @tagName=""+ />+ <div class="post-contents">+ <ReviewablePostHeader+ @reviewable={{@reviewable}}+ @createdBy={{@reviewable.target_created_by}}+ @tagName=""+ />++ <div class="post-body">+ {{htmlSafe+ (or @reviewable.payload.comment_cooked @reviewable.cooked)+ }}+ </div>++ {{#if @reviewable.payload.transcript_topic_id}}+ <div class="transcript">+ <LinkTo+ @route="topic"+ @models={{array "-" @reviewable.payload.transcript_topic_id}}+ class="btn btn-small"+ >+ {{i18n "review.transcript.view"}}+ </LinkTo>+ </div>+ {{/if}}++ {{yield}}+ </div>+ </div>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/connectors/category-custom-settings/post-voting-category-settings.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/connectors/category-custom-settings/post-voting-category-settings.gjsnew file mode 100644index 00000000000..4ba41b7174f--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/connectors/category-custom-settings/post-voting-category-settings.gjs@@ -0,0 +1,29 @@+import Component, { Input } from "@ember/component";+import { classNames, tagName } from "@ember-decorators/component";+import { i18n } from "discourse-i18n";++@tagName("")+@classNames("category-custom-settings-outlet", "post-voting-category-settings")+export default class PostVotingCategorySettings extends Component {+ <template>+ <h3>{{i18n "category.post_voting_settings_heading"}}</h3>+ <section class="field">+ <label>+ <Input+ id="create-as-post-voting-default"+ @type="checkbox"+ @checked={{this.category.custom_fields.create_as_post_voting_default}}+ />+ {{i18n "category.create_as_post_voting_default"}}+ </label>+ <label>+ <Input+ id="only-post-voting-in-this-category"+ @type="checkbox"+ @checked={{this.category.custom_fields.only_post_voting_in_this_category}}+ />+ {{i18n "category.only_post_voting_in_this_category"}}+ </label>+ </section>+ </template>+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/connectors/topic-above-post-stream/add-post-voting-topic-page-class.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/connectors/topic-above-post-stream/add-post-voting-topic-page-class.gjsnew file mode 100644index 00000000000..f0a847a82d8--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/connectors/topic-above-post-stream/add-post-voting-topic-page-class.gjs@@ -0,0 +1,17 @@+import { eq } from "truth-helpers";+import bodyClass from "discourse/helpers/body-class";+import { ORDER_BY_ACTIVITY_FILTER } from "../../components/post-voting-answer-header";++const AddPostVotingTopicPageClass = <template>+ {{#if @outletArgs.model.is_post_voting}}+ {{bodyClass+ (if+ (eq @outletArgs.model.postStream.filter ORDER_BY_ACTIVITY_FILTER)+ "post-voting-topic-sort-by-activity"+ "post-voting-topic"+ )+ }}+ {{/if}}+</template>;++export default AddPostVotingTopicPageClass;diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/custom-post-message-callbacks.js b/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/custom-post-message-callbacks.jsnew file mode 100644index 00000000000..6dadca14b54--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/custom-post-message-callbacks.js@@ -0,0 +1,128 @@+import { withPluginApi } from "discourse/lib/plugin-api";++export default {+ name: "custom-post-message-callbacks",+ initialize(container) {+ const siteSettings = container.lookup("service:site-settings");++ if (!siteSettings.post_voting_enabled) {+ return;+ }++ withPluginApi("1.2.0", (api) => {+ api.registerCustomPostMessageCallback(+ "post_voting_post_comment_edited",+ (topicController, message) => {+ const postStream = topicController.get("model.postStream");+ const post = postStream.findLoadedPost(message.id);++ if (post) {+ const indexToUpdate = post.comments.findIndex(+ (comment) =>+ comment.id === message.comment_id &&+ comment.raw !== message.comment_raw+ );++ if (indexToUpdate !== -1) {+ const updatedComment = {+ ...post.comments[indexToUpdate],+ raw: message.comment_raw,+ cooked: message.comment_cooked,+ };+ post.comments.replace(indexToUpdate, 1, [updatedComment]);++ topicController.appEvents.trigger("post-stream:refresh", {+ id: post.id,+ });+ }+ }+ }+ );++ api.registerCustomPostMessageCallback(+ "post_voting_post_comment_trashed",+ (topicController, message) => {+ const postStream = topicController.get("model.postStream");+ const post = postStream.findLoadedPost(message.id);++ if (post) {+ const indexToDelete = post.comments.findIndex(+ (comment) => comment.id === message.comment_id && !comment.deleted+ );++ if (indexToDelete !== -1) {+ const comment = {+ ...post.comments[indexToDelete],+ deleted: true,+ };+ post.comments.replace(indexToDelete, 1, [comment]);+ }++ post.set("comments_count", message.comments_count);++ topicController.appEvents.trigger("post-stream:refresh", {+ id: post.id,+ });+ }+ }+ );++ api.registerCustomPostMessageCallback(+ "post_voting_post_commented",+ (topicController, message) => {+ const postStream = topicController.get("model.postStream");+ const post = postStream.findLoadedPost(message.id);++ if (+ post &&+ !post.comments.some((comment) => comment.id === message.comment.id)+ ) {+ post.setProperties({+ comments_count: message.comments_count,+ });++ if (+ post.comments_count - post.comments.length <= 1 &&+ topicController.currentUser.id !== message.comment.user_id+ ) {+ post.comments.pushObject(message.comment);+ }++ topicController.appEvents.trigger("post-stream:refresh", {+ id: post.id,+ });+ }+ }+ );++ api.registerCustomPostMessageCallback(+ "post_voting_post_voted",+ (topicController, message) => {+ const postStream = topicController.get("model.postStream");+ const post = postStream.findLoadedPost(message.id);++ if (post) {+ const props = {+ post_voting_vote_count: message.post_voting_vote_count,+ post_voting_has_votes: message.post_voting_has_votes,+ };++ if (+ topicController.currentUser.id ===+ message.post_voting_user_voted_id+ ) {+ props.post_voting_user_voted_direction =+ message.post_voting_user_voted_direction;+ }++ post.setProperties(props);++ topicController.appEvents.trigger("post-stream:refresh", {+ id: post.id,+ });+ }+ }+ );+ });+ },+};diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/extend-composer-actions.js b/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/extend-composer-actions.jsnew file mode 100644index 00000000000..b7c1b54fdc5--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/extend-composer-actions.js@@ -0,0 +1,124 @@+import { observer } from "@ember/object";+import { withPluginApi } from "discourse/lib/plugin-api";+import { CREATE_TOPIC } from "discourse/models/composer";+import { i18n } from "discourse-i18n";++export default {+ name: "extend-composer-actions",+ after: "inject-objects",+ initialize(container) {+ const siteSettings = container.lookup("service:site-settings");++ if (!siteSettings.post_voting_enabled) {+ return;+ }++ withPluginApi("0.13.0", (api) => {+ api.serializeOnCreate("create_as_post_voting", "createAsPostVoting");+ api.serializeOnCreate(+ "only_post_voting_in_this_category",+ "onlyPostVotingInThisCategory"+ );++ api.customizeComposerText({+ actionTitle(model) {+ if (model.createAsPostVoting || model.onlyPostVotingInThisCategory) {+ return i18n("composer.create_post_voting.label");+ } else if (model.topic?.is_post_voting) {+ return i18n("post_voting.topic.answer.label");+ } else {+ return null;+ }+ },++ saveLabel(model) {+ if (model.createAsPostVoting || model.onlyPostVotingInThisCategory) {+ return "composer.create_post_voting.label";+ } else if (model.topic?.is_post_voting) {+ return "post_voting.topic.answer.label";+ } else {+ return null;+ }+ },+ });++ api.modifyClass("component:composer-actions", {+ pluginId: "discourse-post-voting",++ togglePostVotingSelected(options, model) {+ model.toggleProperty("createAsPostVoting");+ model.notifyPropertyChange("replyOptions");+ model.notifyPropertyChange("action");+ },+ });++ api.modifySelectKit("composer-actions").appendContent((options) => {+ if (options.action === CREATE_TOPIC) {+ if (+ options.composerModel.createAsPostVoting &&+ !options.composerModel.onlyPostVotingInThisCategory+ ) {+ return [+ {+ name: i18n(+ "composer.composer_actions.remove_as_post_voting.label"+ ),+ description: i18n(+ "composer.composer_actions.remove_as_post_voting.desc"+ ),+ icon: "plus",+ id: "togglePostVoting",+ },+ ];+ } else if (options.composerModel.onlyPostVotingInThisCategory) {+ return [];+ } else {+ return [+ {+ name: i18n(+ "composer.composer_actions.create_as_post_voting.label"+ ),+ description: i18n(+ "composer.composer_actions.create_as_post_voting.desc"+ ),+ icon: "plus",+ id: "togglePostVoting",+ },+ ];+ }+ } else {+ return [];+ }+ });++ api.modifyClass("model:composer", {+ pluginId: "discourse-post-voting",++ categoryCreateAsPostVotingDefault: observer("categoryId", function () {+ const createAsPostVoting =+ this.category?.create_as_post_voting_default;++ const onlyPostVotingInThisCategory =+ this.category?.only_post_voting_in_this_category;++ if (this.creatingTopic && onlyPostVotingInThisCategory) {+ this.set("createAsPostVoting", true);+ this.set(+ "onlyPostVotingInThisCategory",+ onlyPostVotingInThisCategory+ );+ this.notifyPropertyChange("replyOptions");+ this.notifyPropertyChange("action");+ } else if (+ this.creatingTopic &&+ createAsPostVoting !== this.createAsPostVoting+ ) {+ this.set("createAsPostVoting", createAsPostVoting);+ this.notifyPropertyChange("replyOptions");+ this.notifyPropertyChange("action");+ }+ }),+ });+ });+ },+};diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/post-voting-edits.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/post-voting-edits.gjsnew file mode 100644index 00000000000..17d0482c2f9--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/post-voting-edits.gjs@@ -0,0 +1,262 @@+import Component from "@glimmer/component";+import routeAction from "discourse/helpers/route-action";+import { withSilencedDeprecations } from "discourse/lib/deprecated";+import { withPluginApi } from "discourse/lib/plugin-api";+import { registerWidgetShim } from "discourse/widgets/render-glimmer";+import { i18n } from "discourse-i18n";+import PostVotingAnswerButton from "../components/post-voting-answer-button";+import PostVotingAnswerHeader, {+ ORDER_BY_ACTIVITY_FILTER,+} from "../components/post-voting-answer-header";+import PostVotingComments from "../components/post-voting-comments";+import PostVotingVoteControls from "../components/post-voting-vote-controls";++function initPlugin(api, container) {+ customizePost(api);+ customizePostMenu(api, container);++ function customLastUnreadUrl(context) {+ if (context.is_post_voting && context.last_read_post_number) {+ if (context.highest_post_number <= context.last_read_post_number) {+ // link to OP if no unread+ return context.urlForPostNumber(1);+ } else if (+ context.last_read_post_number ===+ context.highest_post_number - 1+ ) {+ return context.urlForPostNumber(context.last_read_post_number + 1);+ } else {+ // sort by activity if user has 2+ unread posts+ return `${context.urlForPostNumber(+ context.last_read_post_number + 1+ )}?filter=activity`;+ }+ }+ }++ api.registerCustomLastUnreadUrlCallback(customLastUnreadUrl);+}++function customizePost(api) {+ api.addTrackedPostProperties(+ "comments",+ "comments_count",+ "post_voting_user_voted_direction",+ "post_voting_has_votes"+ );++ api.modifyClass(+ "model:post-stream",+ (Superclass) =>+ class extends Superclass {+ orderStreamByActivity() {+ this.cancelFilter();+ this.set("filter", ORDER_BY_ACTIVITY_FILTER);+ return this.refreshAndJumpToSecondVisible();+ }++ orderStreamByVotes() {+ this.cancelFilter();+ return this.refreshAndJumpToSecondVisible();+ }+ }+ );++ api.renderAfterWrapperOutlet(+ "post-avatar",+ class extends Component {+ static shouldRender(args) {+ return args.post.topic?.is_post_voting;+ }++ <template>+ <PostVotingVoteControls+ @post={{@outletArgs.post}}+ @showLogin={{routeAction "showLogin"}}+ />+ </template>+ }+ );+ api.renderBeforeWrapperOutlet("post-article", PostVotingAnswerHeader);++ withSilencedDeprecations("discourse.post-stream-widget-overrides", () =>+ customizeWidgetPost(api)+ );+}++function customizeWidgetPost(api) {+ api.reopenWidget("post", {+ orderByVotes() {+ this._topicController()+ .model.postStream.orderStreamByVotes()+ .then(() => {+ this._refreshController();+ });+ },++ orderByActivity() {+ this._topicController()+ .model.postStream.orderStreamByActivity()+ .then(() => {+ this._refreshController();+ });+ },++ _refreshController() {+ this._topicController().updateQueryParams();+ },++ _topicController() {+ return this.register.lookup("controller:topic");+ },+ });++ api.decorateWidget("post-article:before", (helper) => {+ const result = [];+ const post = helper.getModel();++ if (!post.topic.is_post_voting) {+ return result;+ }++ const topicController = helper.widget.register.lookup("controller:topic");+ let positionInStream;++ if (+ topicController.replies_to_post_number &&+ parseInt(topicController.replies_to_post_number, 10) !== 1+ ) {+ positionInStream = 2;+ } else {+ positionInStream = 1;+ }++ const answersCount = post.topic.posts_count - 1;++ if (+ answersCount <= 0 ||+ post.id !== post.topic.postStream.stream[positionInStream]+ ) {+ return result;+ }++ result.push(+ helper.h("div.post-voting-answers-header.small-action", [+ helper.h(+ "span.post-voting-answers-headers-count",+ i18n("post_voting.topic.answer_count", { count: answersCount })+ ),+ helper.h("span.post-voting-answers-headers-sort", [+ helper.h("span", i18n("post_voting.topic.sort_by")),+ helper.attach("button", {+ action: "orderByVotes",+ contents: i18n("post_voting.topic.votes"),+ disabled: topicController.filter !== ORDER_BY_ACTIVITY_FILTER,+ className: `post-voting-answers-headers-sort-votes ${+ topicController.filter === ORDER_BY_ACTIVITY_FILTER+ ? ""+ : "active"+ }`,+ }),+ helper.attach("button", {+ action: "orderByActivity",+ contents: i18n("post_voting.topic.activity"),+ disabled: topicController.filter === ORDER_BY_ACTIVITY_FILTER,+ className: `post-voting-answers-headers-sort-activity ${+ topicController.filter === ORDER_BY_ACTIVITY_FILTER+ ? "active"+ : ""+ }`,+ }),+ ]),+ ])+ );++ return result;+ });++ registerWidgetShim(+ "post-voting-vote-controls",+ "div.post-voting-post-shim",+ <template>+ <PostVotingVoteControls+ @post={{@data.post}}+ @showLogin={{routeAction "showLogin"}}+ />+ </template>+ );++ api.decorateWidget("post-avatar:after", function (helper) {+ const result = [];+ const model = helper.getModel();++ if (model.topic?.is_post_voting) {+ const postVotingPost = helper.attach("post-voting-vote-controls", {+ post: model,+ });++ result.push(postVotingPost);+ }++ return result;+ });+}++function customizePostMenu(api, container) {+ const siteSettings = container.lookup("service:site-settings");++ api.registerValueTransformer(+ "post-menu-buttons",+ ({ value: dag, context: { post, buttonKeys } }) => {+ if (post.post_voting_has_votes !== undefined) {+ dag.add("post-voting-answer", PostVotingAnswerButton, {+ after: [buttonKeys.SHOW_MORE, buttonKeys.REPLY],+ });++ dag.delete(buttonKeys.REPLY);++ if (+ post.post_number !== 1 &&+ !siteSettings.post_voting_enable_likes_on_answers+ ) {+ dag.delete(buttonKeys.LIKE);+ }+ }+ }+ );++ api.renderInOutlet(+ "post-menu__after",+ class extends Component {+ static shouldRender(args) {+ return (+ args.post.post_voting_has_votes !== undefined &&+ !args.post.reply_to_post_number &&+ !(args.state.filteredRepliesView && args.state.repliesShown)+ );+ }++ <template>+ <PostVotingComments+ @post={{@outletArgs.post}}+ @canCreatePost={{@outletArgs.state.canCreatePost}}+ />+ </template>+ }+ );+}++export default {+ name: "post-voting-edits",+ initialize(container) {+ const siteSettings = container.lookup("service:site-settings");++ if (!siteSettings.post_voting_enabled) {+ return;+ }++ withPluginApi("1.13.0", (api) => {+ initPlugin(api, container);+ });+ },+};diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/post-voting-icon.js b/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/post-voting-icon.jsnew file mode 100644index 00000000000..d528534aabd--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/initializers/post-voting-icon.js@@ -0,0 +1,45 @@+import { withPluginApi } from "discourse/lib/plugin-api";+import { postUrl } from "discourse/lib/utilities";+import { i18n } from "discourse-i18n";+import { buildAnchorId } from "../components/post-voting-comment";++export default {+ name: "post-voting-icon",++ initialize(container) {+ const siteSettings = container.lookup("service:site-settings");+ if (!siteSettings.post_voting_enabled) {+ return;+ }++ withPluginApi("1.18.0", (api) => {+ api.registerNotificationTypeRenderer(+ "question_answer_user_commented",+ (NotificationTypeBase) => {+ return class extends NotificationTypeBase {+ get linkTitle() {+ return i18n(+ "notifications.titles.question_answer_user_commented"+ );+ }++ get linkHref() {+ const url = postUrl(+ this.notification.slug,+ this.topicId,+ this.notification.post_number+ );+ return `${url}#${buildAnchorId(+ this.notification.data.post_voting_comment_id+ )}`;+ }++ get icon() {+ return "comment";+ }+ };+ }+ );+ });+ },+};diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/lib/post-voting-flag.js b/plugins/discourse-post-voting/assets/javascripts/discourse/lib/post-voting-flag.jsnew file mode 100644index 00000000000..a888ba05118--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/lib/post-voting-flag.js@@ -0,0 +1,59 @@+import { ajax } from "discourse/lib/ajax";+import { popupAjaxError } from "discourse/lib/ajax-error";+import Flag from "discourse/lib/flag-targets/flag";++export default class PostVotingFlag extends Flag {+ title() {+ return "flagging.title";+ }++ customSubmitLabel() {+ return "flagging.notify_action";+ }++ submitLabel() {+ return "flagging.action";+ }++ flagCreatedEvent() {+ return "post:flag-created";+ }++ flagsAvailable(flagModal) {+ let flagsAvailable = flagModal.site.flagTypes;++ flagsAvailable = flagsAvailable.filter((flag) => {+ return flagModal.args.model.flagModel.availableFlags.includes(+ flag.name_key+ );+ });++ const notifyUserIndex = flagsAvailable.indexOf(+ flagsAvailable.filterBy("name_key", "notify_user")[0]+ );++ if (notifyUserIndex !== -1) {+ const notifyUser = flagsAvailable[notifyUserIndex];+ flagsAvailable.splice(notifyUserIndex, 1);+ flagsAvailable.splice(0, 0, notifyUser);+ }++ return flagsAvailable;+ }++ async create(flagModal, opts) {+ flagModal.args.closeModal();++ return ajax("/post_voting/comments/flag", {+ method: "PUT",+ data: {+ comment_id: flagModal.args.model.flagModel.id,+ flag_type_id: flagModal.selected.id,+ message: opts.message,+ is_warning: opts.isWarning,+ take_action: opts.takeAction,+ queue_for_review: opts.queue_for_review,+ },+ }).catch((error) => popupAjaxError(error));+ }+}diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/lib/post-voting-utilities.js b/plugins/discourse-post-voting/assets/javascripts/discourse/lib/post-voting-utilities.jsnew file mode 100644index 00000000000..07cf0a7b768--- /dev/null+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/lib/post-voting-utilities.js@@ -0,0 +1,26 @@+import { ajax } from "discourse/lib/ajax";+import { popupAjaxError } from "discourse/lib/ajax-error";++const vote = function (type, data) {+ return ajax("/post_voting/vote", {+ type,+ data,+ });+};++const removeVote = function (data) {+ return vote("DELETE", data);+};++const castVote = function (data) {+ return vote("POST", data);+};++const whoVoted = function (data) {+ return ajax("/post_voting/voters", {+ type: "GET",+ data,+ }).catch(popupAjaxError);+};++export { removeVote, castVote, whoVoted };diff --git a/plugins/discourse-post-voting/assets/stylesheets/common/post-voting-crawler.scss b/plugins/discourse-post-voting/assets/stylesheets/common/post-voting-crawler.scssnew file mode 100644index 00000000000..ca4a4384b4b--- /dev/null+++ b/plugins/discourse-post-voting/assets/stylesheets/common/post-voting-crawler.scss@@ -0,0 +1,34 @@+body.crawler,+body > noscript {+ .crawler-post {+ border-top: 3px solid var(--primary-low);+ }++ .post-voting-comments {+ padding-top: 15px;++ .post-voting-comment-row {+ display: flex;+ border-top: 1px solid var(--primary-low);+ padding: 5px 0 5px 0;++ .post-voting-comment-cooked p,+ .post-voting-comment-creator {+ display: inline;+ }++ .post-voting-comment-info-separator {+ display: inline;+ margin: 0 0.3em;+ }+ }+ }++ .post-voting-answer-count {+ padding-top: 20px;++ .post-voting-answer-count-span {+ display: none;+ }+ }+}diff --git a/plugins/discourse-post-voting/assets/stylesheets/common/post-voting.scss b/plugins/discourse-post-voting/assets/stylesheets/common/post-voting.scssnew file mode 100644index 00000000000..26497589b71--- /dev/null+++ b/plugins/discourse-post-voting/assets/stylesheets/common/post-voting.scss@@ -0,0 +1,298 @@+.post-voting-topic,+.post-voting-topic-sort-by-activity {+ .time-gap,+ .topic-post-visited-line,+ .timeline-date-wrapper,+ .timeline-last-read,+ .timeline-ago {+ display: none;+ }++ .time-gap + .topic-post,+ .topic-post-visited + .topic-post {+ .topic-avatar,+ .topic-body {+ border-top: 1px solid var(--primary-low);+ }+ }++ .posts-filtered-notice:empty {+ display: none;+ }+}++.post-voting-answers-header {+ box-sizing: border-box;+ display: flex;+ flex-direction: row;+ padding: 0.5em;++ .post-voting-answers-headers-count {+ font-size: var(--font-up-1);+ }++ .post-voting-answers-headers-sort {+ margin-left: auto;++ .btn {+ color: var(--primary-high);+ border: 1px solid var(--primary-low-mid);++ &:hover {+ background-color: var(--primary-very-low);+ }++ + .btn {+ margin-left: 0.3em;+ }++ &:first-of-type {+ margin-left: 0.5em;+ }+ }++ .btn.active[disabled] {+ background-color: var(--primary-low);+ color: var(--primary);+ opacity: 1;+ cursor: default;+ }+ }+}++.rtl .qa-answers-header {+ .qa-answers-headers-sort {+ margin-left: unset;+ margin-right: auto;++ .btn {+ + .btn {+ margin-left: 0;+ margin-right: 0.3em;+ }++ &:first-of-type {+ margin-left: 0;+ margin-right: 0.5em;+ }+ }+ }+}++.post-voting-comments {+ width: 100%;+ padding-top: 5px;+}++.post-voting-comment {+ font-size: var(--font-down-1);+ border-top: 1px solid var(--primary-low);+ display: flex;+ flex-direction: row;+ align-items: flex-start;+ padding: 0.7em 0;+ word-break: break-word;++ &.post-voting-comment-deleted {+ background-color: var(--danger-low-mid);+ }++ .post-voting-comment-actions-vote {+ margin-right: 0.5em;+ display: inline-grid;+ grid-auto-flow: column;+ align-items: flex-start;++ .post-voting-comment-actions-vote-count {+ text-align: center;+ width: auto;+ min-width: 16px;+ padding: 0.1em 0;+ color: var(--primary-low-mid-or-secondary-high);+ }++ .btn {+ font-size: var(--font-up-3);+ background: none;+ padding: 0;++ &.post-voting-button-voted {+ .d-icon {+ color: var(--success);+ }+ }+ }+ }++ .post-voting-comment-post {+ .post-voting-comment-cooked {+ p {+ display: inline;+ }+ }++ .post-voting-comment-info-separator {+ margin: 0 0.3em;+ }++ .post-voting-comment-info-username {+ display: inline;+ margin-right: 0.3em;+ }++ .post-voting-comment-info-created,+ .post-voting-comment-info-username-deleted {+ color: var(--primary-med-or-secondary-med);+ }++ .post-voting-comment-actions {+ display: none;+ margin-left: 0.3em;++ .post-voting-comment-actions-edit-link {+ color: var(--primary-med-or-secondary-med);+ margin-right: 0.25em;+ }++ .post-voting-comment-actions-delete-link {+ color: var(--primary-med-or-secondary-med);+ margin-right: 0.25em;+ }++ .post-voting-comment-actions-delete-link:hover {+ color: var(--danger);+ }++ .post-voting-comment-actions-flag-link {+ color: var(--primary-med-or-secondary-med);+ }++ .post-voting-comment-actions-flag-link:hover {+ color: var(--danger);+ }+ }+ }++ .post-voting-comment-editor {+ margin: 0.5em 0;+ width: 100%;++ textarea {+ width: 100%;+ margin-bottom: 0;+ }++ .post-voting-comment-editor-cancel {+ margin-left: 0.5em;+ }+ }++ &:hover {+ .post-voting-comment-actions {+ display: inline-block;+ }+ }+}++.post-voting-comment-composer {+ width: 100%;++ .post-voting-comment-composer-textarea {+ width: 100%;+ margin: 0.5em 0;+ }++ .post-voting-comment-composer-flash {+ width: 100%;+ color: var(--primary-med-or-secondary-med);++ &.error {+ color: var(--danger-hover);+ }+ margin-bottom: 0.5em;+ }+}++.post-voting-comments-menu {+ font-size: var(--font-down-1);+ margin: 0;++ .post-voting-comments-menu-composer-cancel {+ margin-left: 0.5em;+ }++ .post-voting-comments-menu-separator {+ margin: 0 0.8em;+ display: inline;++ &::after {+ content: "|";+ }+ }++ .post-voting-comments-menu-show-more,+ .post-voting-comments-menu-add-link {+ display: inline;+ }+}++.post-voting-post {+ position: relative;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ margin-top: 0.5em;++ .post-voting-button {+ padding-top: 0.1em;+ padding-bottom: 0.1em;+ font-size: var(--font-up-5);+ }++ .post-voting-post-list {+ position: absolute;+ z-index: 2;+ background-color: var(--secondary);+ border: 1px solid var(--primary-low);+ box-shadow: var(--shadow-card);+ display: flex;+ flex-direction: column;+ top: 4em;+ padding: 0.5em;+ max-width: 90vw;+ overflow: auto;++ .post-voting-post-list-voters-wrapper {+ display: flex;+ flex-direction: row;+ }+ }++ .post-voting-post-list-voters {+ display: flex;++ a {+ margin-left: 0.25em;+ margin-bottom: 0.25em;+ }+ }++ .post-voting-post-list-count,+ .post-voting-post-list-icon {+ margin: 0.15em 0.25em 0 0.25em;+ font-size: var(--font-up-1);+ color: var(--primary-low-mid);+ }++ .post-voting-button-voted {+ .d-icon {+ color: var(--success);+ }+ }++ .post-voting-post-toggle-voters {+ padding-top: 0;+ padding-bottom: 0;+ }+}diff --git a/plugins/discourse-post-voting/assets/stylesheets/desktop/post-voting.scss b/plugins/discourse-post-voting/assets/stylesheets/desktop/post-voting.scssnew file mode 100644index 00000000000..c46dfef0d6f--- /dev/null+++ b/plugins/discourse-post-voting/assets/stylesheets/desktop/post-voting.scss@@ -0,0 +1,3 @@+.post-voting-answers-header {+ width: 100%;+}diff --git a/plugins/discourse-post-voting/assets/stylesheets/mobile/post-voting.scss b/plugins/discourse-post-voting/assets/stylesheets/mobile/post-voting.scssnew file mode 100644index 00000000000..8ab4007f94f--- /dev/null+++ b/plugins/discourse-post-voting/assets/stylesheets/mobile/post-voting.scss@@ -0,0 +1,33 @@+.post-voting-topic,+.post-voting-topic-sort-by-activity {+ .post-voting-answers-header {+ width: unset;+ padding: 0;+ padding-bottom: 1em;+ border-top: none;+ border-bottom: 1px solid var(--primary-low);+ margin-bottom: 1em;+ }++ .topic-avatar {+ position: relative;+ }++ // TODO: avoid using magic values here+ // and in .post-voting-post below+ .topic-body .cooked {+ margin-left: 55px;+ min-height: 55px;+ }+}++.post-voting-post {+ position: absolute;+ left: 0;+ top: 45px;+ width: 45px;++ .post-voting-post-list {+ left: -5px;+ }+}diff --git a/plugins/discourse-post-voting/config/locales/client.ar.yml b/plugins/discourse-post-voting/config/locales/client.ar.ymlnew file mode 100644index 00000000000..3cbbc966523--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.ar.yml@@ -0,0 +1,143 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: التصويت على المنشورات+ post_voting:+ reviewables:+ comment_already_handled: "شكرًا، لكننا راجعنا هذا التعليق بالفعل وقررنا أنه لا يلزم الإبلاغ عنه مرة أخرى."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "تعليق جديد"+ popup:+ question_answer_user_commented: 'علَّق %{username} في "%{topic}" - %{site_title}'+ category:+ post_voting_settings_heading: التصويت على المنشورات+ create_as_post_voting_default: يتم تعيين الموضوعات الجديدة افتراضيًا إلى موضوعات "التصويت على المنشورات" في هذه الفئة.+ only_post_voting_in_this_category: لا يمكن أن تكون الموضوعات الجديدة إلا موضوعات "تصويت على المنشورات" في هذه الفئة.+ composer:+ create_post_voting:+ label: "إنشاء موضوع للتصويت على المنشورات"+ composer_actions:+ create_as_post_voting:+ label: "تبديل التصويت على المنشورات"+ desc: "سيتم إنشاء الموضوع مع منشورات قابلة للتصويت"+ remove_as_post_voting:+ label: "إزالة التصويت على المنشورات"+ desc: "سيتم إنشاء الموضوع بتنسيق عادي"+ vote:+ already_voted: "يمكنك التصويت مرة واحدة فقط لكل سؤال."+ user_over_limit: "لا يمكنك تجاوز عدد الأصوات لمستوى ثقتك."+ one_vote_per_post: "يمكنك التصويت مرة واحدة فقط لكل منشور."+ last_answer_lowercase: الإجابة الأخيرة+ answer_lowercase:+ zero: إجابة+ one: إجابة واحدة+ two: إجابتان+ few: إجابات+ many: إجابة+ other: إجابة+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ zero: "أدخل %{count} حرفًا على الأقل"+ one: "أدخل حرفًا واحدًا (%{count}) على الأقل"+ two: "أدخل حرفين (%{count}) على الأقل"+ few: "أدخل %{count} أحرف على الأقل"+ many: "أدخل %{count} حرفًا على الأقل"+ other: "أدخل %{count} حرفًا على الأقل"+ length_ok:+ zero: "تبقَّى %{count} حرفًا..."+ one: "تبقَّى حرف واحد (%{count})..."+ two: "تبقَّى حرفان (%{count})..."+ few: "تبقَّى %{count} أحرف..."+ many: "تبقَّى %{count} حرفًا..."+ other: "تبقَّى %{count} حرفًا..."+ too_long:+ zero: "لا يمكن أن يتجاوز طول التعليق %{count} حرفًا"+ one: "لا يمكن أن يتجاوز طول التعليق حرفًا واحدًا (%{count})"+ two: "لا يمكن أن يتجاوز طول التعليق حرفين (%{count})"+ few: "لا يمكن أن يتجاوز طول التعليق %{count} أحرف"+ many: "لا يمكن أن يتجاوز طول التعليق %{count} حرفًا"+ other: "لا يمكن أن يتجاوز طول التعليق %{count} حرفًا"+ submit: "إضافة تعليق"+ edit: "تعديل"+ cancel: "إلغاء"+ add: "إضافة تعليق"+ show:+ zero: عرض %{count} تعليقًا إضافيًا+ one: عرض تعليق واحد (%{count}) إضافي+ two: عرض تعليقين (%{count}) إضافيين+ few: عرض %{count} تعليقات إضافية+ many: عرض %{count} تعليقًا إضافيًا+ other: عرض %{count} تعليقًا إضافيًا+ delete:+ confirm: "هل تريد بالتأكيد حذف هذا التعليق؟"+ user:+ deleted: "(تم حذف المستخدم)"+ reviewables:+ comment_already_handled: "شكرًا، لكننا راجعنا هذا التعليق بالفعل وقررنا أنه لا يلزم الإبلاغ عنه مرة أخرى."+ actions:+ agree:+ title: "الموافقة..."+ agree_and_keep_comment:+ title: "إبقاء التعليق"+ description: "الموافقة على البلاغ والاحتفاظ بالتعليق دون تغيير."+ agree_and_keep_deleted:+ title: "إبقاء التعليق محذوفًا"+ description: "الموافقة على البلاغ وترك التعليق محذوفًا."+ agree_and_suspend:+ title: "تعليق المستخدم"+ description: "الموافقة على البلاغ وتعليق المستخدم"+ agree_and_silence:+ title: "كتم المستخدم"+ description: "الموافقة على البلاغ وكتم المستخدم"+ agree_and_restore:+ title: "استعادة التعليق"+ description: "استعادة التعليق حتى يتمكن المستخدمون من رؤيته."+ agree_and_delete:+ title: "حذف التعليق"+ description: "حذف التعليق حتى لا يتمكن المستخدمون من رؤيته."+ delete_and_agree:+ title: "تجاهل البلاغ وحذف التعليق"+ description: "تجاهل البلاغ بإزالته من قائمة الانتظار وحذف التعليق."+ disagree_and_restore:+ title: "عدم الموافقة واستعادة التعليق"+ description: "استعادة التعليق حتى يتمكن جميع المستخدمين من رؤيته."+ disagree:+ title: "عدم الموافقة"+ ignore:+ title: "عدم اتخاذ أي إجراء"+ description: "تجاهل البلاغ بإزالته من قائمة الانتظار دون اتخاذ أي إجراء."+ transcript:+ view: "عرض نص التعليقات السابقة"+ topic:+ answer:+ label: "إجابة"+ help: "البدء في تأليف إجابة"+ sort_by: "الترتيب حسب"+ votes: "الأصوات"+ activity: "النشاط"+ answer_count:+ zero: "%{count} إجابات"+ one: "إجابة واحدة (%{count})"+ two: "إجابتان (%{count})"+ few: "%{count} إجابات"+ many: "%{count} إجابات"+ other: "%{count} إجابات"+ review:+ transcript:+ view: "عرض نص الرسائل السابقة"+ types:+ reviewable_post_voting_comment:+ title: "تم الإبلاغ عن تعليق للتصويت على منشور"diff --git a/plugins/discourse-post-voting/config/locales/client.be.yml b/plugins/discourse-post-voting/config/locales/client.be.ymlnew file mode 100644index 00000000000..b1f80066fc5--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.be.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/++be:+ js:+ post_voting:+ post:+ post_voting_comment:+ edit: "правіць"+ cancel: "адмена"+ reviewables:+ actions:+ agree:+ title: "Пагадзіцеся ..."+ agree_and_suspend:+ title: "прыпыненне карыстальніка"+ description: "Пагадзіцеся са сцягамі і падвесіць карыстальнік."+ agree_and_silence:+ title: "Silence Карыстальнік"+ description: "Пагадзіцеся са сцягамі і маўчанне карыстальніка."+ disagree:+ title: "не згаджацца"+ topic:+ sort_by: "сартаваць па"+ activity: "актыўнасць"diff --git a/plugins/discourse-post-voting/config/locales/client.bg.yml b/plugins/discourse-post-voting/config/locales/client.bg.ymlnew file mode 100644index 00000000000..9e4d53f7d73--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.bg.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/++bg:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ edit: "промени"+ cancel: "прекрати"+ user:+ deleted: "(потребителят е изтрит)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Преустанови потребител"+ disagree:+ title: "Не съм съгласен "+ topic:+ sort_by: "Сортирай по"+ activity: "Активност"diff --git a/plugins/discourse-post-voting/config/locales/client.bs_BA.yml b/plugins/discourse-post-voting/config/locales/client.bs_BA.ymlnew file mode 100644index 00000000000..93429f896f7--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.bs_BA.yml@@ -0,0 +1,35 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Unesite bar %{count} znak"+ few: "Unesite najmanje %{count} znakova"+ other: "Unesite najmanje %{count} znakova"+ edit: "uredi"+ cancel: "otkaži"+ user:+ deleted: "(korisnik izbrisan)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspend User"+ description: "Složij se sa prijavom i suspendiraj prijavljenog korisnika (suspend)"+ agree_and_silence:+ title: "Stišaj korisnika"+ description: "Složij se sa prijavom i utišaj prijavljenog korisnika (silence)"+ disagree:+ title: "Disagree"+ topic:+ sort_by: "Sortiraj po"+ activity: "Activity"diff --git a/plugins/discourse-post-voting/config/locales/client.ca.yml b/plugins/discourse-post-voting/config/locales/client.ca.ymlnew file mode 100644index 00000000000..7e225d5e880--- /dev/null+++ b/plugins/discourse-post-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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Introduïu almenys %{count} caràcter"+ other: "Introduïu almenys %{count} caràcters"+ edit: "edita"+ cancel: "cancel·la"+ user:+ deleted: "(usuari suprimit)"+ reviewables:+ actions:+ agree:+ title: "D'acord..."+ agree_and_suspend:+ title: "Suspèn l'usuari"+ description: "D'acord amb la bandera i suspèn l'usuari. "+ agree_and_silence:+ title: "Silencia l'usuari"+ description: "D'acord amb la bandera i silencia l'usuari. "+ disagree:+ title: "En desacord"+ topic:+ sort_by: "Ordena per"+ activity: "Activitat"diff --git a/plugins/discourse-post-voting/config/locales/client.cs.yml b/plugins/discourse-post-voting/config/locales/client.cs.ymlnew file mode 100644index 00000000000..6856d5857f3--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.cs.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/++cs:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Zadejte alespoň %{count} znak"+ few: "Zadejte alespoň %{count} znaky"+ many: "Zadejte alespoň %{count} znaků"+ other: "Zadejte alespoň %{count} znaků"+ edit: "upravit"+ cancel: "zrušit"+ user:+ deleted: "(uživatel smazán)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Zakázat uživatele"+ description: "Schválit nahlášení a pozastavit uživatele."+ agree_and_silence:+ title: "Ztišit uživatele"+ description: "Schválit nahlášení a ztišit uživatele."+ disagree:+ title: "Neschvaluji"+ topic:+ sort_by: "Seřadil"+ activity: "Aktivita"diff --git a/plugins/discourse-post-voting/config/locales/client.da.yml b/plugins/discourse-post-voting/config/locales/client.da.ymlnew file mode 100644index 00000000000..de090b959e5--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.da.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/++da:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Indtast mindst %{count} tegn"+ other: "Indtast mindst %{count} tegn"+ edit: "redigér"+ cancel: "annuller"+ user:+ deleted: "(bruger slettet)"+ reviewables:+ actions:+ agree:+ title: "Enig..."+ agree_and_suspend:+ title: "Suspendér Bruger"+ agree_and_silence:+ title: "Ignorer Bruger"+ disagree:+ title: "Uenig"+ ignore:+ title: "Gør ingenting"+ topic:+ sort_by: "Sorter efter"+ activity: "Aktivitet"diff --git a/plugins/discourse-post-voting/config/locales/client.de.yml b/plugins/discourse-post-voting/config/locales/client.de.ymlnew file mode 100644index 00000000000..1624443f482--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.de.yml@@ -0,0 +1,124 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: Beitragsabstimmung+ post_voting:+ reviewables:+ comment_already_handled: "Danke, aber wir haben diesen Kommentar bereits überprüft und festgestellt, dass er nicht erneut gemeldet werden muss."+ js:+ discourse_post_voting:+ title: "Beitragsabstimmung"+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "neuer Kommentar"+ popup:+ question_answer_user_commented: '%{username} hat kommentiert in „%{topic}“ – %{site_title}'+ category:+ post_voting_settings_heading: Beitragsabstimmung+ create_as_post_voting_default: Neue Themen werden in dieser Kategorie standardmäßig als Beitragsabstimmungsthemen eingestellt.+ only_post_voting_in_this_category: Neue Themen können in dieser Kategorie nur Themen zur Beitragsabstimmung sein.+ composer:+ create_post_voting:+ label: "Beitragsabstimmungsthema erstellen"+ composer_actions:+ create_as_post_voting:+ label: "Beitragsabstimmung umschalten"+ desc: "Thema wird mit Beiträgen erstellt, bei denen abgestimmt werden kann"+ remove_as_post_voting:+ label: "Beitragsabstimmung entfernen"+ desc: "Thema wird im regulären Format erstellt"+ vote:+ already_voted: "Du kannst nur einmal pro Frage abstimmen."+ user_over_limit: "Du kannst nicht öfter abstimmen, als es deine Vertrauensstufe erlaubt."+ one_vote_per_post: "Du kannst nur einmal für jeden Beitrag abstimmen."+ last_answer_lowercase: letzte Antwort+ answer_lowercase:+ one: Antwort+ other: Antworten+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Gib mindestens %{count} Zeichen ein"+ other: "Gib mindestens %{count} Zeichen ein"+ length_ok:+ one: "%{count} Zeichen verbleibend …"+ other: "%{count} Zeichen verbleibend …"+ too_long:+ one: "Kommentar darf nicht länger als %{count} Zeichen sein"+ other: "Kommentar darf nicht länger als %{count} Zeichen sein"+ submit: "Kommentar hinzufügen"+ edit: "bearbeiten"+ cancel: "abbrechen"+ add: "Kommentar hinzufügen"+ show:+ one: '%{count} weiteren Kommentar anzeigen'+ other: '%{count} weitere Kommentare anzeigen'+ delete:+ confirm: "Möchtest du wirklich diesen Kommentar löschen?"+ user:+ deleted: "(Benutzer gelöscht)"+ reviewables:+ comment_already_handled: "Danke, aber wir haben diesen Kommentar bereits überprüft und festgestellt, dass er nicht erneut gemeldet werden muss."+ actions:+ agree:+ title: "Zustimmen …"+ agree_and_keep_comment:+ title: "Kommentar behalten"+ description: "Meldung zustimmen und den Kommentar unbearbeitet lassen."+ agree_and_keep_deleted:+ title: "Kommentar gelöscht lassen"+ description: "Meldung zustimmen und den Kommentar gelöscht lassen."+ agree_and_suspend:+ title: "Benutzer sperren"+ description: "Meldung zustimmen und den Benutzer sperren."+ agree_and_silence:+ title: "Benutzer stummschalten"+ description: "Meldung zustimmen und den Benutzer stummschalten."+ agree_and_restore:+ title: "Kommentar wiederherstellen"+ description: "Kommentar wiederherstellen, damit Benutzer ihn sehen können."+ agree_and_delete:+ title: "Kommentar löschen"+ description: "Kommentar löschen, damit Benutzer ihn nicht sehen können."+ delete_and_agree:+ title: "Meldung ignorieren und Kommentar löschen"+ description: "Ignoriere die Meldung, indem du sie aus der Warteschlange entfernst und den Kommentar löschst."+ disagree_and_restore:+ title: "Ablehnen und Kommentar wiederherstellen"+ description: "Kommentar wiederherstellen, damit alle Benutzer ihn sehen können."+ disagree:+ title: "Ablehnen"+ ignore:+ title: "Nichts tun"+ description: "Ignoriere die Meldung, indem du sie aus der Warteschlange entfernst, ohne etwas zu unternehmen."+ transcript:+ view: "Transkript früherer Kommentare anzeigen"+ topic:+ answer:+ label: "Antwort"+ help: "mit dem Verfassen einer Antwort beginnen"+ sort_by: "Sortieren nach"+ votes: "Stimmen"+ activity: "Aktivität"+ answer_count:+ one: "%{count} Antwort"+ other: "%{count} Antworten"+ voters_count_diff:+ one: "und %{count} weiterer Benutzer ..."+ other: "und %{count} weitere Benutzer …"+ review:+ transcript:+ view: "Transkript früherer Nachrichten anzeigen"+ types:+ reviewable_post_voting_comment:+ title: "Beitragsabstimmungskommentar gemeldet"diff --git a/plugins/discourse-post-voting/config/locales/client.el.yml b/plugins/discourse-post-voting/config/locales/client.el.ymlnew file mode 100644index 00000000000..466da373448--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.el.yml@@ -0,0 +1,79 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "νέο σχόλιο"+ popup:+ question_answer_user_commented: 'Ο χρήστης %{username} σχολίασε στο "%{topic}" - %{site_title}'+ last_answer_lowercase: τελευταία απάντηση+ answer_lowercase:+ one: απάντηση+ other: απαντήσεις+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Βάλε τουλάχιστον %{count} χαρακτήρα"+ other: "Γράψε τουλάχιστον %{count} χαρακτήρες"+ length_ok:+ one: "%{count} χαρακτήρας έμεινε..."+ other: "%{count} χαρακτήρες έμειναν..."+ too_long:+ one: "Το σχόλιο δεν μπορεί να είναι μεγαλύτερο από %{count} χαρακτήρα"+ other: "Το σχόλιο δεν μπορεί να είναι μεγαλύτερο από %{count} χαρακτήρες"+ submit: "Προσθήκη σχολίου"+ edit: "επεξεργασία"+ cancel: "ακύρωση"+ add: "Προσθήκη σχολίου"+ show:+ one: Εμφάνιση %{count} ακόμη σχολίου+ other: Εμφάνιση %{count} ακόμη σχολίων+ delete:+ confirm: "Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτό το σχόλιο;"+ user:+ deleted: "(ο χρήστης διαγράφηκε)"+ reviewables:+ actions:+ agree:+ title: "Συμφωνώ..."+ agree_and_keep_comment:+ title: "Διατήρηση σχολίου"+ agree_and_keep_deleted:+ title: "Διατήρηση σχολίου ως Διαγραμμένο"+ agree_and_suspend:+ title: "Αποβολή Χρήστη"+ agree_and_silence:+ title: "Σίγαση Χρήστη"+ agree_and_restore:+ title: "Επαναφορά σχολίου"+ description: "Επαναφορά του σχολίου ώστε οι χρήστες να μπορούν να το δουν."+ agree_and_delete:+ title: "Διαγραφή σχολίου"+ description: "Διαγράψτε το σχόλιο ώστε οι χρήστες να μην μπορούν να το δουν."+ disagree_and_restore:+ title: "Διαφωνώ και Επαναφορά σχολίου"+ disagree:+ title: "Διαφωνώ"+ ignore:+ title: "Μην κάνετε τίποτα"+ topic:+ answer:+ label: "Απάντηση"+ help: "αρχίστε να συνθέτετε μια απάντηση"+ sort_by: "Ταξινόμηση κατά"+ votes: "Ψήφοι"+ activity: "Δραστηριότητα"+ answer_count:+ one: "%{count} Απάντηση"+ other: "%{count} Απαντήσεις"+ voters_count_diff:+ one: "και %{count} ακόμη χρήστης..."+ other: "και %{count} ακόμη χρήστες..."diff --git a/plugins/discourse-post-voting/config/locales/client.en.yml b/plugins/discourse-post-voting/config/locales/client.en.ymlnew file mode 100644index 00000000000..1751419e310--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.en.yml@@ -0,0 +1,125 @@+en:+ admin_js:+ site_settings:+ categories:+ post_voting: Post Voting+ post_voting:+ reviewables:+ comment_already_handled: "Thanks, but we've already reviewed this comment and determined it does not need to be flagged again."++ js:+ discourse_post_voting:+ title: "Post voting"+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "new comment"+ popup:+ question_answer_user_commented: '%{username} commented in "%{topic}" - %{site_title}'++ category:+ post_voting_settings_heading: Post Voting+ create_as_post_voting_default: New topics default to Post Voting topics in this category.+ only_post_voting_in_this_category: New topics can only be Post Voting topics in this category.++ composer:+ create_post_voting:+ label: "Create post voting topic"+ composer_actions:+ create_as_post_voting:+ label: "Toggle Post Voting"+ desc: "Topic will be created with votable posts"+ remove_as_post_voting:+ label: "Remove Post Voting"+ desc: "Topic will be created in the regular format"++ vote:+ already_voted: "You can only vote once per question."+ user_over_limit: "You cannot exceed the number of votes for your trust level."+ one_vote_per_post: "You can only vote once for each post."++ last_answer_lowercase: last answer+ answer_lowercase:+ one: answer+ other: answers+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Enter at least %{count} character"+ other: "Enter at least %{count} characters"+ length_ok:+ one: "%{count} character left..."+ other: "%{count} characters left..."+ too_long:+ one: "Comment cannot be longer than %{count} character"+ other: "Comment cannot be longer than %{count} characters"+ submit: "Add a comment"+ edit: "edit"+ cancel: "cancel"+ add: "Add a comment"+ show:+ one: Show %{count} more comment+ other: Show %{count} more comments+ delete:+ confirm: "Are you sure you want to delete this comment?"+ user:+ deleted: "(user deleted)"+ reviewables:+ comment_already_handled: "Thanks, but we've already reviewed this comment and determined it does not need to be flagged again."+ actions:+ agree:+ title: "Agree..."+ agree_and_keep_comment:+ title: "Keep comment"+ description: "Agree with flag and keep the comment unchanged."+ agree_and_keep_deleted:+ title: "Keep comment Deleted"+ description: "Agree with flag and leave the comment deleted."+ agree_and_suspend:+ title: "Suspend User"+ description: "Agree with flag and suspend the user."+ agree_and_silence:+ title: "Silence User"+ description: "Agree with flag and silence the user."+ agree_and_restore:+ title: "Restore comment"+ description: "Restore the comment so that users can see it."+ agree_and_delete:+ title: "Delete comment"+ description: "Delete the comment so that users cannot see it."+ delete_and_agree:+ title: "Ignore Flag and Delete comment"+ description: "Ignore the flag by removing it from the queue and delete the comment."+ disagree_and_restore:+ title: "Disagree and Restore comment"+ description: "Restore the comment so that all users can see it."+ disagree:+ title: "Disagree"+ ignore:+ title: "Do Nothing"+ description: "Ignore the flag by removing it from the queue without taking any action."+ transcript:+ view: "View previous comments transcript"++ topic:+ answer:+ label: "Answer"+ help: "begin composing an answer"+ sort_by: "Sort by"+ votes: "Votes"+ activity: "Activity"+ answer_count:+ one: "%{count} Answer"+ other: "%{count} Answers"+ voters_count_diff:+ one: "and %{count} more user..."+ other: "and %{count} more users..."++ review:+ transcript:+ view: "View previous messages transcript"+ types:+ reviewable_post_voting_comment:+ title: "Flagged Post Voting Comment"diff --git a/plugins/discourse-post-voting/config/locales/client.en_GB.yml b/plugins/discourse-post-voting/config/locales/client.en_GB.ymlnew file mode 100644index 00000000000..2d4fa180ec7--- /dev/null+++ b/plugins/discourse-post-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-post-voting/config/locales/client.es.yml b/plugins/discourse-post-voting/config/locales/client.es.ymlnew file mode 100644index 00000000000..81bb4b9f33f--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.es.yml@@ -0,0 +1,119 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: Votación de publicación+ post_voting:+ reviewables:+ comment_already_handled: "Gracias, pero ya hemos revisado este comentario y hemos determinado que no es necesario denunciarlo de nuevo."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "nuevo comentario"+ popup:+ question_answer_user_commented: '%{username} comentó en «%{topic}» - %{site_title}'+ category:+ post_voting_settings_heading: Votación de publicación+ create_as_post_voting_default: De forma predeterminada, los temas nuevos son temas de Votar publicación en esta categoría.+ only_post_voting_in_this_category: Los temas nuevos solo pueden ser temas de Votar publicación en esta categoría.+ composer:+ create_post_voting:+ label: "Crear tema de Votar publicación"+ composer_actions:+ create_as_post_voting:+ label: "Alternar Votar publicación"+ desc: "El tema se creará con publicaciones votables"+ remove_as_post_voting:+ label: "Eliminar Votar publicación"+ desc: "El tema se creará en el formato normal"+ vote:+ already_voted: "Solo puedes votar una vez por pregunta."+ user_over_limit: "No puedes superar el número de votos para tu nivel de confianza."+ one_vote_per_post: "Solo puedes votar una vez por cada publicación."+ last_answer_lowercase: última respuesta+ answer_lowercase:+ one: respuesta+ other: respuestas+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Introduce al menos %{count} carácter"+ other: "Introduce al menos %{count} caracteres"+ length_ok:+ one: "Queda %{count} carácter..."+ other: "Quedan %{count} caracteres..."+ too_long:+ one: "El comentario no puede tener más de %{count} carácter"+ other: "El comentario no puede tener más de %{count} caracteres"+ submit: "Añadir un comentario"+ edit: "editar"+ cancel: "cancelar"+ add: "Añadir un comentario"+ show:+ one: Mostrar %{count} comentario más+ other: Mostrar %{count} comentarios más+ delete:+ confirm: "¿Seguro que quieres eliminar este comentario?"+ user:+ deleted: "(usuario eliminado)"+ reviewables:+ comment_already_handled: "Gracias, pero ya hemos revisado este comentario y hemos determinado que no es necesario denunciarlo de nuevo."+ actions:+ agree:+ title: "De acuerdo..."+ agree_and_keep_comment:+ title: "Mantener comentario"+ description: "Estar de acuerdo con la denuncia y mantener el comentario intacto."+ agree_and_keep_deleted:+ title: "Mantener el comentario eliminado"+ description: "Aceptar la denuncia y dejar el comentario eliminado."+ agree_and_suspend:+ title: "Suspender al usuario"+ description: "Aceptar la denuncia y suspender al usuario."+ agree_and_silence:+ title: "Silenciar al usuario"+ description: "Aceptar la denuncia y silenciar al usuario."+ agree_and_restore:+ title: "Restaurar comentario"+ description: "Restaura el comentario para que los usuarios puedan verlo."+ agree_and_delete:+ title: "Eliminar comentario"+ description: "Elimina el comentario para que los usuarios no puedan verlo."+ delete_and_agree:+ title: "Ignorar denuncia y eliminar comentario"+ description: "Ignorar la denuncia eliminándola de la cola y eliminar el comentario."+ disagree_and_restore:+ title: "Discrepar y restaurar comentario"+ description: "Restaura el comentario para que todos los usuarios puedan verlo."+ disagree:+ title: "No estoy de acuerdo"+ ignore:+ title: "No hacer nada"+ description: "Ignora la denuncia eliminándola de la cola sin realizar ninguna acción."+ transcript:+ view: "Ver la transcripción de los comentarios anteriores"+ topic:+ answer:+ label: "Respuesta"+ help: "empezar a redactar una respuesta"+ sort_by: "Ordenar por"+ votes: "Votos"+ activity: "Actividad"+ answer_count:+ one: "%{count} respuesta"+ other: "%{count} respuestas"+ review:+ transcript:+ view: "Ver la transcripción de los mensajes anteriores"+ types:+ reviewable_post_voting_comment:+ title: "Comentario de votación de publicación denunciado"diff --git a/plugins/discourse-post-voting/config/locales/client.et.yml b/plugins/discourse-post-voting/config/locales/client.et.ymlnew file mode 100644index 00000000000..479d4c39cc9--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.et.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/++et:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Sisesta vähemalt %{count} sümbol"+ other: "Sisesta vähemalt %{count} sümbolit"+ edit: "muuda"+ cancel: "tühista"+ user:+ deleted: "(kasutaja kustutatud)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Peata kasutaja"+ agree_and_silence:+ title: "Vaigista kasutaja"+ disagree:+ title: "Ei nõustu"+ topic:+ sort_by: "Järjesta"+ activity: "Aktiivsus"diff --git a/plugins/discourse-post-voting/config/locales/client.fa_IR.yml b/plugins/discourse-post-voting/config/locales/client.fa_IR.ymlnew file mode 100644index 00000000000..d2cb95350bb--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.fa_IR.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/++fa_IR:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ composer:+ composer_actions:+ remove_as_post_voting:+ desc: "موضوع در ساختار عادی ایجاد خواهد شد"+ last_answer_lowercase: آخرین پاسخ+ answer_lowercase:+ one: پاسخ+ other: پاسخ+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "حداقل %{count} نویسه وارد کنید"+ other: "حداقل %{count} نویسه وارد کنید"+ edit: "ویرایش"+ cancel: "لغو"+ user:+ deleted: "(کاربر حذف شده)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "کاربر تعلیق شده"+ disagree:+ title: "مخالف"+ topic:+ answer:+ label: "پاسخ"+ sort_by: "مرتبسازی بر اساس"+ votes: "رایها"+ activity: "فعالیت"+ answer_count:+ one: "%{count} پاسخ"+ other: "%{count} پاسخ"diff --git a/plugins/discourse-post-voting/config/locales/client.fi.yml b/plugins/discourse-post-voting/config/locales/client.fi.ymlnew file mode 100644index 00000000000..47b6abcf731--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.fi.yml@@ -0,0 +1,119 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: Viestiäänestys+ post_voting:+ reviewables:+ comment_already_handled: "Kiitos, mutta olemme jo käsitelleet tämän kommentin ja todenneet, ettei sitä tarvitse liputtaa uudelleen."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "uusi kommentti"+ popup:+ question_answer_user_commented: '%{username} kommentoi ketjussa "%{topic}" – %{site_title}'+ category:+ post_voting_settings_heading: Viestiäänestys+ create_as_post_voting_default: Uusissa ketjuissa käytetään oletuksena tämän alueen viestiäänestysketjuja.+ only_post_voting_in_this_category: Uudet ketjut voivat olla vain viestiäänestysketjuja tällä alueella.+ composer:+ create_post_voting:+ label: "Luo viestiäänestysketju"+ composer_actions:+ create_as_post_voting:+ label: "Viestiäänestys käyttöön/pois käytöstä"+ desc: "Äänestettäviä viestejä sisältävä ketju luodaan"+ remove_as_post_voting:+ label: "Poista viestiäänestys"+ desc: "Ketju luodaan tavallisessa muodossa"+ vote:+ already_voted: "Voit äänestää vain yhtä vastausta tähän kysymykseen"+ user_over_limit: "Et voi ylittää luottamustasosi äänimäärää."+ one_vote_per_post: "Voit äänestää kutakin viestiä vain kerran."+ last_answer_lowercase: viimeisin vastaus+ answer_lowercase:+ one: vastaus+ other: vastausta+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Syötä vähintään %{count} merkki"+ other: "Syötä vähintään %{count} merkkiä"+ length_ok:+ one: "%{count} merkki jäljellä..."+ other: "%{count} merkkiä jäljellä..."+ too_long:+ one: "Kommentin pituus voi olla enintään %{count} merkki"+ other: "Kommentin pituus voi olla enintään %{count} merkkiä"+ submit: "Lisää kommentti"+ edit: "muokkaa"+ cancel: "peruuta"+ add: "Lisää kommentti"+ show:+ one: Näytä %{count} kommentti lisää+ other: Näytä %{count} kommenttia lisää+ delete:+ confirm: "Oletko varma, että haluat poistaa tämän kommentin?"+ user:+ deleted: "(käyttäjä poistettu)"+ reviewables:+ comment_already_handled: "Kiitos, mutta olemme jo käsitelleet tämän kommentin ja todenneet, ettei sitä tarvitse liputtaa uudelleen."+ actions:+ agree:+ title: "Hyväksy..."+ agree_and_keep_comment:+ title: "Pidä kommentti"+ description: "Hyväksy liputus ja pidä kommentti ennallaan."+ agree_and_keep_deleted:+ title: "Pidä kommentti poistettuna"+ description: "Hyväksy liputus ja pidä kommentti poistettuna."+ agree_and_suspend:+ title: "Aseta käyttäjä käyttökieltoon"+ description: "Hyväksy liputus ja aseta käyttäjä käyttökieltoon."+ agree_and_silence:+ title: "Hiljennä käyttäjä"+ description: "Hyväksy liputus ja hiljennä käyttäjä."+ agree_and_restore:+ title: "Palauta kommentti"+ description: "Palauta kommentti, jotta käyttäjät näkevät sen."+ agree_and_delete:+ title: "Poista kommentti"+ description: "Poista kommentti, jotta käyttäjät eivät näe sitä."+ delete_and_agree:+ title: "Ohita liputus ja poista kommentti"+ description: "Ohita lippu poistamalla se jonosta ja poista kommentti."+ disagree_and_restore:+ title: "Hylkää ja palauta kommentti"+ description: "Palauta kommentti, jotta kaikki käyttäjät näkevät sen."+ disagree:+ title: "Hylkää"+ ignore:+ title: "Älä tee mitään"+ description: "Ohita lippu poistamalla se jonosta tekemättä toimia."+ transcript:+ view: "Näytä aiempien kommenttien transkriptio"+ topic:+ answer:+ label: "Vastaus"+ help: "ala kirjoittamaan vastausta"+ sort_by: "Järjestys"+ votes: "Äänet"+ activity: "Toiminta"+ answer_count:+ one: "%{count} vastaus"+ other: "%{count} vastausta"+ review:+ transcript:+ view: "Näytä aiempien viestien transkriptio"+ types:+ reviewable_post_voting_comment:+ title: "Liputettu viestiäänestyskommentti"diff --git a/plugins/discourse-post-voting/config/locales/client.fr.yml b/plugins/discourse-post-voting/config/locales/client.fr.ymlnew file mode 100644index 00000000000..38a41f65f51--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.fr.yml@@ -0,0 +1,119 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: Vote d'un message+ post_voting:+ reviewables:+ comment_already_handled: "Merci, mais nous avons déjà examiné ce commentaire et déterminé qu'il n'a pas besoin d'être signalé à nouveau."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "nouveau commentaire"+ popup:+ question_answer_user_commented: '%{username} a commenté dans « %{topic} » - %{site_title}'+ category:+ post_voting_settings_heading: Vote d'un message+ create_as_post_voting_default: Les nouveaux sujets sont par défaut les sujets de vote de message dans cette catégorie.+ only_post_voting_in_this_category: Les nouveaux sujets ne peuvent être que des sujets postérieurs au vote dans cette catégorie.+ composer:+ create_post_voting:+ label: "Créer un sujet de vote de message"+ composer_actions:+ create_as_post_voting:+ label: "Activer/désactiver le vote de message"+ desc: "Le sujet sera créé avec des messages pouvant faire l'objet d'un vote"+ remove_as_post_voting:+ label: "Supprimer le vote de message"+ desc: "Le sujet sera créé dans le format normal"+ vote:+ already_voted: "Vous ne pouvez voter qu'une seule fois par question."+ user_over_limit: "Vous ne pouvez pas dépasser le nombre de votes correspondant à votre niveau de confiance."+ one_vote_per_post: "Vous ne pouvez voter qu'une seule fois pour chaque message."+ last_answer_lowercase: dernière réponse+ answer_lowercase:+ one: réponse+ other: réponses+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Saisissez au moins %{count} caractère"+ other: "Saisissez au moins %{count} caractères"+ length_ok:+ one: "Il reste %{count} caractère…"+ other: "Il reste %{count} caractères…"+ too_long:+ one: "Le commentaire ne peut pas comporter plus de %{count} caractère"+ other: "Le commentaire ne peut pas comporter plus de %{count} caractères"+ submit: "Ajouter un commentaire"+ edit: "modifier"+ cancel: "annuler"+ add: "Ajouter un commentaire"+ show:+ one: Afficher %{count} commentaire supplémentaire+ other: Afficher %{count} commentaires supplémentaires+ delete:+ confirm: "Voulez-vous vraiment supprimer ce commentaire ?"+ user:+ deleted: "(utilisateur supprimé)"+ reviewables:+ comment_already_handled: "Merci, mais nous avons déjà examiné ce commentaire et déterminé qu'il n'a pas besoin d'être signalé à nouveau."+ actions:+ agree:+ title: "D'accord…"+ agree_and_keep_comment:+ title: "Conserver le commentaire"+ description: "Accepter le signalement et conserver le commentaire tel quel."+ agree_and_keep_deleted:+ title: "Garder le commentaire supprimé"+ description: "Accepter le signalement et laisser le commentaire supprimé."+ agree_and_suspend:+ title: "Suspendre l'utilisateur"+ description: "Accepter le signalement et suspendre l'utilisateur."+ agree_and_silence:+ title: "Désactiver l'utilisateur"+ description: "Accepter le signalement et désactiver l'utilisateur."+ agree_and_restore:+ title: "Restaurer le commentaire"+ description: "Restaurer le commentaire pour que les utilisateurs puissent le voir."+ agree_and_delete:+ title: "Supprimer le commentaire"+ description: "Supprimer le commentaire pour que les utilisateurs ne puissent pas le voir."+ delete_and_agree:+ title: "Ignorer le signalement et supprimer le commentaire"+ description: "Ignorez le signalement en le supprimant de la file d'attente et supprimez le commentaire."+ disagree_and_restore:+ title: "Rejeter le signalement et rétablir le commentaire"+ description: "Restaurer le commentaire pour que tous les utilisateurs puissent le voir."+ disagree:+ title: "Refuser"+ ignore:+ title: "Ne rien faire"+ description: "Ignorez le signalement en le supprimant de la file d'attente sans prendre aucune mesure."+ transcript:+ view: "Afficher la transcription des commentaires précédents"+ topic:+ answer:+ label: "Réponse"+ help: "commencez à rédiger une réponse"+ sort_by: "Trier par"+ votes: "Votes"+ activity: "Activité"+ answer_count:+ one: "%{count} réponse"+ other: "%{count} réponses"+ review:+ transcript:+ view: "Afficher la transcription des messages précédents"+ types:+ reviewable_post_voting_comment:+ title: "Commentaire sur le vote de publication signalé"diff --git a/plugins/discourse-post-voting/config/locales/client.gl.yml b/plugins/discourse-post-voting/config/locales/client.gl.ymlnew file mode 100644index 00000000000..79c6ecccfa7--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.gl.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/++gl:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Escriba como mínimo %{count} carácter"+ other: "Escriba como mínimo %{count} caracteres"+ edit: "editar"+ cancel: "cancelar"+ user:+ deleted: "(usuario eliminado)"+ reviewables:+ actions:+ agree:+ title: "De acordo..."+ agree_and_suspend:+ title: "Suspender un usuario"+ description: "De acordo con esta denuncia e suspender o usuario."+ agree_and_silence:+ title: "Silenciar o usuario"+ description: "De acordo con esta denuncia e silenciar o usuario."+ disagree:+ title: "Discrepar"+ topic:+ sort_by: "Ordenar por"+ activity: "Actividade"diff --git a/plugins/discourse-post-voting/config/locales/client.he.yml b/plugins/discourse-post-voting/config/locales/client.he.ymlnew file mode 100644index 00000000000..57231678c99--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.he.yml@@ -0,0 +1,133 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: הצבעה על פוסטים+ post_voting:+ reviewables:+ comment_already_handled: "תודה לך, כבר בדקנו את התגובה הזאת והחלטנו שאין צורך לסמן אותה בדגל פעם נוספת."+ js:+ discourse_post_voting:+ title: "הצבעה על פוסטים"+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "תגובה חדשה"+ popup:+ question_answer_user_commented: 'נוספה תגובה מאת %{username} על „%{topic}” - %{site_title}'+ category:+ post_voting_settings_heading: מענה על שאלות+ create_as_post_voting_default: נושאים חדשים מגיעים לשו"ת בקטגוריה זו.+ only_post_voting_in_this_category: נושאים חדשים יכולים להצביע על פוסטים בנושאים בקטגוריה זו.+ composer:+ create_post_voting:+ label: "יצירת נושא שו\"ת"+ composer_actions:+ create_as_post_voting:+ label: "החלפת מצב שו\"ת"+ desc: "הנושא ייווצר בתבנית שו\"ת"+ remove_as_post_voting:+ label: "הסרת שו\"ת"+ desc: "הנושא ייווצר בתבנית הרגילה"+ vote:+ already_voted: "ניתן להצביע רק פעם אחת לשאלה."+ user_over_limit: "הגעת לכמות המקסימלית של ההצבעות."+ one_vote_per_post: "ניתן להצביע רק פעם אחת לפוסט."+ last_answer_lowercase: תשובה אחרונה+ answer_lowercase:+ one: תשובה+ two: תשובות+ many: תשובות+ other: תשובות+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "נא להקליד תו %{count} לפחות"+ two: "נא להקליד %{count} תווים לפחות"+ many: "נא להקליד %{count} תווים לפחות"+ other: "נא להקליד %{count} תווים לפחות"+ length_ok:+ one: "נותר תו %{count}…"+ two: "נותרו %{count} תווים…"+ many: "נותרו %{count} תווים…"+ other: "נותרו %{count} תווים…"+ too_long:+ one: "תגובה לא יכולה להיות ארוכה מתו %{count}"+ two: "תגובה לא יכולה להיות ארוכה מ־%{count} תווים"+ many: "תגובה לא יכולה להיות ארוכה מ־%{count} תווים"+ other: "תגובה לא יכולה להיות ארוכה מ־%{count} תווים"+ submit: "הוספת תגובה"+ edit: "עריכה"+ cancel: "ביטול"+ add: "הוספת תגובה"+ show:+ one: הצגת תגובה %{count} נוספת+ two: הצגת %{count} תגובות נוספות+ many: הצגת %{count} תגובות נוספות+ other: הצגת %{count} תגובות נוספות+ delete:+ confirm: "למחוק את התגובה הזאת?"+ user:+ deleted: "(משתמש נמחק)"+ reviewables:+ comment_already_handled: "תודה לך, כבר בדקנו את התגובה הזאת והחלטנו שאין צורך לסמן אותה בדגל פעם נוספת."+ actions:+ agree:+ title: "הסכמה…"+ agree_and_keep_comment:+ title: "להשאיר את התגובה"+ description: "הבעת הסכמה עם הדגל והשארת התגובה ללא שינוי."+ agree_and_keep_deleted:+ title: "להשאיר את התגובה מחוקה"+ description: "הבעת הסכמה עם הדגל והשארת התגובה מחוקה."+ agree_and_suspend:+ title: "השעיית משתמש"+ description: "הבעת הסכמה עם הדגל והשעיית המשתמש."+ agree_and_silence:+ title: "השתקת משתמש"+ description: "הבעת הסכמה עם הדגל והשתקת המשתמש."+ agree_and_restore:+ title: "שחזור תגובה"+ description: "לשחזר את התגובה כדי שמשתמשים יוכלו לראות אותה."+ agree_and_delete:+ title: "מחיקת תגובה"+ description: "למחוק את התגובה כדי שמשתמשים לא יוכלו לראות אותה."+ delete_and_agree:+ title: "התעלמות מהדגל ומחיקת התגובה"+ description: "התעלמות מהדגל על ידי הסרתו מהתור ומחיקת התגובה."+ disagree_and_restore:+ title: "לסרב ולשחזר תגובה"+ description: "לשחזר את התגובה כדי שכל המשתמשים יוכלו לראות אותה."+ disagree:+ title: "אי קבלה"+ ignore:+ title: "לא לעשות דבר"+ description: "התעלמות מהדגל על ידי הסרתו מהתור מבלי לנקוט בשום פעולה."+ transcript:+ view: "הצגת תמליל התגובות הקודמות"+ topic:+ answer:+ label: "מענה"+ help: "התחלת כתיבת תשובה"+ sort_by: "מיון לפי"+ votes: "הצבעות"+ activity: "פעילות"+ answer_count:+ one: "תשובה %{count}"+ two: "%{count} תשובות"+ many: "%{count} תשובות"+ other: "%{count} תשובות"+ review:+ transcript:+ view: "הצגת תמליל ההודעות הקודמות"+ types:+ reviewable_post_voting_comment:+ title: "הערה על הצבעת פוסט מסומן"diff --git a/plugins/discourse-post-voting/config/locales/client.hr.yml b/plugins/discourse-post-voting/config/locales/client.hr.ymlnew file mode 100644index 00000000000..f824dbf9f43--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.hr.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/++hr:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Unesite barem %{count} znak"+ few: "Unesite barem %{count} znakova"+ other: "Unesite barem %{count} znakova"+ edit: "uredi"+ cancel: "otkaži"+ user:+ deleted: "(korisnik izbrisan)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspendiraj korisnika"+ agree_and_silence:+ title: "Ušuti korisnika"+ disagree:+ title: "Odbaci"+ topic:+ sort_by: "Sortiraj po"+ activity: "Aktivnosti"diff --git a/plugins/discourse-post-voting/config/locales/client.hu.yml b/plugins/discourse-post-voting/config/locales/client.hu.ymlnew file mode 100644index 00000000000..c391c5a7dc1--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.hu.yml@@ -0,0 +1,34 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span>%{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Nem lehet rövidebb, mint %{count} karakter"+ other: "Nem lehet rövidebb, mint %{count} karakter"+ edit: "szerkesztés"+ cancel: "mégse"+ user:+ deleted: "(felhasználó törölve)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Felhasználó felfüggesztése"+ description: "Egyetértés a megjelöléssel, és a felhasználó felfüggesztése"+ agree_and_silence:+ title: "Felhasználó némítása"+ description: "Egyetértés a megjelöléssel, és a felhasználó némítása"+ disagree:+ title: "Elutasítás"+ topic:+ sort_by: "Rendezés"+ activity: "Tevékenység"diff --git a/plugins/discourse-post-voting/config/locales/client.hy.yml b/plugins/discourse-post-voting/config/locales/client.hy.ymlnew file mode 100644index 00000000000..bd5333238ef--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.hy.yml@@ -0,0 +1,34 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Մուտքագրեք առնվազն %{count} սիմվոլ"+ other: "Մուտքագրեք առնվազն %{count} սիմվոլ"+ edit: "խմբագրել"+ cancel: "չեղարկել"+ user:+ deleted: "(օգտատերը ջնջված է)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Սառեցնել Օգտատիրոջը"+ description: "Ընդունել դրոշակավորումը և սառեցնել օգտատիրոջը:"+ agree_and_silence:+ title: "Լռեցնել Օգտատիրոջը"+ description: "Ընդունել դրոշակը և սառեցնել օգտատիրոջը:"+ disagree:+ title: "Չընդունել"+ topic:+ sort_by: "Դասավորել ըստ"+ activity: "Ակտիվության"diff --git a/plugins/discourse-post-voting/config/locales/client.id.yml b/plugins/discourse-post-voting/config/locales/client.id.ymlnew file mode 100644index 00000000000..a5b4c405abb--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.id.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/++id:+ js:+ post_voting:+ post:+ post_voting_comment:+ edit: "ubah"+ cancel: "batal"+ user:+ deleted: "(pengguna dihapus)"+ reviewables:+ actions:+ agree:+ title: "Setuju..."+ agree_and_suspend:+ title: "Tangguhkan Pengguna"+ description: "Setuju dengan penanda dan menangguhkan pengguna."+ agree_and_silence:+ title: "Senyapkan Pengguna"+ description: "Setuju dengan penanda dan senyapkan pengguna."+ disagree:+ title: "Tidak setuju"+ ignore:+ title: "Tidak Melakukan Apapun"+ description: "Abaikan penanda tersebut dengan menghapusnya dari antrean tanpa mengambil tindakan apa pun."+ topic:+ activity: "Activity"diff --git a/plugins/discourse-post-voting/config/locales/client.it.yml b/plugins/discourse-post-voting/config/locales/client.it.ymlnew file mode 100644index 00000000000..b0f8a985d40--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.it.yml@@ -0,0 +1,119 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: Votazioni dei messaggi+ post_voting:+ reviewables:+ comment_already_handled: "Grazie, ma abbiamo già esaminato questo commento e stabilito che non è necessario contrassegnarlo di nuovo."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "nuovo commento"+ popup:+ question_answer_user_commented: '%{username} ha commentato in "%{topic}" - %{site_title}'+ category:+ post_voting_settings_heading: Votazioni dei messaggi+ create_as_post_voting_default: I nuovi argomenti hanno come impostazione predefinita la votazione dei messaggi in questa categoria.+ only_post_voting_in_this_category: I nuovi argomenti possono essere solo messaggi a votazione in questa categoria.+ composer:+ create_post_voting:+ label: "Crea un argomento di votazione dei messaggi"+ composer_actions:+ create_as_post_voting:+ label: "Attiva/disattiva votazione dei messaggi"+ desc: "L'argomento verrà creato con messaggi votabili"+ remove_as_post_voting:+ label: "Rimuovi votazione dei messaggi"+ desc: "L'argomento verrà creato nel formato normale"+ vote:+ already_voted: "Puoi votare una sola volta per domanda."+ user_over_limit: "Non puoi superare il numero di voti per il tuo livello di attendibilità."+ one_vote_per_post: "Puoi votare una sola volta per messaggio."+ last_answer_lowercase: ultima risposta+ answer_lowercase:+ one: risposta+ other: risposte+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Inserisci almeno %{count} carattere"+ other: "Inserisci almeno %{count} caratteri"+ length_ok:+ one: "%{count} carattere rimasto..."+ other: "%{count} caratteri rimasti..."+ too_long:+ one: "Il commento non può essere più lungo di %{count} carattere"+ other: "Il commento non può essere più lungo di %{count} caratteri"+ submit: "Aggiungi un commento"+ edit: "modifica"+ cancel: "annulla"+ add: "Aggiungi un commento"+ show:+ one: Mostra %{count} altro commento+ other: Mostra altri %{count} commenti+ delete:+ confirm: "Vuoi davvero eliminare questo commento?"+ user:+ deleted: "(utente eliminato)"+ reviewables:+ comment_already_handled: "Grazie, ma abbiamo già esaminato questo commento e stabilito che non è necessario contrassegnarlo di nuovo."+ actions:+ agree:+ title: "Accetta..."+ agree_and_keep_comment:+ title: "Mantieni il commento"+ description: "Accetta la segnalazione e mantieni invariato il commento."+ agree_and_keep_deleted:+ title: "Mantieni il commento cancellato"+ description: "Accetta segnalazione e conferma eliminazione del commento."+ agree_and_suspend:+ title: "Sospendi utente"+ description: "Accetta segnalazione e sospendi l'utente."+ agree_and_silence:+ title: "Silenzia utente"+ description: "Accetta segnalazione e silenzia l'utente."+ agree_and_restore:+ title: "Ripristina il commento"+ description: "Ripristina il commento in modo che gli utenti possano vederlo."+ agree_and_delete:+ title: "Elimina il commento"+ description: "Elimina il commento in modo che gli utenti non possano vederlo."+ delete_and_agree:+ title: "Ignora segnalazione ed elimina commento"+ description: "Ignora la segnalazione rimuovendola dalla coda ed eliminando il commento."+ disagree_and_restore:+ title: "Esprimi disaccordo e ripristina il commento"+ description: "Ripristina il commento in modo che tutti gli utenti possano vederlo."+ disagree:+ title: "Rifiuta"+ ignore:+ title: "Non fare nulla"+ description: "Ignora la segnalazione rimuovendola dalla coda senza intraprendere alcuna azione."+ transcript:+ view: "Visualizza la trascrizione dei commenti precedenti"+ topic:+ answer:+ label: "Risposta"+ help: "iniziare a comporre una risposta"+ sort_by: "Ordina per"+ votes: "Voti"+ activity: "Attività"+ answer_count:+ one: "%{count} risposta"+ other: "%{count} risposte"+ review:+ transcript:+ view: "Visualizza la trascrizione dei messaggi precedenti"+ types:+ reviewable_post_voting_comment:+ title: "Commento sulla votazione del messaggio contrassegnato"diff --git a/plugins/discourse-post-voting/config/locales/client.ja.yml b/plugins/discourse-post-voting/config/locales/client.ja.ymlnew file mode 100644index 00000000000..487559833ba--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.ja.yml@@ -0,0 +1,113 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: 投稿の投票+ post_voting:+ reviewables:+ comment_already_handled: "ありがとうございます。ただ、このコメントはすでにレビュー済みで、通報の必要がないと判断されています。"+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "新しいコメント"+ popup:+ question_answer_user_commented: '%{username} が「%{topic}」にコメントしました - %{site_title}'+ category:+ post_voting_settings_heading: 投稿の投票+ create_as_post_voting_default: このカテゴリの新しいトピックは、デフォルトで投稿の投票トピックになります。+ only_post_voting_in_this_category: このカテゴリの新しいトピックは、投稿の投票トピックにしかできません。+ composer:+ create_post_voting:+ label: "投稿の投票トピックを作成する"+ composer_actions:+ create_as_post_voting:+ label: "投稿の投票を切り替える"+ desc: "トピックは投票可能な投稿で作成されます"+ remove_as_post_voting:+ label: "投稿の投票を削除"+ desc: "トピックは通常の形式で作成されます"+ vote:+ already_voted: "質問ごとに 1 回だけ投票できます。"+ user_over_limit: "信頼レベルの投票数を超えることはできません。"+ one_vote_per_post: "投稿ごとに 1 回だけ投票できます。"+ last_answer_lowercase: 最後の回答+ answer_lowercase:+ other: 回答+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ other: "%{count} 文字以上を入力してください"+ length_ok:+ other: "残り %{count} 文字..."+ too_long:+ other: "コメントは %{count} 文字以下にしてください"+ submit: "コメントを追加する"+ edit: "編集"+ cancel: "キャンセル"+ add: "コメントを追加する"+ show:+ other: さらに %{count} 件のコメントを表示+ delete:+ confirm: "このコメントを削除してもよろしいですか?"+ user:+ deleted: "(削除されたユーザー)"+ reviewables:+ comment_already_handled: "ありがとうございます。ただ、このコメントはすでにレビュー済みで、通報の必要がないと判断されています。"+ actions:+ agree:+ title: "同意…"+ agree_and_keep_comment:+ title: "コメントを保持"+ description: "通報に同意し、コメントを変更しないままにします。"+ agree_and_keep_deleted:+ title: "コメントを削除されたままにする"+ description: "通報に同意し、コメントを削除したままにします。"+ agree_and_suspend:+ title: "ユーザーを凍結"+ description: "通報に同意し、ユーザーを凍結します。"+ agree_and_silence:+ title: "ユーザーを投稿禁止"+ description: "通報に同意し、ユーザーを投稿禁止にします。"+ agree_and_restore:+ title: "コメントを復元"+ description: "ユーザーが閲覧できるようにコメントを復元します。"+ agree_and_delete:+ title: "コメントを削除"+ description: "ユーザーが閲覧できないようにコメントを削除します。"+ delete_and_agree:+ title: "通報を無視してコメントを削除"+ description: "キューから削除して通報を無視し、そのコメントを削除します。"+ disagree_and_restore:+ title: "却下してコメントを復元"+ description: "すべてのユーザーが閲覧できるようにコメントを復元します。"+ disagree:+ title: "却下"+ ignore:+ title: "何もしない"+ description: "何もアクションを起こさずに、キューから削除して通報を無視します。"+ transcript:+ view: "前のコメントのトランスクリプトを表示"+ topic:+ answer:+ label: "回答"+ help: "回答を書き始めます"+ sort_by: "並べ替え"+ votes: "投票"+ activity: "アクティビティ"+ answer_count:+ other: "回答 %{count} 件"+ review:+ transcript:+ view: "前のメッセージのトランスクリプトを表示"+ types:+ reviewable_post_voting_comment:+ title: "通報された投稿の投票コメント"diff --git a/plugins/discourse-post-voting/config/locales/client.ko.yml b/plugins/discourse-post-voting/config/locales/client.ko.ymlnew file mode 100644index 00000000000..80d05726e6a--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.ko.yml@@ -0,0 +1,35 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ other: "최소 %{count}자 이상 입력하세요"+ edit: "수정"+ cancel: "취소"+ user:+ deleted: "(사용자 삭제됨)"+ reviewables:+ actions:+ agree:+ title: "동의..."+ agree_and_suspend:+ title: "사용자 차단"+ description: "플래그에 동의하고 사용자를 일시 중지하십시오."+ agree_and_silence:+ title: "글 작성 중지 사용자"+ description: "신고에 동의하고 사용자를 쓰기 금지로 설정합니다."+ disagree:+ title: "동의하지 않음"+ topic:+ sort_by: "정렬 기준"+ activity: "활동"diff --git a/plugins/discourse-post-voting/config/locales/client.lt.yml b/plugins/discourse-post-voting/config/locales/client.lt.ymlnew file mode 100644index 00000000000..0ed5d7a1e81--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.lt.yml@@ -0,0 +1,37 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Įveskite bent jau %{count} simbolį"+ few: "Įveskite bent jau %{count} simbolius"+ many: "Įveskite bent jau %{count}simbolių"+ other: "Įveskite bent jau %{count}simbolius"+ edit: "redaguoti"+ cancel: "atšaukti"+ user:+ deleted: "(naudotojas ištrintas)"+ reviewables:+ actions:+ agree:+ title: "Sutinku..."+ agree_and_suspend:+ title: "Suspenduoti narį"+ agree_and_silence:+ title: "Nutildyti narį"+ description: "Sutikti su pranešimu ir nutildyti narį."+ disagree:+ title: "Nesutinka"+ topic:+ sort_by: "Rūšiuoti pagal"+ activity: "Aktyvumas"diff --git a/plugins/discourse-post-voting/config/locales/client.lv.yml b/plugins/discourse-post-voting/config/locales/client.lv.ymlnew file mode 100644index 00000000000..4dba3cfbe9e--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.lv.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/++lv:+ js:+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ zero: "Ievadiet vismaz %{count} simbolus"+ one: "Ievadiet vismaz %{count} simbolu"+ other: "Ievadiet vismaz %{count} simbolus"+ edit: "rediģēt"+ cancel: "atcelt"+ user:+ deleted: "(lietotājs dzēsts)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Apturētie lietotāji"+ disagree:+ title: "Nepiekrist"+ topic:+ sort_by: "Kārtot pēc"+ activity: "Aktivitāte"diff --git a/plugins/discourse-post-voting/config/locales/client.nb_NO.yml b/plugins/discourse-post-voting/config/locales/client.nb_NO.ymlnew file mode 100644index 00000000000..42f6120d308--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.nb_NO.yml@@ -0,0 +1,34 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Skriv inn minst ett tegn"+ other: "Skriv inn minst %{count} tegn"+ edit: "endre"+ cancel: "avbryt"+ user:+ deleted: "(bruker slettet)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Steng ute bruker"+ description: "Si deg enig med rapportering og steng ute bruker. "+ agree_and_silence:+ title: "Demp bruker"+ description: "Si deg enig med rapportering og demp bruker. "+ disagree:+ title: "Si deg uenig"+ topic:+ sort_by: "Sorter etter"+ activity: "Aktivitet"diff --git a/plugins/discourse-post-voting/config/locales/client.nl.yml b/plugins/discourse-post-voting/config/locales/client.nl.ymlnew file mode 100644index 00000000000..9c8ab301671--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.nl.yml@@ -0,0 +1,119 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: Stemmen op berichten+ post_voting:+ reviewables:+ comment_already_handled: "Bedankt, maar we hebben deze reactie al beoordeeld en vastgesteld dat deze niet opnieuw hoeft te worden gemarkeerd."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "nieuwe reactie"+ popup:+ question_answer_user_commented: '%{username} heeft gereageerd in ''%{topic}'' - %{site_title}'+ category:+ post_voting_settings_heading: Stemmen op berichten+ create_as_post_voting_default: Nieuwe topics in deze categorie zijn standaard ingesteld op Stemmen op berichten.+ only_post_voting_in_this_category: Nieuwe topics in deze categorie kunnen alleen Stemmen op berichten zijn.+ composer:+ create_post_voting:+ label: "Topic met stemmen op berichten maken"+ composer_actions:+ create_as_post_voting:+ label: "Stemmen op berichten schakelen"+ desc: "Topic wordt gemaakt met berichten waarop kan worden gestemd"+ remove_as_post_voting:+ label: "Stemmen op berichten verwijderen"+ desc: "Topic wordt gemaakt in de normale vorm"+ vote:+ already_voted: "Je kunt maar één keer stemmen per vraag."+ user_over_limit: "Je mag het aantal stemmen voor je vertrouwensniveau niet overschrijden."+ one_vote_per_post: "Je kunt maar één keer stemmen per bericht."+ last_answer_lowercase: laatste antwoord+ answer_lowercase:+ one: antwoord+ other: antwoorden+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Voer minimaal %{count} teken in"+ other: "Voer minimaal %{count} tekens in"+ length_ok:+ one: "%{count} teken resterend..."+ other: "%{count} tekens resterend..."+ too_long:+ one: "Reactie mag niet langer zijn dan %{count} teken"+ other: "Reactie mag niet langer zijn dan %{count} tekens"+ submit: "Voeg een reactie toe"+ edit: "bewerken"+ cancel: "annuleren"+ add: "Voeg een reactie toe"+ show:+ one: Nog %{count} reactie weergeven+ other: Nog %{count} reacties weergeven+ delete:+ confirm: "Weet je zeker dat je deze reactie wilt verwijderen?"+ user:+ deleted: "(gebruiker verwijderd)"+ reviewables:+ comment_already_handled: "Bedankt, maar we hebben deze reactie al beoordeeld en vastgesteld dat deze niet opnieuw hoeft te worden gemarkeerd."+ actions:+ agree:+ title: "Akkoord..."+ agree_and_keep_comment:+ title: "Reactie behouden"+ description: "Ga akkoord met de markering en laat de reactie ongewijzigd."+ agree_and_keep_deleted:+ title: "Reactie verwijderd houden"+ description: "Ga akkoord met de markering en laat de reactie verwijderd."+ agree_and_suspend:+ title: "Gebruiker schorsen"+ description: "Akkoord met markering en de gebruiker schorsen."+ agree_and_silence:+ title: "Gebruiker dempen"+ description: "Akkoord met markering en de gebruiker dempen."+ agree_and_restore:+ title: "Reactie herstellen"+ description: "Herstel de reactie zodat gebruikers deze kunnen zien."+ agree_and_delete:+ title: "Reactie verwijderen"+ description: "Verwijder de reactie zodat gebruikers deze niet kunnen zien."+ delete_and_agree:+ title: "Markering negeren en reactie verwijderen"+ description: "Negeer de markering door deze uit de wachtrij te verwijderen en verwijder de reactie."+ disagree_and_restore:+ title: "Niet akkoord en reactie herstellen"+ description: "Herstel de reactie zodat alle gebruikers deze kunnen zien."+ disagree:+ title: "Niet akkoord"+ ignore:+ title: "Niets doen"+ description: "Negeer de markering door deze uit de wachtrij te verwijderen zonder enige actie te ondernemen."+ transcript:+ view: "Transcript van eerdere reacties weergeven"+ topic:+ answer:+ label: "Antwoorden"+ help: "begin met het opstellen van een antwoord"+ sort_by: "Sorteren op"+ votes: "Stemmen"+ activity: "Activiteit"+ answer_count:+ one: "%{count} antwoord"+ other: "%{count} antwoorden"+ review:+ transcript:+ view: "Transcript van eerdere berichten weergeven"+ types:+ reviewable_post_voting_comment:+ title: "Gemarkeerde Stemmen op berichten-reactie"diff --git a/plugins/discourse-post-voting/config/locales/client.pl_PL.yml b/plugins/discourse-post-voting/config/locales/client.pl_PL.ymlnew file mode 100644index 00000000000..663ae7e227f--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.pl_PL.yml@@ -0,0 +1,103 @@+# 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:+ post_voting:+ reviewables:+ comment_already_handled: "Dziękujemy, ale sprawdziliśmy już ten komentarz i stwierdziliśmy, że nie ma potrzeby jego ponownego oznaczania."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "nowy komentarz"+ composer:+ composer_actions:+ remove_as_post_voting:+ desc: "Temat zostanie utworzony w zwykłym formacie"+ vote:+ already_voted: "Na jedno pytanie można oddać tylko jeden głos."+ user_over_limit: "Nie możesz przekroczyć liczby głosów odpowiadającej Twojemu poziomowi zaufania."+ one_vote_per_post: "Na każdy post można oddać tylko jeden głos."+ last_answer_lowercase: ostatnia odpowiedź+ answer_lowercase:+ one: odpowiedź+ few: odpowiedzi+ many: odpowiedzi+ other: odpowiedzi+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Wprowadź co najmniej %{count} znak"+ few: "Wprowadź co najmniej %{count} znaki"+ many: "Wprowadź co najmniej %{count} znaków"+ other: "Wprowadź co najmniej %{count} znaki"+ length_ok:+ one: "Pozostał %{count} znak..."+ few: "Pozostały %{count} znaki..."+ many: "Pozostało %{count} znaków..."+ other: "Pozostało %{count} znaków..."+ too_long:+ one: "Komentarz nie może być dłuższy niż %{count} znak"+ few: "Komentarz nie może być dłuższy niż %{count} znaki"+ many: "Komentarz nie może być dłuższy niż %{count} znaków"+ other: "Komentarz nie może być dłuższy niż %{count} znaków"+ submit: "Dodaj komentarz"+ edit: "edytuj"+ cancel: "anuluj"+ add: "Dodaj komentarz"+ show:+ one: Pokaż jeszcze %{count} komentarz+ few: Pokaż jeszcze %{count} komentarze+ many: Pokaż jeszcze %{count} komentarzy+ other: Pokaż %{count} więcej komentarzy+ delete:+ confirm: "Czy na pewno chcesz usunąć ten komentarz?"+ user:+ deleted: "(użytkownik usunięty)"+ reviewables:+ comment_already_handled: "Dziękujemy, ale sprawdziliśmy już ten komentarz i stwierdziliśmy, że nie ma potrzeby jego ponownego oznaczania."+ actions:+ agree:+ title: "Zgadzam się..."+ agree_and_keep_comment:+ title: "Zachowaj komentarz"+ description: "Zgadzam się z flagą i pozostawię komentarz bez zmian."+ agree_and_keep_deleted:+ title: "Zachowaj komentarz usunięty"+ description: "Zgadzam się z flagą i pozostawię komentarz usunięty."+ agree_and_suspend:+ title: "Zawieś użytkownika"+ description: "Zgódź się z flagą i zawieś konto użytkownika."+ agree_and_silence:+ title: "Wycisz użytkownika"+ description: "Zgódź się z flagą i wycisz użytkownika."+ agree_and_restore:+ title: "Przywróć komentarz"+ description: "Przywróć komentarz, aby użytkownicy mogli go zobaczyć."+ agree_and_delete:+ title: "Usuń komentarz"+ description: "Usuń komentarz, aby użytkownicy nie mogli go zobaczyć."+ disagree_and_restore:+ description: "Przywróć komentarz, aby wszyscy użytkownicy mogli go zobaczyć."+ disagree:+ title: "Wycofaj"+ ignore:+ title: "Nic nie rób"+ description: "Zignoruj flagę usuwając ją z kolejki bez podejmowania jakichkolwiek działań."+ topic:+ sort_by: "Sortuj po"+ votes: "Głosy"+ activity: "Aktywność"+ answer_count:+ one: "%{count} odpowiedź"+ few: "%{count} odpowiedzi"+ many: "%{count} odpowiedzi"+ other: "%{count} odpowiedzi"+ review:+ transcript:+ view: "Zobacz transkrypcję poprzednich wiadomości"diff --git a/plugins/discourse-post-voting/config/locales/client.pt.yml b/plugins/discourse-post-voting/config/locales/client.pt.ymlnew file mode 100644index 00000000000..f985c0ecd3d--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.pt.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/++pt:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Insira pelo menos %{count} caráter"+ other: "Insira pelo menos %{count} carateres"+ edit: "editar"+ cancel: "cancelar"+ user:+ deleted: "(usuário eliminado)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Utilizador Suspenso"+ agree_and_silence:+ title: "Silenciar Usuário"+ disagree:+ title: "Discordar"+ topic:+ sort_by: "Ordenar por"+ activity: "Actividade"diff --git a/plugins/discourse-post-voting/config/locales/client.pt_BR.yml b/plugins/discourse-post-voting/config/locales/client.pt_BR.ymlnew file mode 100644index 00000000000..d7053a38f4e--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.pt_BR.yml@@ -0,0 +1,119 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: Votação em publicação+ post_voting:+ reviewables:+ comment_already_handled: "Agradecemos, mas já analisamos este comentário e determinamos que não precisa ser sinalizado novamente."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "novo comentário"+ popup:+ question_answer_user_commented: '%{username} comentou em "%{topic}" - %{site_title}'+ category:+ post_voting_settings_heading: Votação de publicação+ create_as_post_voting_default: Novos tópicos padrão para tópicos de "Votação de publicação" nesta categoria.+ only_post_voting_in_this_category: Novos tópicos podem ser apenas tópicos de "votação em postagem" nesta categoria+ composer:+ create_post_voting:+ label: "Criar tópico de votação de publicação"+ composer_actions:+ create_as_post_voting:+ label: "Alterar votação de publicação"+ desc: "O tópico será criado com publicações para votar"+ remove_as_post_voting:+ label: "Remover votação de publicação"+ desc: "O tópico será criado no formato regular"+ vote:+ already_voted: "Você só pode votar uma vez por pergunta."+ user_over_limit: "Você não pode exceder o número de votos para seu nível de confiança."+ one_vote_per_post: "Você só pode votar uma vez em cada postagem."+ last_answer_lowercase: última resposta+ answer_lowercase:+ one: resposta+ other: respostas+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Insira pelo menos %{count} caractere"+ other: "Insira pelo menos %{count} caracteres"+ length_ok:+ one: "%{count} caractere restante..."+ other: "%{count} caracteres restantes..."+ too_long:+ one: "O comentário não pode ter mais do que %{count} caractere"+ other: "O comentário não pode ter mais do que %{count} caracteres"+ submit: "Adicione um comentário"+ edit: "editar"+ cancel: "cancelar"+ add: "Adicione um comentário"+ show:+ one: Mostrar mais %{count} comentário+ other: Mostrar mais %{count} comentários+ delete:+ confirm: "Tem certeza de que deseja excluir este comentário?"+ user:+ deleted: "(usuário(a) excluído(a))"+ reviewables:+ comment_already_handled: "Agradecemos, mas já analisamos este comentário e determinamos que não precisa ser sinalizado novamente."+ actions:+ agree:+ title: "Concordo..."+ agree_and_keep_comment:+ title: "Manter comentário"+ description: "Concorde com o sinalizador e mantenha o comentário inalterado."+ agree_and_keep_deleted:+ title: "Manter comentário excluído"+ description: "Concorde com o sinalizador e mantenha o comentário excluído."+ agree_and_suspend:+ title: "Suspender usuário(s)"+ description: "Concorde com o sinalizador e suspenda o(a) usuário(a)."+ agree_and_silence:+ title: "Silenciar usuário(a)"+ description: "Concorde com o sinalizador e silencie o(a) usuário(a)."+ agree_and_restore:+ title: "Restaurar comentário"+ description: "Restaure o comentário para que os(as) usuários(as) possam ver."+ agree_and_delete:+ title: "Excluir comentário"+ description: "Exclua o comentário para que os(as) usuários(as) não possam ver."+ delete_and_agree:+ title: "Ignorar sinalizador e excluir comentário"+ description: "Ignore o sinalizador ao removê-lo da fila e exclua o comentário."+ disagree_and_restore:+ title: "Discordar e restaurar comentário"+ description: "Restaure o comentário para que todos(as) usuários(as) possam ver."+ disagree:+ title: "Discordar"+ ignore:+ title: "Não fazer nada"+ description: "Ignore o sinalizador ao removê-lo da fila sem realizar nenhuma ação."+ transcript:+ view: "Ver transcrição de comentários anteriores"+ topic:+ answer:+ label: "Resposta"+ help: "começar a escrever uma resposta"+ sort_by: "Ordenar por"+ votes: "Votos"+ activity: "Atividade"+ answer_count:+ one: "%{count} resposta"+ other: "%{count} respostas"+ review:+ transcript:+ view: "Ver transcrição de mensagens anteriores"+ types:+ reviewable_post_voting_comment:+ title: "Comentário de votação em postagem sinalizado"diff --git a/plugins/discourse-post-voting/config/locales/client.ro.yml b/plugins/discourse-post-voting/config/locales/client.ro.ymlnew file mode 100644index 00000000000..c8a8be2bb4a--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.ro.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/++ro:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Introdu cel puțin un caracter"+ few: "Introdu cel puțin %{count} caractere"+ other: "Introdu cel puțin %{count} de caractere"+ edit: "Editează"+ cancel: "Anulează"+ user:+ deleted: "(utilizator șters)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspendă Utilizator"+ agree_and_silence:+ title: "Reducere la tăcere utilizator"+ disagree:+ title: "Nu sunt de acord"+ topic:+ sort_by: "Sortează după"+ activity: "Activitate"diff --git a/plugins/discourse-post-voting/config/locales/client.ru.yml b/plugins/discourse-post-voting/config/locales/client.ru.ymlnew file mode 100644index 00000000000..330f449fd50--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.ru.yml@@ -0,0 +1,131 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: Голосование по публикациям+ post_voting:+ reviewables:+ comment_already_handled: "Спасибо, но мы уже просмотрели этот комментарий и решили, что на него не нужно снова отправлять жалобу."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "новый комментарий"+ popup:+ question_answer_user_commented: '%{username} оставил(а) комментарий в теме «%{topic}» — %{site_title}'+ category:+ post_voting_settings_heading: Голосование по сообщениям+ create_as_post_voting_default: Новые темы в этой категории по умолчанию отображаются в формате «Голосование по сообщениям».+ only_post_voting_in_this_category: Новые темы в этой категории могут отображаться только в формате «Голосование по публикациям».+ composer:+ create_post_voting:+ label: "Cоздать тему с голосованием по сообщению"+ composer_actions:+ create_as_post_voting:+ label: "Включить голосование по сообщениям"+ desc: "Тема будет создана в формате голосования по сообщениям"+ remove_as_post_voting:+ label: "Отключить голосование по сообщениям"+ desc: "Тема будет создана в обычном формате"+ vote:+ already_voted: "Проголосовать можно только один раз за вопрос."+ user_over_limit: "Нельзя превышать количество голосов, установленное для вашего уровня доверия."+ one_vote_per_post: "Проголосовать можно только один раз на каждую запись."+ last_answer_lowercase: последний ответ+ answer_lowercase:+ one: ответ+ few: ответа+ many: ответов+ other: ответа+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Введите не менее %{count} символа"+ few: "Введите не менее %{count} символов"+ many: "Введите не менее %{count} символов"+ other: "Введите не менее %{count} символа"+ length_ok:+ one: "Остался %{count} символ..."+ few: "Осталось %{count} символа..."+ many: "Осталось %{count} символов..."+ other: "Осталось %{count} символа..."+ too_long:+ one: "Комментарий не может быть длиннее %{count} символа"+ few: "Комментарий не может быть длиннее %{count} символов"+ many: "Комментарий не может быть длиннее %{count} символов"+ other: "Комментарий не может быть длиннее %{count} символа"+ submit: "Добавить комментарий"+ edit: "изменить"+ cancel: "отменить"+ add: "Добавить комментарий"+ show:+ one: Показать ещё %{count} комментарий+ few: Показать ещё %{count} комментария+ many: Показать ещё %{count} комментариев+ other: Показать ещё %{count} комментария+ delete:+ confirm: "Действительно удалить этот комментарий?"+ user:+ deleted: "(пользователь удалён)"+ reviewables:+ comment_already_handled: "Спасибо, но мы уже просмотрели этот комментарий и решили, что на него не нужно снова отправлять жалобу."+ actions:+ agree:+ title: "Согласиться…"+ agree_and_keep_comment:+ title: "Сохранить комментарий"+ description: "Согласиться с жалобой, но оставить комментарий без изменений."+ agree_and_keep_deleted:+ title: "Оставить комментарий удаленным"+ description: "Согласиться с жалобой и оставить комментарий удаленным."+ agree_and_suspend:+ title: "Блокировка пользователя"+ description: "Согласиться с жалобой и заблокировать пользователя."+ agree_and_silence:+ title: "Заморозка пользователя"+ description: "Согласиться с жалобой и заморозить пользователя."+ agree_and_restore:+ title: "Восстановить комментарий"+ description: "Восстановить комментарий, чтобы пользователи могли его видеть."+ agree_and_delete:+ title: "Удалить комментарий"+ description: "Удалить комментарий, чтобы пользователи не могли его видеть."+ delete_and_agree:+ title: "Игнорировать жалобу и удалить комментарий"+ description: "Проигнорировать жалобу, удалив ее из очереди, и удалить комментарий."+ disagree_and_restore:+ title: "Отклонить жалобу и восстановить комментарий"+ description: "Восстановить комментарий, чтобы все пользователи могли его видеть."+ disagree:+ title: "Отклонить"+ ignore:+ title: "Ничего не делать"+ description: "Проигнорировать жалобу, удалив ее из очереди, не предпринимая никаких действий."+ transcript:+ view: "Просмотр содержимого предыдущих комментариев"+ topic:+ answer:+ label: "Ответ"+ help: "начните писать ответ"+ sort_by: "Сортировать по"+ votes: "Голосам"+ activity: "Активности"+ answer_count:+ one: "%{count} ответ"+ few: "%{count} ответа"+ many: "%{count} ответов"+ other: "%{count} ответа"+ review:+ transcript:+ view: "Просмотр содержимого предыдущих сообщений"+ types:+ reviewable_post_voting_comment:+ title: "Помеченный комментарий к публикации с голосованием"diff --git a/plugins/discourse-post-voting/config/locales/client.sk.yml b/plugins/discourse-post-voting/config/locales/client.sk.ymlnew file mode 100644index 00000000000..ee89868af78--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.sk.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/++sk:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Zadajte aspoň %{count} znak"+ few: "Zadajte aspoň %{count} znakov"+ many: "Zadajte aspoň %{count} znaky"+ other: "Zadajte aspoň %{count} znaky"+ edit: "uprav"+ cancel: "zrušiť"+ user:+ deleted: "(používateľ odstránený)"+ reviewables:+ actions:+ agree:+ title: "Súhlasím..."+ agree_and_suspend:+ title: "Suspendovaný užívateľ"+ description: "Súhlas s príznakom a pozastavenie používateľa."+ agree_and_silence:+ title: "Tichý užívateľ"+ description: "Súhlas s príznakom a umlčte používateľa."+ disagree:+ title: "Nesúhlasiť"+ ignore:+ title: "Nerobte nič"+ description: "Ignorujte príznak jeho odstránením z frontu bez vykonania akejkoľvek akcie."+ topic:+ sort_by: "Zoradiť podľa"+ activity: "Aktivity"+ review:+ transcript:+ view: "Zobraziť prepis predchádzajúcich správ"diff --git a/plugins/discourse-post-voting/config/locales/client.sl.yml b/plugins/discourse-post-voting/config/locales/client.sl.ymlnew file mode 100644index 00000000000..d08df469b59--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.sl.yml@@ -0,0 +1,38 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Vnesite vsaj %{count} znak"+ two: "Vnesite vsaj %{count} znaka"+ few: "Vnesite vsaj %{count} znake"+ other: "Vnesite vsaj %{count} znakov"+ edit: "uredi"+ cancel: "prekliči"+ user:+ deleted: "(uporabnik izbrisan)"+ reviewables:+ actions:+ agree:+ title: "Strinjam se..."+ agree_and_suspend:+ title: "Suspendiraj uporabnika"+ description: "Strinjam se z prijavo in suspendiraj uporabnika."+ agree_and_silence:+ title: "Utišaj uporabnika"+ description: "Potrdi prijavo in utišaj uporabnika"+ disagree:+ title: "Se ne strinjam"+ topic:+ sort_by: "Uredi po"+ activity: "Aktivnost"diff --git a/plugins/discourse-post-voting/config/locales/client.sq.yml b/plugins/discourse-post-voting/config/locales/client.sq.ymlnew file mode 100644index 00000000000..10a41a85efd--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.sq.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/++sq:+ js:+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Futni së paku %{count} gërmë"+ other: "Futni së paku %{count} gërma"+ edit: "redakto"+ cancel: "anulo"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Pezullo anëtarin"+ disagree:+ title: "Jo dakord"+ topic:+ sort_by: "Rendit sipas"+ activity: "Aktiviteti"diff --git a/plugins/discourse-post-voting/config/locales/client.sr.yml b/plugins/discourse-post-voting/config/locales/client.sr.ymlnew file mode 100644index 00000000000..8ef5e4e561f--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.sr.yml@@ -0,0 +1,21 @@+# 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:+ js:+ post_voting:+ post:+ post_voting_comment:+ edit: "izmeni"+ cancel: "otkaži"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspenduj Korisnika"+ disagree:+ title: "Odbaci"+ topic:+ activity: "Aktivnosti"diff --git a/plugins/discourse-post-voting/config/locales/client.sv.yml b/plugins/discourse-post-voting/config/locales/client.sv.ymlnew file mode 100644index 00000000000..e025fdcb0b9--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.sv.yml@@ -0,0 +1,42 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Skriv åtminstone %{count} tecken"+ other: "Skriv åtminstone %{count} tecken"+ edit: "ändra"+ cancel: "avbryt"+ user:+ deleted: "(användare raderad)"+ reviewables:+ actions:+ agree:+ title: "Godkänn..."+ agree_and_suspend:+ title: "Stäng av användaren"+ description: "Godkänn flaggning och stäng av användaren."+ agree_and_silence:+ title: "Tysta användaren"+ description: "Godkänn flaggning och tysta användaren."+ disagree:+ title: "Håll inte med"+ ignore:+ title: "Gör ingenting"+ description: "Ignorera flaggan genom att ta bort den från kön utan att vidta någon åtgärd."+ topic:+ sort_by: "Sortera efter"+ activity: "Aktivitet"+ review:+ transcript:+ view: "Visa tidigare meddelandens avskrift"diff --git a/plugins/discourse-post-voting/config/locales/client.sw.yml b/plugins/discourse-post-voting/config/locales/client.sw.ymlnew file mode 100644index 00000000000..a1766faeea6--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.sw.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/++sw:+ js:+ post_voting:+ post:+ post_voting_comment:+ edit: "hariri"+ cancel: "ghairi"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Simamisha Mtumiaji"+ description: "Kubaliana na bendera na simamisha mtumiaji."+ agree_and_silence:+ title: "Nyamazisha Mtumiaji"+ description: "Kubaliana na bendera na nyamazisha mtumiaji."+ disagree:+ title: "Kataa"+ topic:+ sort_by: "Panga kwa"+ activity: "Kitendo"diff --git a/plugins/discourse-post-voting/config/locales/client.te.yml b/plugins/discourse-post-voting/config/locales/client.te.ymlnew file mode 100644index 00000000000..b26acf82827--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.te.yml@@ -0,0 +1,34 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "కనీసం %{count} అక్షరాన్ని నమోదు చేయండి"+ other: "కనీసం %{count} అక్షరాలను నమోదు చేయండి"+ edit: "సవరణ"+ cancel: "రద్దు"+ user:+ deleted: "(సభ్యుడు తొలగించబడ్డారు)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "సభ్యుడిని సస్పెండు చేయి"+ description: "ఫిర్యాదుతో అంగీకరిస్తు సభ్యుని సస్పెండ్ చేయండి."+ agree_and_silence:+ title: "సభ్యుని నిశ్శబ్దం చేయండి"+ description: "ఫిర్యాదుతో అంగీకరిస్తు సభ్యుని నిశబ్దం చేయండి."+ disagree:+ title: "ఒప్పుకోకు"+ topic:+ sort_by: "క్రమబద్ధీకరించండి"+ activity: "కలాపం"diff --git a/plugins/discourse-post-voting/config/locales/client.th.yml b/plugins/discourse-post-voting/config/locales/client.th.ymlnew file mode 100644index 00000000000..16eb0573569--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.th.yml@@ -0,0 +1,27 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span>%{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ other: "กรอกอย่างน้อย %{count} ตัวอักษร"+ edit: "แก้ไข"+ cancel: "ยกเลิก"+ user:+ deleted: "(ผู้ใช้ถูกลบ)"+ reviewables:+ actions:+ disagree:+ title: "ไม่เห็นด้วย"+ topic:+ sort_by: "เรียงโดย"+ activity: "กิจกรรม"diff --git a/plugins/discourse-post-voting/config/locales/client.tr_TR.yml b/plugins/discourse-post-voting/config/locales/client.tr_TR.ymlnew file mode 100644index 00000000000..b19ffeb6482--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.tr_TR.yml@@ -0,0 +1,119 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: Gönderi Oylaması+ post_voting:+ reviewables:+ comment_already_handled: "Teşekkürler, ancak bu yorumu daha önce inceledik ve yeniden bayrak eklenmesine gerek olmadığına karar verdik."+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "yeni yorum"+ popup:+ question_answer_user_commented: '%{username} "%{topic}" - %{site_title} içinde yorum yaptı'+ category:+ post_voting_settings_heading: Gönderi Oylaması+ create_as_post_voting_default: Yeni konular varsayılan olarak bu kategorideki Gönderi Oylaması konularıdır.+ only_post_voting_in_this_category: Yeni konular yalnızca bu kategorideki Gönderi Oylaması konuları olabilir.+ composer:+ create_post_voting:+ label: "Gönderi oylaması konusu oluşturun"+ composer_actions:+ create_as_post_voting:+ label: "Gönderi Oylamasını değiştir"+ desc: "Konu oylanabilir gönderilerle oluşturulacak"+ remove_as_post_voting:+ label: "Gönderi Oylamasını kaldır"+ desc: "Konu normal formatta oluşturulacak"+ vote:+ already_voted: "Her soru için yalnızca bir kez oy kullanabilirsiniz."+ user_over_limit: "Güven seviyenize uygun oy sayısını aşamazsınız."+ one_vote_per_post: "Her gönderi için yalnızca bir kez oy kullanabilirsiniz."+ last_answer_lowercase: son yanıt+ answer_lowercase:+ one: yanıt+ other: yanıt+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "En az %{count} karakter girin"+ other: "En az %{count} karakter girin"+ length_ok:+ one: "%{count} karakter kaldı..."+ other: "%{count} karakter kaldı..."+ too_long:+ one: "Yorum, %{count} karakterden uzun olamaz"+ other: "Yorum, %{count} karakterden uzun olamaz"+ submit: "Yorum ekle"+ edit: "düzenle"+ cancel: "iptal et"+ add: "Yorum ekle"+ show:+ one: '%{count} yorum daha göster'+ other: '%{count} yorum daha göster'+ delete:+ confirm: "Bu yorumu silmek istediğinizden emin misiniz?"+ user:+ deleted: "(kullanıcı silindi)"+ reviewables:+ comment_already_handled: "Teşekkürler, ancak bu yorumu daha önce inceledik ve yeniden bayrak eklenmesine gerek olmadığına karar verdik."+ actions:+ agree:+ title: "Kabul et..."+ agree_and_keep_comment:+ title: "Yorumu sakla"+ description: "Bayrağı kabul edin ve yorumu değiştirmeyin."+ agree_and_keep_deleted:+ title: "Yorumu Silinmiş hâlde tut"+ description: "Bayrağı kabul edin ve yorumu silinmiş olarak bırakın."+ agree_and_suspend:+ title: "Kullanıcıyı Askıya Al"+ description: "Bayrağı kabul edin ve kullanıcıyı askıya alın."+ agree_and_silence:+ title: "Kullanıcıyı Sustur"+ description: "Bayrağı kabul edin ve kullanıcıyı susturun."+ agree_and_restore:+ title: "Yorumu geri yükle"+ description: "Kullanıcıların görebilmesi için yorumu geri yükleyin."+ agree_and_delete:+ title: "Yorumu sil"+ description: "Kullanıcıların görememesi için yorumu silin."+ delete_and_agree:+ title: "Bayrağı yok say ve yorumu Sil"+ description: "Kuyruktan kaldırarak bayrağı yok sayın ve yorumu silin."+ disagree_and_restore:+ title: "Katılma ve yorumu Geri Yükle"+ description: "Tüm kullanıcıların görebilmesi için yorumu geri yükleyin."+ disagree:+ title: "Katılma"+ ignore:+ title: "Hiçbir şey yapma"+ description: "Herhangi bir işlem yapmadan bayrağı kuyruktan kaldırarak yok say."+ transcript:+ view: "Önceki yorumların dökümünü görüntüle"+ topic:+ answer:+ label: "Yanıt"+ help: "yanıt oluşturmaya başlayın"+ sort_by: "Sıralama ölçütü"+ votes: "Oylar"+ activity: "Aktivite"+ answer_count:+ one: "%{count} Yanıt"+ other: "%{count} Yanıt"+ review:+ transcript:+ view: "Önceki mesajların dökümünü görüntüle"+ types:+ reviewable_post_voting_comment:+ title: "Bayraklı Gönderi Oylama Yorumu"diff --git a/plugins/discourse-post-voting/config/locales/client.ug.yml b/plugins/discourse-post-voting/config/locales/client.ug.ymlnew file mode 100644index 00000000000..bf7609fa35e--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.ug.yml@@ -0,0 +1,42 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "كەم دېگەندە %{count} ھەرپ كىرگۈزۈلىدۇ"+ other: "كەم دېگەندە %{count} ھەرپ كىرگۈزۈلىدۇ"+ edit: "تەھرىر"+ cancel: "ۋاز كەچ"+ user:+ deleted: "(ئىشلەتكۈچى ئۆچۈرۈلدى)"+ reviewables:+ actions:+ agree:+ title: "قوشۇل…"+ agree_and_suspend:+ title: "توختىتىلغان ئىشلەتكۈچى"+ description: "پاش قىلىشقا قوشۇلىدۇ ۋە ئىشلەتكۈچىنى توختىتىدۇ."+ agree_and_silence:+ title: "ئىشلەتكۈچىنى ئۈنسىزلە"+ description: "پاش قىلىشقا قوشۇلىدۇ ۋە ئىشلەتكۈچىنى ئۈنسىزلەيدۇ."+ disagree:+ title: "قوشۇلما"+ ignore:+ title: "ھېچ ئىش قىلما"+ description: "پاش قىلىشنى ئۆچرەتتىن چىقىرىۋېتىپ پەرۋا قىلماي، ھېچقانداق مەشغۇلات قىلمايدۇ."+ topic:+ sort_by: "تەرتىپى"+ activity: "پائالىيەت"+ review:+ transcript:+ view: "ئىلگىرىكى ئۇچۇرلارنىڭ كۆپەيتىلمىسىنى كۆرسىتىدۇ"diff --git a/plugins/discourse-post-voting/config/locales/client.uk.yml b/plugins/discourse-post-voting/config/locales/client.uk.ymlnew file mode 100644index 00000000000..f78d050a0a3--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.uk.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/++uk:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "Введіть хоча б %{count} символ"+ few: "Введіть хоча б %{count} символи"+ many: "Введіть хоча б %{count} символи"+ other: "Введіть хоча б %{count} символи"+ edit: "редагувати"+ cancel: "скасувати"+ user:+ deleted: "(користувача вилучено)"+ reviewables:+ actions:+ agree:+ title: "Погоджуюся…"+ agree_and_suspend:+ title: "Призупинити користувача"+ description: "Погодитися з прапором та призупинити користувача."+ agree_and_silence:+ title: "Заблокувати користувача"+ description: "Погодитися з прапором та заблокувати користувача."+ disagree:+ title: "Відмовити"+ ignore:+ title: "Нічого не робити"+ description: "Ігнорувати прапорець, видаливши його з черги без жодних дій."+ topic:+ sort_by: "Сортувати за"+ activity: "Активність"+ review:+ transcript:+ view: "Показати попередні повідомлення"diff --git a/plugins/discourse-post-voting/config/locales/client.ur.yml b/plugins/discourse-post-voting/config/locales/client.ur.ymlnew file mode 100644index 00000000000..40bc2b5acea--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.ur.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/++ur:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ one: "کم از کم %{count} حرف درج کریں"+ other: "کم از کم %{count} حروف درج کریں"+ edit: "ترمیم کریں"+ cancel: "منسوخ"+ user:+ deleted: "(صارف مٹادیا گیا)"+ reviewables:+ actions:+ agree:+ title: "اتفاق کریں..."+ agree_and_suspend:+ title: "صارف معطل کریں"+ description: "فلَیگ کے ساتھ اتفاق کریں اور صارف معطل کریں۔"+ agree_and_silence:+ title: "صارف خاموش کریں"+ description: "فلَیگ کے ساتھ اتفاق کریں اور صارف خاموش کریں۔"+ disagree:+ title: "اختلاف کریں"+ topic:+ sort_by: "ترتیب بہ"+ activity: "سرگرمی"diff --git a/plugins/discourse-post-voting/config/locales/client.vi.yml b/plugins/discourse-post-voting/config/locales/client.vi.ymlnew file mode 100644index 00000000000..8232550d892--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.vi.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/++vi:+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ other: "Nhập ít nhất %{count} kí tự"+ edit: "sửa"+ cancel: "hủy"+ user:+ deleted: "(người dùng đã bị xóa)"+ reviewables:+ actions:+ agree_and_suspend:+ title: "Tạm ngưng người dùng"+ agree_and_silence:+ title: "Người dùng im lặng"+ disagree:+ title: "Không đồng ý"+ topic:+ sort_by: "Sắp xếp theo"+ activity: "Hoạt động"diff --git a/plugins/discourse-post-voting/config/locales/client.zh_CN.yml b/plugins/discourse-post-voting/config/locales/client.zh_CN.ymlnew file mode 100644index 00000000000..15953d811be--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.zh_CN.yml@@ -0,0 +1,113 @@+# 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:+ admin_js:+ site_settings:+ categories:+ post_voting: 帖子投票+ post_voting:+ reviewables:+ comment_already_handled: "谢谢,但我们已经审核这条评论,并确定不需要再次对其进行举报。"+ js:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "新评论"+ popup:+ question_answer_user_commented: '%{username} 在“%{topic}”中发布了评论 - %{site_title}'+ category:+ post_voting_settings_heading: 帖子投票+ create_as_post_voting_default: 此类别中的新话题默认为“帖子投票”话题。+ only_post_voting_in_this_category: 新话题只能是此类别中的“帖子投票”话题。+ composer:+ create_post_voting:+ label: "创建帖子投票话题"+ composer_actions:+ create_as_post_voting:+ label: "切换帖子投票"+ desc: "话题将使用可投票的帖子创建"+ remove_as_post_voting:+ label: "移除帖子投票"+ desc: "话题将以常规格式创建"+ vote:+ already_voted: "您只能为每个问题投一次票。"+ user_over_limit: "您不能超过您的信任级别对应的投票数。"+ one_vote_per_post: "您只能为每篇帖子投一次票。"+ last_answer_lowercase: 最后一个回答+ answer_lowercase:+ other: 回答+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ other: "至少输入 %{count} 个字符"+ length_ok:+ other: "剩余 %{count} 个字符…"+ too_long:+ other: "评论不能超过 %{count} 个字符"+ submit: "添加评论"+ edit: "编辑"+ cancel: "取消"+ add: "添加评论"+ show:+ other: 显示其他 %{count} 条评论+ delete:+ confirm: "确定要删除此评论吗?"+ user:+ deleted: "(用户已删除)"+ reviewables:+ comment_already_handled: "谢谢,但我们已经审核这条评论,并确定不需要再次对其进行举报。"+ actions:+ agree:+ title: "同意…"+ agree_and_keep_comment:+ title: "保留评论"+ description: "同意举报并保持评论不变。"+ agree_and_keep_deleted:+ title: "保留评论删除状态"+ description: "同意举报并保持评论的删除状态。"+ agree_and_suspend:+ title: "封禁用户"+ description: "同意举报并封禁用户。"+ agree_and_silence:+ title: "将用户禁言"+ description: "同意举报并将用户禁言。"+ agree_and_restore:+ title: "恢复评论"+ description: "恢复评论,以便用户可以看到。"+ agree_and_delete:+ title: "删除评论"+ description: "删除评论,使用户看不到。"+ delete_and_agree:+ title: "忽略举报并删除评论"+ description: "通过从队列中移除来忽略举报并删除评论。"+ disagree_and_restore:+ title: "不同意并恢复评论"+ description: "恢复评论,以便所有用户都可以看到。"+ disagree:+ title: "不同意"+ ignore:+ title: "不进行操作"+ description: "通过从队列中移除来忽略举报,不采取任何措施。"+ transcript:+ view: "查看以前的评论转录文本"+ topic:+ answer:+ label: "回答"+ help: "开始撰写回答"+ sort_by: "排序依据"+ votes: "投票"+ activity: "活动"+ answer_count:+ other: "%{count} 个回答"+ review:+ transcript:+ view: "查看以前的消息转录文本"+ types:+ reviewable_post_voting_comment:+ title: "被举报的“帖子投票”评论"diff --git a/plugins/discourse-post-voting/config/locales/client.zh_TW.yml b/plugins/discourse-post-voting/config/locales/client.zh_TW.ymlnew file mode 100644index 00000000000..beba7db4017--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/client.zh_TW.yml@@ -0,0 +1,66 @@+# 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:+ notifications:+ question_answer_user_commented: "<span>%{username}</span> %{description}"+ titles:+ question_answer_user_commented: "新評論"+ popup:+ question_answer_user_commented: '%{username} 在「%{topic}」- %{site_title} 中評論'+ composer:+ composer_actions:+ remove_as_post_voting:+ desc: "主題將以常規格式建立"+ vote:+ already_voted: "每個問題只能投票一次。"+ user_over_limit: "您不能投超過您的信任等級的投票數。"+ one_vote_per_post: "每個發文只能投票一次。"+ last_answer_lowercase: 最後一個答案+ answer_lowercase:+ other: 回答+ post_voting:+ post:+ post_voting_comment:+ composer:+ too_short:+ other: "輸入至少 %{count} 個字元"+ length_ok:+ other: "剩餘 %{count} 個字元..."+ too_long:+ other: "評論不能超過 %{count} 字元"+ submit: "新增一個評論"+ edit: "編輯"+ cancel: "取消"+ add: "新增一個評論"+ show:+ other: 顯示 %{count} 更多評論+ delete:+ confirm: "您確定要刪除此評論嗎?"+ user:+ deleted: "(使用者已被刪除)"+ reviewables:+ actions:+ agree:+ title: "同意..."+ agree_and_suspend:+ title: "將使用者停權"+ description: "同意檢舉並停權使用者"+ agree_and_silence:+ title: "將使用者禁言"+ description: "同意檢舉並禁止使用者發文"+ disagree:+ title: "不同意"+ topic:+ answer:+ label: "回答"+ help: "開始撰寫回答"+ sort_by: "排序"+ votes: "投票"+ activity: "活動"+ answer_count:+ other: "%{count} 個回答"diff --git a/plugins/discourse-post-voting/config/locales/server.ar.yml b/plugins/discourse-post-voting/config/locales/server.ar.ymlnew file mode 100644index 00000000000..66901d08f1d--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.ar.yml@@ -0,0 +1,111 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "لم يتم تفعيل التصويت على المنشورات."+ replying_to_post_not_permited: "غير مسموح لك بإنشاء منشور ردًا على منشور آخر."+ voting_not_permitted: "غير مسموح لك بالتصويت على هذا المنشور."+ comment_cannot_be_downvoted: "يمكنك التصويت إيجابيًا على التعليقات فقط."+ self_voting_not_permitted: "غير مسموح لك بالتصويت على منشورك أو تعليقك."+ vote_archived_topic: "لا يمكنك التصويت على الموضوعات المؤرشفة."+ vote_closed_topic: "لا يمكنك التصويت على الموضوعات المغلقة."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "لم يتم تفعيل التصويت على المنشورات."+ subtype_not_allowed: "لا يمكن استخدام النوع الفرعي \"التصويت على المنشورات\" إلا مع الموضوعات العادية."+ cannot_change_to_post_voting_subtype: "غير مصرَّح بتغيير النوع الفرعي إلى \"التصويت على المنشورات\"."+ answer_count:+ zero: "%{count} إجابات"+ one: "إجابة واحدة (%{count})"+ two: "إجابتان (%{count})"+ few: "%{count} إجابات"+ many: "%{count} إجابات"+ other: "%{count} إجابات"+ site_settings:+ qa_tags: "وسوم تفعيل التصويت على المنشورات في موضوع"+ post_voting_enabled: "تفعيل المكوِّن الإضافي للتصويت على المنشورات"+ post_voting_enable_likes_on_answers: "تفعيل زر الإعجاب على الردود في موضوعات \"التصويت على المنشورات\""+ post_voting_undo_vote_action_window: "عدد الدقائق المسموح للمستخدمين خلالها بالتراجع عن التصويت في موضوعات \"التصويت على المنشورات\" (أدخل 0 لعدم تعيين حد)"+ post_voting_comment_limit_per_post: "عدد التعليقات المسموح بها على كل منشور"+ min_trust_to_flag_posts_voting_comments: "الحد الأدنى لمستوى الثقة للإبلاغ عن تعليق للتصويت على منشور"+ flag_posts_voting_comments_allowed_groups: "مسموح للمجموعات بالإبلاغ عن تعليق للتصويت على منشور"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "التصويت"+ description: "التصويت لهذا المنشور"+ short_description: "التصويت لهذا المنشور"+ long_form: "تم التصويت لهذا المنشور"+ vote:+ error:+ user_has_not_voted: "لم يصوَّت المستخدم."+ user_over_limit: "لا يمكنك تجاوز عدد الأصوات لمستوى ثقتك."+ already_voted: "يمكنك التصويت مرة واحدة فقط لكل سؤال."+ undo_vote_action_window:+ zero: "لا يمكنك التراجع عن التصويت بعد %{count} دقيقة من التصويت."+ one: "لا يمكنك التراجع عن التصويت بعد دقيقة واحدة (%{count}) من التصويت."+ two: "لا يمكنك التراجع عن التصويت بعد دقيقتين (%{count}) من التصويت."+ few: "لا يمكنك التراجع عن التصويت بعد %{count} دقائق من التصويت."+ many: "لا يمكنك التراجع عن التصويت بعد %{count} دقيقة من التصويت."+ other: "لا يمكنك التراجع عن التصويت بعد %{count} دقيقة من التصويت."+ one_vote_per_post: "يمكنك التصويت مرة واحدة فقط لكل منشور."+ one_vote_per_comment: "يمكنك التصويت مرة واحدة فقط لكل تعليق."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "غير مصرَّح بالتعليق على منشور ليس في موضوع للتصويت على المنشورات."+ not_permitted: "غير مصَّرح بالتعليق على منشور مرتبط."+ limit_exceeded: "تم الوصول إلى حد %{limit} من التعليقات لكل منشور."+ perform: "تلقى البلاغ عن تعليق للتصويت على منشور نقاطًا عالية بما يكفي لإسكات المستخدم."+ auto_silence_from_flags: "تم كتم المستخدم تلقائيًا بسبب بلاغ."+ reviewables:+ comment_already_handled: "شكرًا، لكننا راجعنا هذا التعليق بالفعل وقررنا أنه لا يلزم الإبلاغ عنه مرة أخرى."+ actions:+ agree_and_keep_comment:+ title: "إبقاء التعليق"+ description: "الموافقة على البلاغ والاحتفاظ بالتعليق دون تغيير"+ agree_and_keep_deleted:+ title: "إبقاء التعليق محذوفًا"+ description: "الموافقة على البلاغ وترك التعليق محذوفًا."+ agree_and_suspend:+ title: "تعليق المستخدم"+ description: "الموافقة على البلاغ وتعليق المستخدم"+ agree_and_silence:+ title: "كتم المستخدم"+ description: "الموافقة على البلاغ وكتم المستخدم"+ agree_and_restore:+ title: "استعادة التعليق"+ description: "استعادة التعليق حتى يتمكن المستخدمون من رؤيته."+ agree_and_delete:+ title: "حذف التعليق"+ description: "حذف التعليق حتى لا يتمكن المستخدمون من رؤيته."+ delete_and_agree:+ title: "تجاهل البلاغ وحذف التعليق"+ description: "تجاهل البلاغ بإزالته من قائمة الانتظار وحذف التعليق."+ disagree_and_restore:+ title: "عدم الموافقة واستعادة التعليق"+ description: "استعادة التعليق حتى يتمكن جميع المستخدمين من رؤيته."+ disagree:+ title: "عدم الموافقة"+ ignore:+ title: "عدم اتخاذ أي إجراء"+ description: "تجاهل البلاغ بإزالته من قائمة الانتظار دون اتخاذ أي إجراء."+ transcript:+ view: "عرض نص التعليقات السابقة"+ reviewable_score_types:+ needs_review:+ title: "بحاجة إلى المراجعة"+ notify_user:+ comment_pm_title: "تعليقك للتصويت على المنشور"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "يتطلب تعليقك للتصويت على منشور انتباه فريق العمل"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.be.yml b/plugins/discourse-post-voting/config/locales/server.be.ymlnew file mode 100644index 00000000000..77f9ff2be11--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.be.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/++be:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "прыпыненне карыстальніка"+ description: "Пагадзіцеся са сцягамі і падвесіць карыстальнік."+ agree_and_silence:+ title: "Silence Карыстальнік"+ description: "Пагадзіцеся са сцягамі і маўчанне карыстальніка."+ disagree:+ title: "не згаджацца"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.bg.yml b/plugins/discourse-post-voting/config/locales/server.bg.ymlnew file mode 100644index 00000000000..439a5f295da--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.bg.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/++bg:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Преустанови потребител"+ disagree:+ title: "Не съм съгласен "+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.bs_BA.yml b/plugins/discourse-post-voting/config/locales/server.bs_BA.ymlnew file mode 100644index 00000000000..072a9372370--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.bs_BA.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/++bs_BA:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspend User"+ description: "Složij se sa prijavom i suspendiraj prijavljenog korisnika (suspend)"+ agree_and_silence:+ title: "Stišaj korisnika"+ description: "Složij se sa prijavom i utišaj prijavljenog korisnika (silence)"+ disagree:+ title: "Disagree"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.ca.yml b/plugins/discourse-post-voting/config/locales/server.ca.ymlnew file mode 100644index 00000000000..4e58e4153b8--- /dev/null+++ b/plugins/discourse-post-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:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspèn l'usuari"+ description: "D'acord amb la bandera i suspèn l'usuari. "+ agree_and_silence:+ title: "Silencia l'usuari"+ description: "D'acord amb la bandera i silencia l'usuari. "+ disagree:+ title: "En desacord"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.cs.yml b/plugins/discourse-post-voting/config/locales/server.cs.ymlnew file mode 100644index 00000000000..c8be78ac0eb--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.cs.yml@@ -0,0 +1,27 @@+# 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:+ post_action_types:+ vote:+ title: "Hlasovat"+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Zakázat uživatele"+ description: "Schválit nahlášení a pozastavit uživatele."+ agree_and_silence:+ title: "Ztišit uživatele"+ description: "Schválit nahlášení a ztišit uživatele."+ disagree:+ title: "Neschvaluji"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\\n\\n%{comment}\n"+ notify_moderators:+ comment_pm_body: "%{link}\\n\\n%{comment}\n"diff --git a/plugins/discourse-post-voting/config/locales/server.da.yml b/plugins/discourse-post-voting/config/locales/server.da.ymlnew file mode 100644index 00000000000..0d03d942cd7--- /dev/null+++ b/plugins/discourse-post-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:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspendér Bruger"+ agree_and_silence:+ title: "Ignorer Bruger"+ disagree:+ title: "Uenig"+ ignore:+ title: "Gør ingenting"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.de.yml b/plugins/discourse-post-voting/config/locales/server.de.ymlnew file mode 100644index 00000000000..5c2067d87f2--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.de.yml@@ -0,0 +1,103 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "Beitragsabstimmung ist nicht aktiviert."+ replying_to_post_not_permited: "Es ist dir nicht erlaubt, einen Beitrag als Antwort auf einen anderen Beitrag zu erstellen."+ voting_not_permitted: "Du darfst über diesen Beitrag nicht abstimmen."+ comment_cannot_be_downvoted: "Du kannst nur für Kommentare abstimmen."+ self_voting_not_permitted: "Du darfst nicht über deinen eigenen Beitrag oder deinen eigenen Kommentar abstimmen."+ vote_archived_topic: "Du kannst nicht über archivierte Themen abstimmen."+ vote_closed_topic: "Du kannst nicht über geschlossene Themen abstimmen."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "Beitragsabstimmung ist nicht aktiviert."+ subtype_not_allowed: "Der Untertyp „Beitragsabstimmung“ kann nur mit regulären Themen verwendet werden."+ cannot_change_to_post_voting_subtype: "Ändern des Untertyps eines Themas in Beitragsabstimmung ist nicht zulässig."+ answer_count:+ one: "%{count} Antwort"+ other: "%{count} Antworten"+ site_settings:+ qa_tags: "Schlagwörter zum Aktivieren der Beitragsabstimmung zum Thema"+ post_voting_enabled: "Beitragsabstimmungs-Plug-in aktivieren"+ post_voting_enable_likes_on_answers: "„Gefällt mir“-Schaltfläche für Antworten in Beitragsabstimmungsthemen aktivieren"+ post_voting_undo_vote_action_window: "Anzahl an Minuten, in denen Benutzer Stimmen in Beitragsabstimmungsthemen zurücknehmen können (0 bedeutet kein Limit)"+ post_voting_comment_limit_per_post: "Anzahl der zulässigen Kommentare zu jedem Beitrag"+ min_trust_to_flag_posts_voting_comments: "Mindestvertrauensstufe zum Melden eines Beitragsabstimmungskommentars"+ flag_posts_voting_comments_allowed_groups: "Gruppen, die einen Beitragsabstimmungskommentar melden dürfen"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "Abstimmen"+ description: "Stimme für diesen Beitrag"+ short_description: "Stimme für diesen Beitrag"+ long_form: "hat für diesen Beitrag gestimmt"+ vote:+ error:+ user_has_not_voted: "Benutzer hat nicht abgestimmt."+ user_over_limit: "Du kannst nicht öfter abstimmen, als es deine Vertrauensstufe erlaubt."+ already_voted: "Du kannst nur einmal pro Frage abstimmen."+ undo_vote_action_window:+ one: "Du kannst die Stimme %{count} Minute nach der Abstimmung nicht rückgängig machen."+ other: "Du kannst die Stimme %{count} Minuten nach der Abstimmung nicht rückgängig machen."+ one_vote_per_post: "Du kannst nur einmal pro Beitrag abstimmen."+ one_vote_per_comment: "Du kannst nur einmal pro Kommentar abstimmen."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "Das Kommentieren eines Beitrags, der sich nicht in einem Beitragsabstimmungsthema befindet, ist nicht gestattet."+ not_permitted: "Das Kommentieren von zugehörigen Beiträgen ist nicht gestattet."+ limit_exceeded: "Das Limit von %{limit} Kommentaren pro Beitrag wurde erreicht."+ perform: "Beitragsabstimmungskommentar wurde mit einer Punktzahl gemeldet, die hoch genug ist, um den Benutzer stummzuschalten."+ auto_silence_from_flags: "Aufgrund von Meldungen automatisch stummgeschaltet."+ reviewables:+ comment_already_handled: "Danke, aber wir haben diesen Kommentar bereits überprüft und festgestellt, dass er nicht erneut gemeldet werden muss."+ actions:+ agree_and_keep_comment:+ title: "Kommentar behalten"+ description: "Meldung zustimmen und den Kommentar unbearbeitet lassen."+ agree_and_keep_deleted:+ title: "Kommentar gelöscht lassen"+ description: "Meldung zustimmen und den Kommentar gelöscht lassen."+ agree_and_suspend:+ title: "Benutzer sperren"+ description: "Meldung zustimmen und den Benutzer sperren."+ agree_and_silence:+ title: "Benutzer stummschalten"+ description: "Meldung zustimmen und den Benutzer stummschalten."+ agree_and_restore:+ title: "Kommentar wiederherstellen"+ description: "Kommentar wiederherstellen, damit Benutzer ihn sehen können."+ agree_and_delete:+ title: "Kommentar löschen"+ description: "Kommentar löschen, damit Benutzer ihn nicht sehen können."+ delete_and_agree:+ title: "Meldung ignorieren und Kommentar löschen"+ description: "Ignoriere die Meldung, indem du sie aus der Warteschlange entfernst und den Kommentar löschst."+ disagree_and_restore:+ title: "Ablehnen und Kommentar wiederherstellen"+ description: "Kommentar wiederherstellen, damit alle Benutzer ihn sehen können."+ disagree:+ title: "Ablehnen"+ ignore:+ title: "Nichts tun"+ description: "Ignoriere die Meldung, indem du sie aus der Warteschlange entfernst, ohne etwas zu unternehmen."+ transcript:+ view: "Transkript früherer Kommentare anzeigen"+ reviewable_score_types:+ needs_review:+ title: "Überprüfung erforderlich"+ notify_user:+ comment_pm_title: "Dein Beitragsabstimmungskommentar"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "Ein Beitragsabstimmungskommentar erfordert die Aufmerksamkeit des Teams"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.el.yml b/plugins/discourse-post-voting/config/locales/server.el.ymlnew file mode 100644index 00000000000..946022d4ad8--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.el.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/++el:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Αποβολή Χρήστη"+ agree_and_silence:+ title: "Σίγαση Χρήστη"+ disagree:+ title: "Διαφωνώ"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.en.yml b/plugins/discourse-post-voting/config/locales/server.en.ymlnew file mode 100644index 00000000000..7cf94e9e15a--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.en.yml@@ -0,0 +1,104 @@+en:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "Post voting is not enabled."+ replying_to_post_not_permited: "You are not allowed to create a post in reply to another post."+ voting_not_permitted: "You are not allowed to vote on this post."+ comment_cannot_be_downvoted: "You can only upvote comments."+ self_voting_not_permitted: "You are not allowed to vote on your own post or comment."+ vote_archived_topic: "You cannot vote on archived topics."+ vote_closed_topic: "You cannot vote on closed topics."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "Post voting is not enabled."+ subtype_not_allowed: "The Post Voting subtype can only be used with regular topics."+ cannot_change_to_post_voting_subtype: "Changing a topic's subtype to Post Voting is not permitted."+ answer_count:+ one: "%{count} Answer"+ other: "%{count} Answers"++ site_settings:+ qa_tags: "Tags to enable post voting on topic"+ post_voting_enabled: "Enable Post Voting Plugin"+ post_voting_enable_likes_on_answers: "Enable like button on replies on Post Voting topics"+ post_voting_undo_vote_action_window: "Number of minutes users are allowed to undo votes in Post Voting topics (enter 0 for no limit)"+ post_voting_comment_limit_per_post: "Number of comments allowed on each post"+ min_trust_to_flag_posts_voting_comments: "Minimum trust level to flag a post voting comment"+ flag_posts_voting_comments_allowed_groups: "Groups allowed to flag a post voting comment"++ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+++ post_action_types:+ vote:+ title: "Vote"+ description: "Vote for this post"+ short_description: "Vote for this post"+ long_form: "voted for this post"++ vote:+ error:+ user_has_not_voted: "User has not voted."+ user_over_limit: "You cannot exceed the number of votes for your trust level."+ already_voted: "You can only vote once per question."+ undo_vote_action_window:+ one: "You cannot undo vote %{count} minute after voting."+ other: "You cannot undo vote %{count} minutes after voting."+ one_vote_per_post: "You can only vote once for each post."+ one_vote_per_comment: "You can only vote once for each comment."++ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "Commenting on a post that is not in a Post Voting topic is not permitted."+ not_permitted: "Commenting on associated post is not permitted."+ limit_exceeded: "Limit of %{limit} comments per post has been reached."+ perform: "Post Voting Comment flagged with score high enough to silence user."+ auto_silence_from_flags: "Automatically silenced due to flagging."+ reviewables:+ comment_already_handled: "Thanks, but we've already reviewed this comment and determined it does not need to be flagged again."+ actions:+ agree:+ agree_and_keep_comment:+ title: "Keep comment"+ description: "Agree with flag and keep the comment unchanged."+ agree_and_keep_deleted:+ title: "Keep comment Deleted"+ description: "Agree with flag and leave the comment deleted."+ agree_and_suspend:+ title: "Suspend User"+ description: "Agree with flag and suspend the user."+ agree_and_silence:+ title: "Silence User"+ description: "Agree with flag and silence the user."+ agree_and_restore:+ title: "Restore comment"+ description: "Restore the comment so that users can see it."+ agree_and_delete:+ title: "Delete comment"+ description: "Delete the comment so that users cannot see it."+ delete_and_agree:+ title: "Ignore Flag and Delete comment"+ description: "Ignore the flag by removing it from the queue and delete the comment."+ disagree_and_restore:+ title: "Disagree and Restore comment"+ description: "Restore the comment so that all users can see it."+ disagree:+ title: "Disagree"+ ignore:+ title: "Do Nothing"+ description: "Ignore the flag by removing it from the queue without taking any action."+ transcript:+ view: "View previous comments transcript"+ reviewable_score_types:+ needs_review:+ title: "Needs Review"+ notify_user:+ comment_pm_title: "Your post voting comment"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "A post voting comment requires staff attention"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.en_GB.yml b/plugins/discourse-post-voting/config/locales/server.en_GB.ymlnew file mode 100644index 00000000000..2d4fa180ec7--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.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-post-voting/config/locales/server.es.yml b/plugins/discourse-post-voting/config/locales/server.es.ymlnew file mode 100644index 00000000000..47929f71a74--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.es.yml@@ -0,0 +1,103 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "Votar publicación no está habilitada."+ replying_to_post_not_permited: "No puedes crear una publicación en respuesta a otra publicación."+ voting_not_permitted: "No tienes permitido votar en esta publicación."+ comment_cannot_be_downvoted: "Solo puedes votar comentarios."+ self_voting_not_permitted: "No puedes votar en tu propia publicación o comentario."+ vote_archived_topic: "No puedes votar en temas archivados."+ vote_closed_topic: "No puedes votar en temas cerrados."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "Votar publicación no está habilitada."+ subtype_not_allowed: "El subtipo Votar publicación solo se puede usar con temas normales."+ cannot_change_to_post_voting_subtype: "No se permite cambiar el subtipo de un tema a Votar publicación."+ answer_count:+ one: "%{count} respuesta"+ other: "%{count} respuestas"+ site_settings:+ qa_tags: "Etiquetas para habilitar Votar publicación sobre un tema"+ post_voting_enabled: "Habilitar el plugin Votar publicación"+ post_voting_enable_likes_on_answers: "Habilitar el botón «Me gusta» en las respuestas a los temas Votar publicación"+ post_voting_undo_vote_action_window: "Número de minutos en los cuales los usuarios tienen permitido deshacer sus votos en temas Votar publicación (introducir 0 para no poner límite)"+ post_voting_comment_limit_per_post: "Número de comentarios permitidos en cada publicación"+ min_trust_to_flag_posts_voting_comments: "Nivel de confianza mínimo para denunciar un comentario de votación de publicación"+ flag_posts_voting_comments_allowed_groups: "Grupos autorizados a denunciar un comentario de votación de publicación"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "Votar"+ description: "Vota por esta publicación"+ short_description: "Vota por esta publicación"+ long_form: "ha votado esta publicación"+ vote:+ error:+ user_has_not_voted: "El usuario no ha votado."+ user_over_limit: "No puedes superar el número de votos para tu nivel de confianza."+ already_voted: "Solo puedes votar una vez por pregunta."+ undo_vote_action_window:+ one: "No puedes deshacer el voto %{count} minuto después de votar."+ other: "No puedes deshacer el voto %{count} minutos después de votar."+ one_vote_per_post: "Solo puedes votar una vez por cada publicación."+ one_vote_per_comment: "Solo puedes votar una vez por cada comentario."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "No está permitido comentar una publicación que no esté en un tema Votar publicación."+ not_permitted: "No se permite comentar los mensajes asociados."+ limit_exceeded: "Se ha alcanzado el límite de %{limit} comentarios por publicación."+ perform: "Comentario de votación de publicación denunciado con una puntuación lo suficientemente alta como para silenciar al usuario."+ auto_silence_from_flags: "Silenciado automáticamente debido a denuncias."+ reviewables:+ comment_already_handled: "Gracias, pero ya hemos revisado este comentario y hemos determinado que no es necesario denunciarlo de nuevo."+ actions:+ agree_and_keep_comment:+ title: "Mantener comentario"+ description: "Estar de acuerdo con la denuncia y mantener el comentario intacto."+ agree_and_keep_deleted:+ title: "Mantener el comentario eliminado"+ description: "Aceptar la denuncia y dejar el comentario eliminado."+ agree_and_suspend:+ title: "Suspender al usuario"+ description: "Aceptar la denuncia y suspender al usuario."+ agree_and_silence:+ title: "Silenciar al usuario"+ description: "Aceptar la denuncia y silenciar al usuario."+ agree_and_restore:+ title: "Restaurar comentario"+ description: "Restaura el comentario para que los usuarios puedan verlo."+ agree_and_delete:+ title: "Eliminar comentario"+ description: "Elimina el comentario para que los usuarios no puedan verlo."+ delete_and_agree:+ title: "Ignorar denuncia y eliminar comentario"+ description: "Ignorar la denuncia eliminándola de la cola y eliminar el comentario."+ disagree_and_restore:+ title: "Discrepar y restaurar comentario"+ description: "Restaura el comentario para que todos los usuarios puedan verlo."+ disagree:+ title: "No estoy de acuerdo"+ ignore:+ title: "No hacer nada"+ description: "Ignora la denuncia eliminándola de la cola sin realizar ninguna acción."+ transcript:+ view: "Ver la transcripción de los comentarios anteriores"+ reviewable_score_types:+ needs_review:+ title: "Necesita revisión"+ notify_user:+ comment_pm_title: "Tu comentario de votación de publicación"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "Un comentario de votación de publicación requiere atención del personal"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.et.yml b/plugins/discourse-post-voting/config/locales/server.et.ymlnew file mode 100644index 00000000000..575294b3a86--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.et.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/++et:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Peata kasutaja"+ agree_and_silence:+ title: "Vaigista kasutaja"+ disagree:+ title: "Ei nõustu"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.fa_IR.yml b/plugins/discourse-post-voting/config/locales/server.fa_IR.ymlnew file mode 100644index 00000000000..9ad4c3b40f8--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.fa_IR.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/++fa_IR:+ topic:+ post_voting:+ answer_count:+ one: "%{count} پاسخ"+ other: "%{count} پاسخ"+ post_action_types:+ vote:+ title: "رای"+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "کاربر تعلیق شده"+ disagree:+ title: "مخالف"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.fi.yml b/plugins/discourse-post-voting/config/locales/server.fi.ymlnew file mode 100644index 00000000000..f359cbe6851--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.fi.yml@@ -0,0 +1,103 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "Viestiäänestys ei ole käytössä."+ replying_to_post_not_permited: "Et voi luoda viestiä vastauksena toiseen viestiin."+ voting_not_permitted: "Et voi äänestää tätä viestiä."+ comment_cannot_be_downvoted: "Voit antaa vain positiivisia ääniä kommenteille."+ self_voting_not_permitted: "Et saa äänestää omaa viestiäsi tai kommenttiasi."+ vote_archived_topic: "Et voi äänestää arkistoituja ketjuja."+ vote_closed_topic: "Et voi äänestää suljettuja ketjuja."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "Viestiäänestys ei ole käytössä."+ subtype_not_allowed: "Viestiäänestyksen alatyyppiä voi käyttää vain tavallisissa ketjuissa."+ cannot_change_to_post_voting_subtype: "Ketjun alatyypin vaihtaminen viestiäänestykseksi ei ole sallittua."+ answer_count:+ one: "%{count} vastaus"+ other: "%{count} vastausta"+ site_settings:+ qa_tags: "Tunnisteet, joilla viestiäänestys otetaan käyttöön ketjussa"+ post_voting_enabled: "Ota viestiäänestyslisäosa käyttöön"+ post_voting_enable_likes_on_answers: "Ota käyttöön tykkäyspainike viestiäänestysketjujen vastauksissa"+ post_voting_undo_vote_action_window: "Minuuttien määrä, joiden aikana käyttäjät voivat perua ääniä viestiäänestysketjuissa (poista raja käytöstä syöttämällä 0)"+ post_voting_comment_limit_per_post: "Kussakin viestissä sallittavien kommenttien määrä"+ min_trust_to_flag_posts_voting_comments: "Vähimmäisluottamustaso viestin äänestyskommentin liputtamiseen"+ flag_posts_voting_comments_allowed_groups: "Ryhmät, jotka voivat liputtaa viestin äänestyskommentin"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "Äänestä"+ description: "Äänestä tätä parhaaksi vastaukseksi"+ short_description: "Äänestä tätä parhaaksi vastaukseksi"+ long_form: "äänesti tätä parhaaksi vastaukseksi"+ vote:+ error:+ user_has_not_voted: "Käyttäjä ei ole äänestänyt."+ user_over_limit: "Et voi ylittää luottamustasosi äänimäärää."+ already_voted: "Voit äänestää vain yhtä vastausta tähän kysymykseen."+ undo_vote_action_window:+ one: "Et voi perua ääntä %{count} minuutti äänestämisen jälkeen."+ other: "Et voi perua ääntä %{count} minuuttia äänestämisen jälkeen."+ one_vote_per_post: "Voit äänestää kutakin viestiä vain kerran."+ one_vote_per_comment: "Voit äänestää kutakin kommenttia vain kerran."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "Sellaisen viestin kommentointi ei ole sallittua, joka ei ole viestiäänestysketjussa."+ not_permitted: "Liittyvän viestin kommentointi ei ole sallittua."+ limit_exceeded: "%{limit} kommentin viestikohtainen raja on saavutettu."+ perform: "Viestin äänestyskommentti liputettiin riittävän korkealla pistemäärällä käyttäjän hiljentämiseksi."+ auto_silence_from_flags: "Hiljennetty automaattisesti liputuksen vuoksi."+ reviewables:+ comment_already_handled: "Kiitos, mutta olemme jo käsitelleet tämän kommentin ja todenneet, ettei sitä tarvitse liputtaa uudelleen."+ actions:+ agree_and_keep_comment:+ title: "Pidä kommentti"+ description: "Hyväksy liputus ja pidä kommentti ennallaan."+ agree_and_keep_deleted:+ title: "Pidä kommentti poistettuna"+ description: "Hyväksy liputus ja pidä kommentti poistettuna."+ agree_and_suspend:+ title: "Aseta käyttäjä käyttökieltoon"+ description: "Hyväksy liputus ja aseta käyttäjä käyttökieltoon."+ agree_and_silence:+ title: "Hiljennä käyttäjä"+ description: "Hyväksy liputus ja hiljennä käyttäjä."+ agree_and_restore:+ title: "Palauta kommentti"+ description: "Palauta kommentti, jotta käyttäjät näkevät sen."+ agree_and_delete:+ title: "Poista kommentti"+ description: "Poista kommentti, jotta käyttäjät eivät näe sitä."+ delete_and_agree:+ title: "Ohita liputus ja poista kommentti"+ description: "Ohita lippu poistamalla se jonosta ja poista kommentti."+ disagree_and_restore:+ title: "Hylkää ja palauta kommentti"+ description: "Palauta kommentti, jotta kaikki käyttäjät näkevät sen."+ disagree:+ title: "Hylkää"+ ignore:+ title: "Älä tee mitään"+ description: "Ohita lippu poistamalla se jonosta tekemättä toimia."+ transcript:+ view: "Näytä aiempien kommenttien transkriptio"+ reviewable_score_types:+ needs_review:+ title: "Vaatii käsittelyä"+ notify_user:+ comment_pm_title: "Viestin äänestyskommenttisi"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "Viestin äänestyskommentti vaatii henkilökunnan huomiota"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.fr.yml b/plugins/discourse-post-voting/config/locales/server.fr.ymlnew file mode 100644index 00000000000..c5229ed905b--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.fr.yml@@ -0,0 +1,103 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "Le vote de message n'est pas activé."+ replying_to_post_not_permited: "Vous n'êtes pas autorisé(e) à créer un message en réponse à un autre message."+ voting_not_permitted: "Vous n'êtes pas autorisé(e) à voter sur ce message."+ comment_cannot_be_downvoted: "Vous pouvez uniquement voter pour les commentaires."+ self_voting_not_permitted: "Vous n'êtes pas autorisé(e) à voter pour votre propre message ou commentaire."+ vote_archived_topic: "Vous ne pouvez pas voter dans des sujets archivés."+ vote_closed_topic: "Vous ne pouvez pas voter dans des sujets fermés."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "Le vote de message n'est pas activé."+ subtype_not_allowed: "Le sous-type Vote de message ne peut être utilisé qu'avec des sujets ordinaires."+ cannot_change_to_post_voting_subtype: "Il n'est pas permis de remplacer le sous-type d'un sujet par Vote de message."+ answer_count:+ one: "%{count} réponse"+ other: "%{count} réponses"+ site_settings:+ qa_tags: "Étiquettes permettant d'activer le vote de message sur le sujet"+ post_voting_enabled: "Activer l'extension de vote de message"+ post_voting_enable_likes_on_answers: "Activer le bouton J'aime sur les réponses dans les sujets de Vote de message"+ post_voting_undo_vote_action_window: "Nombre de minutes pendant lesquelles les utilisateurs sont autorisés à annuler les votes dans les sujets de Vote de message (saisissez 0 pour ne fixer aucune limite)"+ post_voting_comment_limit_per_post: "Nombre de commentaires autorisés sur chaque publication"+ min_trust_to_flag_posts_voting_comments: "Niveau de confiance minimal pour signaler un commentaire après le vote"+ flag_posts_voting_comments_allowed_groups: "Groupes autorisés à signaler un commentaire après le vote"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "Vote"+ description: "Voter pour ce message"+ short_description: "Voter pour ce message"+ long_form: "a voté pour ce message"+ vote:+ error:+ user_has_not_voted: "L'utilisateur n'a pas voté."+ user_over_limit: "Vous ne pouvez pas dépasser le nombre de votes correspondant à votre niveau de confiance."+ already_voted: "Vous ne pouvez voter qu'une seule fois par question."+ undo_vote_action_window:+ one: "Vous ne pouvez pas annuler le vote %{count} minute après avoir voté."+ other: "Vous ne pouvez pas annuler le vote %{count} minutes après avoir voté."+ one_vote_per_post: "Vous ne pouvez voter qu'une seule fois pour chaque message."+ one_vote_per_comment: "Vous ne pouvez voter qu'une seule fois pour chaque commentaire."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "Il n'est pas permis de commenter un message qui n'est pas dans un sujet de Vote de message."+ not_permitted: "Il n'est pas permis de commenter un message associé."+ limit_exceeded: "La limite de %{limit} commentaires par message a été atteinte."+ perform: "Commentaire de vote signalé avec un score suffisamment élevé pour désactiver l'utilisateur."+ auto_silence_from_flags: "Automatiquement mis en sourdine en raison d'un signalement."+ reviewables:+ comment_already_handled: "Merci, mais nous avons déjà examiné ce commentaire et déterminé qu'il n'a pas besoin d'être signalé à nouveau."+ actions:+ agree_and_keep_comment:+ title: "Conserver le commentaire"+ description: "Accepter le signalement et conserver le commentaire tel quel."+ agree_and_keep_deleted:+ title: "Garder le commentaire supprimé"+ description: "Accepter le signalement et laisser le commentaire supprimé."+ agree_and_suspend:+ title: "Suspendre l'utilisateur"+ description: "Accepter le signalement et suspendre l'utilisateur."+ agree_and_silence:+ title: "Désactiver l'utilisateur"+ description: "Accepter le signalement et désactiver l'utilisateur."+ agree_and_restore:+ title: "Restaurer le commentaire"+ description: "Restaurer le commentaire pour que les utilisateurs puissent le voir."+ agree_and_delete:+ title: "Supprimer le commentaire"+ description: "Supprimer le commentaire pour que les utilisateurs ne puissent pas le voir."+ delete_and_agree:+ title: "Ignorer le signalement et supprimer le commentaire"+ description: "Ignorez le signalement en le supprimant de la file d'attente et supprimez le commentaire."+ disagree_and_restore:+ title: "Rejeter le signalement et rétablir le commentaire"+ description: "Restaurer le commentaire pour que tous les utilisateurs puissent le voir."+ disagree:+ title: "Refuser"+ ignore:+ title: "Ne rien faire"+ description: "Ignorez le signalement en le supprimant de la file d'attente sans prendre aucune mesure."+ transcript:+ view: "Afficher la transcription des commentaires précédents"+ reviewable_score_types:+ needs_review:+ title: "Nécessite un examen"+ notify_user:+ comment_pm_title: "Votre commentaire après le vote"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "Un commentaire après le vote nécessite l'attention d'un responsable"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.gl.yml b/plugins/discourse-post-voting/config/locales/server.gl.ymlnew file mode 100644index 00000000000..cef462b1167--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.gl.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/++gl:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspender un usuario"+ description: "De acordo con esta denuncia e suspender o usuario."+ agree_and_silence:+ title: "Silenciar o usuario"+ description: "De acordo con esta denuncia e silenciar o usuario."+ disagree:+ title: "Discrepar"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.he.yml b/plugins/discourse-post-voting/config/locales/server.he.ymlnew file mode 100644index 00000000000..4f6b657ed24--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.he.yml@@ -0,0 +1,107 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "מצב שו\"ת אינו מופעל."+ replying_to_post_not_permited: "אסור לך ליצור פוסט בתגובה לפוסט אחר."+ voting_not_permitted: "אסור לך להצביע לפוסט זה."+ comment_cannot_be_downvoted: "אפשר להצביע לתגובות בלבד."+ self_voting_not_permitted: "אסור לך להצביע על פוסט או תגובה שלך."+ vote_archived_topic: "אי אפשר להצביע לנושאים בארכיון."+ vote_closed_topic: "אי אפשר להצביע לנושאים סגורים."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "מצב שו\"ת אינו מופעל."+ subtype_not_allowed: "ניתן ליצור נושאים בתבנית שו\"ת רק על גבי נושאים רגילים."+ cannot_change_to_post_voting_subtype: "לא ניתן להחליף נושאים בתבנית שו\"ת."+ answer_count:+ one: "תשובה %{count}"+ two: "%{count} תשובות"+ many: "%{count} תשובות"+ other: "%{count} תשובות"+ site_settings:+ qa_tags: "תגיות להפעלת שו\"ת על נושא"+ post_voting_enabled: "הפעלת תוסף הצבעה על פוסטים"+ post_voting_enable_likes_on_answers: "הפעלת כפתור לייק על נושאים של הצבעה על פוסטים"+ post_voting_undo_vote_action_window: "מספר הדקות שמשתמשים רשאים לבטל הצבעות בנושאי הצבעות על פוסטים (0 להסרת ההגבלה)"+ post_voting_comment_limit_per_post: "מספר התגובות המותר על כל פוסט"+ min_trust_to_flag_posts_voting_comments: "דרגת האמון המזערית לסימון הערת הצבעה על פוסט"+ flag_posts_voting_comments_allowed_groups: "קבוצות שמורשות לסמן הערת הצבעה לפוסט"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments (דרגת אמון מזערית לסימון הערות הצבעה על פוסטים)"+ post_action_types:+ vote:+ title: "הצבעה"+ description: "הצבעה לפוסט"+ short_description: "הצבעה עבור פוסט"+ long_form: "הצבעת עבור הפוסט"+ vote:+ error:+ user_has_not_voted: "משתמש לא הצביע."+ user_over_limit: "אסור לחרוג מכמות ההצבעות לדרגת האמון שלך."+ already_voted: "אפשר להצביע רק פעם אחת לכל שאלה."+ undo_vote_action_window:+ one: "אי אפשר לבטל הצבעה דקה %{count} לאחר ההצבעה."+ two: "אי אפשר לבטל הצבעה %{count} דקות לאחר ההצבעה."+ many: "אי אפשר לבטל הצבעה %{count} דקות לאחר ההצבעה."+ other: "אי אפשר לבטל הצבעה %{count} דקות לאחר ההצבעה."+ one_vote_per_post: "אפשר להצביע רק פעם אחת לכל פוסט."+ one_vote_per_comment: "אפשר להצביע רק פעם אחת לכל תגובה."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "לא ניתן להגיב על פוסט שאינו בתבנית שו\"ת."+ not_permitted: "הוספת תגובה על פוסט משויך אסורה."+ limit_exceeded: "הגעת למגבלה של %{limit} תגובות לפוסט."+ perform: "הערת הצבעת פוסט סומנה עם ניקוד גבוה מספיק כדי להשתיק את המשתמש."+ auto_silence_from_flags: "הושתק אוטומטית עקב סימון."+ reviewables:+ comment_already_handled: "תודה לך, כבר בדקנו את התגובה הזאת והחלטנו שאין צורך לסמן אותה בדגל פעם נוספת."+ actions:+ agree_and_keep_comment:+ title: "להשאיר את התגובה"+ description: "הבעת הסכמה עם הדגל והשארת התגובה ללא שינוי."+ agree_and_keep_deleted:+ title: "להשאיר את התגובה מחוקה"+ description: "הבעת הסכמה עם הדגל והשארת התגובה מחוקה."+ agree_and_suspend:+ title: "השעיית משתמש"+ description: "הבעת הסכמה עם הדגל והשעיית המשתמש."+ agree_and_silence:+ title: "השתקת משתמש"+ description: "הבעת הסכמה עם הדגל והשתקת המשתמש."+ agree_and_restore:+ title: "שחזור תגובה"+ description: "לשחזר את התגובה כדי שמשתמשים יוכלו לראות אותה."+ agree_and_delete:+ title: "מחיקת תגובה"+ description: "למחוק את התגובה כדי שמשתמשים לא יוכלו לראות אותה."+ delete_and_agree:+ title: "התעלמות מהדגל ומחיקת התגובה"+ description: "התעלמות מהדגל על ידי הסרתו מהתור ומחיקת התגובה."+ disagree_and_restore:+ title: "לסרב ולשחזר תגובה"+ description: "לשחזר את התגובה כדי שכל המשתמשים יוכלו לראות אותה."+ disagree:+ title: "אי קבלה"+ ignore:+ title: "לא לעשות דבר"+ description: "התעלמות מהדגל על ידי הסרתו מהתור מבלי לנקוט בשום פעולה."+ transcript:+ view: "הצגת תמליל התגובות הקודמות"+ reviewable_score_types:+ needs_review:+ title: "דורש סקירה"+ notify_user:+ comment_pm_title: "הערת הצבעה שלך על פוסט"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "הערת הצבעה על פוסטים דורשת את תשומת לב הסגל"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.hr.yml b/plugins/discourse-post-voting/config/locales/server.hr.ymlnew file mode 100644index 00000000000..b3ea3e7b4b1--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.hr.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/++hr:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspendiraj korisnika"+ agree_and_silence:+ title: "Ušuti korisnika"+ disagree:+ title: "Odbaci"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.hu.yml b/plugins/discourse-post-voting/config/locales/server.hu.ymlnew file mode 100644index 00000000000..33d961bb869--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.hu.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/++hu:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Felhasználó felfüggesztése"+ description: "Egyetértés a megjelöléssel, és a felhasználó felfüggesztése"+ agree_and_silence:+ title: "Felhasználó némítása"+ description: "Egyetértés a megjelöléssel, és a felhasználó némítása"+ disagree:+ title: "Elutasítás"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.hy.yml b/plugins/discourse-post-voting/config/locales/server.hy.ymlnew file mode 100644index 00000000000..43e00c56b62--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.hy.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/++hy:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Սառեցնել Օգտատիրոջը"+ description: "Ընդունել դրոշակավորումը և սառեցնել օգտատիրոջը:"+ agree_and_silence:+ title: "Լռեցնել Օգտատիրոջը"+ description: "Ընդունել դրոշակը և սառեցնել օգտատիրոջը:"+ disagree:+ title: "Չընդունել"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.id.yml b/plugins/discourse-post-voting/config/locales/server.id.ymlnew file mode 100644index 00000000000..fdcdf5f8759--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.id.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/++id:+ post_action_types:+ vote:+ title: "Pilih"+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Tangguhkan Pengguna"+ description: "Setuju dengan penanda dan menangguhkan pengguna."+ agree_and_silence:+ title: "Senyapkan Pengguna"+ description: "Setuju dengan penanda dan senyapkan pengguna."+ disagree:+ title: "Tidak setuju"+ ignore:+ title: "Tidak Melakukan Apapun"+ description: "Abaikan penanda tersebut dengan menghapusnya dari antrean tanpa mengambil tindakan apa pun."+ reviewable_score_types:+ needs_review:+ title: "Perlu Reviu"+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.it.yml b/plugins/discourse-post-voting/config/locales/server.it.ymlnew file mode 100644index 00000000000..757dec48909--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.it.yml@@ -0,0 +1,103 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "La votazione dei messaggi non è abilitata."+ replying_to_post_not_permited: "Non sei autorizzato a creare un messaggio in risposta a un altro messaggio."+ voting_not_permitted: "Non sei autorizzato a votare su questo messaggio."+ comment_cannot_be_downvoted: "Puoi solo votare a favore dei commenti."+ self_voting_not_permitted: "Non sei autorizzato a votare il tuo stesso messaggio o commento."+ vote_archived_topic: "Non puoi votare su argomenti archiviati."+ vote_closed_topic: "Non puoi votare su argomenti chiusi."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "La votazione dei messaggi non è abilitata."+ subtype_not_allowed: "Il sottotipo Votazione dei messaggi può essere utilizzato solo con argomenti normali."+ cannot_change_to_post_voting_subtype: "Non è consentito modificare il sottotipo di un argomento con votazione dei messaggi."+ answer_count:+ one: "%{count} risposta"+ other: "%{count} risposte"+ site_settings:+ qa_tags: "Etichette per abilitare la votazione dei messaggi sull'argomento"+ post_voting_enabled: "Abilita il plugin per la votazione dei messaggi"+ post_voting_enable_likes_on_answers: "Abilita il pulsante Mi piace nelle risposte agli argomenti con votazione dei messaggi"+ post_voting_undo_vote_action_window: "Numero di minuti consentiti agli utenti per annullare i voti negli argomenti con votazione dei messaggi (inserisci 0 per non definire alcun limite)"+ post_voting_comment_limit_per_post: "Numero di commenti consentiti su ogni messaggio"+ min_trust_to_flag_posts_voting_comments: "Livello di attendibilità minimo per contrassegnare un commento di votazione dei messaggi"+ flag_posts_voting_comments_allowed_groups: "Gruppi autorizzati a contrassegnare un commento di votazione dei messaggi"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "Vota"+ description: "Vota per questo messaggio"+ short_description: "Vota per questo messaggio"+ long_form: "ha votato per questo messaggio"+ vote:+ error:+ user_has_not_voted: "L'utente non ha votato."+ user_over_limit: "Non puoi superare il numero di voti per il tuo livello di attendibilità."+ already_voted: "Puoi votare una sola volta per domanda."+ undo_vote_action_window:+ one: "Non puoi annullare il voto %{count} minuto dopo la votazione."+ other: "Non puoi annullare la votazione %{count} minuti dopo la votazione."+ one_vote_per_post: "Puoi votare una sola volta per messaggio."+ one_vote_per_comment: "Puoi votare una sola volta per ogni commento."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "Non è consentito commentare un messaggio che non è in un argomento con votazione dei messaggi."+ not_permitted: "Non è consentito commentare messaggi associati."+ limit_exceeded: "È stato raggiunto il limite di %{limit} commenti per messaggio."+ perform: "Commento di votazione di messaggio contrassegnato con un punteggio sufficientemente alto per silenziare l'utente."+ auto_silence_from_flags: "Silenziato automaticamente a causa della segnalazione."+ reviewables:+ comment_already_handled: "Grazie, ma abbiamo già esaminato questo commento e stabilito che non è necessario contrassegnarlo di nuovo."+ actions:+ agree_and_keep_comment:+ title: "Mantieni il commento"+ description: "Accetta la segnalazione e mantieni invariato il commento."+ agree_and_keep_deleted:+ title: "Mantieni il commento cancellato"+ description: "Accetta segnalazione e conferma eliminazione del commento."+ agree_and_suspend:+ title: "Sospendi utente"+ description: "Accetta segnalazione e sospendi l'utente."+ agree_and_silence:+ title: "Silenzia utente"+ description: "Accetta segnalazione e silenzia l'utente."+ agree_and_restore:+ title: "Ripristina il commento"+ description: "Ripristina il commento in modo che gli utenti possano vederlo."+ agree_and_delete:+ title: "Elimina il commento"+ description: "Elimina il commento in modo che gli utenti non possano vederlo."+ delete_and_agree:+ title: "Ignora segnalazione ed elimina commento"+ description: "Ignora la segnalazione rimuovendola dalla coda ed eliminando il commento."+ disagree_and_restore:+ title: "Esprimi disaccordo e ripristina il commento"+ description: "Ripristina il commento in modo che tutti gli utenti possano vederlo."+ disagree:+ title: "Rifiuta"+ ignore:+ title: "Non fare nulla"+ description: "Ignora la segnalazione rimuovendola dalla coda senza intraprendere alcuna azione."+ transcript:+ view: "Visualizza la trascrizione dei commenti precedenti"+ reviewable_score_types:+ needs_review:+ title: "Necessita di revisione"+ notify_user:+ comment_pm_title: "Il tuo commento sulla votazione del messaggio"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "Un commento di votazione dei messaggi richiede l'attenzione dello staff"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.ja.yml b/plugins/discourse-post-voting/config/locales/server.ja.ymlnew file mode 100644index 00000000000..74ee1ca0666--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.ja.yml@@ -0,0 +1,101 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "投稿の投票は有効になっていません。"+ replying_to_post_not_permited: "別の投稿への返信として投稿を作成することはできません。"+ voting_not_permitted: "この投稿には投票できません。"+ comment_cannot_be_downvoted: "コメントにのみ賛成できます。"+ self_voting_not_permitted: "自分の投稿またはコメントに投票できません。"+ vote_archived_topic: "アーカイブされたトピックに投票できません。"+ vote_closed_topic: "クローズされたトピックに投票できません。"+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "投稿の投票は有効になっていません。"+ subtype_not_allowed: "投稿の投票のサブタイプは、通常のトピックのみで使用できます。"+ cannot_change_to_post_voting_subtype: "トピックのサブタイプを投稿の投票に変更することはできません。"+ answer_count:+ other: "回答 %{count} 件"+ site_settings:+ qa_tags: "トピックへの投稿の投票を有効にするタグ"+ post_voting_enabled: "投稿の投票プラグインを有効化"+ post_voting_enable_likes_on_answers: "投稿の投票トピックでの返信に「いいね!」ボタンを有効にする"+ post_voting_undo_vote_action_window: "投稿の投票トピックでユーザーが投票を取り消すことのできる分数 (無制限の場合は 0 を入力します)"+ post_voting_comment_limit_per_post: "各投稿に許可されるコメント数"+ min_trust_to_flag_posts_voting_comments: "投稿の投票コメントを通報できる最低信頼レベル"+ flag_posts_voting_comments_allowed_groups: "投稿の投票コメントを通報できるグループ"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "投票"+ description: "この投稿に投票します"+ short_description: "この投稿に投票します"+ long_form: "がこの投稿に投票しました"+ vote:+ error:+ user_has_not_voted: "ユーザーはまだ投票していません"+ user_over_limit: "信頼レベルの投票数を超えることはできません。"+ already_voted: "質問ごとに 1 回だけ投票できます。"+ undo_vote_action_window:+ other: "投票後 %{count} 分間は投票を取り消すことができません。"+ one_vote_per_post: "投稿ごとに 1 回だけ投票できます。"+ one_vote_per_comment: "コメントごとに 1 回だけ投票できます。"+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "投稿の投票トピックに含まれない投稿へのコメントはできません。"+ not_permitted: "関連する投稿にコメントすることはできません。"+ limit_exceeded: "投稿あたり %{limit} 件のコメント数制限に達しました。"+ perform: "ユーザーを投稿禁止にするのに十分なスコアで通報された投稿の投票コメント。"+ auto_silence_from_flags: "通報により自動的に投稿禁止にされました。"+ reviewables:+ comment_already_handled: "ありがとうございます。ただ、このコメントはすでにレビュー済みで、通報の必要がないと判断されています。"+ actions:+ agree_and_keep_comment:+ title: "コメントを保持"+ description: "通報に同意し、コメントを変更しないままにします。"+ agree_and_keep_deleted:+ title: "コメントを削除されたままにする"+ description: "通報に同意し、コメントを削除したままにします。"+ agree_and_suspend:+ title: "ユーザーを凍結"+ description: "通報に同意し、ユーザーを凍結します。"+ agree_and_silence:+ title: "ユーザーを投稿禁止"+ description: "通報に同意し、ユーザーを投稿禁止にします。"+ agree_and_restore:+ title: "コメントを復元"+ description: "ユーザーが閲覧できるようにコメントを復元します。"+ agree_and_delete:+ title: "コメントを削除"+ description: "ユーザーが閲覧できないようにコメントを削除します。"+ delete_and_agree:+ title: "通報を無視してコメントを削除"+ description: "キューから削除して通報を無視し、そのコメントを削除します。"+ disagree_and_restore:+ title: "却下してコメントを復元"+ description: "すべてのユーザーが閲覧できるようにコメントを復元します。"+ disagree:+ title: "却下"+ ignore:+ title: "何もしない"+ description: "何もアクションを起こさずに、キューから削除して通報を無視します。"+ transcript:+ view: "前のコメントのトランスクリプトを表示"+ reviewable_score_types:+ needs_review:+ title: "要レビュー"+ notify_user:+ comment_pm_title: "あなたの投票の投稿コメント"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "投稿の投票コメントにはスタッフの注意が必要です"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.ko.yml b/plugins/discourse-post-voting/config/locales/server.ko.ymlnew file mode 100644index 00000000000..5e9d62488c6--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.ko.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/++ko:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "사용자 차단"+ description: "플래그에 동의하고 사용자를 일시 중지하십시오."+ agree_and_silence:+ title: "글 작성 중지 사용자"+ description: "신고에 동의하고 사용자를 쓰기 금지로 설정합니다."+ disagree:+ title: "동의하지 않음"+ reviewable_score_types:+ needs_review:+ title: "검토 필요"+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.lt.yml b/plugins/discourse-post-voting/config/locales/server.lt.ymlnew file mode 100644index 00000000000..5b5e89668dc--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.lt.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/++lt:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspenduoti narį"+ agree_and_silence:+ title: "Nutildyti narį"+ description: "Sutikti su pranešimu ir nutildyti narį."+ disagree:+ title: "Nesutinka"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.lv.yml b/plugins/discourse-post-voting/config/locales/server.lv.ymlnew file mode 100644index 00000000000..0e6f9471413--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.lv.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/++lv:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Apturētie lietotāji"+ disagree:+ title: "Nepiekrist"diff --git a/plugins/discourse-post-voting/config/locales/server.nb_NO.yml b/plugins/discourse-post-voting/config/locales/server.nb_NO.ymlnew file mode 100644index 00000000000..93782c98d97--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.nb_NO.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/++nb_NO:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Steng ute bruker"+ description: "Si deg enig med rapportering og steng ute bruker. "+ agree_and_silence:+ title: "Demp bruker"+ description: "Si deg enig med rapportering og demp bruker. "+ disagree:+ title: "Si deg uenig"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.nl.yml b/plugins/discourse-post-voting/config/locales/server.nl.ymlnew file mode 100644index 00000000000..36144c3be5b--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.nl.yml@@ -0,0 +1,103 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "Stemmen op berichten is niet ingeschakeld."+ replying_to_post_not_permited: "Je mag geen bericht maken als antwoord op een ander bericht."+ voting_not_permitted: "Je mag niet stemmen op dit bericht."+ comment_cannot_be_downvoted: "Je kunt alleen reacties omhoog stemmen."+ self_voting_not_permitted: "Je mag niet stemmen op je eigen bericht of reactie."+ vote_archived_topic: "Je kunt niet stemmen op gearchiveerde topics."+ vote_closed_topic: "Je kunt niet stemmen op gesloten topics."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "Stemmen op berichten is niet ingeschakeld."+ subtype_not_allowed: "Het subtype Stemmen op berichten kan alleen worden gebruikt bij reguliere topics."+ cannot_change_to_post_voting_subtype: "Het wijzigen van het subtype van een topic naar Stemmen op berichten is niet toegestaan."+ answer_count:+ one: "%{count} antwoord"+ other: "%{count} antwoorden"+ site_settings:+ qa_tags: "Tags om stemmen op berichten in te schakelen voor een topic"+ post_voting_enabled: "Plug-in Stemmen op berichten inschakelen"+ post_voting_enable_likes_on_answers: "Likeknop inschakelen voor antwoorden in topics met Stemmen op berichten"+ post_voting_undo_vote_action_window: "Aantal minuten waarbinnen gebruikers stemmen in topics met Stemmen op berichten ongedaan kunnen maken (vul 0 in voor geen limiet)"+ post_voting_comment_limit_per_post: "Aantal toegestane reacties op elk bericht"+ min_trust_to_flag_posts_voting_comments: "Minimaal vertrouwensniveau om een Stemmen op berichten-reactie te markeren"+ flag_posts_voting_comments_allowed_groups: "Groepen mogen een reactie op een Stemmen op berichten-reactie markeren"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "Stemmen"+ description: "Stem op dit bericht"+ short_description: "Stem op dit bericht"+ long_form: "op dit bericht gestemd"+ vote:+ error:+ user_has_not_voted: "Gebruiker heeft niet gestemd."+ user_over_limit: "Je mag het aantal stemmen voor je vertrouwensniveau niet overschrijden."+ already_voted: "Je kunt maar één keer stemmen per vraag."+ undo_vote_action_window:+ one: "Je kunt de stem %{count} minuut na het stemmen niet ongedaan maken."+ other: "Je kunt de stem %{count} minuten na het stemmen niet ongedaan maken."+ one_vote_per_post: "Je kunt maar één keer stemmen per bericht."+ one_vote_per_comment: "Je kunt maar één keer stemmen per reactie."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "Reageren op een bericht dat niet in een topic met Stemmen op berichten staat, is niet toegestaan."+ not_permitted: "Reageren op het gerelateerde bericht is niet toegestaan."+ limit_exceeded: "Limiet van %{limit} reacties per bericht is bereikt."+ perform: "Stemmen op berichten-reactie gemarkeerd met een score die hoog genoeg is om de gebruiker te dempen."+ auto_silence_from_flags: "Automatisch gedempt wegens markeringen."+ reviewables:+ comment_already_handled: "Bedankt, maar we hebben deze reactie al beoordeeld en vastgesteld dat deze niet opnieuw hoeft te worden gemarkeerd."+ actions:+ agree_and_keep_comment:+ title: "Reactie behouden"+ description: "Ga akkoord met de markering en laat de reactie ongewijzigd."+ agree_and_keep_deleted:+ title: "Reactie verwijderd houden"+ description: "Ga akkoord met de markering en laat de reactie verwijderd."+ agree_and_suspend:+ title: "Gebruiker schorsen"+ description: "Akkoord met markering en de gebruiker schorsen."+ agree_and_silence:+ title: "Gebruiker dempen"+ description: "Akkoord met markering en de gebruiker dempen."+ agree_and_restore:+ title: "Reactie herstellen"+ description: "Herstel de reactie zodat gebruikers deze kunnen zien."+ agree_and_delete:+ title: "Reactie verwijderen"+ description: "Verwijder de reactie zodat gebruikers deze niet kunnen zien."+ delete_and_agree:+ title: "Markering negeren en reactie verwijderen"+ description: "Negeer de markering door deze uit de wachtrij te verwijderen en verwijder de reactie."+ disagree_and_restore:+ title: "Niet akkoord en reactie herstellen"+ description: "Herstel de reactie zodat alle gebruikers deze kunnen zien."+ disagree:+ title: "Niet akkoord"+ ignore:+ title: "Niets doen"+ description: "Negeer de markering door deze uit de wachtrij te verwijderen zonder enige actie te ondernemen."+ transcript:+ view: "Transcript van eerdere reacties weergeven"+ reviewable_score_types:+ needs_review:+ title: "Beoordeling nodig"+ notify_user:+ comment_pm_title: "Je Stemmen op berichten-reactie"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "Een Stemmen op berichten-reactie vereist aandacht van een medewerker"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.pl_PL.yml b/plugins/discourse-post-voting/config/locales/server.pl_PL.ymlnew file mode 100644index 00000000000..74752230b9c--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.pl_PL.yml@@ -0,0 +1,74 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "Głosowanie na post nie jest włączone."+ replying_to_post_not_permited: "Nie możesz utworzyć postu w odpowiedzi na inny post."+ voting_not_permitted: "Nie możesz głosować na ten post."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "Głosowanie na post nie jest włączone."+ answer_count:+ one: "%{count} odpowiedź"+ few: "%{count} odpowiedzi"+ many: "%{count} odpowiedzi"+ other: "%{count} odpowiedzi"+ site_settings:+ qa_tags: "Tagi umożliwiające głosowanie na posty w temacie"+ post_voting_comment_limit_per_post: "Liczba komentarzy dozwolonych pod każdym postem"+ post_action_types:+ vote:+ title: "Głosuj"+ description: "Zagłosuj na ten post"+ short_description: "Zagłosuj na ten post"+ vote:+ error:+ user_has_not_voted: "Użytkownik nie oddał głosu."+ user_over_limit: "Nie możesz przekroczyć liczby głosów odpowiadającej Twojemu poziomowi zaufania."+ already_voted: "Na jedno pytanie można oddać tylko jeden głos."+ one_vote_per_post: "Na każdy post można oddać tylko jeden głos."+ one_vote_per_comment: "Na każdy komentarz można oddać tylko jeden głos."+ post_voting:+ comment:+ reviewables:+ comment_already_handled: "Dziękujemy, ale sprawdziliśmy już ten komentarz i stwierdziliśmy, że nie ma potrzeby jego ponownego oznaczania."+ actions:+ agree_and_keep_comment:+ title: "Zachowaj komentarz"+ description: "Zgadzam się z flagą i pozostawię komentarz bez zmian."+ agree_and_keep_deleted:+ title: "Zachowaj komentarz usunięty"+ description: "Zgadzam się z flagą i pozostawię komentarz usunięty."+ agree_and_suspend:+ title: "Zawieś użytkownika"+ description: "Zgódź się z flagą i zawieś konto użytkownika."+ agree_and_silence:+ title: "Wycisz użytkownika"+ description: "Zgódź się z flagą i wycisz użytkownika."+ agree_and_restore:+ title: "Przywróć komentarz"+ description: "Przywróć komentarz, aby użytkownicy mogli go zobaczyć."+ agree_and_delete:+ title: "Usuń komentarz"+ description: "Usuń komentarz, aby użytkownicy nie mogli go zobaczyć."+ disagree_and_restore:+ description: "Przywróć komentarz, aby wszyscy użytkownicy mogli go zobaczyć."+ disagree:+ title: "Wycofaj"+ ignore:+ title: "Nic nie rób"+ description: "Zignoruj flagę usuwając ją z kolejki bez podejmowania jakichkolwiek działań."+ reviewable_score_types:+ needs_review:+ title: "Wymaga sprawdzenia"+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.pt.yml b/plugins/discourse-post-voting/config/locales/server.pt.ymlnew file mode 100644index 00000000000..8a222141392--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.pt.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/++pt:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Utilizador Suspenso"+ agree_and_silence:+ title: "Silenciar Usuário"+ disagree:+ title: "Discordar"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.pt_BR.yml b/plugins/discourse-post-voting/config/locales/server.pt_BR.ymlnew file mode 100644index 00000000000..62a0856233b--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.pt_BR.yml@@ -0,0 +1,103 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "A votação de publicação não está ativada."+ replying_to_post_not_permited: "Você não tem permissão para criar uma postagem em resposta a outra postagem."+ voting_not_permitted: "Você não tem permissão para votar nesta postagem."+ comment_cannot_be_downvoted: "Você só pode votar nos comentários."+ self_voting_not_permitted: "Você não tem permissão para votar em sua própria postagem ou comentário."+ vote_archived_topic: "Você não pode votar em tópicos arquivados."+ vote_closed_topic: "Você não pode votar em tópicos fechados."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "A votação de publicação não está ativada."+ subtype_not_allowed: "O subtipo da votação de publicação só poder ser usada com tópicos regulares."+ cannot_change_to_post_voting_subtype: "Não é permitido alterar o subtipo de um tópico de \"Votação de publicação\"."+ answer_count:+ one: "%{count} resposta"+ other: "%{count} respostas"+ site_settings:+ qa_tags: "Etiquetas para ativar votação de publicação no tópico"+ post_voting_enabled: "Ativar plugin de votação em publicação"+ post_voting_enable_likes_on_answers: "Ative o botão de curtir nas respostas, nos tópicos de votação em publicação"+ post_voting_undo_vote_action_window: "Número de minutos em que os(as) usuários(as) podem cancelar votos em tópicos de votação em publicação (digite 0 para não ter limite)"+ post_voting_comment_limit_per_post: "Quantidade de comentários permitidos em cada publicação"+ min_trust_to_flag_posts_voting_comments: "Nível mínimo de confiança para sinalizar comentário de votação em postagem"+ flag_posts_voting_comments_allowed_groups: "Grupos com permissão para sinalizar comentário de votação em postagem"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "Votar"+ description: "Vote nesta postagem"+ short_description: "Vote nesta postagem"+ long_form: "votou nesta postagem"+ vote:+ error:+ user_has_not_voted: "O usuário não votou."+ user_over_limit: "Você não pode exceder o número de votos para seu nível de confiança."+ already_voted: "Você só pode votar uma vez por pergunta."+ undo_vote_action_window:+ one: "Você não pode cancelar a votação %{count} minuto após a votação."+ other: "Você não pode cancelar a votação %{count} minutos após a votação."+ one_vote_per_post: "Você só pode votar uma vez em cada postagem."+ one_vote_per_comment: "Você só pode votar uma vez em cada comentário."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "Não é permitido comentar em uma postagem que não esteja em um tópico de \"Votação de publicação\"."+ not_permitted: "Não é permitido comentar na postagem associada."+ limit_exceeded: "O limite de %{limit} comentários por postagem foi atingido."+ perform: "Comentário de votação em postagem sinalizado com pontuação alta o suficiente para silenciar o(a) usuário(a)."+ auto_silence_from_flags: "Silenciado(a) automaticamente devido à sinalização."+ reviewables:+ comment_already_handled: "Agradecemos, mas já analisamos este comentário e determinamos que não precisa ser sinalizado novamente."+ actions:+ agree_and_keep_comment:+ title: "Manter comentário"+ description: "Concorde com o sinalizador e mantenha o comentário inalterado."+ agree_and_keep_deleted:+ title: "Manter comentário excluído"+ description: "Concorde com o sinalizador e mantenha o comentário excluído."+ agree_and_suspend:+ title: "Suspender usuário(s)"+ description: "Concorde com o sinalizador e suspenda o(a) usuário(a)."+ agree_and_silence:+ title: "Silenciar usuário(a)"+ description: "Concorde com o sinalizador e silencie o(a) usuário(a)."+ agree_and_restore:+ title: "Restaurar comentário"+ description: "Restaure o comentário para que os(as) usuários(as) possam ver."+ agree_and_delete:+ title: "Excluir comentário"+ description: "Exclua o comentário para que os(as) usuários(as) não possam ver."+ delete_and_agree:+ title: "Ignorar sinalizador e excluir comentário"+ description: "Ignore o sinalizador ao removê-lo da fila e exclua o comentário."+ disagree_and_restore:+ title: "Discordar e restaurar comentário"+ description: "Restaure o comentário para que todos(as) usuários(as) possam ver."+ disagree:+ title: "Discordar"+ ignore:+ title: "Não fazer nada"+ description: "Ignore o sinalizador ao removê-lo da fila sem realizar nenhuma ação."+ transcript:+ view: "Ver transcrição de comentários anteriores"+ reviewable_score_types:+ needs_review:+ title: "Precisa de revisão"+ notify_user:+ comment_pm_title: "Seu comentário de votação em postagem"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "Um comentário de votação em postagem requer atenção da equipe"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.ro.yml b/plugins/discourse-post-voting/config/locales/server.ro.ymlnew file mode 100644index 00000000000..a78621daa9f--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.ro.yml@@ -0,0 +1,25 @@+# 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:+ post_action_types:+ vote:+ title: "Votează"+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspendă utilizator"+ agree_and_silence:+ title: "Reducere la tăcere utilizator"+ disagree:+ title: "Nu sunt de acord"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.ru.yml b/plugins/discourse-post-voting/config/locales/server.ru.ymlnew file mode 100644index 00000000000..d299d193433--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.ru.yml@@ -0,0 +1,107 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "Голосование по сообщениям не включено."+ replying_to_post_not_permited: "Вы не можете создать сообщение в ответ на другое сообщение."+ voting_not_permitted: "Вы не можете голосовать за это сообщение."+ comment_cannot_be_downvoted: "Вы можете голосовать только за комментарии."+ self_voting_not_permitted: "Вы не можете голосовать за собственное сообщение или комментарий."+ vote_archived_topic: "Нельзя голосовать по архивным темам."+ vote_closed_topic: "Нельзя голосовать по закрытым темам."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "Голосование по сообщениям не включено."+ subtype_not_allowed: "Подтип «Голосование по сообщениям» можно использовать только с обычными темами."+ cannot_change_to_post_voting_subtype: "Переключение на формат «Голосование по сообщениям» не допускается."+ answer_count:+ one: "%{count} ответ"+ few: "%{count} ответа"+ many: "%{count} ответов"+ other: "%{count} ответа"+ site_settings:+ qa_tags: "Теги для переключения темы в формат «Голосование по сообщениям»"+ post_voting_enabled: "Включить плагин «Голосование по публикациям»"+ post_voting_enable_likes_on_answers: "Включить лайки в ответах тем формата «Голосование по публикациям»"+ post_voting_undo_vote_action_window: "Количество минут, в течение которых пользователям разрешено отменять голоса в темах формата «Голосование по публикациям» (0 — не ограничивать время)"+ post_voting_comment_limit_per_post: "Максимальное количество комментариев к каждой публикации"+ min_trust_to_flag_posts_voting_comments: "Минимальный уровень доверия для жалобы на комментарий в режиме «Голосование по публикациям»"+ flag_posts_voting_comments_allowed_groups: "Группам разрешено жаловаться на комментарии в режиме «Голосование по публикациям»"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "Голосовать"+ description: "Проголосовать за эту запись"+ short_description: "Проголосовать за эту запись"+ long_form: "проголосовал(а) за эту запись"+ vote:+ error:+ user_has_not_voted: "Пользователь не проголосовал."+ user_over_limit: "Нельзя превышать количество голосов, установленное для вашего уровня доверия."+ already_voted: "Проголосовать можно только один раз за вопрос."+ undo_vote_action_window:+ one: "Вы не можете отменить голос по истечении %{count} минуты после голосования."+ few: "Вы не можете отменить голос по истечении %{count} минут после голосования."+ many: "Вы не можете отменить голос по истечении %{count} минут после голосования."+ other: "Вы не можете отменить голос по истечении %{count} минуты после голосования."+ one_vote_per_post: "Проголосовать можно только один раз на каждую запись."+ one_vote_per_comment: "Проголосовать можно только один раз на каждый комментарий."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "Комментирование сообщения, не относящегося к теме в формате «Голосование по сообщениям», не допускается."+ not_permitted: "Комментирование связанного сообщения не допускается."+ limit_exceeded: "Достигнут лимит комментариев на одно сообщение: %{limit}."+ perform: "На комментарий к публикации с голосованием поступило достаточно много жалоб, чтобы заморозить пользователя."+ auto_silence_from_flags: "Автоматическая заморозка из-за жалобы."+ reviewables:+ comment_already_handled: "Спасибо, но мы уже просмотрели этот комментарий и решили, что на него не нужно снова отправлять жалобу."+ actions:+ agree_and_keep_comment:+ title: "Сохранить комментарий"+ description: "Согласиться с жалобой, но оставить комментарий без изменений."+ agree_and_keep_deleted:+ title: "Оставить комментарий удаленным"+ description: "Согласиться с жалобой и оставить комментарий удаленным."+ agree_and_suspend:+ title: "Блокировка пользователя"+ description: "Согласиться с жалобой и заблокировать пользователя."+ agree_and_silence:+ title: "Заморозка пользователя"+ description: "Согласиться с жалобой и заморозить пользователя."+ agree_and_restore:+ title: "Восстановить комментарий"+ description: "Восстановить комментарий, чтобы пользователи могли его видеть."+ agree_and_delete:+ title: "Удалить комментарий"+ description: "Удалить комментарий, чтобы пользователи не могли его видеть."+ delete_and_agree:+ title: "Игнорировать жалобу и удалить комментарий"+ description: "Проигнорировать жалобу, удалив ее из очереди, и удалить комментарий."+ disagree_and_restore:+ title: "Отклонить жалобу и восстановить комментарий"+ description: "Восстановить комментарий, чтобы все пользователи могли его видеть."+ disagree:+ title: "Отклонить"+ ignore:+ title: "Ничего не делать"+ description: "Проигнорировать жалобу, удалив ее из очереди, не предпринимая никаких действий."+ transcript:+ view: "Просмотр содержимого предыдущих комментариев"+ reviewable_score_types:+ needs_review:+ title: "Требуется проверка"+ notify_user:+ comment_pm_title: "Ваш комментарий к публикации с голосованием"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "Комментарий к публикации с голосованием требует внимания персонала"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.sk.yml b/plugins/discourse-post-voting/config/locales/server.sk.ymlnew file mode 100644index 00000000000..5a68aa8f998--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.sk.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/++sk:+ post_action_types:+ vote:+ title: "Hlasovať"+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspendovaný užívateľ"+ description: "Súhlas s príznakom a pozastavenie používateľa."+ agree_and_silence:+ title: "Tichý užívateľ"+ description: "Súhlas s príznakom a umlčte používateľa."+ disagree:+ title: "Nesúhlasiť"+ ignore:+ title: "Nerobte nič"+ description: "Ignorujte príznak jeho odstránením z frontu bez vykonania akejkoľvek akcie."+ reviewable_score_types:+ needs_review:+ title: "Potreba preskúmať"+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.sl.yml b/plugins/discourse-post-voting/config/locales/server.sl.ymlnew file mode 100644index 00000000000..f0db42626c0--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.sl.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/++sl:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspendiraj uporabnika"+ description: "Strinjam se z prijavo in suspendiraj uporabnika."+ agree_and_silence:+ title: "Utišaj uporabnika"+ description: "Potrdi prijavo in utišaj uporabnika"+ disagree:+ title: "Se ne strinjam"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.sq.yml b/plugins/discourse-post-voting/config/locales/server.sq.ymlnew file mode 100644index 00000000000..4de498bd449--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.sq.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/++sq:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Pezullo anëtarin"+ disagree:+ title: "Jo dakord"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.sr.yml b/plugins/discourse-post-voting/config/locales/server.sr.ymlnew file mode 100644index 00000000000..30b0d67b82d--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.sr.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/++sr:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Suspenduj Korisnika"+ disagree:+ title: "Odbaci"diff --git a/plugins/discourse-post-voting/config/locales/server.sv.yml b/plugins/discourse-post-voting/config/locales/server.sv.ymlnew file mode 100644index 00000000000..c994665254b--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.sv.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/++sv:+ post_action_types:+ vote:+ title: "Rösta"+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Stäng av användaren"+ description: "Godkänn flaggning och stäng av användaren."+ agree_and_silence:+ title: "Tysta användaren"+ description: "Godkänn flaggning och tysta användaren."+ disagree:+ title: "Håll inte med"+ ignore:+ title: "Gör ingenting"+ description: "Ignorera flaggan genom att ta bort den från kön utan att vidta någon åtgärd."+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.sw.yml b/plugins/discourse-post-voting/config/locales/server.sw.ymlnew file mode 100644index 00000000000..c527ec07d7d--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.sw.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/++sw:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Simamisha Mtumiaji"+ description: "Kubaliana na bendera na simamisha mtumiaji."+ agree_and_silence:+ title: "Nyamazisha Mtumiaji"+ description: "Kubaliana na bendera na nyamazisha mtumiaji."+ disagree:+ title: "Kataa"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.te.yml b/plugins/discourse-post-voting/config/locales/server.te.ymlnew file mode 100644index 00000000000..c8feedb1d06--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.te.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/++te:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "సభ్యుడిని సస్పెండు చేయి"+ description: "ఫిర్యాదుతో అంగీకరిస్తు సభ్యుని సస్పెండ్ చేయండి."+ agree_and_silence:+ title: "సభ్యుని నిశ్శబ్దం చేయండి"+ description: "ఫిర్యాదుతో అంగీకరిస్తు సభ్యుని నిశబ్దం చేయండి."+ disagree:+ title: "ఒప్పుకోకు"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.th.yml b/plugins/discourse-post-voting/config/locales/server.th.ymlnew file mode 100644index 00000000000..1de3a581ea5--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.th.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/++th:+ post_voting:+ comment:+ reviewables:+ actions:+ disagree:+ title: "ไม่เห็นด้วย"diff --git a/plugins/discourse-post-voting/config/locales/server.tr_TR.yml b/plugins/discourse-post-voting/config/locales/server.tr_TR.ymlnew file mode 100644index 00000000000..08fbcced2aa--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.tr_TR.yml@@ -0,0 +1,103 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "Gönderi oylama etkin değil."+ replying_to_post_not_permited: "Başka bir gönderiye yanıt olarak gönderi oluşturmanıza izin verilmiyor."+ voting_not_permitted: "Bu gönderiye oy vermenize izin verilmiyor."+ comment_cannot_be_downvoted: "Sadece yorumlara olumlu oy verebilirsiniz."+ self_voting_not_permitted: "Kendi gönderinize veya yorumunuza oy vermenize izin verilmiyor."+ vote_archived_topic: "Arşivlenmiş konulara oy veremezsiniz."+ vote_closed_topic: "Kapatılan konulara oy veremezsiniz."+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "Gönderi oylama etkin değil."+ subtype_not_allowed: "Gönderi Oylama alt türü yalnızca normal konularda kullanılabilir."+ cannot_change_to_post_voting_subtype: "Bir konunun alt türünün Gönderi Oylama olarak değiştirilmesine izin verilmez."+ answer_count:+ one: "%{count} Yanıt"+ other: "%{count} Yanıt"+ site_settings:+ qa_tags: "Konuyla ilgili gönderi oylamasını etkinleştirmek için etiketler"+ post_voting_enabled: "Gönderi Oylaması Eklentisini etkinleştir"+ post_voting_enable_likes_on_answers: "Gönderi Oylaması konularındaki yanıtlarda beğen düğmesini etkinleştir"+ post_voting_undo_vote_action_window: "Kullanıcıların Gönderi Oylama konularındaki oyları geri almalarına izin verilen dakika sayısı (limit olmaması için 0 girin)"+ post_voting_comment_limit_per_post: "Her gönderide izin verilen yorum sayısı"+ min_trust_to_flag_posts_voting_comments: "Bir gönderi oylama yorumuna bayrak eklemek için minimum güven seviyesi"+ flag_posts_voting_comments_allowed_groups: "Bir oylama yorumuna bayrak eklemesine izin verilen gruplar"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "Oy verin"+ description: "Bu gönderiye oy verin"+ short_description: "Bu gönderiye oy verin"+ long_form: "bu gönderiye oy verdi"+ vote:+ error:+ user_has_not_voted: "Kullanıcı oy vermedi."+ user_over_limit: "Güven seviyenize uygun oy sayısını aşamazsınız."+ already_voted: "Her soru için yalnızca bir kez oy kullanabilirsiniz."+ undo_vote_action_window:+ one: "Oy kullandıktan %{count} dakika sonra oylamayı geri alamazsınız."+ other: "Oy kullandıktan %{count} dakika sonra oylamayı geri alamazsınız."+ one_vote_per_post: "Her gönderi için yalnızca bir kez oy kullanabilirsiniz."+ one_vote_per_comment: "Her yorum için yalnızca bir kez oy kullanabilirsiniz."+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "Gönderi Oylama konusunda olmayan bir gönderiye yorum yapılmasına izin verilmez."+ not_permitted: "İlişkili gönderiye yorum yapılmasına izin verilmez."+ limit_exceeded: "Gönderi başına %{limit} yorum limitine ulaşıldı."+ perform: "Kullanıcıyı susturmaya yetecek kadar yüksek puanla bayrak eklenen Gönderi Oylama Yorumu."+ auto_silence_from_flags: "Bayrak eklenmesi nedeniyle otomatik olarak susturuldu."+ reviewables:+ comment_already_handled: "Teşekkürler, ancak bu yorumu daha önce inceledik ve yeniden bayrak eklenmesine gerek olmadığına karar verdik."+ actions:+ agree_and_keep_comment:+ title: "Yorumu sakla"+ description: "Bayrağı kabul edin ve yorumu değiştirmeyin."+ agree_and_keep_deleted:+ title: "Yorumu Silinmiş hâlde tut"+ description: "Bayrağı kabul edin ve yorumu silinmiş olarak bırakın."+ agree_and_suspend:+ title: "Kullanıcıyı Askıya Al"+ description: "Bayrağı kabul edin ve kullanıcıyı askıya alın."+ agree_and_silence:+ title: "Kullanıcıyı Sustur"+ description: "Bayrağı kabul edin ve kullanıcıyı susturun."+ agree_and_restore:+ title: "Yorumu geri yükle"+ description: "Kullanıcıların görebilmesi için yorumu geri yükleyin."+ agree_and_delete:+ title: "Yorumu sil"+ description: "Kullanıcıların görememesi için yorumu silin."+ delete_and_agree:+ title: "Bayrağı yok say ve yorumu Sil"+ description: "Kuyruktan kaldırarak bayrağı yok sayın ve yorumu silin."+ disagree_and_restore:+ title: "Katılma ve yorumu Geri Yükle"+ description: "Tüm kullanıcıların görebilmesi için yorumu geri yükleyin."+ disagree:+ title: "Katılma"+ ignore:+ title: "Hiçbir şey yapma"+ description: "Herhangi bir işlem yapmadan bayrağı kuyruktan kaldırarak yok say."+ transcript:+ view: "Önceki yorumların dökümünü görüntüle"+ reviewable_score_types:+ needs_review:+ title: "İnceleme Gerekiyor"+ notify_user:+ comment_pm_title: "Gönderi oylama yorumunuz"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "Bir gönderi oylama yorumu, personelin dikkatini gerektiriyor"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.ug.yml b/plugins/discourse-post-voting/config/locales/server.ug.ymlnew file mode 100644index 00000000000..8e65a90fac9--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.ug.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/++ug:+ post_action_types:+ vote:+ title: "بېلەت تاشلاش"+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "توختىتىلغان ئىشلەتكۈچى"+ description: "پاش قىلىشقا قوشۇلىدۇ ۋە ئىشلەتكۈچىنى توختىتىدۇ."+ agree_and_silence:+ title: "ئىشلەتكۈچىنى ئۈنسىزلە"+ description: "پاش قىلىشقا قوشۇلىدۇ ۋە ئىشلەتكۈچىنى ئۈنسىزلەيدۇ."+ disagree:+ title: "قوشۇلما"+ ignore:+ title: "ھېچ ئىش قىلما"+ description: "پاش قىلىشنى ئۆچرەتتىن چىقىرىۋېتىپ پەرۋا قىلماي، ھېچقانداق مەشغۇلات قىلمايدۇ."+ reviewable_score_types:+ needs_review:+ title: "تەستىقلاش كېرەك"+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.uk.yml b/plugins/discourse-post-voting/config/locales/server.uk.ymlnew file mode 100644index 00000000000..a6ca952ebae--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.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:+ post_action_types:+ vote:+ title: "Голосувати"+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Призупинити користувача"+ description: "Погодитися з прапором та призупинити користувача."+ agree_and_silence:+ title: "Заблокувати користувача"+ description: "Погодитися з прапором та заблокувати користувача."+ disagree:+ title: "Відмовити"+ ignore:+ title: "Нічого не робити"+ description: "Ігнорувати прапорець, видаливши його з черги без жодних дій."+ reviewable_score_types:+ needs_review:+ title: "Потребує розгляду"+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}\n"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}\n"diff --git a/plugins/discourse-post-voting/config/locales/server.ur.yml b/plugins/discourse-post-voting/config/locales/server.ur.ymlnew file mode 100644index 00000000000..3d9b82cf3a3--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.ur.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/++ur:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "صارف معطل کریں"+ description: "فلَیگ کے ساتھ اتفاق کریں اور صارف معطل کریں۔"+ agree_and_silence:+ title: "صارف خاموش کریں"+ description: "فلَیگ کے ساتھ اتفاق کریں اور صارف خاموش کریں۔"+ disagree:+ title: "اختلاف کریں"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.vi.yml b/plugins/discourse-post-voting/config/locales/server.vi.ymlnew file mode 100644index 00000000000..4b9420812b3--- /dev/null+++ b/plugins/discourse-post-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:+ post_voting:+ comment:+ reviewables:+ actions:+ agree_and_suspend:+ title: "Tạm ngưng người dùng"+ agree_and_silence:+ title: "Người dùng im lặng"+ disagree:+ title: "Không đồng ý"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.zh_CN.yml b/plugins/discourse-post-voting/config/locales/server.zh_CN.ymlnew file mode 100644index 00000000000..a701da83e06--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.zh_CN.yml@@ -0,0 +1,101 @@+# 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:+ post:+ post_voting:+ errors:+ post_voting_not_enabled: "帖子投票未启用。"+ replying_to_post_not_permited: "您无权创建一篇帖子来回复另一篇帖子。"+ voting_not_permitted: "您无权在此帖子中投票。"+ comment_cannot_be_downvoted: "您只能为评论投赞成票。"+ self_voting_not_permitted: "您无权对自己的帖子或评论进行投票。"+ vote_archived_topic: "您不能对已归档的话题进行投票。"+ vote_closed_topic: "您不能对已关闭的话题进行投票。"+ topic:+ post_voting:+ errors:+ post_voting_not_enabled: "帖子投票未启用。"+ subtype_not_allowed: "“帖子投票”子类型只能与常规话题一起使用。"+ cannot_change_to_post_voting_subtype: "不允许将话题的子类型更改为“帖子投票”。"+ answer_count:+ other: "%{count} 个回答"+ site_settings:+ qa_tags: "用于对话题启用帖子投票的标签"+ post_voting_enabled: "启用帖子投票插件"+ post_voting_enable_likes_on_answers: "在“帖子投票”话题中回复时启用“点赞”按钮"+ post_voting_undo_vote_action_window: "允许用户在“帖子投票”话题中撤消投票的分钟数(0 为不限制)"+ post_voting_comment_limit_per_post: "每篇帖子允许的评论数"+ min_trust_to_flag_posts_voting_comments: "举报帖子投票评论的最低信任级别"+ flag_posts_voting_comments_allowed_groups: "能够举报帖子投票评论的群组"+ keywords:+ flag_posts_voting_comments_allowed_groups: "min_trust_to_flag_posts_voting_comments"+ post_action_types:+ vote:+ title: "投票"+ description: "为此帖子投票"+ short_description: "为此帖子投票"+ long_form: "为此帖子投了票"+ vote:+ error:+ user_has_not_voted: "用户尚未投票。"+ user_over_limit: "您不能超过您的信任级别对应的投票数。"+ already_voted: "您只能为每个问题投一次票。"+ undo_vote_action_window:+ other: "您无法在投票后的 %{count} 分钟后撤消投票。"+ one_vote_per_post: "您只能为每篇帖子投一次票。"+ one_vote_per_comment: "您只能为每条评论投一次票。"+ post_voting:+ comment:+ errors:+ post_voting_not_enabled: "不允许对不在“帖子投票”话题中的帖子发表评论。"+ not_permitted: "不允许对关联帖子发表评论。"+ limit_exceeded: "已达到每篇帖子 %{limit} 条评论的限制。"+ perform: "帖子投票评论举报得分很高,高到足以将用户禁言。"+ auto_silence_from_flags: "由于举报而被自动禁言。"+ reviewables:+ comment_already_handled: "谢谢,但我们已经审核这条评论,并确定不需要再次对其进行举报。"+ actions:+ agree_and_keep_comment:+ title: "保留评论"+ description: "同意举报并保持评论不变。"+ agree_and_keep_deleted:+ title: "保留评论删除状态"+ description: "同意举报并保持评论的删除状态。"+ agree_and_suspend:+ title: "封禁用户"+ description: "同意举报并封禁用户。"+ agree_and_silence:+ title: "将用户禁言"+ description: "同意举报并将用户禁言。"+ agree_and_restore:+ title: "恢复评论"+ description: "恢复评论,以便用户可以看到。"+ agree_and_delete:+ title: "删除评论"+ description: "删除评论,使用户看不到。"+ delete_and_agree:+ title: "忽略举报并删除评论"+ description: "通过从队列中移除来忽略举报并删除评论。"+ disagree_and_restore:+ title: "不同意并恢复评论"+ description: "恢复评论,以便所有用户都可以看到。"+ disagree:+ title: "不同意"+ ignore:+ title: "不进行操作"+ description: "通过从队列中移除来忽略举报,不采取任何措施。"+ transcript:+ view: "查看以前的评论转录文本"+ reviewable_score_types:+ needs_review:+ title: "需要审核"+ notify_user:+ comment_pm_title: "您的帖子投票评论"+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_title: "帖子投票评论需要管理人员注意"+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/locales/server.zh_TW.yml b/plugins/discourse-post-voting/config/locales/server.zh_TW.ymlnew file mode 100644index 00000000000..16e32b9e11e--- /dev/null+++ b/plugins/discourse-post-voting/config/locales/server.zh_TW.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_TW:+ post:+ post_voting:+ errors:+ replying_to_post_not_permited: "您無法建立回覆其他貼文的貼文。"+ voting_not_permitted: "你不被允許對這篇文章投票。"+ comment_cannot_be_downvoted: "您只能在評論投票。"+ self_voting_not_permitted: "您不得對自己的貼文或評論進行投票。"+ topic:+ post_voting:+ answer_count:+ other: "%{count} 個回答"+ post_action_types:+ vote:+ title: "投票"+ description: "為這篇文章投票"+ short_description: "為這篇文章投票"+ long_form: "為這篇文章投票"+ vote:+ error:+ user_has_not_voted: "使用者尚未投票。"+ user_over_limit: "您不能投超過您的信任等級的投票數。"+ already_voted: "每個問題只能投票一次。"+ undo_vote_action_window:+ other: "您無法在投票 %{count} 分鐘過後撤回投票。"+ one_vote_per_post: "您只能替每個貼文投票一次。"+ one_vote_per_comment: "您只能為每條評論投票一次。"+ post_voting:+ comment:+ errors:+ not_permitted: "不允許對相關貼文發表評論。"+ limit_exceeded: "已達到每篇貼文 %{limit} 條評論的限制。"+ reviewables:+ actions:+ agree_and_suspend:+ title: "將使用者停權"+ description: "同意檢舉並停權使用者"+ agree_and_silence:+ title: "將使用者禁言"+ description: "同意檢舉並禁止使用者發文"+ disagree:+ title: "不同意"+ reviewable_score_types:+ notify_user:+ comment_pm_body: "%{link}\n\n%{comment}"+ notify_moderators:+ comment_pm_body: "%{link}\n\n%{comment}"diff --git a/plugins/discourse-post-voting/config/routes.rb b/plugins/discourse-post-voting/config/routes.rbnew file mode 100644index 00000000000..916b31e4ec5--- /dev/null+++ b/plugins/discourse-post-voting/config/routes.rb@@ -0,0 +1,16 @@+# frozen_string_literal: true++PostVoting::Engine.routes.draw do+ resource :vote+ get "voters" => "votes#voters"++ get "comments" => "comments#load_more_comments"+ post "comments" => "comments#create"+ delete "comments" => "comments#destroy"+ put "comments" => "comments#update"+ put "comments/flag" => "comments#flag"+ post "vote/comment" => "votes#create_comment_vote"+ delete "vote/comment" => "votes#destroy_comment_vote"+end++Discourse::Application.routes.append { mount ::PostVoting::Engine, at: "post_voting" }diff --git a/plugins/discourse-post-voting/config/settings.yml b/plugins/discourse-post-voting/config/settings.ymlnew file mode 100644index 00000000000..b1fff3d97ae--- /dev/null+++ b/plugins/discourse-post-voting/config/settings.yml@@ -0,0 +1,28 @@+plugins:+ post_voting_enabled:+ client: true+ default: false+ post_voting_undo_vote_action_window:+ default: 10+ post_voting_comment_limit_per_post:+ default: 10+ min: 1+ client: true+ post_voting_comment_max_raw_length:+ client: true+ hidden: true+ default: 600+ post_voting_enable_likes_on_answers:+ client: true+ default: false+ min_trust_to_flag_posts_voting_comments:+ default: 1+ enum: "TrustLevelSetting"+ client: true+ hidden: true+ flag_posts_voting_comments_allowed_groups:+ default: "11" # auto group trust_level_1+ type: group_list+ allow_any: false+ refresh: true+ validator: "AtLeastOneGroupValidator"diff --git a/plugins/discourse-post-voting/db/migrate/20211020062413_create_question_answer_votes.rb b/plugins/discourse-post-voting/db/migrate/20211020062413_create_question_answer_votes.rbnew file mode 100644index 00000000000..cc02ec54541--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20211020062413_create_question_answer_votes.rb@@ -0,0 +1,20 @@+# frozen_string_literal: true++class CreateQuestionAnswerVotes < ActiveRecord::Migration[6.1]+ def up+ create_table :question_answer_votes do |t|+ t.integer :post_id, null: false+ t.integer :user_id, null: false+ t.datetime :created_at, null: false+ end++ add_index :question_answer_votes, %i[post_id user_id], unique: true++ add_column :posts, :qa_vote_count, :integer, default: 0, null: true+ end++ def down+ drop_table :question_answer_votes+ remove_index :question_answer_votes, %i[post_id user_id]+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20211126031104_add_direction_to_question_answer_votes.rb b/plugins/discourse-post-voting/db/migrate/20211126031104_add_direction_to_question_answer_votes.rbnew file mode 100644index 00000000000..c8ebc826b4e--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20211126031104_add_direction_to_question_answer_votes.rb@@ -0,0 +1,18 @@+# frozen_string_literal: true++class AddDirectionToQuestionAnswerVotes < ActiveRecord::Migration[6.1]+ def up+ add_column :question_answer_votes, :direction, :string++ execute <<~SQL+ UPDATE question_answer_votes+ SET direction = 'up'+ SQL++ change_column_null :question_answer_votes, :direction, false+ end++ def down+ remove_column :question_answer_votes, :direction+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20211208073658_create_question_answer_comments.rb b/plugins/discourse-post-voting/db/migrate/20211208073658_create_question_answer_comments.rbnew file mode 100644index 00000000000..7c840906f95--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20211208073658_create_question_answer_comments.rb@@ -0,0 +1,21 @@+# frozen_string_literal: true++class CreateQuestionAnswerComments < ActiveRecord::Migration[6.1]+ def change+ create_table :question_answer_comments do |t|+ t.integer :post_id, null: false+ t.integer :user_id, null: false+ t.text :raw, null: false+ t.text :cooked, null: false+ t.integer :cooked_version+ t.datetime :deleted_at+ t.integer :deleted_by_id++ t.timestamps+ end++ add_index :question_answer_comments, :post_id+ add_index :question_answer_comments, :user_id+ add_index :question_answer_comments, :deleted_by_id, where: "deleted_by_id IS NOT NULL"+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20220208071734_add_polymorphic_columns_to_question_answer_votes.rb b/plugins/discourse-post-voting/db/migrate/20220208071734_add_polymorphic_columns_to_question_answer_votes.rbnew file mode 100644index 00000000000..e444a54d36e--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20220208071734_add_polymorphic_columns_to_question_answer_votes.rb@@ -0,0 +1,33 @@+# frozen_string_literal: true++class AddPolymorphicColumnsToQuestionAnswerVotes < ActiveRecord::Migration[6.1]+ def up+ add_column :question_answer_votes, :votable_type, :string+ add_column :question_answer_votes, :votable_id, :integer++ execute <<~SQL+ UPDATE question_answer_votes+ SET votable_type = 'Post', votable_id = question_answer_votes.post_id+ SQL++ change_column_null :question_answer_votes, :votable_type, false+ change_column_null :question_answer_votes, :votable_id, false++ begin+ # At this point in time, this plugin has not been publicly released so just dropping it+ Migration::SafeMigrate.disable!+ remove_column :question_answer_votes, :post_id+ ensure+ Migration::SafeMigrate.enable!+ end++ add_index :question_answer_votes,+ %i[votable_type votable_id user_id],+ unique: true,+ name: "idx_votable_user_id"+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20220209070445_add_qa_vote_count_to_question_answer_comments.rb b/plugins/discourse-post-voting/db/migrate/20220209070445_add_qa_vote_count_to_question_answer_comments.rbnew file mode 100644index 00000000000..60a8e8db4b0--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20220209070445_add_qa_vote_count_to_question_answer_comments.rb@@ -0,0 +1,13 @@+# frozen_string_literal: true++class AddQaVoteCountToQuestionAnswerComments < ActiveRecord::Migration[6.1]+ def up+ add_column :question_answer_comments, :qa_vote_count, :integer, default: 0+ execute "ALTER TABLE question_answer_comments ADD CONSTRAINT qa_vote_count_positive CHECK (qa_vote_count >= 0)"+ end++ def down+ execute "ALTER TABLE question_answer_comments DROP CONSTRAINT qa_vote_count_positive"+ remove_column :question_answer_comments, :qa_vote_count+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20221214133921_rename_setting_in_category_custom_field.rb b/plugins/discourse-post-voting/db/migrate/20221214133921_rename_setting_in_category_custom_field.rbnew file mode 100644index 00000000000..13295c309ef--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20221214133921_rename_setting_in_category_custom_field.rb@@ -0,0 +1,19 @@+# frozen_string_literal: true++class RenameSettingInCategoryCustomField < ActiveRecord::Migration[6.1]+ def up+ DB.exec(<<~SQL)+ UPDATE category_custom_fields+ SET name = 'create_as_post_voting_default'+ WHERE name = 'create_as_qa_default'+ SQL+ end++ def down+ DB.exec(<<~SQL)+ UPDATE category_custom_fields+ SET name = 'create_as_qa_default'+ WHERE name = 'create_as_post_voting_default'+ SQL+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20230819193312_rename_qa_site_settings.rb b/plugins/discourse-post-voting/db/migrate/20230819193312_rename_qa_site_settings.rbnew file mode 100644index 00000000000..4f7c5da9282--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20230819193312_rename_qa_site_settings.rb@@ -0,0 +1,21 @@+# frozen_string_literal: true++class RenameQaSiteSettings < ActiveRecord::Migration[7.0]+ def up+ [+ %w[qa_enabled post_voting_enabled],+ %w[qa_undo_vote_action_window post_voting_undo_vote_action_window],+ %w[qa_comment_limit_per_post post_voting_comment_limit_per_post],+ %w[qa_comment_max_raw_length post_voting_comment_max_raw_length],+ %w[qa_enable_likes_on_answers post_voting_enable_likes_on_answers],+ ].each { |old_name, new_name| execute <<~SQL }+ UPDATE site_settings+ SET name = '#{new_name}'+ WHERE name = '#{old_name}'+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20230904155318_rename_question_answer_tables.rb b/plugins/discourse-post-voting/db/migrate/20230904155318_rename_question_answer_tables.rbnew file mode 100644index 00000000000..a1869339ef3--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20230904155318_rename_question_answer_tables.rb@@ -0,0 +1,74 @@+# frozen_string_literal: true++require "migration/table_dropper"++class RenameQuestionAnswerTables < ActiveRecord::Migration[7.0]+ def up+ unless table_exists?(:post_voting_comments)+ Migration::TableDropper.read_only_table(:question_answer_comments)+ execute <<~SQL+ CREATE TABLE post_voting_comments+ (LIKE question_answer_comments INCLUDING ALL);+ SQL++ execute <<~SQL+ INSERT INTO post_voting_comments+ SELECT *+ FROM question_answer_comments+ SQL++ execute <<~SQL+ ALTER SEQUENCE question_answer_comments_id_seq+ RENAME TO post_voting_comments_id_seq+ SQL++ execute <<~SQL+ ALTER SEQUENCE post_voting_comments_id_seq+ OWNED BY post_voting_comments.id+ SQL++ add_index :post_voting_comments, :post_id+ add_index :post_voting_comments, :user_id+ add_index :post_voting_comments, :deleted_by_id, where: "deleted_by_id IS NOT NULL"+ end++ unless table_exists?(:post_voting_votes)+ Migration::TableDropper.read_only_table(:question_answer_votes)+ execute <<~SQL+ CREATE TABLE post_voting_votes+ (LIKE question_answer_votes INCLUDING ALL);+ SQL++ execute <<~SQL+ INSERT INTO post_voting_votes+ SELECT *+ FROM question_answer_votes+ SQL++ execute <<~SQL+ ALTER SEQUENCE question_answer_votes_id_seq+ RENAME TO post_voting_votes_id_seq+ SQL++ execute <<~SQL+ ALTER SEQUENCE post_voting_votes_id_seq+ OWNED BY post_voting_votes.id+ SQL++ execute <<~SQL+ UPDATE post_voting_votes+ SET votable_type = 'PostVotingComment'+ WHERE votable_type = 'QuestionAnswerComment'+ SQL++ add_index :post_voting_votes,+ %i[votable_type votable_id user_id],+ unique: true,+ name: "post_voting_votes_votable_type_and_votable_id_and_user_id_idx"+ end+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20230908045625_drop_question_answer_tables.rb b/plugins/discourse-post-voting/db/migrate/20230908045625_drop_question_answer_tables.rbnew file mode 100644index 00000000000..286fa0d431b--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20230908045625_drop_question_answer_tables.rb@@ -0,0 +1,19 @@+# frozen_string_literal: true++require "migration/table_dropper"++class DropQuestionAnswerTables < ActiveRecord::Migration[7.0]+ def up+ if table_exists?(:question_answer_votes)+ Migration::TableDropper.execute_drop(:question_answer_votes)+ end++ if table_exists?(:question_answer_comments)+ Migration::TableDropper.execute_drop(:question_answer_comments)+ end+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20231218171020_add_post_voting_comment_custom_fields.rb b/plugins/discourse-post-voting/db/migrate/20231218171020_add_post_voting_comment_custom_fields.rbnew file mode 100644index 00000000000..b7065e35e49--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20231218171020_add_post_voting_comment_custom_fields.rb@@ -0,0 +1,16 @@+# frozen_string_literal: true++class AddPostVotingCommentCustomFields < ActiveRecord::Migration[7.0]+ def change+ create_table :post_voting_comment_custom_fields do |t|+ t.integer :post_voting_comment_id, null: false+ t.string :name, limit: 256, null: false+ t.text :value+ t.timestamps null: false+ end++ add_index :post_voting_comment_custom_fields,+ %i[post_voting_comment_id name],+ name: :idx_post_voting_comment_custom_fields+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20231220042344_add_last_editor_to_post_voting_messages.rb b/plugins/discourse-post-voting/db/migrate/20231220042344_add_last_editor_to_post_voting_messages.rbnew file mode 100644index 00000000000..85e467609d9--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20231220042344_add_last_editor_to_post_voting_messages.rb@@ -0,0 +1,8 @@+# frozen_string_literal: true++class AddLastEditorToPostVotingMessages < ActiveRecord::Migration[7.0]+ def change+ add_column :post_voting_comments, :last_editor_id, :integer+ add_index :post_voting_comments, :last_editor_id+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20231220043117_make_post_voting_comment_last_editor_ids_not_null.rb b/plugins/discourse-post-voting/db/migrate/20231220043117_make_post_voting_comment_last_editor_ids_not_null.rbnew file mode 100644index 00000000000..c55ef80620b--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20231220043117_make_post_voting_comment_last_editor_ids_not_null.rb@@ -0,0 +1,9 @@+# frozen_string_literal: true++class MakePostVotingCommentLastEditorIdsNotNull < ActiveRecord::Migration[7.0]+ def change+ DB.exec("UPDATE post_voting_comments SET last_editor_id = user_id")++ change_column_null :post_voting_comments, :last_editor_id, false+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20240122015930_fill_flag_post_voting_comments_allowed_groups_based_on_deprecated_setting.rb b/plugins/discourse-post-voting/db/migrate/20240122015930_fill_flag_post_voting_comments_allowed_groups_based_on_deprecated_setting.rbnew file mode 100644index 00000000000..c6629a98a07--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20240122015930_fill_flag_post_voting_comments_allowed_groups_based_on_deprecated_setting.rb@@ -0,0 +1,24 @@+# frozen_string_literal: true++class FillFlagPostVotingCommentsAllowedGroupsBasedOnDeprecatedSetting < ActiveRecord::Migration[7.0]+ def up+ old_setting_trust_level =+ DB.query_single(+ "SELECT value FROM site_settings WHERE name = 'min_trust_to_flag_posts_voting_comments' LIMIT 1",+ ).first++ if old_setting_trust_level.present?+ allowed_groups = "1#{old_setting_trust_level}"++ DB.exec(+ "INSERT INTO site_settings(name, value, data_type, created_at, updated_at)+ VALUES('flag_posts_voting_comments_allowed_groups', :setting, '20', NOW(), NOW())",+ setting: allowed_groups,+ )+ end+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-post-voting/db/migrate/20241025132600_alter_post_voting_ids_to_bigint.rb b/plugins/discourse-post-voting/db/migrate/20241025132600_alter_post_voting_ids_to_bigint.rbnew file mode 100644index 00000000000..a06bcb60c70--- /dev/null+++ b/plugins/discourse-post-voting/db/migrate/20241025132600_alter_post_voting_ids_to_bigint.rb@@ -0,0 +1,12 @@+# frozen_string_literal: true++class AlterPostVotingIdsToBigint < ActiveRecord::Migration[7.1]+ def up+ change_column :post_voting_comment_custom_fields, :post_voting_comment_id, :bigint+ change_column :post_voting_votes, :votable_id, :bigint+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/plugins/discourse-post-voting/extensions/post_extension.rb b/plugins/discourse-post-voting/extensions/post_extension.rbnew file mode 100644index 00000000000..ed135807aef--- /dev/null+++ b/plugins/discourse-post-voting/extensions/post_extension.rb@@ -0,0 +1,43 @@+# frozen_string_literal: true++module PostVoting+ module PostExtension+ def self.included(base)+ base.ignored_columns = %w[vote_count]++ base.has_many :post_voting_votes, as: :votable, dependent: :delete_all+ base.has_many :post_voting_comments, dependent: :destroy+ base.validate :ensure_only_replies+ end++ def is_post_voting_topic?+ topic.is_post_voting?+ end++ def post_voting_last_voted(user_id)+ PostVotingVote+ .where(votable: self, user_id: user_id)+ .order(created_at: :desc)+ .pick(:created_at)+ end++ def post_voting_can_vote(user_id, direction = nil)+ direction ||= PostVotingVote.directions[:up]+ !PostVotingVote.exists?(votable: self, user_id: user_id, direction: direction)+ end++ def comments+ topic.posts.where(reply_to_post_number: self.post_number).order("post_number ASC")+ end++ private++ def ensure_only_replies+ return unless SiteSetting.post_voting_enabled+ if will_save_change_to_reply_to_post_number? && reply_to_post_number &&+ reply_to_post_number != 1 && is_post_voting_topic?+ errors.add(:base, I18n.t("post.post_voting.errors.replying_to_post_not_permited"))+ end+ end+ end+enddiff --git a/plugins/discourse-post-voting/extensions/post_serializer_extension.rb b/plugins/discourse-post-voting/extensions/post_serializer_extension.rbnew file mode 100644index 00000000000..2a56c40ec09--- /dev/null+++ b/plugins/discourse-post-voting/extensions/post_serializer_extension.rb@@ -0,0 +1,67 @@+# frozen_string_literal: true++module PostVoting+ module PostSerializerExtension+ def self.included(base)+ base.attributes(+ :post_voting_vote_count,+ :post_voting_user_voted_direction,+ :post_voting_has_votes,+ :comments,+ :comments_count,+ )+ end++ def post_voting_vote_count+ object.qa_vote_count+ end++ def include_post_voting_vote_count?+ object.is_post_voting_topic?+ end++ def comments+ return [] if !@topic_view++ (@topic_view.comments[object.id] || []).map do |comment|+ serializer = PostVotingCommentSerializer.new(comment, scope: scope, root: false)+ serializer.comments_user_voted = @topic_view.comments_user_voted+ serializer.as_json+ end+ end++ def include_comments?+ object.is_post_voting_topic?+ end++ def comments_count+ @topic_view&.comments_counts&.dig(object.id) || 0+ end++ def include_comments_count?+ object.is_post_voting_topic?+ end++ def post_voting_user_voted_direction+ @topic_view.posts_user_voted[object.id]+ end++ def include_post_voting_user_voted_direction?+ @topic_view && object.is_post_voting_topic? && @topic_view.posts_user_voted.present?+ end++ def post_voting_has_votes+ !!@topic_view&.posts_voted_on&.include?(object.id)+ end++ def include_post_voting_has_votes?+ object.is_post_voting_topic?+ end++ private++ def topic+ @topic_view ? @topic_view.topic : object.topic+ end+ end+enddiff --git a/plugins/discourse-post-voting/extensions/topic_extension.rb b/plugins/discourse-post-voting/extensions/topic_extension.rbnew file mode 100644index 00000000000..9c0f97b91e4--- /dev/null+++ b/plugins/discourse-post-voting/extensions/topic_extension.rb@@ -0,0 +1,105 @@+# frozen_string_literal: true++module PostVoting+ module TopicExtension+ def self.included(base)+ base.extend(ClassMethods)+ base.validate :ensure_regular_topic, on: [:create]+ base.validate :ensure_no_post_voting_subtype, on: [:update]+ base.const_set :POST_VOTING_SUBTYPE, "question_answer"+ end++ def reload(options = nil)+ @answers = nil+ @comments = nil+ @last_answerer = nil+ @is_post_voting = nil+ super(options)+ end++ def answers+ @answers ||=+ begin+ posts.where(reply_to_post_number: nil).where.not(post_number: 1).order(post_number: :asc)+ end+ end++ def answer_count+ answers.count+ end++ def last_answered_at+ return if answers.blank?++ answers.last[:created_at]+ end++ def comments+ @comments ||=+ begin+ PostVotingComment+ .joins(:post)+ .where("posts.topic_id = ?", self.id)+ .order(created_at: :asc)+ end+ end++ def last_commented_on+ return if comments.blank?++ comments.last.created_at+ end++ def last_answer_post_number+ return if answers.none?++ answers.last.post_number+ end++ def last_answerer+ return if answers.none?++ @last_answerer ||= User.find(answers.last[:user_id])+ end++ def is_post_voting?+ @is_post_voting ||=+ SiteSetting.post_voting_enabled && self.subtype == Topic::POST_VOTING_SUBTYPE+ end++ # class methods+ module ClassMethods+ def post_voting_votes(topic, user)+ return nil if !user || !SiteSetting.post_voting_enabled++ # This is a very inefficient way since the performance degrades as the+ # number of voted posts in the topic increases.+ PostVotingVote+ .joins("INNER JOIN posts ON posts.id = post_voting_votes.votable_id")+ .where(user: user, votable_type: "Post")+ .where("posts.topic_id = ?", topic.id)+ end+ end++ private++ def ensure_no_post_voting_subtype+ if will_save_change_to_subtype? && self.subtype == Topic::POST_VOTING_SUBTYPE+ self.errors.add(+ :base,+ I18n.t("topic.post_voting.errors.cannot_change_to_post_voting_subtype"),+ )+ end+ end++ def ensure_regular_topic+ return if self.subtype != Topic::POST_VOTING_SUBTYPE++ if !SiteSetting.post_voting_enabled+ self.errors.add(:base, I18n.t("topic.post_voting.errors.post_voting_not_enabled"))+ elsif self.archetype != Archetype.default+ self.errors.add(:base, I18n.t("topic.post_voting.errors.subtype_not_allowed"))+ end+ end+ end+enddiff --git a/plugins/discourse-post-voting/extensions/topic_list_item_serializer_extension.rb b/plugins/discourse-post-voting/extensions/topic_list_item_serializer_extension.rbnew file mode 100644index 00000000000..9efcae2df03--- /dev/null+++ b/plugins/discourse-post-voting/extensions/topic_list_item_serializer_extension.rb@@ -0,0 +1,17 @@+# frozen_string_literal: true++module PostVoting+ module TopicListItemSerializerExtension+ def self.included(base)+ base.attributes :is_post_voting+ end++ def is_post_voting+ object.is_post_voting?+ end++ def include_is_post_voting?+ object.is_post_voting?+ end+ end+enddiff --git a/plugins/discourse-post-voting/extensions/topic_view_extension.rb b/plugins/discourse-post-voting/extensions/topic_view_extension.rbnew file mode 100644index 00000000000..7766e57213e--- /dev/null+++ b/plugins/discourse-post-voting/extensions/topic_view_extension.rb@@ -0,0 +1,100 @@+# frozen_string_literal: true++module PostVoting+ module TopicViewExtension+ def self.prepended(base)+ base.attr_accessor(+ :comments,+ :comments_counts,+ :posts_user_voted,+ :comments_user_voted,+ :posts_voted_on,+ )++ base.const_set :PRELOAD_COMMENTS_COUNT, 5 unless base.const_defined?(:PRELOAD_COMMENTS_COUNT)++ if !base.const_defined?(:ACTIVITY_FILTER)+ # Change ORDER_BY_ACTIVITY_FILTER on the client side when the value here is changed+ base.const_set :ACTIVITY_FILTER, "activity"+ end+ end++ # Monkey patch core's method. In an ideal world, we wouldn't have to do this here but `TopicView` in core does not+ # yet properly support ordering posts in any other order except by `Post#sort_order` and several methods in+ # core's `TopicView` is strongly tied to the assumption that posts are always ordered by `Post#sort_order`. Fixing+ # core is hard and risky so we will just carry this monkey patch instead. There is also a small performance tradeoff+ # here in the following implementation. In PostgreSQL, we basically have to scan for every single posts in order+ # to figure out what the "row_number" for each post. From there, we can then properly fetch the window of posts+ # near a given post number.+ def filter_posts_near(post_number)+ return super if !post_voting_topic?++ post_number = 1 if post_number == 0++ cte_query = <<~SQL+ WITH rows AS (+ WITH posts AS (+ #{@filtered_posts.to_sql}+ )+ SELECT+ id,+ post_number,+ ROW_NUMBER() OVER () AS row_number+ FROM posts+ )+ SQL++ row_number, max_row_number = DB.query_single(<<~SQL)+ #{cte_query}+ SELECT+ row_number,+ (SELECT row_number FROM rows ORDER BY row_number DESC LIMIT 1) AS max_row_number+ FROM rows+ WHERE rows.post_number = #{post_number.to_i}+ SQL++ row_number = 1 if row_number.blank? # Post number does not exist so load from first post.++ posts_before = (@limit.to_f / 4).floor+ posts_before = 1 if posts_before.zero?+ posts_after = @limit - posts_before - 1++ range =+ # Lower boundary window+ if (row_number - posts_before) <= 0+ 1..(@limit - (row_number - 1))+ # Upper boundary window+ elsif (max_row_number - row_number) < posts_after+ (max_row_number - @limit + 1)..max_row_number+ # Any other window in between.+ else+ (row_number - posts_before)..(row_number + posts_after)+ end++ post_ids = DB.query_single(<<~SQL)+ #{cte_query}+ SELECT+ id+ FROM rows+ WHERE rows.row_number IN (#{range.to_a.join(",")})+ SQL++ filter_posts_by_ids(post_ids)+ end++ def next_page+ return super if !post_voting_topic?++ @highest_post_number = @filtered_posts.last.post_number++ @next_page ||=+ if last_post && @highest_post_number && (@highest_post_number != last_post.post_number)+ @page + 1+ end+ end++ def post_voting_topic?+ topic.is_post_voting? && @filter != TopicView::ACTIVITY_FILTER+ end+ end+enddiff --git a/plugins/discourse-post-voting/extensions/topic_view_serializer_extension.rb b/plugins/discourse-post-voting/extensions/topic_view_serializer_extension.rbnew file mode 100644index 00000000000..de6b85277d8--- /dev/null+++ b/plugins/discourse-post-voting/extensions/topic_view_serializer_extension.rb@@ -0,0 +1,64 @@+# frozen_string_literal: true++module PostVoting+ module TopicViewSerializerExtension+ def self.included(base)+ base.attributes(+ :is_post_voting,+ :last_answered_at,+ :last_commented_on,+ :answer_count,+ :last_answer_post_number,+ :last_answerer,+ )+ end++ def is_post_voting+ true+ end++ def include_is_post_voting?+ object.topic.is_post_voting?+ end++ def last_answered_at+ object.topic.last_answered_at+ end++ def include_last_answered_at?+ object.topic.is_post_voting?+ end++ def last_commented_on+ object.topic.last_commented_on+ end++ def include_last_commented_on?+ object.topic.is_post_voting?+ end++ def answer_count+ object.topic.answer_count+ end++ def include_answer_count?+ object.topic.is_post_voting?+ end++ def last_answer_post_number+ object.topic.last_answer_post_number+ end++ def include_last_answer_post_number?+ object.topic.is_post_voting?+ end++ def last_answerer+ BasicUserSerializer.new(object.topic.last_answerer, scope: scope, root: false).as_json+ end++ def include_last_answerer?+ object.topic.is_post_voting?+ end+ end+enddiff --git a/plugins/discourse-post-voting/extensions/user_extension.rb b/plugins/discourse-post-voting/extensions/user_extension.rbnew file mode 100644index 00000000000..68704f84241--- /dev/null+++ b/plugins/discourse-post-voting/extensions/user_extension.rb@@ -0,0 +1,9 @@+# frozen_string_literal: true++module PostVoting+ module UserExtension+ def self.included(base)+ base.has_many :post_voting_votes+ end+ end+enddiff --git a/plugins/discourse-post-voting/lib/post_voting/comment_creator.rb b/plugins/discourse-post-voting/lib/post_voting/comment_creator.rbnew file mode 100644index 00000000000..8da6bc71dc5--- /dev/null+++ b/plugins/discourse-post-voting/lib/post_voting/comment_creator.rb@@ -0,0 +1,61 @@+# frozen_string_literal: true++module PostVoting+ class CommentCreator+ def self.create(attributes)+ comment = PostVotingComment.new(attributes)++ ActiveRecord::Base.transaction do+ if comment.save+ create_commented_notification(comment)++ DB.after_commit { publish_changes(comment) }+ end+ end++ comment+ end++ def self.publish_changes(comment)+ Scheduler::Defer.later "Publish new post voting comment" do+ comment.post.publish_change_to_clients!(+ :post_voting_post_commented,+ comment:+ PostVotingCommentSerializer.new(+ comment,+ { scope: anonymous_guardian, root: false },+ ).as_json,+ comments_count: PostVotingComment.where(post_id: comment.post_id).count,+ )+ end+ end++ def self.create_commented_notification(comment)+ return if comment.user_id == comment.post.user_id++ Notification.create!(+ notification_type: Notification.types[:question_answer_user_commented],+ user_id: comment.post.user_id,+ post_number: comment.post.post_number,+ topic_id: comment.post.topic_id,+ data: {+ post_voting_comment_id: comment.id,+ display_username: comment.user.username,+ }.to_json,+ )++ PostAlerter.create_notification_alert(+ user: comment.post.user,+ post: comment.post,+ notification_type: Notification.types[:question_answer_user_commented],+ username: comment.user.username,+ )+ end++ private++ def self.anonymous_guardian+ Guardian.new(nil)+ end+ end+enddiff --git a/plugins/discourse-post-voting/lib/post_voting/comment_review_queue.rb b/plugins/discourse-post-voting/lib/post_voting/comment_review_queue.rbnew file mode 100644index 00000000000..a059c8e479d--- /dev/null+++ b/plugins/discourse-post-voting/lib/post_voting/comment_review_queue.rb@@ -0,0 +1,151 @@+# frozen_string_literal: true+module PostVoting+ class CommentReviewQueue+ def flag_comment(comment, guardian, flag_type_id, opts = {})+ result = { success: false, errors: [] }+ is_notify_user_type = ReviewableScore.types.slice(:notify_user).values.include?(flag_type_id)+ is_notify_moderators_type =+ ReviewableScore.types.slice(:notify_moderators).values.include?(flag_type_id)+ is_notify_type = is_notify_user_type || is_notify_moderators_type++ guardian.ensure_can_flag_post_voting_comment!(comment)+ guardian.ensure_can_flag_post_voting_comment_as!(comment, flag_type_id, opts)++ existing_reviewable = Reviewable.includes(:reviewable_scores).find_by(target: comment)++ if !can_flag_again?(existing_reviewable, comment, guardian.user, flag_type_id)+ result[:errors] << I18n.t("post_voting.reviewables.comment_already_handled")+ return result+ end++ payload = { comment_cooked: comment.cooked }++ if opts[:comment].present? && is_notify_type+ creator = companion_pm_creator(comment, guardian.user, flag_type_id, opts)+ post = creator.create++ if creator.errors.present?+ creator.errors.full_messages.each { |msg| result[:errors] << msg }+ return result+ end+ end++ queued_for_review = !!ActiveRecord::Type::Boolean.new.deserialize(opts[:queue_for_review])++ if !is_notify_user_type+ reviewable =+ ReviewablePostVotingComment.needs_review!(+ created_by: guardian.user,+ target: comment,+ reviewable_by_moderator: true,+ potential_spam: flag_type_id == ReviewableScore.types[:spam],+ topic: comment.post.topic,+ payload: payload,+ )+ reviewable.update(target_created_by: comment.user)+ score =+ reviewable.add_score(+ guardian.user,+ flag_type_id,+ meta_topic_id: post&.topic_id,+ take_action: opts[:take_action],+ reason: queued_for_review ? "post_voting_comment_queued_by_staff" : nil,+ force_review: queued_for_review,+ )++ if opts[:take_action]+ reviewable.perform(guardian.user, :agree_and_delete)+ else+ enforce_auto_silence_threshold(reviewable)+ end+ end++ result.tap do |r|+ r[:success] = true+ r[:reviewable] = reviewable if !is_notify_user_type+ end+ end++ private++ def enforce_auto_silence_threshold(reviewable)+ auto_silence_duration = SiteSetting.chat_auto_silence_from_flags_duration+ return if auto_silence_duration.zero?+ return if reviewable.score <= Chat::ReviewableMessage.score_to_silence_user++ user = reviewable.target_created_by+ return unless user+ return if user.admin?+ return if user.silenced?++ UserSilencer.silence(+ user,+ Discourse.system_user,+ silenced_till: auto_silence_duration.minutes.from_now,+ reason: I18n.t("post_voting.comment.errors.auto_silence_from_flags"),+ )+ end++ def companion_pm_creator(comment, flagger, flag_type_id, opts)+ notifying_user = flag_type_id == ReviewableScore.types[:notify_user]++ i18n_key = notifying_user ? "notify_user" : "notify_moderators"++ title =+ I18n.t(+ "post_voting.comment.reviewable_score_types.#{i18n_key}.comment_pm_title",+ locale: SiteSetting.default_locale,+ )++ body =+ I18n.t(+ "post_voting.comment.reviewable_score_types.#{i18n_key}.comment_pm_body",+ comment: opts[:comment],+ link: comment.full_url,+ locale: SiteSetting.default_locale,+ )++ create_args = {+ archetype: Archetype.private_message,+ title: title.truncate(SiteSetting.max_topic_title_length, separator: /\s/),+ raw: body,+ }++ if notifying_user+ create_args[:subtype] = TopicSubtype.notify_user+ create_args[:target_usernames] = comment.user.username++ create_args[:is_warning] = opts[:is_warning] if flagger.staff?+ else+ create_args[:subtype] = TopicSubtype.notify_moderators+ create_args[:target_group_names] = [Group[:moderators].name]+ end++ PostCreator.new(flagger, create_args)+ end++ def can_flag_again?(reviewable, comment, flagger, flag_type_id)+ return true if reviewable.blank?++ flagger_has_pending_flags =+ reviewable.reviewable_scores.any? { |rs| rs.user == flagger && rs.pending? }++ if !flagger_has_pending_flags && flag_type_id == ReviewableScore.types[:notify_moderators]+ return true+ end++ flag_used =+ reviewable.reviewable_scores.any? do |rs|+ rs.reviewable_score_type == flag_type_id && rs.pending?+ end+ handled_recently =+ !(+ reviewable.pending? ||+ reviewable.updated_at < SiteSetting.cooldown_hours_until_reflag.to_i.hours.ago+ )+ edited_since_last_review = comment && comment.updated_at > reviewable.updated_at++ !flag_used && !flagger_has_pending_flags && (!handled_recently || edited_since_last_review)+ end+ end+enddiff --git a/plugins/discourse-post-voting/lib/post_voting/engine.rb b/plugins/discourse-post-voting/lib/post_voting/engine.rbnew file mode 100644index 00000000000..93fe9f68ffc--- /dev/null+++ b/plugins/discourse-post-voting/lib/post_voting/engine.rb@@ -0,0 +1,11 @@+# frozen_string_literal: true++module ::PostVoting+ CREATE_AS_POST_VOTING_DEFAULT = "create_as_post_voting_default"+ ONLY_POST_VOTING_IN_THIS_CATEGORY = "only_post_voting_in_this_category"++ class Engine < Rails::Engine+ engine_name "post_voting"+ isolate_namespace PostVoting+ end+enddiff --git a/plugins/discourse-post-voting/lib/post_voting/guardian_extension.rb b/plugins/discourse-post-voting/lib/post_voting/guardian_extension.rbnew file mode 100644index 00000000000..36d61339cf0--- /dev/null+++ b/plugins/discourse-post-voting/lib/post_voting/guardian_extension.rb@@ -0,0 +1,44 @@+# frozen_string_literal: true++module PostVoting+ module GuardianExtension+ def can_edit_comment?(comment)+ return false if !self.user+ return true if comment.user_id == self.user.id+ return true if self.is_admin?+ return true if self.is_moderator?+ false+ end++ def can_delete_comment?(comment)+ can_edit_comment?(comment)+ end++ def can_flag_post_voting_comments?+ return false if self.user.silenced?+ return true if self.user.staff?++ self.user.in_any_groups?(SiteSetting.flag_posts_voting_comments_allowed_groups_map)+ end++ def can_flag_post_voting_comment?(comment)+ return false if !authenticated? || !comment || comment.trashed? || !comment.user+ return false if comment.user.staff? && !SiteSetting.allow_flagging_staff+ return false if comment.user_id == @user.id++ can_flag_post_voting_comments?+ end++ def can_flag_post_voting_comment_as?(comment, flag_type_id, opts)+ return false if !is_staff? && (opts[:take_action] || opts[:queue_for_review])++ if flag_type_id == ReviewableScore.types[:notify_user]+ is_warning = ActiveRecord::Type::Boolean.new.deserialize(opts[:is_warning])++ return false if is_warning && !is_staff?+ end++ true+ end+ end+enddiff --git a/plugins/discourse-post-voting/lib/post_voting/vote_manager.rb b/plugins/discourse-post-voting/lib/post_voting/vote_manager.rbnew file mode 100644index 00000000000..1e446b842d4--- /dev/null+++ b/plugins/discourse-post-voting/lib/post_voting/vote_manager.rb@@ -0,0 +1,105 @@+# frozen_string_literal: true++module PostVoting+ class VoteManager+ def self.vote(obj, user, direction: nil)+ direction ||= PostVotingVote.directions[:up]++ ActiveRecord::Base.transaction do+ existing_vote =+ PostVotingVote.find_by(+ user: user,+ votable: obj,+ direction: PostVotingVote.reverse_direction(direction),+ )++ count_change =+ if existing_vote+ PostVotingVote.directions[:up] == direction ? 2 : -2+ else+ PostVotingVote.directions[:up] == direction ? 1 : -1+ end++ existing_vote.destroy! if existing_vote++ vote = PostVotingVote.create!(user: user, votable: obj, direction: direction)++ vote_count = (obj.qa_vote_count || 0) + count_change++ obj.update!(qa_vote_count: vote_count)++ DB.after_commit { publish_changes(obj, user, vote_count, direction) }++ vote+ end+ end++ def self.remove_vote(obj, user)+ ActiveRecord::Base.transaction do+ vote = PostVotingVote.find_by(votable: obj, user: user)+ direction = vote.direction+ vote.destroy!+ count_change = PostVotingVote.directions[:up] == direction ? -1 : 1+ vote_count = obj.qa_vote_count + count_change+ obj.update!(qa_vote_count: vote_count)++ DB.after_commit { publish_changes(obj, user, vote_count, nil) }+ end+ end++ def self.can_undo(post, user)+ return true if post.post_voting_last_voted(user.id).blank?+ window = SiteSetting.post_voting_undo_vote_action_window.to_i+ window.zero? || post.post_voting_last_voted(user.id).to_i > window.minutes.ago.to_i+ end++ def self.publish_changes(obj, user, vote_count, direction)+ if obj.is_a?(Post)+ obj.publish_change_to_clients!(+ :post_voting_post_voted,+ post_voting_user_voted_id: user.id,+ post_voting_vote_count: vote_count,+ post_voting_user_voted_direction: direction,+ post_voting_has_votes: PostVotingVote.exists?(votable: obj),+ )+ end+ end++ def self.bulk_remove_votes_by(user)+ ActiveRecord::Base.transaction do+ PostVotingVote::VOTABLE_TYPES.map do |votable_type|+ table_name = votable_type.tableize++ DB.exec(+ <<~SQL,+ UPDATE #{table_name}+ SET qa_vote_count = qa_vote_count - (+ SELECT CASE+ WHEN direction = :up THEN 1+ WHEN direction = :down THEN -1+ ELSE 0+ END+ FROM post_voting_votes+ WHERE post_voting_votes.votable_id = #{table_name}.id+ AND post_voting_votes.votable_type = '#{votable_type}'+ AND post_voting_votes.user_id = :user_id+ )+ WHERE EXISTS (+ SELECT 1+ FROM post_voting_votes+ WHERE post_voting_votes.votable_id = #{table_name}.id+ AND post_voting_votes.votable_type = '#{votable_type}'+ AND post_voting_votes.user_id = :user_id+ );+ SQL+ user_id: user.id,+ up: PostVotingVote.directions[:up],+ down: PostVotingVote.directions[:down],+ )+ end++ PostVotingVote.where(user_id: user.id).delete_all+ end+ end+ end+enddiff --git a/plugins/discourse-post-voting/plugin.rb b/plugins/discourse-post-voting/plugin.rbnew file mode 100644index 00000000000..7ad8413e2cb--- /dev/null+++ b/plugins/discourse-post-voting/plugin.rb@@ -0,0 +1,258 @@+# frozen_string_literal: true++# name: discourse-post-voting+# about: Allows the creation of topics with votable posts.+# meta_topic_id: 227808+# version: 0.0.1+# authors: Alan Tan+# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-post-voting++%i[common mobile desktop].each do |type|+ register_asset "stylesheets/#{type}/post-voting.scss", type+end+register_asset "stylesheets/common/post-voting-crawler.scss"++enabled_site_setting :post_voting_enabled++module ::PostVoting+ PLUGIN_NAME = "discourse-post-voting"+end++after_initialize do+ require_relative "lib/post_voting/engine"+ require_relative "lib/post_voting/vote_manager"+ require_relative "lib/post_voting/guardian_extension"+ require_relative "lib/post_voting/comment_creator"+ require_relative "lib/post_voting/comment_review_queue"+ require_relative "extensions/post_extension"+ require_relative "extensions/post_serializer_extension"+ require_relative "extensions/topic_extension"+ require_relative "extensions/topic_list_item_serializer_extension"+ require_relative "extensions/topic_view_serializer_extension"+ require_relative "extensions/topic_view_extension"+ require_relative "extensions/user_extension"+ require_relative "app/validators/post_voting_comment_validator"+ require_relative "app/controllers/post_voting/votes_controller"+ require_relative "app/controllers/post_voting/comments_controller"+ require_relative "app/models/post_voting_vote"+ require_relative "app/models/post_voting_comment"+ require_relative "app/models/post_voting_comment_custom_field"+ require_relative "app/models/reviewable_post_voting_comment"+ require_relative "app/serializers/basic_voter_serializer"+ require_relative "app/serializers/post_voting_comment_serializer"+ require_relative "app/serializers/reviewable_post_voting_comments_serializer"+ require_relative "config/routes"++ if respond_to?(:register_svg_icon)+ register_svg_icon "angle-up"+ register_svg_icon "info"+ end++ register_post_custom_field_type("vote_history", :json)+ register_post_custom_field_type("vote_count", :integer)++ register_reviewable_type ReviewablePostVotingComment++ reloadable_patch do+ Post.include(PostVoting::PostExtension)+ Topic.include(PostVoting::TopicExtension)+ PostSerializer.include(PostVoting::PostSerializerExtension)+ TopicView.prepend(PostVoting::TopicViewExtension)+ TopicViewSerializer.include(PostVoting::TopicViewSerializerExtension)+ TopicListItemSerializer.include(PostVoting::TopicListItemSerializerExtension)+ User.include(PostVoting::UserExtension)+ Guardian.prepend(PostVoting::GuardianExtension)+ end++ # TODO: Performance of the query degrades as the number of posts a user has voted+ # on increases. We should probably keep a counter cache in the user's+ # custom fields.+ add_to_class(:user, :vote_count) { Post.where(user_id: self.id).sum(:qa_vote_count) }++ add_to_serializer(:user_card, :vote_count) { object.vote_count }++ add_to_class(:topic_view, :user_voted_posts) do |user|+ @user_voted_posts ||= {}++ @user_voted_posts[user.id] ||= begin+ PostVotingVote.where(user: user, post: @posts).distinct.pluck(:post_id)+ end+ end++ add_to_class(:topic_view, :user_voted_posts_last_timestamp) do |user|+ @user_voted_posts_last_timestamp ||= {}++ @user_voted_posts_last_timestamp[user.id] ||= begin+ PostVotingVote+ .where(user: user, post: @posts)+ .group(:votable_id, :created_at)+ .pluck(:votable_id, :created_at)+ end+ end++ TopicView.apply_custom_default_scope do |scope, topic_view|+ if topic_view.topic.is_post_voting? &&+ !topic_view.instance_variable_get(:@replies_to_post_number) &&+ !topic_view.instance_variable_get(:@post_ids)+ scope = scope.where(reply_to_post_number: nil)++ if topic_view.instance_variable_get(:@filter) != TopicView::ACTIVITY_FILTER+ scope =+ scope+ .where.not(post_type: [Post.types[:whisper], Post.types[:small_action]])+ .unscope(:order)+ .order("CASE post_number WHEN 1 THEN 0 ELSE 1 END, qa_vote_count DESC, post_number ASC")+ end++ scope+ else+ scope+ end+ end++ TopicView.on_preload do |topic_view|+ next if !topic_view.topic.is_post_voting?++ post_ids = topic_view.posts.pluck(:id)+ next if post_ids.blank?++ post_ids_sql = post_ids.join(",")++ comment_ids_sql = <<~SQL+ SELECT+ post_voting_comments.id+ FROM post_voting_comments+ INNER JOIN LATERAL (+ SELECT 1+ FROM (+ SELECT+ comments.id+ FROM post_voting_comments comments+ WHERE comments.post_id = post_voting_comments.post_id+ AND comments.deleted_at IS NULL+ ORDER BY comments.id ASC+ LIMIT #{TopicView::PRELOAD_COMMENTS_COUNT}+ ) X+ WHERE X.id = post_voting_comments.id+ ) Y ON true+ WHERE post_voting_comments.post_id IN (#{post_ids_sql})+ AND post_voting_comments.deleted_at IS NULL+ SQL++ topic_view.comments = {}+ PostVotingComment+ .includes(:user)+ .where("id IN (#{comment_ids_sql})")+ .order(id: :asc)+ .each do |comment|+ topic_view.comments[comment.post_id] ||= []+ topic_view.comments[comment.post_id] << comment+ end++ topic_view.comments_counts = PostVotingComment.where(post_id: post_ids).group(:post_id).count++ topic_view.posts_user_voted = {}+ topic_view.comments_user_voted = {}++ if topic_view.guardian.user+ PostVotingVote+ .where(user: topic_view.guardian.user, votable_type: "Post", votable_id: post_ids)+ .pluck(:votable_id, :direction)+ .each { |post_id, direction| topic_view.posts_user_voted[post_id] = direction }++ PostVotingVote+ .joins(+ "INNER JOIN post_voting_comments comments ON comments.id = post_voting_votes.votable_id",+ )+ .where(user: topic_view.guardian.user, votable_type: "PostVotingComment")+ .where("comments.post_id IN (?)", post_ids)+ .pluck(:votable_id)+ .each { |votable_id| topic_view.comments_user_voted[votable_id] = true }+ end++ topic_view.posts_voted_on =+ PostVotingVote.where(votable_type: "Post", votable_id: post_ids).distinct.pluck(:votable_id)+ end++ add_permitted_post_create_param(:create_as_post_voting)++ # TODO: Core should be exposing the following as proper plugin interfaces.+ NewPostManager.add_plugin_payload_attribute(:subtype)+ TopicSubtype.register(Topic::POST_VOTING_SUBTYPE)++ NewPostManager.add_handler do |manager|+ if !manager.args[:topic_id] && manager.args[:create_as_post_voting] == "true" &&+ (manager.args[:archetype].blank? || manager.args[:archetype] == Archetype.default)+ manager.args[:subtype] = Topic::POST_VOTING_SUBTYPE+ end++ false+ end++ register_modifier(:topic_embed_import_create_args) do |args|+ category_id = args[:category]+ next args unless category_id+ next args if args[:archetype] != Archetype.default && !args[:archetype].blank?++ category = Category.find_by(id: category_id)++ if category&.create_as_post_voting_default || category&.only_post_voting_in_this_category+ args[:subtype] = Topic::POST_VOTING_SUBTYPE+ end++ args+ end++ register_category_custom_field_type(PostVoting::CREATE_AS_POST_VOTING_DEFAULT, :boolean)+ if respond_to?(:register_preloaded_category_custom_fields)+ register_preloaded_category_custom_fields(PostVoting::CREATE_AS_POST_VOTING_DEFAULT)+ else+ # TODO: Drop the if-statement and this if-branch in Discourse v3.2+ Site.preloaded_category_custom_fields << PostVoting::CREATE_AS_POST_VOTING_DEFAULT+ end+ add_to_class(:category, :create_as_post_voting_default) do+ ActiveModel::Type::Boolean.new.cast(+ self.custom_fields[PostVoting::CREATE_AS_POST_VOTING_DEFAULT],+ )+ end+ add_to_serializer(:basic_category, :create_as_post_voting_default) do+ object.create_as_post_voting_default+ end++ add_to_serializer(:current_user, :can_flag_post_voting_comments) do+ scope.can_flag_post_voting_comments?+ end++ register_category_custom_field_type(PostVoting::ONLY_POST_VOTING_IN_THIS_CATEGORY, :boolean)+ if Site.respond_to? :preloaded_category_custom_fields+ Site.preloaded_category_custom_fields << PostVoting::ONLY_POST_VOTING_IN_THIS_CATEGORY+ Site.preloaded_category_custom_fields << PostVoting::CREATE_AS_POST_VOTING_DEFAULT+ end+ add_to_class(:category, :only_post_voting_in_this_category) do+ ActiveModel::Type::Boolean.new.cast(+ self.custom_fields[PostVoting::ONLY_POST_VOTING_IN_THIS_CATEGORY],+ )+ end+ add_to_serializer(:basic_category, :only_post_voting_in_this_category) do+ object.only_post_voting_in_this_category+ end++ add_model_callback(:post, :before_create) do+ if SiteSetting.post_voting_enabled && self.is_post_voting_topic? && self.via_email &&+ self.reply_to_post_number == 1+ self.reply_to_post_number = nil+ end+ end++ register_user_destroyer_on_content_deletion_callback(+ Proc.new do |user|+ post_voting_comment_ids = PostVotingComment.where(user_id: user.id).pluck(:id)+ PostVotingComment.where(id: post_voting_comment_ids).delete_all+ ReviewablePostVotingComment.where(+ target_id: post_voting_comment_ids,+ target_type: "PostVotingComment",+ ).delete_all+ PostVoting::VoteManager.bulk_remove_votes_by(user)+ end,+ )+enddiff --git a/plugins/discourse-post-voting/spec/components/post_voting/vote_manager_spec.rb b/plugins/discourse-post-voting/spec/components/post_voting/vote_manager_spec.rbnew file mode 100644index 00000000000..87c04d12446--- /dev/null+++ b/plugins/discourse-post-voting/spec/components/post_voting/vote_manager_spec.rb@@ -0,0 +1,155 @@+# frozen_string_literal: true++require "rails_helper"++describe PostVoting::VoteManager do+ fab!(:user)+ fab!(:user_2) { Fabricate(:user) }+ fab!(:user_3) { Fabricate(:user) }+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:topic_post) { Fabricate(:post, topic: topic) }+ fab!(:post) { Fabricate(:post, topic: topic) }+ fab!(:up) { PostVotingVote.directions[:up] }+ fab!(:down) { PostVotingVote.directions[:down] }++ before { SiteSetting.post_voting_enabled = true }++ describe ".vote" do+ it "can create an upvote" do+ message =+ MessageBus+ .track_publish("/topic/#{post.topic_id}") do+ PostVoting::VoteManager.vote(post, user, direction: up)+ end+ .first++ expect(PostVotingVote.exists?(votable: post, user: user, direction: up)).to eq(true)++ expect(post.qa_vote_count).to eq(1)++ expect(message.data[:id]).to eq(post.id)+ expect(message.data[:post_voting_user_voted_id]).to eq(user.id)+ expect(message.data[:post_voting_vote_count]).to eq(1)+ expect(message.data[:post_voting_user_voted_direction]).to eq(up)+ expect(message.data[:post_voting_has_votes]).to eq(true)+ end++ it "can create a downvote" do+ message =+ MessageBus+ .track_publish("/topic/#{post.topic_id}") do+ PostVoting::VoteManager.vote(post, user, direction: down)+ end+ .first++ expect(PostVotingVote.exists?(votable: post, user: user, direction: down)).to eq(true)++ expect(post.qa_vote_count).to eq(-1)++ expect(message.data[:id]).to eq(post.id)+ expect(message.data[:post_voting_user_voted_id]).to eq(user.id)+ expect(message.data[:post_voting_vote_count]).to eq(-1)+ expect(message.data[:post_voting_user_voted_direction]).to eq(down)+ expect(message.data[:post_voting_has_votes]).to eq(true)+ end++ it "can change an upvote to a downvote" do+ PostVoting::VoteManager.vote(post, user, direction: up)+ PostVoting::VoteManager.vote(post, user_2, direction: up)+ PostVoting::VoteManager.vote(post, user, direction: down)++ expect(post.qa_vote_count).to eq(0)+ end++ it "can change a downvote to upvote" do+ PostVoting::VoteManager.vote(post, user, direction: down)+ PostVoting::VoteManager.vote(post, user_2, direction: down)+ PostVoting::VoteManager.vote(post, user_3, direction: down)+ PostVoting::VoteManager.vote(post, user, direction: up)++ expect(post.qa_vote_count).to eq(-1)+ end+ end++ describe ".remove_vote" do+ it "should remove a user's upvote" do+ vote = PostVoting::VoteManager.vote(post, user, direction: up)++ message =+ MessageBus+ .track_publish("/topic/#{post.topic_id}") do+ PostVoting::VoteManager.remove_vote(vote.votable, vote.user)+ end+ .first++ expect(PostVotingVote.exists?(id: vote.id)).to eq(false)+ expect(vote.votable.qa_vote_count).to eq(0)++ expect(message.data[:id]).to eq(post.id)+ expect(message.data[:post_voting_user_voted_id]).to eq(user.id)+ expect(message.data[:post_voting_vote_count]).to eq(0)+ expect(message.data[:post_voting_user_voted_direction]).to eq(nil)+ expect(message.data[:post_voting_has_votes]).to eq(false)+ end++ it "should remove a user's downvote" do+ vote = PostVoting::VoteManager.vote(post, Fabricate(:user), direction: up)+ vote_2 = PostVoting::VoteManager.vote(post, Fabricate(:user), direction: up)+ vote_3 = PostVoting::VoteManager.vote(post, user, direction: down)++ message =+ MessageBus+ .track_publish("/topic/#{post.topic_id}") do+ expect do PostVoting::VoteManager.remove_vote(post, user) end.to change {+ vote.votable.reload.qa_vote_count+ }.from(1).to(2)+ end+ .first++ expect(PostVotingVote.exists?(id: vote_3.id)).to eq(false)+ end+ end++ describe ".bulk_remove_votes_by" do+ it "removes all votes by a user" do+ other_user_1 = Fabricate(:user)+ other_user_2 = Fabricate(:user)++ comment_1 = Fabricate(:post_voting_comment, post: post)+ comment_2 = Fabricate(:post_voting_comment, post: post)+ comment_3 = Fabricate(:post_voting_comment, post: topic_post)++ vote_1 = PostVoting::VoteManager.vote(post, user, direction: down)+ vote_2 = PostVoting::VoteManager.vote(topic_post, user, direction: up)+ vote_3 = PostVoting::VoteManager.vote(comment_1, user, direction: up)+ vote_4 = PostVoting::VoteManager.vote(comment_2, user, direction: up)++ vote_5 = PostVoting::VoteManager.vote(post, other_user_1, direction: down)+ vote_6 = PostVoting::VoteManager.vote(topic_post, other_user_1, direction: up)+ vote_7 = PostVoting::VoteManager.vote(comment_1, other_user_1, direction: up)+ vote_8 = PostVoting::VoteManager.vote(comment_3, other_user_2, direction: up)++ expect(PostVotingVote.exists?(id: [vote_1.id, vote_2.id, vote_3.id, vote_4.id])).to eq(true)+ expect(user.post_voting_votes.count).to eq(4)+ expect(PostVotingVote.count).to eq(8)++ expect(post.qa_vote_count).to eq(-2)+ expect(topic_post.qa_vote_count).to eq(2)+ expect(comment_1.qa_vote_count).to eq(2)+ expect(comment_2.qa_vote_count).to eq(1)+ expect(comment_3.qa_vote_count).to eq(1)++ PostVoting::VoteManager.bulk_remove_votes_by(user)++ expect(PostVotingVote.exists?(id: [vote_1.id, vote_2.id, vote_3.id, vote_4.id])).to eq(false)+ expect(PostVotingVote.exists?(id: [vote_5.id, vote_6.id, vote_7.id, vote_8.id])).to eq(true)+ expect(PostVotingVote.count).to eq(4)++ expect(post.reload.qa_vote_count).to eq(-1)+ expect(topic_post.reload.qa_vote_count).to eq(1)+ expect(comment_1.reload.qa_vote_count).to eq(1)+ expect(comment_2.reload.qa_vote_count).to eq(0)+ expect(comment_3.reload.qa_vote_count).to eq(1)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/fabricators/post_voting_comment_fabricator.rb b/plugins/discourse-post-voting/spec/fabricators/post_voting_comment_fabricator.rbnew file mode 100644index 00000000000..c851120ff43--- /dev/null+++ b/plugins/discourse-post-voting/spec/fabricators/post_voting_comment_fabricator.rb@@ -0,0 +1,15 @@+# frozen_string_literal: true++Fabricator(:post_voting_comment) do+ user+ post+ raw "Hello world"+end++Fabricator(:reviewable_post_voting_comment, class_name: "ReviewablePostVotingComment") do+ reviewable_by_moderator true+ type "ReviewablePostVotingComment"+ created_by { Fabricate(:user) }+ target { Fabricate(:post_voting_comment) }+ reviewable_scores { |p| [Fabricate.build(:reviewable_score, reviewable_id: p[:id])] }+enddiff --git a/plugins/discourse-post-voting/spec/fabricators/post_voting_vote_fabricator.rb b/plugins/discourse-post-voting/spec/fabricators/post_voting_vote_fabricator.rbnew file mode 100644index 00000000000..a950b4a9ffe--- /dev/null+++ b/plugins/discourse-post-voting/spec/fabricators/post_voting_vote_fabricator.rb@@ -0,0 +1,7 @@+# frozen_string_literal: true++Fabricator(:post_voting_vote, class_name: :post_voting_vote) do+ user+ votable(fabricator: :post)+ direction "up"+enddiff --git a/plugins/discourse-post-voting/spec/lib/email/receiver_spec.rb b/plugins/discourse-post-voting/spec/lib/email/receiver_spec.rbnew file mode 100644index 00000000000..5b0b83d8924--- /dev/null+++ b/plugins/discourse-post-voting/spec/lib/email/receiver_spec.rb@@ -0,0 +1,42 @@+# frozen_string_literal: true++require "email/receiver"++RSpec.describe Email::Receiver do+ before do+ SiteSetting.email_in = true+ SiteSetting.reply_by_email_address = "reply+%{reply_key}@bar.com"+ SiteSetting.alternative_reply_by_email_addresses = "alt+%{reply_key}@bar.com"+ end++ def process(email_name, opts = {})+ Email::Receiver.new(email(email_name), opts).process!+ end++ describe "reply" do+ let(:reply_key) { "4f97315cc828096c9cb34c6f1a0d6fe8" }+ fab!(:category)+ fab!(:user) { Fabricate(:user, email: "[email protected]", refresh_auto_groups: true) }+ fab!(:topic) do+ create_topic(category: category, user: user, subtype: Topic::POST_VOTING_SUBTYPE)+ end+ fab!(:post) { create_post(topic: topic) }++ before { Fabricate(:post_reply_key, reply_key: reply_key, user: user, post: post) }++ it "creates a new reply post" do+ handler_calls = 0+ handler = proc { |_| handler_calls += 1 }++ DiscourseEvent.on(:topic_created, &handler)++ expect { process(:html_reply) }.to change { topic.posts.count }+ last_post = topic.posts.last+ expect(last_post.raw).to eq("This is a **HTML** reply ;)")+ expect(last_post.reply_to_post_number).to be_nil++ DiscourseEvent.off(:topic_created, &handler)+ expect(handler_calls).to eq(0)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/lib/post_voting/comment_review_queue_spec.rb b/plugins/discourse-post-voting/spec/lib/post_voting/comment_review_queue_spec.rbnew file mode 100644index 00000000000..8b23834bc37--- /dev/null+++ b/plugins/discourse-post-voting/spec/lib/post_voting/comment_review_queue_spec.rb@@ -0,0 +1,344 @@+# frozen_string_literal: true++require "rails_helper"++describe PostVoting::CommentReviewQueue do+ subject(:queue) { described_class.new }++ fab!(:comment_poster) { Fabricate(:user) }+ fab!(:flagger) { Fabricate(:user, group_ids: [Group::AUTO_GROUPS[:trust_level_1]]) }+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:post) { Fabricate(:post, topic: topic) }+ fab!(:comment) { Fabricate(:post_voting_comment, user: comment_poster, post: post) }+ let(:guardian) { Guardian.new(flagger) }+ fab!(:admin)+ let(:admin_guardian) { Guardian.new(admin) }++ describe "#flag_comment" do+ it "raises an error when the user is not allowed to flag" do+ UserSilencer.new(flagger).silence++ expect { queue.flag_comment(comment, guardian, ReviewableScore.types[:spam]) }.to raise_error(+ Discourse::InvalidAccess,+ )+ end++ it "stores the comment cooked content inside the reviewable" do+ queue.flag_comment(comment, guardian, ReviewableScore.types[:off_topic])++ reviewable = ReviewablePostVotingComment.last++ expect(reviewable.payload["comment_cooked"]).to eq(comment.cooked)+ end++ context "when the user already flagged the post" do+ let(:second_flag_result) do+ queue.flag_comment(comment, guardian, ReviewableScore.types[:off_topic])+ end++ before { queue.flag_comment(comment, guardian, ReviewableScore.types[:spam]) }++ it "returns an error" do+ expect(second_flag_result).to include success: false,+ errors: [I18n.t("post_voting.reviewables.comment_already_handled")]+ end++ it "returns an error when trying to use notify_moderators and the previous flag is still pending" do+ notify_moderators_result =+ queue.flag_comment(+ comment,+ guardian,+ ReviewableScore.types[:notify_moderators],+ comment: "Look at this please, moderators",+ )++ expect(notify_moderators_result).to include success: false,+ errors: [I18n.t("post_voting.reviewables.comment_already_handled")]+ end+ end++ context "when a different user already flagged the post" do+ let(:second_flag_result) { queue.flag_comment(comment, admin_guardian, second_flag_type) }++ before { queue.flag_comment(comment, guardian, ReviewableScore.types[:spam]) }++ it "appends a new score to the existing reviewable" do+ second_flag_result =+ queue.flag_comment(comment, admin_guardian, ReviewableScore.types[:off_topic])+ expect(second_flag_result).to include success: true++ reviewable = ReviewablePostVotingComment.find_by(target: comment)+ scores = reviewable.reviewable_scores++ expect(scores.size).to eq(2)+ expect(scores.map(&:reviewable_score_type)).to contain_exactly(+ *ReviewableScore.types.slice(:off_topic, :spam).values,+ )+ end++ it "returns an error when someone already used the same flag type" do+ second_flag_result =+ queue.flag_comment(comment, admin_guardian, ReviewableScore.types[:spam])++ expect(second_flag_result).to include success: false,+ errors: [I18n.t("post_voting.reviewables.comment_already_handled")]+ end+ end++ context "when a flags exists but staff already handled it" do+ let(:second_flag_result) do+ queue.flag_comment(comment, guardian, ReviewableScore.types[:off_topic])+ end++ before do+ queue.flag_comment(comment, guardian, ReviewableScore.types[:spam])++ reviewable = ReviewablePostVotingComment.last+ reviewable.perform(admin, :ignore)+ end++ it "raises an error when we are inside the cooldown window" do+ expect(second_flag_result).to include success: false,+ errors: [I18n.t("post_voting.reviewables.comment_already_handled")]+ end++ it "allows the user to re-flag after the cooldown period" do+ reviewable = ReviewablePostVotingComment.last+ reviewable.update!(updated_at: (SiteSetting.cooldown_hours_until_reflag.to_i + 1).hours.ago)++ expect(second_flag_result).to include success: true+ end++ it "ignores the cooldown window when using the notify_moderators flag type" do+ notify_moderators_result =+ queue.flag_comment(+ comment,+ guardian,+ ReviewableScore.types[:notify_moderators],+ comment: "Look at this please, moderators",+ )++ expect(notify_moderators_result).to include success: true+ end+ end++ let(:flag_comment) { "I just flagged your post voting comment..." }++ context "when creating a notify_user flag" do+ it "creates a companion PM" do+ queue.flag_comment(+ comment,+ guardian,+ ReviewableScore.types[:notify_user],+ comment: flag_comment,+ )+ pm_topic =+ Topic.includes(:posts).find_by(user: guardian.user, archetype: Archetype.private_message)+ pm_post = pm_topic.first_post++ expect(pm_topic.allowed_users).to include(comment.user)+ expect(pm_topic.subtype).to eq(TopicSubtype.notify_user)+ expect(pm_post.raw).to include(flag_comment)+ expect(pm_topic.title).to eq(+ I18n.t("post_voting.comment.reviewable_score_types.notify_user.comment_pm_title"),+ )+ end++ it "doesn't create a reviewable" do+ queue.flag_comment(comment, guardian, ReviewableScore.types[:notify_user])++ reviewable = ReviewablePostVotingComment.find_by(target: comment)+ expect(reviewable).to be_nil+ end++ it "doesn't create a PM if there is no comment" do+ queue.flag_comment(comment, guardian, ReviewableScore.types[:notify_user])++ pm_topic =+ Topic.includes(:posts).find_by(user: guardian.user, archetype: Archetype.private_message)++ expect(pm_topic).to be_nil+ end++ it "allow staff to tag PM as a warning" do+ queue.flag_comment(+ comment,+ admin_guardian,+ ReviewableScore.types[:notify_user],+ comment: flag_comment,+ is_warning: true,+ )++ expect(UserWarning.exists?(user: comment.user)).to eq(true)+ end++ it "only allows staff members to send warnings" do+ expect do+ queue.flag_comment(+ comment,+ guardian,+ ReviewableScore.types[:notify_user],+ comment: flag_comment,+ is_warning: true,+ )+ end.to raise_error(Discourse::InvalidAccess)+ end+ end++ context "when creating a notify_moderators flag" do+ it "creates a companion PM and gives moderators access to it" do+ queue.flag_comment(+ comment,+ guardian,+ ReviewableScore.types[:notify_moderators],+ comment: flag_comment,+ )++ pm_topic =+ Topic.includes(:posts).find_by(user: guardian.user, archetype: Archetype.private_message)+ pm_post = pm_topic.first_post++ expect(pm_topic.allowed_groups).to contain_exactly(Group[:moderators])+ expect(pm_topic.subtype).to eq(TopicSubtype.notify_moderators)+ expect(pm_post.raw).to include(flag_comment)+ expect(pm_topic.title).to eq("A post voting comment requires staff attention")+ end++ it "creates a reviewable" do+ queue.flag_comment(comment, guardian, ReviewableScore.types[:notify_moderators])++ reviewable = ReviewablePostVotingComment.find_by(target: comment)+ expect(reviewable).to be_present+ end++ it "ignores the is_warning flag when notifying moderators" do+ queue.flag_comment(+ comment,+ guardian,+ ReviewableScore.types[:notify_moderators],+ comment: flag_comment,+ is_warning: true,+ )++ expect(UserWarning.exists?(user: comment.user)).to eq(false)+ end+ end++ context "when immediately taking action" do+ it "agrees with the flag and deletes the post voting comment" do+ queue.flag_comment(+ comment,+ admin_guardian,+ ReviewableScore.types[:off_topic],+ take_action: true,+ )++ reviewable = ReviewablePostVotingComment.find_by(target: comment)++ expect(reviewable.approved?).to eq(true)+ expect(comment.reload.trashed?).to eq(true)+ end++ it "agrees with other flags on the same comment" do+ queue.flag_comment(comment, guardian, ReviewableScore.types[:off_topic])++ reviewable =+ ReviewablePostVotingComment.includes(:reviewable_scores).find_by(target_id: comment)+ scores = reviewable.reviewable_scores++ expect(scores.size).to eq(1)+ expect(scores.all?(&:pending?)).to eq(true)++ queue.flag_comment(comment, admin_guardian, ReviewableScore.types[:spam], take_action: true)++ scores = reviewable.reload.reviewable_scores++ expect(scores.size).to eq(2)+ expect(scores.all?(&:agreed?)).to eq(true)+ end++ it "raises an exception if the user is not a staff member" do+ expect do+ queue.flag_comment(+ comment,+ guardian,+ ReviewableScore.types[:off_topic],+ take_action: true,+ )+ end.to raise_error(Discourse::InvalidAccess)+ end+ end++ context "when queueing for review" do+ it "sets a reason on the score" do+ queue.flag_comment(+ comment,+ admin_guardian,+ ReviewableScore.types[:off_topic],+ queue_for_review: true,+ )++ reviewable =+ ReviewablePostVotingComment.includes(:reviewable_scores).find_by(target_id: comment)+ score = reviewable.reviewable_scores.first++ expect(score.reason).to eq("post_voting_comment_queued_by_staff")+ end++ it "only allows staff members to queue for review" do+ expect do+ queue.flag_comment(+ comment,+ guardian,+ ReviewableScore.types[:off_topic],+ queue_for_review: true,+ )+ end.to raise_error(Discourse::InvalidAccess)+ end+ end++ context "when the auto silence threshold is met" do+ it "silences the user" do+ # Chat setting+ SiteSetting.chat_auto_silence_from_flags_duration = 1+ flagger.update!(trust_level: TrustLevel[4]) # Increase Score due to TL Bonus.++ queue.flag_comment(comment, guardian, ReviewableScore.types[:off_topic])++ expect(comment_poster.reload.silenced?).to eq(true)+ end++ it "does nothing if the new score is less than the auto-silence threshold" do+ # Chat setting+ SiteSetting.chat_auto_silence_from_flags_duration = 50++ queue.flag_comment(comment, guardian, ReviewableScore.types[:off_topic])++ expect(comment_poster.reload.silenced?).to eq(false)+ end++ it "does nothing if the silence duration is set to 0" do+ # Chat setting+ SiteSetting.chat_auto_silence_from_flags_duration = 0+ flagger.update!(trust_level: TrustLevel[4]) # Increase Score due to TL Bonus.++ queue.flag_comment(comment, guardian, ReviewableScore.types[:off_topic])++ expect(comment_poster.reload.silenced?).to eq(false)+ end++ context "when the target is an admin" do+ it "does not silence the user" do+ # Chat setting+ SiteSetting.chat_auto_silence_from_flags_duration = 1+ flagger.update!(trust_level: TrustLevel[4]) # Increase Score due to TL Bonus.+ comment_poster.update!(admin: true)++ queue.flag_comment(comment, guardian, ReviewableScore.types[:off_topic])++ expect(comment_poster.reload.silenced?).to eq(false)+ end+ end+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/lib/topic_view_spec.rb b/plugins/discourse-post-voting/spec/lib/topic_view_spec.rbnew file mode 100644index 00000000000..54407fc2656--- /dev/null+++ b/plugins/discourse-post-voting/spec/lib/topic_view_spec.rb@@ -0,0 +1,263 @@+# frozen_string_literal: true++require "rails_helper"++describe TopicView do+ fab!(:user)+ fab!(:admin)+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:post) { create_post(topic: topic) }++ fab!(:answer) { create_post(topic: topic) }+ fab!(:answer_2) { create_post(topic: topic) }+ let(:comment) { Fabricate(:post_voting_comment, post: answer) }+ let(:comment_2) { Fabricate(:post_voting_comment, post: answer) }+ let(:comment_3) { Fabricate(:post_voting_comment, post: post) }+ let(:vote) { Fabricate(:post_voting_vote, votable: answer, user: user) }++ let(:vote_2) do+ Fabricate(+ :post_voting_vote,+ votable: answer_2,+ user: user,+ direction: PostVotingVote.directions[:down],+ )+ end++ before do+ SiteSetting.post_voting_enabled = true+ vote+ vote_2+ comment+ comment_2+ comment_3+ end++ it "does not preload Post Voting related records for non-Post Voting topics" do+ topic_2 = Fabricate(:topic)+ topic_2_post = Fabricate(:post, topic: topic_2)+ Fabricate(:post, topic: topic_2, reply_to_post_number: topic_2_post.post_number)++ topic_view = TopicView.new(topic_2, user)++ expect(topic_view.comments).to eq(nil)+ expect(topic_view.comments_counts).to eq(nil)+ expect(topic_view.posts_user_voted).to eq(nil)+ end++ it "should preload comments, comments count, user voted status for a given topic" do+ PostVoting::VoteManager.vote(comment, user)+ PostVoting::VoteManager.vote(comment_2, comment_3.user)++ topic_view = TopicView.new(topic, user)++ expect(topic_view.comments[answer.id].map(&:id)).to contain_exactly(comment.id, comment_2.id)+ expect(topic_view.comments[post.id].map(&:id)).to contain_exactly(comment_3.id)++ expect(topic_view.comments_counts[answer.id]).to eq(2)+ expect(topic_view.comments_counts[post.id]).to eq(1)++ expect(topic_view.posts_user_voted).to eq(+ {+ answer.id => PostVotingVote.directions[:up],+ answer_2.id => PostVotingVote.directions[:down],+ },+ )++ expect(topic_view.comments_user_voted).to eq({ comment.id => true })+ end++ it "should respect Topic::PRELOAD_COMMENTS_COUNT when loading initial comments" do+ stub_const(TopicView, "PRELOAD_COMMENTS_COUNT", 1) do+ topic_view = TopicView.new(topic, user)++ expect(topic_view.comments[answer.id].map(&:id)).to contain_exactly(comment.id)+ expect(topic_view.comments_counts[answer.id]).to eq(2)+ end+ end++ it "should preload the right comments even if comments have been deleted" do+ comment_4 = Fabricate(:post_voting_comment, post: answer)+ comment.trash!++ stub_const(TopicView, "PRELOAD_COMMENTS_COUNT", 2) do+ topic_view = TopicView.new(topic, user)++ expect(topic_view.comments[answer.id].map(&:id)).to contain_exactly(+ comment_2.id,+ comment_4.id,+ )+ expect(topic_view.comments_counts[answer.id]).to eq(2)+ end+ end++ describe "#filter_posts_near" do+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:post) { create_post(topic: topic) }++ fab!(:answer_plus_2_votes) do+ create_post(topic: topic).tap do |p|+ PostVoting::VoteManager.vote(p, Fabricate(:user), direction: PostVotingVote.directions[:up])+ PostVoting::VoteManager.vote(p, Fabricate(:user), direction: PostVotingVote.directions[:up])+ end+ end++ fab!(:answer_minus_2_votes) do+ create_post(topic: topic).tap do |p|+ PostVoting::VoteManager.vote(+ p,+ Fabricate(:user),+ direction: PostVotingVote.directions[:down],+ )+ PostVoting::VoteManager.vote(+ p,+ Fabricate(:user),+ direction: PostVotingVote.directions[:down],+ )+ end+ end++ fab!(:answer_minus_1_vote) do+ create_post(topic: topic).tap do |p|+ PostVoting::VoteManager.vote(+ p,+ Fabricate(:user),+ direction: PostVotingVote.directions[:down],+ )+ end+ end++ fab!(:answer_0_votes) { create_post(topic: topic) }++ fab!(:answer_plus_1_vote_deleted) do+ create_post(topic: topic).tap do |p|+ PostVoting::VoteManager.vote(p, Fabricate(:user), direction: PostVotingVote.directions[:up])+ p.trash!+ end+ end++ fab!(:answer_plus_1_vote) do+ create_post(topic: topic).tap do |p|+ PostVoting::VoteManager.vote(p, Fabricate(:user), direction: PostVotingVote.directions[:up])+ end+ end++ def topic_view_near(post)+ TopicView.new(topic.id, user, post_number: post.post_number)+ end++ before do+ Topic.reset_highest(topic.id)+ TopicView.stubs(:chunk_size).returns(3)+ end++ it "snaps to the lower boundary" do+ near_view = topic_view_near(post)+ expect(near_view.desired_post.id).to eq(post.id)+ expect(near_view.posts.map(&:id)).to eq(+ [post.id, answer_plus_2_votes.id, answer_plus_1_vote.id],+ )+ end++ it "snaps to the upper boundary" do+ near_view = topic_view_near(answer_minus_2_votes)++ expect(near_view.desired_post.id).to eq(answer_minus_2_votes.id)+ expect(near_view.posts.map(&:id)).to eq(+ [answer_0_votes.id, answer_minus_1_vote.id, answer_minus_2_votes.id],+ )+ end++ it "returns the posts in the middle" do+ near_view = topic_view_near(answer_0_votes)+ expect(near_view.desired_post.id).to eq(answer_0_votes.id)+ expect(near_view.posts.map(&:id)).to eq(+ [answer_plus_1_vote.id, answer_0_votes.id, answer_minus_1_vote.id],+ )+ end++ it "snaps to the lower boundary when deleted post_number is provided" do+ near_view =+ TopicView.new(+ topic.id,+ user,+ post_number: topic.posts.where("deleted_at IS NOT NULL").pick(:post_number),+ )++ expect(near_view.desired_post.id).to eq(post.id)+ expect(near_view.posts.map(&:id)).to eq(+ [post.id, answer_plus_2_votes.id, answer_plus_1_vote.id],+ )+ end++ it "snaps to the lower boundary when post_number is too large" do+ near_view = TopicView.new(topic.id, user, post_number: 99_999_999)++ expect(near_view.desired_post.id).to eq(post.id)+ expect(near_view.posts.map(&:id)).to eq(+ [post.id, answer_plus_2_votes.id, answer_plus_1_vote.id],+ )+ end++ it "returns the posts in the middle when sorted by activity" do+ near_view =+ TopicView.new(+ topic.id,+ user,+ post_number: answer_minus_1_vote.post_number,+ filter: TopicView::ACTIVITY_FILTER,+ )++ expect(near_view.desired_post.id).to eq(answer_minus_1_vote.id)+ expect(near_view.posts.map(&:id)).to eq(+ [answer_minus_2_votes.id, answer_minus_1_vote.id, answer_0_votes.id],+ )+ end+ describe "#next_page" do+ it "returns the next page properly when the highest id post is not the last" do+ expect(TopicView.new(topic.id, user, { post_number: post.post_number }).next_page).to eql(2)+ end+ end+ end++ describe "custom default scope filters" do+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:post_1) { create_post(topic: topic, raw: "kitties1", post_number: 1) }+ fab!(:post_2) { create_post(topic: topic, raw: "kitties2", post_number: 2) }++ fab!(:post_3) do+ create_post(topic: topic, raw: "poopy", post_number: 3, post_type: Post.types[:small_action])+ end++ fab!(:post_4) { create_post(topic: topic, raw: "kitties4", post_number: 4) }++ fab!(:post_5) do+ create_post(topic: topic, raw: "kitties5", post_number: 5, post_type: Post.types[:whisper])+ end++ fab!(:post_6) do+ create_post(+ topic: topic,+ raw: "kitties6",+ post_number: 6,+ post_type: Post.types[:moderator_action],+ )+ end++ before { SiteSetting.whispers_allowed_groups = "admins" }++ it "returns all posts in chronological order when filtered by ACTIVITY" do+ topic_view = TopicView.new(topic.id, admin, filter: TopicView::ACTIVITY_FILTER)++ expect(topic_view.posts.map(&:raw)).to eq(+ %w[kitties1 kitties2 poopy kitties4 kitties5 kitties6],+ )+ end++ it "returns posts that are not whispers or small action subtypes in chronological order when no filter" do+ topic_view = TopicView.new(topic.id, admin)++ expect(topic_view.posts.map(&:raw)).to eq(%w[kitties1 kitties2 kitties4 kitties6])+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/models/post_spec.rb b/plugins/discourse-post-voting/spec/models/post_spec.rbnew file mode 100644index 00000000000..f180d643c99--- /dev/null+++ b/plugins/discourse-post-voting/spec/models/post_spec.rb@@ -0,0 +1,48 @@+# frozen_string_literal: true++require "rails_helper"++describe Post do+ fab!(:user1) { Fabricate(:user) }+ fab!(:user2) { Fabricate(:user) }+ fab!(:user3) { Fabricate(:user) }+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:topic_post) { Fabricate(:post, topic: topic) }+ fab!(:post) { Fabricate(:post, topic: topic) }+ let(:up) { PostVotingVote.directions[:up] }+ let(:users) { [user1, user2, user3] }++ before { SiteSetting.post_voting_enabled = true }++ describe "validation" do+ it "ensures that post cannot be created with reply_to_post_number set" do+ post.reply_to_post_number = 3++ expect(post.valid?).to eq(false)++ expect(post.errors.full_messages).to contain_exactly(+ I18n.t("post.post_voting.errors.replying_to_post_not_permited"),+ )+ end+ end++ it("should ignore vote_count") { expect(Post.ignored_columns.include?("vote_count")).to eq(true) }++ it "should return last voted correctly" do+ freeze_time do+ expect(post.post_voting_last_voted(user1.id)).to eq(nil)++ PostVoting::VoteManager.vote(post, user1)++ expect(post.post_voting_last_voted(user1.id)).to eq_time(Time.zone.now)+ end+ end++ it "should return post_voting_can_vote correctly" do+ expect(post.post_voting_can_vote(user1.id, PostVotingVote.directions[:up])).to eq(true)++ PostVoting::VoteManager.vote(post, user1)++ expect(post.post_voting_can_vote(user1.id, PostVotingVote.directions[:up])).to eq(false)+ end+enddiff --git a/plugins/discourse-post-voting/spec/models/post_voting_comment_spec.rb b/plugins/discourse-post-voting/spec/models/post_voting_comment_spec.rbnew file mode 100644index 00000000000..c6b766b948a--- /dev/null+++ b/plugins/discourse-post-voting/spec/models/post_voting_comment_spec.rb@@ -0,0 +1,155 @@+# frozen_string_literal: true++require "rails_helper"++describe PostVotingComment do+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:post) { Fabricate(:post, topic: topic) }+ fab!(:user)+ fab!(:tag)++ before { SiteSetting.post_voting_enabled = true }++ describe "validations" do+ it "does not allow comments to be created when post is in reply to another post" do+ post_2 = Fabricate(:post, topic: topic)++ SiteSetting.post_voting_enabled = false++ post_3 = Fabricate(:post, topic: topic, reply_to_post_number: post_2.post_number)++ SiteSetting.post_voting_enabled = true++ comment = PostVotingComment.new(raw: "this is a **post**", post: post_3, user: user)++ expect(comment.valid?).to eq(false)+ expect(comment.errors.full_messages).to contain_exactly(+ I18n.t("post_voting.comment.errors.not_permitted"),+ )+ end++ it "does not allow comments to be created when SiteSetting.post_voting_comment_limit_per_post has been reached" do+ SiteSetting.post_voting_comment_limit_per_post = 1++ PostVotingComment.create!(raw: "this is a **post**", post: post, user: user)+ comment = PostVotingComment.new(raw: "this is a **post**", post: post, user: user)++ expect(comment.valid?).to eq(false)++ expect(comment.errors.full_messages).to contain_exactly(+ I18n.t(+ "post_voting.comment.errors.limit_exceeded",+ limit: SiteSetting.post_voting_comment_limit_per_post,+ ),+ )+ end++ it "does not allow comment to be created when raw does not meet min_post_length site setting" do+ SiteSetting.min_post_length = 5++ comment = PostVotingComment.new(raw: "1234", post: post, user: user)++ expect(comment.valid?).to eq(false)+ expect(comment.errors[:raw]).to eq([I18n.t("errors.messages.too_short", count: 5)])+ end++ it "does not allow comment to be created when raw length exceeds post_voting_comment_max_raw_length site setting" do+ max = SiteSetting.post_voting_comment_max_raw_length = 5+ raw = "this string is too long"++ post_voting_comment = PostVotingComment.new(raw: raw, post: post, user: user)++ expect(post_voting_comment.valid?).to eq(false)+ expect(post_voting_comment.errors[:raw]).to eq(+ [I18n.t("errors.messages.too_long_validation", count: max, length: raw.length)],+ )+ end++ it "does not allow comment to be created when raw does not pass TextSentinel check" do+ post_voting_comment = PostVotingComment.new(raw: "ALL CAPS STRING", post: post, user: user)++ expect(post_voting_comment.valid?).to eq(false)+ expect(post_voting_comment.errors[:raw]).to eq([I18n.t("is_invalid")])+ end++ it "does not allow comment to be created when raw contains a blocked watch word" do+ watched_word = Fabricate(:watched_word, action: WatchedWord.actions[:block])++ post_voting_comment =+ PostVotingComment.new(raw: "contains #{watched_word.word}", post: post, user: user)++ expect(post_voting_comment.valid?).to eq(false)+ expect(post_voting_comment.errors[:base]).to eq(+ [I18n.t("contains_blocked_word", word: watched_word.word)],+ )+ end+ end++ describe "callbacks" do+ it "cooks raw before saving" do+ post_voting_comment = PostVotingComment.new(raw: "this is a **post**", post: post, user: user)++ expect(post_voting_comment.valid?).to eq(true)+ expect(post_voting_comment.cooked).to eq("<p>this is a <strong>post</strong></p>")+ expect(post_voting_comment.cooked_version).to eq(described_class::COOKED_VERSION)+ end+ end++ describe ".cook" do+ it "supports emphasis markdown rule" do+ post_voting_comment = Fabricate(:post_voting_comment, post: post, raw: "**bold**")++ expect(post_voting_comment.cooked).to eq("<p><strong>bold</strong></p>")+ end++ it "supports backticks markdown rule" do+ post_voting_comment = Fabricate(:post_voting_comment, post: post, raw: "`test`")++ expect(post_voting_comment.cooked).to eq("<p><code>test</code></p>")+ end++ it "supports link markdown rule" do+ post_voting_comment =+ Fabricate(:post_voting_comment, post: post, raw: "[test link](https://www.example.com)")++ expect(post_voting_comment.cooked).to eq(+ "<p><a href=\"https://www.example.com\" rel=\"noopener nofollow ugc\">test link</a></p>",+ )+ end++ it "supports linkify markdown rule" do+ post_voting_comment =+ Fabricate(:post_voting_comment, post: post, raw: "https://www.example.com")++ expect(post_voting_comment.cooked).to eq(+ "<p><a href=\"https://www.example.com\" rel=\"noopener nofollow ugc\">https://www.example.com</a></p>",+ )+ end++ it "supports emoji markdown engine" do+ post_voting_comment = Fabricate(:post_voting_comment, post: post, raw: ":grin: abcde")++ expect(post_voting_comment.cooked).to eq(+ "<p><img src=\"/images/emoji/twitter/grin.png?v=#{Emoji::EMOJI_VERSION}\" title=\":grin:\" class=\"emoji\" alt=\":grin:\" loading=\"lazy\" width=\"20\" height=\"20\"> abcde</p>",+ )+ end++ it "supports censored markdown engine" do+ watched_word = Fabricate(:watched_word, action: WatchedWord.actions[:censor], word: "testing")++ post_voting_comment = Fabricate(:post_voting_comment, post: post, raw: watched_word.word)++ expect(post_voting_comment.cooked).to eq("<p>■■■■■■■</p>")+ end++ it "removes newlines from raw as comments should only support a single paragraph" do+ post_voting_comment = Fabricate(:post_voting_comment, post: post, raw: <<~RAW)+ line 1++ line 2+ RAW++ expect(post_voting_comment.cooked).to eq("<p>line 1 line 2</p>")+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/models/post_voting_vote_spec.rb b/plugins/discourse-post-voting/spec/models/post_voting_vote_spec.rbnew file mode 100644index 00000000000..e1f9328a9ba--- /dev/null+++ b/plugins/discourse-post-voting/spec/models/post_voting_vote_spec.rb@@ -0,0 +1,121 @@+# frozen_string_literal: true++require "rails_helper"++describe PostVotingVote do+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:topic_post) { Fabricate(:post, topic: topic) }+ fab!(:post) { Fabricate(:post, topic: topic) }+ fab!(:user)+ fab!(:post_1) { Fabricate(:post, topic: topic, user: user) }+ fab!(:tag)++ before { SiteSetting.post_voting_enabled = true }++ describe "validations" do+ context "with posts" do+ it "ensures votes cannot be created when qa is disabled" do+ SiteSetting.post_voting_enabled = false++ vote =+ PostVotingVote.new(votable: post, user: user, direction: PostVotingVote.directions[:up])++ expect(vote.valid?).to eq(false)++ expect(vote.errors.full_messages).to contain_exactly(+ I18n.t("post.post_voting.errors.post_voting_not_enabled"),+ )+ end++ it "ensures that only posts in reply to other posts cannot be voted on" do+ post.update!(post_number: 2, reply_to_post_number: 1)++ vote =+ PostVotingVote.new(votable: post, user: user, direction: PostVotingVote.directions[:up])++ expect(vote.valid?).to eq(false)++ expect(vote.errors.full_messages).to contain_exactly(+ I18n.t("post.post_voting.errors.voting_not_permitted"),+ )+ end++ it "ensures that votes can only be created for valid polymorphic types" do+ vote =+ PostVotingVote.new(+ votable: post.topic,+ user: user,+ direction: PostVotingVote.directions[:up],+ )++ expect(vote.valid?).to eq(false)+ expect(vote.errors[:votable_type].present?).to eq(true)+ end++ it "ensures that self voting is not allowed" do+ vote =+ PostVotingVote.new(votable: post_1, user: user, direction: PostVotingVote.directions[:up])++ expect(vote.valid?).to eq(false)+ expect(vote.errors.full_messages).to contain_exactly(+ I18n.t("post.post_voting.errors.self_voting_not_permitted"),+ )+ end+ end++ context "when commenting" do+ fab!(:comment) { Fabricate(:post_voting_comment, post: post) }++ it "ensures vote cannot be created on a comment when qa is disabled" do+ SiteSetting.post_voting_enabled = false+ comment.reload++ vote =+ PostVotingVote.new(+ votable: comment,+ user: user,+ direction: PostVotingVote.directions[:up],+ )++ expect(vote.valid?).to eq(false)++ expect(vote.errors.full_messages).to contain_exactly(+ I18n.t("post.post_voting.errors.post_voting_not_enabled"),+ )+ end++ it "ensures vote cannot be created on a comment when it is a downvote" do+ vote =+ PostVotingVote.new(+ votable: comment,+ user: user,+ direction: PostVotingVote.directions[:down],+ )++ expect(vote.valid?).to eq(false)++ expect(vote.errors.full_messages).to contain_exactly(+ I18n.t("post.post_voting.errors.comment_cannot_be_downvoted"),+ )+ end+ end+ end++ describe "#direction" do+ it "ensures inclusion of values" do+ vote = PostVotingVote.new(votable: post, user: user)++ vote.direction = "up"++ expect(vote.valid?).to eq(true)++ vote.direction = "down"++ expect(vote.valid?).to eq(true)++ vote.direction = "somethingelse"++ expect(vote.valid?).to eq(false)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/models/reviewable_post_voting_comment_spec.rb b/plugins/discourse-post-voting/spec/models/reviewable_post_voting_comment_spec.rbnew file mode 100644index 00000000000..d8369a48d88--- /dev/null+++ b/plugins/discourse-post-voting/spec/models/reviewable_post_voting_comment_spec.rb@@ -0,0 +1,98 @@+# frozen_string_literal: true++require "rails_helper"++RSpec.describe ReviewablePostVotingComment, type: :model do+ fab!(:comment_poster) { Fabricate(:user) }+ fab!(:flagger) { Fabricate(:user, group_ids: [Group::AUTO_GROUPS[:trust_level_1]]) }+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:post) { Fabricate(:post, topic: topic) }+ fab!(:comment) { Fabricate(:post_voting_comment, user: comment_poster, post: post) }+ let(:guardian) { Guardian.new(flagger) }+ fab!(:admin)+ let(:admin_guardian) { Guardian.new(admin) }++ fab!(:moderator)+ fab!(:user)++ fab!(:reviewable) do+ Fabricate(:reviewable_post_voting_comment, target: comment, created_by: moderator)+ end++ it "agree_and_keep agrees with the flag and doesn't delete the comment" do+ reviewable.perform(moderator, :agree_and_keep_comment)++ expect(reviewable).to be_approved+ expect(comment.reload.deleted_at).not_to be_present+ end++ it "agree_and_delete agrees with the flag and deletes the comment" do+ comment_id = comment.id+ reviewable.perform(moderator, :agree_and_delete)++ expect(reviewable).to be_approved+ expect(PostVotingComment.with_deleted.find_by(id: comment_id).deleted_at).to be_present+ end++ it "agree_and_restore agrees with the flag and restores the comment" do+ comment.trash!(user)+ reviewable.perform(moderator, :agree_and_restore)++ expect(reviewable).to be_approved+ expect(comment.reload.deleted_at).to be_nil+ end++ it "perform_disagree disagrees with the flag and does nothing" do+ reviewable.perform(moderator, :disagree)++ expect(reviewable).to be_rejected+ end++ it "perform_disagree_and_restore disagrees with the flag and restores the comment" do+ comment.trash!(user)+ reviewable.perform(moderator, :disagree_and_restore)++ expect(reviewable).to be_rejected+ expect(comment.reload.deleted_at).to be_nil+ end++ it "perform_ignore ignores the flag and does nothing" do+ reviewable.perform(moderator, :ignore)++ expect(reviewable).to be_ignored+ expect(comment.reload.deleted_at).not_to be_present+ end++ context "when the flagged comment author is silenced" do+ before do+ UserSilencer.silence(+ comment_poster,+ Discourse.system_user,+ silenced_till: 10.minutes.from_now,+ reason: I18n.t("post_voting.comment.errors.auto_silence_from_flags"),+ )+ end++ it "perform_disagree unsilences the user" do+ reviewable.perform(moderator, :disagree)++ expect(user.reload.silenced?).to eq(false)+ end++ it "perform_disagree_and_restore unsilences the user" do+ comment.trash!(user)+ reviewable.perform(moderator, :disagree_and_restore)++ expect(user.reload.silenced?).to eq(false)+ end+ end++ context "when author of the flagged comment is deleted" do+ it "deletes comment and review" do+ UserDestroyer.new(Discourse.system_user).destroy(comment_poster, { delete_posts: true })+ expect { comment_poster.reload }.to raise_error(ActiveRecord::RecordNotFound)+ expect { comment.reload }.to raise_error(ActiveRecord::RecordNotFound)+ expect { reviewable.reload }.to raise_error(ActiveRecord::RecordNotFound)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/models/topic_embed_spec.rb b/plugins/discourse-post-voting/spec/models/topic_embed_spec.rbnew file mode 100644index 00000000000..a32f6af3e9b--- /dev/null+++ b/plugins/discourse-post-voting/spec/models/topic_embed_spec.rb@@ -0,0 +1,65 @@+# frozen_string_literal: true++require "rails_helper"++describe TopicEmbed do+ fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }+ let(:title) { "How to turn a fish from good to evil in 30 seconds" }+ let(:url) { "http://eviltrout.com/123" }+ let(:contents) do+ "<p>hello world new post <a href='/hello'>hello</a> <img src='images/wat.jpg'></p>"+ end+ fab!(:embeddable_host)+ let(:category) { Fabricate(:category) }++ it "creates the topic with the right subtype in a category with `create_as_post_voting_default == true`" do+ category.custom_fields[PostVoting::CREATE_AS_POST_VOTING_DEFAULT] = true+ category.save!++ Jobs.run_immediately!+ imported_post =+ TopicEmbed.import(+ user,+ "http://eviltrout.com/abcd",+ title,+ "some random content",+ category_id: category.id,+ )++ expect(imported_post.topic.category).to eq(category)+ expect(imported_post.topic.subtype).to eq(Topic::POST_VOTING_SUBTYPE)+ end++ it "creates the topic with the right subtype in a category with `only_post_voting_in_this_category == true`" do+ category.custom_fields[PostVoting::ONLY_POST_VOTING_IN_THIS_CATEGORY] = true+ category.save!++ Jobs.run_immediately!+ imported_post =+ TopicEmbed.import(+ user,+ "http://eviltrout.com/abcd",+ title,+ "some random content",+ category_id: category.id,+ )++ expect(imported_post.topic.category).to eq(category)+ expect(imported_post.topic.subtype).to eq(Topic::POST_VOTING_SUBTYPE)+ end++ it "doesn't change the subtype when the category is not set to use post voting by default" do+ Jobs.run_immediately!+ imported_post =+ TopicEmbed.import(+ user,+ "http://eviltrout.com/abcd",+ title,+ "some random content",+ category_id: category.id,+ )++ expect(imported_post.topic.category).to eq(category)+ expect(imported_post.topic.subtype).not_to eq(Topic::POST_VOTING_SUBTYPE)+ end+enddiff --git a/plugins/discourse-post-voting/spec/models/topic_spec.rb b/plugins/discourse-post-voting/spec/models/topic_spec.rbnew file mode 100644index 00000000000..a45bab7010d--- /dev/null+++ b/plugins/discourse-post-voting/spec/models/topic_spec.rb@@ -0,0 +1,128 @@+# frozen_string_literal: true++require "rails_helper"++describe Topic do+ fab!(:user)+ fab!(:category)+ fab!(:topic) { Fabricate(:topic, category: category, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:topic_post) { Fabricate(:post, topic: topic) }++ fab!(:answers) { 5.times.map { Fabricate(:post, topic: topic) }.sort_by(&:post_number) }++ fab!(:comments) do+ answer = answers.first++ 5.times.map { Fabricate(:post_voting_comment, post: answer) }.sort_by(&:created_at)+ end++ let(:up) { PostVotingVote.directions[:up] }++ describe "validations" do+ describe "#subtype" do+ it "should not allow Post Voting formatted topics to be created when post_voting_enabled site setting is not enabled" do+ SiteSetting.post_voting_enabled = false++ topic =+ Fabricate.build(:topic, archetype: Archetype.default, subtype: Topic::POST_VOTING_SUBTYPE)++ expect(topic.valid?).to eq(false)+ expect(topic.errors.full_messages).to eq(+ [I18n.t("topic.post_voting.errors.post_voting_not_enabled")],+ )+ end++ it "should not allow topic to change to Post Voting subtype once it has been created" do+ topic_2 = Fabricate(:topic)+ topic_2.subtype = Topic::POST_VOTING_SUBTYPE++ expect(topic_2.valid?).to eq(false)+ expect(topic_2.errors.full_messages).to eq(+ [I18n.t("topic.post_voting.errors.cannot_change_to_post_voting_subtype")],+ )+ end++ it "should only allow Post Voting subtype to be set on regular topics" do+ topic =+ Fabricate.build(:topic, archetype: Archetype.default, subtype: Topic::POST_VOTING_SUBTYPE)++ expect(topic.valid?).to eq(true)++ topic.archetype = Archetype.private_message++ expect(topic.valid?).to eq(false)+ expect(topic.errors.full_messages).to eq(+ [I18n.t("topic.post_voting.errors.subtype_not_allowed")],+ )+ end+ end+ end++ it "should return correct comments" do+ comment_ids = comments.map(&:id)+ topic_comment_ids = topic.comments.pluck(:id)++ expect(comment_ids).to eq(topic_comment_ids)+ end++ it "should return correct answers" do+ answer_ids = answers.map(&:id)+ topic_answer_ids = topic.answers.pluck(:id)++ expect(answer_ids).to eq(topic_answer_ids)+ end++ it "should return correct answer_count" do+ expect(topic.answers.size).to eq(answers.size)+ end++ it "should return correct last_answered_at" do+ expected = answers.last.created_at++ expect(topic.last_answered_at).to eq_time(expected)+ end++ it "should return correct last_commented_on" do+ expected = comments.last.created_at++ expect(topic.last_commented_on).to eq_time(expected)+ end++ it "should return correct last_answer_post_number" do+ expected = answers.last.post_number++ expect(topic.last_answer_post_number).to eq(expected)+ end++ it "should return correct last_answerer" do+ expected = answers.last.user.id++ expect(topic.last_answerer.id).to eq(expected)+ end++ describe ".post_voting_votes" do+ it "should return nil if user is blank" do+ expect(Topic.post_voting_votes(topic, nil)).to eq(nil)+ end++ it "should return nil if disabled" do+ SiteSetting.post_voting_enabled = false++ expect(Topic.post_voting_votes(topic, user)).to eq(nil)+ end++ it "should return voted post IDs" do+ expected =+ answers+ .first(3)+ .map do |a|+ PostVoting::VoteManager.vote(a, user, direction: up)++ a.id+ end+ .sort++ expect(Topic.post_voting_votes(topic, user).pluck(:votable_id)).to contain_exactly(*expected)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/plugin_helper.rb b/plugins/discourse-post-voting/spec/plugin_helper.rbnew file mode 100644index 00000000000..284006481e6--- /dev/null+++ b/plugins/discourse-post-voting/spec/plugin_helper.rb@@ -0,0 +1,8 @@+# frozen_string_literal: true++RSpec.configure do |config|+ # this is so that fabricators can fabricate+ # since the creation of some models require+ # the plugin to be turned on+ SiteSetting.post_voting_enabled = true+enddiff --git a/plugins/discourse-post-voting/spec/requests/list_controller_spec.rb b/plugins/discourse-post-voting/spec/requests/list_controller_spec.rbnew file mode 100644index 00000000000..6a5d0a9b220--- /dev/null+++ b/plugins/discourse-post-voting/spec/requests/list_controller_spec.rb@@ -0,0 +1,54 @@+# frozen_string_literal: true++require "rails_helper"++describe ListController do+ fab!(:user)+ fab!(:category)+ fab!(:post_voting_topic) do+ Fabricate(:topic, category: category, subtype: Topic::POST_VOTING_SUBTYPE)+ end+ fab!(:post_voting_topic_post) { Fabricate(:post, topic: post_voting_topic) }+ fab!(:post_voting_topic_answer) { create_post(topic: post_voting_topic, reply_to_post: nil) }+ fab!(:topic)++ before do+ SiteSetting.post_voting_enabled = true+ sign_in(user)+ end++ it "should return the right attributes for Post Voting topics" do+ TopicUser.create!(user: user, topic: post_voting_topic, last_read_post_number: 2)+ TopicUser.create!(user: user, topic: topic, last_read_post_number: 2)++ get "/latest.json"++ expect(response.status).to eq(200)++ topics = response.parsed_body["topic_list"]["topics"]+ post_voting = topics.find { |t| t["id"] == post_voting_topic.id }+ non_post_voting = topics.find { |t| t["id"] == topic.id }++ expect(post_voting["is_post_voting"]).to eq(true)+ expect(non_post_voting["is_post_voting"]).to eq(nil)+ end++ it "should return the right attributes when Post Voting is disabled" do+ SiteSetting.post_voting_enabled = false++ TopicUser.create!(user: user, topic: post_voting_topic, last_read_post_number: 2)+ TopicUser.create!(user: user, topic: topic, last_read_post_number: 2)++ get "/latest.json"++ expect(response.status).to eq(200)++ topics = response.parsed_body["topic_list"]["topics"]++ post_voting = topics.find { |t| t["id"] == post_voting_topic.id }+ non_post_voting = topics.find { |t| t["id"] == topic.id }++ expect(post_voting["is_post_voting"]).to eq(nil)+ expect(non_post_voting["is_post_voting"]).to eq(nil)+ end+enddiff --git a/plugins/discourse-post-voting/spec/requests/post_voting/comments_controller_spec.rb b/plugins/discourse-post-voting/spec/requests/post_voting/comments_controller_spec.rbnew file mode 100644index 00000000000..0469e2f02ec--- /dev/null+++ b/plugins/discourse-post-voting/spec/requests/post_voting/comments_controller_spec.rb@@ -0,0 +1,366 @@+# frozen_string_literal: true++require "rails_helper"++RSpec.describe PostVoting::CommentsController do+ fab!(:user)+ fab!(:admin)+ fab!(:moderator)+ fab!(:group)+ fab!(:category)+ fab!(:topic) { Fabricate(:topic, category: category, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:topic_post) { Fabricate(:post, topic: topic) }+ fab!(:answer) { Fabricate(:post, topic: topic) }+ let(:comment) { Fabricate(:post_voting_comment, post: answer) }+ let(:comment_2) { Fabricate(:post_voting_comment, post: answer) }+ let(:comment_3) { Fabricate(:post_voting_comment, post: answer) }++ before do+ SiteSetting.post_voting_enabled = true+ comment+ comment_2+ comment_3+ end++ describe "#load_comments" do+ it "returns the right response when user is not allowed to view post" do+ category.update!(read_restricted: true)++ get "/post_voting/comments.json", params: { post_id: answer.id, last_comment_id: comment.id }++ expect(response.status).to eq(403)+ end++ it "returns the right response when post_id is invalid" do+ get "/post_voting/comments.json", params: { post_id: -999_999, last_comment_id: comment.id }++ expect(response.status).to eq(404)+ end++ it "returns the right response" do+ get "/post_voting/comments.json", params: { post_id: answer.id, last_comment_id: comment.id }++ expect(response.status).to eq(200)+ payload = response.parsed_body++ expect(payload["comments"].length).to eq(2)++ comment = payload["comments"].first++ expect(comment["id"]).to eq(comment_2.id)+ expect(comment["name"]).to eq(comment_2.user.name)+ expect(comment["username"]).to eq(comment_2.user.username)+ expect(comment["created_at"].present?).to eq(true)+ expect(comment["cooked"]).to eq(comment_2.cooked)++ comment = payload["comments"].last++ expect(comment["id"]).to eq(comment_3.id)+ end+ end++ describe "#create" do+ before { sign_in(user) }++ it "returns the right response when user is not allowed to create post" do+ category.set_permissions(group => :readonly)+ category.save!++ post "/post_voting/comments.json", params: { post_id: answer.id, raw: "this is some content" }++ expect(response.status).to eq(403)+ end++ it "returns the right response when post_id is invalid" do+ post "/post_voting/comments.json", params: { post_id: -999_999, raw: "this is some content" }++ expect(response.status).to eq(404)+ end++ it "publishes a comment created MessageBus message when a new comment is created" do+ message =+ MessageBus+ .track_publish("/topic/#{answer.topic_id}") do+ expect do+ post "/post_voting/comments.json",+ params: {+ post_id: answer.id,+ raw: "this is some content",+ }++ expect(response.status).to eq(200)+ end.to change { answer.reload.post_voting_comments.count }.by(1)+ end+ .first++ comment = answer.post_voting_comments.last+ payload = message[:data]++ expect(payload[:comment][:id]).to eq(comment.id)+ expect(payload[:comment][:user_id]).to eq(user.id)+ expect(payload[:comment][:name]).to eq(user.name)+ expect(payload[:comment][:username]).to eq(user.username)+ expect(payload[:comment][:created_at]).to be_present+ expect(payload[:comment][:raw]).to eq("this is some content")+ expect(payload[:comment][:cooked]).to eq("<p>this is some content</p>")+ expect(payload[:comment][:post_voting_vote_count]).to eq(0)+ expect(payload[:comment][:user_voted]).to eq(false)+ end++ it "publishes a notification when a new comment is created" do+ answer.user.update!(last_seen_at: Time.zone.now) # User has to be seen recently to trigger notification alert message++ message =+ MessageBus+ .track_publish("/notification-alert/#{answer.user_id}") do+ expect do+ post "/post_voting/comments.json",+ params: {+ post_id: answer.id,+ raw: "this is some content",+ }++ expect(response.status).to eq(200)+ end.to change { answer.user.notifications.count }.by(1)+ end+ .first++ notification = answer.user.notifications.last+ comment = PostVotingComment.last++ expect(notification.notification_type).to eq(+ Notification.types[:question_answer_user_commented],+ )+ expect(notification.user_id).to eq(answer.user_id)+ expect(notification.post_number).to eq(answer.post_number)+ expect(notification.topic_id).to eq(answer.topic_id)++ expect(notification.data).to eq(+ { post_voting_comment_id: comment.id, display_username: user.username }.to_json,+ )++ expect(message.data[:notification_type]).to eq(+ Notification.types[:question_answer_user_commented],+ )+ end++ it "returns the right response after creating a new comment" do+ expect do+ post "/post_voting/comments.json",+ params: {+ post_id: answer.id,+ raw: "this is some content",+ }++ expect(response.status).to eq(200)+ end.to change { answer.reload.post_voting_comments.count }.by(1)++ payload = response.parsed_body+ comment = answer.post_voting_comments.last++ expect(payload["id"]).to eq(comment.id)+ expect(payload["name"]).to eq(user.name)+ expect(payload["username"]).to eq(user.username)+ expect(payload["cooked"]).to eq(comment.cooked)+ end+ end++ describe "#update" do+ it "should return 403 for an anon user" do+ put "/post_voting/comments.json",+ params: {+ comment_id: comment.id,+ raw: "this is some new raw",+ }++ expect(response.status).to eq(403)+ end++ it "should return 404 when comment_id is not associated to a valid record" do+ sign_in(comment.user)++ put "/post_voting/comments.json",+ params: {+ comment_id: -999_999,+ raw: "this is some new raw",+ }++ expect(response.status).to eq(404)+ end++ it "should return 403 when trying to update a comment on a post the user cannot see" do+ sign_in(comment.user)++ category.set_permissions(group => :readonly)+ category.save!++ put "/post_voting/comments.json",+ params: {+ comment_id: comment.id,+ raw: "this is some new raw",+ }++ expect(response.status).to eq(403)+ end++ it "should return 403 when a user is trying to update the comment of another user" do+ sign_in(Fabricate(:user))++ put "/post_voting/comments.json",+ params: {+ comment_id: comment.id,+ raw: "this is some new raw",+ }++ expect(response.status).to eq(403)+ end++ it "should allow an admin to update the comment" do+ sign_in(admin)++ put "/post_voting/comments.json",+ params: {+ comment_id: comment.id,+ raw: "this is some new raw",+ }++ expect(response.status).to eq(200)++ body = response.parsed_body++ expect(body["raw"]).to eq("this is some new raw")+ expect(body["cooked"]).to eq("<p>this is some new raw</p>")+ end++ it "should allow a moderator to update the comment" do+ sign_in(moderator)++ put "/post_voting/comments.json",+ params: {+ comment_id: comment.id,+ raw: "this is some new raw",+ }++ expect(response.status).to eq(200)++ body = response.parsed_body++ expect(body["raw"]).to eq("this is some new raw")+ expect(body["cooked"]).to eq("<p>this is some new raw</p>")+ end++ it "should allow users to update their own comment and publishes a MessageBus message" do+ sign_in(comment.user)++ message =+ MessageBus+ .track_publish("/topic/#{comment.post.topic_id}") do+ put "/post_voting/comments.json",+ params: {+ comment_id: comment.id,+ raw: "this is some new raw",+ }++ expect(response.status).to eq(200)+ end+ .first++ body = response.parsed_body++ expect(body["raw"]).to eq("this is some new raw")+ expect(body["cooked"]).to eq("<p>this is some new raw</p>")++ expect(message.data[:id]).to eq(comment.post_id)+ expect(message.data[:comment_id]).to eq(comment.id)+ expect(message.data[:comment_raw]).to eq("this is some new raw")+ expect(message.data[:comment_cooked]).to eq("<p>this is some new raw</p>")+ end+ end++ describe "#destroy" do+ it "should return 403 for an anon user" do+ delete "/post_voting/comments.json", params: { comment_id: comment.id }++ expect(response.status).to eq(403)+ end++ it "should return 404 when comment_id param given does not exist" do+ sign_in(comment.user)++ delete "/post_voting/comments.json", params: { comment_id: -99_999 }++ expect(response.status).to eq(404)+ end++ it "should return 403 when trying to delete a comment on a post the user cannot see" do+ sign_in(comment.user)++ category.set_permissions(group => :readonly)+ category.save!++ delete "/post_voting/comments.json", params: { comment_id: comment.id }++ expect(response.status).to eq(403)+ end++ it "should return 403 when a user is trying to delete another user's comment" do+ sign_in(Fabricate(:user))++ delete "/post_voting/comments.json", params: { comment_id: comment.id }++ expect(response.status).to eq(403)+ end++ it "should allow an admin to delete a comment of another user" do+ sign_in(admin)++ delete "/post_voting/comments.json", params: { comment_id: comment.id }++ expect(response.status).to eq(200)+ expect(+ PostVotingComment+ .with_deleted+ .where("deleted_at IS NOT NULL AND id = ?", comment.id)+ .exists?,+ ).to eq(true)+ end++ it "should allow a moderator to delete a comment of another user" do+ sign_in(moderator)++ delete "/post_voting/comments.json", params: { comment_id: comment.id }++ expect(response.status).to eq(200)+ expect(+ PostVotingComment+ .with_deleted+ .where("deleted_at IS NOT NULL AND id = ?", comment.id)+ .exists?,+ ).to eq(true)+ end++ it "should allow users to delete their own comment and publishes a message bus message" do+ sign_in(comment.user)++ message =+ MessageBus+ .track_publish("/topic/#{comment.post.topic_id}") do+ delete "/post_voting/comments.json", params: { comment_id: comment.id }++ expect(response.status).to eq(200)+ end+ .first++ expect(message.data[:id]).to eq(comment.post_id)+ expect(message.data[:comment_id]).to eq(comment.id)+ expect(message.data[:comments_count]).to eq(2)++ expect(+ PostVotingComment+ .with_deleted+ .where("deleted_at IS NOT NULL AND id = ?", comment.id)+ .exists?,+ ).to eq(true)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/requests/post_voting/votes_controller_spec.rb b/plugins/discourse-post-voting/spec/requests/post_voting/votes_controller_spec.rbnew file mode 100644index 00000000000..3c041e14b1e--- /dev/null+++ b/plugins/discourse-post-voting/spec/requests/post_voting/votes_controller_spec.rb@@ -0,0 +1,286 @@+# frozen_string_literal: true++require "rails_helper"++RSpec.describe PostVoting::VotesController do+ fab!(:user)+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:topic_post) { Fabricate(:post, topic: topic) }+ fab!(:answer) { Fabricate(:post, topic: topic) }+ fab!(:answer_2) { Fabricate(:post, topic: topic) }+ fab!(:answer_3) { Fabricate(:post, topic: topic, user: user) }++ fab!(:admin)+ fab!(:category)++ before { SiteSetting.post_voting_enabled = true }++ describe "#create" do+ before { sign_in(user) }++ it "returns the right response when user does not have access to post" do+ topic.update!(category: category)+ category.update!(read_restricted: true)++ post "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(403)+ end++ it "should be successful if post has never been voted" do+ post "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(200)++ vote = answer.post_voting_votes.first++ expect(vote.votable_type).to eq("Post")+ expect(vote.votable_id).to eq(answer.id)+ expect(vote.user_id).to eq(user.id)+ end++ it "should error if already voted" do+ post "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(200)++ post "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(403)+ end++ context "when topic archived or closed" do+ it "returns an error when the topic is archived" do+ topic.update(archived: true)++ post "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(403)+ expect(JSON.parse(response.body)["errors"][0]).to eq(+ I18n.t("post.post_voting.errors.vote_archived_topic", count: 1),+ )+ end++ it "returns an error when the topic is closed" do+ topic.update(closed: true)++ post "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(403)+ expect(JSON.parse(response.body)["errors"][0]).to eq(+ I18n.t("post.post_voting.errors.vote_closed_topic", count: 1),+ )+ end+ end++ it "should return 403 if user votes on a post by self" do+ post "/post_voting/vote.json", params: { post_id: answer_3.id }++ expect(response.status).to eq(403)+ end++ it "should return 403 after post_voting_undo_vote_action_window" do+ SiteSetting.post_voting_undo_vote_action_window = 1++ post "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(200)++ freeze_time 2.minutes.from_now do+ post "/post_voting/vote.json",+ params: {+ post_id: answer.id,+ direction: PostVotingVote.directions[:down],+ }++ expect(response.status).to eq(403)+ expect(JSON.parse(response.body)["errors"][0]).to eq(+ I18n.t("vote.error.undo_vote_action_window", count: 1),+ )+ end+ end+ end++ describe "#destroy" do+ before { sign_in(user) }++ it "should success if has voted" do+ post "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(200)++ vote = answer.post_voting_votes.first++ expect(vote.votable).to eq(answer)+ expect(vote.user_id).to eq(user.id)++ delete "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(200)+ expect(PostVotingVote.exists?(id: vote.id)).to eq(false)+ end++ it "should return the right response if user has never voted on post" do+ delete "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(403)+ end++ it "should cant undo vote" do+ SiteSetting.post_voting_undo_vote_action_window = 1++ post "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(200)++ freeze_time 2.minutes.from_now do+ delete "/post_voting/vote.json", params: { post_id: answer.id }++ expect(response.status).to eq(403)+ expect(JSON.parse(response.body)["errors"][0]).to eq(+ I18n.t("vote.error.undo_vote_action_window", count: 1),+ )+ end+ end+ end++ describe "#voters" do+ fab!(:user)++ it "should return the right response for an anon user" do+ get "/post_voting/voters.json", params: { post_id: answer.id }++ expect(response.status).to eq(403)+ end++ it "should return the right response if post does not exist" do+ sign_in(user)++ get "/post_voting/voters.json", params: { post_id: -1 }++ expect(response.status).to eq(404)+ end++ it "should return correct users respecting limits" do+ sign_in(user)++ user_2 = Fabricate(:user)+ Fabricate(+ :post_voting_vote,+ votable: answer,+ user: user_2,+ direction: PostVotingVote.directions[:down],+ )+ Fabricate(:post_voting_vote, votable: answer, user: user)+ Fabricate(:post_voting_vote, votable: answer_2, user: user)++ stub_const(PostVoting::VotesController, "VOTERS_LIMIT", 2) do+ get "/post_voting/voters.json", params: { post_id: answer.id }+ end++ expect(response.status).to eq(200)++ parsed = JSON.parse(response.body)+ voters = parsed["voters"]++ expect(voters.map { |v| v["id"] }).to contain_exactly(user_2.id, user.id)++ expect(voters[0]["id"]).to eq(user.id)+ expect(voters[0]["username"]).to eq(user.username)+ expect(voters[0]["name"]).to eq(user.name)+ expect(voters[0]["avatar_template"]).to eq(user.avatar_template)+ expect(voters[0]["direction"]).to eq(PostVotingVote.directions[:up])++ expect(voters[1]["id"]).to eq(user_2.id)+ expect(voters[1]["direction"]).to eq(PostVotingVote.directions[:down])+ end+ end++ describe "#create_comment_vote" do+ let(:comment) { Fabricate(:post_voting_comment, post: answer) }+ let(:comment_2) { Fabricate(:post_voting_comment, post: answer, user: user) }++ it "should return 403 for an anon user" do+ post "/post_voting/vote/comment.json", params: { comment_id: comment.id }++ expect(response.status).to eq(403)+ end++ it "should return 404 if comment_id param is not valid" do+ sign_in(user)++ post "/post_voting/vote/comment.json", params: { comment_id: -999 }++ expect(response.status).to eq(404)+ end++ it "should return 403 if user is not allowed to see comment" do+ sign_in(user)++ topic.update!(category: category)+ category.update!(read_restricted: true)++ post "/post_voting/vote/comment.json", params: { comment_id: comment.id }++ expect(response.status).to eq(403)+ end++ it "should return 403 if user votes on a comment by self" do+ sign_in(user)++ post "/post_voting/vote/comment.json", params: { comment_id: comment_2.id }++ expect(response.status).to eq(403)+ end++ it "allows user to vote on a comment" do+ sign_in(user)++ expect do+ post "/post_voting/vote/comment.json", params: { comment_id: comment.id }++ expect(response.status).to eq(200)+ end.to change { comment.reload.votes.length }.from(0).to(1)++ expect(comment.qa_vote_count).to eq(1)+ end+ end++ describe "#destroy_comment_vote" do+ let(:comment) { Fabricate(:post_voting_comment, post: answer) }++ it "should return 403 for an anon user" do+ delete "/post_voting/vote/comment.json", params: { comment_id: comment.id }++ expect(response.status).to eq(403)+ end++ it "should return 404 if comment_id param is not valid" do+ sign_in(user)++ delete "/post_voting/vote/comment.json", params: { comment_id: -999 }++ expect(response.status).to eq(404)+ end++ it "should return 403 if user has not voted on comment" do+ sign_in(user)++ delete "/post_voting/vote/comment.json", params: { comment_id: comment.id }++ expect(response.status).to eq(403)+ end++ it "should be able to remove a user's vote from a comment" do+ PostVoting::VoteManager.vote(comment, user, direction: PostVotingVote.directions[:up])++ sign_in(user)++ expect do+ delete "/post_voting/vote/comment.json", params: { comment_id: comment.id }++ expect(response.status).to eq(200)+ end.to change { comment.reload.votes.length }.from(1).to(0)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/requests/posts_controller_spec.rb b/plugins/discourse-post-voting/spec/requests/posts_controller_spec.rbnew file mode 100644index 00000000000..d926cee772a--- /dev/null+++ b/plugins/discourse-post-voting/spec/requests/posts_controller_spec.rb@@ -0,0 +1,56 @@+# frozen_string_literal: true++describe PostsController do+ fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }++ describe "#create" do+ before do+ sign_in(user)+ SiteSetting.post_voting_enabled = true+ end++ it "creates a topic with the right subtype when create_as_post_voting param is provided" do+ post "/posts.json",+ params: {+ raw: "this is some raw",+ title: "this is some title",+ create_as_post_voting: true,+ }++ expect(response.status).to eq(200)++ topic = Topic.last++ expect(topic.is_post_voting?).to eq(true)+ end++ it "ignores create_as_post_voting param when trying to create private message" do+ Group.refresh_automatic_groups!+ post "/posts.json",+ params: {+ raw: "this is some raw",+ title: "this is some title",+ create_as_post_voting: true,+ archetype: Archetype.private_message,+ target_recipients: user.username,+ }++ expect(response.status).to eq(200)++ topic = Topic.last++ expect(topic.is_post_voting?).to eq(false)+ end++ it "returns all post-voting fields" do+ topic = Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE)++ post "/posts.json", params: { raw: "this is some raw", topic_id: topic.id }++ expect(response.parsed_body["post_voting_vote_count"]).to eq(0)+ expect(response.parsed_body["post_voting_has_votes"]).to eq(false)+ expect(response.parsed_body["comments"]).to eq([])+ expect(response.parsed_body["comments_count"]).to eq(0)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/requests/topics_controller_spec.rb b/plugins/discourse-post-voting/spec/requests/topics_controller_spec.rbnew file mode 100644index 00000000000..67fc392c4c5--- /dev/null+++ b/plugins/discourse-post-voting/spec/requests/topics_controller_spec.rb@@ -0,0 +1,71 @@+# frozen_string_literal: true++describe TopicsController do+ fab!(:user)+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:post) { create_post(topic: topic) }+ fab!(:comment) { Fabricate(:post_voting_comment, raw: "this is a comment!", post: post) }++ fab!(:answer) { create_post(topic: topic) }+ fab!(:answer_2) { create_post(topic: topic) }+ fab!(:answer_3) { create_post(topic: topic) }++ fab!(:vote) do+ PostVoting::VoteManager.vote(answer_2, user, direction: PostVotingVote.directions[:up])+ end++ fab!(:vote_2) do+ PostVoting::VoteManager.vote(answer, user, direction: PostVotingVote.directions[:down])+ end++ before { SiteSetting.post_voting_enabled = true }++ describe "#show" do+ it "orders posts by number of votes for a Post Voting topic" do+ get "/t/#{topic.id}.json"++ expect(response.status).to eq(200)++ payload = response.parsed_body++ expect(payload["post_stream"]["posts"].map { |p| p["id"] }).to eq(+ [post.id, answer_2.id, answer_3.id, answer.id],+ )+ end++ it "does not error for topic views without any posts" do+ get "/t/#{topic.id}.json?page=2"++ expect(response.status).to eq(404)+ end++ it "orders posts by date of creation when 'activity' filter is provided" do+ get "/t/#{topic.id}.json?filter=#{TopicView::ACTIVITY_FILTER}"++ expect(response.status).to eq(200)++ payload = response.parsed_body++ expect(payload["post_stream"]["posts"].map { |p| p["id"] }).to eq(+ [post.id, answer.id, answer_2.id, answer_3.id],+ )+ end++ it "includes post_voting comments for crawler view" do+ skip "temporarily disable crawler view test while the perf issues are being worked on"++ get "/t/#{topic.slug}/#{topic.id}.html"++ expect(response.status).to eq(200)++ crawler_html = response.body++ expect(crawler_html).to match(+ %r{<span class="post-voting-comment-cooked" itemprop="comment"><p>this is a comment!</p></span>},+ )+ expect(crawler_html).to match(+ %r{<span class="post-voting-answer-count-span" itemprop="answerCount">3</span>},+ )+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/serializers/basic_category_serializer_spec.rb b/plugins/discourse-post-voting/spec/serializers/basic_category_serializer_spec.rbnew file mode 100644index 00000000000..d9643f6ecc2--- /dev/null+++ b/plugins/discourse-post-voting/spec/serializers/basic_category_serializer_spec.rb@@ -0,0 +1,33 @@+# frozen_string_literal: true++require "rails_helper"++describe BasicCategorySerializer do+ fab!(:category)++ let(:serialized) do+ serializer = BasicCategorySerializer.new(category, root: false)+ serializer.as_json+ end++ before do+ category.custom_fields[PostVoting::CREATE_AS_POST_VOTING_DEFAULT] = true+ category.save_custom_fields(true)+ end++ context "with qa enabled" do+ before { SiteSetting.post_voting_enabled = true }++ it "should return post_voting category attributes" do+ expect(serialized[:create_as_post_voting_default]).to eq(true)+ end+ end++ context "with qa disabled" do+ before { SiteSetting.post_voting_enabled = false }++ it "should not return qa category attributes" do+ expect(serialized.key?(:create_as_post_voting_default)).to eq(false)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/serializers/post_voting/comment_serializer_spec.rb b/plugins/discourse-post-voting/spec/serializers/post_voting/comment_serializer_spec.rbnew file mode 100644index 00000000000..4d342cf73b2--- /dev/null+++ b/plugins/discourse-post-voting/spec/serializers/post_voting/comment_serializer_spec.rb@@ -0,0 +1,58 @@+# frozen_string_literal: true++require "rails_helper"++describe PostVotingCommentSerializer do+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:post) { Fabricate(:post, topic: topic) }+ fab!(:user)+ fab!(:comment) { Fabricate(:post_voting_comment, post: post) }++ before do+ SiteSetting.post_voting_enabled = true+ PostVoting::VoteManager.vote(comment, post.user)+ end++ context "with a comment user" do+ it "returns the right attributes for an anonymous user" do+ serializer = described_class.new(comment, scope: Guardian.new)+ serilized_comment = serializer.as_json[:post_voting_comment]++ expect(serilized_comment[:id]).to eq(comment.id)+ expect(serilized_comment[:created_at]).to eq_time(comment.created_at)+ expect(serilized_comment[:post_voting_vote_count]).to eq(1)+ expect(serilized_comment[:cooked]).to eq(comment.cooked)+ expect(serilized_comment[:name]).to eq(comment.user.name)+ expect(serilized_comment[:username]).to eq(comment.user.username)+ end++ it "returns the right attributes for logged in user" do+ serializer = described_class.new(comment, scope: Guardian.new(post.user))+ serilized_comment = serializer.as_json[:post_voting_comment]++ expect(serilized_comment[:id]).to eq(comment.id)+ expect(serilized_comment[:created_at]).to eq_time(comment.created_at)+ expect(serilized_comment[:post_voting_vote_count]).to eq(1)+ expect(serilized_comment[:cooked]).to eq(comment.cooked)+ expect(serilized_comment[:name]).to eq(comment.user.name)+ expect(serilized_comment[:username]).to eq(comment.user.username)+ expect(serilized_comment[:user_voted]).to eq(true)+ end+ end++ context "with a deleted comment user" do+ before do+ comment.user.destroy+ comment.reload+ end++ it "does not fail to serialize" do+ serializer = described_class.new(comment, scope: Guardian.new(post.user))+ serilized_comment = serializer.as_json[:post_voting_comment]++ expect(serilized_comment[:id]).to eq(comment.id)+ expect(serilized_comment[:name]).to be_nil+ expect(serilized_comment[:username]).to be_nil+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/serializers/post_voting/post_serializer_spec.rb b/plugins/discourse-post-voting/spec/serializers/post_voting/post_serializer_spec.rbnew file mode 100644index 00000000000..8a777bf67c8--- /dev/null+++ b/plugins/discourse-post-voting/spec/serializers/post_voting/post_serializer_spec.rb@@ -0,0 +1,44 @@+# frozen_string_literal: true++require "rails_helper"++describe PostVoting::PostSerializerExtension do+ fab!(:user)+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:topic_post) { Fabricate(:post, topic: topic) }+ fab!(:answer) { Fabricate(:post, topic: topic) }+ fab!(:comment) { Fabricate(:post_voting_comment, post: answer) }+ let(:topic_view) { TopicView.new(topic, user) }+ let(:up) { PostVotingVote.directions[:up] }+ let(:guardian) { Guardian.new(user) }++ let(:serialized) do+ serializer = PostSerializer.new(answer, scope: guardian, root: false)+ serializer.topic_view = topic_view+ serializer.as_json+ end++ context "with qa enabled" do+ before { SiteSetting.post_voting_enabled = true }++ it "should return the right attributes" do+ PostVoting::VoteManager.vote(answer, user, direction: up)++ expect(serialized[:post_voting_vote_count]).to eq(1)+ expect(serialized[:post_voting_user_voted_direction]).to eq(up)+ expect(serialized[:comments_count]).to eq(1)+ expect(serialized[:comments].first[:id]).to eq(comment.id)+ end+ end++ context "with qa disabled" do+ before { SiteSetting.post_voting_enabled = false }++ it "should not include dependent_keys" do+ expect(serialized[:qa_vote_count]).to eq(nil)+ expect(serialized[:qa_user_voted_direction]).to eq(nil)+ expect(serialized[:comments_count]).to eq(nil)+ expect(serialized[:comments]).to eq(nil)+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/serializers/post_voting/topic_view_serializer_spec.rb b/plugins/discourse-post-voting/spec/serializers/post_voting/topic_view_serializer_spec.rbnew file mode 100644index 00000000000..772133c8e06--- /dev/null+++ b/plugins/discourse-post-voting/spec/serializers/post_voting/topic_view_serializer_spec.rb@@ -0,0 +1,60 @@+# frozen_string_literal: true++require "rails_helper"++describe PostVoting::TopicViewSerializerExtension do+ fab!(:topic) { Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE) }+ fab!(:topic_post) { Fabricate(:post, topic: topic) }+ fab!(:answer) { Fabricate(:post, topic: topic, reply_to_post_number: nil) }+ fab!(:comment) { Fabricate(:post_voting_comment, post: answer) }+ fab!(:user)+ fab!(:guardian) { Guardian.new(user) }+ let(:topic_view) { TopicView.new(topic, user) }++ before { SiteSetting.post_voting_enabled = true }++ it "should return correct values" do+ PostVoting::VoteManager.vote(topic_post, user)+ PostVoting::VoteManager.vote(answer, user)+ PostVoting::VoteManager.vote(answer, Fabricate(:user))+ PostVoting::VoteManager.vote(comment, user)++ payload = TopicViewSerializer.new(topic_view, scope: guardian, root: false).as_json++ expect(payload[:last_answered_at]).to eq(answer.created_at)+ expect(payload[:last_commented_on]).to eq(comment.created_at)+ expect(payload[:answer_count]).to eq(1)+ expect(payload[:last_answer_post_number]).to eq(answer.post_number)+ expect(payload[:last_answerer][:id]).to eq(answer.user.id)++ posts = payload[:post_stream][:posts]++ expect(posts.first[:id]).to eq(topic_post.id)+ expect(posts.first[:post_voting_user_voted_direction]).to eq(PostVotingVote.directions[:up])+ expect(posts.first[:post_voting_has_votes]).to eq(true)+ expect(posts.first[:post_voting_vote_count]).to eq(1)+ expect(posts.first[:comments]).to eq([])+ expect(posts.first[:comments_count]).to eq(0)++ expect(posts.last[:id]).to eq(answer.id)+ expect(posts.last[:post_voting_user_voted_direction]).to eq(PostVotingVote.directions[:up])+ expect(posts.last[:post_voting_has_votes]).to eq(true)+ expect(posts.last[:post_voting_vote_count]).to eq(2)+ expect(posts.last[:comments].map { |c| c[:id] }).to contain_exactly(comment.id)+ expect(posts.last[:comments].first[:user_voted]).to eq(true)+ expect(posts.last[:comments_count]).to eq(1)+ end++ it "should not include dependent_attrs when plugin is disabled" do+ SiteSetting.post_voting_enabled = false++ payload = TopicViewSerializer.new(topic_view, scope: guardian, root: false).as_json++ expect(payload[:post_voting_enabled]).to eq(nil)+ expect(payload[:last_answered_at]).to eq(nil)+ expect(payload[:last_commented_on]).to eq(nil)+ expect(payload[:answer_count]).to eq(nil)+ expect(payload[:last_answer_post_number]).to eq(nil)+ expect(payload[:last_answerer]).to eq(nil)+ end+enddiff --git a/plugins/discourse-post-voting/spec/system/core_features_spec.rb b/plugins/discourse-post-voting/spec/system/core_features_spec.rbnew file mode 100644index 00000000000..db86db283bd--- /dev/null+++ b/plugins/discourse-post-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-post-voting/spec/system/page_objects/pages/post_voting_topic.rb b/plugins/discourse-post-voting/spec/system/page_objects/pages/post_voting_topic.rbnew file mode 100644index 00000000000..be84ba755c9--- /dev/null+++ b/plugins/discourse-post-voting/spec/system/page_objects/pages/post_voting_topic.rb@@ -0,0 +1,11 @@+# frozen_string_literal: true++module PageObjects+ module Pages+ class PostVotingTopic < PageObjects::Pages::Topic+ COMMENT_VOTE_BUTTON = ".post-voting-comment-actions-vote button"+ POST_VOTE_BUTTON = ".post-voting-post button"+ COMMENT_ACTIONS = ".post-voting-comment-actions"+ end+ end+enddiff --git a/plugins/discourse-post-voting/spec/system/post_voting_spec.rb b/plugins/discourse-post-voting/spec/system/post_voting_spec.rbnew file mode 100644index 00000000000..a0a707bef6a--- /dev/null+++ b/plugins/discourse-post-voting/spec/system/post_voting_spec.rb@@ -0,0 +1,40 @@+# frozen_string_literal: true++RSpec.describe "Post voting", type: :system do+ fab!(:admin) { Fabricate(:admin, refresh_auto_groups: true) }+ fab!(:user1) { Fabricate(:user, refresh_auto_groups: true) }+ fab!(:user2) { Fabricate(:user, refresh_auto_groups: true) }++ let(:topic_page) { PageObjects::Pages::PostVotingTopic.new }++ %w[enabled disabled].each do |value|+ before { SiteSetting.glimmer_post_stream_mode = value }++ context "when glimmer_post_stream_mode=#{value}" do+ it "disallows voting on archived or closed topics" do+ SiteSetting.post_voting_enabled = true+ topic = Fabricate(:topic, subtype: Topic::POST_VOTING_SUBTYPE, user: user2, archived: true)+ Fabricate(:post, topic: topic, post_number: 2)+ post = Fabricate(:post, topic: topic, post_number: 3)+ Fabricate(:post_voting_comment, post: post, user: user1)++ sign_in(user1)++ topic_page.visit_topic(topic)++ expect(page).to have_css(PageObjects::Pages::PostVotingTopic::POST_VOTE_BUTTON, count: 4)+ expect(page).to have_css(+ "#{PageObjects::Pages::PostVotingTopic::POST_VOTE_BUTTON}:disabled",+ count: 4,+ )+ expect(page).to have_css(+ "#{PageObjects::Pages::PostVotingTopic::COMMENT_VOTE_BUTTON}:disabled",+ )+ expect(page).to have_no_css(+ PageObjects::Pages::PostVotingTopic::COMMENT_ACTIONS,+ visible: :all,+ )+ end+ end+ end+enddiff --git a/plugins/discourse-post-voting/test/javascripts/acceptance/category-edit-test.js b/plugins/discourse-post-voting/test/javascripts/acceptance/category-edit-test.jsnew file mode 100644index 00000000000..765d6e4c621--- /dev/null+++ b/plugins/discourse-post-voting/test/javascripts/acceptance/category-edit-test.js@@ -0,0 +1,35 @@+import { click, visit } from "@ember/test-helpers";+import { test } from "qunit";+import pretender from "discourse/tests/helpers/create-pretender";+import { acceptance } from "discourse/tests/helpers/qunit-helpers";++acceptance("Category Edit", function (needs) {+ needs.user();+ needs.settings({ post_voting_enabled: true });++ test("Editing the category to create_as_post_voting_default", async function (assert) {+ await visit("/c/bug/edit/settings");+ await click("#create-as-post-voting-default");++ await click("#save-category");++ const payload = JSON.parse(+ pretender.handledRequests[pretender.handledRequests.length - 1]+ .requestBody+ );+ assert.true(payload.custom_fields.create_as_post_voting_default);+ });++ test("Editing the category to only_post_voting_in_this_category", async function (assert) {+ await visit("/c/bug/edit/settings");+ await click("#only-post-voting-in-this-category");++ await click("#save-category");++ const payload = JSON.parse(+ pretender.handledRequests[pretender.handledRequests.length - 1]+ .requestBody+ );+ assert.true(payload.custom_fields.only_post_voting_in_this_category);+ });+});diff --git a/plugins/discourse-post-voting/test/javascripts/acceptance/composer-test.js b/plugins/discourse-post-voting/test/javascripts/acceptance/composer-test.jsnew file mode 100644index 00000000000..d356efd6af2--- /dev/null+++ b/plugins/discourse-post-voting/test/javascripts/acceptance/composer-test.js@@ -0,0 +1,128 @@+import { click, fillIn, visit } from "@ember/test-helpers";+import { test } from "qunit";+import Category from "discourse/models/category";+import { parsePostData } from "discourse/tests/helpers/create-pretender";+import { acceptance } from "discourse/tests/helpers/qunit-helpers";+import selectKit from "discourse/tests/helpers/select-kit-helper";+import { i18n } from "discourse-i18n";++let createAsPostVotingSetInRequest = false;++acceptance("Discourse Post Voting - composer", function (needs) {+ needs.user();+ needs.settings({ post_voting_enabled: true });++ needs.hooks.afterEach(function () {+ createAsPostVotingSetInRequest = false;+ });++ needs.pretender((server, helper) => {+ server.post("/posts", (request) => {+ if (+ parsePostData(request.requestBody).create_as_post_voting === "true" ||+ parsePostData(request.requestBody).only_post_voting_in_this_category ===+ "true"+ ) {+ createAsPostVotingSetInRequest = true;+ }++ return helper.response({+ post: {+ topic_id: 280,+ },+ });+ });+ });++ test("Creating new topic with post voting format", async function (assert) {+ await visit("/");+ await click("#create-topic");++ const categoryChooser = selectKit(".category-chooser");+ await categoryChooser.expand();+ await categoryChooser.selectRowByValue(2);++ const composerActions = selectKit(".composer-actions");+ await composerActions.expand();+ await composerActions.selectKitSelectRowByName(+ i18n("composer.composer_actions.create_as_post_voting.label")+ );++ assert+ .dom(".action-title")+ .hasText(+ i18n("composer.create_post_voting.label"),+ "displays the right composer action title when creating Post Voting topic"+ );++ assert+ .dom(".create .d-button-label")+ .hasText(+ i18n("composer.create_post_voting.label"),+ "displays the right label for composer create button"+ );++ await composerActions.expand();+ await composerActions.selectKitSelectRowByName(+ i18n("composer.composer_actions.remove_as_post_voting.label")+ );++ assert+ .dom(".action-title")+ .doesNotIncludeText(+ i18n("composer.create_post_voting.label"),+ "reverts to original composer title when post voting format is disabled"+ );++ await composerActions.expand();+ await composerActions.selectKitSelectRowByName(+ i18n("composer.composer_actions.create_as_post_voting.label")+ );++ await fillIn("#reply-title", "this is some random topic title");+ await fillIn(".d-editor-input", "this is some random body");+ await click(".create");++ assert.true(+ createAsPostVotingSetInRequest,+ "submits the right request to create topic as Post Voting formatted"+ );+ });++ test("Creating new topic in category with Post Voting create default", async function (assert) {+ Category.findById(2).set("create_as_post_voting_default", true);++ await visit("/");+ await click("#create-topic");++ assert.dom(".action-title").hasText(i18n("topic.create_long"));++ const categoryChooser = selectKit(".category-chooser");+ await categoryChooser.expand();+ await categoryChooser.selectRowByValue(2);++ assert+ .dom(".action-title")+ .hasText(i18n("composer.create_post_voting.label"));+ });++ test("Creating new topic in category with only_post_voting_in_this_category enabled", async function (assert) {+ const category = Category.findById(2);+ category.set("only_post_voting_in_this_category", true);++ await visit("/");+ await click("#create-topic");++ assert.dom(".action-title").hasText(i18n("topic.create_long"));++ const categoryChooser = selectKit(".category-chooser");+ await categoryChooser.expand();++ await categoryChooser.selectRowByValue(2);+ const newTopicType = selectKit(".dropdown-select-box");+ await newTopicType.expand();+ assert+ .dom(".action-title")+ .hasText(i18n("composer.create_post_voting.label"));+ });+});diff --git a/plugins/discourse-post-voting/test/javascripts/acceptance/notifications-test.js b/plugins/discourse-post-voting/test/javascripts/acceptance/notifications-test.jsnew file mode 100644index 00000000000..aaf4aa4023a--- /dev/null+++ b/plugins/discourse-post-voting/test/javascripts/acceptance/notifications-test.js@@ -0,0 +1,60 @@+import { visit } from "@ember/test-helpers";+import { test } from "qunit";+import { acceptance } from "discourse/tests/helpers/qunit-helpers";+import { i18n } from "discourse-i18n";++acceptance("Discourse Post Voting - notifications", function (needs) {+ needs.user();+ needs.settings({ post_voting_enabled: true });++ needs.pretender((server, helper) => {+ server.get("/notifications", () => {+ return helper.response({+ notifications: [+ {+ id: 1,+ user_id: 26,+ notification_type: 35,+ post_number: 1,+ topic_id: 59,+ fancy_title: "some fancy title",+ slug: "some-slug",+ data: {+ display_username: "some_user",+ post_voting_comment_id: 123,+ },+ },+ ],+ total_rows_notifications: 1,+ });+ });+ });++ test("viewing comments notifications", async (assert) => {+ await visit("/u/eviltrout/notifications");++ assert+ .dom(".user-notifications-list .notification .item-label")+ .hasText("some_user", "Renders username");++ assert+ .dom(".user-notifications-list .notification .item-description")+ .hasText("some fancy title", "Renders description");++ assert+ .dom(".user-notifications-list .notification a")+ .hasAttribute(+ "href",+ /\/t\/some-slug\/59#post-voting-comment-123/,+ "displays a link with a hash fragment pointing to the comment id"+ );++ assert+ .dom(".user-notifications-list .notification a")+ .hasAttribute(+ "title",+ i18n("notifications.titles.question_answer_user_commented"),+ "displays the right title"+ );+ });+});diff --git a/plugins/discourse-post-voting/test/javascripts/acceptance/post-voting-test.js b/plugins/discourse-post-voting/test/javascripts/acceptance/post-voting-test.jsnew file mode 100644index 00000000000..62fec9ca6c0--- /dev/null+++ b/plugins/discourse-post-voting/test/javascripts/acceptance/post-voting-test.js@@ -0,0 +1,952 @@+import {+ click,+ fillIn,+ settled,+ triggerEvent,+ visit,+} from "@ember/test-helpers";+import { test } from "qunit";+import { cloneJSON } from "discourse/lib/object";+import discoveryFixtures from "discourse/tests/fixtures/discovery-fixtures";+import topicFixtures from "discourse/tests/fixtures/topic";+import {+ acceptance,+ publishToMessageBus,+ updateCurrentUser,+} from "discourse/tests/helpers/qunit-helpers";+import { i18n } from "discourse-i18n";++const topicResponse = cloneJSON(topicFixtures["/t/280/1.json"]);+const topicList = cloneJSON(discoveryFixtures["/latest.json"]);++function postVotingEnabledTopicResponse() {+ Object.assign(topicResponse.post_stream.posts[0], {+ post_voting_vote_count: 0,+ comments_count: 1,+ post_voting_has_votes: false,++ comments: [+ {+ id: 1,+ user_id: 12345,+ name: "Some Name",+ username: "some_username",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment 1</p>",+ },+ ],+ });++ Object.assign(topicResponse.post_stream.posts[1], {+ post_voting_vote_count: 2,+ post_voting_has_votes: true,+ comments_count: 6,+ post_voting_user_voted_direction: "up",++ comments: [+ {+ id: 2,+ user_id: 12345,+ name: "Some Name",+ username: "some_username",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment 2</p>",+ post_voting_vote_count: 0,+ user_voted: false,+ },+ {+ id: 3,+ user_id: 12345,+ name: "Some Name",+ username: "some_username",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment 3</p>",+ post_voting_vote_count: 3,+ user_voted: false,+ },+ {+ id: 4,+ user_id: 123456,+ name: "Some Name 2 ",+ username: "some_username2",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment 4</p>",+ post_voting_vote_count: 0,+ user_voted: false,+ },+ {+ id: 5,+ user_id: 1234567,+ name: "Some Name 3 ",+ username: "some_username3",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment 5</p>",+ post_voting_vote_count: 0,+ user_voted: false,+ },+ {+ id: 6,+ user_id: 12345678,+ name: null,+ username: null,+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment 6</p>",+ post_voting_vote_count: 0,+ user_voted: false,+ },+ ],+ });++ topicResponse.is_post_voting = true;++ return topicResponse;+}++function postVotingTopicListResponse() {+ // will link to OP+ topicList.topic_list.topics[0].is_post_voting = true;+ topicList.topic_list.topics[0].last_read_post_number =+ topicList.topic_list.topics[0].highest_post_number;++ // will sort by activity+ topicList.topic_list.topics[1].is_post_voting = true;+ topicList.topic_list.topics[1].last_read_post_number =+ topicList.topic_list.topics[1].highest_post_number - 2;++ // will link to last post+ topicList.topic_list.topics[3].is_post_voting = true;+ topicList.topic_list.topics[3].last_read_post_number =+ topicList.topic_list.topics[3].highest_post_number - 1;++ return topicList;+}++let filteredByActivity = false;++function setupPostVoting(needs, postStreamMode) {+ needs.settings({+ post_voting_enabled: true,+ min_post_length: 5,+ post_voting_comment_max_raw_length: 50,+ post_voting_enable_likes_on_answers: false,+ glimmer_post_stream_mode: postStreamMode,+ });++ needs.hooks.afterEach(function () {+ filteredByActivity = false;+ });++ needs.pretender((server, helper) => {+ server.get("/t/280.json", (request) => {+ if (request.queryParams.filter === "activity") {+ filteredByActivity = true;+ } else {+ filteredByActivity = false;+ }++ return helper.response(postVotingEnabledTopicResponse());+ });++ server.get("/post_voting/comments", () => {+ return helper.response({+ comments: [+ {+ id: 7,+ user_id: 12345678,+ name: "Some Name 4",+ username: "some_username4",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment 7</p>",+ post_voting_vote_count: 0,+ user_voted: false,+ },+ ],+ });+ });++ server.post("/post_voting/comments", () => {+ return helper.response({+ id: 9,+ user_id: 12345678,+ name: "Some Name 5",+ username: "some_username5",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment 9</p>",+ post_voting_vote_count: 0,+ user_voted: false,+ });+ });++ server.delete("/post_voting/comments", () => {+ return helper.response({});+ });++ server.put("/post_voting/comments", () => {+ return helper.response({+ id: 1,+ user_id: 12345,+ name: "Some Name",+ username: "some_username",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>editing this</p>",+ post_voting_vote_count: 0,+ user_voted: false,+ });+ });++ server.post("/post_voting/vote/comment", () => {+ return helper.response({});+ });++ server.delete("/post_voting/vote/comment", () => {+ return helper.response({});+ });++ server.get("/latest.json", () => {+ return helper.response(postVotingTopicListResponse());+ });+ });+}++["enabled", "disabled"].forEach((postStreamMode) => {+ acceptance(+ `Discourse Post Voting - anon user (glimmer_post_stream_mode = ${postStreamMode})`,+ function (needs) {+ setupPostVoting(needs, postStreamMode);++ test("Viewing comments", async function (assert) {+ await visit("/t/280");++ assert+ .dom("#post_1 .post-voting-comment")+ .exists(+ { count: 1 },+ "displays the right number of comments for the first post"+ );++ assert+ .dom("#post_2 .post-voting-comment")+ .exists(+ { count: 5 },+ "displays the right number of comments for the second post"+ );++ await click(".post-voting-comments-menu-show-more-link");++ assert+ .dom("#post_2 .post-voting-comment")+ .exists(+ { count: 6 },+ "displays the right number of comments after loading more"+ );++ assert+ .dom(+ "#post_2 .post-voting-comments #post-voting-comment-6 .post-voting-comment-info-username"+ )+ .hasText(i18n("post_voting.post.post_voting_comment.user.deleted"));+ });++ test("adding a comment", async function (assert) {+ await visit("/t/280");+ await click(".post-voting-comment-add-link");++ assert.dom("#login-form").exists("displays the login screen");+ });++ test("voting a comment", async function (assert) {+ await visit("/t/280");+ await click(+ "#post_2 #post-voting-comment-2 .post-voting-button-upvote"+ );++ assert.dom("#login-form").exists("displays the login screen");+ });+ }+ );++ acceptance(+ `Discourse Post Voting - logged in user (glimmer_post_stream_mode = ${postStreamMode})`,+ function (needs) {+ setupPostVoting(needs, postStreamMode);+ needs.user();++ test("Post Voting features do not leak into non-Post Voting topics", async function (assert) {+ await visit("/t/130");++ assert.dom("#post_1 button.reply").exists("displays the reply button");++ assert+ .dom(".post-voting-answers-header")+ .doesNotExist("does not display the Post Voting answers header");+ });++ test("non Post Voting topics do not have Post Voting specific class on body tag", async function (assert) {+ await visit("/t/130");++ assert+ .dom(document.body)+ .doesNotHaveClass(+ "post-voting-topic",+ "does not append Post Voting specific class on body tag"+ );++ await visit("/t/280");++ assert+ .dom(document.body)+ .hasClass(+ "post-voting-topic",+ "appends Post Voting specific class on body tag"+ );++ await visit("/t/130");++ assert+ .dom(document.body)+ .doesNotHaveClass(+ "post-voting-topic",+ "does not append Post Voting specific class on body tag"+ );+ });++ test("Post Voting topics has relevant copy on reply button", async function (assert) {+ await visit("/t/280");++ assert+ .dom(".reply.create .d-button-label")+ .hasText(+ i18n("post_voting.topic.answer.label"),+ "displays the correct reply label"+ );+ });++ test("sorting post stream by activity and votes", async function (assert) {+ await visit("/t/280");++ assert+ .dom(".post-voting-answers-headers-sort-votes")+ .isDisabled("sort by votes button is disabled by default");++ assert+ .dom(document.body)+ .hasClass(+ "post-voting-topic",+ "appends the right class to body when loading Post Voting topic"+ );++ await click(".post-voting-answers-headers-sort-activity");++ assert.true(+ filteredByActivity,+ "refreshes post stream with the right filter"+ );++ assert+ .dom(document.body)+ .hasClass(+ "post-voting-topic-sort-by-activity",+ "appends the right class to body when topic is filtered by activity"+ );++ assert+ .dom(".post-voting-answers-headers-sort-activity")+ .isDisabled("disabled sort by activity button");++ await click(".post-voting-answers-headers-sort-votes");++ assert+ .dom(".post-voting-answers-headers-sort-votes")+ .isDisabled("disables sort by votes button");++ assert+ .dom(document.body)+ .hasClass(+ "post-voting-topic",+ "appends the right class to body when topic is filtered by votes"+ );++ assert.false(+ filteredByActivity,+ "removes activity filter from post stream"+ );+ });++ test("reply buttons are hidden in post stream except for the first post", async function (assert) {+ await visit("/t/280");++ assert+ .dom("#post_1 .reply")+ .exists("reply button is shown for the first post");++ assert+ .dom("#post_2 .reply")+ .doesNotExist("reply button is only shown for the first post");+ });++ test("like buttons are hidden in post stream except for the first post", async function (assert) {+ await visit("/t/280");++ assert+ .dom("#post_1 .like")+ .exists("like button is shown for the first post");++ assert+ .dom("#post_2 .like")+ .doesNotExist("like button is only shown for the first post");+ });++ test("validations for comment length", async function (assert) {+ await visit("/t/280");+ await click("#post_1 .post-voting-comment-add-link");++ await fillIn(".post-voting-comment-composer-textarea", "a".repeat(4));++ assert.dom(".post-voting-comment-composer-flash").hasText(+ i18n("post_voting.post.post_voting_comment.composer.too_short", {+ count: 5,+ }),+ "displays the right message about raw length when it is too short"+ );++ assert+ .dom(".post-voting-comments-menu-composer-submit")+ .isDisabled("submit comment button is disabled");++ await fillIn(".post-voting-comment-composer-textarea", "a".repeat(6));++ assert.dom(".post-voting-comment-composer-flash").hasText(+ i18n("post_voting.post.post_voting_comment.composer.length_ok", {+ count: 44,+ }),+ "displays the right message about raw length when it is OK"+ );++ assert+ .dom(".post-voting-comments-menu-composer-submit")+ .isEnabled("submit comment button is enabled");++ await fillIn(".post-voting-comment-composer-textarea", "a".repeat(51));++ assert.dom(".post-voting-comment-composer-flash").hasText(+ i18n("post_voting.post.post_voting_comment.composer.too_long", {+ count: 50,+ }),+ "displays the right message about raw length when it is too long"+ );++ assert+ .dom(".post-voting-comments-menu-composer-submit")+ .isDisabled("submit comment button is disabled");+ });++ test("adding a comment", async function (assert) {+ await visit("/t/280");++ assert+ .dom("#post_1 .post-voting-comment")+ .exists(+ { count: 1 },+ "displays the right number of comments for the first post"+ );++ await click("#post_1 .post-voting-comment-add-link");++ assert+ .dom("#post_1 .post-voting-comment")+ .exists({ count: 2 }, "loads all comments when composer is expanded");++ await fillIn(+ ".post-voting-comment-composer-textarea",+ "this is some comment"+ );+ await click(".post-voting-comments-menu-composer-submit");++ assert+ .dom("#post_1 .post-voting-comment")+ .exists({ count: 3 }, "should add the new comment");+ });++ test("adding a comment with keyboard shortcut", async function (assert) {+ await visit("/t/280");+ await click("#post_1 .post-voting-comment-add-link");++ assert+ .dom("#post_1 .post-voting-comment")+ .exists({ count: 2 }, "loads all comments when composer is expanded");++ await fillIn(+ ".post-voting-comment-composer-textarea",+ "this is a new test comment"+ );++ await triggerEvent(+ ".post-voting-comments-menu-composer-submit",+ "keydown",+ {+ key: "Enter",+ ctrlKey: true,+ }+ );++ assert+ .dom("#post_1 .post-voting-comment")+ .exists({ count: 3 }, "should add the new comment");+ });++ test("editing a comment", async function (assert) {+ updateCurrentUser({ id: 12345 }); // userId of comments in fixtures++ await visit("/t/280");++ assert+ .dom("#post_1 .post-voting-comment-cooked")+ .hasText(+ "Test comment 1",+ "displays the right content for the given comment"+ );++ await click("#post_1 .post-voting-comment-actions-edit-link");++ await fillIn(".post-voting-comment-composer-textarea", "a".repeat(4));++ assert.dom(".post-voting-comment-composer-flash").hasText(+ i18n("post_voting.post.post_voting_comment.composer.too_short", {+ count: 5,+ }),+ "displays the right message about raw length when it is too short"+ );++ assert+ .dom(".post-voting-comment-editor-submit")+ .isDisabled("submit comment button is disabled");++ await fillIn(+ "#post_1 .post-voting-comment-editor-1 textarea",+ "editing this"+ );++ assert.dom(".post-voting-comment-composer-flash").hasText(+ i18n("post_voting.post.post_voting_comment.composer.length_ok", {+ count: 38,+ }),+ "displays the right message when comment length is OK"+ );++ assert+ .dom(".post-voting-comment-editor-submit")+ .isEnabled("submit comment button is enabled");++ await click(+ "#post_1 .post-voting-comment-editor-1 .post-voting-comment-editor-submit"+ );++ assert+ .dom("#post_1 .post-voting-comment-cooked")+ .hasText(+ "editing this",+ "displays the right content after comment has been edited"+ );++ assert+ .dom("#post_1 .post-voting-comment-editor-1")+ .doesNotExist("hides editor after comment has been edited");+ });++ test("deleting a comment", async function (assert) {+ updateCurrentUser({ id: 12345 }); // userId of comments in fixtures++ await visit("/t/280");++ assert+ .dom("#post_1 .post-voting-comment")+ .exists(+ { count: 1 },+ "displays the right number of comments for the first post"+ );++ await click("#post_1 .post-voting-comment-actions-delete-link");+ await click("button.btn-danger");++ assert+ .dom("#post_1 #post-voting-comment-1")+ .hasClass(+ "post-voting-comment-deleted",+ "adds the right class to deleted comment"+ );+ });++ test("deleting a comment after more comments have been loaded", async function (assert) {+ updateCurrentUser({ admin: true });++ await visit("/t/280");++ assert+ .dom("#post_2 .post-voting-comment")+ .exists(+ { count: 5 },+ "displays the right number of comments for the second post"+ );++ await click("#post_2 .post-voting-comments-menu-show-more-link");++ assert+ .dom("#post_2 .post-voting-comment")+ .exists({ count: 6 }, "appends the loaded comments");++ const comments = document.querySelectorAll(+ "#post_2 .post-voting-comment-actions-delete-link"+ );++ await click(comments[comments.length - 1]);+ await click("button.btn-danger");++ assert+ .dom("#post_2 .post-voting-comments-menu-show-more-link")+ .doesNotExist(+ "updates the comment count such that show more link is not displayed"+ );++ assert+ .dom("#post_2 #post-voting-comment-7")+ .hasClass(+ "post-voting-comment-deleted",+ "adds the right class to deleted comment"+ );+ });++ test("vote count display", async function (assert) {+ await visit("/t/280");++ assert+ .dom(+ "#post_2 #post-voting-comment-2 .post-voting-comment-actions-vote-count"+ )+ .doesNotExist("does not display element if vote count is zero");++ assert+ .dom(+ "#post_2 #post-voting-comment-3 .post-voting-comment-actions-vote-count"+ )+ .hasText("3", "displays the right vote count");+ });++ test("voting on a comment and removing vote", async function (assert) {+ await visit("/t/280");++ await click(+ "#post_2 #post-voting-comment-2 .post-voting-button-upvote"+ );++ assert+ .dom(+ "#post_2 #post-voting-comment-2 .post-voting-comment-actions-vote-count"+ )+ .hasText("1", "updates the comment vote count correctly");++ await click(+ "#post_2 #post-voting-comment-2 .post-voting-button-upvote"+ );++ assert+ .dom(+ "#post_2 #post-voting-comment-2 .post-voting-comment-actions-vote-count"+ )+ .doesNotExist("updates the comment vote count correctly");+ });++ test("topic list link overrides work", async function (assert) {+ await visit("/");++ assert+ .dom(".topic-list-item:first-child .raw-topic-link")+ .hasAttribute("href", /\/1$/);++ assert+ .dom(".topic-list-item:nth-child(2) .raw-topic-link")+ .hasAttribute("href", /\?filter=activity$/);++ assert+ .dom(".topic-list-item:nth-child(4) .raw-topic-link")+ .hasAttribute("href", /\/2$/);+ });++ test("receiving user post voted message where current user removed their vote", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_voted",+ id: topicResponse.post_stream.posts[1].id,+ post_voting_vote_count: 0,+ post_voting_has_votes: false,+ post_voting_user_voted_id: 19,+ post_voting_user_voted_direction: null,+ });++ await settled();++ assert+ .dom("#post_2 span.post-voting-post-toggle-voters")+ .hasText("0", "displays the right count");++ assert+ .dom("#post_2 .post-voting-button-upvote")+ .doesNotHaveClass(+ "post-voting-button-voted",+ "does not highlight the upvote button"+ );+ });++ test("receiving user post voted message where post no longer has votes", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_voted",+ id: topicResponse.post_stream.posts[1].id,+ post_voting_vote_count: 0,+ post_voting_has_votes: false,+ post_voting_user_voted_id: 280,+ post_voting_user_voted_direction: "down",+ });++ await settled();++ assert+ .dom("#post_2 span.post-voting-post-toggle-voters")+ .hasText("0", "does not render a button to show post voters");+ });++ test("receiving user post voted message where current user is not the one that voted", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_voted",+ id: topicResponse.post_stream.posts[1].id,+ post_voting_vote_count: 5,+ post_voting_has_votes: true,+ post_voting_user_voted_id: 123456,+ post_voting_user_voted_direction: "down",+ });++ await settled();++ assert+ .dom("#post_2 .post-voting-post-toggle-voters")+ .hasText("5", "displays the right post vote count");++ assert+ .dom("#post_2 .post-voting-button-upvote")+ .hasClass(+ "post-voting-button-voted",+ "highlights the upvote button for the current user"+ );++ assert+ .dom("#post_2 .post-voting-button-downvote")+ .doesNotHaveClass(+ "post-voting-button-voted",+ "does not highlight the downvote button for the current user"+ );+ });++ test("receiving user post voted message where current user is the one that voted", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_voted",+ id: topicResponse.post_stream.posts[1].id,+ post_voting_vote_count: 5,+ post_voting_has_votes: true,+ post_voting_user_voted_id: 19,+ post_voting_user_voted_direction: "up",+ });++ await settled();++ assert+ .dom("#post_2 .post-voting-post-toggle-voters")+ .hasText("5", "displays the right post vote count");++ assert+ .dom("#post_2 .post-voting-button-upvote")+ .hasClass(+ "post-voting-button-voted",+ "highlights the upvote button for the current user"+ );+ });++ test("receiving post commented message when comment has already been loaded", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_commented",+ id: topicResponse.post_stream.posts[0].id,+ comments_count: 1,+ comment: topicResponse.post_stream.posts[0]["comments"][0],+ });++ await settled();++ assert+ .dom("#post_1 #post-voting-comment-5678")+ .doesNotExist(+ "does not append comment when comment has already been loaded"+ );+ });++ test("receiving post commented message for a comment created by the current user", async function (assert) {+ updateCurrentUser({ id: 12345 });++ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_commented",+ id: topicResponse.post_stream.posts[0].id,+ comments_count: 2,+ comment: {+ id: 5678,+ user_id: 12345,+ name: "Some Commenter",+ username: "some_commenter",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment ABC</p>",+ },+ });++ await settled();++ assert+ .dom("#post_1 #post-voting-comment-5678")+ .doesNotExist("does not append comment");+ });++ test("receiving post commented message when there are no more comments to load ", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_commented",+ id: topicResponse.post_stream.posts[0].id,+ comments_count: 2,+ comment: {+ id: 5678,+ user_id: 12345,+ name: "Some Commenter",+ username: "some_commenter",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment ABC</p>",+ },+ });++ await settled();++ assert+ .dom("#post_1 #post-voting-comment-5678")+ .includesText(+ "Test comment ABC",+ "appends comment to comments stream"+ );+ });++ test("receiving post commented message when there are more comments to load", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_commented",+ id: topicResponse.post_stream.posts[1].id,+ comments_count: 7,+ comment: {+ id: 5678,+ user_id: 12345,+ name: "Some Commenter",+ username: "some_commenter",+ created_at: "2022-01-12T08:21:54.175Z",+ cooked: "<p>Test comment ABC</p>",+ },+ });++ await settled();++ assert+ .dom("#post_2 #post-voting-comment-5678")+ .doesNotExist(+ "does not append comment when there are more comments to load"+ );++ assert+ .dom("#post_2 .post-voting-comments-menu-show-more-link")+ .exists("updates the comments count to reflect the new comment");+ });++ test("receiving post comment trashed message for a comment that has not been loaded ", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_comment_trashed",+ id: topicResponse.post_stream.posts[1].id,+ comments_count: 5,+ comment_id: 12345,+ });++ await settled();++ assert+ .dom("#post_2 .post-voting-comments-menu-show-more-link")+ .doesNotExist("removes the show more comments link");+ });++ test("receiving post comment trashed message for a comment that has been loaded", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_comment_trashed",+ id: topicResponse.post_stream.posts[1].id,+ comments_count: 5,+ comment_id: topicResponse.post_stream.posts[1].comments[0].id,+ });++ await settled();++ assert+ .dom("#post_2 #post-voting-comment-2")+ .hasClass(+ "post-voting-comment-deleted",+ "adds the right class to the comment"+ );+ });++ test("receiving post comment edited message for a comment that has been loaded", async function (assert) {+ await visit("/t/280");++ publishToMessageBus("/topic/280", {+ type: "post_voting_post_comment_edited",+ id: topicResponse.post_stream.posts[0].id,+ comment_id: topicResponse.post_stream.posts[0].comments[0].id,+ comment_raw: "this is a new comment raw",+ comment_cooked: "<p>this is a new comment cooked</p>",+ });++ await settled();++ assert+ .dom("#post_1 #post-voting-comment-1 .post-voting-comment-cooked")+ .hasText(+ "this is a new comment cooked",+ "updates the content of the comment"+ );++ await click(+ "#post_1 #post-voting-comment-1 .post-voting-comment-actions-edit-link"+ );++ assert+ .dom(+ "#post_1 #post-voting-comment-1 .post-voting-comment-composer textarea"+ )+ .hasValue(+ "this is a new comment raw",+ "updates the content of the comment editor"+ );+ });+ }+ );+});diff --git a/translator.yml b/translator.ymlindex f8cec85d0f0..6967d3385ec 100644--- a/translator.yml+++ b/translator.yml@@ -206,3 +206,10 @@ files:- source_path: plugins/discourse-data-explorer/config/locales/server.en.ymldestination_path: plugins/data-explorer/server.ymllabel: data-explorer++ - source_path: plugins/discourse-post-voting/config/locales/client.en.yml+ destination_path: plugins/post-voting/client.yml+ label: post-voting+ - source_path: plugins/discourse-post-voting/config/locales/server.en.yml+ destination_path: plugins/post-voting/server.yml+ label: post-voting