Skip to content

A platform for community discussion. Free, open, simple.

DEV: Move discourse-user-notes to core (#33570)

Jarek Radosza4f1413964ce
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 15022565d61..54e520d37e6 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -86,6 +86,10 @@ discourse-post-voting:
- changed-files:
- any-glob-to-any-file: plugins/discourse-post-voting/**/*
+discourse-user-notes:
+ - changed-files:
+ - any-glob-to-any-file: plugins/discourse-user-notes/**/*
+
footnote:
- changed-files:
- any-glob-to-any-file: plugins/footnote/**/*
diff --git a/.gitignore b/.gitignore
index 1dd54c2c286..7342871b1cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,6 +64,7 @@
!/plugins/discourse-chat-integration
!/plugins/discourse-data-explorer
!/plugins/discourse-post-voting
+!/plugins/discourse-user-notes
/plugins/*/auto_generated
/spec/fixtures/plugins/my_plugin/auto_generated
diff --git a/plugins/discourse-user-notes/README.md b/plugins/discourse-user-notes/README.md
new file mode 100644
index 00000000000..af12a9c57af
--- /dev/null
+++ b/plugins/discourse-user-notes/README.md
@@ -0,0 +1,26 @@
+### discourse-user-notes
+
+https://meta.discourse.org/t/user-notes-plugin/41026/
+
+This plugin gives staff members the ability to attach notes to users.
+
+Whenever the user posts, a little note icon will appear beside their name if they have
+any staff notes. Clicking on it will reveal the notes other staff members have left.
+
+## Installation
+
+Follow our [Install a Plugin](https://meta.discourse.org/t/install-a-plugin/19157) howto, using
+`git clone https://github.com/discourse/discourse-user-notes.git` as the plugin command.
+
+Once you've installed it, review the settings under admin and then enable
+`user_notes_enabled`.
+
+**Clearing browser cache might be required when first installed**
+
+## Issues
+
+If you have issues or suggestions for the plugin, please bring them up on [Discourse Meta](https://meta.discourse.org).
+
+## License
+
+MIT
diff --git a/plugins/discourse-user-notes/app/controllers/discourse_user_notes/user_notes_controller.rb b/plugins/discourse-user-notes/app/controllers/discourse_user_notes/user_notes_controller.rb
new file mode 100644
index 00000000000..c6d1e37bd31
--- /dev/null
+++ b/plugins/discourse-user-notes/app/controllers/discourse_user_notes/user_notes_controller.rb
@@ -0,0 +1,62 @@
+# frozen_string_literal: true
+
+module DiscourseUserNotes
+ class UserNotesController < ::ApplicationController
+ requires_plugin DiscourseUserNotes::PLUGIN_NAME
+ before_action :ensure_logged_in
+ before_action :ensure_staff
+
+ def index
+ user = User.where(id: params[:user_id]).first
+ raise Discourse::NotFound if user.blank?
+
+ notes = ::DiscourseUserNotes.notes_for(params[:user_id])
+ render json: { extras: { username: user.username }, user_notes: create_json(notes.reverse) }
+ end
+
+ def create
+ user = User.where(id: params[:user_note][:user_id]).first
+ raise Discourse::NotFound if user.blank?
+ extras = {}
+ if post_id = params[:user_note][:post_id]
+ extras[:post_id] = post_id
+ end
+
+ user_note =
+ ::DiscourseUserNotes.add_note(user, params[:user_note][:raw], current_user.id, extras)
+
+ render json: create_json(user_note)
+ end
+
+ def destroy
+ user = User.where(id: params[:user_id]).first
+ raise Discourse::NotFound if user.blank?
+
+ raise Discourse::InvalidAccess.new unless guardian.can_delete_user_notes?
+
+ ::DiscourseUserNotes.remove_note(user, params[:id])
+ render json: success_json
+ end
+
+ protected
+
+ def create_json(obj)
+ # Avoid n+1
+ if obj.is_a?(Array)
+ users_by_id = {}
+ posts_by_id = {}
+ User.where(id: obj.map { |o| o[:created_by] }).each { |u| users_by_id[u.id] = u }
+ Post.with_deleted.where(id: obj.map { |o| o[:post_id] }).each { |p| posts_by_id[p.id] = p }
+ obj.each do |o|
+ o[:created_by] = users_by_id[o[:created_by].to_i]
+ o[:post] = posts_by_id[o[:post_id].to_i]
+ end
+ else
+ obj[:created_by] = User.where(id: obj[:created_by]).first
+ obj[:post] = Post.with_deleted.where(id: obj[:post_id]).first
+ end
+
+ serialize_data(obj, ::UserNoteSerializer)
+ end
+ end
+end
diff --git a/plugins/discourse-user-notes/app/serializers/user_note_serializer.rb b/plugins/discourse-user-notes/app/serializers/user_note_serializer.rb
new file mode 100644
index 00000000000..a578ad7103a
--- /dev/null
+++ b/plugins/discourse-user-notes/app/serializers/user_note_serializer.rb
@@ -0,0 +1,60 @@
+# frozen_string_literal: true
+
+class ::UserNoteSerializer < ApplicationSerializer
+ attributes(
+ :id,
+ :user_id,
+ :raw,
+ :created_by,
+ :created_at,
+ :can_delete,
+ :post_id,
+ :post_url,
+ :post_title,
+ )
+
+ def id
+ object[:id]
+ end
+
+ def user_id
+ object[:user_id]
+ end
+
+ def raw
+ object[:raw]
+ end
+
+ def created_by
+ BasicUserSerializer.new(object[:created_by], scope: scope, root: false)
+ end
+
+ def created_at
+ object[:created_at]
+ end
+
+ def can_delete
+ scope.can_delete_user_notes?
+ end
+
+ def post_id
+ object[:post_id]
+ end
+
+ def post_url
+ url = object[:post].try(:url)
+
+ # In case the topic is deleted
+ url = "/t/#{object[:post].topic_id}/#{object[:post].post_number}" if url == "/404"
+
+ "#{Discourse.base_path}#{url}"
+ end
+
+ def post_title
+ object[:post].try(:title)
+ end
+
+ def topic_id
+ object[:topic_id]
+ end
+end
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/adapters/user-note.js b/plugins/discourse-user-notes/assets/javascripts/discourse/adapters/user-note.js
new file mode 100644
index 00000000000..9e97d1dcf02
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/adapters/user-note.js
@@ -0,0 +1,9 @@
+import RestAdapter from "discourse/adapters/rest";
+import { ajax } from "discourse/lib/ajax";
+
+export default class UserNote extends RestAdapter {
+ destroyRecord(store, type, record) {
+ const path = this.pathFor(store, type, record.id);
+ return ajax(`${path}?user_id=${record.user_id}`, { method: "DELETE" });
+ }
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/components/modal/user-notes.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/components/modal/user-notes.gjs
new file mode 100644
index 00000000000..3bd9ad88bc4
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/components/modal/user-notes.gjs
@@ -0,0 +1,151 @@
+import Component from "@glimmer/component";
+import { tracked } from "@glimmer/tracking";
+import { fn } from "@ember/helper";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import CookText from "discourse/components/cook-text";
+import DButton from "discourse/components/d-button";
+import DModal from "discourse/components/d-modal";
+import Form from "discourse/components/form";
+import UserLink from "discourse/components/user-link";
+import ageWithTooltip from "discourse/helpers/age-with-tooltip";
+import avatar from "discourse/helpers/avatar";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+import { i18n } from "discourse-i18n";
+
+export default class UserNotesModal extends Component {
+ @service dialog;
+ @service store;
+
+ @tracked userId = this.args.model.userId;
+ postId = this.args.model.postId;
+ callback = this.args.model.callback;
+
+ #refreshCount() {
+ if (this.callback) {
+ this.callback(this.args.model.note.length);
+ }
+ }
+
+ /**
+ * Registers the Form API reference.
+ *
+ * @param {Object} api - The Form API object, with form helper methods.
+ */
+ @action
+ registerApi(api) {
+ this.formApi = api;
+ }
+
+ /**
+ * Handles form submission from Form component.
+ *
+ * @param {Object} data - Form data from Form component
+ */
+ @action
+ async onSubmit(data) {
+ const note = this.store.createRecord("user-note");
+ const userId = parseInt(this.userId, 10);
+
+ const args = {
+ raw: data.content,
+ user_id: userId,
+ };
+
+ if (this.postId) {
+ args.post_id = parseInt(this.postId, 10);
+ }
+
+ try {
+ await note.save(args);
+ await this.formApi.set("content", "");
+ this.args.model.note.insertAt(0, note);
+ this.#refreshCount();
+ } catch (error) {
+ popupAjaxError(error);
+ }
+ }
+
+ @action
+ removeNote(note) {
+ this.dialog.deleteConfirm({
+ message: i18n("user_notes.delete_confirm"),
+ didConfirm: () => {
+ note
+ .destroyRecord()
+ .then(() => {
+ this.args.model.note.removeObject(note);
+ this.#refreshCount();
+ })
+ .catch(popupAjaxError);
+ },
+ });
+ }
+
+ <template>
+ <DModal
+ @closeModal={{@closeModal}}
+ @title={{i18n "user_notes.title"}}
+ class="user-notes-modal"
+ >
+ <Form
+ @onSubmit={{this.onSubmit}}
+ @onRegisterApi={{this.registerApi}}
+ as |form|
+ >
+ <form.Field
+ @name="content"
+ @title={{i18n "user_notes.attach_note_description"}}
+ @format="full"
+ @validation="required:trim"
+ as |field|
+ >
+ <field.Textarea />
+ </form.Field>
+
+ <form.Actions>
+ <form.Submit @label="user_notes.attach" class="btn-primary" />
+ </form.Actions>
+ </Form>
+
+ {{#each @model.note as |n|}}
+ <div class="user-note">
+ <div class="posted-by">
+ <UserLink @user={{n.created_by}}>
+ {{avatar n.created_by imageSize="small"}}
+ </UserLink>
+ </div>
+ <div class="note-contents">
+ <div class="note-info">
+ <span class="username">{{n.created_by.username}}</span>
+ <span class="post-date">{{ageWithTooltip n.created_at}}</span>
+
+ {{#if n.can_delete}}
+ <span class="controls">
+ <DButton
+ @action={{fn this.removeNote n}}
+ @icon="far-trash-can"
+ @title="user_notes.remove"
+ class="btn-small btn-danger"
+ />
+ </span>
+ {{/if}}
+ </div>
+
+ <div class="cooked">
+ <CookText @rawText={{n.raw}} />
+ </div>
+
+ {{#if n.post_id}}
+ <a href={{n.post_url}} class="btn btn-small">
+ {{i18n "user_notes.show_post"}}
+ </a>
+ {{/if}}
+ </div>
+
+ <div class="clearfix"></div>
+ </div>
+ {{/each}}
+ </DModal>
+ </template>
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/components/post-metadata-user-notes.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/components/post-metadata-user-notes.gjs
new file mode 100644
index 00000000000..bb3a6a409bd
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/components/post-metadata-user-notes.gjs
@@ -0,0 +1,35 @@
+import Component from "@glimmer/component";
+import { on } from "@ember/modifier";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import icon from "discourse/helpers/d-icon";
+import emoji from "discourse/helpers/emoji";
+import { showUserNotes, updatePostUserNotesCount } from "../lib/user-notes";
+
+export default class PostMetadataUserNotes extends Component {
+ @service siteSettings;
+ @service store;
+
+ @action
+ showNotes() {
+ showUserNotes(
+ this.store,
+ this.args.post.user_id,
+ (count) => updatePostUserNotesCount(this.args.post, count),
+ {
+ postId: this.args.post.id,
+ }
+ );
+ }
+
+ <template>
+ {{! template-lint-disable no-invalid-interactive }}
+ <span class="user-notes-icon" {{on "click" this.showNotes}}>
+ {{#if this.siteSettings.enable_emoji}}
+ {{emoji "memo"}}
+ {{else}}
+ {{icon "pen-to-square"}}
+ {{/if}}
+ </span>
+ </template>
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/components/show-user-notes.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/components/show-user-notes.gjs
new file mode 100644
index 00000000000..3f9bc98be0b
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/components/show-user-notes.gjs
@@ -0,0 +1,22 @@
+import Component from "@glimmer/component";
+import DButton from "discourse/components/d-button";
+import { i18n } from "discourse-i18n";
+
+export default class ShowUserNotes extends Component {
+ get label() {
+ if (this.args.count > 0) {
+ return i18n("user_notes.show", { count: this.args.count });
+ } else {
+ return i18n("user_notes.title");
+ }
+ }
+
+ <template>
+ <DButton
+ class="btn-default show-user-notes-btn"
+ @action={{@show}}
+ @icon="pen-to-square"
+ @translatedLabel={{this.label}}
+ />
+ </template>
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/admin-dashboard-moderation-bottom/recent-user-notes-report-table.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/admin-dashboard-moderation-bottom/recent-user-notes-report-table.gjs
new file mode 100644
index 00000000000..cae21aabda8
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/admin-dashboard-moderation-bottom/recent-user-notes-report-table.gjs
@@ -0,0 +1,16 @@
+import Component from "@ember/component";
+import { classNames, tagName } from "@ember-decorators/component";
+import AdminReport from "admin/components/admin-report";
+
+@tagName("div")
+@classNames(
+ "admin-dashboard-moderation-bottom-outlet",
+ "recent-user-notes-report-table"
+)
+export default class RecentUserNotesReportTable extends Component {
+ <template>
+ {{#if this.siteSettings.user_notes_enabled}}
+ <AdminReport @dataSourceName="user_notes" @filters={{this.filters}} />
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/admin-user-controls-after/add-user-notes-button.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/admin-user-controls-after/add-user-notes-button.gjs
new file mode 100644
index 00000000000..45be413076e
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/admin-user-controls-after/add-user-notes-button.gjs
@@ -0,0 +1,41 @@
+import Component from "@ember/component";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { classNames, tagName } from "@ember-decorators/component";
+import ShowUserNotes from "../../components/show-user-notes";
+import { showUserNotes } from "../../lib/user-notes";
+
+@tagName("")
+@classNames("admin-user-controls-after-outlet", "add-user-notes-button")
+export default class AddUserNotesButton extends Component {
+ static shouldRender(args, context) {
+ const { siteSettings, currentUser } = context;
+ return siteSettings.user_notes_enabled && currentUser && currentUser.staff;
+ }
+
+ @service store;
+
+ init() {
+ super.init(...arguments);
+ const { model } = this;
+ this.set(
+ "userNotesCount",
+ model.user_notes_count || model.get("custom_fields.user_notes_count") || 0
+ );
+ }
+
+ @action
+ showUserNotes() {
+ const user = this.model;
+ showUserNotes(this.store, user.id, (count) =>
+ this.set("userNotesCount", count)
+ );
+ }
+
+ <template>
+ <ShowUserNotes
+ @show={{this.showUserNotes}}
+ @count={{this.userNotesCount}}
+ />
+ </template>
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/after-reviewable-post-user/show-user-notes-on-flags.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/after-reviewable-post-user/show-user-notes-on-flags.gjs
new file mode 100644
index 00000000000..c2bed1c1605
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/after-reviewable-post-user/show-user-notes-on-flags.gjs
@@ -0,0 +1,62 @@
+import Component from "@ember/component";
+import EmberObject, { action } from "@ember/object";
+import { service } from "@ember/service";
+import { classNames, tagName } from "@ember-decorators/component";
+import DButton from "discourse/components/d-button";
+import icon from "discourse/helpers/d-icon";
+import { emojiUrlFor } from "discourse/lib/text";
+import { i18n } from "discourse-i18n";
+import { showUserNotes } from "../../lib/user-notes";
+
+@tagName("div")
+@classNames("after-reviewable-post-user-outlet", "show-user-notes-on-flags")
+export default class ShowUserNotesOnFlags extends Component {
+ static shouldRender(args, context) {
+ return context.siteSettings.user_notes_enabled && args.user;
+ }
+
+ @service store;
+
+ init() {
+ super.init(...arguments);
+ const model = EmberObject.create(this.user);
+ const userNotesCount = model.get("custom_fields.user_notes_count") || 0;
+ this.setProperties({
+ userNotesCount,
+ emojiEnabled: this.siteSettings.enable_emoji,
+ emojiUrl: emojiUrlFor("memo"),
+ userNotesTitle: i18n("user_notes.show", {
+ count: userNotesCount,
+ }),
+ });
+ }
+
+ @action
+ showUserNotes() {
+ const user = this.user;
+ showUserNotes(this.store, user.id, (count) =>
+ this.set("userNotesCount", count)
+ );
+ }
+
+ <template>
+ {{#if this.userNotesCount}}
+ <DButton
+ @translatedTitle={{this.userNotesTitle}}
+ @action={{this.showUserNotes}}
+ class="btn btn-flat"
+ >
+ {{#if this.emojiEnabled}}
+ <img
+ src={{this.emojiUrl}}
+ title={{this.userNotesTitle}}
+ alt
+ class="emoji"
+ />
+ {{else}}
+ {{icon "pen-to-square"}}
+ {{/if}}
+ </DButton>
+ {{/if}}
+ </template>
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/reviewable-note-form-after-note/copy-reviewable-note-to-user-option.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/reviewable-note-form-after-note/copy-reviewable-note-to-user-option.gjs
new file mode 100644
index 00000000000..e7b874f6f1a
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/reviewable-note-form-after-note/copy-reviewable-note-to-user-option.gjs
@@ -0,0 +1,23 @@
+import Component from "@glimmer/component";
+import { i18n } from "discourse-i18n";
+
+export default class CopyReviewableNoteToUserOption extends Component {
+ static shouldRender(args, context) {
+ return (
+ context.siteSettings.user_notes_enabled && context.currentUser?.staff
+ );
+ }
+
+ <template>
+ <@form.CheckboxGroup as |group|>
+ <group.Field
+ @name="copy_note_to_user"
+ @title={{i18n "user_notes.copy_reviewable_note"}}
+ @format="full"
+ as |field|
+ >
+ <field.Checkbox />
+ </group.Field>
+ </@form.CheckboxGroup>
+ </template>
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/user-card-post-names/show-user-notes-on-card.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/user-card-post-names/show-user-notes-on-card.gjs
new file mode 100644
index 00000000000..626254383ee
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/user-card-post-names/show-user-notes-on-card.gjs
@@ -0,0 +1,54 @@
+import Component from "@glimmer/component";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import DButton from "discourse/components/d-button";
+import icon from "discourse/helpers/d-icon";
+import emoji from "discourse/helpers/emoji";
+import I18n from "discourse-i18n";
+import { showUserNotes } from "../../lib/user-notes";
+
+export default class extends Component {
+ static shouldRender(args, context) {
+ const { siteSettings, currentUser } = context;
+ return siteSettings.user_notes_enabled && currentUser?.staff;
+ }
+
+ @service siteSettings;
+ @service currentUser;
+ @service store;
+
+ get userNotesCount() {
+ return parseInt(
+ this.args.outletArgs.user.get("user_notes_count") ||
+ this.args.outletArgs.user.get("custom_fields.user_notes_count") ||
+ 0,
+ 10
+ );
+ }
+
+ @action
+ showUserNotes() {
+ showUserNotes(this.store, this.args.outletArgs.user.id);
+ }
+
+ <template>
+ <div class="show-user-notes-on-card">
+ {{#if this.userNotesCount}}
+ <DButton
+ @translatedTitle={{I18n.t
+ "user_notes.show"
+ count=this.userNotesCount
+ }}
+ @action={{this.showUserNotes}}
+ class="btn-flat"
+ >
+ {{#if this.siteSettings.enable_emoji}}
+ {{emoji "memo"}}
+ {{else}}
+ {{icon "pen-to-square"}}
+ {{/if}}
+ </DButton>
+ {{/if}}
+ </div>
+ </template>
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/user-profile-controls/show-notes-on-profile.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/user-profile-controls/show-notes-on-profile.gjs
new file mode 100644
index 00000000000..64f03302a23
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/connectors/user-profile-controls/show-notes-on-profile.gjs
@@ -0,0 +1,41 @@
+import Component from "@ember/component";
+import { action } from "@ember/object";
+import { service } from "@ember/service";
+import { classNames, tagName } from "@ember-decorators/component";
+import ShowUserNotes from "../../components/show-user-notes";
+import { showUserNotes } from "../../lib/user-notes";
+
+@tagName("li")
+@classNames("user-profile-controls-outlet", "show-notes-on-profile")
+export default class ShowNotesOnProfile extends Component {
+ static shouldRender(args, context) {
+ const { siteSettings, currentUser } = context;
+ return siteSettings.user_notes_enabled && currentUser && currentUser.staff;
+ }
+
+ @service store;
+
+ init() {
+ super.init(...arguments);
+ const { model } = this;
+ this.set(
+ "userNotesCount",
+ model.user_notes_count || model.get("custom_fields.user_notes_count") || 0
+ );
+ }
+
+ @action
+ showUserNotes() {
+ const user = this.model;
+ showUserNotes(this.store, user.id, (count) =>
+ this.set("userNotesCount", count)
+ );
+ }
+
+ <template>
+ <ShowUserNotes
+ @show={{this.showUserNotes}}
+ @count={{this.userNotesCount}}
+ />
+ </template>
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/initializers/enable-user-notes.gjs b/plugins/discourse-user-notes/assets/javascripts/discourse/initializers/enable-user-notes.gjs
new file mode 100644
index 00000000000..4cf11df4bc8
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/initializers/enable-user-notes.gjs
@@ -0,0 +1,229 @@
+import Component from "@glimmer/component";
+import { ajax } from "discourse/lib/ajax";
+import { popupAjaxError } from "discourse/lib/ajax-error";
+import { withSilencedDeprecations } from "discourse/lib/deprecated";
+import { iconNode } from "discourse/lib/icon-library";
+import { withPluginApi } from "discourse/lib/plugin-api";
+import { applyValueTransformer } from "discourse/lib/transformer";
+import PostMetadataUserNotes from "../components/post-metadata-user-notes";
+import { showUserNotes, updatePostUserNotesCount } from "../lib/user-notes";
+
+/**
+ * Plugin initializer for enabling user notes functionality
+ */
+export default {
+ name: "enable-user-notes",
+ initialize(container) {
+ const siteSettings = container.lookup("service:site-settings");
+ const currentUser = container.lookup("service:current-user");
+
+ if (!siteSettings.user_notes_enabled || !currentUser?.staff) {
+ return;
+ }
+
+ withPluginApi((api) => {
+ customizePost(api, container);
+ customizePostMenu(api, container);
+ handleReviewableNoteCreation(api);
+ });
+ },
+};
+
+/**
+ * Customizes how user notes are displayed in posts
+ *
+ * @param {Object} api - Plugin API instance
+ * @param {Object} container - Container instance
+ */
+function customizePost(api, container) {
+ const siteSettings = container.lookup("service:site-settings");
+
+ const placement = applyValueTransformer(
+ "user-notes-icon-placement",
+ siteSettings.user_notes_icon_placement
+ );
+
+ // Component to display user notes flair icon
+ class UserNotesPostMetadataFlairIcon extends Component {
+ static shouldRender(args) {
+ return args.post?.user_custom_fields?.user_notes_count > 0;
+ }
+
+ <template><PostMetadataUserNotes @post={{@post}} /></template>
+ }
+
+ // Handle placement next to avatar
+ if (placement === "avatar") {
+ api.renderAfterWrapperOutlet(
+ "poster-avatar",
+ UserNotesPostMetadataFlairIcon
+ );
+ }
+ // Handle placement next to username
+ else if (placement === "name") {
+ // Mobile-specific version
+ class MobileUserNotesIcon extends UserNotesPostMetadataFlairIcon {
+ static shouldRender(args, context) {
+ return context.site.mobileView && super.shouldRender(args);
+ }
+ }
+
+ // Desktop-specific version
+ class DesktopUserNotesIcon extends UserNotesPostMetadataFlairIcon {
+ static shouldRender(args, context) {
+ return !context.site.mobileView && super.shouldRender(args);
+ }
+ }
+
+ api.renderBeforeWrapperOutlet(
+ "post-meta-data-poster-name",
+ MobileUserNotesIcon
+ );
+ api.renderAfterWrapperOutlet(
+ "post-meta-data-poster-name",
+ DesktopUserNotesIcon
+ );
+ }
+
+ withSilencedDeprecations("discourse.post-stream-widget-overrides", () =>
+ customizeWidgetPost(api)
+ );
+}
+
+/**
+ * Customizes the post widget to display user notes
+ *
+ * @param {Object} api - Plugin API instance
+ */
+function customizeWidgetPost(api) {
+ // Handler for showing user notes modal
+ function widgetShowUserNotes() {
+ showUserNotes(
+ this.store,
+ this.attrs.user_id,
+ (count) => {
+ this.sendWidgetAction("refreshUserNotes", count);
+ },
+ {
+ postId: this.attrs.id,
+ }
+ );
+ }
+
+ // Update post when notes are changed
+ api.attachWidgetAction("post", "refreshUserNotes", function (count) {
+ updatePostUserNotesCount(this.model, count);
+ });
+
+ const mobileView = api.container.lookup("service:site").mobileView;
+ const loc = mobileView ? "before" : "after";
+
+ // Helper to attach notes icon if user has notes
+ const attachUserNotesIconIfPresent = (dec) => {
+ const post = dec.getModel();
+ if (post?.user_custom_fields?.user_notes_count > 0) {
+ return dec.attach("user-notes-icon");
+ }
+ };
+
+ // Add notes icon to poster name
+ api.decorateWidget(`poster-name:${loc}`, (dec) => {
+ if (dec.widget.settings.hideNotes) {
+ return;
+ }
+
+ return attachUserNotesIconIfPresent(dec);
+ });
+
+ // Add notes icon after avatar
+ api.decorateWidget(`post-avatar:after`, (dec) => {
+ if (!dec.widget.settings.showNotes) {
+ return;
+ }
+
+ return attachUserNotesIconIfPresent(dec);
+ });
+
+ api.attachWidgetAction("post", "showUserNotes", widgetShowUserNotes);
+
+ // Create the user notes icon widget
+ api.createWidget("user-notes-icon", {
+ services: ["site-settings"],
+
+ tagName: "span.user-notes-icon",
+ click: widgetShowUserNotes,
+
+ html() {
+ if (this.siteSettings.enable_emoji) {
+ return this.attach("emoji", { name: "memo" });
+ } else {
+ return iconNode("pen-to-square");
+ }
+ },
+ });
+}
+
+/**
+ * Adds user notes button to post admin menu
+ *
+ * @param {Object} api - Plugin API instance
+ * @param {Object} container - Container instance
+ */
+function customizePostMenu(api, container) {
+ const appEvents = container.lookup("service:app-events");
+ const store = container.lookup("service:store");
+
+ api.addPostAdminMenuButton((attrs) => {
+ return {
+ icon: "pen-to-square",
+ label: "user_notes.attach",
+ action: (post) => {
+ showUserNotes(
+ store,
+ attrs.user_id,
+ (count) => {
+ updatePostUserNotesCount(post, count);
+ appEvents.trigger("post-stream:refresh", {
+ id: post.id,
+ });
+ },
+ { postId: attrs.id }
+ );
+ },
+ secondaryAction: "closeAdminMenu",
+ className: "add-user-note",
+ };
+ });
+}
+
+/**
+ * Optionally creates a user note when a reviewable note is created.
+ *
+ * @param {Object} api - Plugin API instance
+ */
+function handleReviewableNoteCreation(api) {
+ api.onAppEvent(
+ "reviewablenote:created",
+ async (data, reviewable, formApi) => {
+ if (!data.copy_note_to_user || !reviewable.target_created_by) {
+ return;
+ }
+
+ try {
+ await ajax("/user_notes", {
+ type: "POST",
+ data: {
+ user_note: {
+ user_id: reviewable.target_created_by.id,
+ raw: data.content.trim(),
+ },
+ },
+ });
+
+ formApi.set("copy_note_to_user", false);
+ } catch (error) {
+ popupAjaxError(error);
+ }
+ }
+ );
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/lib/user-notes.js b/plugins/discourse-user-notes/assets/javascripts/discourse/lib/user-notes.js
new file mode 100644
index 00000000000..b20de37de83
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/lib/user-notes.js
@@ -0,0 +1,24 @@
+import { getOwnerWithFallback } from "discourse/lib/get-owner";
+import UserNotesModal from "../../discourse/components/modal/user-notes";
+
+export function showUserNotes(store, userId, callback, opts) {
+ const modal = getOwnerWithFallback(this).lookup("service:modal");
+ opts = opts || {};
+
+ return store.find("user-note", { user_id: userId }).then((model) => {
+ return modal.show(UserNotesModal, {
+ model: {
+ note: model,
+ userId,
+ callback,
+ postId: opts.postId,
+ },
+ });
+ });
+}
+
+export function updatePostUserNotesCount(post, count) {
+ const cfs = post.user_custom_fields || {};
+ cfs.user_notes_count = count;
+ post.user_custom_fields = cfs;
+}
diff --git a/plugins/discourse-user-notes/assets/javascripts/discourse/pre-initializers/user-notes-transformers.js b/plugins/discourse-user-notes/assets/javascripts/discourse/pre-initializers/user-notes-transformers.js
new file mode 100644
index 00000000000..9bb6c722d7b
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/javascripts/discourse/pre-initializers/user-notes-transformers.js
@@ -0,0 +1,11 @@
+import { withPluginApi } from "discourse/lib/plugin-api";
+
+export default {
+ before: "freeze-valid-transformers",
+
+ initialize() {
+ withPluginApi((api) => {
+ api.addValueTransformerName("user-notes-icon-placement");
+ });
+ },
+};
diff --git a/plugins/discourse-user-notes/assets/stylesheets/user_notes.scss b/plugins/discourse-user-notes/assets/stylesheets/user_notes.scss
new file mode 100644
index 00000000000..78e99dc8e26
--- /dev/null
+++ b/plugins/discourse-user-notes/assets/stylesheets/user_notes.scss
@@ -0,0 +1,85 @@
+.d-modal.user-notes-modal {
+ .d-modal__container {
+ width: 100%;
+ }
+
+ .posted-by {
+ width: 40px;
+ float: left;
+ }
+
+ .note-contents {
+ overflow: hidden;
+
+ .cooked {
+ margin-top: 0.5em;
+ }
+
+ .username {
+ font-weight: bold;
+ }
+
+ p {
+ margin: 0 0 1em 0;
+ }
+ }
+
+ .user-note {
+ border-top: 1px solid var(--primary-low);
+ padding-top: 1em;
+
+ &:first-of-type {
+ margin-top: 1em;
+ }
+ }
+
+ .controls {
+ float: right;
+ }
+}
+
+.show-user-notes-on-flags {
+ display: inline-block;
+
+ button {
+ display: inline;
+ padding: 0;
+ }
+}
+
+.show-user-notes-on-card {
+ button {
+ display: inline;
+ padding: 0;
+ }
+}
+
+.user-notes-icon {
+ .mobile-view & {
+ order: 2;
+ margin-left: 10px;
+ }
+ cursor: pointer;
+}
+
+.admin-report.user-notes {
+ grid-column: span 12;
+
+ .admin-report-table {
+ table-layout: auto;
+
+ tbody tr td,
+ thead tr th {
+ text-align: left;
+ }
+
+ thead tr th.note,
+ tbody tr td.note {
+ width: 60%;
+ }
+ }
+}
+
+.add-user-note {
+ border-top: 1px solid rgb(var(--primary-low-rgb), 0.5);
+}
diff --git a/plugins/discourse-user-notes/config/locales/client.ar.yml b/plugins/discourse-user-notes/config/locales/client.ar.yml
new file mode 100644
index 00000000000..8a7e6c7fb38
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.ar.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/
+
+ar:
+ js:
+ user_notes:
+ title: "ملاحظات المستخدمين"
+ attach: "إضافة ملاحظة للمستخدم"
+ remove: "إزالة ملاحظة المستخدم"
+ show: "ملاحظات المستخدمين (%{count})"
+ delete_confirm: "هل تريد بالتأكيد حذف ملاحظة المستخدم هذه؟"
+ show_post: "عرض المنشور"
diff --git a/plugins/discourse-user-notes/config/locales/client.be.yml b/plugins/discourse-user-notes/config/locales/client.be.yml
new file mode 100644
index 00000000000..2ea77a0d350
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.be.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+be:
diff --git a/plugins/discourse-user-notes/config/locales/client.bg.yml b/plugins/discourse-user-notes/config/locales/client.bg.yml
new file mode 100644
index 00000000000..52333529d3c
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.bg.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/
+
+bg:
diff --git a/plugins/discourse-user-notes/config/locales/client.bs_BA.yml b/plugins/discourse-user-notes/config/locales/client.bs_BA.yml
new file mode 100644
index 00000000000..828a7e65af8
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.bs_BA.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/
+
+bs_BA:
diff --git a/plugins/discourse-user-notes/config/locales/client.ca.yml b/plugins/discourse-user-notes/config/locales/client.ca.yml
new file mode 100644
index 00000000000..f53e1762b1e
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.ca.yml
@@ -0,0 +1,14 @@
+# 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:
+ user_notes:
+ title: "Notes d'usuari"
+ attach: "Afegeix una nota d'usuari"
+ remove: "Elimina la nota d'usuari"
+ delete_confirm: "Esteu segur que voleu suprimir aquesta nota d'usuari?"
+ show_post: "Mostra la publicació"
diff --git a/plugins/discourse-user-notes/config/locales/client.cs.yml b/plugins/discourse-user-notes/config/locales/client.cs.yml
new file mode 100644
index 00000000000..ce1e5f0c5f3
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.cs.yml
@@ -0,0 +1,10 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+cs:
+ js:
+ user_notes:
+ show_post: "Zobrazit příspěvek"
diff --git a/plugins/discourse-user-notes/config/locales/client.da.yml b/plugins/discourse-user-notes/config/locales/client.da.yml
new file mode 100644
index 00000000000..1c1fa2ce6b9
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.da.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/
+
+da:
+ js:
+ user_notes:
+ title: "Bruger Noter"
+ attach: "Tilføj Brugernote"
+ remove: "Fjern Brugernote"
+ show: "Bruger Noter (%{count})"
+ delete_confirm: "Er du sikker på, at du vil slette bruger noten?"
+ show_post: "Vis indlæg"
diff --git a/plugins/discourse-user-notes/config/locales/client.de.yml b/plugins/discourse-user-notes/config/locales/client.de.yml
new file mode 100644
index 00000000000..7af1d78c058
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.de.yml
@@ -0,0 +1,16 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+de:
+ js:
+ user_notes:
+ title: "Benutzer-Notizen"
+ attach: "Benutzer-Notiz hinzufügen"
+ remove: "Benutzer-Notiz entfernen"
+ show: "Benutzer-Notizen (%{count})"
+ delete_confirm: "Bist du sicher, dass du diese Benutzer-Notiz löschen möchtest?"
+ show_post: "Beitrag anzeigen"
+ copy_reviewable_note: "Notiz ins Benutzerprofil kopieren?"
diff --git a/plugins/discourse-user-notes/config/locales/client.el.yml b/plugins/discourse-user-notes/config/locales/client.el.yml
new file mode 100644
index 00000000000..958c647ca18
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.el.yml
@@ -0,0 +1,15 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+el:
+ js:
+ user_notes:
+ title: "Σημειώσεις χρήστη"
+ attach: "Προσθήκη σημείωσης"
+ remove: "Αφαίρεση σημείωσης"
+ show: "Σημειώσεις χρήστη (%{count})"
+ delete_confirm: "Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτήν τη σημείωση χρήστη;"
+ show_post: "Εμφάνιση ανάρτησης"
diff --git a/plugins/discourse-user-notes/config/locales/client.en.yml b/plugins/discourse-user-notes/config/locales/client.en.yml
new file mode 100644
index 00000000000..e4e2aa3a13e
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.en.yml
@@ -0,0 +1,11 @@
+en:
+ js:
+ user_notes:
+ title: "User Notes"
+ attach: "Add User Note"
+ attach_note_description: "Add a note about this user. This note will be visible to staff only."
+ remove: "Remove User Note"
+ show: "User Notes (%{count})"
+ delete_confirm: "Are you sure you want to delete that user note?"
+ show_post: "Show Post"
+ copy_reviewable_note: "Copy note to user profile?"
diff --git a/plugins/discourse-user-notes/config/locales/client.en_GB.yml b/plugins/discourse-user-notes/config/locales/client.en_GB.yml
new file mode 100644
index 00000000000..2d4fa180ec7
--- /dev/null
+++ b/plugins/discourse-user-notes/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-user-notes/config/locales/client.es.yml b/plugins/discourse-user-notes/config/locales/client.es.yml
new file mode 100644
index 00000000000..7eafd42bac5
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.es.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/
+
+es:
+ js:
+ user_notes:
+ title: "Notas de usuario"
+ attach: "Añadir nota de usuario"
+ remove: "Eliminar nota de usuario"
+ show: "Notas de usuario (%{count})"
+ delete_confirm: "¿Seguro que quieres eliminar este nota del usuario?"
+ show_post: "Mostrar publicación"
diff --git a/plugins/discourse-user-notes/config/locales/client.et.yml b/plugins/discourse-user-notes/config/locales/client.et.yml
new file mode 100644
index 00000000000..120e54d748c
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.et.yml
@@ -0,0 +1,11 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+et:
+ js:
+ user_notes:
+ attach: "Lisa kasutaja märkus"
+ show_post: "Näita postitust"
diff --git a/plugins/discourse-user-notes/config/locales/client.fa_IR.yml b/plugins/discourse-user-notes/config/locales/client.fa_IR.yml
new file mode 100644
index 00000000000..181e1296304
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.fa_IR.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/
+
+fa_IR:
+ js:
+ user_notes:
+ title: "یادداشت‌های کاربر"
+ attach: "افزودن یادداشت کاربر"
+ remove: "حذف یادداشت کاربر"
+ show: "یادداشت‌های کاربر (%{count})"
+ delete_confirm: "آیا از حذف یادداشت کاربر مطمئن هستید؟"
+ show_post: "نمایش نوشته"
diff --git a/plugins/discourse-user-notes/config/locales/client.fi.yml b/plugins/discourse-user-notes/config/locales/client.fi.yml
new file mode 100644
index 00000000000..c969aa218b6
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.fi.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/
+
+fi:
+ js:
+ user_notes:
+ title: "Käyttäjähuomiot"
+ attach: "Lisää käyttäjähuomio"
+ remove: "Poista käyttäjähuomio"
+ show: "Käyttäjähuomiot (%{count})"
+ delete_confirm: "Oletko varma, että haluat poistaa kyseisen käyttäjähuomion?"
+ show_post: "Näytä viesti"
diff --git a/plugins/discourse-user-notes/config/locales/client.fr.yml b/plugins/discourse-user-notes/config/locales/client.fr.yml
new file mode 100644
index 00000000000..84b5403d6bd
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.fr.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/
+
+fr:
+ js:
+ user_notes:
+ title: "Notes d'utilisateur"
+ attach: "Ajouter une note d'utilisateur"
+ remove: "Supprimer la note d'utilisateur"
+ show: "Notes d'utilisateur (%{count})"
+ delete_confirm: "Voulez-vous vraiment supprimer cette note d'utilisateur ?"
+ show_post: "Afficher le message"
diff --git a/plugins/discourse-user-notes/config/locales/client.gl.yml b/plugins/discourse-user-notes/config/locales/client.gl.yml
new file mode 100644
index 00000000000..538743265e5
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.gl.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/
+
+gl:
+ js:
+ user_notes:
+ title: "Notas de usuario"
+ attach: "Engadir nota de usuario"
+ remove: "Eliminar nota de usuario"
+ show: "Notas de usuario (%{count})"
diff --git a/plugins/discourse-user-notes/config/locales/client.he.yml b/plugins/discourse-user-notes/config/locales/client.he.yml
new file mode 100644
index 00000000000..58dcaa408d4
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.he.yml
@@ -0,0 +1,16 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+he:
+ js:
+ user_notes:
+ title: "הערות משתמש"
+ attach: "הוספת הערת משתמש"
+ remove: "הסרת הערת משתמש"
+ show: "הערות משתמש (%{count})"
+ delete_confirm: "למחוק את הערת המשתמש הזאת"
+ show_post: "הצגת פוסט"
+ copy_reviewable_note: "להעתיק את ההערה לפרופיל המשתמש?"
diff --git a/plugins/discourse-user-notes/config/locales/client.hr.yml b/plugins/discourse-user-notes/config/locales/client.hr.yml
new file mode 100644
index 00000000000..38723949a9c
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.hr.yml
@@ -0,0 +1,11 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hr:
+ js:
+ user_notes:
+ attach: "Dodaj bilješku za korisnike"
+ show_post: "Prikaži objavu"
diff --git a/plugins/discourse-user-notes/config/locales/client.hu.yml b/plugins/discourse-user-notes/config/locales/client.hu.yml
new file mode 100644
index 00000000000..219b0547688
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.hu.yml
@@ -0,0 +1,10 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hu:
+ js:
+ user_notes:
+ show_post: "Bejegyzés mutatása"
diff --git a/plugins/discourse-user-notes/config/locales/client.hy.yml b/plugins/discourse-user-notes/config/locales/client.hy.yml
new file mode 100644
index 00000000000..abcbf304edd
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.hy.yml
@@ -0,0 +1,10 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hy:
+ js:
+ user_notes:
+ show_post: "Ցուցադրել Գրառումը"
diff --git a/plugins/discourse-user-notes/config/locales/client.id.yml b/plugins/discourse-user-notes/config/locales/client.id.yml
new file mode 100644
index 00000000000..9be6d12c1a4
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.id.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/
+
+id:
+ js:
+ user_notes:
+ title: "Catatan Pengguna"
+ attach: "Tambahkan Catatan Pengguna"
+ remove: "Hapus Catatan Pengguna"
+ show: "Catatan Pengguna (%{count})"
+ delete_confirm: "Apakah Anda yakin ingin menghapus catatan pengguna tersebut?"
+ show_post: "Tampilkan Postingan"
diff --git a/plugins/discourse-user-notes/config/locales/client.it.yml b/plugins/discourse-user-notes/config/locales/client.it.yml
new file mode 100644
index 00000000000..8a3adff6b87
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.it.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/
+
+it:
+ js:
+ user_notes:
+ title: "Note Utente"
+ attach: "Aggiungi nota utente"
+ remove: "Rimuovi Nota Utente"
+ show: "Note utente (%{count})"
+ delete_confirm: "Sei sicuro di voler cancellare questa nota utente?"
+ show_post: "Mostra messaggio"
diff --git a/plugins/discourse-user-notes/config/locales/client.ja.yml b/plugins/discourse-user-notes/config/locales/client.ja.yml
new file mode 100644
index 00000000000..06023920f45
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.ja.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/
+
+ja:
+ js:
+ user_notes:
+ title: "ユーザーメモ"
+ attach: "ユーザーメモを追加"
+ remove: "ユーザーメモを削除"
+ show: "ユーザーメモ(%{count})"
+ delete_confirm: "このユーザーメモを削除してもよろしいですか?"
+ show_post: "投稿を表示"
diff --git a/plugins/discourse-user-notes/config/locales/client.ko.yml b/plugins/discourse-user-notes/config/locales/client.ko.yml
new file mode 100644
index 00000000000..bd4172adb34
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.ko.yml
@@ -0,0 +1,14 @@
+# 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:
+ user_notes:
+ title: "사용자 노트"
+ attach: "사용자 메모 추가"
+ remove: "사용자 메모 제거"
+ delete_confirm: "해당 사용자 노트를 삭제 하시겠습니까?"
+ show_post: "게시물 표시"
diff --git a/plugins/discourse-user-notes/config/locales/client.lt.yml b/plugins/discourse-user-notes/config/locales/client.lt.yml
new file mode 100644
index 00000000000..16bb19758dc
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.lt.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/
+
+lt:
diff --git a/plugins/discourse-user-notes/config/locales/client.lv.yml b/plugins/discourse-user-notes/config/locales/client.lv.yml
new file mode 100644
index 00000000000..59e0ef6f4ed
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.lv.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/
+
+lv:
diff --git a/plugins/discourse-user-notes/config/locales/client.nb_NO.yml b/plugins/discourse-user-notes/config/locales/client.nb_NO.yml
new file mode 100644
index 00000000000..17f28fffaf5
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.nb_NO.yml
@@ -0,0 +1,10 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nb_NO:
+ js:
+ user_notes:
+ show_post: "Vis innlegg"
diff --git a/plugins/discourse-user-notes/config/locales/client.nl.yml b/plugins/discourse-user-notes/config/locales/client.nl.yml
new file mode 100644
index 00000000000..a62e276f5b0
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.nl.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/
+
+nl:
+ js:
+ user_notes:
+ title: "Gebruikersnotities"
+ attach: "Gebruikersnotitie toevoegen"
+ remove: "Gebruikersnotitie verwijderen"
+ show: "Gebruikersnotities (%{count})"
+ delete_confirm: "Weet je zeker dat je die gebruikersnotitie wilt verwijderen?"
+ show_post: "Bericht weergeven"
diff --git a/plugins/discourse-user-notes/config/locales/client.pl_PL.yml b/plugins/discourse-user-notes/config/locales/client.pl_PL.yml
new file mode 100644
index 00000000000..5f538ab7fcf
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.pl_PL.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/
+
+pl_PL:
+ js:
+ user_notes:
+ title: "Notatki do użytkownika"
+ attach: "Dodaj notatkę do użytkownika"
+ remove: "Usuń notatkę do użytkownika"
+ show: "Notatki do użytkownika (%{count})"
+ delete_confirm: "Czy na pewno chcesz usunąć tę notatkę do użytkownika?"
+ show_post: "Pokaż wiadomość"
diff --git a/plugins/discourse-user-notes/config/locales/client.pt.yml b/plugins/discourse-user-notes/config/locales/client.pt.yml
new file mode 100644
index 00000000000..bf2504e0fc3
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.pt.yml
@@ -0,0 +1,10 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt:
+ js:
+ user_notes:
+ show_post: "Mostrar Publicação"
diff --git a/plugins/discourse-user-notes/config/locales/client.pt_BR.yml b/plugins/discourse-user-notes/config/locales/client.pt_BR.yml
new file mode 100644
index 00000000000..ec8d464be03
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.pt_BR.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/
+
+pt_BR:
+ js:
+ user_notes:
+ title: "Anotações de usuário(a)"
+ attach: "Adicionar anotação de usuário(a)"
+ remove: "Remover anotação de usuário(a)"
+ show: "Anotações de usuário(a) (%{count})"
+ delete_confirm: "Tem certeza de que deseja excluir esta anotação de usuário(a)?"
+ show_post: "Mostrar Postagem"
diff --git a/plugins/discourse-user-notes/config/locales/client.ro.yml b/plugins/discourse-user-notes/config/locales/client.ro.yml
new file mode 100644
index 00000000000..fe21e0b8b90
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.ro.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/
+
+ro:
+ js:
+ user_notes:
+ title: "Note despre utilizator"
+ attach: "Adaugă notă despre utilizator"
+ remove: "Eliminați nota despre utilizator"
+ show: "Note utilizator (%{count})"
+ delete_confirm: "Ești sigur că vrei să ştergi acea notă de utilizator?"
+ show_post: "Arată postarea"
diff --git a/plugins/discourse-user-notes/config/locales/client.ru.yml b/plugins/discourse-user-notes/config/locales/client.ru.yml
new file mode 100644
index 00000000000..e5f6edad686
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.ru.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/
+
+ru:
+ js:
+ user_notes:
+ title: "Заметки пользователя"
+ attach: "Добавить заметку"
+ remove: "Удалить заметку пользователя"
+ show: "Заметки пользователя (%{count})"
+ delete_confirm: "Вы действительно хотите удалить эту заметку пользователя?"
+ show_post: "Показать заметку"
diff --git a/plugins/discourse-user-notes/config/locales/client.sk.yml b/plugins/discourse-user-notes/config/locales/client.sk.yml
new file mode 100644
index 00000000000..2510c19f8e4
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.sk.yml
@@ -0,0 +1,10 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sk:
+ js:
+ user_notes:
+ show_post: "Zobraz príspevok"
diff --git a/plugins/discourse-user-notes/config/locales/client.sl.yml b/plugins/discourse-user-notes/config/locales/client.sl.yml
new file mode 100644
index 00000000000..2aa4145b92a
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.sl.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/
+
+sl:
+ js:
+ user_notes:
+ title: "Opombe k uporabniku"
+ attach: "Dodaj opombo k uporabniku"
+ remove: "Odstrani opombo k uporabniku"
+ show: "Opomb k uporabniku (%{count})"
+ delete_confirm: "Ali želite odstraniti opombo k uporabniku?"
+ show_post: "Prikaži prispevek"
diff --git a/plugins/discourse-user-notes/config/locales/client.sq.yml b/plugins/discourse-user-notes/config/locales/client.sq.yml
new file mode 100644
index 00000000000..7f051b7a7cf
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.sq.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sq:
diff --git a/plugins/discourse-user-notes/config/locales/client.sr.yml b/plugins/discourse-user-notes/config/locales/client.sr.yml
new file mode 100644
index 00000000000..88d63d6ae1a
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.sr.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sr:
diff --git a/plugins/discourse-user-notes/config/locales/client.sv.yml b/plugins/discourse-user-notes/config/locales/client.sv.yml
new file mode 100644
index 00000000000..c54767b9764
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.sv.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/
+
+sv:
+ js:
+ user_notes:
+ title: "Användaranteckningar"
+ attach: "Lägg till användaranteckning"
+ remove: "Ta bort användaranteckning"
+ show: "Användaranteckningar (%{count})"
+ delete_confirm: "Är du säker på att du vill radera den användaranteckningen?"
+ show_post: "Visa inlägg"
diff --git a/plugins/discourse-user-notes/config/locales/client.sw.yml b/plugins/discourse-user-notes/config/locales/client.sw.yml
new file mode 100644
index 00000000000..04973f60476
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.sw.yml
@@ -0,0 +1,10 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sw:
+ js:
+ user_notes:
+ show_post: "Onyesha Taarifa"
diff --git a/plugins/discourse-user-notes/config/locales/client.te.yml b/plugins/discourse-user-notes/config/locales/client.te.yml
new file mode 100644
index 00000000000..03967bdbb07
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.te.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+te:
diff --git a/plugins/discourse-user-notes/config/locales/client.th.yml b/plugins/discourse-user-notes/config/locales/client.th.yml
new file mode 100644
index 00000000000..7de85ff91c4
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.th.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+th:
diff --git a/plugins/discourse-user-notes/config/locales/client.tr_TR.yml b/plugins/discourse-user-notes/config/locales/client.tr_TR.yml
new file mode 100644
index 00000000000..79c543f7e6e
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.tr_TR.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/
+
+tr_TR:
+ js:
+ user_notes:
+ title: "Kullanıcı Notları"
+ attach: "Kullanıcı Notu Ekle"
+ remove: "Kullanıcı Notunu Kaldır"
+ show: "Kullanıcı Notları (%{count})"
+ delete_confirm: "Bu kullanıcı notunu silmek istediğinizden emin misiniz?"
+ show_post: "Gönderiyi Göster"
diff --git a/plugins/discourse-user-notes/config/locales/client.ug.yml b/plugins/discourse-user-notes/config/locales/client.ug.yml
new file mode 100644
index 00000000000..a6bf0185ae2
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.ug.yml
@@ -0,0 +1,7 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ug:
diff --git a/plugins/discourse-user-notes/config/locales/client.uk.yml b/plugins/discourse-user-notes/config/locales/client.uk.yml
new file mode 100644
index 00000000000..8692f8663c8
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.uk.yml
@@ -0,0 +1,14 @@
+# 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:
+ user_notes:
+ title: "Нотатки користувачів"
+ attach: "Додати нотатку користувача"
+ remove: "Видалити нотатку користувача"
+ delete_confirm: "Ви впевнені, що хочете видалити цю нотатку користувача?"
+ show_post: "Показати допис"
diff --git a/plugins/discourse-user-notes/config/locales/client.ur.yml b/plugins/discourse-user-notes/config/locales/client.ur.yml
new file mode 100644
index 00000000000..242cbd15d35
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.ur.yml
@@ -0,0 +1,14 @@
+# 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:
+ user_notes:
+ title: "صارف نوٹس"
+ attach: "صارف نوٹ شامل کریں"
+ remove: "صارف نوٹ ہٹائیں"
+ delete_confirm: "کیا آپ واقعی وہ صارف نوٹ حذف کرنا چاہتے ہیں؟"
+ show_post: "پوسٹ دکھائیں"
diff --git a/plugins/discourse-user-notes/config/locales/client.vi.yml b/plugins/discourse-user-notes/config/locales/client.vi.yml
new file mode 100644
index 00000000000..f629dcf5329
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.vi.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/
+
+vi:
diff --git a/plugins/discourse-user-notes/config/locales/client.zh_CN.yml b/plugins/discourse-user-notes/config/locales/client.zh_CN.yml
new file mode 100644
index 00000000000..2454c596c61
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.zh_CN.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/
+
+zh_CN:
+ js:
+ user_notes:
+ title: "用户备注"
+ attach: "添加用户备注"
+ remove: "移除用户备注"
+ show: "用户备注 (%{count})"
+ delete_confirm: "确定要删除该用户备注吗?"
+ show_post: "显示帖子"
diff --git a/plugins/discourse-user-notes/config/locales/client.zh_TW.yml b/plugins/discourse-user-notes/config/locales/client.zh_TW.yml
new file mode 100644
index 00000000000..7e15fab0018
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/client.zh_TW.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/
+
+zh_TW:
diff --git a/plugins/discourse-user-notes/config/locales/server.ar.yml b/plugins/discourse-user-notes/config/locales/server.ar.yml
new file mode 100644
index 00000000000..0bb00f9fbe8
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.ar.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/
+
+ar:
+ site_settings:
+ user_notes_enabled: "السماح للمستخدمين من فريق العمل بإرفاق ملاحظات للمستخدمين"
+ user_notes_moderators_delete: "السماح للمشرفين بحذف ملاحظات المستخدمين"
+ user_notes:
+ official_warning: "لقد تلقيت تحذيرًا رسميًا من @%{username} -- %{warning_link}"
+ user_suspended: "علَّق @%{username} هذا الحساب حتى %{suspended_till}. السبب: %{reason}"
+ user_silenced: "كتم @%{username} هذا الحساب حتى %{silenced_till}. السبب: %{reason}"
+ reports:
+ user_notes:
+ title: "ملاحظات المستخدمين"
+ description: "يمكنك عرض قائمة بأحدث ملاحظات المستخدمين."
+ labels:
+ user: مستخدم
+ note: ملاحظة
+ moderator: مشرف
diff --git a/plugins/discourse-user-notes/config/locales/server.be.yml b/plugins/discourse-user-notes/config/locales/server.be.yml
new file mode 100644
index 00000000000..7b21bcf04aa
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.be.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+be:
+ reports:
+ user_notes:
+ labels:
+ user: Карыстальнік
+ moderator: запавольнік
diff --git a/plugins/discourse-user-notes/config/locales/server.bg.yml b/plugins/discourse-user-notes/config/locales/server.bg.yml
new file mode 100644
index 00000000000..6002625d911
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.bg.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bg:
+ reports:
+ user_notes:
+ labels:
+ user: Потребител
+ moderator: Модератор
diff --git a/plugins/discourse-user-notes/config/locales/server.bs_BA.yml b/plugins/discourse-user-notes/config/locales/server.bs_BA.yml
new file mode 100644
index 00000000000..d7d0a3951b7
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.bs_BA.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+bs_BA:
+ reports:
+ user_notes:
+ labels:
+ user: User
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.ca.yml b/plugins/discourse-user-notes/config/locales/server.ca.yml
new file mode 100644
index 00000000000..2494b154fba
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.ca.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/
+
+ca:
+ site_settings:
+ user_notes_enabled: "Permet als usuaris de l'equip responsable adjuntar notes als usuaris"
+ user_notes_moderators_delete: "Permet que els moderadors suprimeixin notes d'usuari"
+ user_notes:
+ official_warning: "S'ha rebut un avís oficial de @%{username} - %{warning_link}"
+ user_suspended: "@%{username} ha suspès aquest compte fins a %{suspended_till}. Motiu: %{reason}"
+ user_silenced: "@%{username} ha silenciat aquest compte fins a %{silenced_till}. Motiu: %{reason}"
+ reports:
+ user_notes:
+ title: "Notes de l'usuari"
+ description: "Llista les notes d'usuari més recents."
+ labels:
+ user: Usuari
+ note: Nota
+ moderator: Moderador
diff --git a/plugins/discourse-user-notes/config/locales/server.cs.yml b/plugins/discourse-user-notes/config/locales/server.cs.yml
new file mode 100644
index 00000000000..290d14e9494
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.cs.yml
@@ -0,0 +1,19 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+cs:
+ site_settings:
+ user_notes_enabled: "Povolit redaktorům připojit poznámku k uživatelům"
+ user_notes:
+ official_warning: "Obdrženo oficiální varování od @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} zakázal tento účet do %{suspended_till}. Důvod: %{reason}"
+ user_silenced: "@%{username} ulmčel tento účet do %{silenced_till}. Důvod: %{reason}"
+ reports:
+ user_notes:
+ labels:
+ user: Uživatel
+ note: Poznámka
+ moderator: Moderátor
diff --git a/plugins/discourse-user-notes/config/locales/server.da.yml b/plugins/discourse-user-notes/config/locales/server.da.yml
new file mode 100644
index 00000000000..3a2180de531
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.da.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/
+
+da:
+ site_settings:
+ user_notes_enabled: "Tillad hjælperteam brugere at vedhæfte noter til brugere"
+ user_notes_moderators_delete: "Tillad moderatorer at slette bruger noter"
+ user_notes:
+ official_warning: "Modtog en officiel advarsel fra @ %{username} - %{warning_link}"
+ user_suspended: "@ %{username} suspenderede denne konto indtil %{suspended_till}. Årsag: %{reason}"
+ user_silenced: "@%{username} gjorde denne konto lydløs indtil %{silenced_till}. Årsag: %{reason}"
+ reports:
+ user_notes:
+ title: "bruger noter"
+ description: "Vis de seneste bruger noter."
+ labels:
+ user: Bruger
+ note: Note
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.de.yml b/plugins/discourse-user-notes/config/locales/server.de.yml
new file mode 100644
index 00000000000..b754bc5bf1f
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.de.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/
+
+de:
+ site_settings:
+ user_notes_enabled: "Dem Team erlauben, Benutzer mit Notizen zu versehen"
+ user_notes_icon_placement: "Platzierung des Symbols für Benutzer-Notizen in den Beiträgen"
+ user_notes_moderators_delete: "Moderatoren erlauben, Benutzer-Notizen zu löschen"
+ user_notes:
+ official_warning: "Offizielle Warnung erhalten von @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} hat dieses Konto gesperrt bis %{suspended_till}. Grund: %{reason}"
+ user_silenced: "@%{username} hat dieses Konto stummgeschaltet bis %{silenced_till}. Grund: %{reason}"
+ reports:
+ user_notes:
+ title: "Benutzer-Notizen"
+ description: "Neueste Benutzer-Notizen anzeigen."
+ labels:
+ user: Benutzer
+ note: Notiz
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.el.yml b/plugins/discourse-user-notes/config/locales/server.el.yml
new file mode 100644
index 00000000000..49575d96a3a
--- /dev/null
+++ b/plugins/discourse-user-notes/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:
+ site_settings:
+ user_notes_enabled: "Επιτρέψτε στους επόπτες να προθέτουν σημειώσεις στους χρήστες"
+ user_notes_moderators_delete: "Να επιτρέπεται στους επόπτες να διαγράφουν σημειώσεις χρήστη"
+ user_notes:
+ official_warning: "Έλαβες μια επίσημη προειδοποίηση από το @%{username} - %{warning_link}"
+ user_suspended: "Ο χρήστης @%{username} ανέστειλε αυτόν τον λογαριασμό έως τις %{suspended_till}. Λόγος: %{reason}"
+ user_silenced: "Ο χρήστης @%{username} ανέστειλε αυτόν τον λογαριασμό έως τις %{silenced_till}. Λόγος: %{reason}"
+ reports:
+ user_notes:
+ title: "Σημειώσεις χρήστη"
+ description: "Λίστα των πρόσφατων σημειώσεων για χρήστες."
+ labels:
+ user: Χρήστης
+ note: Σημείωση
+ moderator: Συντονιστής
diff --git a/plugins/discourse-user-notes/config/locales/server.en.yml b/plugins/discourse-user-notes/config/locales/server.en.yml
new file mode 100644
index 00000000000..96d2187e3a0
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.en.yml
@@ -0,0 +1,19 @@
+en:
+ site_settings:
+ user_notes_enabled: "Allow staff users to attach notes to users"
+ user_notes_icon_placement: "Placement of the user notes indicative icon in the posts"
+ user_notes_moderators_delete: "Allow moderators to delete user notes"
+
+ user_notes:
+ official_warning: "Received an official warning from @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} suspended this account until %{suspended_till}. Reason: %{reason}"
+ user_silenced: "@%{username} silenced this account until %{silenced_till}. Reason: %{reason}"
+
+ reports:
+ user_notes:
+ title: "User notes"
+ description: "List most recent user notes."
+ labels:
+ user: User
+ note: Note
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.en_GB.yml b/plugins/discourse-user-notes/config/locales/server.en_GB.yml
new file mode 100644
index 00000000000..2d4fa180ec7
--- /dev/null
+++ b/plugins/discourse-user-notes/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-user-notes/config/locales/server.es.yml b/plugins/discourse-user-notes/config/locales/server.es.yml
new file mode 100644
index 00000000000..1ce721a1cdf
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.es.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/
+
+es:
+ site_settings:
+ user_notes_enabled: "Permitir a los usuarios del personal adjuntar notas a los usuarios"
+ user_notes_moderators_delete: "Permitir a los moderadores eliminar notas de usuario"
+ user_notes:
+ official_warning: "Recibió una advertencia oficial de @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} suspendió esta cuenta hasta el %{suspended_till}. Razón: %{reason}"
+ user_silenced: "@%{username} silenció esta cuenta hasta el %{silenced_till}. Razón: %{reason}"
+ reports:
+ user_notes:
+ title: "Notas de usuario"
+ description: "Listar las notas de usuario más recientes."
+ labels:
+ user: Usuario
+ note: Nota
+ moderator: Moderador
diff --git a/plugins/discourse-user-notes/config/locales/server.et.yml b/plugins/discourse-user-notes/config/locales/server.et.yml
new file mode 100644
index 00000000000..15ccf78ad08
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.et.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+et:
+ reports:
+ user_notes:
+ labels:
+ user: Kasutaja
+ moderator: Moderaator
diff --git a/plugins/discourse-user-notes/config/locales/server.fa_IR.yml b/plugins/discourse-user-notes/config/locales/server.fa_IR.yml
new file mode 100644
index 00000000000..e39053e4b31
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.fa_IR.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/
+
+fa_IR:
+ site_settings:
+ user_notes_moderators_delete: "به مدیران اجازه دهید یادداشت‌های کاربر را حذف کنند"
+ user_notes:
+ official_warning: "یک اخطار رسمی از کاربر @%{username} - %{warning_link} دریافت شده است."
+ user_suspended: "کاربر @%{username} این حساب کاربری را تا تاریخ %{suspended_till} مسدود کرده است. دلیل: %{reason}"
+ user_silenced: "کاربر @%{username} این حساب کاربری را تا تاریخ %{silenced_till} ساکت کرده است. دلیل: %{reason}"
+ reports:
+ user_notes:
+ title: "یادداشت‌های کاربر"
+ description: "فهرست جدیدترین یادداشت‌های کاربر."
+ labels:
+ user: کاربر
+ note: یادداشت
+ moderator: مدیر
diff --git a/plugins/discourse-user-notes/config/locales/server.fi.yml b/plugins/discourse-user-notes/config/locales/server.fi.yml
new file mode 100644
index 00000000000..6e6f93924b4
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.fi.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/
+
+fi:
+ site_settings:
+ user_notes_enabled: "Salli henkilökunnan lisätä huomioita käyttäjiin"
+ user_notes_moderators_delete: "Salli valvojien poistaa käyttäjähuomioita"
+ user_notes:
+ official_warning: "%{username} antoi virallisen varoituksen – %{warning_link}"
+ user_suspended: "@%{username} hyllytti tämän käyttäjän %{suspended_till} asti. Syy: %{reason}"
+ user_silenced: "@%{username} hiljensi tämän tilin %{silenced_till} asti. Syy: %{reason}"
+ reports:
+ user_notes:
+ title: "Käyttäjähuomiot"
+ description: "Listaa viimeisimmät käyttäjähuomiot."
+ labels:
+ user: Käyttäjä
+ note: Huomio
+ moderator: Valvoja
diff --git a/plugins/discourse-user-notes/config/locales/server.fr.yml b/plugins/discourse-user-notes/config/locales/server.fr.yml
new file mode 100644
index 00000000000..8cce0d7eaa4
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.fr.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/
+
+fr:
+ site_settings:
+ user_notes_enabled: "Permettre aux responsables d'associer des notes aux utilisateurs"
+ user_notes_moderators_delete: "Permettre aux modérateurs de supprimer les notes d'utilisateur"
+ user_notes:
+ official_warning: "A reçu un avertissement officiel de @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} a suspendu ce compte jusqu'au %{suspended_till}. Raison : %{reason}"
+ user_silenced: "@%{username} a mis ce compte en sourdine jusqu'au %{silenced_till}. Raison : %{reason}"
+ reports:
+ user_notes:
+ title: "Notes d'utilisateur"
+ description: "Liste des notes d'utilisateur les plus récentes."
+ labels:
+ user: Utilisateur
+ note: Note
+ moderator: Modérateur
diff --git a/plugins/discourse-user-notes/config/locales/server.gl.yml b/plugins/discourse-user-notes/config/locales/server.gl.yml
new file mode 100644
index 00000000000..eade7178983
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.gl.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+gl:
+ reports:
+ user_notes:
+ labels:
+ user: Usuario
+ moderator: Moderador
diff --git a/plugins/discourse-user-notes/config/locales/server.he.yml b/plugins/discourse-user-notes/config/locales/server.he.yml
new file mode 100644
index 00000000000..efd583b71b9
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.he.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/
+
+he:
+ site_settings:
+ user_notes_enabled: "לאפשר למשתמשי הצוות לצרף הערות למשתמשים"
+ user_notes_icon_placement: "הצבת סמל החיווי להערות משתמש בפוסטים"
+ user_notes_moderators_delete: "לאפשר למפקחים למחוק הערות משתמש"
+ user_notes:
+ official_warning: "התקבלה אזהרה רשמית מאת ‎@%{username}‎ -- %{warning_link}"
+ user_suspended: "חשבון זה הושעה על ידי ‎@%{username}‎ עד %{suspended_till}. סיבה: %{reason}"
+ user_silenced: "חשבון זה הושתק על ידי @%{username}‎ עד %{silenced_till}. סיבה: %{reason}"
+ reports:
+ user_notes:
+ title: "הערות משתמש"
+ description: "הצגת הערות המשתמש העדכניות ביותר."
+ labels:
+ user: משתמש
+ note: הערה
+ moderator: מפקח
diff --git a/plugins/discourse-user-notes/config/locales/server.hr.yml b/plugins/discourse-user-notes/config/locales/server.hr.yml
new file mode 100644
index 00000000000..4fe675fac8a
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.hr.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hr:
+ reports:
+ user_notes:
+ labels:
+ user: Korisnik
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.hu.yml b/plugins/discourse-user-notes/config/locales/server.hu.yml
new file mode 100644
index 00000000000..9c52d80539d
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.hu.yml
@@ -0,0 +1,19 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hu:
+ site_settings:
+ user_notes_enabled: "Megjegyzések hozzáadása a felhasználókhoz engedélyezése a személyzeti felhasználóknak"
+ user_notes:
+ official_warning: "Hivatalos figyelmeztetést kaptál a következő felhasználótól @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} felfüggesztette ezt a fiókot a következő ideig, %{suspended_till}. Ok: %{reason}"
+ user_silenced: "@%{username} elnémította ezt a fiókot a következő ideig, %{silenced_till}. Ok: %{reason}"
+ reports:
+ user_notes:
+ labels:
+ user: Felhasználó
+ note: Megjegyzés
+ moderator: Moderátor
diff --git a/plugins/discourse-user-notes/config/locales/server.hy.yml b/plugins/discourse-user-notes/config/locales/server.hy.yml
new file mode 100644
index 00000000000..30604b0261e
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.hy.yml
@@ -0,0 +1,19 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+hy:
+ site_settings:
+ user_notes_enabled: "Թույլատրել անձնակազմի անդամներին կցել նշումներ օգտատերերին"
+ user_notes:
+ official_warning: "Ստացել է պաշտոնական զգուշացում @%{username} -ից -- %{warning_link}"
+ user_suspended: "@%{username} -ը սառեցրել է հաշիվը մինչև %{suspended_till}: Պատճառը՝ %{reason}"
+ user_silenced: "@%{username} -ը լռեցրել է այս հաշիվը մինչև %{silenced_till}: Պատճառը՝ %{reason}"
+ reports:
+ user_notes:
+ labels:
+ user: Օգտատեր
+ note: Նշում
+ moderator: Մոդերատոր
diff --git a/plugins/discourse-user-notes/config/locales/server.id.yml b/plugins/discourse-user-notes/config/locales/server.id.yml
new file mode 100644
index 00000000000..5abd6e86beb
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.id.yml
@@ -0,0 +1,19 @@
+# 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:
+ site_settings:
+ user_notes_enabled: "Izinkan staf melampirkan pada pengguna"
+ user_notes_moderators_delete: "Izinkan moderator menghapus catatan pengguna"
+ user_notes:
+ official_warning: "Mendapatkan peringatan resmi dari @%{username} -- %{warning_link}"
+ reports:
+ user_notes:
+ title: "Catatan pengguna"
+ labels:
+ user: Pengguna
+ note: Catatan
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.it.yml b/plugins/discourse-user-notes/config/locales/server.it.yml
new file mode 100644
index 00000000000..7f177d5dc23
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.it.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/
+
+it:
+ site_settings:
+ user_notes_enabled: "Consenti ai membri dello staff di allegare note agli utenti"
+ user_notes_moderators_delete: "Consenti ai moderatori di eliminare le note utente"
+ user_notes:
+ official_warning: "Ha ricevuto un richiamo ufficiale da @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} ha sospeso questo account fino a %{suspended_till}. Motivo: %{reason}"
+ user_silenced: "@%{username} ha silenziato questo account fino a %{silenced_till}. Motivo: %{reason}"
+ reports:
+ user_notes:
+ title: "Note utente"
+ description: "Mostra le note utente più recenti."
+ labels:
+ user: Utente
+ note: Nota
+ moderator: Moderatore
diff --git a/plugins/discourse-user-notes/config/locales/server.ja.yml b/plugins/discourse-user-notes/config/locales/server.ja.yml
new file mode 100644
index 00000000000..4b582f45452
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.ja.yml
@@ -0,0 +1,22 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+ja:
+ site_settings:
+ user_notes_enabled: "スタッフユーザーがユーザーにメモを添付することを許可する"
+ user_notes_moderators_delete: "モデレーターがユーザーメモを削除することを許可する"
+ user_notes:
+ official_warning: "運営スタッフからの警告を @%{username} から受信しました -- %{warning_link}"
+ user_suspended: "@%{username} は、このアカウントを %{suspended_till} まで凍結しました。理由: %{reason}"
+ user_silenced: "@%{username} は、このアカウントを %{silenced_till} まで投稿禁止にしました。理由: %{reason}"
+ reports:
+ user_notes:
+ title: "ユーザーメモ"
+ description: "直近のユーザーメモをリストします。"
+ labels:
+ user: ユーザー
+ note: メモ
+ moderator: モデレーター
diff --git a/plugins/discourse-user-notes/config/locales/server.ko.yml b/plugins/discourse-user-notes/config/locales/server.ko.yml
new file mode 100644
index 00000000000..7b0a45a3e75
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.ko.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/
+
+ko:
+ site_settings:
+ user_notes_enabled: "직원 사용자가 사용자에게 메모를 첨부 할 수 있도록 허용"
+ user_notes_moderators_delete: "중재자가 사용자 노트를 삭제하도록 허용"
+ user_notes:
+ official_warning: "@ %{username}에서 공식 경고를 받았습니다-%{warning_link}"
+ user_suspended: "@ %{username}은 %{suspended_till}까지이 계정을 일시 중지했습니다. 이유 : %{reason}"
+ user_silenced: "@ %{username}은 %{silenced_till}까지이 계정을 침묵 시켰습니다. 이유 : %{reason}"
+ reports:
+ user_notes:
+ title: "사용자 노트"
+ description: "가장 최근의 사용자 메모를 나열하십시오."
+ labels:
+ user: 사용자
+ note: 노트
+ moderator: 운영자
diff --git a/plugins/discourse-user-notes/config/locales/server.lt.yml b/plugins/discourse-user-notes/config/locales/server.lt.yml
new file mode 100644
index 00000000000..070a521856e
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.lt.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lt:
+ reports:
+ user_notes:
+ labels:
+ user: Narys
+ moderator: Moderatorius
diff --git a/plugins/discourse-user-notes/config/locales/server.lv.yml b/plugins/discourse-user-notes/config/locales/server.lv.yml
new file mode 100644
index 00000000000..28e6fe54989
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.lv.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+lv:
+ reports:
+ user_notes:
+ labels:
+ user: Lietotājs
+ moderator: Moderātors
diff --git a/plugins/discourse-user-notes/config/locales/server.nb_NO.yml b/plugins/discourse-user-notes/config/locales/server.nb_NO.yml
new file mode 100644
index 00000000000..f80ccaa44af
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.nb_NO.yml
@@ -0,0 +1,18 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+nb_NO:
+ site_settings:
+ user_notes_enabled: "Tillat staben å opprette notater på brukere"
+ user_notes:
+ official_warning: "Mottok en offisiell advarsel fra %{username} -- %{warning_link}"
+ user_suspended: "@%{username} sperret denne kontoen til %{suspended_till}. Årsak: %{reason}"
+ user_silenced: "@%{username} dempet denne kontoen til %{silenced_till}. Årsak: %{reason}"
+ reports:
+ user_notes:
+ labels:
+ user: Bruker
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.nl.yml b/plugins/discourse-user-notes/config/locales/server.nl.yml
new file mode 100644
index 00000000000..5b458e2eb4e
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.nl.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/
+
+nl:
+ site_settings:
+ user_notes_enabled: "Medewerkers toestaan om notities toe te voegen aan gebruikers"
+ user_notes_moderators_delete: "Moderators toestaan om gebruikersnotities te verwijderen"
+ user_notes:
+ official_warning: "Heeft een officiële waarschuwing gekregen van @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} heeft dit account geschorst tot %{suspended_till}. Reden: %{reason}"
+ user_silenced: "@%{username} heeft dit account gedempt tot %{silenced_till}. Reden: %{reason}"
+ reports:
+ user_notes:
+ title: "Gebruikersnotities"
+ description: "Lijst van meest recente gebruikersnotities."
+ labels:
+ user: Gebruiker
+ note: Notitie
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.pl_PL.yml b/plugins/discourse-user-notes/config/locales/server.pl_PL.yml
new file mode 100644
index 00000000000..988ba97ef38
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.pl_PL.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/
+
+pl_PL:
+ site_settings:
+ user_notes_enabled: "Pozwól członkom zespołu dołączać uwagi do użytkowników"
+ user_notes_moderators_delete: "Pozwól moderatorom usuwać notatki do użytkowników"
+ user_notes:
+ official_warning: "Otrzymano oficjalne ostrzeżenie od @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} zawiesiłeś to konto do %{suspended_till}. Powód: %{reason}"
+ user_silenced: "@%{username}uciszył/a to konto do %{silenced_till}. Powód: %{reason} "
+ reports:
+ user_notes:
+ title: "Notatki do użytkownika"
+ description: "Lista najnowszych notatek do użytkowników."
+ labels:
+ user: Użytkownik
+ note: Notatka
+ moderator: Moderatorzy
diff --git a/plugins/discourse-user-notes/config/locales/server.pt.yml b/plugins/discourse-user-notes/config/locales/server.pt.yml
new file mode 100644
index 00000000000..7e8614284ce
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.pt.yml
@@ -0,0 +1,17 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+pt:
+ site_settings:
+ user_notes_enabled: "Permitir que os utilizadores da equipa anexem notas aos utilizadores"
+ user_notes:
+ official_warning: "Recebeu um aviso oficial de @%{username} -- %{warning_link}"
+ reports:
+ user_notes:
+ labels:
+ user: Utilizador
+ note: Nota
+ moderator: Moderador
diff --git a/plugins/discourse-user-notes/config/locales/server.pt_BR.yml b/plugins/discourse-user-notes/config/locales/server.pt_BR.yml
new file mode 100644
index 00000000000..5644650258f
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.pt_BR.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_BR:
+ site_settings:
+ user_notes_enabled: "Permitir que usuários(as) da equipe anexem anotações a usuários(as)"
+ user_notes_moderators_delete: "Permitir que moderadores apaguem anotações de usuário(a)"
+ user_notes:
+ official_warning: "Recebido um aviso oficial de @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} suspendeu esta conta até %{suspended_till}. Motivo: %{reason}"
+ user_silenced: "@%{username} silenciou esta conta até %{silenced_till}. Motivo: %{reason}"
+ reports:
+ user_notes:
+ title: "Anotações de usuário(a)"
+ description: "Listar as anotações de usuário(a) mais recentes."
+ labels:
+ user: Usuário(a)
+ note: Anotação
+ moderator: Moderador
diff --git a/plugins/discourse-user-notes/config/locales/server.ro.yml b/plugins/discourse-user-notes/config/locales/server.ro.yml
new file mode 100644
index 00000000000..c38ca917024
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.ro.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/
+
+ro:
+ site_settings:
+ user_notes_enabled: "Permite personalului să atașeze note utilizatorilor"
+ user_notes_moderators_delete: "Permite moderatorilor să șteargă notele despre utilizatori"
+ user_notes:
+ official_warning: "A primit un avertisment oficial de la %{username} -- %{warning_link}"
+ user_suspended: "%{username} a suspendat acest cont până pe %{suspended_till}. Motiv: %{reason}"
+ user_silenced: "%{username} a suspendat acest cont până pe %{silenced_till}. Motiv: %{reason}"
+ reports:
+ user_notes:
+ title: "Note despre utilizator"
+ description: "Listează cele mai recente note despre utilizatori."
+ labels:
+ user: Utilizator
+ note: Notă
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.ru.yml b/plugins/discourse-user-notes/config/locales/server.ru.yml
new file mode 100644
index 00000000000..018c564e764
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.ru.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/
+
+ru:
+ site_settings:
+ user_notes_enabled: "Разрешить персоналу прикреплять заметки к пользователям"
+ user_notes_moderators_delete: "Разрешить модераторам удалять заметки пользователей"
+ user_notes:
+ official_warning: "Получено официальное предупреждение от @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} приостановил этот аккаунт до %{suspended_till}. Причина: %{reason}"
+ user_silenced: "@%{username} заблокировал этот аккаунт до %{silenced_till}. Причина: %{reason}"
+ reports:
+ user_notes:
+ title: "Заметки пользователя"
+ description: "Список последних заметок пользователя."
+ labels:
+ user: Пользователь
+ note: Заметка
+ moderator: Модератор
diff --git a/plugins/discourse-user-notes/config/locales/server.sk.yml b/plugins/discourse-user-notes/config/locales/server.sk.yml
new file mode 100644
index 00000000000..bf704d7f3dd
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.sk.yml
@@ -0,0 +1,15 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sk:
+ site_settings:
+ user_notes_enabled: "Umožniť personálu napísať poznámku k používateľom"
+ reports:
+ user_notes:
+ labels:
+ user: Používateľ
+ note: Poznámka
+ moderator: Moderátor
diff --git a/plugins/discourse-user-notes/config/locales/server.sl.yml b/plugins/discourse-user-notes/config/locales/server.sl.yml
new file mode 100644
index 00000000000..b421275a63a
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.sl.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/
+
+sl:
+ site_settings:
+ user_notes_enabled: "Osebju omogoči dodajanje opomb k uporabniku"
+ user_notes_moderators_delete: "Dovoli moderatorjem, da izbrišejo opombe k uporabnikom"
+ user_notes:
+ official_warning: "Prejel uradno opozorilo od @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} onemogočil ta račun do %{suspended_till}. Razlog: %{reason}"
+ user_silenced: "@%{username} utišal ta račun do %{silenced_till}. Razlog: %{reason}"
+ reports:
+ user_notes:
+ title: "Opombe k uporabniku"
+ description: "Prikaži najnovejše opombe k uporabniku."
+ labels:
+ user: Uporabnik
+ note: Opomba
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.sq.yml b/plugins/discourse-user-notes/config/locales/server.sq.yml
new file mode 100644
index 00000000000..b7b4edbc81e
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.sq.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sq:
+ reports:
+ user_notes:
+ labels:
+ user: User
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.sr.yml b/plugins/discourse-user-notes/config/locales/server.sr.yml
new file mode 100644
index 00000000000..51e296fe071
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.sr.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sr:
+ reports:
+ user_notes:
+ labels:
+ user: Korisnik
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.sv.yml b/plugins/discourse-user-notes/config/locales/server.sv.yml
new file mode 100644
index 00000000000..03d1d86f43b
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.sv.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/
+
+sv:
+ site_settings:
+ user_notes_enabled: "Låt personalanvändare bifoga anteckningar till användare"
+ user_notes_moderators_delete: "Låt moderatorer radera användaranteckningar"
+ user_notes:
+ official_warning: "Fått en officiell varning från @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} stängde av det här kontot fram till %{suspended_till}. Anledning: %{reason}"
+ user_silenced: "@%{username} tystade det här kontot fram till %{silenced_till}. Anledning: %{reason}"
+ reports:
+ user_notes:
+ title: "Användaranteckningar"
+ description: "Lista över de senaste användaranteckningarna."
+ labels:
+ user: Användare
+ note: Anteckning
+ moderator: Moderator
diff --git a/plugins/discourse-user-notes/config/locales/server.sw.yml b/plugins/discourse-user-notes/config/locales/server.sw.yml
new file mode 100644
index 00000000000..085cfa54f40
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.sw.yml
@@ -0,0 +1,19 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+sw:
+ site_settings:
+ user_notes_enabled: "Waruhusu wasaidizi waambatanishe madokezo kwa watumiaji"
+ user_notes:
+ official_warning: "Umepokea onyo kutoka kwa @%{username} -- %{warning_link}"
+ user_suspended: "@%{username}amesimamisha akaunti yake mpaka %{suspended_till}. Sababu:%{reason}"
+ user_silenced: "@%{username} ameinyamazisha hii akaunti mpaka %{silenced_till}. Sababu: %{reason}"
+ reports:
+ user_notes:
+ labels:
+ user: Mtumiaji
+ note: Ujumbe
+ moderator: Msimamizi
diff --git a/plugins/discourse-user-notes/config/locales/server.te.yml b/plugins/discourse-user-notes/config/locales/server.te.yml
new file mode 100644
index 00000000000..a6b7291073e
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.te.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+te:
+ reports:
+ user_notes:
+ labels:
+ user: సభ్యుడు
+ moderator: నిర్వాహకుడు
diff --git a/plugins/discourse-user-notes/config/locales/server.th.yml b/plugins/discourse-user-notes/config/locales/server.th.yml
new file mode 100644
index 00000000000..d29f9676e1a
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.th.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+th:
+ reports:
+ user_notes:
+ labels:
+ user: ผู้ใช้
+ moderator: ผู้ดูแล
diff --git a/plugins/discourse-user-notes/config/locales/server.tr_TR.yml b/plugins/discourse-user-notes/config/locales/server.tr_TR.yml
new file mode 100644
index 00000000000..bbb79876de2
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.tr_TR.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/
+
+tr_TR:
+ site_settings:
+ user_notes_enabled: "Personel kullanıcıların kullanıcılara not eklemesine izin verin"
+ user_notes_moderators_delete: "Moderatörlerin kullanıcı notlarını silmesine izin verin"
+ user_notes:
+ official_warning: "%{username} adlı kullanıcıdan resmi bir uyarı aldı -- %{warning_link}"
+ user_suspended: "@%{username} bu hesabı %{suspended_till} tarihine kadar askıya aldı. Sebep: %{reason}"
+ user_silenced: "%{username} bu hesabı %{silenced_till} tarihine kadar susturdu. Sebep: %{reason}"
+ reports:
+ user_notes:
+ title: "Kullanıcı notları"
+ description: "En son kullanıcı notlarını listeleyin."
+ labels:
+ user: Kullanıcı
+ note: Not
+ moderator: Moderatör
diff --git a/plugins/discourse-user-notes/config/locales/server.ug.yml b/plugins/discourse-user-notes/config/locales/server.ug.yml
new file mode 100644
index 00000000000..945394935e8
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.ug.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/
+
+ug:
+ reports:
+ user_notes:
+ labels:
+ user: ئىشلەتكۈچى
+ note: ئەسكەرتىش
+ moderator: رىياسەتچى
diff --git a/plugins/discourse-user-notes/config/locales/server.uk.yml b/plugins/discourse-user-notes/config/locales/server.uk.yml
new file mode 100644
index 00000000000..8131f52cd90
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.uk.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/
+
+uk:
+ site_settings:
+ user_notes_enabled: "Дозволити персоналу додавати нотатки для користувачів"
+ user_notes_moderators_delete: "Дозволити модераторам видаляти нотатки користувачів"
+ user_notes:
+ official_warning: "Отримано офіційне попередження від @%{username} -- %{warning_link}"
+ user_suspended: "@%{username} призупинив цей обліковий запис до %{suspended_till}. Причина: %{reason}"
+ user_silenced: "@ %{username} приглушив цей обліковий запис до %{silenced_till}. Причина: %{reason}"
+ reports:
+ user_notes:
+ title: "Нотатки користувача"
+ description: "Список останніх нотаток користувачів."
+ labels:
+ user: Користувач
+ note: Нотатки
+ moderator: Модератор
diff --git a/plugins/discourse-user-notes/config/locales/server.ur.yml b/plugins/discourse-user-notes/config/locales/server.ur.yml
new file mode 100644
index 00000000000..7c6501c4952
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.ur.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/
+
+ur:
+ site_settings:
+ user_notes_enabled: "اسٹاف صارفین کو صارفین کیساتھ نوٹ منسلک کرنے کی اجازت دیں"
+ user_notes_moderators_delete: "منتظمین کو صارف نوٹس حذف کرنے کی اجازت دیں"
+ user_notes:
+ official_warning: "@%{username} کی طرف سے ایک آفیشل انتباہ ملی -- %{warning_link}"
+ user_suspended: "@%{username}نے یہ اکاؤنٹ %{suspended_till}تک معطل کر دیا۔ وجہ: %{reason} "
+ user_silenced: "@%{username}نے یہ اکاؤنٹ %{silenced_till} تک خاموش کر دیا۔ وجہ: %{reason} "
+ reports:
+ user_notes:
+ title: "صارف نوٹس"
+ description: "حالیہ ترین صارف نوٹس کو فہرست کریں۔"
+ labels:
+ user: صارف
+ note: نوٹ
+ moderator: ماڈریٹر
diff --git a/plugins/discourse-user-notes/config/locales/server.vi.yml b/plugins/discourse-user-notes/config/locales/server.vi.yml
new file mode 100644
index 00000000000..069e6f6fb9a
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.vi.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+vi:
+ reports:
+ user_notes:
+ labels:
+ user: Người dùng
+ moderator: Điều hành
diff --git a/plugins/discourse-user-notes/config/locales/server.zh_CN.yml b/plugins/discourse-user-notes/config/locales/server.zh_CN.yml
new file mode 100644
index 00000000000..deea7e37e4f
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.zh_CN.yml
@@ -0,0 +1,22 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_CN:
+ site_settings:
+ user_notes_enabled: "允许管理人员将备注附加到用户"
+ user_notes_moderators_delete: "允许版主删除用户备注"
+ user_notes:
+ official_warning: "收到来自 @%{username} 的正式警告 – %{warning_link}"
+ user_suspended: "@%{username} 将此帐户暂停至 %{suspended_till}。原因:%{reason}"
+ user_silenced: "@%{username} 将此帐户禁言至 %{silenced_till}。原因:%{reason}"
+ reports:
+ user_notes:
+ title: "用户备注"
+ description: "列出最近的用户备注。"
+ labels:
+ user: 用户
+ note: 备注
+ moderator: 版主
diff --git a/plugins/discourse-user-notes/config/locales/server.zh_TW.yml b/plugins/discourse-user-notes/config/locales/server.zh_TW.yml
new file mode 100644
index 00000000000..a2c4b05698b
--- /dev/null
+++ b/plugins/discourse-user-notes/config/locales/server.zh_TW.yml
@@ -0,0 +1,12 @@
+# WARNING: Never edit this file.
+# It will be overwritten when translations are pulled from Crowdin.
+#
+# To work with us on translations, join this project:
+# https://translate.discourse.org/
+
+zh_TW:
+ reports:
+ user_notes:
+ labels:
+ user: 使用者
+ moderator: 板主
diff --git a/plugins/discourse-user-notes/config/settings.yml b/plugins/discourse-user-notes/config/settings.yml
new file mode 100644
index 00000000000..d2beb6468b7
--- /dev/null
+++ b/plugins/discourse-user-notes/config/settings.yml
@@ -0,0 +1,14 @@
+plugins:
+ user_notes_enabled:
+ default: false
+ client: true
+ user_notes_icon_placement:
+ client: true
+ type: enum
+ default: "name"
+ choices:
+ - name
+ - avatar
+ user_notes_moderators_delete:
+ default: true
+ client: false
diff --git a/plugins/discourse-user-notes/db/migrate/20190724200243_rename_staff_notes.rb b/plugins/discourse-user-notes/db/migrate/20190724200243_rename_staff_notes.rb
new file mode 100644
index 00000000000..24d9b4fc287
--- /dev/null
+++ b/plugins/discourse-user-notes/db/migrate/20190724200243_rename_staff_notes.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class RenameStaffNotes < ActiveRecord::Migration[5.2]
+ def change
+ execute "UPDATE site_settings SET name = 'user_notes_enabled' WHERE name = 'staff_notes_enabled'"
+ end
+end
diff --git a/plugins/discourse-user-notes/db/migrate/20190725020422_rename_staff_notes_rows_and_fields.rb b/plugins/discourse-user-notes/db/migrate/20190725020422_rename_staff_notes_rows_and_fields.rb
new file mode 100644
index 00000000000..70bb56bd0d0
--- /dev/null
+++ b/plugins/discourse-user-notes/db/migrate/20190725020422_rename_staff_notes_rows_and_fields.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class RenameStaffNotesRowsAndFields < ActiveRecord::Migration[5.2]
+ def change
+ execute "UPDATE user_custom_fields SET name = 'user_notes_count' WHERE name = 'staff_notes_count'"
+ execute "UPDATE plugin_store_rows SET plugin_name = 'user_notes' WHERE plugin_name = 'staff_notes'"
+ end
+end
diff --git a/plugins/discourse-user-notes/db/migrate/20200120140900_add_user_notes_count_index.rb b/plugins/discourse-user-notes/db/migrate/20200120140900_add_user_notes_count_index.rb
new file mode 100644
index 00000000000..714a6d5b617
--- /dev/null
+++ b/plugins/discourse-user-notes/db/migrate/20200120140900_add_user_notes_count_index.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class AddUserNotesCountIndex < ActiveRecord::Migration[5.2]
+ def up
+ execute <<~SQL
+ DELETE
+ FROM user_custom_fields a
+ USING user_custom_fields b
+ WHERE a.name = 'user_notes_count'
+ AND a.name = b.name
+ AND a.user_id = b.user_id
+ AND a.id > b.id
+ SQL
+
+ add_index :user_custom_fields,
+ %i[name user_id],
+ unique: true,
+ name: :idx_user_custom_fields_user_notes_count,
+ where: "name = 'user_notes_count'"
+ end
+
+ def down
+ remove_index :user_custom_fields, name: :idx_user_custom_fields_user_notes_count
+ end
+end
diff --git a/plugins/discourse-user-notes/db/migrate/20200121120800_correct_user_notes_count.rb b/plugins/discourse-user-notes/db/migrate/20200121120800_correct_user_notes_count.rb
new file mode 100644
index 00000000000..d7afca2b78b
--- /dev/null
+++ b/plugins/discourse-user-notes/db/migrate/20200121120800_correct_user_notes_count.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+class CorrectUserNotesCount < ActiveRecord::Migration[5.2]
+ # This corrects an error in the previous migration (now fixed)
+
+ def up
+ execute <<~SQL
+ INSERT INTO user_custom_fields (
+ user_id,
+ name,
+ value,
+ created_at,
+ updated_at
+ ) SELECT
+ REPLACE(key, 'notes:', '')::int,
+ 'user_notes_count',
+ json_array_length(value::json),
+ now(),
+ now()
+ FROM plugin_store_rows
+ WHERE plugin_name = 'user_notes'
+ AND key LIKE 'notes:%'
+ ON CONFLICT (name, user_id) WHERE name::text = 'user_notes_count'::text
+ DO NOTHING
+ SQL
+ end
+
+ def down
+ # Nothing to do
+ end
+end
diff --git a/plugins/discourse-user-notes/plugin.rb b/plugins/discourse-user-notes/plugin.rb
new file mode 100644
index 00000000000..0d9532dc790
--- /dev/null
+++ b/plugins/discourse-user-notes/plugin.rb
@@ -0,0 +1,176 @@
+# frozen_string_literal: true
+
+# name: discourse-user-notes
+# about: Provides staff the ability to share notes with other staff about a user.
+# meta_topic_id: 41026
+# version: 0.0.2
+# authors: Robin Ward
+# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-user-notes
+
+enabled_site_setting :user_notes_enabled
+
+register_asset "stylesheets/user_notes.scss"
+
+register_svg_icon "pen-to-square"
+
+after_initialize do
+ require_dependency "user"
+
+ module ::DiscourseUserNotes
+ PLUGIN_NAME = "discourse-user-notes"
+ COUNT_FIELD = "user_notes_count"
+
+ class Engine < ::Rails::Engine
+ engine_name PLUGIN_NAME
+ isolate_namespace DiscourseUserNotes
+ end
+
+ def self.key_for(user_id)
+ "notes:#{user_id}"
+ end
+
+ def self.notes_for(user_id)
+ PluginStore.get("user_notes", key_for(user_id)) || []
+ end
+
+ def self.add_note(user, raw, created_by, opts = nil)
+ opts ||= {}
+
+ notes = notes_for(user.id)
+ record = {
+ id: SecureRandom.hex(16),
+ user_id: user.id,
+ raw: raw,
+ created_by: created_by,
+ created_at: Time.now,
+ }.merge(opts)
+
+ notes << record
+ ::PluginStore.set("user_notes", key_for(user.id), notes)
+
+ user.custom_fields[DiscourseUserNotes::COUNT_FIELD] = notes.size
+ user.save_custom_fields
+
+ record
+ end
+
+ def self.remove_note(user, note_id)
+ notes = notes_for(user.id)
+ notes.reject! { |n| n[:id] == note_id }
+
+ if notes.size > 0
+ ::PluginStore.set("user_notes", key_for(user.id), notes)
+ else
+ ::PluginStore.remove("user_notes", key_for(user.id))
+ end
+ user.custom_fields[DiscourseUserNotes::COUNT_FIELD] = notes.size
+ user.save_custom_fields
+ end
+ end
+
+ require_relative "app/serializers/user_note_serializer.rb"
+ require_relative "app/controllers/discourse_user_notes/user_notes_controller.rb"
+
+ Discourse::Application.routes.append { mount ::DiscourseUserNotes::Engine, at: "/user_notes" }
+
+ DiscourseUserNotes::Engine.routes.draw do
+ get "/" => "user_notes#index"
+ post "/" => "user_notes#create"
+ delete "/:id" => "user_notes#destroy"
+ end
+
+ allow_staff_user_custom_field(DiscourseUserNotes::COUNT_FIELD)
+
+ add_to_class(Guardian, :can_delete_user_notes?) do
+ (SiteSetting.user_notes_moderators_delete? && user.staff?) || user.admin?
+ end
+
+ add_to_serializer(:admin_detailed_user, :user_notes_count) do
+ object.custom_fields && object.custom_fields["user_notes_count"].to_i
+ end
+
+ add_model_callback(UserWarning, :after_commit, on: :create) do
+ user = User.find_by_id(self.user_id)
+ created_by_user = User.find_by_id(self.created_by_id)
+ warning_topic = Topic.find_by_id(self.topic_id)
+ raw_note =
+ I18n.with_locale(SiteSetting.default_locale) do
+ I18n.t(
+ "user_notes.official_warning",
+ username: created_by_user.username,
+ warning_link: "[#{warning_topic.title}](#{warning_topic.url})",
+ )
+ end
+ ::DiscourseUserNotes.add_note(
+ user,
+ raw_note,
+ Discourse::SYSTEM_USER_ID,
+ topic_id: self.topic_id,
+ )
+ end
+
+ add_report("user_notes") do |report|
+ report.modes = [:table]
+
+ report.data = []
+
+ report.labels = [
+ {
+ type: :user,
+ properties: {
+ username: :username,
+ id: :user_id,
+ avatar: :user_avatar_template,
+ },
+ title: I18n.t("reports.user_notes.labels.user"),
+ },
+ {
+ type: :user,
+ properties: {
+ username: :moderator_username,
+ id: :moderator_id,
+ avatar: :moderator_avatar_template,
+ },
+ title: I18n.t("reports.user_notes.labels.moderator"),
+ },
+ { type: :text, property: :note, title: I18n.t("reports.user_notes.labels.note") },
+ ]
+
+ values = []
+ values =
+ PluginStoreRow
+ .where(plugin_name: "user_notes")
+ .where("value::json->0->>'created_at'>=?", report.start_date)
+ .where("value::json->0->>'created_at'<=?", report.end_date)
+ .pluck(:value)
+
+ values.each do |value|
+ notes = JSON.parse(value)
+ notes.each do |note|
+ data = {}
+ created_at = Time.parse(note["created_at"])
+ user = User.find_by(id: note["user_id"])
+ moderator = User.find_by(id: note["created_by"])
+
+ if user && moderator
+ data[:created_at] = created_at
+ data[:user_id] = user.id
+ data[:username] = user.username_lower
+ data[:user_avatar_template] = User.avatar_template(
+ user.username_lower,
+ user.uploaded_avatar_id,
+ )
+ data[:moderator_id] = moderator.id
+ data[:moderator_username] = moderator.username_lower
+ data[:moderator_avatar_template] = User.avatar_template(
+ moderator.username_lower,
+ moderator.uploaded_avatar_id,
+ )
+ data[:note] = note["raw"]
+
+ report.data << data
+ end
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-user-notes/spec/system/core_features_spec.rb b/plugins/discourse-user-notes/spec/system/core_features_spec.rb
new file mode 100644
index 00000000000..db86db283bd
--- /dev/null
+++ b/plugins/discourse-user-notes/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"
+end
diff --git a/plugins/discourse-user-notes/spec/user_warning_spec.rb b/plugins/discourse-user-notes/spec/user_warning_spec.rb
new file mode 100644
index 00000000000..f80e10f6579
--- /dev/null
+++ b/plugins/discourse-user-notes/spec/user_warning_spec.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+require "rails_helper"
+
+describe UserWarning do
+ let(:user) { Fabricate(:user) }
+ let(:admin) { Fabricate(:admin) }
+ let(:topic) { Fabricate(:topic) }
+
+ describe "when a user warning is created" do
+ context "when staff notes plugin is enabled" do
+ before { SiteSetting.user_notes_enabled = true }
+
+ it "should create staff note for warning" do
+ UserWarning.create(topic_id: topic.id, user_id: user.id, created_by_id: admin.id)
+
+ expect(PluginStore.get("user_notes", "notes:#{user.id}")).to be_present
+ end
+
+ it "should use system language" do
+ freeze_time
+
+ warning = UserWarning.create!(topic_id: topic.id, user_id: user.id, created_by_id: admin.id)
+ warning.destroy!
+
+ I18n.with_locale(:fr) do # Simulate request from french user
+ UserWarning.create(topic_id: topic.id, user_id: user.id, created_by_id: admin.id)
+ end
+
+ notes = PluginStore.get("user_notes", "notes:#{user.id}")
+ expect(notes[0]["raw"]).to eq(notes[1]["raw"])
+ end
+ end
+ end
+end
diff --git a/plugins/discourse-user-notes/test/javascripts/acceptance/user-notes-test.js b/plugins/discourse-user-notes/test/javascripts/acceptance/user-notes-test.js
new file mode 100644
index 00000000000..7e9018d896f
--- /dev/null
+++ b/plugins/discourse-user-notes/test/javascripts/acceptance/user-notes-test.js
@@ -0,0 +1,65 @@
+import { click, fillIn, visit } from "@ember/test-helpers";
+import { test } from "qunit";
+import { acceptance } from "discourse/tests/helpers/qunit-helpers";
+import { i18n } from "discourse-i18n";
+
+acceptance("User Notes", function (needs) {
+ needs.user();
+ needs.settings({ user_notes_enabled: true });
+
+ needs.pretender((server, helper) => {
+ server.get("/user_notes", () => {
+ return helper.response(200, {
+ extras: { username: "eviltrout" },
+ user_notes: [],
+ });
+ });
+
+ server.post("/user_notes", () => {
+ return helper.response(200, {
+ user_note: {
+ id: "6d945d25740e9801920e54c71c516c7b",
+ user_id: 1,
+ raw: "Helpful user",
+ created_by: {
+ id: 2,
+ username: "sam",
+ name: null,
+ avatar_template:
+ "/letter_avatar_proxy/v4/letter/s/ac8455/{size}.png",
+ },
+ created_at: "2022-11-16T22:00:00.000Z",
+ can_delete: true,
+ post_id: null,
+ post_url: "",
+ post_title: null,
+ },
+ });
+ });
+ });
+
+ test("creates note from user's profile", async function (assert) {
+ await visit("/admin/users/1/eviltrout");
+
+ const modalClass = ".user-notes-modal";
+ assert
+ .dom(".user-controls .show-user-notes-btn")
+ .hasText(i18n("user_notes.title"));
+ assert.dom(modalClass).doesNotExist();
+
+ await click(".user-controls .show-user-notes-btn");
+
+ assert.dom(modalClass).exists();
+
+ await fillIn(`${modalClass} textarea`, "Helpful user");
+
+ assert.dom(`${modalClass} .btn-primary`).isEnabled();
+
+ await click(`${modalClass} .btn-primary`);
+ await click(`${modalClass} .modal-close`);
+
+ assert
+ .dom(".user-controls .show-user-notes-btn")
+ .hasText(i18n("user_notes.show", { count: 1 }));
+ });
+});
diff --git a/translator.yml b/translator.yml
index 6967d3385ec..838cb7ce656 100644
--- a/translator.yml
+++ b/translator.yml
@@ -213,3 +213,10 @@ files:
- source_path: plugins/discourse-post-voting/config/locales/server.en.yml
destination_path: plugins/post-voting/server.yml
label: post-voting
+
+ - source_path: plugins/discourse-user-notes/config/locales/client.en.yml
+ destination_path: plugins/user-notes/client.yml
+ label: user-notes
+ - source_path: plugins/discourse-user-notes/config/locales/server.en.yml
+ destination_path: plugins/user-notes/server.yml
+ label: user-notes