diff --git a/README.md b/README.md index 2b7a4ec..df1f882 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -### discourse-staff-notes +### discourse-user-notes This plugin gives staff members the ability to attach notes to users. @@ -11,9 +11,9 @@ Follow our [Install a Plugin](https://meta.discourse.org/t/install-a-plugin/1915 `git clone https://github.com/discourse/discourse-staff-notes.git` as the plugin command. Once you've installed it, review the settings under admin and then enable -`staff_notes_enabled`. +`user_notes_enabled`. -**Clearing browser cache might be required when first insalled** +**Clearing browser cache might be required when first installed** ## Issues diff --git a/assets/javascripts/discourse-staff-notes/connectors/flagged-post-controls/show-staff-notes-on-flags.js.es6 b/assets/javascripts/discourse-staff-notes/connectors/flagged-post-controls/show-staff-notes-on-flags.js.es6 index ba31ea6..4dc7da9 100644 --- a/assets/javascripts/discourse-staff-notes/connectors/flagged-post-controls/show-staff-notes-on-flags.js.es6 +++ b/assets/javascripts/discourse-staff-notes/connectors/flagged-post-controls/show-staff-notes-on-flags.js.es6 @@ -3,7 +3,7 @@ import { getOwner } from "discourse-common/lib/get-owner"; export default { shouldRender(args, component) { - return component.siteSettings.staff_notes_enabled; + return component.siteSettings.user_notes_enabled; }, setupComponent(args, component) { diff --git a/assets/javascripts/discourse-staff-notes/connectors/user-card-post-names/show-staff-notes-on-card.js.es6 b/assets/javascripts/discourse-staff-notes/connectors/user-card-post-names/show-staff-notes-on-card.js.es6 index 04d1498..3996762 100644 --- a/assets/javascripts/discourse-staff-notes/connectors/user-card-post-names/show-staff-notes-on-card.js.es6 +++ b/assets/javascripts/discourse-staff-notes/connectors/user-card-post-names/show-staff-notes-on-card.js.es6 @@ -5,7 +5,7 @@ import { emojiUrlFor } from "discourse/lib/text"; export default { shouldRender(args, component) { const { siteSettings, currentUser } = component; - return siteSettings.staff_notes_enabled && currentUser && currentUser.staff; + return siteSettings.user_notes_enabled && currentUser && currentUser.staff; }, setupComponent(args, component) { diff --git a/assets/javascripts/discourse-staff-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6 b/assets/javascripts/discourse-staff-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6 index bac44fc..ab4da3e 100644 --- a/assets/javascripts/discourse-staff-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6 +++ b/assets/javascripts/discourse-staff-notes/connectors/user-profile-controls/show-notes-on-profile.js.es6 @@ -4,7 +4,7 @@ import { getOwner } from "discourse-common/lib/get-owner"; export default { shouldRender(args, component) { const { siteSettings, currentUser } = component; - return siteSettings.staff_notes_enabled && currentUser && currentUser.staff; + return siteSettings.user_notes_enabled && currentUser && currentUser.staff; }, setupComponent(args, component) { diff --git a/assets/javascripts/discourse/initializers/enable-staff-notes.js.es6 b/assets/javascripts/discourse/initializers/enable-staff-notes.js.es6 index 0a4c7f2..9204458 100644 --- a/assets/javascripts/discourse/initializers/enable-staff-notes.js.es6 +++ b/assets/javascripts/discourse/initializers/enable-staff-notes.js.es6 @@ -8,7 +8,7 @@ export default { const siteSettings = container.lookup("site-settings:main"); const currentUser = container.lookup("current-user:main"); if ( - !siteSettings.staff_notes_enabled || + !siteSettings.user_notes_enabled || !currentUser || !currentUser.staff ) { diff --git a/assets/javascripts/discourse/templates/connectors/admin-dashboard-moderation-bottom/recent-staff-notes-report-table.hbs b/assets/javascripts/discourse/templates/connectors/admin-dashboard-moderation-bottom/recent-staff-notes-report-table.hbs index 90fa42a..62438d1 100644 --- a/assets/javascripts/discourse/templates/connectors/admin-dashboard-moderation-bottom/recent-staff-notes-report-table.hbs +++ b/assets/javascripts/discourse/templates/connectors/admin-dashboard-moderation-bottom/recent-staff-notes-report-table.hbs @@ -1,4 +1,4 @@ -{{#if siteSettings.staff_notes_enabled}} +{{#if siteSettings.user_notes_enabled}} {{admin-report dataSourceName="staff_notes" startDate=lastWeek diff --git a/config/locales/server.ca.yml b/config/locales/server.ca.yml index cdefff8..69d255f 100644 --- a/config/locales/server.ca.yml +++ b/config/locales/server.ca.yml @@ -7,8 +7,8 @@ ca: site_settings: - staff_notes_enabled: "Permet als usuaris de l'equip responsable adjuntar notes als usuaris" - staff_notes_moderators_delete: "Permet que els moderadors suprimeixin notes d’usuari" + 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" staff_notes: official_warning: "Rebut un advertiment oficial de @%{username} - %{warning_link}" user_suspended: "@ %{username} ha suspès aquest compte fins a %{suspended_till}. Motiu: %{reason}" diff --git a/config/locales/server.cs.yml b/config/locales/server.cs.yml index 25044e1..ffedd11 100644 --- a/config/locales/server.cs.yml +++ b/config/locales/server.cs.yml @@ -7,7 +7,7 @@ cs: site_settings: - staff_notes_enabled: "Povolit redaktorům připojit poznámku k uživatelům" + user_notes_enabled: "Povolit redaktorům připojit poznámku k uživatelům" staff_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}" diff --git a/config/locales/server.de.yml b/config/locales/server.de.yml index 8447405..1438517 100644 --- a/config/locales/server.de.yml +++ b/config/locales/server.de.yml @@ -7,7 +7,7 @@ de: site_settings: - staff_notes_enabled: "Erlaube dem Team, Benutzer mit Notizen zu versehen" + user_notes_enabled: "Erlaube dem Team, Benutzer mit Notizen zu versehen" staff_notes: official_warning: "Hat eine offizielle Warnung erhalten von @%{username} -- %{warning_link}" user_suspended: "@%{username} hat dieses Konto gesperrt bis %{suspended_till}. Grund: %{reason}" diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index ec8ceb8..166385d 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1,7 +1,7 @@ en: site_settings: - staff_notes_enabled: "Allow staff users to attach notes to users" - staff_notes_moderators_delete: "Allow moderators to delete user notes" + user_notes_enabled: "Allow staff users to attach notes to users" + user_notes_moderators_delete: "Allow moderators to delete user notes" staff_notes: official_warning: "Received an official warning from @%{username} -- %{warning_link}" diff --git a/config/locales/server.es.yml b/config/locales/server.es.yml index 2c88d6a..09df012 100644 --- a/config/locales/server.es.yml +++ b/config/locales/server.es.yml @@ -7,7 +7,7 @@ es: site_settings: - staff_notes_enabled: "Permitir a los usuarios del staff adjuntar notas a los usuarios" + user_notes_enabled: "Permitir a los usuarios del staff adjuntar notas a los usuarios" staff_notes: official_warning: "Recibiste una advertencia oficial de @%{username} -- %{warning_link}" user_suspended: "@%{username} suspendió esta cuenta hasta %{suspended_till}. Razón: %{reason}" diff --git a/config/locales/server.fi.yml b/config/locales/server.fi.yml index 62e6296..06357c9 100644 --- a/config/locales/server.fi.yml +++ b/config/locales/server.fi.yml @@ -7,7 +7,7 @@ fi: site_settings: - staff_notes_enabled: "Salli henkilökunnan lisätä huomioita käyttäjiin liittyen" + user_notes_enabled: "Salli henkilökunnan lisätä huomioita käyttäjiin liittyen" staff_notes: official_warning: "%{username} antoi virallisen varoituksen - %{warning_link}" user_suspended: "@%{username} hyllytti käyttäjätilin %{suspended_till} asti. Syy: %{reason}" diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index a78cd09..e7fea7b 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -7,7 +7,7 @@ fr: site_settings: - staff_notes_enabled: "Permettre aux responsables d'associer des notes aux utilisateurs" + user_notes_enabled: "Permettre aux responsables d'associer des notes aux utilisateurs" staff_notes: official_warning: "A reçu un avertissement officiel de @%{username} -- %{warning_link}" user_suspended: "@%{username} a suspendu ce compte jusqu'à %{suspended_till}. Raison : %{reason}" diff --git a/config/locales/server.he.yml b/config/locales/server.he.yml index c156b77..27a5df6 100644 --- a/config/locales/server.he.yml +++ b/config/locales/server.he.yml @@ -7,8 +7,8 @@ he: site_settings: - staff_notes_enabled: "לאפשר למשתמשי הצוות לצרף הערות למשתמשים" - staff_notes_moderators_delete: "לאפשר למפקחים למחוק הערות משתמש" + user_notes_enabled: "לאפשר למשתמשי הצוות לצרף הערות למשתמשים" + user_notes_moderators_delete: "לאפשר למפקחים למחוק הערות משתמש" staff_notes: official_warning: "התקבלה אזהרה רשמית מאת ‎@%{username}‎ -- %{warning_link}" user_suspended: "חשבון זה הושעה על ידי ‎@%{username}‎ עד %{suspended_till}. סיבה: %{reason}" diff --git a/config/locales/server.hu.yml b/config/locales/server.hu.yml index 386485f..88e0331 100644 --- a/config/locales/server.hu.yml +++ b/config/locales/server.hu.yml @@ -7,7 +7,7 @@ hu: site_settings: - staff_notes_enabled: "Megjegyzések hozzáadása a felhasználókhoz engedélyezése a személyzeti felhasználóknak" + user_notes_enabled: "Megjegyzések hozzáadása a felhasználókhoz engedélyezése a személyzeti felhasználóknak" staff_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}" diff --git a/config/locales/server.hy.yml b/config/locales/server.hy.yml index ded9c48..6e5b29f 100644 --- a/config/locales/server.hy.yml +++ b/config/locales/server.hy.yml @@ -7,7 +7,7 @@ hy: site_settings: - staff_notes_enabled: "Թույլատրել անձնակազմի անդամներին կցել նշումներ օգտատերերին" + user_notes_enabled: "Թույլատրել անձնակազմի անդամներին կցել նշումներ օգտատերերին" staff_notes: official_warning: "Ստացել է պաշտոնական զգուշացում @%{username} -ից -- %{warning_link}" user_suspended: "@%{username} -ը սառեցրել է հաշիվը մինչև %{suspended_till}: Պատճառը՝ %{reason}" diff --git a/config/locales/server.it.yml b/config/locales/server.it.yml index ee6e5b2..e9ce45d 100644 --- a/config/locales/server.it.yml +++ b/config/locales/server.it.yml @@ -7,7 +7,7 @@ it: site_settings: - staff_notes_enabled: "Abilitare gli utenti dello staff ad allegare note agli utenti" + user_notes_enabled: "Abilitare gli utenti dello staff ad allegare note agli utenti" staff_notes: official_warning: "Ha ricevuto un richiamo ufficiale da @%{username} -- %{warning_link}" user_suspended: "@%{username} ha sospeso questo account fino a %{suspended_till}. Motivazione: %{reason}" diff --git a/config/locales/server.ja.yml b/config/locales/server.ja.yml index d3bbe6f..fd48749 100644 --- a/config/locales/server.ja.yml +++ b/config/locales/server.ja.yml @@ -7,7 +7,7 @@ ja: site_settings: - staff_notes_enabled: "スタッフがユーザにメモを付けることを許可" + user_notes_enabled: "スタッフがユーザにメモを付けることを許可" staff_notes: official_warning: "@%{username} -- %{warning_link} から、公式な警告を受けました" user_suspended: "@%{username} \nこのアカウントは、%{suspended_till}まで無効化されました。\n理由:%{reason}" diff --git a/config/locales/server.nb_NO.yml b/config/locales/server.nb_NO.yml index 73e1c46..497ad41 100644 --- a/config/locales/server.nb_NO.yml +++ b/config/locales/server.nb_NO.yml @@ -7,7 +7,7 @@ nb_NO: site_settings: - staff_notes_enabled: "Tillat staben å opprette notater på brukere" + user_notes_enabled: "Tillat staben å opprette notater på brukere" staff_notes: official_warning: "Mottok en offisiell advarsel fra %{username} -- %{warning_link}" user_suspended: "@%{username} sperret denne kontoen til %{suspended_till}. Årsak: %{reason}" diff --git a/config/locales/server.nl.yml b/config/locales/server.nl.yml index 3206c0e..c283814 100644 --- a/config/locales/server.nl.yml +++ b/config/locales/server.nl.yml @@ -7,7 +7,7 @@ nl: site_settings: - staff_notes_enabled: "Stafgebruikers mogen notities aan gebruikers toevoegen" + user_notes_enabled: "Stafgebruikers mogen notities aan gebruikers toevoegen" staff_notes: official_warning: "Heeft een officiële waarschuwing gekregen van @%{username} -- %{warning_link}" user_suspended: "@%{username} heeft deze account geschorst tot %{suspended_till}. Reden: %{reason}" diff --git a/config/locales/server.pl_PL.yml b/config/locales/server.pl_PL.yml index c5b3516..97eb504 100644 --- a/config/locales/server.pl_PL.yml +++ b/config/locales/server.pl_PL.yml @@ -7,7 +7,7 @@ pl_PL: site_settings: - staff_notes_enabled: "Pozwól członkom zespołu dołączać uwagi do użytkowników" + user_notes_enabled: "Pozwól członkom zespołu dołączać uwagi do użytkowników" staff_notes: official_warning: "Otrzymano oficjalne ostrzeżenie od @%{username} -- %{warning_link}" user_suspended: "@%{username} zawiesiłeś to konto do %{suspended_till}. Powód: %{reason}" diff --git a/config/locales/server.pt.yml b/config/locales/server.pt.yml index 4eae109..9f2eb31 100644 --- a/config/locales/server.pt.yml +++ b/config/locales/server.pt.yml @@ -7,7 +7,7 @@ pt: site_settings: - staff_notes_enabled: "Permitir que os utilizadores da equipa anexem notas aos utilizadores" + user_notes_enabled: "Permitir que os utilizadores da equipa anexem notas aos utilizadores" staff_notes: official_warning: "Recebeu um aviso oficial de @%{username} -- %{warning_link}" reports: diff --git a/config/locales/server.pt_BR.yml b/config/locales/server.pt_BR.yml index 47357f1..de5c8f5 100644 --- a/config/locales/server.pt_BR.yml +++ b/config/locales/server.pt_BR.yml @@ -7,7 +7,7 @@ pt_BR: site_settings: - staff_notes_enabled: "Permitir que usuários da staff anexem notas aos usuários" + user_notes_enabled: "Permitir que usuários da staff anexem notas aos usuários" staff_notes: official_warning: "Recebido um aviso oficial de @%{username} -- %{warning_link}" user_suspended: "@%{username} suspendeu esta conta até %{suspended_till}. Motivo: %{reason}" diff --git a/config/locales/server.ru.yml b/config/locales/server.ru.yml index eb963cd..9bd4eea 100644 --- a/config/locales/server.ru.yml +++ b/config/locales/server.ru.yml @@ -7,7 +7,7 @@ ru: site_settings: - staff_notes_enabled: "Разрешить персоналу прикреплять заметки к пользователям" + user_notes_enabled: "Разрешить персоналу прикреплять заметки к пользователям" staff_notes: official_warning: "Получено официальное предупреждение от @%{username} -- %{warning_link}" user_suspended: "@%{username} приостановил этот аккаунт до %{suspended_till}. Причина: %{reason}" diff --git a/config/locales/server.sk.yml b/config/locales/server.sk.yml index 71161cf..8265539 100644 --- a/config/locales/server.sk.yml +++ b/config/locales/server.sk.yml @@ -7,7 +7,7 @@ sk: site_settings: - staff_notes_enabled: "Umožniť personálu napísať poznámku k používateľom" + user_notes_enabled: "Umožniť personálu napísať poznámku k používateľom" reports: staff_notes: labels: diff --git a/config/locales/server.sl.yml b/config/locales/server.sl.yml index d1130d1..bf10f52 100644 --- a/config/locales/server.sl.yml +++ b/config/locales/server.sl.yml @@ -7,7 +7,7 @@ sl: site_settings: - staff_notes_enabled: "Omogoči opombe osebja na uporabniku" + user_notes_enabled: "Omogoči opombe osebja na uporabniku" staff_notes: official_warning: "Prejel uradno opozorilo od @%{username} -- %{warning_link}" user_suspended: "@%{username} supendiral ta račun do %{suspended_till}. Razlog: %{reason}" diff --git a/config/locales/server.sw.yml b/config/locales/server.sw.yml index c51217e..a9deb2e 100644 --- a/config/locales/server.sw.yml +++ b/config/locales/server.sw.yml @@ -7,7 +7,7 @@ sw: site_settings: - staff_notes_enabled: "Waruhusu wasaidizi waambatanishe madokezo kwa watumiaji" + user_notes_enabled: "Waruhusu wasaidizi waambatanishe madokezo kwa watumiaji" staff_notes: official_warning: "Umepokea onyo kutoka kwa @%{username} -- %{warning_link}" user_suspended: "@%{username}amesimamisha akaunti yake mpaka %{suspended_till}. Sababu:%{reason}" diff --git a/config/locales/server.tr_TR.yml b/config/locales/server.tr_TR.yml index a13817c..48731c4 100644 --- a/config/locales/server.tr_TR.yml +++ b/config/locales/server.tr_TR.yml @@ -7,7 +7,7 @@ tr_TR: site_settings: - staff_notes_enabled: "Personel kullanıcılarının, kullanıcılara not eklemesine izin ver" + user_notes_enabled: "Personel kullanıcılarının, kullanıcılara not eklemesine izin ver" reports: staff_notes: labels: diff --git a/config/locales/server.ur.yml b/config/locales/server.ur.yml index 8802597..a8c0102 100644 --- a/config/locales/server.ur.yml +++ b/config/locales/server.ur.yml @@ -7,8 +7,8 @@ ur: site_settings: - staff_notes_enabled: "اسٹاف صارفین کو صارفین کیساتھ نوٹ منسلک کرنے کی اجازت دیں" - staff_notes_moderators_delete: "منتظمین کو صارف نوٹس حذف کرنے کی اجازت دیں" + user_notes_enabled: "اسٹاف صارفین کو صارفین کیساتھ نوٹ منسلک کرنے کی اجازت دیں" + user_notes_moderators_delete: "منتظمین کو صارف نوٹس حذف کرنے کی اجازت دیں" staff_notes: official_warning: "@%{username} کی طرف سے ایک آفیشل انتباہ ملی -- %{warning_link}" user_suspended: "@%{username}نے یہ اکاؤنٹ %{suspended_till}تک معطل کر دیا۔ وجہ: %{reason} " diff --git a/config/locales/server.zh_CN.yml b/config/locales/server.zh_CN.yml index 0bab991..225e552 100644 --- a/config/locales/server.zh_CN.yml +++ b/config/locales/server.zh_CN.yml @@ -7,8 +7,8 @@ zh_CN: site_settings: - staff_notes_enabled: "允许管理人员将注释附加到用户" - staff_notes_moderators_delete: "允许版主删除用户注释" + user_notes_enabled: "允许管理人员将注释附加到用户" + user_notes_moderators_delete: "允许版主删除用户注释" staff_notes: official_warning: "收到来自 @%{username}的正式警告 - %{warning_link}" user_suspended: "@%{username}暂停此帐户,直到%{suspended_till}。 原因:%{reason}" diff --git a/config/settings.yml b/config/settings.yml index 300502e..5f6a42a 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -1,7 +1,7 @@ plugins: - staff_notes_enabled: + user_notes_enabled: default: false client: true - staff_notes_moderators_delete: + user_notes_moderators_delete: default: true client: false diff --git a/plugin.rb b/plugin.rb index 9c6fa86..0f96178 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -# name: discourse-staff-notes +# name: discourse-user-notes # about: Gives the ability for staff members to attach notes to users # version: 0.0.2 # authors: Robin Ward # url: https://github.com/discourse/discourse-staff-notes -enabled_site_setting :staff_notes_enabled +enabled_site_setting :user_notes_enabled register_asset 'stylesheets/staff_notes.scss' @@ -203,7 +203,7 @@ after_initialize do whitelist_staff_user_custom_field(STAFF_NOTE_COUNT_FIELD) add_to_class(Guardian, :can_delete_staff_notes?) do - (SiteSetting.staff_notes_moderators_delete? && user.staff?) || user.admin? + (SiteSetting.user_notes_moderators_delete? && user.staff?) || user.admin? end add_to_serializer(:admin_detailed_user, :staff_notes_count, false) do diff --git a/spec/user_history_spec.rb b/spec/user_history_spec.rb index 7467ab9..6fa3d1f 100644 --- a/spec/user_history_spec.rb +++ b/spec/user_history_spec.rb @@ -9,7 +9,7 @@ describe UserHistory do describe 'when a user suspension log is created' do context "staff notes plugin is enabled" do before do - SiteSetting.staff_notes_enabled = true + SiteSetting.user_notes_enabled = true end it "should create staff note for suspension" do diff --git a/spec/user_warning_spec.rb b/spec/user_warning_spec.rb index 1f734fc..95c0149 100644 --- a/spec/user_warning_spec.rb +++ b/spec/user_warning_spec.rb @@ -10,7 +10,7 @@ describe UserWarning do describe 'when a user warning is created' do context "staff notes plugin is enabled" do before do - SiteSetting.staff_notes_enabled = true + SiteSetting.user_notes_enabled = true end it "should create staff note for warning" do