From 8aac646759f942a41a6afb57b4703d1b0a1a591f Mon Sep 17 00:00:00 2001 From: Daniel Hershcovich Date: Sat, 16 Apr 2016 08:07:57 +0300 Subject: [PATCH 001/320] Allow any username character in user search --- app/assets/javascripts/discourse/lib/user-search.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/user-search.js.es6 b/app/assets/javascripts/discourse/lib/user-search.js.es6 index 08d5c6bd6..eb5bc209b 100644 --- a/app/assets/javascripts/discourse/lib/user-search.js.es6 +++ b/app/assets/javascripts/discourse/lib/user-search.js.es6 @@ -91,7 +91,7 @@ export default function userSearch(options) { return new Ember.RSVP.Promise(function(resolve) { // TODO site setting for allowed regex in username - if (term.match(/[^a-zA-Z0-9_\.\-]/)) { + if (term.match(/[^\w\.\-]/)) { resolve([]); return; } From 7811213ff95845dd639e7911fde7a20d28bfc8fb Mon Sep 17 00:00:00 2001 From: scossar Date: Sun, 15 May 2016 16:01:13 -0700 Subject: [PATCH 002/320] vertical-align text-top --- app/assets/stylesheets/common/components/badges.css.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/stylesheets/common/components/badges.css.scss b/app/assets/stylesheets/common/components/badges.css.scss index a7b4c8c1b..110ad1968 100644 --- a/app/assets/stylesheets/common/components/badges.css.scss +++ b/app/assets/stylesheets/common/components/badges.css.scss @@ -213,7 +213,9 @@ margin-top: 0; width: 100%; line-height: 1; + vertical-align: text-top; span.badge-category { + max-width: 100px; padding: 5px; } } From 9ace919f7c49c33f17d794606e64d4db28ec4962 Mon Sep 17 00:00:00 2001 From: Erick Guan Date: Fri, 15 Apr 2016 19:12:42 +0200 Subject: [PATCH 003/320] Add translation for topic title and remove dangling validation translation --- config/locales/server.en.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 57a68ba5b..6c5643b5d 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -188,7 +188,6 @@ en: topic_not_found: "Something has gone wrong. Perhaps this topic was closed or deleted while you were looking at it?" just_posted_that: "is too similar to what you recently posted" - has_already_been_used: "has already been used" invalid_characters: "contains invalid characters" is_invalid: "is invalid; try to be a little more descriptive" next_page: "next page →" @@ -311,6 +310,8 @@ en: attributes: category: name: "Category Name" + topic: + title: 'Title' post: raw: "Body" user_profile: From 36ba5f6716db95d4b120bf1b89ea0dba02be4080 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Thu, 26 May 2016 07:54:55 +0530 Subject: [PATCH 004/320] FIX: broken onebox avatar image --- lib/pretty_text.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb index b328f230f..e1341006f 100644 --- a/lib/pretty_text.rb +++ b/lib/pretty_text.rb @@ -267,7 +267,7 @@ module PrettyText protect do v8.eval < Date: Thu, 26 May 2016 01:08:48 -0700 Subject: [PATCH 005/320] clean up some embed CSS oddities --- app/assets/stylesheets/embed.css.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/assets/stylesheets/embed.css.scss b/app/assets/stylesheets/embed.css.scss index 826b4e284..03af8d2b9 100644 --- a/app/assets/stylesheets/embed.css.scss +++ b/app/assets/stylesheets/embed.css.scss @@ -8,6 +8,10 @@ article.post { border-bottom: 1px solid #ddd; + img.avatar { + border-radius: 50%; + } + &.deleted { background-color: #ffe5e5; } @@ -141,3 +145,12 @@ footer { // load onebox CSS at the end @import "./common/base/onebox"; + +// we apparently use bottom margins on paras in the embed CSS, leading to weirdness +// which we will now clean up +aside.onebox { + margin-bottom: 20px; + p { + margin-bottom: 0 !important; + } +} From a92fd9d701d1ae0d0bcdfda26c5bd33e5d39543e Mon Sep 17 00:00:00 2001 From: David McClure Date: Thu, 26 May 2016 01:13:01 -0700 Subject: [PATCH 006/320] Add Site Setting to use HTML from incoming email when available. (#4236) --- config/locales/server.en.yml | 1 + config/site_settings.yml | 2 ++ lib/email/receiver.rb | 23 ++++++++++++++--------- spec/components/email/receiver_spec.rb | 12 ++++++++++++ 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index ee9d9ebb1..db341f15c 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1166,6 +1166,7 @@ en: reply_by_email_enabled: "Enable replying to topics via email." reply_by_email_address: "Template for reply by email incoming email address, for example: %{reply_key}@reply.example.com or replies+%{reply_key}@example.com" + incoming_email_prefer_html: "Use the HTML instead of the text for incoming email. May cause unexcpeted formatting issues!" disable_emails: "Prevent Discourse from sending any kind of emails" diff --git a/config/site_settings.yml b/config/site_settings.yml index f58e42c6a..18c732a2b 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -544,6 +544,8 @@ email: pop3_polling_username: '' pop3_polling_password: '' log_mail_processing_failures: false + incoming_email_prefer_html: + default: false email_in: default: false client: true diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb index bc2b98005..d71cf8ca7 100644 --- a/lib/email/receiver.rb +++ b/lib/email/receiver.rb @@ -212,16 +212,21 @@ module Email text = fix_charset(@mail) end - # prefer text over html - text = trim_discourse_markers(text) if text.present? - text, elided = EmailReplyTrimmer.trim(text, true) if text.present? - return [text, elided] if text.present? + use_html = html.present? && (!text.present? || SiteSetting.incoming_email_prefer_html) + use_text = text.present? unless use_html - # clean the html if that's all we've got - html = Email::HtmlCleaner.new(html).output_html if html.present? - html = trim_discourse_markers(html) if html.present? - html, elided = EmailReplyTrimmer.trim(html, true) if html.present? - return [html, elided] if html.present? + if use_text + text = trim_discourse_markers(text) + text, elided = EmailReplyTrimmer.trim(text, true) + return [text, elided] + end + + if use_html + html = Email::HtmlCleaner.new(html).output_html + html = trim_discourse_markers(html) + html, elided = EmailReplyTrimmer.trim(html, true) + return [html, elided] + end end def fix_charset(mail_part) diff --git a/spec/components/email/receiver_spec.rb b/spec/components/email/receiver_spec.rb index f996028ec..7a802acd1 100644 --- a/spec/components/email/receiver_spec.rb +++ b/spec/components/email/receiver_spec.rb @@ -171,6 +171,18 @@ describe Email::Receiver do expect(topic.posts.last.raw).to eq("This is the *text* part.") end + it "prefers html over text when site setting is enabled" do + SiteSetting.incoming_email_prefer_html = true + expect { process(:text_and_html_reply) }.to change { topic.posts.count } + expect(topic.posts.last.raw).to eq('This is the html part.') + end + + it "uses text when prefer_html site setting is enabled but no html is available" do + SiteSetting.incoming_email_prefer_html = true + expect { process(:text_reply) }.to change { topic.posts.count } + expect(topic.posts.last.raw).to eq("This is a text reply :)") + end + it "removes the 'on , wrote' quoting line" do expect { process(:on_date_contact_wrote) }.to change { topic.posts.count } expect(topic.posts.last.raw).to eq("This is the actual reply.") From c1b3912c3699b7d09e665c10baef6acf24348c04 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 26 May 2016 01:16:33 -0700 Subject: [PATCH 007/320] one more embed CSS tweak --- app/assets/stylesheets/embed.css.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/stylesheets/embed.css.scss b/app/assets/stylesheets/embed.css.scss index 03af8d2b9..ae15f2cc6 100644 --- a/app/assets/stylesheets/embed.css.scss +++ b/app/assets/stylesheets/embed.css.scss @@ -154,3 +154,9 @@ aside.onebox { margin-bottom: 0 !important; } } + +// images large enough for the lightbox wrapper don't have bottom margins +// either, unless we add one now +div.lightbox-wrapper { + margin-bottom: 20px; +} From 23799e342208cd910539c3ec5d88a1b56847bc93 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Thu, 26 May 2016 16:00:35 +0530 Subject: [PATCH 008/320] FIX: validate tl3_time_period max value --- config/site_settings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/site_settings.yml b/config/site_settings.yml index 18c732a2b..a6a000ad4 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -700,6 +700,7 @@ trust: tl3_time_period: default: 100 min: 1 + max: 1000000 tl3_requires_days_visited: default: 50 min: 0 From 7050042088187d169027a60bc0db95a74fd90e79 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 26 May 2016 11:50:15 -0400 Subject: [PATCH 009/320] Update translations --- config/locales/client.da.yml | 3 + config/locales/client.es.yml | 3 + config/locales/client.fi.yml | 2 + config/locales/client.fr.yml | 21 ++ config/locales/client.it.yml | 34 +++ config/locales/client.ja.yml | 260 +++++++++++-------- config/locales/client.pt.yml | 10 + config/locales/client.ro.yml | 6 +- config/locales/client.sq.yml | 2 +- config/locales/client.zh_CN.yml | 4 +- config/locales/server.ar.yml | 2 +- config/locales/server.es.yml | 5 +- config/locales/server.fi.yml | 5 +- config/locales/server.fr.yml | 22 +- config/locales/server.it.yml | 25 +- config/locales/server.ja.yml | 202 ++++++++++---- config/locales/server.pt.yml | 17 +- config/locales/server.pt_BR.yml | 2 +- config/locales/server.ro.yml | 10 +- config/locales/server.ru.yml | 4 +- config/locales/server.zh_CN.yml | 8 +- plugins/poll/config/locales/client.bs_BA.yml | 3 + plugins/poll/config/locales/client.fr.yml | 4 +- plugins/poll/config/locales/client.ja.yml | 2 +- plugins/poll/config/locales/server.ja.yml | 6 +- public/500.ja.html | 2 +- 26 files changed, 464 insertions(+), 200 deletions(-) diff --git a/config/locales/client.da.yml b/config/locales/client.da.yml index 7c0f49740..001364a85 100644 --- a/config/locales/client.da.yml +++ b/config/locales/client.da.yml @@ -111,6 +111,7 @@ da: google+: 'del dette link på Google+' email: 'send dette link i en e-mail' action_codes: + public_topic: "offentliggjorde dette emne %{when}" split_topic: "delte dette emne op %{when}" invited_user: "Inviterede %{who} %{when}" removed_user: "fjernede %{who} %{when}" @@ -285,6 +286,8 @@ da: title: "Brugere" likes_given: "Givet" likes_received: "Modtaget" + topics_entered: "Set" + topics_entered_long: "Læste emner" time_read: "Læsetid" topic_count: "Emner" topic_count_long: "Emner oprettet" diff --git a/config/locales/client.es.yml b/config/locales/client.es.yml index 2a0915905..a265c993c 100644 --- a/config/locales/client.es.yml +++ b/config/locales/client.es.yml @@ -302,6 +302,8 @@ es: title: "Usuarios" likes_given: "Dados" likes_received: "Recibidos" + topics_entered: "Vistos" + topics_entered_long: "Temas vistos" time_read: "Tiempo de Lectura" topic_count: "Temas" topic_count_long: "Temas creados" @@ -2620,6 +2622,7 @@ es: embed_truncate: "Truncar los posts insertados" embed_whitelist_selector: "Selector CSS para permitir elementos a embeber" embed_blacklist_selector: "Selector CSS para restringir elementos a embeber" + embed_classname_whitelist: "Clases CSS permitidas" feed_polling_enabled: "Importar posts usando RSS/ATOM" feed_polling_url: "URL del feed RSS/ATOM del que extraer datos" save: "Guardar ajustes de Insertado" diff --git a/config/locales/client.fi.yml b/config/locales/client.fi.yml index 6cecab1d4..c19d2c70c 100644 --- a/config/locales/client.fi.yml +++ b/config/locales/client.fi.yml @@ -111,6 +111,8 @@ fi: google+: 'jaa tämä linkki Google+:ssa' email: 'lähetä tämä linkki sähköpostissa' action_codes: + public_topic: "teki ketjusta julkisen %{when}" + private_topic: "teki ketjusta yksityisen %{when}" split_topic: "pilkkoi tämän ketjun %{when}" invited_user: "kutsui käyttäjän %{who} %{when}" removed_user: "poisti käyttäjän %{who} %{when}" diff --git a/config/locales/client.fr.yml b/config/locales/client.fr.yml index be3d803ee..0b513115f 100644 --- a/config/locales/client.fr.yml +++ b/config/locales/client.fr.yml @@ -302,6 +302,8 @@ fr: title: "Utilisateurs" likes_given: "Donnés" likes_received: "Reçus" + topics_entered: "Vus" + topics_entered_long: "Sujets consultés" time_read: "Temps de lecture" topic_count: "Sujets" topic_count_long: "Sujets créés" @@ -2620,6 +2622,7 @@ fr: embed_truncate: "Tronquer les messages intégrés" embed_whitelist_selector: "Sélecteur CSS pour les éléments qui seront autorisés dans les contenus intégrés" embed_blacklist_selector: "Sélecteur CSS pour les éléments qui seront interdits dans les contenus intégrés" + embed_classname_whitelist: "Classes CSS autorisées" feed_polling_enabled: "Importer les messages via flux RSS/ATOM" feed_polling_url: "URL du flux RSS/ATOM à importer" save: "Sauvegarder paramètres d'intégration" @@ -2753,6 +2756,9 @@ fr: watching: title: "Suivie" description: "Vous serez automatiquement abonné aux nouveaux sujets de ces catégories. Vous serez notifié de tous les nouveaux messages et sujets, et le décompte des messages non-lus et nouveaux aussi à côté de chaque sujet." + tracking: + title: "Suivi" + description: "Vous allez suivre automatiquement tous les nouveaux sujets dans ce tag. Le nombre de messages nouveaux et non lus apparaîtra à côté du sujet." regular: title: "Habitué" description: "Vous serez averti si quelqu'un mentionne votre @pseudo ou répond à votre message." @@ -2765,3 +2771,18 @@ fr: new: "Vous n'avez aucun nouveau sujet." read: "Vous n'avez lu aucun sujet pour le moment." posted: "Vous n'avez écrit aucun message pour le moment." + latest: "Il n'y a pas de sujets récents." + hot: "Il n'y a pas de sujets populaires." + bookmarks: "Vous n'avez pas encore de sujets ajoutés aux signets." + top: "Il n'y a pas de meilleurs sujets." + search: "Il n'y a pas de résultats de recherche." + bottom: + latest: "Il n'y a plus de sujets récents." + hot: "Il n'y a plus de sujets populaires." + posted: "Il n'y a plus de sujets publiés." + read: "Il n'y a plus de sujets lus." + new: "Il n'y a plus de nouveaux sujets." + unread: "Il n'y a plus de sujets non lus." + top: "Il n'y a plus de meilleurs sujets." + bookmarks: "Il n'y a plus de sujets ajoutés aux signets." + search: "Il n'y a plus de résultats de recherche." diff --git a/config/locales/client.it.yml b/config/locales/client.it.yml index 93de1785d..b9983631a 100644 --- a/config/locales/client.it.yml +++ b/config/locales/client.it.yml @@ -302,6 +302,8 @@ it: title: "Utenti" likes_given: "Dati" likes_received: "Ricevuti" + topics_entered: "Visualizzati" + topics_entered_long: "Argomenti Visualizzati" time_read: "Tempo di Lettura" topic_count: "Argomenti" topic_count_long: "Argomenti Creati" @@ -701,6 +703,9 @@ it: top_badges: "Migliori Targhette" no_badges: "Ancora nessuna targhetta." more_badges: "Altre Targhette" + top_links: "Migliori Collegamenti" + no_links: "Ancora nessun collegamento." + no_likes: "Ancora nessun \"Mi piace\"." associated_accounts: "Login" ip_address: title: "Ultimo indirizzo IP" @@ -2192,6 +2197,8 @@ it: grant_moderation: "assegna moderazione" revoke_moderation: "revoca moderazione" backup_operation: "operazione di backup" + deleted_tag: "etichetta cancellata" + renamed_tag: "etichetta rinominata" screened_emails: title: "Email Scansionate" description: "Quando qualcuno cerca di creare un nuovo account, verrando controllati i seguenti indirizzi email e la registrazione viene bloccata, o eseguita qualche altra azione." @@ -2478,6 +2485,7 @@ it: login: "Accesso" plugins: "Plugin" user_preferences: "Preferenze Utente" + tags: "Etichette" badges: title: Targhette new_badge: Nuova Targhetta @@ -2686,3 +2694,29 @@ it:

+ tagging: + all_tags: "Tutte Le Etichette" + selector_all_tags: "tutte le etichette" + changed: "etichette cambiate:" + tags: "Etichette" + choose_for_topic: "scegli delle etichette opzionali per questo argomento" + delete_tag: "Cancella Etichetta" + delete_confirm: "Sicuro di voler eliminare l'etichetta?" + rename_tag: "Rinomina Etichetta" + rename_instructions: "Scegli un nome per l'etichetta:" + sort_by: "Ordina per:" + sort_by_count: "conteggio" + sort_by_name: "nome" + filters: + without_category: "%{filter} %{tag} argomenti" + with_category: "%{filter} %{tag} argomenti in %{category}" + topics: + bottom: + hot: "Non ci sono ulteriori argomenti caldi." + posted: "Non ci sono ulteriori argomenti pubblicati." + read: "Non ci sono ulteriori argomenti letti." + new: "Non ci sono ulteriori nuovi argomenti." + unread: "Non ci sono ulteriori argomenti non letti." + top: "Non ci sono ulteriori argomenti di punta." + bookmarks: "Non ci sono ulteriori argomenti aggiunti ai segnalibri." + search: "Non ci sono ulteriori risultati di ricerca." diff --git a/config/locales/client.ja.yml b/config/locales/client.ja.yml index 06b4f1e4d..853ce02b7 100644 --- a/config/locales/client.ja.yml +++ b/config/locales/client.ja.yml @@ -29,8 +29,8 @@ ja: long_no_year: "MMM D h:mm a" long_no_year_no_time: "MMM D" full_no_year_no_time: "MMMM Do" - long_with_year: "YYYY, D MMM h:mm a" - long_with_year_no_time: "YYYY, D MMM" + long_with_year: "YYYY, MMM D h:mm a" + long_with_year_no_time: "YYYY, MMM D" full_with_year_no_time: "MMMM Do, YYYY" long_date_with_year: "MMM D, 'YY LT" long_date_without_year: "MMM D, LT" @@ -38,13 +38,13 @@ ja: long_date_without_year_with_linebreak: "MMM D
LT" long_date_with_year_with_linebreak: "MMM D, 'YY
LT" tiny: - half_a_minute: "< 1分" + half_a_minute: "1分前" less_than_x_seconds: - other: "< %{count}秒" + other: "%{count}秒前" x_seconds: other: "%{count}秒" less_than_x_minutes: - other: "< %{count}分" + other: "%{count}分前" x_minutes: other: "%{count}分" about_x_hours: @@ -54,10 +54,10 @@ ja: about_x_years: other: "%{count}年" over_x_years: - other: "> %{count}年" + other: "%{count}年以上前" almost_x_years: other: "%{count}年" - date_month: "MMM D" + date_month: "MMM D日" date_year: "MMM 'YY" medium: x_minutes: @@ -92,12 +92,17 @@ ja: google+: 'Google+ でこのリンクを共有する' email: 'メールでこのリンクを送る' action_codes: + public_topic: "%{when} にこのトピックは公開されました" + private_topic: "%{when} にこのトピックは非公開にされました" invited_user: "%{who} から招待されました: %{when}" autoclosed: - enabled: 'クローズされました // %{when}' + enabled: 'クローズされました: %{when}' closed: - enabled: 'クローズされました // %{when}' - topic_admin_menu: "トピック管理" + enabled: 'クローズされました: %{when}' + visible: + enabled: 'リストに表示: %{when}' + disabled: 'リストから非表示: %{when}' + topic_admin_menu: "トピックの管理" emails_are_disabled: "メールアドレスの送信は管理者によって無効化されています。全てのメール通知は行われません" s3: regions: @@ -113,7 +118,7 @@ ja: ap_northeast_2: "Asia Pacific (Seoul)" sa_east_1: "South America (Sao Paulo)" edit: 'このトピックのタイトルとカテゴリを編集' - not_implemented: "申し訳ありませんが、この機能はまだ実装されていません" + not_implemented: "この機能はまだ実装されていません!" no_value: "いいえ" yes_value: "はい" generic_error: "申し訳ありませんが、エラーが発生しました" @@ -122,14 +127,14 @@ ja: log_in: "ログイン" age: "経過" joined: "参加時刻" - admin_title: "Admin" + admin_title: "管理設定" flags_title: "通報" show_more: "もっと見る" show_help: "オプション" links: "リンク" links_lowercase: other: "リンク" - faq: "よくある質問" + faq: "FAQ" guidelines: "ガイドライン" privacy_policy: "プライバシーポリシー" privacy: "プライバシー" @@ -155,7 +160,7 @@ ja: other: "{{count}}文字" suggested_topics: title: "関連トピック" - pm_title: "提案したメッセージ" + pm_title: "他のメッセージ" about: simple_title: "このサイトについて" title: "%{title}について" @@ -163,7 +168,7 @@ ja: our_admins: "管理者" our_moderators: "モデレータ" stat: - all_time: "今まで" + all_time: "すべて" last_7_days: "過去7日間" last_30_days: "過去30日間" like_count: "いいね!" @@ -191,7 +196,7 @@ ja: topic_count_unread: other: "{{count}} 個の未読トピック。" topic_count_new: - other: "{{count}} 個の新規トピック。" + other: "{{count}} 件の新しいトピック" click_to_show: "クリックして表示" preview: "プレビュー" cancel: "キャンセル" @@ -317,35 +322,35 @@ ja: '9': "引用" '11': "編集" '12': "アイテム送信" - '13': "インボックス" + '13': "受信ボックス" '14': "保留" categories: - all: "全てのカテゴリ" - all_subcategories: "全てのサブカテゴリ" + all: "すべてのカテゴリ" + all_subcategories: "すべてのサブカテゴリ" no_subcategory: "サブカテゴリなし" category: "カテゴリ" category_list: "カテゴリリストを表示" reorder: - title: "カテゴリを並び替える" - title_long: "カテゴリリストを再構築" + title: "カテゴリの並び替え" + title_long: "カテゴリリストを並べ直します" fix_order: "位置を修正" - save: "オーダーを保存" + save: "順番を保存" apply_all: "適用" position: "位置" posts: "投稿" topics: "トピック" - latest: "最新の投稿" - latest_by: "最新投稿: " + latest: "最近の投稿" + latest_by: "最新投稿: " toggle_ordering: "カテゴリの並び替えモードを切り替え" subcategories: "サブカテゴリ:" topic_stats: "新しいトピック数" topic_stat_sentence: - other: "過去 %{unit} 間 %{count} 個の新規トピック。" - post_stats: "新規トピック数:" + other: "過去 %{unit} 間 %{count} 個の新着トピック。" + post_stats: "新着トピック数:" post_stat_sentence: other: "過去 %{unit} 間 %{count} 個の新しい投稿。" ip_lookup: - title: IPアドレスで検索 + title: IPアドレスを検索 hostname: ホスト名 location: 現在地 location_not_found: (不明) @@ -356,7 +361,7 @@ ja: username: "ユーザ名" trust_level: "トラストレベル" read_time: "読んだ時間" - topics_entered: "Topics Entered" + topics_entered: "入力したトピック" post_count: "# 投稿" confirm_delete_other_accounts: "これらのアカウントを削除してもよろしいですか?" user_fields: @@ -367,7 +372,7 @@ ja: mute: "ミュート" edit: "プロフィールを編集" download_archive: "自分の投稿をダウンロード" - new_private_message: "新規メッセージ" + new_private_message: "新しいメッセージ" private_message: "メッセージ" private_messages: "メッセージ" activity_stream: "アクティビティ" @@ -393,7 +398,7 @@ ja: disable_jump_reply: "返信した後に投稿へ移動しない" dynamic_favicon: "新規または更新されたトピックのカウントをブラウザアイコンに表示する" edit_history_public: "投稿の編集履歴を公開する" - external_links_in_new_tab: "外部リンクを全て新しいタブで開く" + external_links_in_new_tab: "外部リンクをすべて別のタブで開く" enable_quoting: "選択したテキストを引用して返信する" change: "変更" moderator: "{{user}} はモデレータです" @@ -404,14 +409,19 @@ ja: suspended_notice: "このユーザは {{date}} まで凍結状態です。" suspended_reason: "理由: " github_profile: "Github" - mailing_list_mode: "投稿される度にメールで通知を受け取る(ミュートにしたトピック、カテゴリ以外)" + email_activity_summary: "アクティビティの情報" + mailing_list_mode: + enabled: "メーリングリストモードを有効にする" + instructions: | + この設定は、アクティビティの情報機能を無効化します。
+ ミュートしているトピックやカテゴリはこれらのメールには含まれません。 watched_categories: "ウォッチ中" watched_categories_instructions: "これらのカテゴリに新しく投稿されたトピックを自動的に参加します。これらのカテゴリに対して新しい投稿があった場合、登録されたメールアドレスと、コミュニティ内の通知ボックスに通知が届き、トピック一覧に新しい投稿数がつきます。" tracked_categories: "追跡中" tracked_categories_instructions: "カテゴリの新しいトピックを自動的に追跡します。トピックに対して新しい投稿があった場合、トピック一覧に新しい投稿数がつきます。" muted_categories: "ミュート中" delete_account: "アカウントを削除する" - delete_account_confirm: "本当にアカウントを削除しますか?削除されたアカウントは復元できません。" + delete_account_confirm: "アカウントを削除してもよろしいですか?削除されたアカウントは復元できません。" deleted_yourself: "あなたのアカウントは削除されました。" delete_yourself_not_allowed: "アカウントを削除できませんでした。サイトの管理者へ連絡してください。" unread_message_count: "メッセージ" @@ -428,15 +438,15 @@ ja: warnings_received: "警告" messages: all: "すべて" - inbox: "Inbox" + inbox: "受信ボックス" sent: "送信済み" archive: "アーカイブ" groups: "自分のグループ" bulk_select: "メッセージを選択" - move_to_inbox: "Inboxへ移動" + move_to_inbox: "受信ボックスへ移動" move_to_archive: "アーカイブ" failed_to_move: "選択したメッセージを移動できませんでした(ネットワークがダウンしている可能性があります)" - select_all: "全てを選択する" + select_all: "すべて選択する" change_password: success: "(メールを送信しました)" in_progress: "(メールを送信中)" @@ -448,7 +458,7 @@ ja: error: "変更中にエラーが発生しました。" change_username: title: "ユーザ名を変更" - confirm: "ユーザ名を変更すると、投稿への引用と @ユーザ名でメンションされた時のリンクが解除されます。本当にユーザ名を変更してもよろしいですか?" + confirm: "ユーザ名を変更すると、投稿への引用と @ユーザ名でメンションされた時のリンクが解除されます。ユーザ名を変更しても本当によろしいですか?" taken: "このユーザ名は既に使われています。" error: "ユーザ名変更中にエラーが発生しました。" invalid: "このユーザ名は無効です。英数字のみ利用可能です。" @@ -481,6 +491,8 @@ ja: ok: "確認用メールを送信します" invalid: "正しいメールアドレスを入力してください" authenticated: "あなたのメールアドレスは {{provider}} によって認証されています" + frequency: + other: "最後に利用されてから{{count}}分以上経過した場合にメールを送ります。" name: title: "名前" instructions: "フルネーム(任意)" @@ -520,24 +532,30 @@ ja: title: "いいねされた時に通知" always: "常時" email_previous_replies: + title: "メールの文章の下部に以前の返信を含める" always: "常に" email_digests: - title: "サイトを訪れていない場合、ダイジェストをメールで送信する" + title: "サイトを訪れていない場合、まとめをメールで送る" every_30_minutes: "30分毎" every_hour: "1時間毎" daily: "毎日" every_three_days: "3日毎" weekly: "毎週" every_two_weeks: "2週間に1回" + include_tl0_in_digests: "新しいユーザからの投稿を含める" email_direct: "誰かが投稿を引用した時、投稿に返信があった時、私のユーザ名にメンションがあった時、またはトピックへの招待があった時にメールで通知を受け取る。" email_private_messages: "メッセージを受け取ったときにメールで通知を受け取る。" - email_always: "フォーラムにアクティブに参加している状態でも常にメール通知を受け取る" + email_always: "常にメールへ通知を送る" other_settings: "その他" categories_settings: "カテゴリ設定" new_topic_duration: label: "以下の条件でトピックを新規と見なす" - not_viewed: "未読のもの" + not_viewed: "未読" last_here: "ログアウトした後に投稿されたもの" + after_1_day: "昨日投稿されたもの" + after_2_days: "2日前に投稿されたもの" + after_1_week: "先週投稿されたもの" + after_2_weeks: "2週間前に投稿されたもの" auto_track_topics: "自動でトピックを追跡する" auto_track_options: never: "追跡しない" @@ -593,13 +611,23 @@ ja: time_read: "読んだ時間" topic_count: other: "つのトピックを作成" + post_count: + other: "つの投稿" + likes_given: + other: "あげた " + likes_received: + other: "もらった " + days_visited: + other: "訪問日数" posts_read: other: "読んだ投稿" bookmark_count: other: "つのブックマーク" no_replies: "まだ返信はありません。" no_topics: "まだトピックはありません。" + top_badges: "最近ゲットしたバッジ" no_badges: "まだバッジはありません。" + more_badges: "バッジをもっと見る" associated_accounts: "関連アカウント" ip_address: title: "最近使用したIPアドレス" @@ -667,7 +695,7 @@ ja: enabled_description: "トピックのまとめを表示されています。" description: "{{replyCount}}件の返信があります。" enable: 'このトピックを要訳する' - disable: '全ての投稿を表示する' + disable: 'すべての投稿を表示する' deleted_filter: enabled_description: "削除された投稿は非表示になっています。" disabled_description: "削除された投稿は表示しています。" @@ -675,8 +703,8 @@ ja: disable: "削除された投稿を表示する" private_message_info: title: "メッセージ" - invite: "友だちを招待する..." - remove_allowed_user: "このメッセージから{{name}}を本当に取り除きますか?" + invite: "他の人を招待する..." + remove_allowed_user: "このメッセージから {{name}} を削除してもよろしいですか?" email: 'メール' username: 'ユーザ名' last_seen: '最終アクティビティ' @@ -693,9 +721,9 @@ ja: invite: "ユーザ名かメールアドレスを入力してください。パスワードリセット用のメールを送信します。" reset: "パスワードをリセット" complete_username: "%{username},アカウントにパスワード再設定メールを送りました。" - complete_email: "%{email}にパスワード再設定メールを送りました。" + complete_email: "%{email}宛にパスワード再設定メールを送信しました。" complete_username_found: "%{username},アカウントにパスワード再設定メールを送りました。" - complete_email_found: "%{email}にパスワード再設定メールを送りました。" + complete_email_found: "%{email}宛にパスワード再設定メールを送信しました。" complete_username_not_found: " %{username}は見つかりませんでした" complete_email_not_found: "%{email}で登録したアカウントがありません。" login: @@ -767,13 +795,14 @@ ja: reply_here: "ここに返信" reply: "返信" cancel: "キャンセル" - create_topic: "トピック作成" + create_topic: "トピックを作る" create_pm: "メッセージ" title: "またはCtrl+Enter" users_placeholder: "ユーザの追加" title_placeholder: "トピックのタイトルを入力してください。" edit_reason_placeholder: "編集する理由は何ですか?" show_edit_reason: "(編集理由を追加)" + reply_placeholder: "文章を入力してください。 Markdown, BBコード, HTMLが使用出来ます。 画像はドラッグアンドドロップで貼り付けられます。" view_new_post: "新しい投稿を見る。" saving: "保存中" saved: "保存完了!" @@ -832,7 +861,7 @@ ja: invitee_accepted: "

{{username}} accepted your invitation

" moved_post: "

{{username}} moved {{description}}

" linked: "

{{username}} {{description}}

" - granted_badge: "

{{description}}バッジをゲットしました

" + granted_badge: "

'{{description}}' バッジをゲット!

" group_message_summary: other: "

{{count}}件のメッセージが{{group_name}}へ着ています

" alt: @@ -844,6 +873,7 @@ ja: invitee_accepted: "招待が承認されました: " moved_post: "投稿を移動しました: " linked: "あなたの投稿にリンク" + granted_badge: "バッジを付与" group_message_summary: "グループ宛のメッセージがあります" popup: mentioned: '"{{topic}}"で{{username}} がタグ付けしました - {{site_title}}' @@ -865,20 +895,25 @@ ja: select_file: "ファイル選択" image_link: "イメージのリンク先" search: - latest_post: "最新の投稿" - select_all: "全てを選択する" + sort_by: "並べ替え" + relevance: "一番関連しているもの" + latest_post: "最近の投稿" + most_viewed: "最も閲覧されている順" + most_liked: "「いいね!」されている順" + select_all: "すべて選択する" + clear_all: "すべてクリア" title: "トピック、投稿、ユーザ、カテゴリを探す" no_results: "何も見つかりませんでした。" - no_more_results: "何も見つかりませんでした。" + no_more_results: "検索結果は以上です。" search_help: 検索ヘルプ searching: "検索中..." post_format: "#{{post_number}} {{username}}から" context: user: "@{{username}}の投稿を検索" - category: "\"{{category}}\" カテゴリで検索する" topic: "このトピックを探す" private_messages: "メッセージ検索" hamburger_menu: "他のトピック一覧やカテゴリを見る" + new_item: "新着" go_back: '戻る' not_logged_in_user: 'ユーザアクティビティと設定ページ' current_user: 'ユーザページに移動' @@ -887,7 +922,7 @@ ja: unlist_topics: "トピックをリストから非表示にする" reset_read: "未読に設定" delete: "トピックを削除" - dismiss_new: "既読に設定" + dismiss_new: "既読にする" toggle: "選択したトピックを切り替え" actions: "操作" change_category: "カテゴリを変更" @@ -897,6 +932,7 @@ ja: choose_new_category: "このトピックの新しいカテゴリを選択してください" selected: other: "あなたは {{count}} トピックを選択しました。" + change_tags: "タグを変更" none: unread: "未読のトピックはありません。" new: "新しいトピックはありません。" @@ -910,13 +946,13 @@ ja: search: "検索結果はありません。" educate: new: '

新しいトピックがここに表示されます。

デフォルトで、新しいトピックがある場合は2日間、 new が表示されます。

設定はプロフィール設定から変更できます。

' - unread: '

新しいトピックがここに表示されます。

未読のトピックがある場合は、1と表示されます。 もし、

  • トピックを作る
  • トピックに返信
  • 4分以上のトピックを読む場合

などを設定した場合、トピックを追跡してそれぞれのトピックの下にある通知の設定を経由してウォッチします。

プロフィール から変更できます。

' + unread: '

新しいトピックがここに表示されます。

未読のトピックがある場合は、1が表示されます。 もし、

  • トピックを作る
  • トピックに返信
  • トピックを4分以上読む

などを行った場合、トピックを追跡してそれぞれのトピックの下にある通知の設定を経由してウォッチします。

プロフィールから変更できます。

' bottom: latest: "最新のトピックは以上です。" hot: "ホットなトピックは以上です。" posted: "投稿のあるトピックは以上です。" read: "既読のトピックは以上です。" - new: "新規トピックは以上です。" + new: "新着トピックは以上です。" unread: "未読のトピックは以上です。" category: "{{category}}トピックは以上です。" top: "トップトピックはこれ以上ありません。" @@ -929,11 +965,13 @@ ja: private_message: 'メッセージを書く' archive_message: title: 'アーカイブ' + move_to_inbox: + title: '受信ボックスへ移動' list: 'トピック' - new: '新規トピック' + new: '新着トピック' unread: '未読' new_topics: - other: '{{count}}個の新規トピック' + other: '{{count}}個の新着トピック' unread_topics: other: '{{count}}個の未読トピック' title: 'トピック' @@ -958,7 +996,7 @@ ja: back_to_list: "トピックリストに戻る" options: "トピックオプション" show_links: "このトピック内のリンクを表示" - toggle_information: "トピック詳細をトグル" + toggle_information: "トピックの詳細を切り替え" read_more_in_category: "{{catLink}}の他のトピックを見る or {{latestLink}}。" read_more: "{{catLink}} or {{latestLink}}。" read_more_MF: "{ UNREAD, plural, =0 {} one { 未読 1つ } other { 未読 #つ } } { NEW, plural, =0 {} one { {BOTH, select, true{} false {} other{}} 新規トピック 1つ} other { {BOTH, select, true{} false {} other{}} 新規トピック #つ} } remaining, or {CATEGORY, select, true {{catLink}の他のトピックを読む} false {{latestLink}} other {}}" @@ -1026,7 +1064,7 @@ ja: actions: recover: "トピックの削除を取り消す" delete: "トピックを削除" - open: "トピックを開く" + open: "トピックをオープン" close: "トピックをクローズする" multi_select: "投稿を選択" auto_close: "自動でクローズする..." @@ -1086,6 +1124,7 @@ ja: success: "ユーザにメッセージへの参加を招待しました。" error: "申し訳ありませんが、ユーザ招待中にエラーが発生しました。" group_name: "グループ名" + controls: "オプション" invite_reply: title: '招待' username_placeholder: "ユーザ名" @@ -1137,7 +1176,7 @@ ja: select_replies: '返信と選択' delete: 選択中のものを削除 cancel: 選択を外す - select_all: 全てを選択する + select_all: すべて選択する deselect_all: 全ての選択を外す description: other: {{count}}個の投稿を選択中。 @@ -1207,7 +1246,7 @@ ja: unwiki: "wiki投稿から外す" convert_to_moderator: "スタッフカラーを追加" revert_to_regular: "スタッフカラーを外す" - rebake: "HTMLを再構築" + rebake: "HTMLを再構成" unhide: "表示する" change_owner: "オーナーシップを変更" actions: @@ -1278,7 +1317,7 @@ ja: other: "{{count}}人のユーザがこのポストに投票しました" delete: confirm: - other: "本当にこれらの投稿を削除しますか?" + other: "これらの投稿を削除してもよろしいですか?" revisions: controls: first: "最初のリビジョン" @@ -1311,7 +1350,7 @@ ja: topic_template: "トピックテンプレート" delete: 'カテゴリを削除する' create: '新規カテゴリ' - create_long: '新しいカテゴリを作る' + create_long: '新しいカテゴリを作ります' save: 'カテゴリを保存する' slug: 'カテゴリスラグ' slug_placeholder: '(任意)URL用' @@ -1327,7 +1366,7 @@ ja: foreground_color: "文字表示色" name_placeholder: "簡潔な名前にしてください。" color_placeholder: "任意の Web カラー" - delete_confirm: "本当にこのカテゴリを削除してもよいですか?" + delete_confirm: "このカテゴリを削除してもよろしいですか?" delete_error: "カテゴリ削除に失敗しました。" list: "カテゴリをリストする" no_description: "このカテゴリの説明はありません。トピック定義を編集してください。" @@ -1475,7 +1514,7 @@ ja: lower_title_with_count: other: "{{count}}件" lower_title: "新着" - title: "新規" + title: "新着" title_with_count: other: "最新 ({{count}})" help: "最近投稿されたトピック" @@ -1494,25 +1533,25 @@ ja: title: "トップ" help: "過去年間、月間、週間及び日間のアクティブトピック" all: - title: "今まで" + title: "すべて" yearly: - title: "今年" + title: "年ごと" quarterly: title: "3ヶ月おき" monthly: - title: "今月" + title: "月ごと" weekly: title: "毎週" daily: - title: "毎日" - all_time: "今まで" + title: "日ごと" + all_time: "すべて" this_year: "年" this_quarter: "今季" this_month: "月" this_week: "週" - today: "本日" + today: "今日" other_periods: "次の期間のトピックを見る" - browser_update: 'ここで動作するにはブラウザのバージョンが古すぎます。ここでブラウザアップグレード.' + browser_update: 'ご利用のブラウザのバージョンが古いですブラウザをアップデートしてください。' permission_types: full: "作成 / 返信 / 閲覧" create_post: "返信 / 閲覧" @@ -1661,7 +1700,7 @@ ja: regenerate: "API キーを再生成" revoke: "無効化" confirm_regen: "このAPIキーを新しいものに置き換えてもよろしいですか?" - confirm_revoke: "このキーを無効化しても本当によろしいですか?" + confirm_revoke: "このキーを無効化してもよろしいですか?" info_html: "API キーを使うと、JSON 呼び出しでトピックの作成・更新を行うことが出来ます。" all_users: "全てのユーザ" note_html: "このキーは、秘密にしてください。このキーを持っている全てのユーザは任意のユーザとして、好きな投稿を作成できます" @@ -1708,10 +1747,10 @@ ja: cancel: label: "キャンセル" title: "バックアップ作業をキャンセルする" - confirm: "本当に実行中バックアップ作業をキャンセルしますか?" + confirm: "実行中のバックアップをキャンセルしてもよろしいですか?" backup: label: "バックアップ" - title: "バックアップを作成" + title: "バックアップを行います" confirm: "新しくバックアップを行ってもよろしいですか?" without_uploads: "はい(ファイルは含まない)" download: @@ -1727,10 +1766,10 @@ ja: confirm: "バックアップを復元してもよろしいですか?" rollback: label: "ロールバック" - title: "データベースを元の作業状態にロールバックする" + title: "データベースを前回の状態に戻します" export_csv: user_archive_confirm: "投稿をダウンロードしてもよろしいですか?" - success: "エスクポートを開始しました。処理が完了すると、メッセージで通知されます。" + success: "エクスポートを開始しました。処理が完了した後、メッセージでお知らせします。" failed: "出力失敗。詳しくはログに参考してください。" rate_limit_error: "投稿は1日に1度だけダウンロードできます。また明日お試しください。" button_text: "エクスポート" @@ -1768,7 +1807,7 @@ ja: explain_rescue_preview: "既定スタイルシートでサイトを表示する" save: "保存" new: "新規" - new_style: "新規スタイル" + new_style: "新しいスタイル" import: "インポート" import_title: "ファイルを選択するかテキストをペースト" delete: "削除" @@ -1826,7 +1865,7 @@ ja: email: title: "メール" settings: "設定" - preview_digest: "ダイジェストのプレビュー" + preview_digest: "まとめのプレビュー" sending_test: "テストメールを送信中..." error: "ERROR - %{server_error}" test_error: "テストメールを送れませんでした。メール設定、またはホストをメールコネクションをブロックされていないようを確認してください。" @@ -1859,7 +1898,7 @@ ja: title: "フィルター" user_placeholder: "ユーザ名" address_placeholder: "name@example.com" - type_placeholder: "ダイジェスト、サインアップ..." + type_placeholder: "まとめ、サインアップ..." reply_key_placeholder: "返信キー" skipped_reason_placeholder: "理由" logs: @@ -1881,7 +1920,7 @@ ja: staff_actions: title: "スタッフ操作" instructions: "ユーザ名、アクションをクリックすると、リストはフィルタされます。プロフィール画像をクリックするとユーザページに遷移します" - clear_filters: "全てを表示する" + clear_filters: "すべて表示する" staff_user: "スタッフユーザ" target_user: "対象ユーザ" subject: "対象" @@ -1934,7 +1973,7 @@ ja: screened_ips: title: "スクリーン対象IP" description: '参加中のIPアドレス。IPアドレスをホワイトリストに追加するには "許可" を利用してください。' - delete_confirm: "%{ip_address} のルールを本当に削除しますか?" + delete_confirm: "%{ip_address} のルールを削除してもよろしいですか?" roll_up_confirm: "Are you sure you want to roll up commonly screened IP addresses into subnets?" rolled_up_some_subnets: "Successfully rolled up IP ban entries to these subnets: %{subnets}." rolled_up_no_subnet: "There was nothing to roll up." @@ -1982,7 +2021,7 @@ ja: active: 'アクティブユーザ' new: '新規ユーザ' pending: '保留中のユーザ' - newuser: 'トラストレベル0のユーザ (新規ユーザ)' + newuser: 'トラストレベル0のユーザ (新しいユーザ)' basic: 'トラストレベル1のユーザ (ベーシックユーザ)' staff: "スタッフ" admins: '管理者ユーザ' @@ -2011,17 +2050,18 @@ ja: suspend: "凍結" unsuspend: "凍結解除" suspended: "凍結状態" - moderator: "モデレータ?" - admin: "管理者?" - blocked: "ブロック中?" + moderator: "モデレータ権限の所有" + admin: "管理者権限の所有" + blocked: "ブロック状態" + staged: "ステージドモードの状態" show_admin_profile: "アカウントの管理" edit_title: "タイトルを編集" save_title: "タイトルを保存" refresh_browsers: "ブラウザを強制リフレッシュ" refresh_browsers_message: "全てのクライアントにメッセージが送信されました!" - show_public_profile: "公開されるプロフィールを見る" + show_public_profile: "公開プロフィールを見る" impersonate: 'このユーザになりすます' - ip_lookup: "IP検索" + ip_lookup: "IPアドレスを検索" log_out: "ログアウト" logged_out: "すべてのデバイスでログアウトしました" revoke_admin: '管理者権限を剥奪' @@ -2061,7 +2101,7 @@ ja: other: "全ての投稿を削除できませんでした。%{count}日以上経過した投稿があります。(設定: delete_user_max_post_age)" cant_delete_all_too_many_posts: other: "全ての投稿を削除できませんでした。ユーザは%{count} 件以上投稿しています。(delete_all_posts_max)" - delete_confirm: "本当にこのユーザを削除しますか?" + delete_confirm: "このユーザを削除してもよろしいですか?" delete_and_block: " 削除する。このメールとIPアドレスからのサインアップを以後ブロック" delete_dont_block: "削除する" deleted: "ユーザが削除されました。" @@ -2079,6 +2119,7 @@ ja: deactivate_explanation: "アクティベート解除されたユーザは、メールで再アクティベートする必要があります。" suspended_explanation: "凍結中のユーザはログインできません。" block_explanation: "ブロックされているユーザは投稿およびトピックの作成ができません。" + staged_explanation: "ステージドユーザは特定のトピック宛に、メールを経由して投稿する事が出来ます。" trust_level_change_failed: "ユーザのトラストレベル変更に失敗しました。" suspend_modal_title: "凍結中のユーザ" trust_level_2_users: "トラストレベル2のユーザ" @@ -2187,20 +2228,21 @@ ja: title: バッジ new_badge: 新しいバッジ new: 新規 - name: バッジ名 + name: バッジの名前 badge: バッジ display_name: バッジの表示名 description: バッジの説明 + long_description: 詳しい説明 badge_type: バッジの種類 badge_grouping: グループ badge_groupings: - modal_title: バッジの振り分け + modal_title: バッジのグループ granted_by: 'バッジをつけた人: ' granted_at: 'バッジをつけた日: ' reason_help: (投稿かトピックへのリンク) save: バッジを保存する - delete: バッジを削除する - delete_confirm: 本当にこのバッジを削除しますか? + delete: 削除 + delete_confirm: このバッジを削除してもよろしいですか? revoke: 取り消す reason: 理由 expand: '&hellipを展開' @@ -2212,17 +2254,17 @@ ja: no_user_badges: "%{name} はバッジを付けられていません。" no_badges: 付けられるバッジがありません none_selected: "バッジを選択して開始" - allow_title: バッジは、タイトルとして使用されることを許可する - multiple_grant: 複数回付与することができます - listable: パブリックパッジページに表示するバッジ - enabled: バッジシステムを使う + allow_title: バッジをタイトルとして使用されることを許可する + multiple_grant: 何度もゲットできるようにする + listable: 公開されるバッジページにバッジを表示する + enabled: バッジを有効にする icon: アイコン image: 画像 icon_help: "Font Awesomeのクラスか画像のURLを使用してください" query: バッジクエリ(SQL) target_posts: 投稿を対象 - auto_revoke: 毎日失効クエリを実行 - show_posts: バッジページの付与したバッジで投稿を表示 + auto_revoke: 毎日クエリの取り消しを実行 + show_posts: バッジページでバッジを取得したことを投稿する trigger: トリガー trigger_type: none: "毎日更新する" @@ -2279,16 +2321,18 @@ ja: search_help: title: 'Search Help' keyboard_shortcuts_help: - title: 'キーボードショートカット' + title: 'ショートカットキー' jump_to: title: 'ページ移動' home: 'g, h ホーム' latest: 'g, l 最新' - new: 'g, n 新規' + new: 'g, n 新着' unread: 'g, u 未読' categories: 'g, c カテゴリ' top: 'g, t トップ' bookmarks: 'g, b ブックマーク' + profile: 'g, p プロフィール' + messages: 'g, m メッセージ' navigation: title: 'ナビゲーション' jump: '# # 投稿へ' @@ -2300,6 +2344,7 @@ ja: title: 'アプリケーション' create: 'c 新しいトピックを作成' notifications: 'n お知らせを開く' + hamburger_menu: '= メニューを開く' user_profile_menu: 'p ユーザメニュを開く' show_incoming_updated_topics: '. 更新されたトピックを表示する' search: '/ 検索' @@ -2308,7 +2353,7 @@ ja: dismiss_topics: 'Dismiss Topics' actions: title: '操作' - bookmark_topic: 'f トピックのブックマークをトグル' + bookmark_topic: 'f トピックのブックマークを切り替え' pin_unpin_topic: 'shift+pトピックを ピン留め/ピン留め解除' share_topic: 'shift+s トピックをシェア' share_post: 's 投稿をシェアする' @@ -2326,7 +2371,10 @@ ja: mark_tracking: 'm, t トピックを追跡する' mark_watching: 'm, w トピックを参加中にする' badges: + granted_on: "%{date} にゲット" title: バッジ + allow_title: "タイトルとしての使用" + multiple_grant: "何度も取得可能" badge_count: other: "%{count} バッジ" more_badges: @@ -2337,7 +2385,7 @@ ja: none: "" badge_grouping: getting_started: - name: Getting Started + name: はじめの一歩 community: name: コミュニティ trust_level: @@ -2345,4 +2393,12 @@ ja: other: name: その他 posting: - name: 投稿中 + name: 投稿 + tagging: + changed: "タグを変更しました:" + sort_by: "並べ替え:" + topics: + none: + search: "検索結果は何もありません。" + bottom: + search: "検索結果は以上です。" diff --git a/config/locales/client.pt.yml b/config/locales/client.pt.yml index 03cacd03f..dde943291 100644 --- a/config/locales/client.pt.yml +++ b/config/locales/client.pt.yml @@ -111,6 +111,8 @@ pt: google+: 'partilhar esta hiperligação no Google+' email: 'enviar esta hiperligação por email' action_codes: + public_topic: "tornei este tópico publico %{when}" + private_topic: "tornei este tópico privado %{when}" split_topic: "dividir este tópico %{when}" invited_user: "Convidou %{who} %{when}" removed_user: "Removeu %{who} %{when}" @@ -2115,6 +2117,7 @@ pt: test_error: "Occorreu um problema no envio do email de teste. Por favor verifique novamente as suas definições de email, verifique se o seu host não está a bloquear conexões de email, e tente novamente." sent: "Enviado" skipped: "Ignorado" + bounced: "Devolvida" received: "Recebido" rejected: "Rejeitado" sent_at: "Enviado em" @@ -2765,3 +2768,10 @@ pt: bottom: latest: "Não há mais tópicos recentes." hot: "Não há mais tópicos quentes." + posted: "Não existem mais tópicos publicados." + read: "Não existem mais tópicos lidos." + new: "Não existem mais tópicos novos." + unread: "Não existem mais tópicos por ler." + top: "Não existem mais tópicos de topo." + bookmarks: "Não existem mais tópicos marcados." + search: "Não existem mais resultados de pesquisa." diff --git a/config/locales/client.ro.yml b/config/locales/client.ro.yml index 61f124d3c..7d4a573ea 100644 --- a/config/locales/client.ro.yml +++ b/config/locales/client.ro.yml @@ -554,7 +554,7 @@ ro: username: title: "Nume Utilizator" instructions: "Numele de utilizator trebuie sa fie unic, fără spații, scurt." - short_instructions: "Ceilalți te pot numii @{{username}}." + short_instructions: "Ceilalți te pot menționa ca @{{username}}." available: "Numele de utilizator este valabil." global_match: "Emailul se potrivește numelui de utilizator înregistrat." global_mismatch: "Deja înregistrat. Încearcă:{{suggestion}}?" @@ -1501,10 +1501,11 @@ ro: muted: title: "Silențios" flagging: - title: 'De ce marcați această postare ca fiind privată?' + title: 'Mulțumim că ne ajuți să păstrăm o comunitate civilizată!' action: 'Marcare' take_action: "Actionează" notify_action: 'Mesaj' + official_warning: 'Avertismen Oficial' delete_spammer: "Șterge spammer" delete_confirm: "Sunteți pe punctul de a șterge postarea %{posts} și postările %{topics} ale acestui uitilizator, de a-i anula contul, de a-i bloca autentificarea de la adresa IP %{ip_address}, adresa de email %{email} și de a bloca listarea permanent. Sunteți sigur ca acest utilizator este un spammer?" yes_delete_spammer: "Da, Șterge spammer" @@ -1513,6 +1514,7 @@ ro: submit_tooltip: "Acceptă marcarea privată" take_action_tooltip: "Accesati permisiunea marcarii imediat, nu mai asteptati alte marcaje comune" cant: "Ne pare rău nu puteți marca această postare deocamdată." + notify_staff: 'Notifică un moderator în privat' formatted_name: off_topic: "În afară discuției" inappropriate: "Inadecvat" diff --git a/config/locales/client.sq.yml b/config/locales/client.sq.yml index 293571f46..c8aed6f50 100644 --- a/config/locales/client.sq.yml +++ b/config/locales/client.sq.yml @@ -124,7 +124,7 @@ sq: disabled: 'hapur %{when}' archived: enabled: 'arkivoi %{when}' - disabled: 'çarkivuar %{when}' + disabled: 'paarkivuar %{when}' pinned: enabled: 'mbërthyer %{when}' disabled: 'zbërthyer %{when}' diff --git a/config/locales/client.zh_CN.yml b/config/locales/client.zh_CN.yml index 268a19e19..8847a7f49 100644 --- a/config/locales/client.zh_CN.yml +++ b/config/locales/client.zh_CN.yml @@ -2602,8 +2602,8 @@ zh_CN:

tagging: - all_tags: "所以标签" - selector_all_tags: "所以标签" + all_tags: "所有标签" + selector_all_tags: "所有标签" changed: "标签被修改" tags: "标签" choose_for_topic: "为主题选择可选标签" diff --git a/config/locales/server.ar.yml b/config/locales/server.ar.yml index 8042ec355..6a86bd1bd 100644 --- a/config/locales/server.ar.yml +++ b/config/locales/server.ar.yml @@ -898,7 +898,7 @@ ar: post_excerpt_maxlength: "الحد الأقصى لطول وظيفة مقتطف / ملخص." post_onebox_maxlength: "الحد الأقصى لطول مشاركة oneboxed Discourse بالأحرف." onebox_domains_whitelist: "قائمة بالمجالات للسماح روابط تفصيلي؛ وينبغي دعم هذه المجالات OpenGraph أو oEmbed. اختبار لهم في http://iframely.com/debug" - logo_url: "صورة الشعار في الجزء العلوي الأيسر من موقع الويب الخاص بك، يجب أن تكون على شكل مستطيل واسع. إذا كان سيتم إظهار غادر نص عنوان موقع على بياض." + logo_url: "صورة الشعار في الجزء العلوي الأيسر من موقع الويب الخاص بك، يجب أن تكون على شكل مستطيل واسع. إذا ترك الحقل فارغا فسيتم استخدام اسم الموقع." logo_small_url: "صورة الشعار صغيرة في الجزء العلوي الأيسر من موقع الويب الخاص بك، يجب أن تكون على شكل مربع، وينظر عند التمرير لأسفل. وإذا ترك فارغا أن أظهرت الصورة الرمزية المنزل." favicon_url: "الأيقونة الخاصة بموقعك, شاهد http://en.wikipedia.org/wiki/Favicon, لتعمل بشكل صحيح ضمن CDN يجب ان تكون بصيغة png." mobile_logo_url: "صورة الشعار الثابتة ستظهر في الجزء العلوي الأيسر في نسخة الجوال من موقعك. يجب أن تكون مربعة. إذا تُركت فارغة، سيتم استخدام الـ `logo_url`. على سبيل المثال: http://example.com/uploads/default/logo.png" diff --git a/config/locales/server.es.yml b/config/locales/server.es.yml index aecd86c1a..4d93a22e2 100644 --- a/config/locales/server.es.yml +++ b/config/locales/server.es.yml @@ -31,6 +31,7 @@ es: incoming: default_subject: "Email entrante desde %{email}" show_trimmed_content: "Mostrar contenido recortado" + maximum_staged_user_per_email_reached: "Alcanzado el número máximo de usuarios provisionales creados por email." errors: empty_email_error: "Sucede cuando el texto en bruto del email que recibimos está en blanco." no_message_id_error: "Sucede cuando el email no tiene Id del mensaje en el encabezado." @@ -44,7 +45,7 @@ es: reply_user_not_matching_error: "Sucede cuando una respuesta vino de una dirección de email diferente a la que fue enviada la notificación." topic_not_found_error: "Sucede cuando entró una respuesta pero el tema relacionado ha sido eliminado." topic_closed_error: "Sucede cuando entró una respuesta pero el tema relacionado ha sido cerrado. " - bounced_email_report: "El email es un reporte que ha rebotado." + bounced_email_error: "El email es un reporte de correo rebotado." auto_generated_email_reply: "El email contiene una respuesta a un correo autogenerado." screened_email_error: "Sucede cuando la dirección de email del remitente ya ha sido filtrada." errors: &errors @@ -1120,6 +1121,8 @@ es: default_categories_tracking: "Lista de categorías que están seguidas por defecto" default_categories_muted: "Lista de categorías que están silenciadas por defecto." tagging_enabled: "¿Activar etiquetas para los temas?" + min_trust_to_create_tag: "El mínimo nivel de confianza requerido para crear una etiqueta." + max_tags_per_topic: "El máximo número de etiquetas que se pueden añadir a un tema." errors: invalid_email: "Dirección de correo electrónico inválida. " invalid_username: "No existe ningún usuario con ese nombre de usuario. " diff --git a/config/locales/server.fi.yml b/config/locales/server.fi.yml index 71f1642a1..a661f6aa4 100644 --- a/config/locales/server.fi.yml +++ b/config/locales/server.fi.yml @@ -24,7 +24,7 @@ fi: loading: "Lataa" powered_by_html: 'Voimanlähteenä Discourse, toimii parhaiten, kun JavaScript on käytössä' log_in: "Kirjaudu" - purge_reason: "Poistettu automaattisesti hylättynä, aktivoimattomana tilinä" + purge_reason: "Hylätty, aktivoimaton tili poistettiin automaattisesti" disable_remote_images_download_reason: "Linkattujen kuvien lataaminen poistettiin käytöstä vähäisen tallennustilan vuoksi." anonymous: "Anonyymejä" emails: @@ -172,7 +172,8 @@ fi: private_posts: "Uusimmat yksityisviestit" group_posts: "Uusimmat viestit ryhmässä %{group_name}" group_mentions: "Uusimmat maininnat ryhmässä %{group_name}" - tag: "Tagatut aiheet" + user_posts: "Viimeisimmät viestit käyttäjältä @%{username}" + user_topics: "Viimeisimmät ketjut käyttäjältä @%{username}" too_late_to_edit: "Tämä viesti luotiin liian kauan sitten. Sitä ei voi enää muokata tai poistaa." revert_version_same: "Nykyinen revisio on sama, kuin jonka yrität palauttaa." excerpt_image: "kuva" diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index 0180f6103..ddf4c041b 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -31,6 +31,7 @@ fr: incoming: default_subject: "Courriel arrivant de %{email}" show_trimmed_content: "Montrer le contenu raccourci" + maximum_staged_user_per_email_reached: "Vous avez atteint le nombre maximal d'utilisateurs qui peuvent être créés par mail." errors: empty_email_error: "Arrive quand le courriel reçu était vide." no_message_id_error: "Arrive quand le courrier n'a pas d'en-tête \"Message-Id\"." @@ -44,7 +45,7 @@ fr: reply_user_not_matching_error: "Arrive quand une réponse est venue d'une adresse de courriel différente de celle où a été envoyée la notification." topic_not_found_error: "Arrive quand quelqu'un répond à un sujet qui a été supprimé." topic_closed_error: "Arrive quand quelqu'un répond mais le sujet lié a été fermé." - bounced_email_report: "Le courriel est un rapport de courriel rejeté." + bounced_email_error: "Le courriel est un rapport de courriel rejeté." auto_generated_email_reply: "Email contient une réponse à un email automatiquement généré." screened_email_error: "Arrive quand l'adresse courriel de l'expéditeur est déjà sous surveillance." errors: &errors @@ -713,6 +714,9 @@ fr: site_contact_username_warning: "Saisissez le pseudo d'un responsable sympathique à partir duquel sera envoyé les messages importants. Mettez à jour site_contact_username dans les Paramètres du site." notification_email_warning: "Les courriels de notification ne serot pas envoyés depuis une adresse de courriel valide sur votre domaine ; l'envoie des courriels sera aléatoire et peu fiable. Veuillez saisir une adresse de courriel locale dans notification_email dans les Paramètres du site." subfolder_ends_in_slash: "Votre configuration de sous-répertoire est erronée; DISCOURSE_RELATIVE_URL_ROOT se termine avec une barre oblique ." + email_polling_errored_recently: + one: "La vérification des mails a généré une erreur au cours des 24 dernières heures. Vérifiez le journal pour plus de détails." + other: "La vérification des mails a généré %{count} erreurs au cours des 24 dernières heures. Vérifiez le journal pour plus de détails." bad_favicon_url: "Impossible de charger la favicon. Vérifiez le paramètre favicon_url dans les paramètres du site" site_settings: censored_words: "Mots qui seront automatiquement remplacés par ■■■■" @@ -1105,10 +1109,8 @@ fr: default_categories_watching: "Liste de catégories surveillées par défaut." default_categories_tracking: "Liste de catégories suivies par défaut." default_categories_muted: "Liste de catégories silencées par défaut." - tagging_enabled: "Autoriser les utilisateurs à mettre des tags sur les sujets ?" - min_trust_to_create_tag: "Le niveau de confiance requis pour créer un tag." - max_tags_per_topic: "Le nombre maximum de tags qui peuvent être ajouté à un sujet." - max_tag_length: "The nombre maximum de caractères qui peuvent être utilisés pour un tag." + tagging_enabled: "Activer les tags sur les sujets ?" + tag_style: "Style visuel pour tag badges." errors: invalid_email: "Adresse de courriel invalide." invalid_username: "Il n'y a pas d'utilisateur ayant ce pseudo." @@ -1929,6 +1931,7 @@ fr: avatar: missing: "Désolé, nous ne parvenons pas à trouver un avatar associé à cette adresse mail. Pouvez-vous essayer de la télécharger à nouveau ?" email_log: + post_user_deleted: "L'auteur du message a été supprimé." no_user: "Impossible de trouver l'utilisateur avec l'id %{user_id}" anonymous_user: "L'utilisateur est anonyme" suspended_not_pm: "L'utilisateur est suspendu, pas de message" @@ -2211,25 +2214,23 @@ fr: Ce badge est accordé lorsque vous utilisez tous les 50 de vos j'aime quotidiens. Rappelez-vous de prendre un moment pour aimer les messages qui vous plaisent et d'apprécier encourager vos membres de la communauté pour créer encore plus de grandes discussions à l'avenir. higher_love: name: Amour plus fort + description: A utilisé 50 likes en un jour 5 fois long_description: | Ce badge est accordé lorsque vous utilisez tous les 50 j'aime par jour pendant 5 jours. Merci de prendre le temps activement d'encourager les meilleures conversations chaque jour! crazy_in_love: name: Fou amoureux + description: A utilisé 50 likes en un jour 20 fois long_description: | Ce badge est accordé lorsque vous utilisez tous les 50 de vos j'aime par jour pendant 20 jours. Hou la la! Vous êtes un modèle de régulièrement encourager vos membres de la communauté! thank_you: name: 'Merci ' description: A 20 messages ayant reçu un j'aime et a donné 10 j'aime - long_description: "Ce badge vous est accordé quand vous avez reçu 20 j'aime sur vos messages et en avez donné 10 ou plus en retour. Quand quelqu'un aime vos messages, vous trouvez le temps d'aimer ce que les autres postent à leur tour. \n" gives_back: name: Redonne description: A 100 messages ayant reçu un j'aime et a donné 100 j'aime - long_description: | - Ce badge vous est accordé quand vous avez reçu 100 j'aime et en avez donné 100 ou plus en retour. Merci pour tout cela. empathetic: name: Empathique description: A 500 messages ayant reçu un j'aime et a donné 1000 j'aime - long_description: "Ce badge vous est accordé quand vous avez reçu 500 j'aime et en avez donné 1000 ou plus en retour. Whaou ! Vous êtes un modèle de générosité et d'amour mutuel :two_hearts:. \n" first_emoji: name: Premier Emoji description: A utilisé un emoji dans un message @@ -2253,9 +2254,10 @@ fr: initial_topic_title: Rapports de performances du site topic_invite: user_exists: "Désolé, cet utilisateur a déjà été invité. Vous ne pouvez inviter un utilisateur qu'une seule fois par sujet." + tags: + title: "Tags" time: <<: *datetime_formats activemodel: errors: <<: *errors - rss_by_tag: "Sujets portant le tag %{tag}" diff --git a/config/locales/server.it.yml b/config/locales/server.it.yml index a16c287bd..c1f7e369b 100644 --- a/config/locales/server.it.yml +++ b/config/locales/server.it.yml @@ -159,8 +159,16 @@ it: rss_description: latest: "Argomenti più recenti" hot: "Argomenti caldi" + top: "Argomenti di punta" posts: "Ultimi messaggi" + private_posts: "Ultimi messaggi privati" + group_posts: "Ultimi messaggi da %{group_name}" + group_mentions: "Ultime menzioni da %{group_name}" + user_posts: "Ultimi messaggi di @%{username}" + user_topics: "Ultimi argomenti di @%{username}" + tag: "Argomenti etichettati" too_late_to_edit: "Questo messaggio è stato creato troppo tempo fa. Non può più essere modificato né cancellato." + revert_version_same: "La versione attuale è la stessa versione che stai cercando di ripristinare." excerpt_image: "immagine" queue: delete_reason: "Cancellato attraverso la coda di moderazione" @@ -169,6 +177,7 @@ it: can_not_modify_automatic: "Non puoi modificare un gruppo automatico" member_already_exist: "'%{username}' è già membro di questo gruppo." invalid_domain: "'%{domain}' non è un dominio valido." + invalid_incoming_email: "'%{email}' non è un indirizzo email valido." default_names: everyone: "chiunque" admins: "amministratori" @@ -728,7 +737,7 @@ it: share_links: "Determina quali elementi appaiono nella finestra di condivisione e in quale ordine." track_external_right_clicks: "Segui i collegamenti esterni sui quali viene fatto click destro (es: apri in una nuova tab). Disabilitato di default perché riscrive le URL" site_contact_username: "Un utente dello staff valido da cui inviare tutti i messaggi automatici. Se lasciato vuoto verrà usato l'account System di default." - send_welcome_message: "nvia a tutti i nuovi utenti un messaggio di benvenuto con una guida di avvio rapido." + send_welcome_message: "Invia a tutti i nuovi utenti un messaggio di benvenuto con una guida di avvio rapido." suppress_reply_directly_below: "Non mostrare il conteggio espandibile delle risposte quando c'è una sola risposta sotto quel messaggio." suppress_reply_directly_above: "Non mostrare in-risposta-a espandibile in un messaggio quando c'è una sola risposta sopra quel messaggio. " suppress_reply_when_quoting: "Non mostrare in-risposta-a espandibile in un messaggio quando il messaggio include la citazione." @@ -1273,6 +1282,10 @@ it: privacy_topic: title: "Politica della Privacy" badges: + welcome: + description: Hai ricevuto un Mi piace + great_topic: + description: Hai ricevuto 50 Mi piace su 1 argomento first_like: name: Primo "Mi piace" description: Ha messo "Mi piace" a un messaggio @@ -1286,11 +1299,21 @@ it: name: Primo Collegamento first_quote: description: Ha citato un messaggio + appreciated: + description: Hai ricevuto 1 Mi piace su 20 messaggi + respected: + description: Hai ricevuto 2 Mi piace su 100 messaggi + admired: + description: Hai ricevuto 5 Mi piace su 300 messaggi admin_login: success: "email Inviata" error: "Errore!" email_input: "Email Amministratore" submit_button: "Invia Email" + tags: + title: "Etichette" + staff_tag_remove_disallowed: "L'etichetta \"%{tag}\" può essere cancellata soltanto dallo staff." + rss_by_tag: "Argomenti etichettati %{tag}" time: <<: *datetime_formats activemodel: diff --git a/config/locales/server.ja.yml b/config/locales/server.ja.yml index 0bd2d5b1c..748537b6a 100644 --- a/config/locales/server.ja.yml +++ b/config/locales/server.ja.yml @@ -9,7 +9,7 @@ ja: dates: short_date_no_year: "MMM D" short_date: "YYYY MMM D" - long_date: "MMMM D, YYYY h:mma" + long_date: "YYYY MMMM D h:mma" date: month_names: [null, 1月, 2月, 3月, 4月, 5月, 6月, 7月, 8月, 9月, 10月, 11月, 12月] title: "Discourse" @@ -23,20 +23,21 @@ ja: emails: incoming: default_subject: "%{email}からメール" + show_trimmed_content: "続きを読む" errors: &errors format: '%{attribute} %{message}' messages: too_long_validation: "は、最大文字数(%{max}文字)を超えています。(入力したのは%{length}文字 ) " - invalid_boolean: "無効なboolean." + invalid_boolean: "無効な選択肢" taken: "は既に使用されています" accepted: に同意する必要があります blank: を入力してください present: は入力しないでください confirmation: "と%{attribute}の入力が一致しません" - empty: 本文が未入力です。. + empty: 本文が入力されていません equal_to: は%{count}にしてください even: は偶数にしてください - exclusion: は予約されています + exclusion: はすでに使われています greater_than: は%{count}より大きい値にしてください greater_than_or_equal_to: は%{count}以上の値にしてください has_already_been_used: "は既に使用されています" @@ -74,7 +75,7 @@ ja: not_logged_in: "ログインしてください。" not_found: "リクエストされたURL、リソースは見つかりませんでした" invalid_access: "リクエストしたリソースの閲覧が許可されていません" - read_only_mode_enabled: "このサイトは読み取り専用モードです。会話は無効になっています。" + read_only_mode_enabled: "このサイトは閲覧専用状態です。変更などの操作は無効になっています。" too_many_replies: other: "申し訳ありません、新しいユーザーの同じトピックへの返信は、一時的に %{count} 回に制限されています。" embed: @@ -82,12 +83,14 @@ ja: continue: "議論を続ける" more_replies: other: "%{count} 以上の返信" - loading: "会話をロードしています…" + loading: "会話を読み込んでいます…" permalink: "パーマリンク" imported_from: "これは、オリジナルエントリ%{link}に対するディスカッショントピックです" in_reply_to: "▶ %{username}" replies: other: "%{count} 通の返信" + no_mentions_allowed: "あなたは他のユーザへメンションを送ることができません。" + no_images_allowed: "新規ユーザは投稿に画像を付ける事はできません。" spamming_host: "申し訳ありませんが、このホストへのリンクを貼ることはできません。" user_is_suspended: "アカウントが凍結中のユーザーは投稿ができません。" topic_not_found: "問題が発生しました。トピックがクローズしたか、閲覧中に削除された可能性があります。" @@ -108,9 +111,10 @@ ja: read_full_topic: "完全なトピックを読む" private_message_abbrev: "メッセージ" rss_description: - latest: "最新トピック" + latest: "最新のトピック" hot: "ホットトピック" posts: "最近の投稿" + private_posts: "最新のプライベートメッセージ" too_late_to_edit: "この投稿の編集・削除期間が過ぎました。編集・削除が出来ません。" excerpt_image: "画像" queue: @@ -161,11 +165,12 @@ ja: 回答を追加する代わりに、以前の回答を編集するか、別のトピックを訪れる事を検討してください。 reviving_old_topic: | - ### このトピックを復活させますか? + ### このトピックを復活させてもよろしいですか? - このトピックの最後の回答は%{days}日前です。あなたの回答はトピックを一覧のトップに上げて、以前回答した誰がか気付きます。 + このトピックへの最後の返信は%{days}日前です。 + あなたの返信はトピック一覧の一番上に移動させ、以前に返信した人宛に通知が送られます。 - 本当に過去の議論を続けますか? + 本当に過去の会話を復元してもよろしいですか? activerecord: attributes: category: @@ -209,7 +214,7 @@ ja: lounge_welcome: title: "ラウンジへようこそ" category: - topic_prefix: "%{category} カテゴリの定義" + topic_prefix: "%{category}カテゴリについて" errors: uncategorized_parent: "未分類カテゴリは親カテゴリに設定出来ません。" self_parent: "自分自身がサブカテゴリの親になることはできません" @@ -222,7 +227,7 @@ ja: topic_exists_no_oldest: "%{count}個のトピックを持っているため、このカテゴリを削除できません。" trust_levels: newuser: - title: "新規ユーザ" + title: "新しいユーザ" basic: title: "ベーシックユーザ" change_failed_explanation: "%{user_name} を '%{new_trust_level}' に格下げしようとしましたが、既にトラストレベルが '%{current_trust_level}' です。%{user_name} は '%{current_trust_level}' のままになります - もしユーザーを降格させたい場合は、トラストレベルをロックしてください" @@ -236,15 +241,15 @@ ja: other: "%{count} 秒" datetime: distance_in_words: - half_a_minute: "< 1分" + half_a_minute: "1分前" less_than_x_seconds: other: "< %{count} 秒" x_seconds: other: "%{count} 秒" less_than_x_minutes: - other: "< %{count} 分" + other: "%{count}分前" x_minutes: - other: "%{count} 分" + other: "%{count}分" about_x_hours: other: "%{count} 時間" x_days: @@ -266,9 +271,9 @@ ja: x_seconds: other: "%{count} 秒前" less_than_x_minutes: - other: "%{count} 分未満" + other: "%{count}分未満" x_minutes: - other: "%{count} 分前" + other: "%{count}分前" about_x_hours: other: "%{count} 時間前" x_days: @@ -534,7 +539,7 @@ ja: title_nag: "サイトの名前が正しくありません。サイトの設定で更新してください" site_description_missing: "検索結果に表示される説明文を入力してください。サイトの設定で更新してください" consumer_email_warning: "サイトはメール送信に Gmail (または他のカスタムメールサービス) を利用するように設定されています。Gmail で送信可能なメール数には制限があります。メールを確実に送信するために mandrill.com などのメールサービスプロバイダーの利用を検討してください。" - site_contact_username_warning: "重要な自動メッセージを送信するフレンドリースタッフユーザーアカウントの名前を入力してください。サイト設定 のsite_contact_username を更新してください。" + site_contact_username_warning: "重要なメッセージを送るために、スタッフユーザの名前を入力してください。サイト設定 のsite_contact_username を更新してください。" notification_email_warning: "通知用メールがあなたのドメインで有効なメールアドレスから送信されていません。メール配信が不安定になり、信頼性が低くなります。\nサイトの設定で更新してください" site_settings: censored_words: "自動的に ■■■■ で置換されます" @@ -583,12 +588,12 @@ ja: notification_email: "The from: email address used when sending all essential system emails. The domain specified here must have SPF, DKIM and reverse PTR records set correctly for email to arrive." email_custom_headers: "カスタムメールヘッダのリスト (パイプ(バーティカルバー) 区切り)" email_subject: "標準のメールタイトルをカスタマイズできます。https://meta.discourse.org/t/customize-subject-format-for-standard-emails/20801 を参照してください" - use_https: "サイトのURL(Discourse.base_url)をhttpかhttpsにしますか? \"既に設定が完了し、動作していない限り、HTTPSは選択しないでください!\"" summary_score_threshold: "'トピックサマリー'に投稿が含まれるために必要な最低スコア" summary_posts_required: "'トピックサマリー'が有効になるために必要な最小投稿数" summary_likes_required: "'トピックサマリー'が有効になるために必要な最小「いいね!」数" summary_percent_filter: "ユーザが'トピックサマリー'をクリックしたとき, 上位何パーセントのポストを表示するか" summary_max_results: "'トピックサマリー'として返却される最大ポスト数" + enable_private_messages: "トラストレベル1のユーザにメッセージの作成と返信を許可する(最小のトラストレベルを介して設定可能なメッセージを送信します)" enable_long_polling: "通知用のメッセージバスによるロングポーリングの利用を許可する" long_polling_base_url: "ロングポーリングのベースURL(CDNが動的コンテンツを配信している場合、これをoriginに指定してください) eg: http://origin.site.com" long_polling_interval: "ユーザに送信するデータが存在しないとき、サーバが待機する時間(ログインユーザーのみ)" @@ -601,7 +606,7 @@ ja: tl2_additional_likes_per_day_multiplier: "この数字を掛けると TL2 (メンバー) の1日あたりの「いいね!」の上限を増やします" tl3_additional_likes_per_day_multiplier: "この数字を掛けると TL3 (レギュラー) の1日あたりの「いいね!」の上限を増やします" tl4_additional_likes_per_day_multiplier: "この数字を掛けると TL4 (リーダー) の1日あたりの「いいね!」の上限を増やします" - num_flags_to_block_new_user: "新規ユーザの投稿に対して、何人のユーザによりここで指定した数のスパムフラグが立てられたら、全てのポストを非表示状態にした上でこのユーザからのポストを拒否するか。0 で無効化" + num_flags_to_block_new_user: "もし新しいユーザがnum_users_to_block_new_userで定義されている数の通報を受けたらそれらの投稿を全て非表示にし、今後の投稿をブロックします。0で無効にします。" num_users_to_block_new_user: "新規ユーザのポストに対して、ここで指定した数のユーザにより何個のスパムフラグが立てられたら、全てのポストを非表示状態にした上でこのユーザからのポストを拒否するか。0 で無効化" notify_mods_when_user_blocked: "ユーザが自動的にブロックされた際に、すべてのモデレータにメッセージを送信する。" flag_sockpuppets: "トピックを作成したユーザーと同じIPアドレスで、新規ユーザーがトピックに回答した場合、両者を潜在的なスパムとしてフラグを立てるか" @@ -615,7 +620,7 @@ ja: enable_noscript_support: "noscript タグ経由でアクセスしてきた標準サーチエンジンクローラのサポートを有効にする" allow_moderators_to_create_categories: "モデレータのカテゴリ作成を許可" cors_origins: "CORSを許可。オリジンはhttp://かhttps://を含む必要があります。CORSを有効にするには、環境変数 DISCOURSE_ENABLE_CORSにtrueをセットする必要があります" - top_menu: "ホームナビゲーゲションに表示する項目、表示順を指定。例: latest|new|unread|categories|top|read|posted|bookmarks" + top_menu: "ホームナビゲーションに表示する項目・表示順を指定。例: latest|new|unread|categories|top|read|posted|bookmarks" post_menu: "投稿メニューに表示する項目を指定。例 like|edit|flag|delete|share|bookmark|reply" post_menu_hidden_items: "開くボタンをクリックするまで投稿のメニュー項目を隠します" share_links: "シェアダイアログに表示する項目、表示順を指定" @@ -632,13 +637,13 @@ ja: show_email_on_profile: "プロフィールのメールアドレスを表示(自分とスタッフのみ閲覧できます)" email_token_valid_hours: "パスワードリマインダ、アカウントアクティベート時のトークンを何時間有効にするか" email_token_grace_period_hours: "パスワードリマインダ、アカウントアクティベート時のトークンを無効するときに、何時間猶予を与えるか" - enable_badges: "バッジシステムを有効にする" + enable_badges: "バッジ機能を有効にする" allow_index_in_robots_txt: "サーチエンジンにインデックスを許可するようにrobots.txtを指定する" email_domains_blacklist: "ユーザーがアカウント登録をすることができない、パイプ区切りのドメイン名のリスト。 例 : mailinator.com|trashmail.net" email_domains_whitelist: "ユーザー登録に必要なパイプ区切りのメールドメインのリスト。警告: 指定したメールドメイン以外のユーザは許可されません!" forgot_password_strict: "パスワードリマインダダイアログで、アカウントの存在を通知しない" log_out_strict: "ログアウトした際に、そのユーザーの全デバイスのセッションをログアウトさせる" - version_checks: "Discourse Hub にアップデート、新バージョンの有無を問い合わせ /admin ダッシュボードにバージョンメッセージを表示する" + version_checks: "Discourse Hubからのアップデートを確認し、管理ページにバージョンやアップデートメッセージを表示する" new_version_emails: "Discourseの新しいバージョンが利用可能になった際に contact_email アドレスにメールで通知する" port: "開発者用! 警告! デフォルトの80番ポートではなく、ここで指定した HTTP ポートを利用する。空欄でデフォルトの80番ポートを利用。" force_hostname: "開発者用! 警告! URL 内のホスト名を指定。空欄でデフォルト値を利用。" @@ -658,7 +663,7 @@ ja: sso_overrides_avatar: "SSOペイロードから取得した外部サイトのプロフィール画像でローカルのプロフィール画像を上書きする。有効にする場合、プロフィール画像のアップデートを無効にする事を強く薦めます" sso_not_approved_url: "このURLに承認されていないSSOアカウントをリダイレクト" enable_local_logins: "ローカルのユーザ名、パスワードでのログインを有効にする (注意: 招待を使用するには有効にする必要があります)" - allow_new_registrations: "新規ユーザー登録を許可。誰でもユーザーを作れるのを防ぐには、チェックを外してください。" + allow_new_registrations: "新しいユーザの登録を許可。ユーザを誰でも作れないようにするためには、チェックを外してください。" enable_yahoo_logins: "Yahoo 認証を有効にする" enable_google_oauth2_logins: "グーグル Oauth2 認証を有効にします。これはグーグルが現在サポートしている認証方式です。key と secret が必要です。" google_oauth2_client_id: "あなたのGoogleアプリケーションのクライアントID" @@ -678,12 +683,12 @@ ja: enable_s3_backups: "完了時にS3にバックアップをアップロードします。重要: 有効なS3 credentialsがファイル設定に必要です" s3_backup_bucket: "バックアップを保持するバケット。 警告: 必ずプライベートバケットになっていることを確認してください" active_user_rate_limit_secs: "'last_seen_at' フィールドを更新する頻度 (秒)" - verbose_localization: "ローカライゼーションtipsを展開するUIを表示する" + verbose_localization: "翻訳者向けの機能を表示をします" previous_visit_timeout_hours: "'previous' visit とみなす時間 (時間)" rate_limit_create_topic: "トピック作成後、次のトピックを作成するまでにユーザが待たなければならない時間 (秒)" rate_limit_create_post: "ポスト投稿後、次のポストを投稿するまでにユーザが待たなければならない時間 (秒)" - rate_limit_new_user_create_topic: "トピック作成後、次のトピックを作成するまでに新規ユーザが待たなければならない時間 (秒)" - rate_limit_new_user_create_post: "ポスト投稿後、次のポストを投稿するまでに新規ユーザが待たなければならない時間 (秒)" + rate_limit_new_user_create_topic: "新しいユーザがトピックを作った後、次のトピックが作成できるまでの時間(秒)" + rate_limit_new_user_create_post: "投稿後、次のポストを投稿するまでに新しいユーザが待たなければならない時間 (秒)" max_likes_per_day: "ユーザが一日に「いいね!」できる最大数" max_flags_per_day: "ユーザが一日に行える通報の回数" max_bookmarks_per_day: "ユーザが一日にブックマークできる最大数" @@ -725,11 +730,11 @@ ja: tl3_links_no_follow: "トラストレベル3のユーザのポスト内のrel=nofolowを削除しない" min_trust_to_create_topic: "新規にトピックを作成するために必要な最低トラストレベル。" min_trust_to_edit_wiki_post: "ポストをwikiにするために必要な最低トラストレベル" - newuser_max_links: "新規ユーザがポスト内に作成できるリンクの数" - newuser_max_images: "新規ユーザがポスト内にアップロードできる画像の数" - newuser_max_attachments: "新規ユーザがポスト内に添付できるファイルの数" - newuser_max_mentions_per_post: "新規ユーザがポスト内で @name で通知できる最大数" - newuser_max_replies_per_topic: "新規ユーザが1つのトピックで誰かがそれに回答するまでに回答できる最大数" + newuser_max_links: "新しいユーザが投稿内に貼れるリンクの数" + newuser_max_images: "新しいユーザが投稿内にアップロードできる画像の数" + newuser_max_attachments: "新しいユーザが投稿内に添付できるファイルの数" + newuser_max_mentions_per_post: "新しいユーザが投稿内で @name で通知できる最大の数" + newuser_max_replies_per_topic: "新しいユーザが1つのトピックで誰かがそれに回答するまでに回答できる最大の数" max_mentions_per_post: "ユーザがポスト内で@name で通知できる最大数" create_thumbnails: "大きすぎる画像はポストにフィットするように、サムネイルを作成しlightbox 画像を作成する" email_time_window_mins: "ユーザによるポストの最終編集チャンスを与えるために、通知用メール送信までに待つ時間 (分)" @@ -760,7 +765,7 @@ ja: topic_post_like_heat_low: "いいね数/ ポスト数の比率がこの比率を超えると、ポスト数のフィールドがやや強調されます" topic_post_like_heat_medium: "いいね数/ ポスト数の比率がこの比率を超えると、ポスト数のフィールドが適度に強調されます" topic_post_like_heat_high: "いいね数/ ポスト数の比率がこの比率を超えると、ポスト数のフィールドが強く強調されます" - faq_url: "他サイトに FAQ をホストしている場合は、フル URL をここに指定。" + faq_url: "FAQが他のサイトにある場合、URLをここに指定します。" tos_url: "他サイトに利用規約をホストしている場合は、フル URL をここに指定。" privacy_policy_url: "他サイトにプライバシーポリシーをホストしている場合は、フル URL を個々に指定。" white_listed_spam_host_domains: "スパムホスト検査から除外するドメインのリスト。新規ユーザはこれらのドメインでポスト内にリンクを作成することを制限されません" @@ -806,9 +811,9 @@ ja: allow_animated_thumbnails: "アニメgifからアニメーションサムネイルを生成する" default_avatars: "新規ユーザが変更するまで使用されるデフォルトのプロフィール画像URL" automatically_download_gravatars: "アカウントの生成時、メールアドレスの変更時にGravatarをダウンロード" - digest_topics: "ダイジェストメールに表示されるトピックの最大数" - digest_min_excerpt_length: "ダイジェストメール内の投稿の抜粋の最小文字数" - disable_digest_emails: "全てのユーザのダイジェストメールを無効にする" + digest_topics: "まとめメールに表示されるトピックの最大数" + digest_min_excerpt_length: "まとめメール内の投稿の抜粋の最小文字数" + disable_digest_emails: "すべてのユーザのまとめメールを無効にする" detect_custom_avatars: "ユーザがプロフィール画像をアップロードしたか確認する" max_daily_gravatar_crawls: "Discourseがプロフィール画像の確認をgravastarに行う回数の上限" public_user_custom_fields: "パブリックに公開されるカスタムフィールドのホワイトリスト" @@ -839,7 +844,7 @@ ja: embed_by_username: "embedされたトピックの作成者として表示されるDiscourseユーザー名" embed_username_key_from_feed: "フィードからDsicourseユーザ名をプルするキー" embed_truncate: "embedされた投稿をtruncateする" - embed_post_limit: "embedで表示する投稿の最大数" + embed_post_limit: "表示可能な投稿の最大数を埋め込む" embed_whitelist_selector: "embedを許可するエレメントのCSS Selector" embed_blacklist_selector: "embedから削除するエレメントのCSS Selector" notify_about_flags_after: "この数時間後に処理されていない通報がある場合は、contact_emailにメールを送信する。0を設定すると無効になります" @@ -852,6 +857,7 @@ ja: emoji_set: "How would you like your emoji?" enforce_square_emoji: "絵文字のアスペクト比を強制的に揃える" approve_unless_trust_level: "トラストレベル以下のユーザーの投稿には承認が必要" + default_email_previous_replies: "デフォルトでメールの文章に以前の返信を含める" errors: invalid_email: "不正なメールアドレスです" invalid_username: "そのユーザ名のユーザは存在しません" @@ -894,7 +900,7 @@ ja: not_seen_in_a_month: "お帰りなさい! 最近見かけませんでしたね。 これらがあなたが離れてから最も人気のトピックです" move_posts: new_topic_moderator_post: - other: "%{count} 件のポストを新しいトピックに分割しました: %{topic_link}" + other: "%{count}件の投稿を新しいトピックに分割しました: %{topic_link}" existing_topic_moderator_post: other: "%{count} 件のポストを既存のトピックにマージしました: %{topic_link}" change_owner: @@ -945,7 +951,7 @@ ja: something_already_taken: "エラーが発生しました。ユーザ名またはメールアドレスが既に使用中の可能性があります。パスワードリセットを行ってください。" omniauth_error: "あなたの アカウントの認可に失敗しました。アカウントの認可を許可したか確認してください" omniauth_error_unknown: "ログインに失敗しました。もう一度試してください。" - new_registrations_disabled: "新規登録は、この時点で許可されていません" + new_registrations_disabled: "新規登録は現在行えません。" password_too_long: "パスワードは200文字までです" email_too_long: "メールアドレスが長過ぎます。アドレス部は254文字以内に、ドメイン部は253文字以内にする必要があります" reserved_username: "そのユーザー名は許可されていません" @@ -964,7 +970,7 @@ ja: blocked: "は許可されていません。" ip_address: blocked: "あなたのIPアドレスからの新規登録は許可されていません" - max_new_accounts_per_registration_ip: "あなたのIPアドレスからの新規登録は許可されていません(最大数に達しました)。スタッフメンバーに連絡してください" + max_new_accounts_per_registration_ip: "あなたのIPアドレスからの新規登録は行えません(登録可能な数を超えています)。スタッフへお問い合わせください。" flags_reminder: subject_template: other: "%{count}件の通報が対応待ちです" @@ -1002,9 +1008,36 @@ ja: test_mailer: subject_template: "[%{site_name}] メール送信テスト" new_version_mailer: - subject_template: "[%{site_name}] New Discourse version, update available" + subject_template: "[%{site_name}] Discourseの新しいバージョンがあります。" + text_body_template: | + 最新版の[Discourse](http://www.discourse.org)が利用出来ます! + + 現在利用しているバージョン: %{installed_version} + 新しいバージョン: **%{new_version}** + + - 更新は**[ワンクリックブラウザ・アップグレード](%{base_url}/admin/upgrade)**から簡単にできます。 + + - 更新内容は[GitHubの更新履歴](https://github.com/discourse/discourse/commits/master)をご覧ください。 + + - [meta.discourse.org](http://meta.discourse.org)にて、Discourseに関するお知らせ、話し合い、サポートを行っています。 new_version_mailer_with_notes: - subject_template: "[%{site_name}] update available" + subject_template: "[%{site_name}] アップデートがあります" + text_body_template: |+ + 最新版の[Discourse](http://www.discourse.org)が利用出来ます! + + 現在利用しているバージョン: %{installed_version} + 新しいバージョン: **%{new_version}** + + - 更新は**[ワンクリックブラウザ・アップグレード](%{base_url}/admin/upgrade)**から簡単にできます。 + + - 更新内容は[GitHubの更新履歴](https://github.com/discourse/discourse/commits/master)をご覧ください。 + + - [meta.discourse.org](http://meta.discourse.org)にて、Discourseに関するお知らせ、話し合い、サポートを行っています。 + + ### リリースノート + + %{notes} + queued_posts_reminder: subject_template: other: "[%{site_name}] %{count} 件の投稿がレビュー待ちです" @@ -1058,7 +1091,7 @@ ja: ``` restore_succeeded: subject_template: "復元が正常に完了しました" - text_body_template: "復元に成功しました" + text_body_template: "復元が完了しました。" restore_failed: subject_template: "復元に失敗しました" text_body_template: | @@ -1083,7 +1116,7 @@ ja: %{logs} ``` csv_export_succeeded: - subject_template: "データ出力完了" + subject_template: "データのダウンロード準備が完了しました" text_body_template: | データ出力が完了しました! :dvd: @@ -1091,8 +1124,8 @@ ja: このダウンロードリンクは48時間有効です csv_export_failed: - subject_template: "データ出力失敗" - text_body_template: "申し訳ありません。データ出力に失敗しました。ログを確認するかスタッフメンバーに連絡してください" + subject_template: "データのエクスポートに失敗しました" + text_body_template: "申し訳ありません。データのエクスポートに失敗しました。ログを確認するかスタッフメンバーにお問い合わせください。" email_reject_no_account: subject_template: "[%{site_name}] Email issue -- 不明なアカウント" email_reject_empty: @@ -1152,16 +1185,18 @@ ja: subject_template: "[%{site_name}] [プライベートメッセージ] %{topic_title}" digest: why: "あなたが最後にアクセスした %{last_seen_at} 以降の %{site_link} のまとめです" - subject_template: "[%{site_name}] ダイジェスト" + subject_template: "[%{site_name}] のまとめ" new_activity: "あなたのトピックおよびポストにおけるアクティビティ:" top_topics: "人気の投稿" other_new_topics: "人気のトピック" - unsubscribe: "このダイジェストは、あなたからのアクセスがしばらくない場合、%{site_link}から送信されます。配信停止はこちら %{unsubscribe_link}" + unsubscribe: "このまとめは、サイトへのアクセスが一定期間無い場合に、%{site_link}から送られます。配信停止はこちらから行えます: %{unsubscribe_link}" click_here: "ここをクリック" - from: "%{site_name} ダイジェスト" + from: "%{site_name} のまとめ" read_more: "もっと読む" more_topics: " %{new_topics_since_seen}個の新しいトピックがありました" more_topics_category: "もっと新しいトピック:" + mailing_list: + new_topics: "新着トピック" forgot_password: subject_template: "[%{site_name}] パスワードのリセット" text_body_template: | @@ -1189,6 +1224,12 @@ ja: 以下のリンクをクリックしてパスワードを設定してください: %{base_url}/users/password-reset/%{email_token} + confirm_new_email: + subject_template: "[%{site_name}] 新しいメールアドレスを確認してください" + text_body_template: | + 以下のリンクをクリックして、%{site_name}で利用するメールアドレスを有効化してください: + + %{base_url}/users/authorize-email/%{email_token} signup_after_approval: subject_template: "%{site_name} への参加承認完了!" signup: @@ -1196,11 +1237,12 @@ ja: text_body_template: | Welcome to %{site_name}! - 次のリンクをクリックして、新たなアカウントの承認およびアクティベーションを行ってください: + リンクをクリックして、アカウントを有効化してください: %{base_url}/users/activate-account/%{email_token} もし、上記のURLがクリックできない場合は、ブラウザのアドレスバーへURLをコピーして貼り付けて下さい。 page_not_found: + title: "ページが見つからないか、アクセス出来ない場所にあります。" popular_topics: "人気" recent_topics: "最新" see_more: "もっと見る" @@ -1248,19 +1290,73 @@ ja: csv_export: boolean_yes: "はい" boolean_no: "いいえ" - static_topic_first_reply: |+ + static_topic_first_reply: | %{page_name}ページのコンテンツを編集するには、このトピックの最初の投稿を編集してください - guidelines_topic: - title: "よくある質問/コミュニティガイドライン" + title: "FAQ/ガイドライン" tos_topic: title: "利用規約" privacy_topic: title: "プライバシーポリシー" + static: + search_help: | +

マメ知識

+

+

    +
  • 検索はタイトルが優先されます。 – 迷った時はタイトルを調べてみましょう。
  • +
  • 調べたい物特有の、他にはない言葉で調べると良いでしょう。
  • +
  • 特定のカテゴリ、トピック、ユーザーページにて検索してみましょう。
  • +
+

+

オプション

+

+ + + + + + + +
order:viewsorder:latestorder:likes@usernameuser:foo
status:openstatus:closedstatus:archivedstatus:norepliesstatus:single_user
#category-slugcategory:foogroup:foobadge:foo
in:likesin:postedin:watchingin:trackingin:private
in:bookmarksin:firstin:pinnedin:unpinnedin:wiki
posts_count:numbefore:days or dateafter:days or date
+

+

サンプル

+

+

    +
  • rainbows #parks で、"parks"カテゴリの"rainbows"という言葉を含むトピックを検索します。
  • +
  • rainbows category:parks status:open order:latest 最終投稿の日付順に並べ替え、”parks”カテゴリの"rainbows"を含むクローズ/アーカイブされていないトピックを検索します。
  • +
  • rainbows category:"parks and gardens" in:bookmarks ブックマークされている"parks and gardens"カテゴリの中で、"rainbows"という言葉を含むトピックを検索します。
  • +
+

badges: + editor: + name: 編集者 + description: 最初の投稿を編集する + autobiographer: + name: あなたはだれ? + description: プロフィールをすべて書く + nice_post: + name: ナイスな返事 + good_post: + name: イカす返事 + great_post: + name: 素晴らしい返事 + nice_topic: + name: ナイスなトピック + good_topic: + name: イカすトピック first_flag: name: はじめの通報 description: 通報した投稿 + read_guidelines: + description: ガイドラインを読む + popular_link: + name: 人気のリンク + hot_link: + name: ウワサのリンク + famous_link: + name: 伝説のリンク + first_emoji: + name: はじめての絵文字 admin_login: success: "メールを送信しました" error: "エラー!" diff --git a/config/locales/server.pt.yml b/config/locales/server.pt.yml index 35f64b1d6..eb4c8272d 100644 --- a/config/locales/server.pt.yml +++ b/config/locales/server.pt.yml @@ -24,7 +24,7 @@ pt: loading: "A carregar" powered_by_html: 'Desenvolvido por Discourse, e melhor visualizado com o JavaScript ativo' log_in: "Iniciar Sessão" - purge_reason: "Automaticamente eliminado devido a abandono, conta inativada" + purge_reason: "Conta removida automaticamente como conta abandonada, desactivada." disable_remote_images_download_reason: "O download remoto de imagens foi desativado por não haver espaço disponível no disco." anonymous: "Anónimo" emails: @@ -35,7 +35,7 @@ pt: empty_email_error: "Acontece quando, a informação não processada, do email recebido veio em branco." no_message_id_error: "Acontece quando o email recebido não tem 'Message-Id' no cabeçalho da mensagem." auto_generated_email_error: "Acontece quando o cabeçalho 'precedence' é definida como: 'list', 'junk' ou 'auto_reply', ou quando algum cabeçalho contém: 'auto-submitted', 'auto-replied' ou 'auto-generated'." - no_body_detected_error: "Acontece quando não conseguimos extrair o corpo da mensagem e não existem anexos." + no_body_detected_error: "Acontece quando não se consegue obter um corpo de mensagem e não existem anexos." inactive_user_error: "Acontece quando o remetente não está activo." blocked_user_error: "Acontece quando o remetente está bloqueado." bad_destination_address: "Acontece quando nenhum dos endereços de email nos campos para/cc/bcc coincide com um endereço de email configurado." @@ -44,6 +44,9 @@ pt: reply_user_not_matching_error: "Acontece quando uma resposta veio de um endereço de email diferente do destinatário da notificação." topic_not_found_error: "Acontece quando a resposta veio de um tópico relacionado mas o tópico relacionado foi apagado." topic_closed_error: "Acontece quando uma resposta chegou mas o tópico relacionado foi fechado." + bounced_email_error: "O email é um relatório devolvido." + auto_generated_email_reply: "O email contém uma resposta a um email gerado automaticamente." + screened_email_error: "Acontece quando a morada de email da pessoa que enviou já foi confirmada." errors: &errors format: '%{attribute} %{message}' messages: @@ -174,6 +177,7 @@ pt: group_mentions: "Últimas menções em %{group_name}" user_posts: "Mensagens mais recentes criados por @%{username}" user_topics: "Tópicos mais recentes criados por @%{username}" + tag: "Tópicos etiquetados" too_late_to_edit: "Essa mensagem foi criada há muito tempo. Já não pode ser editada ou apagada." revert_version_same: "A versão atual é o mesma versão para a qual você está tentando reverter." excerpt_image: "imagem" @@ -181,7 +185,7 @@ pt: delete_reason: "Eliminado através da fila de moderação de mensagens" groups: errors: - can_not_modify_automatic: "Não pode modificar um grupo automático" + can_not_modify_automatic: "Não pode modificar um grupo automatico" member_already_exist: "'%{username}' já é membro deste grupo." invalid_domain: "'%{domain}' não é um domínio válido." invalid_incoming_email: "'%{email}' não é um endereço de email válido." @@ -475,7 +479,7 @@ pt: continue_button: "Continuar para %{site_name}" welcome_to: "Bem-vindo a %{site_name}!" approval_required: "Um moderador tem que aprovar a sua conta antes de poder aceder a este fórum. Irá receber um email quando a sua conta for aprovada!" - missing_session: "Não conseguimos detetar se a sua conta foi criada, por favor assegure-se que tem os cookies ativos." + missing_session: "Não conseguimos detectar se a sua conta foi criada, pelo que pedimos que confirme que tem os cookies possibilitados." post_action_types: off_topic: title: 'Fora de Contexto' @@ -721,6 +725,9 @@ pt: email_polling_errored_recently: one: "A consulta automática de emails gerou um erro nas últimas 24 horas. Consulte em os registos para mais detalhes." other: "A consulta automática de emails gerou %{count} erros nas últimas 24 horas. Consulte em os registos para mais detalhes." + bad_favicon_url: "Não estamos a conseguir carregar o favicon. Pot favor, confirme a sua configuração favicon_url nas Configurações do sítio." + poll_pop3_timeout: "A tentativa de ligação ao servidor POP3 está a ultrapassar o tempo máximo. Email de caixa de entrada não pôde ser obtido. Por favor verifique a sua configuração de POP3 e fornecedor de serviço internet." + poll_pop3_auth_error: "A tentativa de ligação ao servidor POP3 está a falhar por motivos de erro de autenticação. Por favor verifique a sua configuração de POP3." site_settings: censored_words: "Palavras que serão automaticamente substituídas por ■■■■" delete_old_hidden_posts: "Eliminar automaticamente quaisquer mensagens ocultas que permaneçam escondidas por mais de 30 dias." @@ -765,6 +772,7 @@ pt: post_onebox_maxlength: "Tamanho máximo de uma mensagem Discourse de caixa única, em caracteres." onebox_domains_whitelist: "Lista de domínios que permitem colocar em caixa única; estes domínios devem suportar OpenGraph ou oEmbed. Teste-os em http://iframely.com/debug" logo_url: "A imagem do logótipo no canto superior esquerdo do seu sítio, deve ter uma forma retangular. Quando deixada em branco, o texto do título do sítio será exibido." + digest_logo_url: "O logotipo alternativo usado no topo do email de resumo do seu sítio. Deve ter um formato rectangular amplo. Não pode ser uma imagem em formato SVG. Se deixado em branco, `logo_url` será utilizado." logo_small_url: "A pequena imagem do logótipo no canto superior esquerdo do seu sítio, deve ter uma forma quadrada, visível quando arrastado para baixo. Quando deixado em branco, um glifo de início será exibido." favicon_url: "Um favicon para o seu sítio, veja http://en.wikipedia.org/wiki/Favicon, para trabalhar corretamente sobre um CDN deve ser um png" mobile_logo_url: "A imagem do logótipo com posição fixa utilizada no canto superior esquerdo do seu sítio móvel deve ter uma forma quadrada. Quando deixado em branco, `logo_url` será utilizado. ex: http://exemplo.com/uploads/default/logo.png" @@ -785,6 +793,7 @@ pt: polling_interval: "Quando não está a ocorrer uma solicitação ao servidor, com que frequência devem os clientes ligados requerer uma atualização, em milissegundos" anon_polling_interval: "Com que frequência os clientes não registados podem fazer solicitações ao servidor, em milisegundos" background_polling_interval: "Com que frequência deverão os clientes solicitar o servidor, em milissegundos (quando a janela está em plano de fundo)" + flags_required_to_hide_post: "Número de bandeiras que fazem com que uma mensagem seja automaticamente escondida e uma mensagem enviada ao utilizador (0 se nunca)" cooldown_minutes_after_hiding_posts: "Número de minutos que o utilizador deve esperar antes de poder editar uma mensagem oculta devido a sinalizações por parte da comunidade" max_topics_in_first_day: "O número máximo de tópicos que é o utilizador pode criar no seu primeiro dia no Fórum." max_replies_in_first_day: "Número máximo de mensagens que um utilizador pode criar no seu primeiro dia no Fórum." diff --git a/config/locales/server.pt_BR.yml b/config/locales/server.pt_BR.yml index 5c22281a6..e1065c534 100644 --- a/config/locales/server.pt_BR.yml +++ b/config/locales/server.pt_BR.yml @@ -24,7 +24,7 @@ pt_BR: loading: "Carregando" powered_by_html: 'Desenvolvido por Discourse, melhor visualizado com JavaScript ativado' log_in: "Entrar" - purge_reason: "A conta não verificada, foi excluída." + purge_reason: "Automaticamente eliminada por ser uma conta abandonada, não ativada" disable_remote_images_download_reason: "Download de imagens remotas foi desativado porque não havia espaço suficiente em disco disponível." anonymous: "Anônimo" emails: diff --git a/config/locales/server.ro.yml b/config/locales/server.ro.yml index d44a17e71..98c03ce65 100644 --- a/config/locales/server.ro.yml +++ b/config/locales/server.ro.yml @@ -340,7 +340,7 @@ ro: please_continue: "Noul dvs cont este confirmat, iar acum sunteți autentificat." continue_button: "Continuă cu %{site_name}" welcome_to: "Bine ați venit la %{site_name}!" - approval_required: "Un moderator trebuie să aprobe manual contul înaine să puteți accesa forumul. Veți primii un email când acesta a fost aprobat!" + approval_required: "Un moderator trebuie să aprobe manual contul înaine să puteți accesa forumul. Vei primi un email când acesta a fost aprobat!" post_action_types: off_topic: title: 'În afară discuției' @@ -352,7 +352,7 @@ ro: long_form: 'marchează aceasta ca spam' inappropriate: title: 'Necorespunzător' - description: 'Această postare are conținut pe care o persoană normală l-ar numii ofesator, abuziv, sau o violare a regulilor comune.' + description: 'Această postare are conținut ce ar putea fi considerat drept ofesator, abuziv, sau o violare a regulilor comune.' long_form: 'marcat ca necorespunzător' notify_user: email_title: 'Despre postarea dvs din "%{title}"' @@ -379,7 +379,7 @@ ro: long_form: 'Marchează asta ca spam' inappropriate: title: 'Necorespunzător' - description: 'Această discuție are conținut pe care o persoană normală l-ar numii ofesantor, abuziv, sau o violare a regulilor comune.' + description: 'Această discuție are conținut ce ar putea fi considerat drept ofesantor, abuziv, sau o violare a regulilor comune.' long_form: 'marcat ca necorespunzător' notify_moderators: title: "Notifică moderatori" @@ -601,7 +601,7 @@ ro: invite_expiry_days: "Cat timp sun valabile cheile de invitație ale utilizatorilor, în zile" invite_passthrough_hours: "Cât timp un utilizator poate folosii o cheie de invitație recuperată anterior pentru autentificare, în ore" invite_only: "Înregistrarea publică este dezactivată, toți utilizatorii noi trebuie să fie exclusiv invitați de un alt membru sau personalul site-ului." - login_required: "Autentificarea e necesară pentru a citii conținutul site-ului, nu permite accesul anonim." + login_required: "Autentificarea este necesară pentru a citi conținutul site-ului, nu permite accesul anonim." min_password_length: "Lungimea minimă de caractere pentru parolă." block_common_passwords: "nu permite parole ce sunt în cele 10,000 cele mai cunoscute parole." enable_local_logins: "Activează numele de utilizator local și a conturilor bazate pe logare cu parola. (Notă: Aceasta trebuie activiată pentru invitații pt a funcționa)" @@ -874,7 +874,7 @@ ro: previous_discussion: "Răspunsurile precedente" unsubscribe: title: "Dezabonare" - description: "Nu sunteți interesat în a primii aceste email-uri? Nicio problemă! Faceți clic dedesubt pentru a vă dezabona imediat:" + description: "Nu ești interesat în a primi aceste email-uri? Nicio problemă! Faceți click dedesubt pentru a vă dezabona imediat:" posted_by: "Postat de %{username} pe data %{post_date}" user_replied: subject_template: "[%{site_name}] %{topic_title}" diff --git a/config/locales/server.ru.yml b/config/locales/server.ru.yml index 606eb2182..213450abb 100644 --- a/config/locales/server.ru.yml +++ b/config/locales/server.ru.yml @@ -12,7 +12,7 @@ ru: long_date: "D MMMM YYYY, HH:mm" datetime_formats: &datetime_formats formats: - short: "%m-%d-%Y" + short: "%d.%m.%Y" date: month_names: [null, Январь, Февраль, Март, Апрель, Май, Июнь, Июль, Август, Сентябрь, Октябрь, Ноябрь, Декабрь] <<: *datetime_formats @@ -22,7 +22,7 @@ ru: loading: "Загрузка..." powered_by_html: 'При поддержке Discourse, лучше всего использовать с включенным JavaScript' log_in: "Войти" - purge_reason: "Автоматически удален, как неактивная, неактивированная учетная запись" + purge_reason: "Деактивированная учетная запись будет автоматически удалена как заброшенная" disable_remote_images_download_reason: "Загрузка картинок была отключена из-за недостаточности места на диске." anonymous: "Гость" emails: diff --git a/config/locales/server.zh_CN.yml b/config/locales/server.zh_CN.yml index a9d2052a2..00a51dab5 100644 --- a/config/locales/server.zh_CN.yml +++ b/config/locales/server.zh_CN.yml @@ -2436,18 +2436,14 @@ zh_CN: thank_you: name: 感谢你 description: 有 20 个被赞的帖子,给出过 10 个赞 - long_description: | - 该徽章授予给收到了 20 个赞,且赞过别人 10 次的你。当别人感谢你的帖子时,你也感谢他们的帖子。 gives_back: name: 回馈 description: 有 100 个被赞的帖子,给出过 100 个赞 - long_description: | - 该徽章授予给收到了 100 个赞,且赞过别人 100 次的你。感谢你回馈赞给社群! empathetic: name: 感性 description: 有 500 个被赞的帖子,给出过 1000 个赞 - long_description: | - 该徽章授予给收到了 500 个赞,且赞过别人 1000 次的你。哇!你是一个富有同情心且会换位思考的模范。 :two_hearts: + first_emoji: + description: 在帖子中使用表情符号 admin_login: success: "邮件已发送" error: "错误!" diff --git a/plugins/poll/config/locales/client.bs_BA.yml b/plugins/poll/config/locales/client.bs_BA.yml index c03c38e59..da40be0d9 100644 --- a/plugins/poll/config/locales/client.bs_BA.yml +++ b/plugins/poll/config/locales/client.bs_BA.yml @@ -17,5 +17,8 @@ bs_BA: few: "ukupno glasova" other: "ukupno glasova" average_rating: "Prosječna ocjena: %{average}." + cast-votes: + title: "ukupno glasova" + label: "Glasaj" close: label: "Zatvori" diff --git a/plugins/poll/config/locales/client.fr.yml b/plugins/poll/config/locales/client.fr.yml index cb7bcccbd..a674b4e69 100644 --- a/plugins/poll/config/locales/client.fr.yml +++ b/plugins/poll/config/locales/client.fr.yml @@ -9,8 +9,8 @@ fr: js: poll: voters: - one: "voteur" - other: "voteurs" + one: "votant" + other: "votants" total_votes: one: "vote au total" other: "votes au total" diff --git a/plugins/poll/config/locales/client.ja.yml b/plugins/poll/config/locales/client.ja.yml index a3b3f1bbb..b9be616a8 100644 --- a/plugins/poll/config/locales/client.ja.yml +++ b/plugins/poll/config/locales/client.ja.yml @@ -24,7 +24,7 @@ ja: between_min_and_max_options: "%{min}%{max} のオプションから選択することができます。" cast-votes: title: "投票する" - label: "すぐ投票!" + label: "今すぐ投票!" show-results: title: "投票結果を表示" label: "結果を表示" diff --git a/plugins/poll/config/locales/server.ja.yml b/plugins/poll/config/locales/server.ja.yml index 7b42aca44..16434983f 100644 --- a/plugins/poll/config/locales/server.ja.yml +++ b/plugins/poll/config/locales/server.ja.yml @@ -26,9 +26,9 @@ ja: cannot_change_polls_after_5_minutes: "最初の5分を経過すると、投票の追加、削除や名前変更はできません。" op_cannot_edit_options_after_5_minutes: "最初の5分を経過すると投票オプションの追加や削除はできません。投票オプションの編集が必要であれば、モデレータに連絡してください。" staff_cannot_add_or_remove_options_after_5_minutes: "最初の5分を経過すると投票オプションの追加や削除はできません。このトピックを閉じて新しいトピックを作成してください。" - no_polls_associated_with_this_post: "このポストに関連付けられた投票はありません。" - no_poll_with_this_name: "このポストに関連付けられた投票 %{name} はありません。" - post_is_deleted: "削除されたポストに作用することはできません。" + no_polls_associated_with_this_post: "この投稿に関連付けられた投票はありません。" + no_poll_with_this_name: "この投稿に関連付けられた投票 %{name} はありません。" + post_is_deleted: "削除された投稿を操作する事はできません。" topic_must_be_open_to_vote: "投票するトピックはオープンになっている必要があります。" poll_must_be_open_to_vote: "投票するにはオープンになっている必要があります。" topic_must_be_open_to_toggle_status: "状態を切り替えるには、トピックがオープンになっている必要があります。" diff --git a/public/500.ja.html b/public/500.ja.html index 9e698a3fe..48faa075b 100644 --- a/public/500.ja.html +++ b/public/500.ja.html @@ -5,7 +5,7 @@

500

-

このディスカッションフォーラムに予期しないエラーが発生しました。

+

予期しないエラーが発生しました。

エラーについての詳細情報は記録されました。自動通知を受け取りました。確認致します。

これ以上のアクションは必要ありません。ただし、エラーが解消されない場合、エラー再現の手順を含めて,このカテゴリ.に投稿することにより詳細情報を提供することができます。

From 113ce00e6a36f83575da60173ece6af7b20ad0ba Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 26 May 2016 11:51:48 -0400 Subject: [PATCH 010/320] Version bump to v1.6.0.beta6 --- lib/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/version.rb b/lib/version.rb index 146324f3b..919b48142 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -5,7 +5,7 @@ module Discourse MAJOR = 1 MINOR = 6 TINY = 0 - PRE = 'beta5' + PRE = 'beta6' STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.') end From 51dbb966de66fea4409f0b750f24fb337054d6bf Mon Sep 17 00:00:00 2001 From: James Kiesel Date: Thu, 26 May 2016 09:33:49 -0700 Subject: [PATCH 011/320] Don't display activity summary in two places (#4239) * Don't display activity summary in two places * Re-add tl0 user digest option --- .../discourse/templates/user/preferences.hbs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/user/preferences.hbs b/app/assets/javascripts/discourse/templates/user/preferences.hbs index 9c14f6b45..cb9b9e6c1 100644 --- a/app/assets/javascripts/discourse/templates/user/preferences.hbs +++ b/app/assets/javascripts/discourse/templates/user/preferences.hbs @@ -168,16 +168,6 @@
- {{#if canReceiveDigest}} - {{preference-checkbox labelKey="user.email_digests.title" checked=model.user_option.email_digests}} - {{#if model.user_option.email_digests}} -
- {{combo-box valueAttribute="value" content=digestFrequencies value=model.user_option.digest_after_minutes}} -
- {{preference-checkbox labelKey="user.include_tl0_in_digests" checked=model.user_option.include_tl0_in_digests}} - {{/if}} - {{/if}} -
{{combo-box valueAttribute="value" content=previousRepliesOptions value=model.user_option.email_previous_replies}} @@ -205,6 +195,7 @@
{{combo-box valueAttribute="value" content=digestFrequencies value=model.user_option.digest_after_minutes}}
+ {{preference-checkbox labelKey="user.include_tl0_in_digests" disabled=model.user_option.mailing_list_mode checked=model.user_option.include_tl0_in_digests}} {{/if}} {{/if}}
From ebd4b4577168644ff1132af85215bfa2034ecdbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 26 May 2016 19:02:31 +0200 Subject: [PATCH 012/320] FIX: use 16:9 ratio to detect whether to crop a thumbnail or not --- lib/cooked_post_processor.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rb index 60af2b57a..9d9e1fac3 100644 --- a/lib/cooked_post_processor.rb +++ b/lib/cooked_post_processor.rb @@ -186,6 +186,10 @@ class CookedPostProcessor rescue URI::InvalidURIError end + # only crop when the image is taller than 16:9 + # we only use 95% of that to allow for a small margin + MIN_RATIO_TO_CROP ||= (9.0 / 16.0) * 0.95 + def convert_to_link!(img) src = img["src"] return unless src.present? @@ -208,7 +212,7 @@ class CookedPostProcessor return if is_a_hyperlink?(img) crop = false - if original_width.to_f / original_height.to_f < 0.75 + if original_width.to_f / original_height.to_f < MIN_RATIO_TO_CROP crop = true width, height = ImageSizer.crop(original_width, original_height) img["width"] = width From 2e1cc061d8338b3c94a675a3bc9b0e3841a4b7ba Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Sun, 24 Apr 2016 16:31:41 +0200 Subject: [PATCH 013/320] Make sure PMs imported from phpBB3 are only visible to the correct users In addition this tries to automatically fix PMs that were migrated from phpBB2 to phpBB3. --- .../phpbb3/database/database_3_0.rb | 183 +++--------------- script/import_scripts/phpbb3/importer.rb | 9 +- .../phpbb3/importers/message_importer.rb | 100 +++++++--- script/import_scripts/phpbb3/settings.yml | 6 - .../import_scripts/phpbb3/support/settings.rb | 2 - 5 files changed, 105 insertions(+), 195 deletions(-) diff --git a/script/import_scripts/phpbb3/database/database_3_0.rb b/script/import_scripts/phpbb3/database/database_3_0.rb index f6ebc9223..94ec4ca50 100644 --- a/script/import_scripts/phpbb3/database/database_3_0.rb +++ b/script/import_scripts/phpbb3/database/database_3_0.rb @@ -161,82 +161,39 @@ module ImportScripts::PhpBB3 SQL end - def count_messages(use_fixed_messages) - if use_fixed_messages - count(<<-SQL) - SELECT COUNT(*) AS count - FROM #{@table_prefix}_import_privmsgs - SQL - else - count(<<-SQL) - SELECT COUNT(*) AS count - FROM #{@table_prefix}_privmsgs - SQL - end + def count_messages + count(<<-SQL) + SELECT COUNT(*) AS count + FROM #{@table_prefix}_privmsgs m + WHERE NOT EXISTS ( -- ignore duplicate messages + SELECT 1 + FROM #{@table_prefix}_privmsgs x + WHERE x.msg_id < m.msg_id AND x.root_level = m.root_level AND x.author_id = m.author_id + AND x.to_address = m.to_address AND x.message_time = m.message_time + ) + SQL end - def fetch_messages(use_fixed_messages, last_msg_id) - if use_fixed_messages - query(<<-SQL, :msg_id) - SELECT m.msg_id, i.root_msg_id, m.author_id, m.message_time, m.message_subject, m.message_text, - IFNULL(a.attachment_count, 0) AS attachment_count - FROM #{@table_prefix}_privmsgs m - JOIN #{@table_prefix}_import_privmsgs i ON (m.msg_id = i.msg_id) - LEFT OUTER JOIN ( - SELECT post_msg_id, COUNT(*) AS attachment_count - FROM #{@table_prefix}_attachments - WHERE topic_id = 0 - GROUP BY post_msg_id - ) a ON (m.msg_id = a.post_msg_id) - WHERE m.msg_id > #{last_msg_id} - ORDER BY i.root_msg_id, m.msg_id - LIMIT #{@batch_size} - SQL - else - query(<<-SQL, :msg_id) - SELECT m.msg_id, m.root_level AS root_msg_id, m.author_id, m.message_time, m.message_subject, - m.message_text, IFNULL(a.attachment_count, 0) AS attachment_count - FROM #{@table_prefix}_privmsgs m - LEFT OUTER JOIN ( - SELECT post_msg_id, COUNT(*) AS attachment_count - FROM #{@table_prefix}_attachments - WHERE topic_id = 0 - GROUP BY post_msg_id - ) a ON (m.msg_id = a.post_msg_id) - WHERE m.msg_id > #{last_msg_id} - ORDER BY m.root_level, m.msg_id - LIMIT #{@batch_size} - SQL - end - end - - def fetch_message_participants(msg_id, use_fixed_messages) - if use_fixed_messages - query(<<-SQL) - SELECT m.to_address - FROM #{@table_prefix}_privmsgs m - JOIN #{@table_prefix}_import_privmsgs i ON (m.msg_id = i.msg_id) - WHERE i.msg_id = #{msg_id} OR i.root_msg_id = #{msg_id} - SQL - else - query(<<-SQL) - SELECT m.to_address - FROM #{@table_prefix}_privmsgs m - WHERE m.msg_id = #{msg_id} OR m.root_level = #{msg_id} - SQL - end - end - - def calculate_fixed_messages - drop_temp_import_message_table - create_temp_import_message_table - fill_temp_import_message_table - - drop_import_message_table - create_import_message_table - fill_import_message_table - - drop_temp_import_message_table + def fetch_messages(last_msg_id) + query(<<-SQL, :msg_id) + SELECT m.msg_id, m.root_level AS root_msg_id, m.author_id, m.message_time, m.message_subject, + m.message_text, m.to_address, r.author_id AS root_author_id, r.to_address AS root_to_address, ( + SELECT COUNT(*) + FROM #{@table_prefix}_attachments a + WHERE a.topic_id = 0 AND m.msg_id = a.post_msg_id + ) AS attachment_count + FROM #{@table_prefix}_privmsgs m + LEFT OUTER JOIN #{@table_prefix}_privmsgs r ON (m.root_level = r.msg_id) + WHERE m.msg_id > #{last_msg_id} + AND NOT EXISTS ( -- ignore duplicate messages + SELECT 1 + FROM #{@table_prefix}_privmsgs x + WHERE x.msg_id < m.msg_id AND x.root_level = m.root_level AND x.author_id = m.author_id + AND x.to_address = m.to_address AND x.message_time = m.message_time + ) + ORDER BY m.msg_id + LIMIT #{@batch_size} + SQL end def count_bookmarks @@ -268,83 +225,5 @@ module ImportScripts::PhpBB3 (SELECT config_value FROM #{@table_prefix}_config WHERE config_name = 'upload_path') AS attachment_path SQL end - - protected - - def drop_temp_import_message_table - query("DROP TABLE IF EXISTS #{@table_prefix}_import_privmsgs_temp") - end - - def create_temp_import_message_table - query(<<-SQL) - CREATE TABLE #{@table_prefix}_import_privmsgs_temp ( - msg_id MEDIUMINT(8) NOT NULL, - root_msg_id MEDIUMINT(8) NOT NULL, - recipient_id MEDIUMINT(8), - normalized_subject VARCHAR(255) NOT NULL, - PRIMARY KEY (msg_id) - ) - SQL - end - - # this removes duplicate messages, converts the to_address to a number - # and stores the message_subject in lowercase and without the prefix "Re: " - def fill_temp_import_message_table - query(<<-SQL) - INSERT INTO #{@table_prefix}_import_privmsgs_temp (msg_id, root_msg_id, recipient_id, normalized_subject) - SELECT m.msg_id, m.root_level, - CASE WHEN m.root_level = 0 AND INSTR(m.to_address, ':') = 0 THEN - CAST(SUBSTRING(m.to_address, 3) AS SIGNED INTEGER) - ELSE NULL END AS recipient_id, - LOWER(CASE WHEN m.message_subject LIKE 'Re: %' THEN - SUBSTRING(m.message_subject, 5) - ELSE m.message_subject END) AS normalized_subject - FROM #{@table_prefix}_privmsgs m - WHERE NOT EXISTS ( - SELECT 1 - FROM #{@table_prefix}_privmsgs x - WHERE x.msg_id < m.msg_id AND x.root_level = m.root_level AND x.author_id = m.author_id - AND x.to_address = m.to_address AND x.message_time = m.message_time - ) - SQL - end - - def drop_import_message_table - query("DROP TABLE IF EXISTS #{@table_prefix}_import_privmsgs") - end - - def create_import_message_table - query(<<-SQL) - CREATE TABLE #{@table_prefix}_import_privmsgs ( - msg_id MEDIUMINT(8) NOT NULL, - root_msg_id MEDIUMINT(8) NOT NULL, - PRIMARY KEY (msg_id), - INDEX #{@table_prefix}_import_privmsgs_root_msg_id (root_msg_id) - ) - SQL - end - - # this tries to calculate the actual root_level (= msg_id of the first message in a - # private conversation) based on subject, time, author and recipient - def fill_import_message_table - query(<<-SQL) - INSERT INTO #{@table_prefix}_import_privmsgs (msg_id, root_msg_id) - SELECT m.msg_id, CASE WHEN i.root_msg_id = 0 THEN - COALESCE(( - SELECT a.msg_id - FROM #{@table_prefix}_privmsgs a - JOIN #{@table_prefix}_import_privmsgs_temp b ON (a.msg_id = b.msg_id) - WHERE ((a.author_id = m.author_id AND b.recipient_id = i.recipient_id) OR - (a.author_id = i.recipient_id AND b.recipient_id = m.author_id)) - AND b.normalized_subject = i.normalized_subject - AND a.msg_id <> m.msg_id - AND a.message_time < m.message_time - ORDER BY a.message_time - LIMIT 1 - ), 0) ELSE i.root_msg_id END AS root_msg_id - FROM #{@table_prefix}_privmsgs m - JOIN #{@table_prefix}_import_privmsgs_temp i ON (m.msg_id = i.msg_id) - SQL - end end end diff --git a/script/import_scripts/phpbb3/importer.rb b/script/import_scripts/phpbb3/importer.rb index b0c46c870..b9daaa156 100644 --- a/script/import_scripts/phpbb3/importer.rb +++ b/script/import_scripts/phpbb3/importer.rb @@ -118,18 +118,13 @@ module ImportScripts::PhpBB3 end def import_private_messages - if @settings.fix_private_messages - puts '', 'fixing private messages' - @database.calculate_fixed_messages - end - puts '', 'creating private messages' - total_count = @database.count_messages(@settings.fix_private_messages) + total_count = @database.count_messages importer = @importers.message_importer last_msg_id = 0 batches do |offset| - rows, last_msg_id = @database.fetch_messages(@settings.fix_private_messages, last_msg_id) + rows, last_msg_id = @database.fetch_messages(last_msg_id) break if rows.size < 1 next if all_records_exist?(:posts, importer.map_to_import_ids(rows)) diff --git a/script/import_scripts/phpbb3/importers/message_importer.rb b/script/import_scripts/phpbb3/importers/message_importer.rb index 0ebab7d24..c164806b6 100644 --- a/script/import_scripts/phpbb3/importers/message_importer.rb +++ b/script/import_scripts/phpbb3/importers/message_importer.rb @@ -14,7 +14,7 @@ module ImportScripts::PhpBB3 end def map_to_import_ids(rows) - rows.map { |row| get_import_id(row) } + rows.map { |row| get_import_id(row[:msg_id]) } end @@ -23,31 +23,38 @@ module ImportScripts::PhpBB3 attachments = import_attachments(row, user_id) mapped = { - id: get_import_id(row), + id: get_import_id(row[:msg_id]), user_id: user_id, created_at: Time.zone.at(row[:message_time]), raw: @text_processor.process_private_msg(row[:message_text], attachments) } - if row[:root_msg_id] == 0 - map_first_message(row, mapped) + root_user_ids = sorted_user_ids(row[:root_author_id], row[:root_to_address]) + current_user_ids = sorted_user_ids(row[:author_id], row[:to_address]) + topic_id = get_topic_id(row, root_user_ids, current_user_ids) + + if topic_id.blank? + map_first_message(row, current_user_ids, mapped) else - map_other_message(row, mapped) + map_other_message(row, topic_id, mapped) end end protected + RE_PREFIX = 're: ' + def import_attachments(row, user_id) if @settings.import_attachments && row[:attachment_count] > 0 @attachment_importer.import_attachments(user_id, row[:msg_id]) end end - def map_first_message(row, mapped) - mapped[:title] = CGI.unescapeHTML(row[:message_subject]) + def map_first_message(row, current_user_ids, mapped) + mapped[:title] = get_topic_title(row) mapped[:archetype] = Archetype.private_message - mapped[:target_usernames] = get_usernames(row[:msg_id], row[:author_id]) + mapped[:target_usernames] = get_recipient_usernames(row) + mapped[:custom_fields] = {import_user_ids: current_user_ids.join(',')} if mapped[:target_usernames].empty? # pm with yourself? puts "Private message without recipients. Skipping #{row[:msg_id]}: #{row[:message_subject][0..40]}" @@ -57,36 +64,73 @@ module ImportScripts::PhpBB3 mapped end - def map_other_message(row, mapped) - parent_msg_id = "pm:#{row[:root_msg_id]}" - parent = @lookup.topic_lookup_from_imported_post_id(parent_msg_id) - - if parent.blank? - puts "Parent post #{parent_msg_id} doesn't exist. Skipping #{row[:msg_id]}: #{row[:message_subject][0..40]}" - return nil - end - - mapped[:topic_id] = parent[:topic_id] + def map_other_message(row, topic_id, mapped) + mapped[:topic_id] = topic_id mapped end - def get_usernames(msg_id, author_id) - # Find the users who are part of this private message. - # Found from the to_address of phpbb_privmsgs, by looking at - # all the rows with the same root_msg_id. + def get_recipient_user_ids(to_address) + return [] if to_address.blank? + # to_address looks like this: "u_91:u_1234:u_200" # The "u_" prefix is discarded and the rest is a user_id. - import_user_ids = @database.fetch_message_participants(msg_id, @settings.fix_private_messages) - .map { |r| r[:to_address].split(':') } - .flatten!.uniq.map! { |u| u[2..-1] } + user_ids = to_address.split(':') + user_ids.uniq! + user_ids.map! { |u| u[2..-1].to_i } + end + + def get_recipient_usernames(row) + author_id = row[:author_id].to_s + import_user_ids = get_recipient_user_ids(row[:to_address]) import_user_ids.map! do |import_user_id| - import_user_id.to_s == author_id.to_s ? nil : @lookup.find_user_by_import_id(import_user_id).try(:username) + import_user_id.to_s == author_id ? nil : @lookup.find_user_by_import_id(import_user_id).try(:username) end.compact end - def get_import_id(row) - "pm:#{row[:msg_id]}" + def get_topic_title(row) + CGI.unescapeHTML(row[:message_subject]) + end + + def get_import_id(msg_id) + "pm:#{msg_id}" + end + + # Creates a sorted array consisting of the message's author and recipients. + def sorted_user_ids(author_id, to_address) + user_ids = get_recipient_user_ids(to_address) + user_ids << author_id unless author_id.nil? + user_ids.uniq! + user_ids.sort! + end + + def get_topic_id(row, root_user_ids, current_user_ids) + if row[:root_msg_id] == 0 || root_user_ids != current_user_ids + # Let's try to find an existing Discourse topic_id if this looks like a root message or + # the user IDs of the root message are different from the current message. + find_topic_id(row, current_user_ids) + else + # This appears to be a reply. Let's try to find the Discourse topic_id for this message. + parent_msg_id = get_import_id(row[:root_msg_id]) + parent = @lookup.topic_lookup_from_imported_post_id(parent_msg_id) + parent[:topic_id] unless parent.blank? + end + end + + # Tries to find a Discourse topic (private message) that has the same title as the current message. + # The users involved in these messages must match too. + def find_topic_id(row, current_user_ids) + topic_title = get_topic_title(row).downcase + topic_titles = [topic_title] + topic_titles << topic_title[RE_PREFIX.length..-1] if topic_title.start_with?(RE_PREFIX) + + Post.select(:topic_id) + .joins(:topic) + .joins(:_custom_fields) + .where(["LOWER(topics.title) IN (:titles) AND post_custom_fields.name = 'import_user_ids' AND post_custom_fields.value = :user_ids", + {titles: topic_titles, user_ids: current_user_ids.join(',')}]) + .order('topics.created_at DESC') + .first.try(:topic_id) end end end diff --git a/script/import_scripts/phpbb3/settings.yml b/script/import_scripts/phpbb3/settings.yml index 5164270c9..8377860e8 100644 --- a/script/import_scripts/phpbb3/settings.yml +++ b/script/import_scripts/phpbb3/settings.yml @@ -52,12 +52,6 @@ import: private_messages: true polls: true - # This tries to fix Private Messages that were imported from phpBB2 to phpBB3. - # You should enable this option if you see duplicate messages or lots of related - # messages as topics with just one post (e.g. 'Importer', 'Re: Importer', 'Re: Importer' - # should be one topic named 'Importer' and consist of 3 posts). - fix_private_messages: false - # When true: each imported user will have the original username from phpBB as its name # When false: the name of each user will be blank username_as_name: false diff --git a/script/import_scripts/phpbb3/support/settings.rb b/script/import_scripts/phpbb3/support/settings.rb index f7ff71ce9..870c162b7 100644 --- a/script/import_scripts/phpbb3/support/settings.rb +++ b/script/import_scripts/phpbb3/support/settings.rb @@ -18,7 +18,6 @@ module ImportScripts::PhpBB3 attr_reader :import_remote_avatars attr_reader :import_gallery_avatars - attr_reader :fix_private_messages attr_reader :use_bbcode_to_md attr_reader :original_site_prefix @@ -45,7 +44,6 @@ module ImportScripts::PhpBB3 @import_remote_avatars = avatar_settings['remote'] @import_gallery_avatars = avatar_settings['gallery'] - @fix_private_messages = import_settings['fix_private_messages'] @use_bbcode_to_md =import_settings['use_bbcode_to_md'] @original_site_prefix = import_settings['site_prefix']['original'] From f13470b96bcae5a3fd1dd4baa943cc730a922f31 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 4 May 2016 14:02:47 -0400 Subject: [PATCH 014/320] Use db schema for tags instead of plugin store and custom fields --- .../discourse/controllers/rename-tag.js.es6 | 13 +- app/controllers/tags_controller.rb | 65 +++++---- app/helpers/topics_helper.rb | 5 +- app/jobs/onceoff/migrate_tagging_plugin.rb | 16 +++ app/models/tag.rb | 18 +++ app/models/tag_user.rb | 95 +++++++++++++ app/models/topic.rb | 8 +- app/models/topic_tag.rb | 4 + app/models/topic_user.rb | 5 +- app/models/user.rb | 1 + app/serializers/post_revision_serializer.rb | 9 ++ app/serializers/site_serializer.rb | 2 +- app/serializers/topic_list_item_serializer.rb | 2 +- app/serializers/topic_list_serializer.rb | 2 +- app/serializers/topic_view_serializer.rb | 13 +- db/migrate/20160503205953_create_tags.rb | 27 ++++ lib/discourse_tagging.rb | 114 +++++++--------- lib/post_creator.rb | 12 -- lib/post_revisor.rb | 50 +------ lib/pretty_text.rb | 4 +- lib/search.rb | 8 +- lib/topic_creator.rb | 9 ++ lib/topic_query.rb | 15 +++ lib/topics_bulk_action.rb | 7 +- spec/components/post_creator_spec.rb | 53 ++++++++ spec/components/post_revisor_spec.rb | 126 ++++++++++++++++++ spec/components/pretty_text_spec.rb | 6 +- spec/components/search_spec.rb | 10 ++ spec/components/topic_query_spec.rb | 39 ++++++ spec/components/topics_bulk_action_spec.rb | 52 ++++++++ spec/fabricators/tag_fabricator.rb | 3 + spec/models/tag_spec.rb | 32 +++++ spec/models/tag_user_spec.rb | 87 ++++++++++++ 33 files changed, 726 insertions(+), 186 deletions(-) create mode 100644 app/jobs/onceoff/migrate_tagging_plugin.rb create mode 100644 app/models/tag.rb create mode 100644 app/models/tag_user.rb create mode 100644 app/models/topic_tag.rb create mode 100644 db/migrate/20160503205953_create_tags.rb create mode 100644 spec/fabricators/tag_fabricator.rb create mode 100644 spec/models/tag_spec.rb create mode 100644 spec/models/tag_user_spec.rb diff --git a/app/assets/javascripts/discourse/controllers/rename-tag.js.es6 b/app/assets/javascripts/discourse/controllers/rename-tag.js.es6 index 3c5a7bc29..0585d4a6c 100644 --- a/app/assets/javascripts/discourse/controllers/rename-tag.js.es6 +++ b/app/assets/javascripts/discourse/controllers/rename-tag.js.es6 @@ -1,5 +1,6 @@ import ModalFunctionality from 'discourse/mixins/modal-functionality'; import BufferedContent from 'discourse/mixins/buffered-content'; +import { extractError } from 'discourse/lib/ajax-error'; export default Ember.Controller.extend(ModalFunctionality, BufferedContent, { @@ -14,11 +15,15 @@ export default Ember.Controller.extend(ModalFunctionality, BufferedContent, { performRename() { const tag = this.get('model'), self = this; - tag.update({ id: this.get('buffered.id') }).then(function() { + tag.update({ id: this.get('buffered.id') }).then(function(result) { self.send('closeModal'); - self.transitionToRoute('tags.show', tag.get('id')); - }).catch(function() { - self.flash(I18n.t('generic_error'), 'error'); + if (result.responseJson.tag) { + self.transitionToRoute('tags.show', result.responseJson.tag.id); + } else { + self.flash(extractError(result.responseJson.errors[0]), 'error'); + } + }).catch(function(error) { + self.flash(extractError(error), 'error'); }); } } diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 6b08a54f3..23eac8886 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -29,14 +29,11 @@ class TagsController < ::ApplicationController define_method("show_#{filter}") do @tag_id = DiscourseTagging.clean_tag(params[:tag_id]) - # TODO PERF: doesn't scale: - topics_tagged = TopicCustomField.where(name: DiscourseTagging::TAGS_FIELD_NAME, value: @tag_id).pluck(:topic_id) - page = params[:page].to_i query = TopicQuery.new(current_user, build_topic_list_options) - results = query.send("#{filter}_results").where(id: topics_tagged) + results = query.send("#{filter}_results") if @filter_on_category category_ids = [@filter_on_category.id] + @filter_on_category.subcategories.pluck(:id) @@ -52,8 +49,7 @@ class TagsController < ::ApplicationController @list.more_topics_url = list_by_tag_path(tag_id: @tag_id, page: page + 1) @rss = "tag" - - if @list.topics.size == 0 && !TopicCustomField.where(name: DiscourseTagging::TAGS_FIELD_NAME, value: @tag_id).exists? + if @list.topics.size == 0 && !Tag.where(name: @tag_id).exists? raise Discourse::NotFound else respond_with_list(@list) @@ -68,20 +64,25 @@ class TagsController < ::ApplicationController def update guardian.ensure_can_admin_tags! - new_tag_id = DiscourseTagging.clean_tag(params[:tag][:id]) - if current_user.staff? - DiscourseTagging.rename_tag(current_user, params[:tag_id], new_tag_id) + tag = Tag.find_by_name(params[:tag_id]) + raise Discourse::NotFound if tag.nil? + + new_tag_name = DiscourseTagging.clean_tag(params[:tag][:id]) + tag.name = new_tag_name + if tag.save + StaffActionLogger.new(current_user).log_custom('renamed_tag', previous_value: params[:tag_id], new_value: new_tag_name) + render json: { tag: { id: new_tag_name }} + else + render_json_error tag.errors.full_messages end - render json: { tag: { id: new_tag_id }} end def destroy guardian.ensure_can_admin_tags! - tag_id = params[:tag_id] + tag_name = params[:tag_id] TopicCustomField.transaction do - TopicCustomField.where(name: DiscourseTagging::TAGS_FIELD_NAME, value: tag_id).delete_all - UserCustomField.delete_all(name: ::DiscourseTagging.notification_key(tag_id)) - StaffActionLogger.new(current_user).log_custom('deleted_tag', subject: tag_id) + Tag.find_by_name(tag_name).destroy + StaffActionLogger.new(current_user).log_custom('deleted_tag', subject: tag_name) end render json: success_json end @@ -89,45 +90,45 @@ class TagsController < ::ApplicationController def tag_feed discourse_expires_in 1.minute - tag_id = ::DiscourseTagging.clean_tag(params[:tag_id]) + tag_id = DiscourseTagging.clean_tag(params[:tag_id]) @link = "#{Discourse.base_url}/tags/#{tag_id}" @description = I18n.t("rss_by_tag", tag: tag_id) @title = "#{SiteSetting.title} - #{@description}" @atom_link = "#{Discourse.base_url}/tags/#{tag_id}.rss" - query = TopicQuery.new(current_user) - topics_tagged = TopicCustomField.where(name: DiscourseTagging::TAGS_FIELD_NAME, value: tag_id).pluck(:topic_id) - latest_results = query.latest_results.where(id: topics_tagged) + query = TopicQuery.new(current_user, {tags: [tag_id]}) + latest_results = query.latest_results @topic_list = query.create_list(:by_tag, {}, latest_results) render 'list/list', formats: [:rss] end def search - tags = self.class.tags_by_count(guardian, params.slice(:limit)) + query = self.class.tags_by_count(guardian, params.slice(:limit)) term = params[:q] if term.present? term.gsub!(/[^a-z0-9\.\-\_]*/, '') term.gsub!("_", "\\_") - tags = tags.where('value like ?', "%#{term}%") + query = query.where('tags.name like ?', "%#{term}%") end - tags = tags.count(:value).map {|t, c| { id: t, text: t, count: c } } + tags = query.count.map {|t, c| { id: t, text: t, count: c } } render json: { results: tags } end def notifications - level = current_user.custom_fields[::DiscourseTagging.notification_key(params[:tag_id])] || 1 + tag = Tag.find_by_name(params[:tag_id]) + raise Discourse::NotFound unless tag + level = tag.tag_users.where(user: current_user).first.try(:notification_level) || TagUser.notification_levels[:regular] render json: { tag_notification: { id: params[:tag_id], notification_level: level.to_i } } end def update_notifications + tag = Tag.find_by_name(params[:tag_id]) + raise Discourse::NotFound unless tag level = params[:tag_notification][:notification_level].to_i - - current_user.custom_fields[::DiscourseTagging.notification_key(params[:tag_id])] = level - current_user.save_custom_fields - + TagUser.change(current_user.id, tag.id, level) render json: {notification_level: level} end @@ -147,15 +148,8 @@ class TagsController < ::ApplicationController raise Discourse::NotFound unless SiteSetting.tagging_enabled? end - def self.tags_by_count(guardian, opts=nil) - opts = opts || {} - result = TopicCustomField.where(name: DiscourseTagging::TAGS_FIELD_NAME) - .joins(:topic) - .group(:value) - .limit(opts[:limit] || 5) - .order('COUNT(topic_custom_fields.value) DESC') - - guardian.filter_allowed_categories(result) + def self.tags_by_count(guardian, opts={}) + guardian.filter_allowed_categories(Tag.tags_by_count_query(opts)) end def set_category_from_params @@ -182,6 +176,7 @@ class TagsController < ::ApplicationController topic_ids: param_to_integer_list(:topic_ids), exclude_category_ids: params[:exclude_category_ids], category: params[:category], + tags: [params[:tag_id]], order: params[:order], ascending: params[:ascending], min_posts: params[:min_posts], diff --git a/app/helpers/topics_helper.rb b/app/helpers/topics_helper.rb index a92617e80..857e1fc90 100644 --- a/app/helpers/topics_helper.rb +++ b/app/helpers/topics_helper.rb @@ -17,9 +17,8 @@ module TopicsHelper if (tags = topic.tags).present? tags.each do |tag| - tag_id = DiscourseTagging.clean_tag(tag) - url = "#{Discourse.base_url}/tags/#{tag_id}" - breadcrumb << {url: url, name: tag} + url = "#{Discourse.base_url}/tags/#{tag.name}" + breadcrumb << {url: url, name: tag.name} end end diff --git a/app/jobs/onceoff/migrate_tagging_plugin.rb b/app/jobs/onceoff/migrate_tagging_plugin.rb new file mode 100644 index 000000000..f0bb91e7e --- /dev/null +++ b/app/jobs/onceoff/migrate_tagging_plugin.rb @@ -0,0 +1,16 @@ +module Jobs + + class MigrateTaggingPlugin < Jobs::Onceoff + + def execute_onceoff(args) + all_tags = TopicCustomField.where(name: "tags").select('DISTINCT value').all.map(&:value) + tag_id_lookup = Tag.create(all_tags.map { |tag_name| {name: tag_name} }).inject({}) { |h,v| h[v.name] = v.id; h } + + TopicCustomField.where(name: "tags").find_each do |tcf| + TopicTag.create(topic_id: tcf.topic_id, tag_id: tag_id_lookup[tcf.value] || Tag.find_by_name(tcf.value).try(:id)) + end + end + + end + +end diff --git a/app/models/tag.rb b/app/models/tag.rb new file mode 100644 index 000000000..bb628d38f --- /dev/null +++ b/app/models/tag.rb @@ -0,0 +1,18 @@ +class Tag < ActiveRecord::Base + validates :name, presence: true, uniqueness: true + has_many :topic_tags, dependent: :destroy + has_many :topics, through: :topic_tags + has_many :tag_users + + def self.tags_by_count_query(opts={}) + q = TopicTag.joins(:tag, :topic).group("topic_tags.tag_id, tags.name").order('count_all DESC') + q = q.limit(opts[:limit]) if opts[:limit] + q + end + + def self.top_tags(limit_arg=nil) + self.tags_by_count_query(limit: limit_arg || SiteSetting.max_tags_in_filter_list) + .count + .map {|name, count| name} + end +end diff --git a/app/models/tag_user.rb b/app/models/tag_user.rb new file mode 100644 index 000000000..1abd68ea0 --- /dev/null +++ b/app/models/tag_user.rb @@ -0,0 +1,95 @@ +class TagUser < ActiveRecord::Base + belongs_to :tag + belongs_to :user + + def self.notification_levels + TopicUser.notification_levels + end + + def self.change(user_id, tag_id, level) + tag_id = tag_id.id if tag_id.is_a?(::Tag) + user_id = user_id.id if user_id.is_a?(::User) + + tag_id = tag_id.to_i + user_id = user_id.to_i + + tag_user = TagUser.where(user_id: user_id, tag_id: tag_id).first + + if tag_user + return tag_user if tag_user.notification_level == level + tag_user.notification_level = level + tag_user.save + else + tag_user = TagUser.create(user_id: user_id, tag_id: tag_id, notification_level: level) + end + + tag_user + rescue ActiveRecord::RecordNotUnique + # In case of a race condition to insert, do nothing + end + + %w{watch track}.each do |s| + define_singleton_method("auto_#{s}_new_topic") do |topic, new_tags=nil| + tag_ids = topic.tags.pluck(:id) + if !new_tags.nil? && topic.created_at && topic.created_at > 5.days.ago + tag_ids = new_tags.map(&:id) + remove_default_from_topic( topic.id, tag_ids, + TopicUser.notification_levels[:"#{s}ing"], + TopicUser.notification_reasons[:"auto_#{s}_tag"] ) + end + + apply_default_to_topic( topic.id, tag_ids, + TopicUser.notification_levels[:"#{s}ing"], + TopicUser.notification_reasons[:"auto_#{s}_tag"]) + end + end + + def self.apply_default_to_topic(topic_id, tag_ids, level, reason) + sql = <<-SQL + INSERT INTO topic_users(user_id, topic_id, notification_level, notifications_reason_id) + SELECT user_id, :topic_id, :level, :reason + FROM tag_users + WHERE notification_level = :level + AND tag_id in (:tag_ids) + AND NOT EXISTS(SELECT 1 FROM topic_users WHERE topic_id = :topic_id AND user_id = tag_users.user_id) + LIMIT 1 + SQL + + exec_sql(sql, + topic_id: topic_id, + tag_ids: tag_ids, + level: level, + reason: reason + ) + end + + def self.remove_default_from_topic(topic_id, tag_ids, level, reason) + sql = <<-SQL + DELETE FROM topic_users + WHERE topic_id = :topic_id + AND notifications_changed_at IS NULL + AND notification_level = :level + AND notifications_reason_id = :reason + SQL + + if !tag_ids.empty? + sql << <<-SQL + AND NOT EXISTS( + SELECT 1 + FROM tag_users + WHERE tag_users.tag_id in (:tag_ids) + AND tag_users.notification_level = :level + AND tag_users.user_id = topic_users.user_id) + SQL + end + + exec_sql(sql, + topic_id: topic_id, + level: level, + reason: reason, + tag_ids: tag_ids + ) + end + + private_class_method :apply_default_to_topic, :remove_default_from_topic +end diff --git a/app/models/topic.rb b/app/models/topic.rb index 2fc448405..5694d3c0c 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -92,6 +92,9 @@ class Topic < ActiveRecord::Base has_many :allowed_users, through: :topic_allowed_users, source: :user has_many :queued_posts + has_many :topic_tags, dependent: :destroy + has_many :tags, through: :topic_tags + has_one :top_topic belongs_to :user belongs_to :last_poster, class_name: 'User', foreign_key: :last_post_user_id @@ -1042,11 +1045,6 @@ SQL builder.exec.first["count"].to_i end - def tags - result = custom_fields[DiscourseTagging::TAGS_FIELD_NAME] - [result].flatten unless result.blank? - end - def convert_to_public_topic(user) public_topic = TopicConverter.new(self, user).convert_to_public_topic add_small_action(user, "public_topic") if public_topic diff --git a/app/models/topic_tag.rb b/app/models/topic_tag.rb new file mode 100644 index 000000000..9882ddf24 --- /dev/null +++ b/app/models/topic_tag.rb @@ -0,0 +1,4 @@ +class TopicTag < ActiveRecord::Base + belongs_to :topic + belongs_to :tag, counter_cache: "topic_count" +end diff --git a/app/models/topic_user.rb b/app/models/topic_user.rb index 5d0919de8..78480319c 100644 --- a/app/models/topic_user.rb +++ b/app/models/topic_user.rb @@ -32,7 +32,10 @@ class TopicUser < ActiveRecord::Base auto_watch_category: 6, auto_mute_category: 7, auto_track_category: 8, - plugin_changed: 9) + plugin_changed: 9, + auto_watch_tag: 10, + auto_mute_tag: 11, + auto_track_tag: 12) end def auto_track(user_id, topic_id, reason) diff --git a/app/models/user.rb b/app/models/user.rb index a410a7116..4b20b9718 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -18,6 +18,7 @@ class User < ActiveRecord::Base has_many :notifications, dependent: :destroy has_many :topic_users, dependent: :destroy has_many :category_users, dependent: :destroy + has_many :tag_users, dependent: :destroy has_many :topics has_many :user_open_ids, dependent: :destroy has_many :user_actions, dependent: :destroy diff --git a/app/serializers/post_revision_serializer.rb b/app/serializers/post_revision_serializer.rb index 383d4142e..d1c935411 100644 --- a/app/serializers/post_revision_serializer.rb +++ b/app/serializers/post_revision_serializer.rb @@ -41,6 +41,7 @@ class PostRevisionSerializer < ApplicationSerializer end add_compared_field :wiki + add_compared_field :tags def previous_hidden previous["hidden"] @@ -149,6 +150,10 @@ class PostRevisionSerializer < ApplicationSerializer } end + def include_tags_changes? + SiteSetting.tagging_enabled + end + protected def post @@ -184,6 +189,10 @@ class PostRevisionSerializer < ApplicationSerializer end end + if SiteSetting.tagging_enabled + latest_modifications["tags"] = post.topic.tags.map(&:name) + end + post_revisions << PostRevision.new( number: post_revisions.last.number + 1, hidden: post.hidden, diff --git a/app/serializers/site_serializer.rb b/app/serializers/site_serializer.rb index d49257b14..74b4929a3 100644 --- a/app/serializers/site_serializer.rb +++ b/app/serializers/site_serializer.rb @@ -106,7 +106,7 @@ class SiteSerializer < ApplicationSerializer SiteSetting.tagging_enabled && SiteSetting.show_filter_by_tag end def top_tags - DiscourseTagging.top_tags + Tag.top_tags end end diff --git a/app/serializers/topic_list_item_serializer.rb b/app/serializers/topic_list_item_serializer.rb index 5a8ac8d37..d3763cef1 100644 --- a/app/serializers/topic_list_item_serializer.rb +++ b/app/serializers/topic_list_item_serializer.rb @@ -68,7 +68,7 @@ class TopicListItemSerializer < ListableTopicSerializer SiteSetting.tagging_enabled end def tags - object.tags + object.tags.map(&:name) end end diff --git a/app/serializers/topic_list_serializer.rb b/app/serializers/topic_list_serializer.rb index f932b644d..c0321c705 100644 --- a/app/serializers/topic_list_serializer.rb +++ b/app/serializers/topic_list_serializer.rb @@ -27,7 +27,7 @@ class TopicListSerializer < ApplicationSerializer SiteSetting.tagging_enabled && SiteSetting.show_filter_by_tag end def tags - DiscourseTagging.top_tags + Tag.top_tags end end diff --git a/app/serializers/topic_view_serializer.rb b/app/serializers/topic_view_serializer.rb index b30d0c9e6..c44d44cac 100644 --- a/app/serializers/topic_view_serializer.rb +++ b/app/serializers/topic_view_serializer.rb @@ -33,8 +33,7 @@ class TopicViewSerializer < ApplicationSerializer :word_count, :deleted_at, :pending_posts_count, - :user_id, - :tags + :user_id attributes :draft, :draft_key, @@ -55,7 +54,8 @@ class TopicViewSerializer < ApplicationSerializer :is_warning, :chunk_size, :bookmarked, - :message_archived + :message_archived, + :tags # TODO: Split off into proper object / serializer def details @@ -231,4 +231,11 @@ class TopicViewSerializer < ApplicationSerializer scope.is_staff? && NewPostManager.queue_enabled? end + def include_tags? + SiteSetting.tagging_enabled + end + def tags + object.topic.tags.map(&:name) + end + end diff --git a/db/migrate/20160503205953_create_tags.rb b/db/migrate/20160503205953_create_tags.rb new file mode 100644 index 000000000..6af853f73 --- /dev/null +++ b/db/migrate/20160503205953_create_tags.rb @@ -0,0 +1,27 @@ +class CreateTags < ActiveRecord::Migration + def change + create_table :tags do |t| + t.string :name, null: false + t.integer :topic_count, null: false, default: 0 + t.timestamps + end + + create_table :topic_tags do |t| + t.references :topic, null: false + t.references :tag, null: false + t.timestamps + end + + create_table :tag_users do |t| + t.references :tag, null: false + t.references :user, null: false + t.integer :notification_level, null: false + t.timestamps + end + + add_index :tags, :name, unique: true + add_index :topic_tags, [:topic_id, :tag_id], unique: true + add_index :tag_users, [:user_id, :tag_id, :notification_level], name: "idx_tag_users_ix1", unique: true + add_index :tag_users, [:tag_id, :user_id, :notification_level], name: "idx_tag_users_ix2", unique: true + end +end diff --git a/lib/discourse_tagging.rb b/lib/discourse_tagging.rb index 16d2625c0..cb5ce1d7c 100644 --- a/lib/discourse_tagging.rb +++ b/lib/discourse_tagging.rb @@ -8,6 +8,55 @@ module DiscourseTagging # isolate_namespace DiscourseTagging # end + def self.tag_topic_by_names(topic, guardian, tag_names_arg) + if SiteSetting.tagging_enabled + tag_names = DiscourseTagging.tags_for_saving(tag_names_arg, guardian) || [] + + old_tag_names = topic.tags.map(&:name) || [] + new_tag_names = tag_names - old_tag_names + removed_tag_names = old_tag_names - tag_names + + # Protect staff-only tags + unless guardian.is_staff? + staff_tags = DiscourseTagging.staff_only_tags(new_tag_names) + if staff_tags.present? + topic.errors[:base] << I18n.t("tags.staff_tag_disallowed", tag: staff_tags.join(" ")) + return false + end + + staff_tags = DiscourseTagging.staff_only_tags(removed_tag_names) + if staff_tags.present? + topic.errors[:base] << I18n.t("tags.staff_tag_remove_disallowed", tag: staff_tags.join(" ")) + return false + end + end + + if tag_names.present? + tags = Tag.where(name: tag_names).all + if tags.size < tag_names.size + existing_names = tags.map(&:name) + tag_names.each do |name| + next if existing_names.include?(name) + tags << Tag.create(name: name) + end + end + + auto_notify_for(tags, topic) + + topic.tags = tags + else + auto_notify_for([], topic) + topic.tags = [] + end + end + true + end + + def self.auto_notify_for(tags, topic) + TagUser.auto_watch_new_topic(topic, tags) + TagUser.auto_track_new_topic(topic, tags) + end + def self.clean_tag(tag) tag.downcase.strip[0...SiteSetting.max_tag_length].gsub(TAGS_FILTER_REGEXP, '') end @@ -36,8 +85,7 @@ module DiscourseTagging # If the user can't create tags, remove any tags that don't already exist # TODO: this is doing a full count, it should just check first or use a cache unless guardian.can_create_tag? - tag_count = TopicCustomField.where(name: TAGS_FIELD_NAME, value: tags).group(:value).count - tags.delete_if {|t| !tag_count.has_key?(t) } + tags = Tag.where(name: tags).pluck(:name) end return tags[0...SiteSetting.max_tags_per_topic] @@ -47,68 +95,6 @@ module DiscourseTagging "tags_notification:#{tag_id}" end - def self.auto_notify_for(tags, topic) - # This insert will run up to SiteSetting.max_tags_per_topic times - tags.each do |tag| - key_name_sql = ActiveRecord::Base.sql_fragment("('#{notification_key(tag)}')", tag) - - sql = <<-SQL - INSERT INTO topic_users(user_id, topic_id, notification_level, notifications_reason_id) - SELECT ucf.user_id, - #{topic.id.to_i}, - CAST(ucf.value AS INTEGER), - #{TopicUser.notification_reasons[:plugin_changed]} - FROM user_custom_fields AS ucf - WHERE ucf.name IN #{key_name_sql} - AND NOT EXISTS(SELECT 1 FROM topic_users WHERE topic_id = #{topic.id.to_i} AND user_id = ucf.user_id) - AND CAST(ucf.value AS INTEGER) <> #{TopicUser.notification_levels[:regular]} - SQL - - ActiveRecord::Base.exec_sql(sql) - end - end - - def self.rename_tag(current_user, old_id, new_id) - sql = <<-SQL - UPDATE topic_custom_fields AS tcf - SET value = :new_id - WHERE value = :old_id - AND name = :tags_field_name - AND NOT EXISTS(SELECT 1 - FROM topic_custom_fields - WHERE value = :new_id AND name = :tags_field_name AND topic_id = tcf.topic_id) - SQL - - user_sql = <<-SQL - UPDATE user_custom_fields - SET name = :new_user_tag_id - WHERE name = :old_user_tag_id - AND NOT EXISTS(SELECT 1 - FROM user_custom_fields - WHERE name = :new_user_tag_id) - SQL - - ActiveRecord::Base.transaction do - ActiveRecord::Base.exec_sql(sql, new_id: new_id, old_id: old_id, tags_field_name: TAGS_FIELD_NAME) - TopicCustomField.delete_all(name: TAGS_FIELD_NAME, value: old_id) - ActiveRecord::Base.exec_sql(user_sql, new_user_tag_id: notification_key(new_id), - old_user_tag_id: notification_key(old_id)) - UserCustomField.delete_all(name: notification_key(old_id)) - StaffActionLogger.new(current_user).log_custom('renamed_tag', previous_value: old_id, new_value: new_id) - end - end - - def self.top_tags(limit_arg=nil) - # TODO: cache - # TODO: need an index for this (name,value) - TopicCustomField.where(name: TAGS_FIELD_NAME) - .group(:value) - .limit(limit_arg || SiteSetting.max_tags_in_filter_list) - .order('COUNT(value) DESC') - .count - .map {|name, count| name} - end - def self.muted_tags(user) return [] unless user UserCustomField.where(user_id: user.id, value: TopicUser.notification_levels[:muted]).pluck(:name).map { |x| x[0,17] == "tags_notification" ? x[18..-1] : nil}.compact diff --git a/lib/post_creator.rb b/lib/post_creator.rb index 005932a8e..47d154037 100644 --- a/lib/post_creator.rb +++ b/lib/post_creator.rb @@ -147,7 +147,6 @@ class PostCreator track_latest_on_category enqueue_jobs BadgeGranter.queue_badge_grant(Badge::Trigger::PostRevision, post: @post) - auto_notify_for_tags trigger_after_events(@post) @@ -439,17 +438,6 @@ class PostCreator PostJobsEnqueuer.new(@post, @topic, new_topic?, {import_mode: @opts[:import_mode]}).enqueue_jobs end - def auto_notify_for_tags - if SiteSetting.tagging_enabled - tags = DiscourseTagging.tags_for_saving(@opts[:tags], @guardian) - if tags.present? - @topic.custom_fields.update(DiscourseTagging::TAGS_FIELD_NAME => tags) - @topic.save - DiscourseTagging.auto_notify_for(tags, @topic) - end - end - end - def new_topic? @opts[:topic_id].blank? end diff --git a/lib/post_revisor.rb b/lib/post_revisor.rb index d1fb4bcea..ec7871349 100644 --- a/lib/post_revisor.rb +++ b/lib/post_revisor.rb @@ -72,51 +72,15 @@ class PostRevisor tc.check_result(tc.topic.change_category_to_id(category_id)) end - track_topic_field(:tags_empty_array) do |tc, val| - if val.present? - unless tc.guardian.is_staff? - old_tags = tc.topic.tags || [] - staff_tags = DiscourseTagging.staff_only_tags(old_tags) - if staff_tags.present? - tc.topic.errors[:base] << I18n.t("tags.staff_tag_remove_disallowed", tag: staff_tags.join(" ")) - tc.check_result(false) - next - end - end - - tc.record_change(DiscourseTagging::TAGS_FIELD_NAME, tc.topic.custom_fields[DiscourseTagging::TAGS_FIELD_NAME], nil) - tc.topic.custom_fields.delete(DiscourseTagging::TAGS_FIELD_NAME) - end - end - track_topic_field(:tags) do |tc, tags| - if tags.present? && tc.guardian.can_tag_topics? - tags = DiscourseTagging.tags_for_saving(tags, tc.guardian) - old_tags = tc.topic.tags || [] - - new_tags = tags - old_tags - removed_tags = old_tags - tags - - unless tc.guardian.is_staff? - staff_tags = DiscourseTagging.staff_only_tags(new_tags) - if staff_tags.present? - tc.topic.errors[:base] << I18n.t("tags.staff_tag_disallowed", tag: staff_tags.join(" ")) - tc.check_result(false) - next - end - - staff_tags = DiscourseTagging.staff_only_tags(removed_tags) - if staff_tags.present? - tc.topic.errors[:base] << I18n.t("tags.staff_tag_remove_disallowed", tag: staff_tags.join(" ")) - tc.check_result(false) - next - end + if tc.guardian.can_tag_topics? + prev_tags = tc.topic.tags.map(&:name) + next if tags.blank? && prev_tags.blank? + if !DiscourseTagging.tag_topic_by_names(tc.topic, tc.guardian, tags) + tc.check_result(false) + next end - - tc.record_change(DiscourseTagging::TAGS_FIELD_NAME, tc.topic.custom_fields[DiscourseTagging::TAGS_FIELD_NAME], tags) - tc.topic.custom_fields.update(DiscourseTagging::TAGS_FIELD_NAME => tags) - - DiscourseTagging.auto_notify_for(new_tags, tc.topic) if new_tags.present? + tc.record_change('tags', prev_tags, tags) end end diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb index e1341006f..9551a4197 100644 --- a/lib/pretty_text.rb +++ b/lib/pretty_text.rb @@ -77,8 +77,8 @@ module PrettyText if !is_tag && category = Category.query_from_hashtag_slug(text) [category.url_with_id, text] - elsif is_tag && tag = TopicCustomField.find_by(name: DiscourseTagging::TAGS_FIELD_NAME, value: text.gsub!("#{tag_postfix}", '')) - ["#{Discourse.base_url}/tags/#{tag.value}", text] + elsif is_tag && tag = Tag.find_by_name(text.gsub!("#{tag_postfix}", '')) + ["#{Discourse.base_url}/tags/#{tag.name}", text] else nil end diff --git a/lib/search.rb b/lib/search.rb index 22cb3f79c..4de9c8a52 100644 --- a/lib/search.rb +++ b/lib/search.rb @@ -348,10 +348,10 @@ class Search tags = match.split(",") posts.where("topics.id IN ( - SELECT tc.topic_id - FROM topic_custom_fields tc - WHERE tc.name = '#{DiscourseTagging::TAGS_FIELD_NAME}' AND - tc.value in (?) + SELECT DISTINCT(tt.topic_id) + FROM topic_tags tt, tags + WHERE tt.tag_id = tags.id + AND tags.name in (?) )", tags) end diff --git a/lib/topic_creator.rb b/lib/topic_creator.rb index 53409a183..1e683f5b4 100644 --- a/lib/topic_creator.rb +++ b/lib/topic_creator.rb @@ -39,6 +39,8 @@ class TopicCreator def create topic = Topic.new(setup_topic_params) + setup_tags(topic) + DiscourseEvent.trigger(:before_create_topic, topic, self) setup_auto_close_time(topic) @@ -90,8 +92,11 @@ class TopicCreator end unless topic.private_message? + # In order of importance: CategoryUser.auto_watch_new_topic(topic) CategoryUser.auto_track_new_topic(topic) + TagUser.auto_watch_new_topic(topic) + TagUser.auto_track_new_topic(topic) end end @@ -141,6 +146,10 @@ class TopicCreator end end + def setup_tags(topic) + DiscourseTagging.tag_topic_by_names(topic, @guardian, @opts[:tags]) + end + def setup_auto_close_time(topic) return unless @opts[:auto_close_time].present? return unless @guardian.can_moderate?(topic) diff --git a/lib/topic_query.rb b/lib/topic_query.rb index 8c9ba0d1a..65696d64c 100644 --- a/lib/topic_query.rb +++ b/lib/topic_query.rb @@ -20,6 +20,7 @@ class TopicQuery topic_ids visible category + tags order ascending no_subcategories @@ -451,6 +452,20 @@ class TopicQuery result = result.references(:categories) end + # ALL TAGS: something like this? + # Topic.joins(:tags).where('tags.name in (?)', @options[:tags]).group('topic_id').having('count(*)=?', @options[:tags].size).select('topic_id') + + if @options[:tags] && @options[:tags].size > 0 + result = result.joins(:tags).preload(:tags) + + # ANY of the given tags: + if @options[:tags][0].is_a?(Integer) + result = result.where("tags.id in (?)", @options[:tags]) + else + result = result.where("tags.name in (?)", @options[:tags]) + end + end + result = apply_ordering(result, options) result = result.listable_topics.includes(:category) diff --git a/lib/topics_bulk_action.rb b/lib/topics_bulk_action.rb index 36c17f228..2b3709113 100644 --- a/lib/topics_bulk_action.rb +++ b/lib/topics_bulk_action.rb @@ -137,12 +137,11 @@ class TopicsBulkAction topics.each do |t| if guardian.can_edit?(t) if tags.present? - t.custom_fields.update(DiscourseTagging::TAGS_FIELD_NAME => tags) - t.save - DiscourseTagging.auto_notify_for(tags, t) + DiscourseTagging.tag_topic_by_names(t, guardian, tags) else - t.custom_fields.delete(DiscourseTagging::TAGS_FIELD_NAME) + t.tags = [] end + @changed_ids << t.id end end end diff --git a/spec/components/post_creator_spec.rb b/spec/components/post_creator_spec.rb index 1b3c59399..1c647fef7 100644 --- a/spec/components/post_creator_spec.rb +++ b/spec/components/post_creator_spec.rb @@ -265,6 +265,59 @@ describe PostCreator do end + context "tags" do + let(:tag_names) { ['art', 'science', 'dance'] } + let(:creator_with_tags) { PostCreator.new(user, basic_topic_params.merge(tags: tag_names)) } + + context "tagging disabled" do + before do + SiteSetting.tagging_enabled = false + end + + it "doesn't create tags" do + expect { @post = creator_with_tags.create }.to change { Tag.count }.by(0) + expect(@post.topic.tags.size).to eq(0) + end + end + + context "tagging enabled" do + before do + SiteSetting.tagging_enabled = true + end + + context "can create tags" do + before do + SiteSetting.min_trust_to_create_tag = 0 + SiteSetting.min_trust_level_to_tag_topics = 0 + end + + it "can create all tags if none exist" do + expect { @post = creator_with_tags.create }.to change { Tag.count }.by( tag_names.size ) + expect(@post.topic.tags.map(&:name).sort).to eq(tag_names.sort) + end + + it "creates missing tags if some exist" do + existing_tag1 = Fabricate(:tag, name: tag_names[0]) + existing_tag1 = Fabricate(:tag, name: tag_names[1]) + expect { @post = creator_with_tags.create }.to change { Tag.count }.by( tag_names.size - 2 ) + expect(@post.topic.tags.map(&:name).sort).to eq(tag_names.sort) + end + end + + context "cannot create tags" do + before do + SiteSetting.min_trust_to_create_tag = 4 + SiteSetting.min_trust_level_to_tag_topics = 0 + end + + it "only uses existing tags" do + existing_tag1 = Fabricate(:tag, name: tag_names[1]) + expect { @post = creator_with_tags.create }.to change { Tag.count }.by(0) + expect(@post.topic.tags.map(&:name)).to eq([existing_tag1.name]) + end + end + end + end end context 'when auto-close param is given' do diff --git a/spec/components/post_revisor_spec.rb b/spec/components/post_revisor_spec.rb index c88e7e78e..9cf5b3ee5 100644 --- a/spec/components/post_revisor_spec.rb +++ b/spec/components/post_revisor_spec.rb @@ -362,5 +362,131 @@ describe PostRevisor do expect(payload[:reload_topic]).to eq(true) end end + + context "tagging" do + context "tagging disabled" do + before do + SiteSetting.tagging_enabled = false + end + + it "doesn't add the tags" do + result = subject.revise!(Fabricate(:user), { raw: "lets totally update the body", tags: ['totally', 'update'] }) + expect(result).to eq(true) + post.reload + expect(post.topic.tags.size).to eq(0) + end + end + + context "tagging enabled" do + before do + SiteSetting.tagging_enabled = true + end + + context "can create tags" do + before do + SiteSetting.min_trust_to_create_tag = 0 + SiteSetting.min_trust_level_to_tag_topics = 0 + end + + it "can create all tags if none exist" do + expect { + @result = subject.revise!(Fabricate(:user), { raw: "lets totally update the body", tags: ['totally', 'update'] }) + }.to change { Tag.count }.by(2) + expect(@result).to eq(true) + post.reload + expect(post.topic.tags.map(&:name).sort).to eq(['totally', 'update']) + end + + it "creates missing tags if some exist" do + Fabricate(:tag, name: 'totally') + expect { + @result = subject.revise!(Fabricate(:user), { raw: "lets totally update the body", tags: ['totally', 'update'] }) + }.to change { Tag.count }.by(1) + expect(@result).to eq(true) + post.reload + expect(post.topic.tags.map(&:name).sort).to eq(['totally', 'update']) + end + + it "can remove all tags" do + topic.tags = [Fabricate(:tag, name: "super"), Fabricate(:tag, name: "stuff")] + result = subject.revise!(Fabricate(:user), { raw: "lets totally update the body", tags: [] }) + expect(result).to eq(true) + post.reload + expect(post.topic.tags.size).to eq(0) + end + + it "can't add staff-only tags" do + SiteSetting.staff_tags = "important" + result = subject.revise!(Fabricate(:user), { raw: "lets totally update the body", tags: ['important', 'stuff'] }) + expect(result).to eq(false) + expect(post.topic.errors.present?).to eq(true) + end + + it "staff can add staff-only tags" do + SiteSetting.staff_tags = "important" + result = subject.revise!(Fabricate(:admin), { raw: "lets totally update the body", tags: ['important', 'stuff'] }) + expect(result).to eq(true) + post.reload + expect(post.topic.tags.map(&:name).sort).to eq(['important', 'stuff']) + end + + context "with staff-only tags" do + before do + SiteSetting.staff_tags = "important" + topic = post.topic + topic.tags = [Fabricate(:tag, name: "super"), Fabricate(:tag, name: "important"), Fabricate(:tag, name: "stuff")] + end + + it "staff-only tags can't be removed" do + result = subject.revise!(Fabricate(:user), { raw: "lets totally update the body", tags: ['stuff'] }) + expect(result).to eq(false) + expect(post.topic.errors.present?).to eq(true) + post.reload + expect(post.topic.tags.map(&:name).sort).to eq(['important', 'stuff', 'super']) + end + + it "can't remove all tags if some are staff-only" do + result = subject.revise!(Fabricate(:user), { raw: "lets totally update the body", tags: [] }) + expect(result).to eq(false) + expect(post.topic.errors.present?).to eq(true) + post.reload + expect(post.topic.tags.map(&:name).sort).to eq(['important', 'stuff', 'super']) + end + + it "staff-only tags can be removed by staff" do + result = subject.revise!(Fabricate(:admin), { raw: "lets totally update the body", tags: ['stuff'] }) + expect(result).to eq(true) + post.reload + expect(post.topic.tags.map(&:name)).to eq(['stuff']) + end + + it "staff can remove all tags" do + result = subject.revise!(Fabricate(:admin), { raw: "lets totally update the body", tags: [] }) + expect(result).to eq(true) + post.reload + expect(post.topic.tags.size).to eq(0) + end + end + + end + + context "cannot create tags" do + before do + SiteSetting.min_trust_to_create_tag = 4 + SiteSetting.min_trust_level_to_tag_topics = 0 + end + + it "only uses existing tags" do + Fabricate(:tag, name: 'totally') + expect { + @result = subject.revise!(Fabricate(:user), { raw: "lets totally update the body", tags: ['totally', 'update'] }) + }.to_not change { Tag.count } + expect(@result).to eq(true) + post.reload + expect(post.topic.tags.map(&:name)).to eq(['totally']) + end + end + end + end end end diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index d66de2138..430bf7bad 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -417,12 +417,12 @@ HTML describe "tag and category links" do it "produces tag links" do - # TODO where is our tags table? - TopicCustomField.create!(topic_id: 1, name: DiscourseTagging::TAGS_FIELD_NAME, value: "known") - # TODO does it make sense to generate hashtags for tags that are missing in action? + Fabricate(:topic, {tags: [Fabricate(:tag, name: 'known')]}) expect(PrettyText.cook(" #unknown::tag #known::tag")).to match_html("

#unknown::tag #known

") end + # TODO does it make sense to generate hashtags for tags that are missing in action? + end end diff --git a/spec/components/search_spec.rb b/spec/components/search_spec.rb index 8d14de941..128c77646 100644 --- a/spec/components/search_spec.rb +++ b/spec/components/search_spec.rb @@ -553,6 +553,16 @@ describe Search do expect(Search.execute('testing again #category-24:sub-category').posts.length).to eq(1) expect(Search.execute('testing again #sub-category').posts.length).to eq(0) end + + it "can find with tag" do + topic1 = Fabricate(:topic, title: 'Could not, would not, on a boat') + topic1.tags = [Fabricate(:tag, name: 'eggs'), Fabricate(:tag, name: 'ham')] + post1 = Fabricate(:post, topic: topic1) + post2 = Fabricate(:post, topic: topic1, raw: "It probably doesn't help that they're green...") + + expect(Search.execute('green tags:eggs').posts.map(&:id)).to eq([post2.id]) + expect(Search.execute('green tags:plants').posts.size).to eq(0) + end end it 'can parse complex strings using ts_query helper' do diff --git a/spec/components/topic_query_spec.rb b/spec/components/topic_query_spec.rb index fcb0bb1f8..663fdef53 100644 --- a/spec/components/topic_query_spec.rb +++ b/spec/components/topic_query_spec.rb @@ -112,8 +112,47 @@ describe TopicQuery do end end + end + context 'tag filter' do + let(:tag) { Fabricate(:tag) } + let(:other_tag) { Fabricate(:tag) } + it "returns topics with the tag when filtered to it" do + tagged_topic1 = Fabricate(:topic, {tags: [tag]}) + tagged_topic2 = Fabricate(:topic, {tags: [other_tag]}) + tagged_topic3 = Fabricate(:topic, {tags: [tag, other_tag]}) + no_tags_topic = Fabricate(:topic) + + expect(TopicQuery.new(moderator, tags: [tag.name]).list_latest.topics.map(&:id).sort).to eq([tagged_topic1.id, tagged_topic3.id].sort) + expect(TopicQuery.new(moderator, tags: [tag.id]).list_latest.topics.map(&:id).sort).to eq([tagged_topic1.id, tagged_topic3.id].sort) + + two_tag_topic = TopicQuery.new(moderator, tags: [tag.name]).list_latest.topics.find { |t| t.id == tagged_topic3.id } + expect(two_tag_topic.tags.size).to eq(2) + + # topics with ANY of the given tags: + expect(TopicQuery.new(moderator, tags: [tag.name, other_tag.name]).list_latest.topics.map(&:id).sort).to eq([tagged_topic1.id, tagged_topic2.id, tagged_topic3.id].sort) + expect(TopicQuery.new(moderator, tags: [tag.id, other_tag.id]).list_latest.topics.map(&:id).sort).to eq([tagged_topic1.id, tagged_topic2.id, tagged_topic3.id].sort) + + # TODO: topics with ALL of the given tags: + # expect(TopicQuery.new(moderator, tags: [tag.name, other_tag.name]).list_latest.topics.map(&:id)).to eq([tagged_topic3.id].sort) + # expect(TopicQuery.new(moderator, tags: [tag.id, other_tag.id]).list_latest.topics.map(&:id)).to eq([tagged_topic3.id].sort) + end + + context "and categories too" do + let(:category1) { Fabricate(:category) } + let(:category2) { Fabricate(:category) } + + it "returns topics in the given category with the given tag" do + tagged_topic1 = Fabricate(:topic, {category: category1, tags: [tag]}) + tagged_topic2 = Fabricate(:topic, {category: category2, tags: [tag]}) + tagged_topic3 = Fabricate(:topic, {category: category1, tags: [tag, other_tag]}) + no_tags_topic = Fabricate(:topic, {category: category1}) + + expect(TopicQuery.new(moderator, category: category1.id, tags: [tag.name]).list_latest.topics.map(&:id).sort).to eq([tagged_topic1.id, tagged_topic3.id].sort) + expect(TopicQuery.new(moderator, category: category2.id, tags: [other_tag.name]).list_latest.topics.size).to eq(0) + end + end end context 'muted categories' do diff --git a/spec/components/topics_bulk_action_spec.rb b/spec/components/topics_bulk_action_spec.rb index 0003ee2dc..6aa99fcd1 100644 --- a/spec/components/topics_bulk_action_spec.rb +++ b/spec/components/topics_bulk_action_spec.rb @@ -180,4 +180,56 @@ describe TopicsBulkAction do end end end + + describe "change_tags" do + let(:topic) { Fabricate(:topic) } + let(:tag1) { Fabricate(:tag) } + let(:tag2) { Fabricate(:tag) } + + before do + SiteSetting.tagging_enabled = true + SiteSetting.min_trust_level_to_tag_topics = 0 + topic.tags = [tag1, tag2] + end + + it "can change the tags, and can create new tags" do + SiteSetting.min_trust_to_create_tag = 0 + tba = TopicsBulkAction.new(topic.user, [topic.id], type: 'change_tags', tags: ['newtag', tag1.name]) + topic_ids = tba.perform! + expect(topic_ids).to eq([topic.id]) + topic.reload + expect(topic.tags.map(&:name).sort).to eq(['newtag', tag1.name].sort) + end + + it "can change the tags but not create new ones" do + SiteSetting.min_trust_to_create_tag = 4 + tba = TopicsBulkAction.new(topic.user, [topic.id], type: 'change_tags', tags: ['newtag', tag1.name]) + topic_ids = tba.perform! + expect(topic_ids).to eq([topic.id]) + topic.reload + expect(topic.tags.map(&:name)).to eq([tag1.name]) + end + + it "can remove all tags" do + tba = TopicsBulkAction.new(topic.user, [topic.id], type: 'change_tags', tags: []) + topic_ids = tba.perform! + expect(topic_ids).to eq([topic.id]) + topic.reload + expect(topic.tags.size).to eq(0) + end + + context "when user can't edit topic" do + before do + Guardian.any_instance.expects(:can_edit?).returns(false) + end + + it "doesn't change the tags" do + tba = TopicsBulkAction.new(topic.user, [topic.id], type: 'change_tags', tags: ['newtag', tag1.name]) + topic_ids = tba.perform! + expect(topic_ids).to eq([]) + topic.reload + expect(topic.tags.map(&:name)).to eq([tag1.name, tag2.name]) + end + end + end end diff --git a/spec/fabricators/tag_fabricator.rb b/spec/fabricators/tag_fabricator.rb new file mode 100644 index 000000000..45940081a --- /dev/null +++ b/spec/fabricators/tag_fabricator.rb @@ -0,0 +1,3 @@ +Fabricator(:tag) do + name { sequence(:name) { |i| "tag#{i}" } } +end diff --git a/spec/models/tag_spec.rb b/spec/models/tag_spec.rb new file mode 100644 index 000000000..22cda4a4b --- /dev/null +++ b/spec/models/tag_spec.rb @@ -0,0 +1,32 @@ +require 'rails_helper' + +describe Tag do + describe '#tags_by_count_query' do + it "returns empty hash if nothing is tagged" do + expect(described_class.tags_by_count_query.count).to eq({}) + end + + context "with some tagged topics" do + before do + @topics = [] + @tags = [] + 3.times { @topics << Fabricate(:topic) } + 2.times { @tags << Fabricate(:tag) } + @topics[0].tags << @tags[0] + @topics[0].tags << @tags[1] + @topics[1].tags << @tags[0] + end + + it "returns tag names with topic counts in a hash" do + counts = described_class.tags_by_count_query.count + expect(counts[@tags[0].name]).to eq(2) + expect(counts[@tags[1].name]).to eq(1) + end + + it "can be used to filter before doing the count" do + counts = described_class.tags_by_count_query.where("topics.id = ?", @topics[1].id).count + expect(counts).to eq({@tags[0].name => 1}) + end + end + end +end diff --git a/spec/models/tag_user_spec.rb b/spec/models/tag_user_spec.rb new file mode 100644 index 000000000..5b1753bbf --- /dev/null +++ b/spec/models/tag_user_spec.rb @@ -0,0 +1,87 @@ +# encoding: utf-8 + +require 'rails_helper' +require_dependency 'post_creator' + +describe TagUser do + + context "integration" do + before do + ActiveRecord::Base.observers.enable :all + SiteSetting.tagging_enabled = true + SiteSetting.min_trust_to_create_tag = 0 + SiteSetting.min_trust_level_to_tag_topics = 0 + end + + let(:user) { Fabricate(:user) } + + let(:watched_tag) { Fabricate(:tag) } + let(:muted_tag) { Fabricate(:tag) } + let(:tracked_tag) { Fabricate(:tag) } + + context "with some tag notification settings" do + before do + TagUser.create!(user: user, tag: watched_tag, notification_level: TagUser.notification_levels[:watching]) + TagUser.create!(user: user, tag: muted_tag, notification_level: TagUser.notification_levels[:muted]) + TagUser.create!(user: user, tag: tracked_tag, notification_level: TagUser.notification_levels[:tracking]) + end + + it "sets notification levels correctly" do + watched_post = create_post(tags: [watched_tag.name]) + muted_post = create_post(tags: [muted_tag.name]) + tracked_post = create_post(tags: [tracked_tag.name]) + + expect(Notification.where(user_id: user.id, topic_id: watched_post.topic_id).count).to eq 1 + expect(Notification.where(user_id: user.id, topic_id: tracked_post.topic_id).count).to eq 0 + + tu = TopicUser.get(tracked_post.topic, user) + expect(tu.notification_level).to eq TopicUser.notification_levels[:tracking] + expect(tu.notifications_reason_id).to eq TopicUser.notification_reasons[:auto_track_tag] + end + + it "sets notification level to the highest one if there are multiple tags" do + post = create_post(tags: [muted_tag.name, tracked_tag.name, watched_tag.name]) + expect(Notification.where(user_id: user.id, topic_id: post.topic_id).count).to eq 1 + tu = TopicUser.get(post.topic, user) + expect(tu.notification_level).to eq TopicUser.notification_levels[:watching] + expect(tu.notifications_reason_id).to eq TopicUser.notification_reasons[:auto_watch_tag] + end + + it "can start watching after tag has been added" do + post = create_post + expect(TopicUser.get(post.topic, user)).to be_blank + DiscourseTagging.tag_topic_by_names(post.topic, Guardian.new(user), [watched_tag.name]) + tu = TopicUser.get(post.topic, user) + expect(tu.notification_level).to eq(TopicUser.notification_levels[:watching]) + end + + it "can start watching after tag has changed" do + post = create_post(tags: [Fabricate(:tag).name]) + expect(TopicUser.get(post.topic, user)).to be_blank + DiscourseTagging.tag_topic_by_names(post.topic, Guardian.new(user), [watched_tag.name]) + tu = TopicUser.get(post.topic, user) + expect(tu.notification_level).to eq(TopicUser.notification_levels[:watching]) + end + + it "can stop watching after tag has changed" do + post = create_post(tags: [watched_tag.name]) + expect(TopicUser.get(post.topic, user)).to be_present + DiscourseTagging.tag_topic_by_names(post.topic, Guardian.new(user), [Fabricate(:tag).name]) + expect(TopicUser.get(post.topic, user)).to be_blank + end + + it "can stop watching after tags have been removed" do + post = create_post(tags: [muted_tag.name, tracked_tag.name, watched_tag.name]) + expect(TopicUser.get(post.topic, user)).to be_present + DiscourseTagging.tag_topic_by_names(post.topic, Guardian.new(user), []) + expect(TopicUser.get(post.topic, user)).to be_blank + end + + it "is destroyed when a user is deleted" do + expect(TagUser.where(user_id: user.id).count).to eq(3) + user.destroy! + expect(TagUser.where(user_id: user.id).count).to eq(0) + end + end + end +end From af1c99494013f38807529176be91383b675facd3 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 26 May 2016 14:57:43 -0700 Subject: [PATCH 015/320] FIX: QSG incorrectly referred to meta category --- docs/ADMIN-QUICK-START-GUIDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ADMIN-QUICK-START-GUIDE.md b/docs/ADMIN-QUICK-START-GUIDE.md index 5c32d2112..1c1000d6d 100644 --- a/docs/ADMIN-QUICK-START-GUIDE.md +++ b/docs/ADMIN-QUICK-START-GUIDE.md @@ -121,7 +121,7 @@ Right now [your FAQ](/faq) is the same Creative Commons [universal rules of civi However, if you want to set up a more detailed FAQ dealing with the specifics of *your* community, here's how: -1. Create a new [meta topic](category/meta), titled "Frequently Asked Questions (FAQ)" or similar. +1. Create a new [site feedback topic](category/site-feedback), titled "Frequently Asked Questions (FAQ)" or similar. 2. Use the admin wrench icon below the post to make it a wiki post. This means the post is now editable to any user with a trust level of 1 or higher. @@ -135,7 +135,7 @@ Now you have a community FAQ for your site that is collaboratively editable, and You have three default categories: -1. [Meta](/category/meta) – general discussion about the site itself. [It's important!](https://meta.discourse.org/t/what-is-meta/5249) +1. [Site Feedback](/category/site-feedback) – general discussion about the site itself. [It's important!](https://meta.discourse.org/t/5249) 2. [Lounge](/category/lounge) – a perk for users at trust level 3 and higher 3. [Staff](/category/staff) – visible only to staff (admins and moderators) From 3d5716a2c8949d92394752b31cb7d0aff0b8dd20 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 26 May 2016 17:24:03 -0400 Subject: [PATCH 016/320] FIX: tag input doesn't show staff-only tags to non-staff --- .../javascripts/discourse/components/tag-chooser.js.es6 | 2 +- app/controllers/tags_controller.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/tag-chooser.js.es6 b/app/assets/javascripts/discourse/components/tag-chooser.js.es6 index c942cf599..88e7577d1 100644 --- a/app/assets/javascripts/discourse/components/tag-chooser.js.es6 +++ b/app/assets/javascripts/discourse/components/tag-chooser.js.es6 @@ -78,7 +78,7 @@ export default Ember.TextField.extend({ url: Discourse.getURL("/tags/filter/search"), dataType: 'json', data: function (term) { - return { q: term, limit: self.siteSettings.max_tag_search_results }; + return { q: term, limit: self.siteSettings.max_tag_search_results, filterForInput: true }; }, results: function (data) { if (self.siteSettings.tags_sort_alphabetically) { diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 23eac8886..c5040d3a2 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -112,6 +112,11 @@ class TagsController < ::ApplicationController query = query.where('tags.name like ?', "%#{term}%") end + if params[:filterForInput] && !guardian.is_staff? + staff_tag_names = SiteSetting.staff_tags.split("|") + query = query.where('tags.name NOT IN (?)', staff_tag_names) if staff_tag_names.present? + end + tags = query.count.map {|t, c| { id: t, text: t, count: c } } render json: { results: tags } From 884779b5c18f1b963e532d904198df7e00cf9dda Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 26 May 2016 18:03:36 -0400 Subject: [PATCH 017/320] FIX: N+1 query when tagging enabled and no tags in topic list query. Topic query ignored tags input when tagging is disabled. --- lib/topic_query.rb | 18 +++++++++++------- spec/components/topic_query_spec.rb | 4 ++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/topic_query.rb b/lib/topic_query.rb index 65696d64c..d2add0c9b 100644 --- a/lib/topic_query.rb +++ b/lib/topic_query.rb @@ -455,14 +455,18 @@ class TopicQuery # ALL TAGS: something like this? # Topic.joins(:tags).where('tags.name in (?)', @options[:tags]).group('topic_id').having('count(*)=?', @options[:tags].size).select('topic_id') - if @options[:tags] && @options[:tags].size > 0 - result = result.joins(:tags).preload(:tags) + if SiteSetting.tagging_enabled + result = result.preload(:tags) - # ANY of the given tags: - if @options[:tags][0].is_a?(Integer) - result = result.where("tags.id in (?)", @options[:tags]) - else - result = result.where("tags.name in (?)", @options[:tags]) + if @options[:tags] && @options[:tags].size > 0 + result = result.joins(:tags) + + # ANY of the given tags: + if @options[:tags][0].is_a?(Integer) + result = result.where("tags.id in (?)", @options[:tags]) + else + result = result.where("tags.name in (?)", @options[:tags]) + end end end diff --git a/spec/components/topic_query_spec.rb b/spec/components/topic_query_spec.rb index 663fdef53..d3298a9dc 100644 --- a/spec/components/topic_query_spec.rb +++ b/spec/components/topic_query_spec.rb @@ -118,6 +118,10 @@ describe TopicQuery do let(:tag) { Fabricate(:tag) } let(:other_tag) { Fabricate(:tag) } + before do + SiteSetting.tagging_enabled = true + end + it "returns topics with the tag when filtered to it" do tagged_topic1 = Fabricate(:topic, {tags: [tag]}) tagged_topic2 = Fabricate(:topic, {tags: [other_tag]}) From 17ebcdd413649220449497e1046bf07f68f286f1 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 26 May 2016 15:05:41 -0700 Subject: [PATCH 018/320] very minor typo --- config/locales/server.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index db341f15c..6729cbae3 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -928,7 +928,7 @@ en: allow_index_in_robots_txt: "Specify in robots.txt that this site is allowed to be indexed by web search engines." email_domains_blacklist: "A pipe-delimited list of email domains that users are not allowed to register accounts with. Example: mailinator.com|trashmail.net" email_domains_whitelist: "A pipe-delimited list of email domains that users MUST register accounts with. WARNING: Users with email domains other than those listed will not be allowed!" - forgot_password_strict: "Don't inform users of an account's existance when they use the forgot password dialog." + forgot_password_strict: "Don't inform users of an account's existence when they use the forgot password dialog." log_out_strict: "When logging out, log out ALL sessions for the user on all devices" version_checks: "Ping the Discourse Hub for version updates and show new version messages on the /admin dashboard" new_version_emails: "Send an email to the contact_email address when a new version of Discourse is available." From 89b730600accfaec1f07703369762406e151ead7 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 26 May 2016 15:23:15 -0700 Subject: [PATCH 019/320] QSG: improve pin description --- docs/ADMIN-QUICK-START-GUIDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ADMIN-QUICK-START-GUIDE.md b/docs/ADMIN-QUICK-START-GUIDE.md index 1c1000d6d..7af407c95 100644 --- a/docs/ADMIN-QUICK-START-GUIDE.md +++ b/docs/ADMIN-QUICK-START-GUIDE.md @@ -92,8 +92,8 @@ Your welcome topic is important because it is the first thing you visitors will Note that pinning topics works a little differently in Discourse: -- Users can hide pins on topics once they have read them via the controls at the bottom of the topic, so they aren't always pinned forever for everyone. -- When you pin a topic, you can choose to pin it globally to all topic lists, or pin it only within its category. +- Once someone reads to the bottom of a pinned topic, it is automatically unpinned for them specifically. They can change this via the personal pin controls at the bottom of the topic. +- When staff pins a topic, they can pin it globally to all topic lists, or just within its category. If a pin isn't visible enough, you can also turn one single topic into a **banner**. The banner topic floats on top of all topics and all primary pages. Users can permanently dismiss this floating banner by clicking the × in the upper right corner. From 8c3a0b44baea3388db4b719766a961d3a2114fc9 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 27 May 2016 12:07:10 +1000 Subject: [PATCH 020/320] FIX: restore "every email" default for old accounts in mailing list mode - Change default for mailing list mode frequency to daily - Remove bootbox warning for mailing list mode (cause default is daily) --- .../discourse/controllers/preferences.js.es6 | 15 --------------- .../discourse/templates/user/preferences.hbs | 2 +- config/locales/client.en.yml | 10 +++------- config/site_settings.yml | 2 +- ...7015355_correct_mailing_list_mode_frequency.rb | 10 ++++++++++ 5 files changed, 15 insertions(+), 24 deletions(-) create mode 100644 db/migrate/20160527015355_correct_mailing_list_mode_frequency.rb diff --git a/app/assets/javascripts/discourse/controllers/preferences.js.es6 b/app/assets/javascripts/discourse/controllers/preferences.js.es6 index 729f749af..c9dd265c4 100644 --- a/app/assets/javascripts/discourse/controllers/preferences.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences.js.es6 @@ -130,21 +130,6 @@ export default Ember.Controller.extend(CanCheckEmails, { actions: { - checkMailingList(){ - Em.run.next(()=>{ - const postsPerDay = this.get('model.mailing_list_posts_per_day'); - if (!postsPerDay || postsPerDay < 2) { - return true; - } - - bootbox.confirm(I18n.t("user.enable_mailing_list", {count: postsPerDay}), I18n.t("no_value"), I18n.t("yes_value"), (success) => { - if (!success) { - this.set('model.user_option.mailing_list_mode', false); - } - }); - }); - }, - save() { this.set('saved', false); diff --git a/app/assets/javascripts/discourse/templates/user/preferences.hbs b/app/assets/javascripts/discourse/templates/user/preferences.hbs index cb9b9e6c1..a69a8b629 100644 --- a/app/assets/javascripts/discourse/templates/user/preferences.hbs +++ b/app/assets/javascripts/discourse/templates/user/preferences.hbs @@ -203,7 +203,7 @@ {{#unless siteSettings.disable_mailing_list_mode}}
- {{preference-checkbox labelKey="user.mailing_list_mode.enabled" warning="checkMailingList" checked=model.user_option.mailing_list_mode}} + {{preference-checkbox labelKey="user.mailing_list_mode.enabled" checked=model.user_option.mailing_list_mode}}
{{{i18n 'user.mailing_list_mode.instructions'}}}
{{#if model.user_option.mailing_list_mode}}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 50f7a44d4..a6dcf4e17 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -507,12 +507,12 @@ en: email_activity_summary: "Activity Summary" mailing_list_mode: label: "Mailing list mode" - enabled: "Enable mailing list mode." + enabled: "Enable mailing list mode" instructions: | This setting overrides the activity summary.
Muted topics and categories are not included in these emails. - daily: "Send daily updates." - individual: "Send an email for every new post." + daily: "Send daily updates" + individual: "Send an email for every new post" many_per_day: "Send me an email for every new post (about {{dailyEmailEstimate}} per day)." few_per_day: "Send me an email for every new post (less than 2 per day)." watched_categories: "Watched" @@ -676,10 +676,6 @@ en: other_settings: "Other" categories_settings: "Categories" - enable_mailing_list: - one: "Are you sure you want to be emailed for every new post?" - other: "Are you sure you want to be emailed for every new post?

This will result in approximately {{count}} emails per day." - new_topic_duration: label: "Consider topics new when" not_viewed: "I haven't viewed them yet" diff --git a/config/site_settings.yml b/config/site_settings.yml index a6a000ad4..828ddf1dd 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -1139,7 +1139,7 @@ user_preferences: default_email_mailing_list_mode: false default_email_mailing_list_mode_frequency: enum: 'MailingListModeSiteSetting' - default: 1 + default: 0 disable_mailing_list_mode: default: false client: true diff --git a/db/migrate/20160527015355_correct_mailing_list_mode_frequency.rb b/db/migrate/20160527015355_correct_mailing_list_mode_frequency.rb new file mode 100644 index 000000000..bcbdcd036 --- /dev/null +++ b/db/migrate/20160527015355_correct_mailing_list_mode_frequency.rb @@ -0,0 +1,10 @@ +class CorrectMailingListModeFrequency < ActiveRecord::Migration + def up + # historically mailing list mode was for every message + # keep working the same way for all old users + execute 'UPDATE user_options SET mailing_list_mode_frequency = 1 where mailing_list_mode' + end + + def down + end +end From bd9bc7918ccf29820415a9c1caa809e797fa6bcc Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 27 May 2016 12:18:54 +1000 Subject: [PATCH 021/320] FIX: downcase developer emails do it matches internal email storage --- config/environments/development.rb | 2 +- config/environments/production.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index ee06ba01b..7079245f7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -49,6 +49,6 @@ Discourse::Application.configure do require 'rbtrace' if emails = GlobalSetting.developer_emails - config.developer_emails = emails.split(",").map(&:strip) + config.developer_emails = emails.split(",").map(&:downcase).map(&:strip) end end diff --git a/config/environments/production.rb b/config/environments/production.rb index 35c21bf22..f73b6e2dc 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -60,7 +60,7 @@ Discourse::Application.configure do # developers have god like rights and may impersonate anyone in the system # normal admins may only impersonate other moderators (not admins) if emails = GlobalSetting.developer_emails - config.developer_emails = emails.split(",").map(&:strip) + config.developer_emails = emails.split(",").map(&:downcase).map(&:strip) end end From efc45aa704f15ec71cce65100f8290c5e59efa29 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 27 May 2016 12:35:22 +1000 Subject: [PATCH 022/320] correct specs --- spec/jobs/notify_mailing_list_subscribers_spec.rb | 5 ++++- spec/models/topic_user_spec.rb | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/jobs/notify_mailing_list_subscribers_spec.rb b/spec/jobs/notify_mailing_list_subscribers_spec.rb index 75e32073d..aa311c038 100644 --- a/spec/jobs/notify_mailing_list_subscribers_spec.rb +++ b/spec/jobs/notify_mailing_list_subscribers_spec.rb @@ -3,7 +3,10 @@ require "rails_helper" describe Jobs::NotifyMailingListSubscribers do context "with mailing list on" do - before { SiteSetting.default_email_mailing_list_mode = true } + before do + SiteSetting.default_email_mailing_list_mode = true + SiteSetting.default_email_mailing_list_mode_frequency = 1 + end let(:user) { Fabricate(:user) } context "SiteSetting.max_emails_per_day_per_user" do diff --git a/spec/models/topic_user_spec.rb b/spec/models/topic_user_spec.rb index e08725480..5b609c0c8 100644 --- a/spec/models/topic_user_spec.rb +++ b/spec/models/topic_user_spec.rb @@ -294,7 +294,8 @@ describe TopicUser do it "will receive email notification for every topic" do user1 = Fabricate(:user) - SiteSetting.stubs(:default_email_mailing_list_mode).returns(true) + SiteSetting.default_email_mailing_list_mode = true + SiteSetting.default_email_mailing_list_mode_frequency = 1 user2 = Fabricate(:user) post = create_post From eb21ed7fcfb030b06a6942c8c534ce3fd6879c8d Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 27 May 2016 14:34:44 +0800 Subject: [PATCH 023/320] Allow options to be cleared. --- .../javascripts/discourse/components/combo-box.js.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/combo-box.js.es6 b/app/assets/javascripts/discourse/components/combo-box.js.es6 index e023ad267..4dd19bd58 100644 --- a/app/assets/javascripts/discourse/components/combo-box.js.es6 +++ b/app/assets/javascripts/discourse/components/combo-box.js.es6 @@ -65,7 +65,11 @@ export default Ember.Component.extend({ const $elem = this.$(); const minimumResultsForSearch = this.capabilities.isIOS ? -1 : 5; - $elem.select2({formatResult: this.comboTemplate, minimumResultsForSearch, width: 'resolve'}); + $elem.select2({ + formatResult: this.comboTemplate, minimumResultsForSearch, + width: 'resolve', + allowClear: true + }); const castInteger = this.get('castInteger'); $elem.on("change", e => { From 86ed6c7d5ef08d7561f4d3e8761f4a2580224ef5 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 27 May 2016 18:02:22 +0800 Subject: [PATCH 024/320] Revert "Clear read only timestamp in Redis when switching back to master." This reverts commit f891430f32a3b8ba9caac20b5ad36621eeadd691. --- .../connection_adapters/postgresql_fallback_adapter.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb index ecc2f6e2c..857cc28b5 100644 --- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb +++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb @@ -39,7 +39,6 @@ class PostgreSQLFallbackHandler end Discourse.disable_readonly_mode - Discourse.clear_readonly! self.master = true end rescue => e From ec4a7d708dde7a2c508cb5941a6c0fe7b0d30c6d Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 27 May 2016 11:06:51 -0400 Subject: [PATCH 025/320] Version bump to v1.6.0.beta7 --- lib/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/version.rb b/lib/version.rb index 919b48142..3b9b3c2a3 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -5,7 +5,7 @@ module Discourse MAJOR = 1 MINOR = 6 TINY = 0 - PRE = 'beta6' + PRE = 'beta7' STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.') end From 05c8bca2222ccbc5e07734357ad2285b7bc64cdc Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 27 May 2016 15:02:43 -0400 Subject: [PATCH 026/320] show tags usage in search options --- config/locales/server.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 6729cbae3..ff4ca0f80 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -2807,7 +2807,7 @@ en: #category-slugcategory:foogroup:foobadge:foo in:likesin:postedin:watchingin:trackingin:private in:bookmarksin:firstin:pinnedin:unpinnedin:wiki - posts_count:numbefore:days or dateafter:days or date + posts_count:numbefore:days or dateafter:days or datetags:one,two

Examples

From e922db82fb2c2970325ce6c157fa1e831be5f883 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Sun, 29 May 2016 00:49:40 +0530 Subject: [PATCH 027/320] disable username autocomplete on Sign Up modal --- .../javascripts/discourse/templates/modal/create-account.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/templates/modal/create-account.hbs b/app/assets/javascripts/discourse/templates/modal/create-account.hbs index b401e45c8..5e5d9b497 100644 --- a/app/assets/javascripts/discourse/templates/modal/create-account.hbs +++ b/app/assets/javascripts/discourse/templates/modal/create-account.hbs @@ -25,7 +25,7 @@ - {{input value=accountUsername id="new-account-username" name="username" maxlength=maxUsernameLength}} + {{input value=accountUsername id="new-account-username" name="username" maxlength=maxUsernameLength autocomplete="off"}}  {{input-tip validation=usernameValidation id="username-validation"}} From 089b1d164c67d58926c9462bd793f5a931208f45 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 30 May 2016 10:45:32 +1000 Subject: [PATCH 028/320] annotate models (reminder run RAILS_ENV=test bin/annotate once in a while) --- app/models/email_log.rb | 2 ++ app/models/incoming_email.rb | 3 +++ app/models/onceoff_log.rb | 14 ++++++++++++++ app/models/tag.rb | 15 +++++++++++++++ app/models/tag_user.rb | 17 +++++++++++++++++ app/models/topic_custom_field.rb | 2 +- app/models/topic_tag.rb | 15 +++++++++++++++ app/models/translation_override.rb | 1 + app/models/user.rb | 1 + app/models/user_option.rb | 1 + app/models/user_stat.rb | 28 +++++++++++++++------------- 11 files changed, 85 insertions(+), 14 deletions(-) diff --git a/app/models/email_log.rb b/app/models/email_log.rb index 99d12b52d..ceb32d525 100644 --- a/app/models/email_log.rb +++ b/app/models/email_log.rb @@ -73,6 +73,8 @@ end # topic_id :integer # skipped :boolean default(FALSE) # skipped_reason :string +# bounce_key :string +# bounced :boolean default(FALSE), not null # # Indexes # diff --git a/app/models/incoming_email.rb b/app/models/incoming_email.rb index 1266d665e..97427699d 100644 --- a/app/models/incoming_email.rb +++ b/app/models/incoming_email.rb @@ -24,10 +24,13 @@ end # created_at :datetime not null # updated_at :datetime not null # rejection_message :text +# is_auto_generated :boolean default(FALSE) +# is_bounce :boolean default(FALSE), not null # # Indexes # # index_incoming_emails_on_created_at (created_at) # index_incoming_emails_on_error (error) # index_incoming_emails_on_message_id (message_id) +# index_incoming_emails_on_post_id (post_id) # diff --git a/app/models/onceoff_log.rb b/app/models/onceoff_log.rb index 88e43f19b..12ce7377c 100644 --- a/app/models/onceoff_log.rb +++ b/app/models/onceoff_log.rb @@ -1,2 +1,16 @@ class OnceoffLog < ActiveRecord::Base end + +# == Schema Information +# +# Table name: onceoff_logs +# +# id :integer not null, primary key +# job_name :string +# created_at :datetime not null +# updated_at :datetime not null +# +# Indexes +# +# index_onceoff_logs_on_job_name (job_name) +# diff --git a/app/models/tag.rb b/app/models/tag.rb index bb628d38f..3d03aa83d 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -16,3 +16,18 @@ class Tag < ActiveRecord::Base .map {|name, count| name} end end + +# == Schema Information +# +# Table name: tags +# +# id :integer not null, primary key +# name :string not null +# topic_count :integer default(0), not null +# created_at :datetime +# updated_at :datetime +# +# Indexes +# +# index_tags_on_name (name) UNIQUE +# diff --git a/app/models/tag_user.rb b/app/models/tag_user.rb index 1abd68ea0..96244cf21 100644 --- a/app/models/tag_user.rb +++ b/app/models/tag_user.rb @@ -93,3 +93,20 @@ class TagUser < ActiveRecord::Base private_class_method :apply_default_to_topic, :remove_default_from_topic end + +# == Schema Information +# +# Table name: tag_users +# +# id :integer not null, primary key +# tag_id :integer not null +# user_id :integer not null +# notification_level :integer not null +# created_at :datetime +# updated_at :datetime +# +# Indexes +# +# idx_tag_users_ix1 (user_id,tag_id,notification_level) UNIQUE +# idx_tag_users_ix2 (tag_id,user_id,notification_level) UNIQUE +# diff --git a/app/models/topic_custom_field.rb b/app/models/topic_custom_field.rb index 22685679d..5dd6e53c7 100644 --- a/app/models/topic_custom_field.rb +++ b/app/models/topic_custom_field.rb @@ -16,5 +16,5 @@ end # Indexes # # index_topic_custom_fields_on_topic_id_and_name (topic_id,name) -# index_topic_custom_fields_on_value (value) +# topic_custom_fields_value_key_idx (value,name) # diff --git a/app/models/topic_tag.rb b/app/models/topic_tag.rb index 9882ddf24..f8dc3cfee 100644 --- a/app/models/topic_tag.rb +++ b/app/models/topic_tag.rb @@ -2,3 +2,18 @@ class TopicTag < ActiveRecord::Base belongs_to :topic belongs_to :tag, counter_cache: "topic_count" end + +# == Schema Information +# +# Table name: topic_tags +# +# id :integer not null, primary key +# topic_id :integer not null +# tag_id :integer not null +# created_at :datetime +# updated_at :datetime +# +# Indexes +# +# index_topic_tags_on_topic_id_and_tag_id (topic_id,tag_id) UNIQUE +# diff --git a/app/models/translation_override.rb b/app/models/translation_override.rb index 408c46f09..d39c48221 100644 --- a/app/models/translation_override.rb +++ b/app/models/translation_override.rb @@ -41,6 +41,7 @@ end # value :string not null # created_at :datetime not null # updated_at :datetime not null +# compiled_js :text # # Indexes # diff --git a/app/models/user.rb b/app/models/user.rb index 4b20b9718..a4917e0ee 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1037,6 +1037,7 @@ end # registration_ip_address :inet # trust_level_locked :boolean default(FALSE), not null # staged :boolean default(FALSE), not null +# first_seen_at :datetime # # Indexes # diff --git a/app/models/user_option.rb b/app/models/user_option.rb index ad4ac23a4..6f0a8ecbd 100644 --- a/app/models/user_option.rb +++ b/app/models/user_option.rb @@ -151,6 +151,7 @@ end # email_in_reply_to :boolean default(TRUE), not null # like_notification_frequency :integer default(1), not null # include_tl0_in_digests :boolean default(FALSE) +# mailing_list_mode_frequency :integer default(0), not null # # Indexes # diff --git a/app/models/user_stat.rb b/app/models/user_stat.rb index 746ad3557..7898a2e57 100644 --- a/app/models/user_stat.rb +++ b/app/models/user_stat.rb @@ -103,17 +103,19 @@ end # # Table name: user_stats # -# user_id :integer not null, primary key -# topics_entered :integer default(0), not null -# time_read :integer default(0), not null -# days_visited :integer default(0), not null -# posts_read_count :integer default(0), not null -# likes_given :integer default(0), not null -# likes_received :integer default(0), not null -# topic_reply_count :integer default(0), not null -# new_since :datetime not null -# read_faq :datetime -# first_post_created_at :datetime -# post_count :integer default(0), not null -# topic_count :integer default(0), not null +# user_id :integer not null, primary key +# topics_entered :integer default(0), not null +# time_read :integer default(0), not null +# days_visited :integer default(0), not null +# posts_read_count :integer default(0), not null +# likes_given :integer default(0), not null +# likes_received :integer default(0), not null +# topic_reply_count :integer default(0), not null +# new_since :datetime not null +# read_faq :datetime +# first_post_created_at :datetime +# post_count :integer default(0), not null +# topic_count :integer default(0), not null +# bounce_score :integer default(0), not null +# reset_bounce_score_after :datetime # From c9dcffe434ef5944ef2cef87f7e77b17f40ff453 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 30 May 2016 11:38:08 +1000 Subject: [PATCH 029/320] FEATURE: store history for scheduled job execution --- app/jobs/scheduled/weekly.rb | 1 + app/models/scheduler_stat.rb | 20 +++++++++ .../20160530003739_create_scheduler_stats.rb | 14 ++++++ lib/scheduler/manager.rb | 21 +++++++++ lib/scheduler/views/history.erb | 45 +++++++++++++++++++ lib/scheduler/views/scheduler.erb | 2 +- lib/scheduler/web.rb | 5 +++ spec/components/scheduler/manager_spec.rb | 31 +++++++++++++ 8 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 app/models/scheduler_stat.rb create mode 100644 db/migrate/20160530003739_create_scheduler_stats.rb create mode 100644 lib/scheduler/views/history.erb diff --git a/app/jobs/scheduled/weekly.rb b/app/jobs/scheduled/weekly.rb index 613833ff5..ffce8c1d2 100644 --- a/app/jobs/scheduled/weekly.rb +++ b/app/jobs/scheduled/weekly.rb @@ -11,6 +11,7 @@ module Jobs Post.calculate_avg_time Topic.calculate_avg_time ScoreCalculator.new.calculate + SchedulerStat.purge_old Draft.cleanup! end end diff --git a/app/models/scheduler_stat.rb b/app/models/scheduler_stat.rb new file mode 100644 index 000000000..55dc8fda6 --- /dev/null +++ b/app/models/scheduler_stat.rb @@ -0,0 +1,20 @@ +class SchedulerStat < ActiveRecord::Base + def self.purge_old + where('started_at < ?', 3.months.ago).delete_all + end +end + +# == Schema Information +# +# Table name: scheduler_stats +# +# id :integer not null, primary key +# name :string not null +# hostname :string not null +# pid :integer not null +# duration_ms :integer +# live_slots_start :integer +# live_slots_finish :integer +# started_at :datetime not null +# success :boolean +# diff --git a/db/migrate/20160530003739_create_scheduler_stats.rb b/db/migrate/20160530003739_create_scheduler_stats.rb new file mode 100644 index 000000000..04cfdca81 --- /dev/null +++ b/db/migrate/20160530003739_create_scheduler_stats.rb @@ -0,0 +1,14 @@ +class CreateSchedulerStats < ActiveRecord::Migration + def change + create_table :scheduler_stats do |t| + t.string :name, null: false + t.string :hostname, null: false + t.integer :pid, null: false + t.integer :duration_ms + t.integer :live_slots_start + t.integer :live_slots_finish + t.datetime :started_at, null: false + t.boolean :success + end + end +end diff --git a/lib/scheduler/manager.rb b/lib/scheduler/manager.rb index 78d1de7fa..060780425 100644 --- a/lib/scheduler/manager.rb +++ b/lib/scheduler/manager.rb @@ -50,6 +50,14 @@ module Scheduler Discourse.handle_job_exception(ex, {message: "Scheduling manager orphan rescheduler"}) end + def hostname + @hostname ||= begin + `hostname` + rescue + "unknown" + end + end + def process_queue klass = @queue.deq # hack alert, I need to both deq and set @running atomically. @@ -57,9 +65,17 @@ module Scheduler failed = false start = Time.now.to_f info = @mutex.synchronize { @manager.schedule_info(klass) } + stat = nil begin info.prev_result = "RUNNING" @mutex.synchronize { info.write! } + stat = SchedulerStat.create!( + name: klass.to_s, + hostname: hostname, + pid: Process.pid, + started_at: Time.zone.now, + live_slots_start: GC.stat[:heap_live_slots] + ) klass.new.perform rescue Jobs::HandledExceptionWrapper # Discourse.handle_exception was already called, and we don't have any extra info to give @@ -72,6 +88,11 @@ module Scheduler info.prev_duration = duration info.prev_result = failed ? "FAILED" : "OK" info.current_owner = nil + stat.update_columns( + duration_ms: duration, + live_slots_finish: GC.stat[:heap_live_slots], + success: !failed + ) attempts(3) do @mutex.synchronize { info.write! } end diff --git a/lib/scheduler/views/history.erb b/lib/scheduler/views/history.erb new file mode 100644 index 000000000..f6c8f5c92 --- /dev/null +++ b/lib/scheduler/views/history.erb @@ -0,0 +1,45 @@ +
+
+

Scheduler History

+
+
+ +
+
+
+ <% if @scheduler_stats.length > 0 %> + + + + + + + + + + + + <% @scheduler_stats.each do |stat| %> + + + + + + + + + <% end %> + +
Job NameHostname:PidLive Slots deltaStarted AtDuration (ms)
<%= stat.name %><%= stat.hostname %>:<%= stat.pid %> + <% if stat.live_slots_start && stat.live_slots_finish %> + <%= stat.live_slots_finish - stat.live_slots_start %> + <% end %> + <%= relative_time stat.started_at %><%= stat.duration_ms %> + <% if !stat.success %> + FAILED + <% end %> +
+ <% end %> +
+
+
diff --git a/lib/scheduler/views/scheduler.erb b/lib/scheduler/views/scheduler.erb index 9d07083b0..d50aaa861 100644 --- a/lib/scheduler/views/scheduler.erb +++ b/lib/scheduler/views/scheduler.erb @@ -7,7 +7,7 @@
<% end %>
-

Recurring Jobs

+

Recurring Jobs history

diff --git a/lib/scheduler/web.rb b/lib/scheduler/web.rb index e3c6c84cd..d3af23643 100644 --- a/lib/scheduler/web.rb +++ b/lib/scheduler/web.rb @@ -22,6 +22,11 @@ module Scheduler end end + app.get "/scheduler/history" do + @scheduler_stats = SchedulerStat.order('started_at desc').limit(200) + erb File.read(File.join(VIEWS, 'history.erb')), locals: {view_path: VIEWS} + end + app.post "/scheduler/:name/trigger" do halt 404 unless (name = params[:name]) diff --git a/spec/components/scheduler/manager_spec.rb b/spec/components/scheduler/manager_spec.rb index 7261a79fe..2f82deed7 100644 --- a/spec/components/scheduler/manager_spec.rb +++ b/spec/components/scheduler/manager_spec.rb @@ -133,6 +133,37 @@ describe Scheduler::Manager do expect(info.next_run).to be <= Time.now.to_i end + it 'should log when job finishes running' do + + Testing::RandomJob.runs = 0 + + info = manager.schedule_info(Testing::RandomJob) + info.next_run = Time.now.to_i - 1 + info.write! + + manager = Scheduler::Manager.new(DiscourseRedis.new) + manager.blocking_tick + manager.stop! + + stat = SchedulerStat.first + expect(stat).to be_present + expect(stat.duration_ms).to be > 0 + expect(stat.success).to be true + + end + + it 'should log when jobs start running' do + info = manager.schedule_info(Testing::SuperLongJob) + info.next_run = Time.now.to_i - 1 + info.write! + + manager.tick + manager.stop! + + stat = SchedulerStat.first + expect(stat).to be_present + end + it 'should only run pending job once' do Testing::RandomJob.runs = 0 From cc088956bc2dbab95fd77574886c84c3ea5f0215 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 30 May 2016 12:28:05 +1000 Subject: [PATCH 030/320] correct some test concurrency bugs --- lib/scheduler/manager.rb | 36 +++++++++++++++-------- spec/components/scheduler/manager_spec.rb | 10 ++++--- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/lib/scheduler/manager.rb b/lib/scheduler/manager.rb index 060780425..0e264d249 100644 --- a/lib/scheduler/manager.rb +++ b/lib/scheduler/manager.rb @@ -8,7 +8,7 @@ require_dependency 'distributed_mutex' module Scheduler class Manager - attr_accessor :random_ratio, :redis + attr_accessor :random_ratio, :redis, :enable_stats class Runner def initialize(manager) @@ -69,13 +69,15 @@ module Scheduler begin info.prev_result = "RUNNING" @mutex.synchronize { info.write! } - stat = SchedulerStat.create!( - name: klass.to_s, - hostname: hostname, - pid: Process.pid, - started_at: Time.zone.now, - live_slots_start: GC.stat[:heap_live_slots] - ) + if @manager.enable_stats + stat = SchedulerStat.create!( + name: klass.to_s, + hostname: hostname, + pid: Process.pid, + started_at: Time.zone.now, + live_slots_start: GC.stat[:heap_live_slots] + ) + end klass.new.perform rescue Jobs::HandledExceptionWrapper # Discourse.handle_exception was already called, and we don't have any extra info to give @@ -88,11 +90,13 @@ module Scheduler info.prev_duration = duration info.prev_result = failed ? "FAILED" : "OK" info.current_owner = nil - stat.update_columns( - duration_ms: duration, - live_slots_finish: GC.stat[:heap_live_slots], - success: !failed - ) + if stat + stat.update_columns( + duration_ms: duration, + live_slots_finish: GC.stat[:heap_live_slots], + success: !failed + ) + end attempts(3) do @mutex.synchronize { info.write! } end @@ -151,6 +155,12 @@ module Scheduler @hostname = options && options[:hostname] @manager_id = SecureRandom.hex + + if options && options.key?(:enable_stats) + @enable_stats = options[:enable_stats] + else + @enable_stats = true + end end def self.current diff --git a/spec/components/scheduler/manager_spec.rb b/spec/components/scheduler/manager_spec.rb index 2f82deed7..8b1bff1a8 100644 --- a/spec/components/scheduler/manager_spec.rb +++ b/spec/components/scheduler/manager_spec.rb @@ -54,7 +54,9 @@ describe Scheduler::Manager do end end - let(:manager) { Scheduler::Manager.new(DiscourseRedis.new) } + let(:manager) { + Scheduler::Manager.new(DiscourseRedis.new, enable_stats: false) + } before do $redis.del manager.class.lock_key @@ -79,7 +81,7 @@ describe Scheduler::Manager do hosts.map do |host| - manager = Scheduler::Manager.new(DiscourseRedis.new, hostname: host) + manager = Scheduler::Manager.new(DiscourseRedis.new, hostname: host, enable_stats: false) manager.ensure_schedule!(Testing::PerHostJob) info = manager.schedule_info(Testing::PerHostJob) @@ -126,7 +128,7 @@ describe Scheduler::Manager do $redis.del manager.identity_key - manager = Scheduler::Manager.new(DiscourseRedis.new) + manager = Scheduler::Manager.new(DiscourseRedis.new, enable_stats: false) manager.reschedule_orphans! info = manager.schedule_info(Testing::SuperLongJob) @@ -174,7 +176,7 @@ describe Scheduler::Manager do (0..5).map do Thread.new do - manager = Scheduler::Manager.new(DiscourseRedis.new) + manager = Scheduler::Manager.new(DiscourseRedis.new, enable_stats: false) manager.blocking_tick manager.stop! end From e11c83341c7001c693f8f4e155c801ab90335866 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 30 May 2016 12:43:01 +1000 Subject: [PATCH 031/320] add more specs --- spec/components/scheduler/manager_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/components/scheduler/manager_spec.rb b/spec/components/scheduler/manager_spec.rb index 8b1bff1a8..6811d2d51 100644 --- a/spec/components/scheduler/manager_spec.rb +++ b/spec/components/scheduler/manager_spec.rb @@ -58,6 +58,14 @@ describe Scheduler::Manager do Scheduler::Manager.new(DiscourseRedis.new, enable_stats: false) } + it 'can disable stats' do + manager = Scheduler::Manager.new(DiscourseRedis.new, enable_stats: false) + expect(manager.enable_stats).to eq(false) + + manager = Scheduler::Manager.new(DiscourseRedis.new) + expect(manager.enable_stats).to eq(true) + end + before do $redis.del manager.class.lock_key $redis.del manager.class.queue_key @@ -140,6 +148,7 @@ describe Scheduler::Manager do Testing::RandomJob.runs = 0 info = manager.schedule_info(Testing::RandomJob) + manager.enable_stats = true info.next_run = Time.now.to_i - 1 info.write! @@ -151,11 +160,13 @@ describe Scheduler::Manager do expect(stat).to be_present expect(stat.duration_ms).to be > 0 expect(stat.success).to be true + SchedulerStat.destroy_all end it 'should log when jobs start running' do info = manager.schedule_info(Testing::SuperLongJob) + manager.enable_stats = true info.next_run = Time.now.to_i - 1 info.write! @@ -164,6 +175,7 @@ describe Scheduler::Manager do stat = SchedulerStat.first expect(stat).to be_present + SchedulerStat.destroy_all end it 'should only run pending job once' do From cb5be1fe8f7032d4d648a375e5fcb516ba3a1541 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 30 May 2016 11:38:04 +0800 Subject: [PATCH 032/320] Upgrade rspec to 3.4.0. --- Gemfile | 2 +- Gemfile.lock | 34 +++++++++---------- app/models/user.rb | 7 ++-- lib/plugin/filter_manager.rb | 2 +- spec/components/plugin/filter_manager_spec.rb | 4 +-- spec/components/topic_query_spec.rb | 2 +- .../directory_items_controller_spec.rb | 2 +- .../omniauth_callbacks_controller_spec.rb | 4 +-- .../user_actions_controller_spec.rb | 2 +- .../user_badges_controller_spec.rb | 4 +-- spec/jobs/jobs_base_spec.rb | 2 +- spec/models/post_action_spec.rb | 2 +- spec/models/topic_spec.rb | 6 ++-- spec/models/user_spec.rb | 4 +-- spec/rails_helper.rb | 7 ---- 15 files changed, 40 insertions(+), 44 deletions(-) diff --git a/Gemfile b/Gemfile index 29c9292d0..ab8d2856f 100644 --- a/Gemfile +++ b/Gemfile @@ -125,7 +125,7 @@ group :test do end group :test, :development do - gem 'rspec', '~> 3.2.0' + gem 'rspec' gem 'mock_redis' gem 'listen', '0.7.3', require: false gem 'certified', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 995efb13e..f54b09ea2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -294,33 +294,33 @@ GEM netrc (~> 0.7) rinku (2.0.0) rmmseg-cpp (0.2.9) - rspec (3.2.0) - rspec-core (~> 3.2.0) - rspec-expectations (~> 3.2.0) - rspec-mocks (~> 3.2.0) - rspec-core (3.2.3) - rspec-support (~> 3.2.0) - rspec-expectations (3.2.1) + rspec (3.4.0) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-core (3.4.4) + rspec-support (~> 3.4.0) + rspec-expectations (3.4.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.2.0) + rspec-support (~> 3.4.0) rspec-given (3.7.1) given_core (= 3.7.1) rspec (>= 2.14.0) rspec-html-matchers (0.7.0) nokogiri (~> 1) rspec (~> 3) - rspec-mocks (3.2.1) + rspec-mocks (3.4.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.2.0) - rspec-rails (3.2.3) + rspec-support (~> 3.4.0) + rspec-rails (3.4.2) actionpack (>= 3.0, < 4.3) activesupport (>= 3.0, < 4.3) railties (>= 3.0, < 4.3) - rspec-core (~> 3.2.0) - rspec-expectations (~> 3.2.0) - rspec-mocks (~> 3.2.0) - rspec-support (~> 3.2.0) - rspec-support (3.2.2) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-support (~> 3.4.0) + rspec-support (3.4.1) rtlit (0.0.5) ruby-openid (2.7.0) ruby-readability (0.7.0) @@ -475,7 +475,7 @@ DEPENDENCIES rest-client rinku rmmseg-cpp - rspec (~> 3.2.0) + rspec rspec-given rspec-html-matchers rspec-rails diff --git a/app/models/user.rb b/app/models/user.rb index a4917e0ee..bff292523 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -613,7 +613,10 @@ class User < ActiveRecord::Base # Use this helper to determine if the user has a particular trust level. # Takes into account admin, etc. def has_trust_level?(level) - raise "Invalid trust level #{level}" unless TrustLevel.valid?(level) + unless TrustLevel.valid?(level) + raise InvalidTrustLevel.new("Invalid trust level #{level}") + end + admin? || moderator? || staged? || TrustLevel.compare(trust_level, level) end @@ -907,7 +910,7 @@ class User < ActiveRecord::Base end def hash_password(password, salt) - raise "password is too long" if password.size > User.max_password_length + raise StandardError.new("password is too long") if password.size > User.max_password_length Pbkdf2.hash_password(password, salt, Rails.configuration.pbkdf2_iterations, Rails.configuration.pbkdf2_algorithm) end diff --git a/lib/plugin/filter_manager.rb b/lib/plugin/filter_manager.rb index 10da578bd..34b76a1e1 100644 --- a/lib/plugin/filter_manager.rb +++ b/lib/plugin/filter_manager.rb @@ -6,7 +6,7 @@ module Plugin end def register(name, &blk) - raise ArgumentException unless blk && blk.arity == 2 + raise ArgumentError unless blk && blk.arity == 2 filters = @map[name] ||= [] filters << blk end diff --git a/spec/components/plugin/filter_manager_spec.rb b/spec/components/plugin/filter_manager_spec.rb index 44e98d530..285a2c8df 100644 --- a/spec/components/plugin/filter_manager_spec.rb +++ b/spec/components/plugin/filter_manager_spec.rb @@ -20,7 +20,7 @@ describe Plugin::FilterManager do expect do instance.register(:test) do end - end.to raise_exception + end.to raise_error(ArgumentError) end it "should return the original if no filters exist" do @@ -30,6 +30,6 @@ describe Plugin::FilterManager do it "should raise an exception if no block is passed in" do expect do instance.register(:test) - end.to raise_exception + end.to raise_error(ArgumentError) end end diff --git a/spec/components/topic_query_spec.rb b/spec/components/topic_query_spec.rb index d3298a9dc..8874bcabb 100644 --- a/spec/components/topic_query_spec.rb +++ b/spec/components/topic_query_spec.rb @@ -416,7 +416,7 @@ describe TopicQuery do TopicList.preloaded_custom_fields.clear # if we attempt to access non preloaded fields explode - expect{new_topic.custom_fields["boom"]}.to raise_error + expect{new_topic.custom_fields["boom"]}.to raise_error(StandardError) end end diff --git a/spec/controllers/directory_items_controller_spec.rb b/spec/controllers/directory_items_controller_spec.rb index 38132d8e2..fa33e8af9 100644 --- a/spec/controllers/directory_items_controller_spec.rb +++ b/spec/controllers/directory_items_controller_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe DirectoryItemsController do it "requires a `period` param" do - expect{ xhr :get, :index }.to raise_error + expect{ xhr :get, :index }.to raise_error(ActionController::ParameterMissing) end it "requires a proper `period` param" do diff --git a/spec/controllers/omniauth_callbacks_controller_spec.rb b/spec/controllers/omniauth_callbacks_controller_spec.rb index 62f803cea..de2a7d8f4 100644 --- a/spec/controllers/omniauth_callbacks_controller_spec.rb +++ b/spec/controllers/omniauth_callbacks_controller_spec.rb @@ -7,13 +7,13 @@ describe Users::OmniauthCallbacksController do SiteSetting.stubs("enable_twitter_logins?").returns(false) expect(lambda { Users::OmniauthCallbacksController.find_authenticator("twitter") - }).to raise_error + }).to raise_error(Discourse::InvalidAccess) end it "fails for unknown" do expect(lambda { Users::OmniauthCallbacksController.find_authenticator("twitter1") - }).to raise_error + }).to raise_error(Discourse::InvalidAccess) end it "finds an authenticator when enabled" do diff --git a/spec/controllers/user_actions_controller_spec.rb b/spec/controllers/user_actions_controller_spec.rb index b1914dea2..a161c2f90 100644 --- a/spec/controllers/user_actions_controller_spec.rb +++ b/spec/controllers/user_actions_controller_spec.rb @@ -5,7 +5,7 @@ describe UserActionsController do context 'index' do it 'fails if username is not specified' do - expect { xhr :get, :index }.to raise_error + expect { xhr :get, :index }.to raise_error(ActionController::ParameterMissing) end it 'renders list correctly' do diff --git a/spec/controllers/user_badges_controller_spec.rb b/spec/controllers/user_badges_controller_spec.rb index 0046f6140..8047d8571 100644 --- a/spec/controllers/user_badges_controller_spec.rb +++ b/spec/controllers/user_badges_controller_spec.rb @@ -24,7 +24,7 @@ describe UserBadgesController do let!(:user_badge) { UserBadge.create(badge: badge, user: user, granted_by: Discourse.system_user, granted_at: Time.now) } it 'requires username or badge_id to be specified' do - expect { xhr :get, :index }.to raise_error + expect { xhr :get, :index }.to raise_error(ActionController::ParameterMissing) end it 'returns user_badges for a user' do @@ -54,7 +54,7 @@ describe UserBadgesController do context 'create' do it 'requires username to be specified' do - expect { xhr :post, :create, badge_id: badge.id }.to raise_error + expect { xhr :post, :create, badge_id: badge.id }.to raise_error(ActionController::ParameterMissing) end it 'does not allow regular users to grant badges' do diff --git a/spec/jobs/jobs_base_spec.rb b/spec/jobs/jobs_base_spec.rb index c8ab2ab56..4388dc488 100644 --- a/spec/jobs/jobs_base_spec.rb +++ b/spec/jobs/jobs_base_spec.rb @@ -32,7 +32,7 @@ describe Jobs::Base do Discourse.expects(:handle_job_exception).times(3) bad = BadJob.new - expect{bad.perform({})}.to raise_error + expect{bad.perform({})}.to raise_error(Jobs::HandledExceptionWrapper) expect(bad.fail_count).to eq(3) end diff --git a/spec/models/post_action_spec.rb b/spec/models/post_action_spec.rb index e5809521e..9321dedd8 100644 --- a/spec/models/post_action_spec.rb +++ b/spec/models/post_action_spec.rb @@ -29,7 +29,7 @@ describe PostAction do expect { PostAction.act(eviltrout, post, PostActionType.types[:like]) - }.to raise_error + }.to raise_error(RateLimiter::LimitExceeded) end end diff --git a/spec/models/topic_spec.rb b/spec/models/topic_spec.rb index e9b8b84cf..e1f48980f 100644 --- a/spec/models/topic_spec.rb +++ b/spec/models/topic_spec.rb @@ -443,7 +443,7 @@ describe Topic do expect { topic.invite(topic.user, "user@example.com") - }.to raise_exception + }.to raise_error(RateLimiter::LimitExceeded) end context 'bumping topics' do @@ -1483,7 +1483,7 @@ describe Topic do freeze_time(start + 10.minutes) expect { create_post(user: user) - }.to raise_exception + }.to raise_error(RateLimiter::LimitExceeded) freeze_time(start + 20.minutes) create_post(user: user, topic_id: topic_id) @@ -1492,7 +1492,7 @@ describe Topic do expect { create_post(user: user, topic_id: topic_id) - }.to raise_exception + }.to raise_error(RateLimiter::LimitExceeded) end describe ".count_exceeds_minimun?" do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 63a0dcfb2..4fbd120a6 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -204,7 +204,7 @@ describe User do describe 'has_trust_level?' do it "raises an error with an invalid level" do - expect { user.has_trust_level?(:wat) }.to raise_error + expect { user.has_trust_level?(:wat) }.to raise_error(InvalidTrustLevel) end it "is true for your basic level" do @@ -1106,7 +1106,7 @@ describe User do end it "raises an error when passwords are too long" do - expect { hash(too_long, 'gravy') }.to raise_error + expect { hash(too_long, 'gravy') }.to raise_error(StandardError) end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 354cb630d..30921a6e3 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -78,13 +78,6 @@ Spork.prefork do SiteSetting.defaults[k] = v end - # Monkey patch for NoMethodError: undefined method `cache' for nil:NilClass - # https://github.com/rspec/rspec-rails/issues/1532#issuecomment-174679485 - # fixed in Rspec 3.4.1 - RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator.class_eval do - alias_method :find_all_anywhere, :find_all - end - require_dependency 'site_settings/local_process_provider' SiteSetting.provider = SiteSettings::LocalProcessProvider.new end From 880b7e105322283b24fe635d417262717ea4f585 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 30 May 2016 11:50:02 +0800 Subject: [PATCH 033/320] FIX: Connections were incorrectly going to master when failing over. --- .../connection_adapters/postgresql_fallback_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb index 857cc28b5..b52a6c12a 100644 --- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb +++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb @@ -79,7 +79,7 @@ class PostgreSQLFallbackHandler end def verify? - !master && !running && !recently_checked? + !master && !running end private From 706624c9fcaf0b10b2d1ada952c5a177b9bedf59 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 30 May 2016 13:59:16 +1000 Subject: [PATCH 034/320] workaround incorrect uncategorized category id set in site settings --- db/fixtures/001_categories.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/fixtures/001_categories.rb b/db/fixtures/001_categories.rb index edc23155f..c6880b533 100644 --- a/db/fixtures/001_categories.rb +++ b/db/fixtures/001_categories.rb @@ -2,7 +2,10 @@ ActiveRecord::Base.send(:subclasses).each{|m| m.reset_column_information} SiteSetting.refresh! -if SiteSetting.uncategorized_category_id == -1 || !Category.exists?(SiteSetting.uncategorized_category_id) +uncat_id = SiteSetting.uncategorized_category_id +uncat_id = -1 unless Numeric === uncat_id + +if uncat_id == -1 || !Category.exists?(uncat_id) puts "Seeding uncategorized category!" result = Category.exec_sql "SELECT 1 FROM categories WHERE lower(name) = 'uncategorized'" From 3eec0a83b012c318b7362928567678dbfc56542d Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 30 May 2016 13:59:39 +1000 Subject: [PATCH 035/320] clean up stop semantics and bypass test --- lib/scheduler/manager.rb | 30 +++++++++-- spec/components/scheduler/manager_spec.rb | 62 ++++++++++------------- 2 files changed, 53 insertions(+), 39 deletions(-) diff --git a/lib/scheduler/manager.rb b/lib/scheduler/manager.rb index 0e264d249..1846aa766 100644 --- a/lib/scheduler/manager.rb +++ b/lib/scheduler/manager.rb @@ -12,11 +12,12 @@ module Scheduler class Runner def initialize(manager) + @stopped = false @mutex = Mutex.new @queue = Queue.new @manager = manager @reschedule_orphans_thread = Thread.new do - while true + while !@stopped sleep 1.minute @mutex.synchronize do reschedule_orphans @@ -24,7 +25,7 @@ module Scheduler end end @keep_alive_thread = Thread.new do - while true + while !@stopped @mutex.synchronize do keep_alive end @@ -32,8 +33,17 @@ module Scheduler end end @thread = Thread.new do - while true - process_queue + while !@stopped + if @manager.enable_stats + begin + RailsMultisite::ConnectionManagement.establish_connection(db: "default") + process_queue + ensure + ActiveRecord::Base.connection_handler.clear_active_connections! + end + else + process_queue + end end end end @@ -60,6 +70,8 @@ module Scheduler def process_queue klass = @queue.deq + return unless klass + # hack alert, I need to both deq and set @running atomically. @running = true failed = false @@ -108,9 +120,17 @@ module Scheduler def stop! @mutex.synchronize do - @thread.kill + @stopped = true + @keep_alive_thread.kill @reschedule_orphans_thread.kill + + enq(nil) + + Thread.new do + sleep 5 + @thread.kill + end end end diff --git a/spec/components/scheduler/manager_spec.rb b/spec/components/scheduler/manager_spec.rb index 6811d2d51..b72e3d519 100644 --- a/spec/components/scheduler/manager_spec.rb +++ b/spec/components/scheduler/manager_spec.rb @@ -58,6 +58,14 @@ describe Scheduler::Manager do Scheduler::Manager.new(DiscourseRedis.new, enable_stats: false) } + before { + expect(ActiveRecord::Base.connection_pool.connections.length).to eq(1) + } + + after { + expect(ActiveRecord::Base.connection_pool.connections.length).to eq(1) + } + it 'can disable stats' do manager = Scheduler::Manager.new(DiscourseRedis.new, enable_stats: false) expect(manager.enable_stats).to eq(false) @@ -143,40 +151,26 @@ describe Scheduler::Manager do expect(info.next_run).to be <= Time.now.to_i end - it 'should log when job finishes running' do - - Testing::RandomJob.runs = 0 - - info = manager.schedule_info(Testing::RandomJob) - manager.enable_stats = true - info.next_run = Time.now.to_i - 1 - info.write! - - manager = Scheduler::Manager.new(DiscourseRedis.new) - manager.blocking_tick - manager.stop! - - stat = SchedulerStat.first - expect(stat).to be_present - expect(stat.duration_ms).to be > 0 - expect(stat.success).to be true - SchedulerStat.destroy_all - - end - - it 'should log when jobs start running' do - info = manager.schedule_info(Testing::SuperLongJob) - manager.enable_stats = true - info.next_run = Time.now.to_i - 1 - info.write! - - manager.tick - manager.stop! - - stat = SchedulerStat.first - expect(stat).to be_present - SchedulerStat.destroy_all - end + # something about logging jobs causing a leak in connection pool in test + # it 'should log when job finishes running' do + # + # Testing::RandomJob.runs = 0 + # + # info = manager.schedule_info(Testing::RandomJob) + # info.next_run = Time.now.to_i - 1 + # info.write! + # + # # with stats so we must be careful to cleanup + # manager = Scheduler::Manager.new(DiscourseRedis.new) + # manager.blocking_tick + # manager.stop! + # + # stat = SchedulerStat.first + # expect(stat).to be_present + # expect(stat.duration_ms).to be > 0 + # expect(stat.success).to be true + # SchedulerStat.destroy_all + # end it 'should only run pending job once' do From 1caaf5208f95d41a5bd30f589b7bdeec9707c8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 30 May 2016 09:46:27 +0200 Subject: [PATCH 036/320] move tombstone under 'uploads/' for easier deployment --- lib/file_store/local_store.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/file_store/local_store.rb b/lib/file_store/local_store.rb index e9bbdab6a..5054c7cc8 100644 --- a/lib/file_store/local_store.rb +++ b/lib/file_store/local_store.rb @@ -13,9 +13,9 @@ module FileStore return unless is_relative?(url) path = public_dir + url return if !File.exists?(path) - tombstone = public_dir + url.sub("/uploads/", "/tombstone/") - FileUtils.mkdir_p(Pathname.new(tombstone).dirname) - FileUtils.move(path, tombstone, :force => true) + tombstone = public_dir + url.sub("/uploads/", "/uploads/tombstone/") + FileUtils.mkdir_p(tombstone_dir) + FileUtils.move(path, tombstone, force: true) end def has_been_uploaded?(url) @@ -85,7 +85,7 @@ module FileStore end def tombstone_dir - public_dir + relative_base_url.sub("/uploads/", "/tombstone/") + public_dir + relative_base_url.sub("/uploads/", "/uploads/tombstone/") end end From 116efffdaad04ca4357fffa827ef236f93454378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 30 May 2016 17:11:17 +0200 Subject: [PATCH 037/320] FEATURE: webhooks support for mailgun --- app/controllers/webhooks_controller.rb | 77 ++++++++++++++++++++ app/models/admin_dashboard_data.rb | 7 ++ config/locales/server.en.yml | 2 + config/routes.rb | 2 + config/site_settings.yml | 3 + lib/email/receiver.rb | 8 +- spec/controllers/webhooks_controller_spec.rb | 34 +++++++++ 7 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 app/controllers/webhooks_controller.rb create mode 100644 spec/controllers/webhooks_controller_spec.rb diff --git a/app/controllers/webhooks_controller.rb b/app/controllers/webhooks_controller.rb new file mode 100644 index 000000000..f12786127 --- /dev/null +++ b/app/controllers/webhooks_controller.rb @@ -0,0 +1,77 @@ +require "openssl" + +class WebhooksController < ActionController::Base + + def mailgun + # can't verify data without an API key + return mailgun_failure if SiteSetting.mailgun_api_key.blank? + + # token is a random string of 50 characters + token = params.delete("token") + return mailgun_failure if token.blank? || token.size != 50 + + # prevent replay attack + key = "mailgun_token_#{token}" + return mailgun_failure unless $redis.setnx(key, 1) + $redis.expire(key, 8.hours) + + # ensure timestamp isn't too far from current time + timestamp = params.delete("timestamp") + return mailgun_failure if (Time.at(timestamp.to_i) - Time.now).abs > 1.hour.to_i + + # check the signature + return mailgun_failure unless mailgun_verify(timestamp, token, params["signature"]) + + handled = false + event = params.delete("event") + + # only handle soft bounces, because hard bounces are also handled + # by the "dropped" event and we don't want to increase bounce score twice + # for the same message + if event == "bounced".freeze && params["error"]["4."] + handled = mailgun_process(params, Email::Receiver::SOFT_BOUNCE_SCORE) + elsif event == "dropped".freeze + handled = mailgun_process(params, Email::Receiver::HARD_BOUNCE_SCORE) + end + + handled ? mailgun_success : mailgun_failure + end + + private + + def mailgun_failure + render nothing: true, status: 406 + end + + def mailgun_success + render nothing: true, status: 200 + end + + def mailgun_verify(timestamp, token, signature) + digest = OpenSSL::Digest::SHA256.new + data = "#{timestamp}#{token}" + signature == OpenSSL::HMAC.hexdigest(digest, SiteSetting.mailgun_api_key, data) + end + + def mailgun_process(params, bounce_score) + return false if params["message-headers"].blank? + + return_path_header = params["message-headers"].first { |h| h[0] == "Return-Path".freeze } + return false if return_path_header.blank? + + return_path = return_path_header[1] + return false if return_path.blank? + + bounce_key = return_path[/\+verp-(\h{32})@/, 1] + return false if bounce_key.blank? + + email_log = EmailLog.find_by(bounce_key: bounce_key) + return false if email_log.nil? + + email_log.update_columns(bounced: true) + Email::Receiver.update_bounce_score(email_log.user.email, bounce_score) + + true + end + +end diff --git a/app/models/admin_dashboard_data.rb b/app/models/admin_dashboard_data.rb index b5ca6de75..66a31f887 100644 --- a/app/models/admin_dashboard_data.rb +++ b/app/models/admin_dashboard_data.rb @@ -266,4 +266,11 @@ class AdminDashboardData I18n.t('dashboard.email_polling_errored_recently', count: errors) if errors > 0 end + def missing_mailgun_api_key + return unless SiteSetting.reply_by_email_enabled + return unless ActionMailer::Base.smtp_settings[:address]["smtp.mailgun.org"] + return unless SiteSetting.mailgun_api_key.blank? + I18n.t('dashboard.missing_mailgun_api_key') + end + end diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index ff4ca0f80..11da9082f 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -798,6 +798,7 @@ en: email_polling_errored_recently: one: "Email polling has generated an error in the past 24 hours. Look at the logs for more details." other: "Email polling has generated %{count} errors in the past 24 hours. Look at the logs for more details." + missing_mailgun_api_key: "The server is configured to send emails via mailgun but you haven't provided an API key used the verify the webhook messages." bad_favicon_url: "The favicon is failing to load. Check your favicon_url setting in Site Settings." poll_pop3_timeout: "Connection to the POP3 server is timing out. Incoming email could not be retrieved. Please check your POP3 settings and service provider." poll_pop3_auth_error: "Connection to the POP3 server is failing with an authentication error. Please check your POP3 settings." @@ -1185,6 +1186,7 @@ en: block_auto_generated_emails: "Block incoming emails identified as being auto generated." bounce_score_threshold: "Max score before we will stop emailing a user. Soft bounce adds 1, hard bounce adds 2, score reset 30 days after last bounce." ignore_by_title: "Ignore incoming emails based on their title." + mailgun_api_key: "Mailgun API key used to verify webhook messages." manual_polling_enabled: "Push emails using the API for email replies." pop3_polling_enabled: "Poll via POP3 for email replies." diff --git a/config/routes.rb b/config/routes.rb index 21459fc9c..9a1675e24 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,6 +16,8 @@ Discourse::Application.routes.draw do match "/404", to: "exceptions#not_found", via: [:get, :post] get "/404-body" => "exceptions#not_found_body" + post "webhooks/mailgun" => "webhooks#mailgun" + if Rails.env.development? mount Sidekiq::Web => "/sidekiq" mount Logster::Web => "/logs" diff --git a/config/site_settings.yml b/config/site_settings.yml index 828ddf1dd..e3176161f 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -582,6 +582,9 @@ email: ignore_by_title: type: list default: '' + mailgun_api_key: + default: '' + regex: '^pubkey-\h{32}$' files: diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb index d71cf8ca7..af3245fde 100644 --- a/lib/email/receiver.rb +++ b/lib/email/receiver.rb @@ -151,12 +151,12 @@ module Email if @mail.error_status.present? if @mail.error_status.start_with?("4.") - update_bounce_score(email_log.user.email, SOFT_BOUNCE_SCORE) + Email::Receiver.update_bounce_score(email_log.user.email, SOFT_BOUNCE_SCORE) elsif @mail.error_status.start_with?("5.") - update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE) + Email::Receiver.update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE) end elsif is_auto_generated? - update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE) + Email::Receiver.update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE) end end end @@ -168,7 +168,7 @@ module Email @verp ||= all_destinations.select { |to| to[/\+verp-\h{32}@/] }.first end - def update_bounce_score(email, score) + def self.update_bounce_score(email, score) # only update bounce score once per day key = "bounce_score:#{email}:#{Date.today}" diff --git a/spec/controllers/webhooks_controller_spec.rb b/spec/controllers/webhooks_controller_spec.rb new file mode 100644 index 000000000..662833b49 --- /dev/null +++ b/spec/controllers/webhooks_controller_spec.rb @@ -0,0 +1,34 @@ +require "rails_helper" + +describe WebhooksController do + + context "mailgun" do + + + it "works" do + SiteSetting.mailgun_api_key = "pubkey-8221462f0c915af3f6f2e2df7aa5a493" + token = "705a8ccd2ce932be8e98c221fe701c1b4a0afcb8bbd57726de" + + user = Fabricate(:user, email: "em@il.com") + email_log = Fabricate(:email_log, user: user, bounce_key: SecureRandom.hex) + return_path = "foo+verp-#{email_log.bounce_key}@bar.com" + + $redis.del("mailgun_token_#{token}") + $redis.del("bounce_score:#{user.email}:#{Date.today}") + WebhooksController.any_instance.expects(:mailgun_verify).returns(true) + + post :mailgun, "token" => token, + "timestamp" => Time.now.to_i, + "event" => "dropped", + "message-headers" => [["Return-Path", return_path]] + + expect(response).to be_success + + email_log.reload + expect(email_log.bounced).to eq(true) + expect(email_log.user.user_stat.bounce_score).to eq(2) + end + + end + +end From be057dfb75ad5cdb5c10800003da99134f01b355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 30 May 2016 19:29:29 +0200 Subject: [PATCH 038/320] fix no replies string --- app/assets/javascripts/discourse/templates/user/summary.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/templates/user/summary.hbs b/app/assets/javascripts/discourse/templates/user/summary.hbs index 1b1a12eb9..ebb483b78 100644 --- a/app/assets/javascripts/discourse/templates/user/summary.hbs +++ b/app/assets/javascripts/discourse/templates/user/summary.hbs @@ -108,7 +108,7 @@ {{/each}} {{else}} -

{{i18n "user.summary.no_likes"}}

+

{{i18n "user.summary.no_replies"}}

{{/if}}
From 26f25fc0d98c19c7f2742ec2973d236442acb960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 30 May 2016 19:48:46 +0200 Subject: [PATCH 039/320] FIX: most liked queries were leaking info in user summaries --- app/models/topic.rb | 2 +- app/models/user_summary.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/topic.rb b/app/models/topic.rb index 5694d3c0c..6a568f549 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -129,7 +129,7 @@ class Topic < ActiveRecord::Base # Return private message topics scope :private_messages, -> { where(archetype: Archetype.private_message) } - scope :listable_topics, -> { where('topics.archetype <> ?', [Archetype.private_message]) } + scope :listable_topics, -> { where('topics.archetype <> ?', Archetype.private_message) } scope :by_newest, -> { order('topics.created_at desc, topics.id desc') } diff --git a/app/models/user_summary.rb b/app/models/user_summary.rb index dd14be6e2..abfc9b8f5 100644 --- a/app/models/user_summary.rb +++ b/app/models/user_summary.rb @@ -53,7 +53,7 @@ class UserSummary def most_liked_by_users likers = {} UserAction.joins(:target_topic, :target_post) - .where('topics.archetype <> ?', Archetype.private_message) + .merge(Topic.listable_topics.visible.secured(@guardian)) .where(user: @user) .where(action_type: UserAction::WAS_LIKED) .group(:acting_user_id) @@ -78,7 +78,7 @@ class UserSummary def most_liked_users liked_users = {} UserAction.joins(:target_topic, :target_post) - .where('topics.archetype <> ?', Archetype.private_message) + .merge(Topic.listable_topics.visible.secured(@guardian)) .where(action_type: UserAction::WAS_LIKED) .where(acting_user_id: @user.id) .group(:user_id) From 6796b1585797306cff8bb0a9104f7bb7f19ac919 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 30 May 2016 16:37:06 -0400 Subject: [PATCH 040/320] FEATURE: restrict tags to be used in a category --- .../components/edit-category-tags.js.es6 | 4 ++ .../discourse/components/tag-chooser.js.es6 | 6 +- .../discourse/models/category.js.es6 | 3 +- .../components/edit-category-tags.hbs | 4 ++ .../discourse/templates/composer.hbs | 2 +- .../templates/modal/edit-category.hbs | 3 + .../javascripts/discourse/templates/topic.hbs | 2 +- app/controllers/categories_controller.rb | 3 +- app/controllers/tags_controller.rb | 21 +++---- app/models/category.rb | 9 +++ app/models/category_tag.rb | 4 ++ app/models/tag.rb | 7 ++- app/serializers/category_serializer.rb | 11 +++- config/locales/client.en.yml | 3 + .../20160527191614_create_category_tags.rb | 12 ++++ lib/discourse_tagging.rb | 51 +++++++++++++---- spec/integration/category_tag_spec.rb | 55 +++++++++++++++++++ 17 files changed, 168 insertions(+), 32 deletions(-) create mode 100644 app/assets/javascripts/discourse/components/edit-category-tags.js.es6 create mode 100644 app/assets/javascripts/discourse/templates/components/edit-category-tags.hbs create mode 100644 app/models/category_tag.rb create mode 100644 db/migrate/20160527191614_create_category_tags.rb create mode 100644 spec/integration/category_tag_spec.rb diff --git a/app/assets/javascripts/discourse/components/edit-category-tags.js.es6 b/app/assets/javascripts/discourse/components/edit-category-tags.js.es6 new file mode 100644 index 000000000..22bf364e9 --- /dev/null +++ b/app/assets/javascripts/discourse/components/edit-category-tags.js.es6 @@ -0,0 +1,4 @@ +import { buildCategoryPanel } from 'discourse/components/edit-category-panel'; + +export default buildCategoryPanel('tags', { +}); diff --git a/app/assets/javascripts/discourse/components/tag-chooser.js.es6 b/app/assets/javascripts/discourse/components/tag-chooser.js.es6 index 88e7577d1..e69ba2df5 100644 --- a/app/assets/javascripts/discourse/components/tag-chooser.js.es6 +++ b/app/assets/javascripts/discourse/components/tag-chooser.js.es6 @@ -6,7 +6,7 @@ function formatTag(t) { export default Ember.TextField.extend({ classNameBindings: [':tag-chooser'], - attributeBindings: ['tabIndex'], + attributeBindings: ['tabIndex', 'placeholderKey', 'categoryId'], _setupTags: function() { const tags = this.get('tags') || []; @@ -25,7 +25,7 @@ export default Ember.TextField.extend({ this.$().select2({ tags: true, - placeholder: I18n.t('tagging.choose_for_topic'), + placeholder: I18n.t(this.get('placeholderKey') || 'tagging.choose_for_topic'), maximumInputLength: this.siteSettings.max_tag_length, maximumSelectionSize: this.siteSettings.max_tags_per_topic, initSelection(element, callback) { @@ -78,7 +78,7 @@ export default Ember.TextField.extend({ url: Discourse.getURL("/tags/filter/search"), dataType: 'json', data: function (term) { - return { q: term, limit: self.siteSettings.max_tag_search_results, filterForInput: true }; + return { q: term, limit: self.siteSettings.max_tag_search_results, filterForInput: true, categoryId: self.get('categoryId') }; }, results: function (data) { if (self.siteSettings.tags_sort_alphabetically) { diff --git a/app/assets/javascripts/discourse/models/category.js.es6 b/app/assets/javascripts/discourse/models/category.js.es6 index 37cfd9f29..0e013cf83 100644 --- a/app/assets/javascripts/discourse/models/category.js.es6 +++ b/app/assets/javascripts/discourse/models/category.js.es6 @@ -86,7 +86,8 @@ const Category = RestModel.extend({ allow_badges: this.get('allow_badges'), custom_fields: this.get('custom_fields'), topic_template: this.get('topic_template'), - suppress_from_homepage: this.get('suppress_from_homepage') + suppress_from_homepage: this.get('suppress_from_homepage'), + allowed_tags: this.get('allowed_tags') }, type: this.get('id') ? 'PUT' : 'POST' }); diff --git a/app/assets/javascripts/discourse/templates/components/edit-category-tags.hbs b/app/assets/javascripts/discourse/templates/components/edit-category-tags.hbs new file mode 100644 index 000000000..632690bed --- /dev/null +++ b/app/assets/javascripts/discourse/templates/components/edit-category-tags.hbs @@ -0,0 +1,4 @@ +
+

{{i18n 'category.tags_allowed_tags'}}

+ {{tag-chooser placeholderKey="category.tags_placeholder" tags=category.allowed_tags}} +
diff --git a/app/assets/javascripts/discourse/templates/composer.hbs b/app/assets/javascripts/discourse/templates/composer.hbs index 44c91b570..eb72ca673 100644 --- a/app/assets/javascripts/discourse/templates/composer.hbs +++ b/app/assets/javascripts/discourse/templates/composer.hbs @@ -98,7 +98,7 @@
{{plugin-outlet "composer-fields-below"}} {{#if canEditTags}} - {{tag-chooser tags=model.tags tabIndex="4"}} + {{tag-chooser tags=model.tags tabIndex="4" categoryId=model.categoryId}} {{/if}} {{i18n 'cancel'}} diff --git a/app/assets/javascripts/discourse/templates/modal/edit-category.hbs b/app/assets/javascripts/discourse/templates/modal/edit-category.hbs index 6cde3451d..10282704c 100644 --- a/app/assets/javascripts/discourse/templates/modal/edit-category.hbs +++ b/app/assets/javascripts/discourse/templates/modal/edit-category.hbs @@ -7,6 +7,9 @@ {{edit-category-tab panels=panels selectedTab=selectedTab tab="settings"}} {{edit-category-tab panels=panels selectedTab=selectedTab tab="images"}} {{edit-category-tab panels=panels selectedTab=selectedTab tab="topic-template"}} + {{#if siteSettings.tagging_enabled}} + {{edit-category-tab panels=panels selectedTab=selectedTab tab="tags"}} + {{/if}} From 171dbd4b099558fd5c9e688cba261e65e4db9b03 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 9 Jun 2016 15:51:46 -0400 Subject: [PATCH 260/320] Allow redirects on Facebook Browser --- .../users/omniauth_callbacks/complete.html.erb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/views/users/omniauth_callbacks/complete.html.erb b/app/views/users/omniauth_callbacks/complete.html.erb index 3d4f96cea..07bd70146 100644 --- a/app/views/users/omniauth_callbacks/complete.html.erb +++ b/app/views/users/omniauth_callbacks/complete.html.erb @@ -22,17 +22,14 @@

<%=t "login.close_window" %>

From a6090339a7986fcb0bcea0a9966cab7a62d65539 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 9 Jun 2016 16:00:19 -0400 Subject: [PATCH 261/320] FEATURE: tag group options: limit usage of one tag per group, tags in a group can't be used unless a prerequisite tag is used --- .../discourse/components/tag-chooser.js.es6 | 16 ++- .../discourse/models/tag-group.js.es6 | 4 +- .../discourse/templates/tag-groups-show.hbs | 26 +++-- .../stylesheets/common/base/tagging.scss | 14 +++ app/controllers/tag_groups_controller.rb | 7 +- app/controllers/tags_controller.rb | 9 +- app/models/tag_group.rb | 12 ++ app/models/tag_group_membership.rb | 2 +- app/serializers/tag_group_serializer.rb | 6 +- config/locales/client.en.yml | 4 + .../20160607213656_add_tag_group_options.rb | 6 + lib/discourse_tagging.rb | 67 ++++++++--- spec/fabricators/tag_fabricator.rb | 2 +- spec/integration/category_tag_spec.rb | 109 ++++++++++++++++-- 14 files changed, 243 insertions(+), 41 deletions(-) create mode 100644 db/migrate/20160607213656_add_tag_group_options.rb diff --git a/app/assets/javascripts/discourse/components/tag-chooser.js.es6 b/app/assets/javascripts/discourse/components/tag-chooser.js.es6 index d9b3863cf..4f33e3b6d 100644 --- a/app/assets/javascripts/discourse/components/tag-chooser.js.es6 +++ b/app/assets/javascripts/discourse/components/tag-chooser.js.es6 @@ -36,12 +36,19 @@ export default Ember.TextField.extend({ const site = this.site, self = this, filterRegexp = new RegExp(this.site.tags_filter_regexp, "g"); + var limit = this.siteSettings.max_tags_per_topic; + + if (this.get('unlimitedTagCount')) { + limit = null; + } else if (this.get('limit')) { + limit = parseInt(this.get('limit')); + } this.$().select2({ tags: true, placeholder: I18n.t(this.get('placeholderKey') || 'tagging.choose_for_topic'), maximumInputLength: this.siteSettings.max_tag_length, - maximumSelectionSize: self.get('unlimitedTagCount') ? null : this.siteSettings.max_tags_per_topic, + maximumSelectionSize: limit, initSelection(element, callback) { const data = []; @@ -92,7 +99,12 @@ export default Ember.TextField.extend({ url: Discourse.getURL("/tags/filter/search"), dataType: 'json', data: function (term) { - const d = { q: term, limit: self.siteSettings.max_tag_search_results, categoryId: self.get('categoryId') }; + const d = { + q: term, + limit: self.siteSettings.max_tag_search_results, + categoryId: self.get('categoryId'), + selected_tags: self.get('tags') + }; if (!self.get('everyTag')) { d.filterForInput = true; } diff --git a/app/assets/javascripts/discourse/models/tag-group.js.es6 b/app/assets/javascripts/discourse/models/tag-group.js.es6 index 6ab079c37..67ee9b63e 100644 --- a/app/assets/javascripts/discourse/models/tag-group.js.es6 +++ b/app/assets/javascripts/discourse/models/tag-group.js.es6 @@ -20,7 +20,9 @@ const TagGroup = RestModel.extend({ return Discourse.ajax(url, { data: { name: this.get('name'), - tag_names: this.get('tag_names') + tag_names: this.get('tag_names'), + parent_tag_name: this.get('parent_tag_name') ? this.get('parent_tag_name') : undefined, + one_per_topic: this.get('one_per_topic') }, type: this.get('id') ? 'PUT' : 'POST' }).then(function(result) { diff --git a/app/assets/javascripts/discourse/templates/tag-groups-show.hbs b/app/assets/javascripts/discourse/templates/tag-groups-show.hbs index aec3ce6e5..58b80d565 100644 --- a/app/assets/javascripts/discourse/templates/tag-groups-show.hbs +++ b/app/assets/javascripts/discourse/templates/tag-groups-show.hbs @@ -1,13 +1,25 @@

{{text-field value=model.name}}


-
- -
- {{tag-chooser tags=model.tag_names everyTag="false" unlimitedTagCount="true"}} -
-
+
+
+ {{tag-chooser tags=model.tag_names everyTag="true" unlimitedTagCount="true"}} +
+ +
+ + {{tag-chooser tags=model.parent_tag_name everyTag="true" limit="1" placeholderKey="tagging.groups.parent_tag_placeholder"}} + {{i18n 'tagging.groups.parent_tag_description'}} +
+ +
+ +
+ - + {{model.savingStatus}}
\ No newline at end of file diff --git a/app/assets/stylesheets/common/base/tagging.scss b/app/assets/stylesheets/common/base/tagging.scss index 3d90c7709..ff4cf495b 100644 --- a/app/assets/stylesheets/common/base/tagging.scss +++ b/app/assets/stylesheets/common/base/tagging.scss @@ -222,6 +222,14 @@ header .discourse-tag {color: $tag-color !important; } .tag-group-content { width: 75%; float: right; + section { + margin-bottom: 20px; + } + label { + font-size: 1em; + display: inline-block; + margin-right: 10px; + } } .group-tags-list .tag-chooser { height: 150px !important; @@ -233,4 +241,10 @@ header .discourse-tag {color: $tag-color !important; } .saving { margin-left: 20px; } + .parent-tag-section { + .tag-chooser { + width: 200px; + margin-right: 10px; + } + } } \ No newline at end of file diff --git a/app/controllers/tag_groups_controller.rb b/app/controllers/tag_groups_controller.rb index 4bfc943a1..36d955268 100644 --- a/app/controllers/tag_groups_controller.rb +++ b/app/controllers/tag_groups_controller.rb @@ -69,7 +69,10 @@ class TagGroupsController < ApplicationController end def tag_groups_params - params[:tag_names] ||= [] - params.permit(:id, :name, :tag_names => []) + result = params.permit(:id, :name, :one_per_topic, :tag_names => [], :parent_tag_name => []) + result[:tag_names] ||= [] + result[:parent_tag_name] ||= [] + result[:one_per_topic] = (params[:one_per_topic] == "true") + result end end diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 7fffed3b5..a476c204d 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -117,7 +117,12 @@ class TagsController < ::ApplicationController tags_with_counts = DiscourseTagging.filter_allowed_tags( self.class.tags_by_count(guardian, params.slice(:limit)), guardian, - { for_input: params[:filterForInput], term: params[:q], category: category } + { + for_input: params[:filterForInput], + term: params[:q], + category: category, + selected_tags: params[:selected_tags] + } ) tags = tags_with_counts.count.map {|t, c| { id: t, text: t, count: c } } @@ -125,7 +130,7 @@ class TagsController < ::ApplicationController unused_tags = DiscourseTagging.filter_allowed_tags( Tag.where(topic_count: 0), guardian, - { for_input: params[:filterForInput], term: params[:q], category: category } + { for_input: params[:filterForInput], term: params[:q], category: category, selected_tags: params[:selected_tags] } ) unused_tags.each do |t| diff --git a/app/models/tag_group.rb b/app/models/tag_group.rb index dea1199a6..484619793 100644 --- a/app/models/tag_group.rb +++ b/app/models/tag_group.rb @@ -6,7 +6,19 @@ class TagGroup < ActiveRecord::Base has_many :category_tag_groups, dependent: :destroy has_many :categories, through: :category_tag_groups + belongs_to :parent_tag, class_name: 'Tag' + def tag_names=(tag_names_arg) DiscourseTagging.add_or_create_tags_by_name(self, tag_names_arg) end + + def parent_tag_name=(tag_names_arg) + if tag_names_arg.empty? + self.parent_tag = nil + else + if tag_name = DiscourseTagging.tags_for_saving(tag_names_arg, Guardian.new(Discourse.system_user)).first + self.parent_tag = Tag.find_by_name(tag_name) || Tag.create(name: tag_name) + end + end + end end diff --git a/app/models/tag_group_membership.rb b/app/models/tag_group_membership.rb index 0fee1fdcf..eaa9c5178 100644 --- a/app/models/tag_group_membership.rb +++ b/app/models/tag_group_membership.rb @@ -1,4 +1,4 @@ class TagGroupMembership < ActiveRecord::Base belongs_to :tag - belongs_to :tag_group, counter_cache: "tag_count" + belongs_to :tag_group, counter_cache: "tag_count" # TODO: remove counter cache end diff --git a/app/serializers/tag_group_serializer.rb b/app/serializers/tag_group_serializer.rb index 0aa0f412d..560eef34b 100644 --- a/app/serializers/tag_group_serializer.rb +++ b/app/serializers/tag_group_serializer.rb @@ -1,7 +1,11 @@ class TagGroupSerializer < ApplicationSerializer - attributes :id, :name, :tag_names + attributes :id, :name, :tag_names, :parent_tag_name, :one_per_topic def tag_names object.tags.pluck(:name).sort end + + def parent_tag_name + [object.parent_tag.try(:name)].compact + end end diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index b7647e2b7..433b9c4a1 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -3015,6 +3015,10 @@ en: about: "Add tags to groups to manage them more easily." new: "New Group" tags_label: "Tags in this group:" + parent_tag_label: "Parent tag:" + parent_tag_placeholder: "Optional" + parent_tag_description: "Tags from this group can't be used unless the parent tag is present." + one_per_topic_label: "Limit one tag per topic from this group" new_name: "New Tag Group" save: "Save" delete: "Delete" diff --git a/db/migrate/20160607213656_add_tag_group_options.rb b/db/migrate/20160607213656_add_tag_group_options.rb new file mode 100644 index 000000000..54f0c6050 --- /dev/null +++ b/db/migrate/20160607213656_add_tag_group_options.rb @@ -0,0 +1,6 @@ +class AddTagGroupOptions < ActiveRecord::Migration + def change + add_column :tag_groups, :parent_tag_id, :integer + add_column :tag_groups, :one_per_topic, :boolean, default: false + end +end diff --git a/lib/discourse_tagging.rb b/lib/discourse_tagging.rb index 72ef4aecd..f2bb69921 100644 --- a/lib/discourse_tagging.rb +++ b/lib/discourse_tagging.rb @@ -33,7 +33,7 @@ module DiscourseTagging if tag_names.present? category = topic.category - tags = filter_allowed_tags(Tag.where(name: tag_names), guardian, { for_input: true, category: category }).to_a + tags = filter_allowed_tags(Tag.where(name: tag_names), guardian, { for_input: true, category: category, selected_tags: tag_names }).to_a if tags.size < tag_names.size && (category.nil? || category.tags.count == 0) tag_names.each do |name| @@ -56,8 +56,9 @@ module DiscourseTagging # Options: # term: a search term to filter tags by name - # for_input: result is for an input field, so only show permitted tags # category: a Category to which the object being tagged belongs + # for_input: result is for an input field, so only show permitted tags + # selected_tags: an array of tag names that are in the current selection def self.filter_allowed_tags(query, guardian, opts={}) term = opts[:term] if term.present? @@ -67,6 +68,8 @@ module DiscourseTagging end if opts[:for_input] + selected_tag_ids = opts[:selected_tags] ? Tag.where(name: opts[:selected_tags]).pluck(:id) : [] + unless guardian.is_staff? staff_tag_names = SiteSetting.staff_tags.split("|") query = query.where('tags.name NOT IN (?)', staff_tag_names) if staff_tag_names.present? @@ -74,20 +77,24 @@ module DiscourseTagging # Filters for category-specific tags: - if opts[:category] && (opts[:category].tags.count > 0 || opts[:category].tag_groups.count > 0) - if opts[:category].tags.count > 0 && opts[:category].tag_groups.count > 0 - tag_group_ids = opts[:category].tag_groups.pluck(:id) + category = opts[:category] + + if category && (category.tags.count > 0 || category.tag_groups.count > 0) + if category.tags.count > 0 && category.tag_groups.count > 0 + tag_group_ids = category.tag_groups.pluck(:id) + query = query.where( "tags.id IN (SELECT tag_id FROM category_tags WHERE category_id = ? UNION - SELECT tag_id FROM tag_group_memberships WHERE tag_group_id = ?)", - opts[:category].id, tag_group_ids + SELECT tag_id FROM tag_group_memberships WHERE tag_group_id IN (?))", + category.id, tag_group_ids ) - elsif opts[:category].tags.count > 0 - query = query.where("tags.id IN (SELECT tag_id FROM category_tags WHERE category_id = ?)", opts[:category].id) - else # opts[:category].tag_groups.count > 0 - tag_group_ids = opts[:category].tag_groups.pluck(:id) - query = query.where("tags.id IN (SELECT tag_id FROM tag_group_memberships WHERE tag_group_id = ?)", tag_group_ids) + elsif category.tags.count > 0 + query = query.where("tags.id IN (SELECT tag_id FROM category_tags WHERE category_id = ?)", category.id) + else # category.tag_groups.count > 0 + tag_group_ids = category.tag_groups.pluck(:id) + + query = query.where("tags.id IN (SELECT tag_id FROM tag_group_memberships WHERE tag_group_id IN (?))", tag_group_ids) end else # exclude tags that are restricted to other categories @@ -97,7 +104,41 @@ module DiscourseTagging if CategoryTagGroup.exists? tag_group_ids = CategoryTagGroup.pluck(:tag_group_id).uniq - query = query.where("tags.id NOT IN (SELECT tag_id FROM tag_group_memberships WHERE tag_group_id = ?)", tag_group_ids) + query = query.where("tags.id NOT IN (SELECT tag_id FROM tag_group_memberships WHERE tag_group_id IN (?))", tag_group_ids) + end + end + + # exclude tag groups that have a parent tag which is missing from selected_tags + + select_sql = <<-SQL + SELECT tag_id + FROM tag_group_memberships tgm + INNER JOIN tag_groups tg + ON tgm.tag_group_id = tg.id + SQL + + if selected_tag_ids.empty? + sql = "tags.id NOT IN (#{select_sql} WHERE tg.parent_tag_id IS NOT NULL)" + query = query.where(sql) + else + # One tag per group restriction + exclude_group_ids = TagGroup.where(one_per_topic: true) + .joins(:tag_group_memberships) + .where('tag_group_memberships.tag_id in (?)', selected_tag_ids) + .pluck(:id) + + if exclude_group_ids.empty? + sql = "tags.id NOT IN (#{select_sql} WHERE tg.parent_tag_id NOT IN (?))" + query = query.where(sql, selected_tag_ids) + else + # It's possible that the selected tags violate some one-tag-per-group restrictions, + # so filter them out by picking one from each group. + limit_tag_ids = TagGroupMembership.select('distinct on (tag_group_id) tag_id') + .where(tag_id: selected_tag_ids) + .where(tag_group_id: exclude_group_ids) + .map(&:tag_id) + sql = "(tags.id NOT IN (#{select_sql} WHERE (tg.parent_tag_id NOT IN (?) OR tg.id in (?))) OR tags.id IN (?))" + query = query.where(sql, selected_tag_ids, exclude_group_ids, limit_tag_ids) end end end diff --git a/spec/fabricators/tag_fabricator.rb b/spec/fabricators/tag_fabricator.rb index 45940081a..5c61060c8 100644 --- a/spec/fabricators/tag_fabricator.rb +++ b/spec/fabricators/tag_fabricator.rb @@ -1,3 +1,3 @@ Fabricator(:tag) do - name { sequence(:name) { |i| "tag#{i}" } } + name { sequence(:name) { |i| "tag#{i+1}" } } end diff --git a/spec/integration/category_tag_spec.rb b/spec/integration/category_tag_spec.rb index 9b2f0c3a9..047056ced 100644 --- a/spec/integration/category_tag_spec.rb +++ b/spec/integration/category_tag_spec.rb @@ -9,6 +9,10 @@ describe "category tag restrictions" do tag_records.map(&:name).sort end + def filter_allowed_tags(opts={}) + DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), opts) + end + let!(:tag1) { Fabricate(:tag) } let!(:tag2) { Fabricate(:tag) } let!(:tag3) { Fabricate(:tag) } @@ -40,9 +44,9 @@ describe "category tag restrictions" do end it "search can show only permitted tags" do - expect(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user)).count).to eq(Tag.count) - expect(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true, category: category_with_tags}).pluck(:name).sort).to eq([tag1.name, tag2.name].sort) - expect(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true}).pluck(:name).sort).to eq([tag3.name, tag4.name].sort) + expect(filter_allowed_tags.count).to eq(Tag.count) + expect(filter_allowed_tags({for_input: true, category: category_with_tags}).pluck(:name).sort).to eq([tag1.name, tag2.name].sort) + expect(filter_allowed_tags({for_input: true}).pluck(:name).sort).to eq([tag3.name, tag4.name].sort) end it "can't create new tags in a restricted category" do @@ -76,13 +80,13 @@ describe "category tag restrictions" do category.allowed_tag_groups = [tag_group1.name] category.reload - expect(sorted_tag_names(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true, category: category}))).to eq(sorted_tag_names([tag1, tag2])) - expect(sorted_tag_names(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true}))).to eq(sorted_tag_names([tag3, tag4])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: category}))).to eq(sorted_tag_names([tag1, tag2])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true}))).to eq(sorted_tag_names([tag3, tag4])) tag_group1.tags = [tag2, tag3, tag4] - expect(sorted_tag_names(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true, category: category}))).to eq(sorted_tag_names([tag2, tag3, tag4])) - expect(sorted_tag_names(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true}))).to eq(sorted_tag_names([tag1])) - expect(sorted_tag_names(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true, category: other_category}))).to eq(sorted_tag_names([tag1])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: category}))).to eq(sorted_tag_names([tag2, tag3, tag4])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true}))).to eq(sorted_tag_names([tag1])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: other_category}))).to eq(sorted_tag_names([tag1])) end it "groups and individual tags can be mixed" do @@ -90,9 +94,92 @@ describe "category tag restrictions" do category.allowed_tags = [tag4.name] category.reload - expect(sorted_tag_names(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true, category: category}))).to eq(sorted_tag_names([tag1, tag2, tag4])) - expect(sorted_tag_names(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true}))).to eq(sorted_tag_names([tag3])) - expect(sorted_tag_names(DiscourseTagging.filter_allowed_tags(Tag.all, Guardian.new(user), {for_input: true, category: other_category}))).to eq(sorted_tag_names([tag3])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: category}))).to eq(sorted_tag_names([tag1, tag2, tag4])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true}))).to eq(sorted_tag_names([tag3])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: other_category}))).to eq(sorted_tag_names([tag3])) + end + end + + context "tag groups with parent tag" do + it "filter_allowed_tags returns results based on whether parent tag is present or not" do + tag_group = Fabricate(:tag_group, parent_tag_id: tag1.id) + tag_group.tags = [tag3, tag4] + expect(sorted_tag_names(filter_allowed_tags({for_input: true}))).to eq(sorted_tag_names([tag1, tag2])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, selected_tags: [tag1.name]}))).to eq(sorted_tag_names([tag1, tag2, tag3, tag4])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, selected_tags: [tag1.name, tag3.name]}))).to eq(sorted_tag_names([tag1, tag2, tag3, tag4])) + end + + context "and category restrictions" do + let(:car_category) { Fabricate(:category) } + let(:other_category) { Fabricate(:category) } + let(:makes) { Fabricate(:tag_group, name: "Makes") } + let(:honda_group) { Fabricate(:tag_group, name: "Honda Models") } + let(:ford_group) { Fabricate(:tag_group, name: "Ford Models") } + + before do + @tags = {} + ['honda', 'ford', 'civic', 'accord', 'mustang', 'taurus'].each do |name| + @tags[name] = Fabricate(:tag, name: name) + end + + makes.tags = [@tags['honda'], @tags['ford']] + + honda_group.parent_tag_id = @tags['honda'].id + honda_group.save + honda_group.tags = [@tags['civic'], @tags['accord']] + + ford_group.parent_tag_id = @tags['ford'].id + ford_group.save + ford_group.tags = [@tags['mustang'], @tags['taurus']] + + car_category.allowed_tag_groups = [makes.name, honda_group.name, ford_group.name] + end + + it "handles all those rules" do + # car tags can't be used outside of car category: + expect(sorted_tag_names(filter_allowed_tags({for_input: true}))).to eq(sorted_tag_names([tag1, tag2, tag3, tag4])) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: other_category}))).to eq(sorted_tag_names([tag1, tag2, tag3, tag4])) + + # in car category, a make tag must be given first: + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: car_category}))).to eq(['ford', 'honda']) + + # model tags depend on which make is chosen: + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: car_category, selected_tags: ['honda']}))).to eq(['accord', 'civic', 'ford', 'honda']) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: car_category, selected_tags: ['ford']}))).to eq(['ford', 'honda', 'mustang', 'taurus']) + end + + it "can apply the tags to a topic" do + post = create_post(category: car_category, tags: ['ford', 'mustang']) + expect(post.topic.tags.map(&:name).sort).to eq(['ford', 'mustang']) + end + + context "limit one tag from each group" do + before do + makes.update_attributes(one_per_topic: true) + honda_group.update_attributes(one_per_topic: true) + ford_group.update_attributes(one_per_topic: true) + end + + it "can restrict one tag from each group" do + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: car_category}))).to eq(['ford', 'honda']) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: car_category, selected_tags: ['honda']}))).to eq(['accord', 'civic', 'honda']) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: car_category, selected_tags: ['ford']}))).to eq(['ford', 'mustang', 'taurus']) + expect(sorted_tag_names(filter_allowed_tags({for_input: true, category: car_category, selected_tags: ['ford', 'mustang']}))).to eq(['ford', 'mustang']) + end + + it "can apply the tags to a topic" do + post = create_post(category: car_category, tags: ['ford', 'mustang']) + expect(post.topic.tags.map(&:name).sort).to eq(['ford', 'mustang']) + end + + it "can remove extra tags from the same group" do + # A weird case that input field wouldn't allow. + # Only one tag from car makers is allowed, but we're saying that two have been selected. + names = filter_allowed_tags({for_input: true, category: car_category, selected_tags: ['honda', 'ford']}).map(&:name) + expect(names.include?('honda') && names.include?('ford')).to eq(false) + expect(names.include?('honda') || names.include?('ford')).to eq(true) + end + end end end end From addf4822e31a670b24e69f3abb7e7e815f6e1833 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 9 Jun 2016 16:32:19 -0400 Subject: [PATCH 262/320] FIX: max_tags_per_topic should not limit how many tags can be in a group --- app/models/tag_group.rb | 2 +- lib/discourse_tagging.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/tag_group.rb b/app/models/tag_group.rb index 484619793..8f3f9c185 100644 --- a/app/models/tag_group.rb +++ b/app/models/tag_group.rb @@ -9,7 +9,7 @@ class TagGroup < ActiveRecord::Base belongs_to :parent_tag, class_name: 'Tag' def tag_names=(tag_names_arg) - DiscourseTagging.add_or_create_tags_by_name(self, tag_names_arg) + DiscourseTagging.add_or_create_tags_by_name(self, tag_names_arg, unlimited: true) end def parent_tag_name=(tag_names_arg) diff --git a/lib/discourse_tagging.rb b/lib/discourse_tagging.rb index f2bb69921..f2dcb6b14 100644 --- a/lib/discourse_tagging.rb +++ b/lib/discourse_tagging.rb @@ -166,7 +166,7 @@ module DiscourseTagging tag_diff.present? ? tag_diff : nil end - def self.tags_for_saving(tags, guardian) + def self.tags_for_saving(tags, guardian, opts={}) return [] unless guardian.can_tag_topics? @@ -181,11 +181,11 @@ module DiscourseTagging tag_names = Tag.where(name: tag_names).pluck(:name) end - return tag_names[0...SiteSetting.max_tags_per_topic] + return opts[:unlimited] ? tag_names : tag_names[0...SiteSetting.max_tags_per_topic] end - def self.add_or_create_tags_by_name(taggable, tag_names_arg) - tag_names = DiscourseTagging.tags_for_saving(tag_names_arg, Guardian.new(Discourse.system_user)) || [] + def self.add_or_create_tags_by_name(taggable, tag_names_arg, opts={}) + tag_names = DiscourseTagging.tags_for_saving(tag_names_arg, Guardian.new(Discourse.system_user), opts) || [] if taggable.tags.pluck(:name).sort != tag_names.sort taggable.tags = Tag.where(name: tag_names).all if taggable.tags.size < tag_names.size From d7622f0665f63b2f07da0a6e6063e00ff66f78a4 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 9 Jun 2016 16:50:09 -0400 Subject: [PATCH 263/320] remove unused broken tag_count column --- app/models/tag_group_membership.rb | 2 +- .../20160609203508_remove_tag_count_from_tag_groups.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20160609203508_remove_tag_count_from_tag_groups.rb diff --git a/app/models/tag_group_membership.rb b/app/models/tag_group_membership.rb index eaa9c5178..eecc2966a 100644 --- a/app/models/tag_group_membership.rb +++ b/app/models/tag_group_membership.rb @@ -1,4 +1,4 @@ class TagGroupMembership < ActiveRecord::Base belongs_to :tag - belongs_to :tag_group, counter_cache: "tag_count" # TODO: remove counter cache + belongs_to :tag_group end diff --git a/db/migrate/20160609203508_remove_tag_count_from_tag_groups.rb b/db/migrate/20160609203508_remove_tag_count_from_tag_groups.rb new file mode 100644 index 000000000..e6e73949b --- /dev/null +++ b/db/migrate/20160609203508_remove_tag_count_from_tag_groups.rb @@ -0,0 +1,5 @@ +class RemoveTagCountFromTagGroups < ActiveRecord::Migration + def change + remove_column :tag_groups, :tag_count + end +end From 8b5dfeb18fc99290aa48e4f2986173b5b0204f58 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 9 Jun 2016 16:38:41 -0700 Subject: [PATCH 264/320] ignore a few more common meaningless JS errs --- .gitignore | 1 + config/initializers/100-logster.rb | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index fcdaca12c..d88f2ca16 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,4 @@ config/version.rb bundler_stubs/* vendor/bundle/* +*.db diff --git a/config/initializers/100-logster.rb b/config/initializers/100-logster.rb index e237d6aa7..be4191583 100644 --- a/config/initializers/100-logster.rb +++ b/config/initializers/100-logster.rb @@ -28,11 +28,17 @@ if Rails.env.production? # suppress unconditionally for now /^Can't verify CSRF token authenticity$/, - # 404s can be dealt with elsewise - /^ActiveRecord::RecordNotFound /, + # Yandex bot triggers this JS error a lot + /^Uncaught ReferenceError: I18n is not defined/, + + # related to browser plugins somehow, we don't care + /Error calling method on NPObject/, + + # 404s can be dealt with elsewhere + /^ActiveRecord::RecordNotFound/, # bad asset requested, no need to log - /^ActionController::BadRequest / + /^ActionController::BadRequest/ ] end From a4e705648b7c53ed34941b652ac0626ecca6477a Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 9 Jun 2016 17:38:49 -0700 Subject: [PATCH 265/320] "digest" is now "summary" --- config/locales/server.en.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 5f035a6fe..b85c82744 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -621,8 +621,8 @@ en: description: "You have been unsubscribed. We won't contact you again!" oops: "In case you didn't mean to do this, click below." error: "Error Unsubscribing" - preferences_link: "You can also unsubscribe from digest emails on your preferences page" - different_user_description: "You are currently logged in as a different user than the one who the digest was mailed to. Please log out and try again." + preferences_link: "You can also unsubscribe from summary emails on your preferences page" + different_user_description: "You are currently logged in as a different user than the one who the summary was mailed to. Please log out and try again." not_found_description: "Sorry, we couldn't unsubscribe you. It's possible the link in your email has expired." resubscribe: @@ -850,7 +850,7 @@ en: onebox_domains_whitelist: "A list of domains to allow oneboxing for; these domains should support OpenGraph or oEmbed. Test them at http://iframely.com/debug" logo_url: "The logo image at the top left of your site, should be a wide rectangle shape. If left blank site title text will be shown." - digest_logo_url: "The alternate logo image used at the top of your site's email digest. Should be a wide rectangle shape. Should not be an SVG image. If left blank `logo_url` will be used." + digest_logo_url: "The alternate logo image used at the top of your site's email summary. Should be a wide rectangle shape. Should not be an SVG image. If left blank `logo_url` will be used." logo_small_url: "The small logo image at the top left of your site, should be a square shape, seen when scrolling down. If left blank a home glyph will be shown." favicon_url: "A favicon for your site, see http://en.wikipedia.org/wiki/Favicon, to work correctly over a CDN it must be a png" mobile_logo_url: "The fixed position logo image used at the top left of your mobile site. Should be a square shape. If left blank, `logo_url` will be used. eg: http://example.com/uploads/default/logo.png" @@ -1220,11 +1220,11 @@ en: allow_animated_thumbnails: "Generates animated thumbnails of animated gifs." default_avatars: "URLs to avatars that will be used by default for new users until they change them." automatically_download_gravatars: "Download Gravatars for users upon account creation or email change." - digest_topics: "The maximum number of topics to display in the email digest." - digest_min_excerpt_length: "Minimum post excerpt in the email digest, in characters." - delete_digest_email_after_days: "Suppress digest emails for users not seen on the site for more than (n) days." - digest_suppress_categories: "Suppress these categories from digest emails." - disable_digest_emails: "Disable digest emails for all users." + digest_topics: "The maximum number of topics to display in the email summary." + digest_min_excerpt_length: "Minimum post excerpt in the email summary, in characters." + delete_digest_email_after_days: "Suppress summary emails for users not seen on the site for more than (n) days." + digest_suppress_categories: "Suppress these categories from summary emails." + disable_digest_emails: "Disable summary emails for all users." detect_custom_avatars: "Whether or not to check that users have uploaded custom profile pictures." max_daily_gravatar_crawls: "Maximum number of times Discourse will check Gravatar for custom avatars in a day" @@ -1307,8 +1307,8 @@ en: auto_close_messages_post_count: "Maximum number of posts allowed in a message before it is automatically closed (0 to disable)" auto_close_topics_post_count: "Maximum number of posts allowed in a topic before it is automatically closed (0 to disable)" - default_email_digest_frequency: "How often users receive digest emails by default." - default_include_tl0_in_digests: "Include posts from new users in digest emails by default. Users can change this in their preferences." + default_email_digest_frequency: "How often users receive summary emails by default." + default_include_tl0_in_digests: "Include posts from new users in summary emails by default. Users can change this in their preferences." default_email_private_messages: "Send an email when someone messages the user by default." default_email_direct: "Send an email when someone quotes/replies to/mentions or invites the user by default." default_email_mailing_list_mode: "Send an email for every new post by default." @@ -2339,13 +2339,13 @@ en: digest: why: "A brief summary of %{site_link} since your last visit on %{last_seen_at}" - subject_template: "[%{site_name}] Digest" + subject_template: "[%{site_name}] Summary" new_activity: "New activity on your topics and posts:" top_topics: "Popular posts" other_new_topics: "Popular topics" - unsubscribe: "This digest is sent from %{site_link} when we haven't seen you in a while. To unsubscribe %{unsubscribe_link}." + unsubscribe: "This summary is sent from %{site_link} when we haven't seen you in a while. To unsubscribe %{unsubscribe_link}." click_here: "click here" - from: "%{site_name} digest" + from: "%{site_name} summary" read_more: "Read More" more_topics: "There were %{new_topics_since_seen} other new topics." more_topics_category: "More new topics:" From 3015030fe21a120f42aadcdd14e84cb3e964f873 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 10 Jun 2016 10:53:03 +1000 Subject: [PATCH 266/320] FIX: unlisted topics do not get "slug auto correct" logic --- app/controllers/topics_controller.rb | 11 +++++++++-- spec/controllers/topics_controller_spec.rb | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index 0d1681c9a..1b58942ab 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -65,7 +65,7 @@ class TopicsController < ApplicationController rescue Discourse::NotFound if params[:id] topic = Topic.find_by(slug: params[:id].downcase) - return redirect_to_correct_topic(topic, opts[:post_number]) if topic + return redirect_to_correct_topic(topic, opts[:post_number]) if topic && topic.visible end raise Discourse::NotFound end @@ -77,7 +77,14 @@ class TopicsController < ApplicationController discourse_expires_in 1.minute - redirect_to_correct_topic(@topic_view.topic, opts[:post_number]) && return if slugs_do_not_match || (!request.format.json? && params[:slug].nil?) + if !@topic_view.topic.visible && @topic_view.topic.slug != params[:slug] + raise Discourse::NotFound + end + + if slugs_do_not_match || (!request.format.json? && params[:slug].nil?) + redirect_to_correct_topic(@topic_view.topic, opts[:post_number]) + return + end track_visit_to_topic diff --git a/spec/controllers/topics_controller_spec.rb b/spec/controllers/topics_controller_spec.rb index 780e6f4a4..e66a8085c 100644 --- a/spec/controllers/topics_controller_spec.rb +++ b/spec/controllers/topics_controller_spec.rb @@ -532,6 +532,22 @@ describe TopicsController do end end + describe 'show unlisted' do + it 'returns 404 unless exact correct URL' do + topic = Fabricate(:topic, visible: false) + Fabricate(:post, topic: topic) + + xhr :get, :show, topic_id: topic.id, slug: topic.slug + expect(response).to be_success + + xhr :get, :show, topic_id: topic.id, slug: "just-guessing" + expect(response.code).to eq("404") + + xhr :get, :show, id: topic.slug + expect(response.code).to eq("404") + end + end + describe 'show' do let(:topic) { Fabricate(:post).topic } From 30e4b17de8d6ccb3c9dd328476c1a043d0971199 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 10 Jun 2016 13:07:35 +1000 Subject: [PATCH 267/320] UX: strip outgoing links from bottom of post. Only show incoming --- .../discourse/widgets/post-links.js.es6 | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-links.js.es6 b/app/assets/javascripts/discourse/widgets/post-links.js.es6 index 50624d0e0..ca17d358c 100644 --- a/app/assets/javascripts/discourse/widgets/post-links.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-links.js.es6 @@ -20,37 +20,42 @@ export default createWidget('post-links', { return h('li', h('a.track-link', { - className: link.reflection ? 'inbound' : 'outbound', + className: 'inbound', attributes: { href: link.url } - }, [iconNode(link.reflection ? 'arrow-left' : 'arrow-right'), linkBody]) + }, [iconNode('arrow-left'), linkBody]) ); }, html(attrs, state) { - const links = this.attrs.links || []; - const dedupedLinks = _.uniq(links, true, l => l.title); - const incomingLinks = dedupedLinks.filter(l => l.reflection); + if (!this.attrs.links || this.attrs.links.length == 0) { + // shortcut all work + return; + } - // if all links are outgoing, don't show any - if (incomingLinks.length === 0) { return; } + // only show incoming + const links = _(this.attrs.links) + .filter(l => l.reflection) + .uniq(true, l => l.title) + .value(); + + if (links.length === 0) { return; } const result = []; // show all links - if (dedupedLinks.length <= 5 || !state.collapsed) { - _.each(dedupedLinks, l => result.push(this.linkHtml(l))); + if (links.length <= 5 || !state.collapsed) { + _.each(links, l => result.push(this.linkHtml(l))); } else { - // show up to 5 *incoming* links when collapsed - const max = Math.min(5, incomingLinks.length); + const max = Math.min(5, links.length); for (let i = 0; i < max; i++) { - result.push(this.linkHtml(incomingLinks[i])); + result.push(this.linkHtml(links[i])); } // 'show more' link - if (dedupedLinks.length > max) { + if (links.length > max) { result.push(h('li', this.attach('link', { labelCount: 'post_links.title', title: 'post_links.about', - count: dedupedLinks.length - max, + count: links.length - max, action: 'expandLinks', className: 'expand-links' }))); From a496574e933d6af1ef0590f26180fefbc71e18fb Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 10 Jun 2016 11:40:21 +0800 Subject: [PATCH 268/320] Make eslint happy. --- app/assets/javascripts/discourse/widgets/post-links.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/widgets/post-links.js.es6 b/app/assets/javascripts/discourse/widgets/post-links.js.es6 index ca17d358c..8aa84650f 100644 --- a/app/assets/javascripts/discourse/widgets/post-links.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-links.js.es6 @@ -27,7 +27,7 @@ export default createWidget('post-links', { }, html(attrs, state) { - if (!this.attrs.links || this.attrs.links.length == 0) { + if (!this.attrs.links || this.attrs.links.length === 0) { // shortcut all work return; } From 65f466cf8c863631e00e371778bf588e10dd204e Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 10 Jun 2016 17:24:30 +1000 Subject: [PATCH 269/320] FIX: topic link reflections deleted on second save --- app/models/topic_link.rb | 14 +++++++++++- spec/models/topic_link_spec.rb | 39 +++++++++++++++++++--------------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index 516f9505d..786c5e625 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -178,7 +178,17 @@ class TopicLink < ActiveRecord::Base prefix = Discourse.base_url_no_prefix reflected_url = "#{prefix}#{post.topic.relative_url(post.post_number)}" - tl = TopicLink.create(user_id: post.user_id, + + tl = TopicLink.find_by(topic_id: topic_id, + post_id: reflected_post.try(:id), + url: reflected_url) + + if tl + tl.update_columns(domain: Discourse.current_hostname, + link_topic_id: post.topic.id, + link_post_id: post.id) + else + tl = TopicLink.create(user_id: post.user_id, topic_id: topic_id, post_id: reflected_post.try(:id), url: reflected_url, @@ -188,6 +198,8 @@ class TopicLink < ActiveRecord::Base link_topic_id: post.topic_id, link_post_id: post.id) + end + reflected_ids << tl.try(:id) end end diff --git a/spec/models/topic_link_spec.rb b/spec/models/topic_link_spec.rb index 7ce59822d..487c6852f 100644 --- a/spec/models/topic_link_spec.rb +++ b/spec/models/topic_link_spec.rb @@ -92,27 +92,32 @@ http://b.com/#{'a'*500} topic.posts.create(user: user, raw: 'initial post') linked_post = topic.posts.create(user: user, raw: "Link to another topic: #{url}") - TopicLink.extract_from(linked_post) + # this is subtle, but we had a bug were second time + # TopicLink.extract_from was called a reflection was nuked + 2.times do + topic.reload + TopicLink.extract_from(linked_post) - link = topic.topic_links.first - expect(link).to be_present - expect(link).to be_internal - expect(link.url).to eq(url) - expect(link.domain).to eq(test_uri.host) - link.link_topic_id == other_topic.id - expect(link).not_to be_reflection + link = topic.topic_links.first + expect(link).to be_present + expect(link).to be_internal + expect(link.url).to eq(url) + expect(link.domain).to eq(test_uri.host) + link.link_topic_id == other_topic.id + expect(link).not_to be_reflection - reflection = other_topic.topic_links.first + reflection = other_topic.topic_links.first - expect(reflection).to be_present - expect(reflection).to be_reflection - expect(reflection.post_id).to be_present - expect(reflection.domain).to eq(test_uri.host) - expect(reflection.url).to eq("http://#{test_uri.host}/t/unique-topic-name/#{topic.id}/#{linked_post.post_number}") - expect(reflection.link_topic_id).to eq(topic.id) - expect(reflection.link_post_id).to eq(linked_post.id) + expect(reflection).to be_present + expect(reflection).to be_reflection + expect(reflection.post_id).to be_present + expect(reflection.domain).to eq(test_uri.host) + expect(reflection.url).to eq("http://#{test_uri.host}/t/unique-topic-name/#{topic.id}/#{linked_post.post_number}") + expect(reflection.link_topic_id).to eq(topic.id) + expect(reflection.link_post_id).to eq(linked_post.id) - expect(reflection.user_id).to eq(link.user_id) + expect(reflection.user_id).to eq(link.user_id) + end linked_post.revise(post.user, { raw: "no more linkies https://eviltrout.com" }) expect(other_topic.topic_links.where(link_post_id: linked_post.id)).to be_blank From 9e75b14535b401346ac6547d883d9b3901407eec Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 10 Jun 2016 17:25:37 +1000 Subject: [PATCH 270/320] update is not really needed --- app/models/topic_link.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index 786c5e625..08114bfae 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -183,11 +183,7 @@ class TopicLink < ActiveRecord::Base post_id: reflected_post.try(:id), url: reflected_url) - if tl - tl.update_columns(domain: Discourse.current_hostname, - link_topic_id: post.topic.id, - link_post_id: post.id) - else + unless tl tl = TopicLink.create(user_id: post.user_id, topic_id: topic_id, post_id: reflected_post.try(:id), From dffe50a2e6cccb31a54bffae55ad94f6fb71f293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Fri, 10 Jun 2016 16:14:42 +0200 Subject: [PATCH 271/320] new alternative reply by email addresses --- config/locales/server.en.yml | 2 ++ config/site_settings.yml | 4 +++- lib/email/receiver.rb | 21 ++++++++++++++----- ...tive_reply_by_email_addresses_validator.rb | 16 ++++++++++++++ .../reply_by_email_address_validator.rb | 6 +++--- spec/components/email/receiver_spec.rb | 1 + spec/fixtures/emails/html_reply.eml | 2 +- 7 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 lib/validators/alternative_reply_by_email_addresses_validator.rb diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index b85c82744..2ab37f4dc 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1171,6 +1171,7 @@ en: reply_by_email_enabled: "Enable replying to topics via email." reply_by_email_address: "Template for reply by email incoming email address, for example: %{reply_key}@reply.example.com or replies+%{reply_key}@example.com" + alternative_reply_by_email_addresses: "List of alternative templates for reply by email incoming email addresses." incoming_email_prefer_html: "Use the HTML instead of the text for incoming email. May cause unexcpeted formatting issues!" disable_emails: "Prevent Discourse from sending any kind of emails" @@ -1363,6 +1364,7 @@ en: invalid_string_min: "Must be at least %{min} characters." invalid_string_max: "Must be no more than %{max} characters." invalid_reply_by_email_address: "Value must contain '%{reply_key}' and be different from the notification email." + invalid_alternative_reply_by_email_addresses: "All values must contain '%{reply_key}' and be different from the notification email." pop3_polling_host_is_empty: "You must set a 'pop3 polling host' before enabling POP3 polling." pop3_polling_username_is_empty: "You must set a 'pop3 polling username' before enabling POP3 polling." pop3_polling_password_is_empty: "You must set a 'pop3 polling password' before enabling POP3 polling." diff --git a/config/site_settings.yml b/config/site_settings.yml index 1f9fddf2b..2d5b7f45c 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -534,7 +534,9 @@ email: validator: "ReplyByEmailEnabledValidator" reply_by_email_address: default: '' - validator: "ReplyByEmailAddressValidator" + validator: "AlternativeReplyByEmailAddressesValidator" + alternative_reply_by_email_addresses: + default: '' manual_polling_enabled: default: false pop3_polling_enabled: diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb index 5d9b5d162..36b0dc484 100644 --- a/lib/email/receiver.rb +++ b/lib/email/receiver.rb @@ -327,15 +327,26 @@ module Email # reply match = reply_by_email_address_regex.match(address) - if match && match[1].present? - email_log = EmailLog.for(match[1]) - return { type: :reply, obj: email_log } if email_log + if match && match.captures + match.captures.each do |c| + next if c.blank? + email_log = EmailLog.for(c) + return { type: :reply, obj: email_log } if email_log + end end end def reply_by_email_address_regex - @reply_by_email_address_regex ||= Regexp.new Regexp.escape(SiteSetting.reply_by_email_address) - .gsub(Regexp.escape("%{reply_key}"), "([[:xdigit:]]{32})") + @reply_by_email_address_regex ||= begin + reply_addresses = [ + SiteSetting.reply_by_email_address, + *SiteSetting.alternative_reply_by_email_addresses.split("|") + ] + escaped_reply_addresses = reply_addresses.select { |a| a.present? } + .map { |a| Regexp.escape(a) } + .map { |a| a.gsub(Regexp.escape("%{reply_key}"), "([[:xdigit:]]{32})") } + Regexp.new(escaped_reply_addresses.join("|")) + end end def group_incoming_emails_regex diff --git a/lib/validators/alternative_reply_by_email_addresses_validator.rb b/lib/validators/alternative_reply_by_email_addresses_validator.rb new file mode 100644 index 000000000..d35dedf7c --- /dev/null +++ b/lib/validators/alternative_reply_by_email_addresses_validator.rb @@ -0,0 +1,16 @@ +class AlternativeReplyByEmailAddressesValidator + def initialize(opts={}) + @opts = opts + end + + def valid_value?(val) + return true if val.blank? + + validator = ReplyByEmailAddressValidator.new(@opts) + val.split("|").all? { |v| validator.valid_value?(v) } + end + + def error_message + I18n.t('site_settings.errors.invalid_alternative_reply_by_email_addresses') + end +end diff --git a/lib/validators/reply_by_email_address_validator.rb b/lib/validators/reply_by_email_address_validator.rb index f5c19d2bd..024a1aab7 100644 --- a/lib/validators/reply_by_email_address_validator.rb +++ b/lib/validators/reply_by_email_address_validator.rb @@ -6,9 +6,9 @@ class ReplyByEmailAddressValidator def valid_value?(val) return true if val.blank? - !!(val =~ /@/i) && - !!(val =~ /%{reply_key}/i) && - val.gsub(/\+?%{reply_key}/i, "") != SiteSetting.notification_email + !!val["@"] && + !!val["%{reply_key}"] && + val.gsub(/\+?%{reply_key}/, "") != SiteSetting.notification_email end def error_message diff --git a/spec/components/email/receiver_spec.rb b/spec/components/email/receiver_spec.rb index 7a802acd1..533eea27e 100644 --- a/spec/components/email/receiver_spec.rb +++ b/spec/components/email/receiver_spec.rb @@ -6,6 +6,7 @@ describe Email::Receiver do before do SiteSetting.email_in = true SiteSetting.reply_by_email_address = "reply+%{reply_key}@bar.com" + SiteSetting.alternative_reply_by_email_addresses = "alt+%{reply_key}@bar.com" end def process(email_name) diff --git a/spec/fixtures/emails/html_reply.eml b/spec/fixtures/emails/html_reply.eml index 28e5feff8..2f4ac8f34 100644 --- a/spec/fixtures/emails/html_reply.eml +++ b/spec/fixtures/emails/html_reply.eml @@ -1,6 +1,6 @@ Return-Path: From: Foo Bar -To: reply+4f97315cc828096c9cb34c6f1a0d6fe8@bar.com +To: alt+4f97315cc828096c9cb34c6f1a0d6fe8@bar.com Date: Fri, 15 Jan 2016 00:12:43 +0100 Message-ID: <18@foo.bar.mail> Mime-Version: 1.0 From eff28652782b312c3ae69cf27470bc17575814fa Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 10 Jun 2016 11:12:46 -0400 Subject: [PATCH 272/320] FIX: Support create account on facebook browser --- .../discourse/initializers/auth-complete.js.es6 | 13 +++++++++++++ .../users/omniauth_callbacks/complete.html.erb | 7 +++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/discourse/initializers/auth-complete.js.es6 diff --git a/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 b/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 new file mode 100644 index 000000000..613d03fd1 --- /dev/null +++ b/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 @@ -0,0 +1,13 @@ +export default { + name: "auth-complete", + after: "inject-objects", + initialize() { + if (window.location.search.indexOf('authComplete=true') !== -1) { + const lastAuthResult = localStorage.getItem('lastAuthResult'); + if (lastAuthResult) { + Discourse.authenticationComplete(JSON.parse(lastAuthResult)); + } + } + } +}; + diff --git a/app/views/users/omniauth_callbacks/complete.html.erb b/app/views/users/omniauth_callbacks/complete.html.erb index 07bd70146..4d7f5dd9e 100644 --- a/app/views/users/omniauth_callbacks/complete.html.erb +++ b/app/views/users/omniauth_callbacks/complete.html.erb @@ -22,12 +22,15 @@

<%=t "login.close_window" %>

From 3b9b492ea6652894184fdea55ab68240a084522d Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 10 Jun 2016 11:32:32 -0400 Subject: [PATCH 273/320] FIX: Weird spec --- spec/views/omniauth_callbacks/complete.html.erb_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/views/omniauth_callbacks/complete.html.erb_spec.rb b/spec/views/omniauth_callbacks/complete.html.erb_spec.rb index ba571e078..614877fdb 100644 --- a/spec/views/omniauth_callbacks/complete.html.erb_spec.rb +++ b/spec/views/omniauth_callbacks/complete.html.erb_spec.rb @@ -6,7 +6,7 @@ require_dependency "auth/result" describe "users/omniauth_callbacks/complete.html.erb" do let :rendered_data do - returned = JSON.parse(rendered.match(/window.opener.Discourse.authenticationComplete\((.*)\)/)[1]) + JSON.parse(rendered.match(/var authResult = (.*);/)[1]) end it "renders auth info" do From 33a418d5370f1d459b3a47df42573f366fd95830 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 10 Jun 2016 12:05:14 -0400 Subject: [PATCH 274/320] Log errors authenticating with facebook --- .../discourse/initializers/auth-complete.js.es6 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 b/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 index 613d03fd1..779067362 100644 --- a/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 +++ b/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 @@ -5,7 +5,12 @@ export default { if (window.location.search.indexOf('authComplete=true') !== -1) { const lastAuthResult = localStorage.getItem('lastAuthResult'); if (lastAuthResult) { - Discourse.authenticationComplete(JSON.parse(lastAuthResult)); + try { + Discourse.authenticationComplete(JSON.parse(lastAuthResult)); + } catch(e) { + document.write(`

lastAuthResult: ${lastAuthResult}

`); + document.write(e); + } } } } From 28e3becf441c3f64099c57af7559defddcb69b02 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 10 Jun 2016 12:24:34 -0400 Subject: [PATCH 275/320] FIX: Allow authentication complete window to pop up --- .../discourse/initializers/auth-complete.js.es6 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 b/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 index 779067362..9ce534315 100644 --- a/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 +++ b/app/assets/javascripts/discourse/initializers/auth-complete.js.es6 @@ -5,12 +5,7 @@ export default { if (window.location.search.indexOf('authComplete=true') !== -1) { const lastAuthResult = localStorage.getItem('lastAuthResult'); if (lastAuthResult) { - try { - Discourse.authenticationComplete(JSON.parse(lastAuthResult)); - } catch(e) { - document.write(`

lastAuthResult: ${lastAuthResult}

`); - document.write(e); - } + Ember.run.next(() => Discourse.authenticationComplete(JSON.parse(lastAuthResult))); } } } From 9ecd5bd59968758ef58830ef76927f4483f45c51 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 10 Jun 2016 13:41:22 -0400 Subject: [PATCH 276/320] Version bump to v1.6.0.beta8 --- lib/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/version.rb b/lib/version.rb index 3b9b3c2a3..1936907b9 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -5,7 +5,7 @@ module Discourse MAJOR = 1 MINOR = 6 TINY = 0 - PRE = 'beta7' + PRE = 'beta8' STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.') end From a77f5a75a1b8548b6c9b83afa67ab3aa3c6a70a1 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 10 Jun 2016 14:14:08 -0400 Subject: [PATCH 277/320] FIX: Scroll jumping in some dimensions of browser --- .../discourse/widgets/post-stream.js.es6 | 16 +++++++++------- .../javascripts/discourse/widgets/post.js.es6 | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-stream.js.es6 b/app/assets/javascripts/discourse/widgets/post-stream.js.es6 index 704b671f2..9488cf768 100644 --- a/app/assets/javascripts/discourse/widgets/post-stream.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-stream.js.es6 @@ -8,6 +8,7 @@ const DAY = 1000 * 60 * 60 * 24; const _dontCloak = {}; let _cloaked = {}; +let _heights = {}; export function preventCloak(postId) { _dontCloak[postId] = true; @@ -17,7 +18,8 @@ export function cloak(post, component) { if (!CLOAKING_ENABLED || _cloaked[post.id] || _dontCloak[post.id]) { return; } const $post = $(`#post_${post.post_number}`); - _cloaked[post.id] = $post.outerHeight(); + _cloaked[post.id] = true; + _heights[post.id] = $post.outerHeight(); Ember.run.debounce(component, 'queueRerender', 1000); } @@ -27,7 +29,10 @@ export function uncloak(post, component) { component.queueRerender(); } -addWidgetCleanCallback('post-stream', () => _cloaked = {}); +addWidgetCleanCallback('post-stream', () => { + _cloaked = {}; + _heights = {}; +}); export default createWidget('post-stream', { tagName: 'div.post-stream', @@ -88,11 +93,8 @@ export default createWidget('post-stream', { } prevDate = curTime; - const height = _cloaked[post.id]; - if (height) { - transformed.cloaked = true; - transformed.height = height; - } + transformed.height = _heights[post.id]; + transformed.cloaked = _cloaked[post.id]; if (transformed.isSmallAction) { result.push(this.attach('post-small-action', transformed, { model: post })); diff --git a/app/assets/javascripts/discourse/widgets/post.js.es6 b/app/assets/javascripts/discourse/widgets/post.js.es6 index 506e9dab7..2ba179a9e 100644 --- a/app/assets/javascripts/discourse/widgets/post.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post.js.es6 @@ -384,7 +384,7 @@ export default createWidget('post', { shadowTree: true, buildAttributes(attrs) { - return attrs.cloaked ? { style: `height: ${attrs.height}px` } : undefined; + return attrs.height ? { style: `height: ${attrs.height}px` } : undefined; }, buildId(attrs) { From d1c59499228712eaaf6e59d636b2ceeb989c33b6 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Fri, 10 Jun 2016 16:09:10 -0700 Subject: [PATCH 278/320] switch to dual-way arrow for links --- app/assets/javascripts/discourse/widgets/post-links.js.es6 | 2 +- config/locales/client.en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-links.js.es6 b/app/assets/javascripts/discourse/widgets/post-links.js.es6 index 8aa84650f..f7b621a50 100644 --- a/app/assets/javascripts/discourse/widgets/post-links.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-links.js.es6 @@ -22,7 +22,7 @@ export default createWidget('post-links', { h('a.track-link', { className: 'inbound', attributes: { href: link.url } - }, [iconNode('arrow-left'), linkBody]) + }, [iconNode('arrows-h'), linkBody]) ); }, diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 433b9c4a1..7c4c6c749 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1083,7 +1083,7 @@ en: invited_to_topic: "

{{username}} {{description}}

" invitee_accepted: "

{{username}} accepted your invitation

" moved_post: "

{{username}} moved {{description}}

" - linked: "

{{username}} {{description}}

" + linked: "

{{username}} {{description}}

" granted_badge: "

Earned '{{description}}'

" group_message_summary: From c0e25b5a9a9449f128672cbc7e1fde20c03efc84 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 10 Jun 2016 21:37:33 -0500 Subject: [PATCH 279/320] Replace certain uses of 'gsub' with 'tr' or 'chomp' for a speed improvement --- app/controllers/application_controller.rb | 11 +++++------ app/helpers/application_helper.rb | 2 +- app/mailers/invite_mailer.rb | 2 +- app/mailers/user_notifications.rb | 2 +- app/models/badge.rb | 2 +- app/models/topic_status_update.rb | 2 +- lib/email/sender.rb | 4 ++-- lib/ip_addr.rb | 2 +- lib/slug.rb | 4 ++-- 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2db847958..5ac481144 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -296,13 +296,12 @@ class ApplicationController < ActionController::Base def fetch_user_from_params(opts=nil) opts ||= {} user = if params[:username] - username_lower = params[:username].downcase - username_lower.gsub!(/\.json$/, '') + username_lower = params[:username].downcase.chomp('.json') find_opts = { username_lower: username_lower } find_opts[:active] = true unless opts[:include_inactive] || current_user.try(:staff?) User.find_by(find_opts) elsif params[:external_id] - external_id = params[:external_id].gsub(/\.json$/, '') + external_id = params[:external_id].chomp('.json') SingleSignOnRecord.find_by(external_id: external_id).try(:user) end raise Discourse::NotFound if user.blank? @@ -335,9 +334,9 @@ class ApplicationController < ActionController::Base # Rails I18n uses underscores between the locale and the region; the request # headers use hyphens. require 'http_accept_language' unless defined? HttpAcceptLanguage - available_locales = I18n.available_locales.map { |locale| locale.to_s.gsub(/_/, '-') } + available_locales = I18n.available_locales.map { |locale| locale.to_s.tr('_', '-') } parser = HttpAcceptLanguage::Parser.new(request.env["HTTP_ACCEPT_LANGUAGE"]) - parser.language_region_compatible_from(available_locales).gsub(/-/, '_') + parser.language_region_compatible_from(available_locales).tr('-', '_') rescue # If Accept-Language headers are not set. I18n.default_locale @@ -493,7 +492,7 @@ class ApplicationController < ActionController::Base @recent = Topic.where.not(id: category_topic_ids).recent(10) @slug = params[:slug].class == String ? params[:slug] : '' @slug = (params[:id].class == String ? params[:id] : '') if @slug.blank? - @slug.gsub!('-',' ') + @slug.tr!('-',' ') render_to_string status: status, layout: layout, formats: [:html], template: '/exceptions/not_found' end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4b6808962..c5160585f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -38,7 +38,7 @@ module ApplicationHelper def script(*args) if SiteSetting.enable_cdn_js_debugging && GlobalSetting.cdn_url tags = javascript_include_tag(*args, "crossorigin" => "anonymous") - tags.gsub!("/assets/", "/cdn_asset/#{Discourse.current_hostname.gsub(".","_")}/") + tags.gsub!("/assets/", "/cdn_asset/#{Discourse.current_hostname.tr(".","_")}/") tags.gsub!(".js\"", ".js?v=1&origin=#{CGI.escape request.base_url}\"") tags.html_safe else diff --git a/app/mailers/invite_mailer.rb b/app/mailers/invite_mailer.rb index f94aca2eb..346507326 100644 --- a/app/mailers/invite_mailer.rb +++ b/app/mailers/invite_mailer.rb @@ -22,7 +22,7 @@ class InviteMailer < ActionMailer::Base # get topic excerpt topic_excerpt = "" if first_topic.excerpt - topic_excerpt = first_topic.excerpt.gsub("\n", " ") + topic_excerpt = first_topic.excerpt.tr("\n", " ") end template = 'invite_mailer' diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index 284cd00ef..b863955fe 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -341,7 +341,7 @@ class UserNotifications < ActionMailer::Base else invite_template = "user_notifications.invited_to_topic_body" end - topic_excerpt = post.excerpt.gsub("\n", " ") if post.is_first_post? && post.excerpt + topic_excerpt = post.excerpt.tr("\n", " ") if post.is_first_post? && post.excerpt message = I18n.t(invite_template, username: username, topic_title: title, topic_excerpt: topic_excerpt, site_title: SiteSetting.title, site_description: SiteSetting.site_description) html = UserNotificationRenderer.new(Rails.configuration.paths["app/views"]).render( template: 'email/invite', diff --git a/app/models/badge.rb b/app/models/badge.rb index f9a175713..55e1d81f3 100644 --- a/app/models/badge.rb +++ b/app/models/badge.rb @@ -203,7 +203,7 @@ SQL end def i18n_name - self.name.downcase.gsub(' ', '_') + self.name.downcase.tr(' ', '_') end end diff --git a/app/models/topic_status_update.rb b/app/models/topic_status_update.rb index cb8557f2a..bfd438bba 100644 --- a/app/models/topic_status_update.rb +++ b/app/models/topic_status_update.rb @@ -102,7 +102,7 @@ TopicStatusUpdate = Struct.new(:topic, :user) do end def locale_key - "topic_statuses.#{action_code.gsub('.', '_')}" + "topic_statuses.#{action_code.tr('.', '_')}" end def reopening_topic? diff --git a/lib/email/sender.rb b/lib/email/sender.rb index 29683770f..e40cf09a6 100644 --- a/lib/email/sender.rb +++ b/lib/email/sender.rb @@ -94,12 +94,12 @@ module Email # http://www.ietf.org/rfc/rfc2919.txt if topic && topic.category && !topic.category.uncategorized? - list_id = "<#{topic.category.name.downcase.gsub(' ', '-')}.#{host}>" + list_id = "<#{topic.category.name.downcase.tr(' ', '-')}.#{host}>" # subcategory case if !topic.category.parent_category_id.nil? parent_category_name = Category.find_by(id: topic.category.parent_category_id).name - list_id = "<#{topic.category.name.downcase.gsub(' ', '-')}.#{parent_category_name.downcase.gsub(' ', '-')}.#{host}>" + list_id = "<#{topic.category.name.downcase.tr(' ', '-')}.#{parent_category_name.downcase.tr(' ', '-')}.#{host}>" end else list_id = "<#{host}>" diff --git a/lib/ip_addr.rb b/lib/ip_addr.rb index c80501c3b..22886a5ec 100644 --- a/lib/ip_addr.rb +++ b/lib/ip_addr.rb @@ -16,7 +16,7 @@ class IPAddr (4 - parts.size).times { parts << '*' } # support strings like 192.* v = parts.join('.') - "#{v.gsub('*', '0')}/#{32 - (v.count('*') * 8)}" + "#{v.tr('*', '0')}/#{32 - (v.count('*') * 8)}" end def to_cidr_s diff --git a/lib/slug.rb b/lib/slug.rb index e2c876de7..133a4e1bd 100644 --- a/lib/slug.rb +++ b/lib/slug.rb @@ -20,9 +20,9 @@ module Slug private def self.ascii_generator(string) - string.gsub("'", "") + string.tr("'", "") .parameterize - .gsub("_", "-") + .tr("_", "-") end def self.encoded_generator(string) From 176d9e4863b330a8b817c84a8879aed265c0f54c Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Fri, 10 Jun 2016 22:50:49 -0700 Subject: [PATCH 280/320] UX: use link icon for linked posts ;) FINAL DECISION --- app/assets/javascripts/discourse/widgets/post-links.js.es6 | 2 +- config/locales/client.en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-links.js.es6 b/app/assets/javascripts/discourse/widgets/post-links.js.es6 index f7b621a50..db9fb4312 100644 --- a/app/assets/javascripts/discourse/widgets/post-links.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-links.js.es6 @@ -22,7 +22,7 @@ export default createWidget('post-links', { h('a.track-link', { className: 'inbound', attributes: { href: link.url } - }, [iconNode('arrows-h'), linkBody]) + }, [iconNode('link'), linkBody]) ); }, diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 7c4c6c749..8ebd00820 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1083,7 +1083,7 @@ en: invited_to_topic: "

{{username}} {{description}}

" invitee_accepted: "

{{username}} accepted your invitation

" moved_post: "

{{username}} moved {{description}}

" - linked: "

{{username}} {{description}}

" + linked: "

{{username}} {{description}}

" granted_badge: "

Earned '{{description}}'

" group_message_summary: From 73859e8315597e95c1cf4adf4e7a3580c9efbc10 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Fri, 10 Jun 2016 23:54:52 -0700 Subject: [PATCH 281/320] revise new user welcome for 1.6 --- config/locales/server.en.yml | 52 +++++++++--------- .../welcome/like-link-flag-bookmark-2x.png | Bin 1479 -> 1532 bytes .../welcome/topic-notification-control-2x.png | Bin 48063 -> 62746 bytes 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 2ab37f4dc..a0a5c6bd4 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1746,34 +1746,24 @@ en: - For search, your user page, or the menu, use the **icon buttons at upper right**. - - Selecting a topic title will always take you to the **next unread reply** in the topic. To enter at the top or bottom, select the reply count or last reply date instead. + - Selecting a topic title will always take you to your **next unread reply** in the topic. To enter at the top or bottom instead, select the reply count or last reply date. - - While reading a topic, select the progress bar at the bottom right for full navigation controls. Quickly jump back to the top by selecting the topic title. Press ? for a list of super-speedy keyboard shortcuts. + - While reading a topic, use the timeline on the right to jump to the top, bottom, or your last read position. On smaller screens, select the progress bar at bottom right to expand it: + You can also press ? on your keyboard for a list of super-speedy keyboard shortcuts. + ## Replying - - To reply to the **topic in general**, use at the very bottom of the topic. - - - To reply to a **specific person**, use on their post. - - - To reply with **a new topic**, use to the right of the post. Both old and new topics will be automatically linked together. - - Your reply can be formatted using simple HTML, BBCode, or [Markdown](http://commonmark.org/help/): - - This is **bold**. - This is bold. - This is [b]bold[/b]. - - Want to learn Markdown? [Take our fun 10 minute interactive tutorial!](http://commonmark.org/help/tutorial/) - - To insert a quote, select the text you wish to quote, then press any Reply button. Repeat for multiple quotes. + To insert a quote, select the text you wish to quote, then press any Reply button to open the editor. Repeat for multiple quotes. + You can always continue reading while you compose your reply, and we automatically save drafts as you write. + To notify someone about your reply, mention their name. Type `@` to begin selecting a username. @@ -1786,45 +1776,55 @@ en: + Your reply can be formatted using simple HTML, BBCode, or [Markdown](http://commonmark.org/help/): + + This is **bold**. + This is bold. + This is [b]bold[/b]. + + For more formatting tips, [try our fun 10 minute interactive tutorial!](http://commonmark.org/help/tutorial/) + ## Actions There are action buttons at the bottom of each post: - To let someone know that you enjoyed and appreciated their post, use the **like** button. Share the love! + - To let someone know that you enjoyed and appreciated their post, use the **like** button. Share the love! - If you see a problem with someone's post, privately let them, or [our staff](%{base_url}/about), know about it with the **flag** button. You can also **share** a link to a post, or **bookmark** it for later reference on your user page. + - Grab a copy-pasteable link to any reply or topic via the **link** button. + + - Use the show more button to reveal more actions. **Flag** to privately let the author, or [our staff](%{base_url}/about), know about a problem. **Bookmark** to find this post later on your profile page. ## Notifications - When someone replies to you, quotes your post, or mentions your `@username`, a number will immediately appear at the top right of the page. Use it to access your **notifications**. + When someone replies to you, quotes your post, mentions your `@username`, or even links to your post, a number will immediately appear at the top right of the page. Select it to access your **notifications**. Don't worry about missing a reply – you'll be emailed any notifications that arrive when you are away. - ## Your Preferences + ## Preferences - All topics less than **two days old** are considered new. - - Any topic you've **actively participated in** (by creating, replying, or reading for an extended period) will be automatically tracked. + - Any topic you've **actively participated in** (by creating it, replying to it, or reading it for an extended period) will be automatically tracked on your behalf. - You will see the blue new and unread number indicators next to these topics: + You will see the new and unread number indicators next to these topics: - You can change your notifications for any topic via the notification control at the bottom of the topic. + You can change your notifications for any topic via the notification control at the bottom, and right hand side, of each topic. - You can also set notification state per category, if you want to watch every new topic in a specific category. + You can also set notification state per category, if you want to watch or mute every new topic in a specific category. To change any of these settings, see [your user preferences](%{base_url}/my/preferences). ## Community Trust - As you participate here, over time you'll gain the trust of the community, become a full citizen, and new user limitations will be lifted. At a high enough [trust level](https://meta.discourse.org/t/what-do-user-trust-levels-do/4924), you'll gain new abilities to help us manage our community together. + It's great to meet you! As you participate here, over time we'll get to know you, and your temporary new user limitations will be lifted. Keep participating, and over time you'll gain new [trust levels](https://meta.discourse.org/t/what-do-user-trust-levels-do/4924) that include special abilities to help us manage our community together. welcome_user: subject_template: "Welcome to %{site_name}!" diff --git a/public/images/welcome/like-link-flag-bookmark-2x.png b/public/images/welcome/like-link-flag-bookmark-2x.png index bf8b7650d3816fe9b45b36b25f96a919cbcd9732..9961fcd30e8096e49c80f9e399c349384ea6f342 100644 GIT binary patch delta 1525 zcmZXUX*kq*0LTB6Z95$4P&_E3xXg!?~)=2!hyrS z{vH~Q2B_3PrUWx8FsBC6DKM=B$ytA{jqoadPrvsr3Yo#Giis9Hy_+~nMBb^A} z$w5n+!KesGrhr%h*a9@W2ELsQ-^xOsmtnnZFd+v3@cDeTT8*)INJ<5K^*MZnjNHvd z8#}}{{H@jg$2Om!8cODH=$fEN2@6w`s1VN-yDVk4(!=Gc+FL2}^ z91e%UV6a%M+1Xj8Qi;UBLXyjYkT^L!Jd8DUz)`7K&k&MSiWX2OCnv$M0C|uPUnMh{ zOg5W6Iy#DVvyixKkw_#Ki!nL}NhrqpImrDyFg%7aMv(_E0bh(fDgay&kH-T)ej>d> z(yG8W5t2wj5=+q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CH 282/320] typo --- docs/DEVELOPER-ADVANCED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DEVELOPER-ADVANCED.md b/docs/DEVELOPER-ADVANCED.md index 41b20345d..a12f2e4c9 100644 --- a/docs/DEVELOPER-ADVANCED.md +++ b/docs/DEVELOPER-ADVANCED.md @@ -6,7 +6,7 @@ Note: If you are developing on a Mac, you will probably want to look at [these i # Preparing a fresh Ubuntu install -To get your Ubuntu 16.04 LTS install up and running to develop Discourse and Discourse plugins follow the commands below. We assume and English install of Ubuntu. +To get your Ubuntu 16.04 LTS install up and running to develop Discourse and Discourse plugins follow the commands below. We assume an English install of Ubuntu. # Basics whoami > /tmp/username From e66c51fd85d2564da0b9711e12fdfb522c83c3c9 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 12 Jun 2016 16:36:38 +1000 Subject: [PATCH 283/320] correct regression where clicking on unlisted topics does not work --- app/controllers/topics_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index 1b58942ab..3ffc9a86a 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -77,7 +77,7 @@ class TopicsController < ApplicationController discourse_expires_in 1.minute - if !@topic_view.topic.visible && @topic_view.topic.slug != params[:slug] + if !@topic_view.topic.visible && @topic_view.topic.slug != params[:slug] && !request.format.json? raise Discourse::NotFound end From a36203ff78b19b99c90b8dab8af4ae4ab1533cbf Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 9 Jun 2016 21:33:17 +0800 Subject: [PATCH 284/320] PERF: Paginate public polls. --- .../poll-results-number-voters.js.es6 | 29 +++--------- .../components/poll-results-number.js.es6 | 2 - .../poll-results-standard-voters.js.es6 | 22 +++------ .../javascripts/components/poll-voters.js.es6 | 46 +++++++++++++++++-- .../javascripts/controllers/poll.js.es6 | 5 -- .../components/poll-results-number.hbs | 6 ++- .../components/poll-results-standard.hbs | 2 +- .../templates/components/poll-voters.hbs | 12 ++--- .../javascripts/discourse/templates/poll.hbs | 4 +- .../initializers/extend-for-poll.js.es6 | 5 -- .../poll/assets/stylesheets/common/poll.scss | 5 +- plugins/poll/config/locales/client.en.yml | 1 + plugins/poll/plugin.rb | 35 +++++--------- .../spec/controllers/polls_controller_spec.rb | 1 - .../spec/integration/poll_endpoints_spec.rb | 18 ++++++++ 15 files changed, 102 insertions(+), 91 deletions(-) create mode 100644 plugins/poll/spec/integration/poll_endpoints_spec.rb diff --git a/plugins/poll/assets/javascripts/components/poll-results-number-voters.js.es6 b/plugins/poll/assets/javascripts/components/poll-results-number-voters.js.es6 index 63449af06..e75ad84cb 100644 --- a/plugins/poll/assets/javascripts/components/poll-results-number-voters.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-results-number-voters.js.es6 @@ -3,29 +3,14 @@ import User from 'discourse/models/user'; import PollVoters from 'discourse/plugins/poll/components/poll-voters'; export default PollVoters.extend({ - @computed("pollsVoters", "poll.options", "showMore", "isExpanded", "numOfVotersToShow") - users(pollsVoters, options, showMore, isExpanded, numOfVotersToShow) { - var users = []; - var voterIds = []; - const shouldLimit = showMore && !isExpanded; - - options.forEach(option => { - option.voter_ids.forEach(voterId => { - if (shouldLimit) { - if (!(users.length > numOfVotersToShow - 1)) { - users.push(pollsVoters[voterId]); - } - } else { - users.push(pollsVoters[voterId]); - } - }) - }); - - return users; + @computed("poll.voters", "pollsVoters") + canLoadMore(voters, pollsVoters) { + return pollsVoters.length < voters; }, - @computed("pollsVoters", "numOfVotersToShow") - showMore(pollsVoters, numOfVotersToShow) { - return !(Object.keys(pollsVoters).length < numOfVotersToShow); + @computed("poll.options", "offset") + voterIds(options) { + const ids = [].concat(...(options.map(option => option.voter_ids))); + return this._getIds(ids); } }); diff --git a/plugins/poll/assets/javascripts/components/poll-results-number.js.es6 b/plugins/poll/assets/javascripts/components/poll-results-number.js.es6 index 5718642b3..bbaf1813b 100644 --- a/plugins/poll/assets/javascripts/components/poll-results-number.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-results-number.js.es6 @@ -2,8 +2,6 @@ import round from "discourse/lib/round"; import computed from 'ember-addons/ember-computed-decorators'; export default Em.Component.extend({ - tagName: "span", - @computed("poll.options.@each.{html,votes}") totalScore() { return _.reduce(this.get("poll.options"), function(total, o) { diff --git a/plugins/poll/assets/javascripts/components/poll-results-standard-voters.js.es6 b/plugins/poll/assets/javascripts/components/poll-results-standard-voters.js.es6 index 1e51dc23c..80dc1ef8b 100644 --- a/plugins/poll/assets/javascripts/components/poll-results-standard-voters.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-results-standard-voters.js.es6 @@ -3,23 +3,13 @@ import User from 'discourse/models/user'; import PollVoters from 'discourse/plugins/poll/components/poll-voters'; export default PollVoters.extend({ - @computed("pollsVoters", "option.voter_ids", "showMore", "isExpanded", "numOfVotersToShow") - users(pollsVoters, voterIds, showMore, isExpanded, numOfVotersToShow) { - var users = []; - - if (showMore && !isExpanded) { - voterIds = voterIds.slice(0, numOfVotersToShow); - } - - voterIds.forEach(voterId => { - users.push(pollsVoters[voterId]); - }); - - return users; + @computed("option.votes", "pollsVoters") + canLoadMore(voters, pollsVoters) { + return pollsVoters.length < voters; }, - @computed("option.votes", "numOfVotersToShow") - showMore(numOfVotes, numOfVotersToShow) { - return !(numOfVotes < numOfVotersToShow); + @computed("option.voter_ids", "offset") + voterIds(ids) { + return this._getIds(ids); } }); diff --git a/plugins/poll/assets/javascripts/components/poll-voters.js.es6 b/plugins/poll/assets/javascripts/components/poll-voters.js.es6 index b580f1118..d2b8af9ae 100644 --- a/plugins/poll/assets/javascripts/components/poll-voters.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-voters.js.es6 @@ -3,11 +3,51 @@ export default Ember.Component.extend({ tagName: 'ul', classNames: ["poll-voters-list"], isExpanded: false, - numOfVotersToShow: 20, + numOfVotersToShow: 0, + offset: 0, + loading: false, + pollsVoters: null, + + init() { + this._super(); + this.set("pollsVoters", []); + }, + + _fetchUsers() { + this.set("loading", true); + + Discourse.ajax("/polls/voters.json", { + type: "get", + data: { user_ids: this.get("voterIds") } + }).then(result => { + if (this.isDestroyed) return; + this.set("pollsVoters", this.get("pollsVoters").concat(result.users)); + this.incrementProperty("offset"); + this.set("loading", false); + }).catch((error) => { + Ember.logger.log(error); + bootbox.alert(I18n.t('poll.error_while_fetching_voters')); + }); + }, + + _getIds(ids) { + const numOfVotersToShow = this.get("numOfVotersToShow"); + const offset = this.get("offset"); + return ids.slice(numOfVotersToShow * offset, numOfVotersToShow * (offset + 1)); + }, + + didInsertElement() { + this._super(); + + Ember.run.schedule("afterRender", () => { + this.set("numOfVotersToShow", Math.round(this.$().width() / 25) * 2); + if (this.get("voterIds").length > 0) this._fetchUsers(); + }); + }, actions: { - toggleExpand() { - this.toggleProperty("isExpanded"); + loadMore() { + this._fetchUsers(); } } }); diff --git a/plugins/poll/assets/javascripts/controllers/poll.js.es6 b/plugins/poll/assets/javascripts/controllers/poll.js.es6 index 50b80eb6d..841a3beb8 100644 --- a/plugins/poll/assets/javascripts/controllers/poll.js.es6 +++ b/plugins/poll/assets/javascripts/controllers/poll.js.es6 @@ -6,7 +6,6 @@ export default Ember.Controller.extend({ isRandom : Ember.computed.equal("poll.order", "random"), isClosed: Ember.computed.equal("poll.status", "closed"), isPublic: Ember.computed.equal("poll.public", "true"), - pollsVoters: Ember.computed.alias("post.polls_voters"), // shows the results when // - poll is closed @@ -152,10 +151,6 @@ export default Ember.Controller.extend({ this.setProperties({ vote: votes, showResults: true }); this.set("model", Em.Object.create(poll)); - - if (poll.public) { - this.get("pollsVoters")[currentUser.get("id")] = currentUser; - } }).catch(() => { bootbox.alert(I18n.t("poll.error_while_casting_votes")); }).finally(() => { diff --git a/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-number.hbs b/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-number.hbs index 48e73ff2f..c00255a09 100644 --- a/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-number.hbs +++ b/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-number.hbs @@ -1,5 +1,7 @@ -{{{averageRating}}} +
+ {{{averageRating}}} +
{{#if poll.public}} - {{poll-results-number-voters poll=poll pollsVoters=pollsVoters}} + {{poll-results-number-voters poll=poll}} {{/if}} diff --git a/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs b/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs index e412d61a7..5f939cbc8 100644 --- a/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs +++ b/plugins/poll/assets/javascripts/discourse/templates/components/poll-results-standard.hbs @@ -11,7 +11,7 @@ {{#if poll.public}} - {{poll-results-standard-voters option=option pollsVoters=pollsVoters}} + {{poll-results-standard-voters option=option}} {{/if}} {{/each}} diff --git a/plugins/poll/assets/javascripts/discourse/templates/components/poll-voters.hbs b/plugins/poll/assets/javascripts/discourse/templates/components/poll-voters.hbs index 5c5a57aa5..53f6fcdc7 100644 --- a/plugins/poll/assets/javascripts/discourse/templates/components/poll-voters.hbs +++ b/plugins/poll/assets/javascripts/discourse/templates/components/poll-voters.hbs @@ -1,5 +1,5 @@
diff --git a/plugins/poll/assets/javascripts/discourse/templates/poll.hbs b/plugins/poll/assets/javascripts/discourse/templates/poll.hbs index d459a0c68..af63c2a4b 100644 --- a/plugins/poll/assets/javascripts/discourse/templates/poll.hbs +++ b/plugins/poll/assets/javascripts/discourse/templates/poll.hbs @@ -2,9 +2,9 @@
{{#if showingResults}} {{#if isNumber}} - {{poll-results-number poll=poll pollsVoters=pollsVoters}} + {{poll-results-number poll=poll}} {{else}} - {{poll-results-standard poll=poll pollsVoters=pollsVoters}} + {{poll-results-standard poll=poll}} {{/if}} {{else}}
    diff --git a/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 b/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 index 0b7919258..d09937209 100644 --- a/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 +++ b/plugins/poll/assets/javascripts/initializers/extend-for-poll.js.es6 @@ -29,10 +29,6 @@ function initializePolls(api) { const post = this.get('model.postStream').findLoadedPost(msg.post_id); if (post) { post.set('polls', msg.polls); - - if (msg.user) { - post.set(`polls_voters.${msg.user.id}`, msg.user); - } } }); }, @@ -80,7 +76,6 @@ function initializePolls(api) { const post = helper.getModel(); api.preventCloak(post.id); const votes = post.get('polls_votes') || {}; - post.set("polls_voters", (post.get("polls_voters") || {})); post.pollsChanged(); diff --git a/plugins/poll/assets/stylesheets/common/poll.scss b/plugins/poll/assets/stylesheets/common/poll.scss index 5db255555..1d25e2d57 100644 --- a/plugins/poll/assets/stylesheets/common/poll.scss +++ b/plugins/poll/assets/stylesheets/common/poll.scss @@ -81,7 +81,7 @@ div.poll { vertical-align: middle; padding: 10px; - & > span { + .poll-results-number-rating { font-size: 2em; } } @@ -97,10 +97,11 @@ div.poll { display: inline; } - margin: 5px 0; + margin-top: 10px; } .poll-voters-toggle-expand { + width: 100%; text-align: center; } diff --git a/plugins/poll/config/locales/client.en.yml b/plugins/poll/config/locales/client.en.yml index 9cad3df38..4344b85bd 100644 --- a/plugins/poll/config/locales/client.en.yml +++ b/plugins/poll/config/locales/client.en.yml @@ -67,3 +67,4 @@ en: error_while_toggling_status: "There was an error while toggling the status of this poll." error_while_casting_votes: "There was an error while casting your votes." + error_while_fetching_voters: "There was an error while displaying the voters." diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb index 26b825dac..075be0983 100644 --- a/plugins/poll/plugin.rb +++ b/plugins/poll/plugin.rb @@ -185,7 +185,7 @@ after_initialize do class DiscoursePoll::PollsController < ::ApplicationController requires_plugin PLUGIN_NAME - before_filter :ensure_logged_in + before_filter :ensure_logged_in, except: [:voters] def vote post_id = params.require(:post_id) @@ -214,11 +214,22 @@ after_initialize do render_json_error e.message end end + + def voters + user_ids = params.require(:user_ids) + + users = User.where(id: user_ids).map do |user| + UserNameSerializer.new(user).serializable_hash + end + + render json: { users: users } + end end DiscoursePoll::Engine.routes.draw do put "/vote" => "polls#vote" put "/toggle_status" => "polls#toggle_status" + get "/voters" => 'polls#voters' end Discourse::Application.routes.append do @@ -299,26 +310,4 @@ after_initialize do return unless post_custom_fields[DiscoursePoll::VOTES_CUSTOM_FIELD].present? post_custom_fields[DiscoursePoll::VOTES_CUSTOM_FIELD].has_key?("#{scope.user.id}") end - - add_to_serializer(:post, :polls_voters) do - voters = {} - - user_ids = post_custom_fields[DiscoursePoll::VOTES_CUSTOM_FIELD].keys - - User.where(id: user_ids).map do |user| - voters[user.id] = UserNameSerializer.new(user).serializable_hash - end - - voters - end - - add_to_serializer(:post, :include_polls_voters?) do - return unless post_custom_fields.present? - return unless post_custom_fields[DiscoursePoll::POLLS_CUSTOM_FIELD].present? - return unless post_custom_fields[DiscoursePoll::VOTES_CUSTOM_FIELD].present? - - post_custom_fields[DiscoursePoll::POLLS_CUSTOM_FIELD].any? do |_, value| - value["public"] == "true" - end - end end diff --git a/plugins/poll/spec/controllers/polls_controller_spec.rb b/plugins/poll/spec/controllers/polls_controller_spec.rb index 8dc6a66cf..9e8e01964 100644 --- a/plugins/poll/spec/controllers/polls_controller_spec.rb +++ b/plugins/poll/spec/controllers/polls_controller_spec.rb @@ -173,5 +173,4 @@ describe ::DiscoursePoll::PollsController do end end - end diff --git a/plugins/poll/spec/integration/poll_endpoints_spec.rb b/plugins/poll/spec/integration/poll_endpoints_spec.rb new file mode 100644 index 000000000..6aeb65cd3 --- /dev/null +++ b/plugins/poll/spec/integration/poll_endpoints_spec.rb @@ -0,0 +1,18 @@ +require "rails_helper" + +describe "DiscoursePoll endpoints" do + describe "fetch voters from user_ids" do + let(:user) { Fabricate(:user) } + + it "should return the right response" do + get "/polls/voters.json", { user_ids: [user.id] } + + expect(response.status).to eq(200) + + json = JSON.parse(response.body)["users"].first + + expect(json["name"]).to eq(user.name) + expect(json["title"]).to eq(user.title) + end + end +end From 3de2d7a0037e5a8bcedb7f964d043eed81489ce7 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Sun, 12 Jun 2016 03:02:07 -0700 Subject: [PATCH 285/320] better invite copy --- config/locales/server.en.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index a0a5c6bd4..6438a804a 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1583,7 +1583,7 @@ en: %{invite_link} - This invitation is from a trusted user, so you won't need to log in. + This invitation is from a trusted user, so an account will be created for you automatically. custom_invite_forum_mailer: subject_template: "%{invitee_name} invited you to join %{site_domain_name}" @@ -1602,7 +1602,7 @@ en: %{invite_link} - This invitation is from a trusted user, so you won't need to log in. + This invitation is from a trusted user, so an account will be created for you automatically. invite_password_instructions: subject_template: "Set password for your %{site_name} account" From 3a8d366011d070289528249c48b93377fc43a749 Mon Sep 17 00:00:00 2001 From: awesomerobot Date: Sun, 12 Jun 2016 19:46:24 -0400 Subject: [PATCH 286/320] usercard background matches theme background (default = white) --- app/assets/stylesheets/desktop/user-card.scss | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/desktop/user-card.scss b/app/assets/stylesheets/desktop/user-card.scss index 2980ef2cf..687534cdf 100644 --- a/app/assets/stylesheets/desktop/user-card.scss +++ b/app/assets/stylesheets/desktop/user-card.scss @@ -1,8 +1,8 @@ // styles that apply to the "share" popup when sharing a link to a post or topic // Colors should mostly be absolute here, it will look the same in dark & light themes -$user_card_primary: #fff; -$user_card_background: #222; +$user_card_primary: $primary; +$user_card_background: $secondary; #user-card { position: absolute; @@ -10,7 +10,7 @@ $user_card_background: #222; left: -9999px; top: -9999px; z-index: 990; - box-shadow: 0 2px 12px rgba($primary, .6); + box-shadow: 1px 2px 6px rgba(0,0,0, .25); margin-top: -2px; color: $user_card_primary; background: $user_card_background center center; @@ -94,7 +94,7 @@ $user_card_background: #222; font-size: 0.929em; font-weight: normal; margin-top: 0; - color: scale-color($user_card_primary, $lightness: 25%); + color: scale-color($user_card_primary, $lightness: 20%); overflow: hidden; text-overflow: ellipsis; a { @@ -121,7 +121,7 @@ $user_card_background: #222; display: inline; margin-right: 5px; .desc, a { - color: scale-color($user_card_primary, $lightness: 50%); + color: scale-color($user_card_primary, $lightness: 35%); } } div {display: inline; color: scale-color($user_card_background, $lightness: 50%); @@ -139,7 +139,7 @@ $user_card_background: #222; } .bio { - padding: 15px 0 0 0; + padding: 10px 0 0 0; clear: left; a { @@ -161,9 +161,11 @@ $user_card_background: #222; .location-and-website { clear: left; - + margin-top: 5px; + .location {margin-right: 10px;} .website-name { a { + text-decoration: underline; color: $user_card_primary; } } @@ -204,7 +206,6 @@ $user_card_background: #222; height: 60px; position: relative; width: 45%; - margin-top: 11px; span { position: absolute; @@ -222,9 +223,9 @@ $user_card_background: #222; margin-top: 5px; .user-badge { - background: transparent; - color: scale-color($user_card_background, $lightness: 50%); - border-color: scale-color($user_card_background, $lightness: 50%); + background: scale-color($user_card_background, $lightness: -5%); + border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%); + color: $user_card_primary; } h3 { From 142b74b01b0bbab29bad1334992762695d632307 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 13 Jun 2016 09:34:52 +0800 Subject: [PATCH 287/320] Add default queues to sidekiq.yml. --- config/sidekiq.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 config/sidekiq.yml diff --git a/config/sidekiq.yml b/config/sidekiq.yml new file mode 100644 index 000000000..7b095d7d4 --- /dev/null +++ b/config/sidekiq.yml @@ -0,0 +1,6 @@ +--- +development: + :queues: + - [critical,4] + - [default, 2] + - [low] From 0c8dd283953187196280b68fda275bbf281aa6e8 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 13 Jun 2016 11:25:06 +0800 Subject: [PATCH 288/320] FIX: Post count wasn't recovered when a post is recovered. --- lib/post_destroyer.rb | 6 ++++++ spec/components/post_destroyer_spec.rb | 28 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/lib/post_destroyer.rb b/lib/post_destroyer.rb index 9d35572f0..b1538585a 100644 --- a/lib/post_destroyer.rb +++ b/lib/post_destroyer.rb @@ -64,6 +64,12 @@ class PostDestroyer def staff_recovered @post.recover! + + if author = @post.user + author.user_stat.post_count += 1 + author.user_stat.save! + end + @post.publish_change_to_clients! :recovered TopicTrackingState.publish_recover(@post.topic) if @post.topic && @post.post_number == 1 end diff --git a/spec/components/post_destroyer_spec.rb b/spec/components/post_destroyer_spec.rb index 00573a5f4..aacad3ca9 100644 --- a/spec/components/post_destroyer_spec.rb +++ b/spec/components/post_destroyer_spec.rb @@ -162,6 +162,34 @@ describe PostDestroyer do post_action = author.user_actions.where(action_type: UserAction::REPLY, target_post_id: reply.id).first expect(post_action).to be_present end + + describe "post_count recovery" do + before do + post + @user = post.user + expect(@user.user_stat.post_count).to eq(1) + end + + context "recovered by user" do + it "should increment the user's post count" do + PostDestroyer.new(@user, post).destroy + expect(@user.user_stat.post_count).to eq(1) + + PostDestroyer.new(@user, post.reload).recover + expect(@user.reload.user_stat.post_count).to eq(1) + end + end + + context "recovered by admin" do + it "should increment the user's post count" do + PostDestroyer.new(moderator, post).destroy + expect(@user.user_stat.post_count).to eq(0) + + PostDestroyer.new(admin, post).recover + expect(@user.reload.user_stat.post_count).to eq(1) + end + end + end end describe 'basic destroying' do From 8c3e63f87af941fb2d8b1097d1e9ce2c99320d16 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 13 Jun 2016 12:24:38 +0800 Subject: [PATCH 289/320] Raise an error if create fails. --- app/models/topic_link.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index 08114bfae..b35ec1c76 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -159,7 +159,7 @@ class TopicLink < ActiveRecord::Base next if parsed && parsed.host && parsed.host.length > TopicLink.max_domain_length added_urls << url - TopicLink.create(post_id: post.id, + TopicLink.create!(post_id: post.id, user_id: post.user_id, topic_id: post.topic_id, url: url, @@ -184,7 +184,7 @@ class TopicLink < ActiveRecord::Base url: reflected_url) unless tl - tl = TopicLink.create(user_id: post.user_id, + tl = TopicLink.create!(user_id: post.user_id, topic_id: topic_id, post_id: reflected_post.try(:id), url: reflected_url, From 1fe499e893eceb07294b0adf6edd97c8c41798a6 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 13 Jun 2016 13:13:39 +0800 Subject: [PATCH 290/320] FIX: Don't include reflections when checking for duplication topic links. --- app/models/topic_link.rb | 3 ++- spec/models/topic_link_spec.rb | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index b35ec1c76..4ba19ef7b 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -233,7 +233,8 @@ class TopicLink < ActiveRecord::Base results = TopicLink .includes(:post => :user) - .where(topic_id: topic.id).limit(200) + .where(topic_id: topic.id, reflection: false) + .limit(200) lookup = {} results.each do |tl| diff --git a/spec/models/topic_link_spec.rb b/spec/models/topic_link_spec.rb index 487c6852f..5fb86c7fc 100644 --- a/spec/models/topic_link_spec.rb +++ b/spec/models/topic_link_spec.rb @@ -16,6 +16,8 @@ describe TopicLink do topic.user end + let(:post) { Fabricate(:post) } + it "can't link to the same topic" do ftl = TopicLink.new(url: "/t/#{topic.id}", topic_id: topic.id, @@ -320,6 +322,31 @@ http://b.com/#{'a'*500} end end + + describe ".duplicate_lookup" do + let(:user) { Fabricate(:user, username: "junkrat") } + + let(:post_with_internal_link) do + Fabricate(:post, user: user, raw: "Check out this topic #{post.topic.url}/122131") + end + + it "should return the right response" do + TopicLink.extract_from(post_with_internal_link) + + result = TopicLink.duplicate_lookup(post_with_internal_link.topic) + expect(result.count).to eq(1) + + lookup = result["test.localhost/t/#{post.topic.slug}/#{post.topic.id}/122131"] + + expect(lookup[:domain]).to eq("test.localhost") + expect(lookup[:username]).to eq("junkrat") + expect(lookup[:posted_at].to_s).to eq(post_with_internal_link.created_at.to_s) + expect(lookup[:post_number]).to eq(1) + + result = TopicLink.duplicate_lookup(post.topic) + expect(result.count).to eq(0) + end + end end end From 95efdce74f23707160af293256430d18148edf01 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 13 Jun 2016 13:16:24 +0800 Subject: [PATCH 291/320] Improve spec. --- spec/models/topic_link_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/topic_link_spec.rb b/spec/models/topic_link_spec.rb index 5fb86c7fc..5aca2837b 100644 --- a/spec/models/topic_link_spec.rb +++ b/spec/models/topic_link_spec.rb @@ -344,7 +344,7 @@ http://b.com/#{'a'*500} expect(lookup[:post_number]).to eq(1) result = TopicLink.duplicate_lookup(post.topic) - expect(result.count).to eq(0) + expect(result).to eq({}) end end end From 191d2283f46f34f85a6286b1a669ec8071648ae7 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 13 Jun 2016 14:31:10 +0800 Subject: [PATCH 292/320] Fix specs. --- app/models/topic_link.rb | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index 4ba19ef7b..505565caf 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -133,7 +133,7 @@ class TopicLink < ActiveRecord::Base # We aren't interested in tracking internal links to users next if route[:controller] == 'users' - topic_id = route[:topic_id] + topic_id = route[:topic_id].to_i post_number = route[:post_number] || 1 # Store the canonical URL @@ -159,15 +159,22 @@ class TopicLink < ActiveRecord::Base next if parsed && parsed.host && parsed.host.length > TopicLink.max_domain_length added_urls << url - TopicLink.create!(post_id: post.id, - user_id: post.user_id, - topic_id: post.topic_id, - url: url, - domain: parsed.host || Discourse.current_hostname, - internal: internal, - link_topic_id: topic_id, - link_post_id: reflected_post.try(:id), - quote: link.is_quote) + + topic_link = TopicLink.find_by(topic_id: post.topic_id, + user_id: post.user_id, + url: url) + + unless topic_link + TopicLink.create!(post_id: post.id, + user_id: post.user_id, + topic_id: post.topic_id, + url: url, + domain: parsed.host || Discourse.current_hostname, + internal: internal, + link_topic_id: topic_id, + link_post_id: reflected_post.try(:id), + quote: link.is_quote) + end # Create the reflection if we can if topic_id.present? From c13cbc8aeadcd849b7342636ffac5dff93111e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 13 Jun 2016 11:11:25 +0200 Subject: [PATCH 293/320] FIX: only show topic links from active users --- app/models/topic_link.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index 505565caf..27735689d 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -237,17 +237,18 @@ class TopicLink < ActiveRecord::Base end def self.duplicate_lookup(topic) - results = TopicLink - .includes(:post => :user) + .includes(:post, :user) + .joins(:post, :user) + .where("posts.id IS NOT NULL AND users.id IS NOT NULL") .where(topic_id: topic.id, reflection: false) - .limit(200) + .last(200) lookup = {} results.each do |tl| normalized = tl.url.downcase.sub(/^https?:\/\//, '').sub(/\/$/, '') lookup[normalized] = { domain: tl.domain, - username: tl.post.user.username_lower, + username: tl.user.username_lower, posted_at: tl.post.created_at, post_number: tl.post.post_number } end From 49f8a2baa78789c098eef9ef980570deb6cf5a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 13 Jun 2016 12:31:01 +0200 Subject: [PATCH 294/320] FEATURE: support for mandrill webhooks --- app/controllers/webhooks_controller.rb | 17 ++++++++++++++ config/routes.rb | 1 + lib/email/sender.rb | 7 ++++-- spec/controllers/webhooks_controller_spec.rb | 24 ++++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/app/controllers/webhooks_controller.rb b/app/controllers/webhooks_controller.rb index 79265ee2a..90edfe99a 100644 --- a/app/controllers/webhooks_controller.rb +++ b/app/controllers/webhooks_controller.rb @@ -71,6 +71,23 @@ class WebhooksController < ActionController::Base render nothing: true, status: 200 end + def mandrill + events = params["mandrill_events"] + events.each do |event| + message_id = event["msg"]["metadata"]["message_id"] rescue nil + next unless message_id + + case event["event"] + when "hard_bounce" + process_bounce(message_id, Email::Receiver::HARD_BOUNCE_SCORE) + when "soft_bounce" + process_bounce(message_id, Email::Receiver::SOFT_BOUNCE_SCORE) + end + end + + render nothing: true, status: 200 + end + private def mailgun_failure diff --git a/config/routes.rb b/config/routes.rb index 717fe6da5..92497616f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -19,6 +19,7 @@ Discourse::Application.routes.draw do post "webhooks/mailgun" => "webhooks#mailgun" post "webhooks/sendgrid" => "webhooks#sendgrid" post "webhooks/mailjet" => "webhooks#mailjet" + post "webhooks/mandrill" => "webhooks#mandrill" if Rails.env.development? mount Sidekiq::Web => "/sidekiq" diff --git a/lib/email/sender.rb b/lib/email/sender.rb index e40cf09a6..d37746418 100644 --- a/lib/email/sender.rb +++ b/lib/email/sender.rb @@ -133,9 +133,12 @@ module Email @message.header['X-Discourse-Post-Id'] = nil if post_id.present? @message.header['X-Discourse-Reply-Key'] = nil if reply_key.present? - # it's the only way to pass the original message_id when using mailjet - if ActionMailer::Base.smtp_settings[:address][".mailjet.com"] + # pass the original message_id when using mailjet/mandrill + case ActionMailer::Base.smtp_settings[:address] + when /\.mailjet\.com/ @message.header['X-MJ-CustomID'] = @message.message_id + when "smtp.mandrillapp.com" + @message.header['X-MC-Metadata'] = { message_id: @message.message_id }.to_json end # Suppress images from short emails diff --git a/spec/controllers/webhooks_controller_spec.rb b/spec/controllers/webhooks_controller_spec.rb index 0bf1b3611..6e599a2aa 100644 --- a/spec/controllers/webhooks_controller_spec.rb +++ b/spec/controllers/webhooks_controller_spec.rb @@ -75,4 +75,28 @@ describe WebhooksController do end + context "mandrill" do + + it "works" do + user = Fabricate(:user, email: email) + email_log = Fabricate(:email_log, user: user, message_id: message_id) + + post :mandrill, mandrill_events: [{ + "event" => "hard_bounce", + "msg" => { + "metadata" => { + "message_id" => message_id + } + } + }] + + expect(response).to be_success + + email_log.reload + expect(email_log.bounced).to eq(true) + expect(email_log.user.user_stat.bounce_score).to eq(2) + end + + end + end From e97e0bb311d1bea13512c1b77a7c1ca9e8018cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 13 Jun 2016 15:37:14 +0200 Subject: [PATCH 295/320] FEATURE: new FirstReplyByEmail bronze badge --- .../onceoff/grand_first_reply_by_email.rb | 31 +++++++++++++++++++ app/jobs/onceoff/grant_emoji.rb | 8 +++-- app/jobs/onceoff/grant_onebox.rb | 5 ++- app/models/badge.rb | 5 +-- config/locales/server.en.yml | 5 +++ db/fixtures/006_badges.rb | 14 +++++++++ 6 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 app/jobs/onceoff/grand_first_reply_by_email.rb diff --git a/app/jobs/onceoff/grand_first_reply_by_email.rb b/app/jobs/onceoff/grand_first_reply_by_email.rb new file mode 100644 index 000000000..12fbb86e5 --- /dev/null +++ b/app/jobs/onceoff/grand_first_reply_by_email.rb @@ -0,0 +1,31 @@ +module Jobs + + class GrantFirstReplyByEmail < Jobs::Onceoff + def execute_onceoff(args) + to_award = {} + + Post.select(:id, :created_at, :user_id) + .secured(Guardian.new) + .visible + .public_posts + .where(via_email: true) + .where("post_number > 1") + .find_in_batches do |group| + group.each do |p| + to_award[p.user_id] ||= { post_id: p.id, created_at: p.created_at } + end + end + + to_award.each do |user_id, opts| + user = User.where(id: user_id).first + BadgeGranter.grant(badge, user, opts) if user + end + end + + def badge + @badge ||= Badge.find(Badge::FirstReplyByEmail) + end + + end + +end diff --git a/app/jobs/onceoff/grant_emoji.rb b/app/jobs/onceoff/grant_emoji.rb index 9a57423d6..3b9608ec5 100644 --- a/app/jobs/onceoff/grant_emoji.rb +++ b/app/jobs/onceoff/grant_emoji.rb @@ -18,12 +18,16 @@ module Jobs end end - badge = Badge.find(Badge::FirstEmoji) to_award.each do |user_id, opts| - BadgeGranter.grant(badge, User.find(user_id), opts) + user = User.where(id: user_id).first + BadgeGranter.grant(badge, user, opts) if user end end + def badge + @badge ||= Badge.find(Badge::FirstEmoji) + end + end end diff --git a/app/jobs/onceoff/grant_onebox.rb b/app/jobs/onceoff/grant_onebox.rb index 113f2e542..3dadbd16d 100644 --- a/app/jobs/onceoff/grant_onebox.rb +++ b/app/jobs/onceoff/grant_onebox.rb @@ -28,13 +28,16 @@ module Jobs end - badge = Badge.find(Badge::FirstOnebox) to_award.each do |user_id, opts| user = User.where(id: user_id).first BadgeGranter.grant(badge, user, opts) if user end end + def badge + @badge ||= Badge.find(Badge::FirstOnebox) + end + end end diff --git a/app/models/badge.rb b/app/models/badge.rb index 55e1d81f3..4a2105a10 100644 --- a/app/models/badge.rb +++ b/app/models/badge.rb @@ -1,6 +1,6 @@ class Badge < ActiveRecord::Base - # NOTE: These badge ids are not in order! They are grouped logically. When picking an id - # search for it. + # NOTE: These badge ids are not in order! They are grouped logically. + # When picking an id, *search* for it. Welcome = 5 NicePost = 6 @@ -17,6 +17,7 @@ class Badge < ActiveRecord::Base FirstMention = 40 FirstEmoji = 41 FirstOnebox = 42 + FirstReplyByEmail = 43 ReadGuidelines = 16 Reader = 17 diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 6438a804a..7f2a04b79 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -3095,6 +3095,11 @@ en: name: First Onebox description: Posted a link that was oneboxed long_description: This badge is granted the first time you post a link on a line by itself, which was then automatically expanded into a onebox with a brief summary of the link, a title, and (when available) a picture. + first_reply_by_email: + name: First Reply By Email + description: Replied to a Post via email + long_description: | + This badge is granted the first time you reply to a post via email :e-mail:. admin_login: success: "Email Sent" diff --git a/db/fixtures/006_badges.rb b/db/fixtures/006_badges.rb index b9fc82f80..bf99aa53a 100644 --- a/db/fixtures/006_badges.rb +++ b/db/fixtures/006_badges.rb @@ -400,6 +400,20 @@ Badge.seed do |b| b.system = true end +Badge.seed do |b| + b.id = Badge::FirstReplyByEmail + b.default_name = "First Reply By Email" + b.badge_type_id = BadgeType::Bronze + b.multiple_grant = false + b.target_posts = true + b.show_posts = true + b.query = nil + b.badge_grouping_id = BadgeGrouping::GettingStarted + b.default_badge_grouping_id = BadgeGrouping::GettingStarted + b.trigger = Badge::Trigger::PostProcessed + b.system = true +end + Badge.where("NOT system AND id < 100").each do |badge| new_id = [Badge.maximum(:id) + 1, 100].max old_id = badge.id From d2bd857160b27877aba237a16751b409b6efc4ef Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Tue, 14 Jun 2016 12:06:11 +1000 Subject: [PATCH 296/320] enable args MODULE and FILTER for qunit:test rake task --- lib/tasks/qunit.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/tasks/qunit.rake b/lib/tasks/qunit.rake index 061ae69ff..07e9a48b6 100644 --- a/lib/tasks/qunit.rake +++ b/lib/tasks/qunit.rake @@ -37,6 +37,16 @@ task "qunit:test" => :environment do test_path = "#{Rails.root}/vendor/assets/javascripts" cmd = "phantomjs #{test_path}/run-qunit.js http://localhost:#{port}/qunit" + options = {} + + %w{module filter}.each do |arg| + options[arg] = ENV[arg.upcase] if ENV[arg.upcase].present? + end + + if options.present? + cmd += "?#{options.to_query.gsub('+', '%20')}" + end + # wait for server to respond, will exception out on failure tries = 0 begin From 470da6205c36d83daa32c8403d0d0bf886e5f0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 14 Jun 2016 16:45:47 +0200 Subject: [PATCH 297/320] FIX: staged users should not watch/track/mute categories by default --- app/models/user.rb | 2 ++ app/models/user_option.rb | 1 - spec/models/user_spec.rb | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index bff292523..c44a6fd3a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -952,6 +952,8 @@ class User < ActiveRecord::Base end def set_default_categories_preferences + return if self.staged? + values = [] %w{watching tracking muted}.each do |s| diff --git a/app/models/user_option.rb b/app/models/user_option.rb index 6f0a8ecbd..7a812e403 100644 --- a/app/models/user_option.rb +++ b/app/models/user_option.rb @@ -42,7 +42,6 @@ class UserOption < ActiveRecord::Base self.like_notification_frequency = SiteSetting.default_other_like_notification_frequency - if SiteSetting.default_email_digest_frequency.to_i <= 0 self.email_digests = false else diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 4fbd120a6..e08759b6d 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1235,6 +1235,13 @@ describe User do expect(CategoryUser.lookup(user, :tracking).pluck(:category_id)).to eq([2]) expect(CategoryUser.lookup(user, :muted).pluck(:category_id)).to eq([3]) end + + it "does not set category preferences for staged users" do + user = Fabricate(:user, staged: true) + expect(CategoryUser.lookup(user, :watching).pluck(:category_id)).to eq([]) + expect(CategoryUser.lookup(user, :tracking).pluck(:category_id)).to eq([]) + expect(CategoryUser.lookup(user, :muted).pluck(:category_id)).to eq([]) + end end context UserOption do From b42f28d4c36eddce1df039566f3615b0753a2dc6 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 14 Jun 2016 11:44:35 -0400 Subject: [PATCH 298/320] Improved mailing list import. Now uses a SQLite database to store messages rather than JSON files for performance and memory considerations. --- script/import_scripts/base.rb | 12 +- script/import_scripts/mbox.rb | 257 ++++++++++++++++++++++++---------- 2 files changed, 188 insertions(+), 81 deletions(-) diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb index f4b378b4f..e7829a270 100644 --- a/script/import_scripts/base.rb +++ b/script/import_scripts/base.rb @@ -198,10 +198,14 @@ class ImportScripts::Base def all_records_exist?(type, import_ids) return false if import_ids.empty? - Post.exec_sql('CREATE TEMP TABLE import_ids(val varchar(200) PRIMARY KEY)') + orig_conn = ActiveRecord::Base.connection + conn = orig_conn.raw_connection + + conn.exec('CREATE TEMP TABLE import_ids(val varchar(200) PRIMARY KEY)') import_id_clause = import_ids.map { |id| "('#{PG::Connection.escape_string(id.to_s)}')" }.join(",") - Post.exec_sql("INSERT INTO import_ids VALUES #{import_id_clause}") + + conn.exec("INSERT INTO import_ids VALUES #{import_id_clause}") existing = "#{type.to_s.classify}CustomField".constantize.where(name: 'import_id') existing = existing.joins('JOIN import_ids ON val = value') @@ -211,7 +215,7 @@ class ImportScripts::Base return true end ensure - Post.exec_sql('DROP TABLE import_ids') + conn.exec('DROP TABLE import_ids') end # Iterate through a list of user records to be imported. @@ -366,7 +370,7 @@ class ImportScripts::Base params[:parent_category_id] = top.id if top end - new_category = create_category(params, params[:id]) + create_category(params, params[:id]) created += 1 end diff --git a/script/import_scripts/mbox.rb b/script/import_scripts/mbox.rb index cf50d1aed..978b30cc2 100755 --- a/script/import_scripts/mbox.rb +++ b/script/import_scripts/mbox.rb @@ -1,3 +1,4 @@ +require 'sqlite3' require File.expand_path(File.dirname(__FILE__) + "/base.rb") class ImportScripts::Mbox < ImportScripts::Base @@ -5,96 +6,169 @@ class ImportScripts::Mbox < ImportScripts::Base BATCH_SIZE = 1000 CATEGORY_ID = 6 - MBOX_DIR = "/tmp/mbox-input" - USER_INDEX_PATH = "#{MBOX_DIR}/user-index.json" - TOPIC_INDEX_PATH = "#{MBOX_DIR}/topic-index.json" - REPLY_INDEX_PATH = "#{MBOX_DIR}/replies-index.json" + MBOX_DIR = File.expand_path("~/import/site") + + # Remove to not split individual files + SPLIT_AT = /^From owner-/ def execute - create_indices + create_email_indices + create_user_indices + massage_indices import_users create_forum_topics import_replies end - def all_messages + def open_db + SQLite3::Database.new("#{MBOX_DIR}/index.db") + end - files = Dir["#{MBOX_DIR}/*/*"] + def all_messages + files = Dir["#{MBOX_DIR}/messages/*"] files.each_with_index do |f, idx| - raw = File.read(f) - mail = Mail.read_from_string(raw) - yield mail, f - print_status(idx, files.size) + if SPLIT_AT.present? + msg = "" + File.foreach(f).with_index do |line, line_num| + line = line.scrub + if line =~ SPLIT_AT + if !msg.empty? + mail = Mail.read_from_string(msg) + yield mail + print_status(idx, files.size) + msg = "" + end + end + msg << line + end + if !msg.empty? + mail = Mail.read_from_string(msg) + yield mail + print_status(idx, files.size) + msg = "" + end + else + raw = File.read(f) + mail = Mail.read_from_string(raw) + yield mail + print_status(idx, files.size) + end + end end - def create_indices - return if File.exist?(USER_INDEX_PATH) && File.exist?(TOPIC_INDEX_PATH) && File.exist?(REPLY_INDEX_PATH) - puts "", "creating indices" - users = {} + def massage_indices + db = open_db + db.execute "UPDATE emails SET reply_to = null WHERE reply_to = ''" - topics = [] + rows = db.execute "SELECT msg_id, title, reply_to FROM emails ORDER BY email_date ASC" - topic_lookup = {} - topic_titles = {} - replies = [] + msg_ids = {} + titles = {} + rows.each do |row| + msg_ids[row[0]] = true + titles[row[1]] = row[0] + end - all_messages do |mail, filename| - users[mail.from.first] = mail[:from].display_names.first - - msg_id = mail['Message-ID'].to_s - reply_to = mail['In-Reply-To'].to_s - title = clean_title(mail['Subject'].to_s) - date = Time.parse(mail['date'].to_s).to_i + # First, any replies where the parent doesn't exist should have that field cleared + not_found = [] + rows.each do |row| + msg_id, _, reply_to = row if reply_to.present? - topic = topic_lookup[reply_to] || reply_to - topic_lookup[msg_id] = topic - replies << {id: msg_id, topic: topic, file: filename, title: title, date: date} - else - topics << {id: msg_id, file: filename, title: title, date: date} - topic_titles[title] ||= msg_id + not_found << msg_id if msg_ids[reply_to].blank? end end - replies.sort! {|a, b| a[:date] <=> b[:date]} - topics.sort! {|a, b| a[:date] <=> b[:date]} - - # Replies without parents should be hoisted to topics - to_hoist = [] - replies.each do |r| - to_hoist << r if !topic_lookup[r[:topic]] + puts "#{not_found.size} records couldn't be associated with parents" + if not_found.present? + db.execute "UPDATE emails SET reply_to = NULL WHERE msg_id IN (#{not_found.map {|nf| "'#{nf}'"}.join(',')})" end - to_hoist.each do |h| - replies.delete(h) - topics << {id: h[:id], file: h[:file], title: h[:title], date: h[:date]} - topic_titles[h[:title]] ||= h[:id] + dupe_titles = db.execute "SELECT title, COUNT(*) FROM emails GROUP BY title HAVING count(*) > 1" + puts "#{dupe_titles.size} replies to wire up" + dupe_titles.each do |t| + title = t[0] + first = titles[title] + db.execute "UPDATE emails SET reply_to = ? WHERE title = ? and msg_id <> ?", [first, title, first] end - # Topics with duplicate replies should be replies - to_group = [] - topics.each do |t| - first = topic_titles[t[:title]] - to_group << t if first && first != t[:id] + ensure + db.close + end + + def create_email_indices + db = open_db + db.execute "DROP TABLE IF EXISTS emails" + db.execute <<-SQL + CREATE TABLE emails ( + msg_id VARCHAR(995) PRIMARY KEY, + from_email VARCHAR(255) NOT NULL, + from_name VARCHAR(255) NOT NULL, + title VARCHAR(255) NOT NULL, + reply_to VARCHAR(955) NULL, + email_date DATETIME NOT NULL, + message TEXT NOT NULL + ); + SQL + + db.execute "CREATE INDEX by_title ON emails (title)" + db.execute "CREATE INDEX by_email ON emails (from_email)" + + puts "", "creating indices" + + all_messages do |mail| + msg_id = mail['Message-ID'].to_s + + # Many ways to get a name + from = mail[:from] + from_name = nil + + from_email = nil + if mail.from.present? + from_email = mail.from.first + end + + display_names = from.try(:display_names) + if display_names.present? + from_name = display_names.first + end + + if from_name.blank? && from.to_s =~ /\(([^\)]+)\)/ + from_name = Regexp.last_match[1] + end + from_name = from.to_s if from_name.blank? + + title = clean_title(mail['Subject'].to_s) + reply_to = mail['In-Reply-To'].to_s + email_date = mail['date'].to_s + + db.execute "INSERT OR IGNORE INTO emails (msg_id, from_email, from_name, title, reply_to, email_date, message) + VALUES (?, ?, ?, ?, ?, ?, ?)", + [msg_id, from_email, from_name, title, reply_to, email_date, mail.to_s] end + ensure + db.close + end - to_group.each do |t| - topics.delete(t) - replies << {id: t[:id], topic: topic_titles[t[:title]], file: t[:file], title: t[:title], date: t[:date]} - end + def create_user_indices + db = open_db + db.execute "DROP TABLE IF EXISTS users" + db.execute <<-SQL + CREATE TABLE users ( + email VARCHAR(995) PRIMARY KEY, + name VARCHAR(255) NOT NULL + ); + SQL - replies.sort! {|a, b| a[:date] <=> b[:date]} - topics.sort! {|a, b| a[:date] <=> b[:date]} - - - File.write(USER_INDEX_PATH, {users: users}.to_json) - File.write(TOPIC_INDEX_PATH, {topics: topics}.to_json) - File.write(REPLY_INDEX_PATH, {replies: replies}.to_json) + db.execute "INSERT OR IGNORE INTO users (email, name) SELECT from_email, from_name FROM emails" + ensure + db.close end def clean_title(title) + title ||= "" #Strip mailing list name from subject title = title.gsub(/\[[^\]]+\]+/, '').strip @@ -125,24 +199,26 @@ class ImportScripts::Mbox < ImportScripts::Base def import_users puts "", "importing users" + db = open_db - all_users = ::JSON.parse(File.read(USER_INDEX_PATH))['users'] - user_keys = all_users.keys - total_count = user_keys.size + all_users = db.execute("SELECT name, email FROM users") + total_count = all_users.size batches(BATCH_SIZE) do |offset| - users = user_keys[offset..offset+BATCH_SIZE-1] + users = all_users[offset..offset+BATCH_SIZE-1] break if users.nil? - next if all_records_exist? :users, users + next if all_records_exist? :users, users.map {|u| u[1]} - create_users(users, total: total_count, offset: offset) do |email| + create_users(users, total: total_count, offset: offset) do |u| { - id: email, - email: email, - name: all_users[email] + id: u[1], + email: u[1], + name: u[0] } end end + ensure + db.close end def parse_email(msg) @@ -157,23 +233,33 @@ class ImportScripts::Mbox < ImportScripts::Base def create_forum_topics puts "", "creating forum topics" - all_topics = ::JSON.parse(File.read(TOPIC_INDEX_PATH))['topics'] + db = open_db + all_topics = db.execute("SELECT msg_id, + from_email, + from_name, + title, + email_date, + message + FROM emails + WHERE reply_to IS NULL") + topic_count = all_topics.size batches(BATCH_SIZE) do |offset| topics = all_topics[offset..offset+BATCH_SIZE-1] break if topics.nil? - next if all_records_exist? :posts, topics.map {|t| t['id']} + next if all_records_exist? :posts, topics.map {|t| t[0]} create_posts(topics, total: topic_count, offset: offset) do |t| - raw_email = File.read(t['file']) + raw_email = t[5] receiver = Email::Receiver.new(raw_email) mail = Mail.read_from_string(raw_email) mail.body selected = receiver.select_body next unless selected + selected = selected.join('') if selected.kind_of?(Array) raw = selected.force_encoding(selected.encoding).encode("UTF-8") @@ -195,7 +281,7 @@ class ImportScripts::Mbox < ImportScripts::Base end end - { id: t['id'], + { id: t[0], title: clean_title(title), user_id: user_id_from_imported_user_id(mail.from.first) || Discourse::SYSTEM_USER_ID, created_at: mail.date, @@ -204,34 +290,49 @@ class ImportScripts::Mbox < ImportScripts::Base cook_method: Post.cook_methods[:email] } end end + ensure + db.close end def import_replies puts "", "creating topic replies" - replies = ::JSON.parse(File.read(REPLY_INDEX_PATH))['replies'] + db = open_db + replies = db.execute("SELECT msg_id, + from_email, + from_name, + title, + email_date, + message, + reply_to + FROM emails + WHERE reply_to IS NOT NULL") + post_count = replies.size batches(BATCH_SIZE) do |offset| posts = replies[offset..offset+BATCH_SIZE-1] break if posts.nil? - next if all_records_exist? :posts, posts.map {|p| p['id']} + next if all_records_exist? :posts, posts.map {|p| p[0]} create_posts(posts, total: post_count, offset: offset) do |p| - parent_id = p['topic'] - id = p['id'] + parent_id = p[6] + id = p[0] topic = topic_lookup_from_imported_post_id(parent_id) topic_id = topic[:topic_id] if topic next unless topic_id - raw_email = File.read(p['file']) + raw_email = p[5] receiver = Email::Receiver.new(raw_email) mail = Mail.read_from_string(raw_email) mail.body selected = receiver.select_body + selected = selected.join('') if selected.kind_of?(Array) + next unless selected + raw = selected.force_encoding(selected.encoding).encode("UTF-8") # import the attachments @@ -258,6 +359,8 @@ class ImportScripts::Mbox < ImportScripts::Base cook_method: Post.cook_methods[:email] } end end + ensure + db.close end end From 3d3ce56f52b99eb2a8662d766390a577cb2fc7bb Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 14 Jun 2016 12:02:24 -0400 Subject: [PATCH 299/320] UX: Never show the back button if it's the last post --- app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 index a25207609..3dfdbb774 100644 --- a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 @@ -143,7 +143,7 @@ createWidget('timeline-scrollarea', { this.attach('timeline-padding', { height: after }) ]; - if (position.lastRead) { + if (position.lastRead && position.lastRead !== position.total) { const lastReadTop = Math.round(position.lastReadPercentage * SCROLLAREA_HEIGHT); if ((lastReadTop > (before + SCROLLER_HEIGHT)) && (lastReadTop < (SCROLLAREA_HEIGHT - SCROLLER_HEIGHT))) { result.push(this.attach('timeline-last-read', { top: lastReadTop, lastRead: position.lastRead })); From 5813352439b9b30708f347e7ba2b1c65d5037fda Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 14 Jun 2016 12:50:16 +0800 Subject: [PATCH 300/320] FEATURE: Add new API to add a toolbar popup menu button. --- .../discourse/controllers/composer.js.es6 | 39 +++++++++++++++++++ .../discourse/lib/plugin-api.js.es6 | 21 ++++++++++ .../discourse/templates/composer.hbs | 10 +++-- 3 files changed, 67 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index 5da100683..18784fa01 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -42,6 +42,12 @@ function loadDraft(store, opts) { } } +const _popupMenuOptionsCallbacks = []; + +export function addPopupMenuOptionsCallback(callback) { + _popupMenuOptionsCallbacks.push(callback); +} + export default Ember.Controller.extend({ needs: ['modal', 'topic', 'application'], replyAsNewTopicDraft: Em.computed.equal('model.draftKey', Composer.REPLY_AS_NEW_TOPIC_KEY), @@ -56,6 +62,20 @@ export default Ember.Controller.extend({ topic: null, linkLookup: null, + init() { + this._super(); + const self = this + + addPopupMenuOptionsCallback(function() { + return { + action: 'toggleWhisper', + icon: 'eye-slash', + label: 'composer.toggle_whisper', + condition: "canWhisper" + }; + }); + }, + showToolbar: Em.computed({ get(){ const keyValueStore = this.container.lookup('key-value-store:main'); @@ -92,6 +112,25 @@ export default Ember.Controller.extend({ return currentUser && currentUser.get('staff') && this.siteSettings.enable_whispers && action === Composer.REPLY; }, + @computed("model.composeState") + popupMenuOptions(composeState) { + const self = this; + + if (composeState === 'open') { + return _popupMenuOptionsCallbacks.map(callback => { + let option = callback(); + + if (option.condition) { + option.condition = self.get(option.condition); + } else { + option.condition = true; + } + + return option; + }); + } + }, + showWarning: function() { if (!Discourse.User.currentProp('staff')) { return false; } diff --git a/app/assets/javascripts/discourse/lib/plugin-api.js.es6 b/app/assets/javascripts/discourse/lib/plugin-api.js.es6 index b7e3eb040..8665e4468 100644 --- a/app/assets/javascripts/discourse/lib/plugin-api.js.es6 +++ b/app/assets/javascripts/discourse/lib/plugin-api.js.es6 @@ -10,6 +10,7 @@ import { onPageChange } from 'discourse/lib/page-tracker'; import { preventCloak } from 'discourse/widgets/post-stream'; import { h } from 'virtual-dom'; import { addFlagProperty } from 'discourse/components/site-header'; +import { addPopupMenuOptionsCallback } from 'discourse/controllers/composer'; class PluginApi { constructor(version, container) { @@ -224,6 +225,26 @@ class PluginApi { addToolbarCallback(callback); } + /** + * Add a new button in the options popup menu. + * + * Example: + * + * ``` + * api.addToolbarPopupMenuOptionsCallback(function(controller) { + * return { + * action: 'toggleWhisper', + * icon: 'eye-slash', + * label: 'composer.toggle_whisper', + * condition: "canWhisper" + * }; + * }); + * ``` + **/ + addToolbarPopupMenuOptionsCallback(callback) { + addPopupMenuOptionsCallback(callback); + } + /** * A hook that is called when the post stream is removed from the DOM. * This advanced hook should be used if you end up wiring up any diff --git a/app/assets/javascripts/discourse/templates/composer.hbs b/app/assets/javascripts/discourse/templates/composer.hbs index 9bf668db7..2e3c6636b 100644 --- a/app/assets/javascripts/discourse/templates/composer.hbs +++ b/app/assets/javascripts/discourse/templates/composer.hbs @@ -3,9 +3,13 @@ {{#if currentUser.staff}} {{#popup-menu visible=optionsVisible hide="hideOptions" title="composer.options"}} -
  • - {{d-button action="toggleWhisper" icon="eye-slash" label="composer.toggle_whisper"}} -
  • + {{#each popupMenuOptions as |option|}} + {{#if option.condition}} +
  • + {{d-button action=option.action icon=option.icon label=option.label}} +
  • + {{/if}} + {{/each}} {{/popup-menu}} {{/if}} From 1dae7fbe0451ec96a8b42f955695ab5c7dca0666 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 14 Jun 2016 12:55:08 -0400 Subject: [PATCH 301/320] FIX: move non-admin i18n keys out of admin_js section --- config/locales/client.en.yml | 355 ++++++++++++++++++----------------- 1 file changed, 179 insertions(+), 176 deletions(-) diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 8ebd00820..f0177aa9d 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1979,6 +1979,183 @@ en: create_post: "Reply / See" readonly: "See" + lightbox: + download: "download" + + search_help: + title: 'Search Help' + + keyboard_shortcuts_help: + title: 'Keyboard Shortcuts' + jump_to: + title: 'Jump To' + home: 'g, h Home' + latest: 'g, l Latest' + new: 'g, n New' + unread: 'g, u Unread' + categories: 'g, c Categories' + top: 'g, t Top' + bookmarks: 'g, b Bookmarks' + profile: 'g, p Profile' + messages: 'g, m Messages' + navigation: + title: 'Navigation' + jump: '# Go to post #' + back: 'u Back' + up_down: 'k/j Move selection ↑ ↓' + open: 'o or Enter Open selected topic' + next_prev: 'shift+j/shift+k Next/previous section' + application: + title: 'Application' + create: 'c Create a new topic' + notifications: 'n Open notifications' + hamburger_menu: '= Open hamburger menu' + user_profile_menu: 'p Open user menu' + show_incoming_updated_topics: '. Show updated topics' + search: '/ Search' + help: '? Open keyboard help' + dismiss_new_posts: 'x, r Dismiss New/Posts' + dismiss_topics: 'x, t Dismiss Topics' + log_out: 'shift+z shift+z Log Out' + actions: + title: 'Actions' + bookmark_topic: 'f Toggle bookmark topic' + pin_unpin_topic: 'shift+p Pin/Unpin topic' + share_topic: 'shift+s Share topic' + share_post: 's Share post' + reply_as_new_topic: 't Reply as linked topic' + reply_topic: 'shift+r Reply to topic' + reply_post: 'r Reply to post' + quote_post: 'q Quote post' + like: 'l Like post' + flag: '! Flag post' + bookmark: 'b Bookmark post' + edit: 'e Edit post' + delete: 'd Delete post' + mark_muted: 'm, m Mute topic' + mark_regular: 'm, r Regular (default) topic' + mark_tracking: 'm, t Track topic' + mark_watching: 'm, w Watch topic' + + badges: + earned_n_times: + one: "Earned this badge 1 time" + other: "Earned this badge %{count} times" + granted_on: "Granted %{date}" + others_count: "Others with this badge (%{count})" + title: Badges + allow_title: "available title" + multiple_grant: "awarded multiple times" + badge_count: + one: "1 Badge" + other: "%{count} Badges" + more_badges: + one: "+1 More" + other: "+%{count} More" + granted: + one: "1 granted" + other: "%{count} granted" + select_badge_for_title: Select a badge to use as your title + none: "" + badge_grouping: + getting_started: + name: Getting Started + community: + name: Community + trust_level: + name: Trust Level + other: + name: Other + posting: + name: Posting + + google_search: | +

    Search with Google

    +

    +

    +

    + + tagging: + all_tags: "All Tags" + selector_all_tags: "all tags" + changed: "tags changed:" + tags: "Tags" + choose_for_topic: "choose optional tags for this topic" + delete_tag: "Delete Tag" + delete_confirm: "Are you sure you want to delete that tag?" + rename_tag: "Rename Tag" + rename_instructions: "Choose a new name for the tag:" + sort_by: "Sort by:" + sort_by_count: "count" + sort_by_name: "name" + manage_groups: "Manage Tag Groups" + manage_groups_description: "Define groups to organize tags" + + filters: + without_category: "%{filter} %{tag} topics" + with_category: "%{filter} %{tag} topics in %{category}" + + notifications: + watching: + title: "Watching" + description: "You will automatically watch all new topics in this tag. You will be notified of all new posts and topics, plus the count of unread and new posts will also appear next to the topic." + tracking: + title: "Tracking" + description: "You will automatically track all new topics in this tag. A count of unread and new posts will appear next to the topic." + regular: + title: "Regular" + description: "You will be notified if someone mentions your @name or replies to your post." + muted: + title: "Muted" + description: "You will not be notified of anything about new topics in this tag, and they will not appear on your unread tab." + + groups: + title: "Tag Groups" + about: "Add tags to groups to manage them more easily." + new: "New Group" + tags_label: "Tags in this group:" + parent_tag_label: "Parent tag:" + parent_tag_placeholder: "Optional" + parent_tag_description: "Tags from this group can't be used unless the parent tag is present." + one_per_topic_label: "Limit one tag per topic from this group" + new_name: "New Tag Group" + save: "Save" + delete: "Delete" + confirm_delete: "Are you sure you want to delete this tag group?" + + topics: + none: + unread: "You have no unread topics." + new: "You have no new topics." + read: "You haven't read any topics yet." + posted: "You haven't posted in any topics yet." + latest: "There are no latest topics." + hot: "There are no hot topics." + bookmarks: "You have no bookmarked topics yet." + top: "There are no top topics." + search: "There are no search results." + bottom: + latest: "There are no more latest topics." + hot: "There are no more hot topics." + posted: "There are no more posted topics." + read: "There are no more read topics." + new: "There are no more new topics." + unread: "There are no more unread topics." + top: "There are no more top topics." + bookmarks: "There are no more bookmarked topics." + search: "There are no more search results." + + invite: + custom_message: "Make your invite a little bit more personal by writing a" + custom_message_link: "custom message" + custom_message_placeholder: "Enter your custom message" + custom_message_template_forum: "Hey, you should join this forum!" + custom_message_template_topic: "Hey, I thought you might enjoy this topic!" + # This section is exported to the javascript for i18n in the admin section admin_js: type_to_filter: "type to filter..." @@ -2876,179 +3053,5 @@ en: add: "Add" filter: "Search (URL or External URL)" - lightbox: - download: "download" - - search_help: - title: 'Search Help' - - keyboard_shortcuts_help: - title: 'Keyboard Shortcuts' - jump_to: - title: 'Jump To' - home: 'g, h Home' - latest: 'g, l Latest' - new: 'g, n New' - unread: 'g, u Unread' - categories: 'g, c Categories' - top: 'g, t Top' - bookmarks: 'g, b Bookmarks' - profile: 'g, p Profile' - messages: 'g, m Messages' - navigation: - title: 'Navigation' - jump: '# Go to post #' - back: 'u Back' - up_down: 'k/j Move selection ↑ ↓' - open: 'o or Enter Open selected topic' - next_prev: 'shift+j/shift+k Next/previous section' - application: - title: 'Application' - create: 'c Create a new topic' - notifications: 'n Open notifications' - hamburger_menu: '= Open hamburger menu' - user_profile_menu: 'p Open user menu' - show_incoming_updated_topics: '. Show updated topics' - search: '/ Search' - help: '? Open keyboard help' - dismiss_new_posts: 'x, r Dismiss New/Posts' - dismiss_topics: 'x, t Dismiss Topics' - log_out: 'shift+z shift+z Log Out' - actions: - title: 'Actions' - bookmark_topic: 'f Toggle bookmark topic' - pin_unpin_topic: 'shift+p Pin/Unpin topic' - share_topic: 'shift+s Share topic' - share_post: 's Share post' - reply_as_new_topic: 't Reply as linked topic' - reply_topic: 'shift+r Reply to topic' - reply_post: 'r Reply to post' - quote_post: 'q Quote post' - like: 'l Like post' - flag: '! Flag post' - bookmark: 'b Bookmark post' - edit: 'e Edit post' - delete: 'd Delete post' - mark_muted: 'm, m Mute topic' - mark_regular: 'm, r Regular (default) topic' - mark_tracking: 'm, t Track topic' - mark_watching: 'm, w Watch topic' - - badges: - earned_n_times: - one: "Earned this badge 1 time" - other: "Earned this badge %{count} times" - granted_on: "Granted %{date}" - others_count: "Others with this badge (%{count})" - title: Badges - allow_title: "available title" - multiple_grant: "awarded multiple times" - badge_count: - one: "1 Badge" - other: "%{count} Badges" - more_badges: - one: "+1 More" - other: "+%{count} More" - granted: - one: "1 granted" - other: "%{count} granted" - select_badge_for_title: Select a badge to use as your title - none: "" - badge_grouping: - getting_started: - name: Getting Started - community: - name: Community - trust_level: - name: Trust Level - other: - name: Other - posting: - name: Posting - - google_search: | -

    Search with Google

    -

    -

    -

    - - tagging: - all_tags: "All Tags" - selector_all_tags: "all tags" - changed: "tags changed:" - tags: "Tags" - choose_for_topic: "choose optional tags for this topic" - delete_tag: "Delete Tag" - delete_confirm: "Are you sure you want to delete that tag?" - rename_tag: "Rename Tag" - rename_instructions: "Choose a new name for the tag:" - sort_by: "Sort by:" - sort_by_count: "count" - sort_by_name: "name" - manage_groups: "Manage Tag Groups" - manage_groups_description: "Define groups to organize tags" - - filters: - without_category: "%{filter} %{tag} topics" - with_category: "%{filter} %{tag} topics in %{category}" - - notifications: - watching: - title: "Watching" - description: "You will automatically watch all new topics in this tag. You will be notified of all new posts and topics, plus the count of unread and new posts will also appear next to the topic." - tracking: - title: "Tracking" - description: "You will automatically track all new topics in this tag. A count of unread and new posts will appear next to the topic." - regular: - title: "Regular" - description: "You will be notified if someone mentions your @name or replies to your post." - muted: - title: "Muted" - description: "You will not be notified of anything about new topics in this tag, and they will not appear on your unread tab." - - groups: - title: "Tag Groups" - about: "Add tags to groups to manage them more easily." - new: "New Group" - tags_label: "Tags in this group:" - parent_tag_label: "Parent tag:" - parent_tag_placeholder: "Optional" - parent_tag_description: "Tags from this group can't be used unless the parent tag is present." - one_per_topic_label: "Limit one tag per topic from this group" - new_name: "New Tag Group" - save: "Save" - delete: "Delete" - confirm_delete: "Are you sure you want to delete this tag group?" - - topics: - none: - unread: "You have no unread topics." - new: "You have no new topics." - read: "You haven't read any topics yet." - posted: "You haven't posted in any topics yet." - latest: "There are no latest topics." - hot: "There are no hot topics." - bookmarks: "You have no bookmarked topics yet." - top: "There are no top topics." - search: "There are no search results." - bottom: - latest: "There are no more latest topics." - hot: "There are no more hot topics." - posted: "There are no more posted topics." - read: "There are no more read topics." - new: "There are no more new topics." - unread: "There are no more unread topics." - top: "There are no more top topics." - bookmarks: "There are no more bookmarked topics." - search: "There are no more search results." - - invite: - custom_message: "Make your invite a little bit more personal by writing a" - custom_message_link: "custom message" - custom_message_placeholder: "Enter your custom message" - custom_message_template_forum: "Hey, you should join this forum!" - custom_message_template_topic: "Hey, I thought you might enjoy this topic!" +# WARNING! Keys added here will be in the admin_js section. +# Keys that don't belong in admin should be placed earlier in the file. From bdd15d5452e9b1d836f06ebfc702566a217c2994 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 14 Jun 2016 13:40:30 -0400 Subject: [PATCH 302/320] FIX: Don't remove all events, only the ones we created --- .../discourse/components/mount-widget.js.es6 | 14 ++++++++++---- .../discourse/components/topic-progress.js.es6 | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/components/mount-widget.js.es6 b/app/assets/javascripts/discourse/components/mount-widget.js.es6 index c9310fb66..e62390e69 100644 --- a/app/assets/javascripts/discourse/components/mount-widget.js.es6 +++ b/app/assets/javascripts/discourse/components/mount-widget.js.es6 @@ -16,6 +16,7 @@ export default Ember.Component.extend({ _widgetClass: null, _renderCallback: null, _childEvents: null, + _dispatched: null, init() { this._super(); @@ -31,6 +32,7 @@ export default Ember.Component.extend({ this._childEvents = []; this._connected = []; + this._dispatched = []; }, didInsertElement() { @@ -52,7 +54,10 @@ export default Ember.Component.extend({ }, willDestroyElement() { - this._childEvents.forEach(evt => this.appEvents.off(evt)); + this._dispatched.forEach(evt => { + const [eventName, caller] = evt; + this.appEvents.off(eventName, caller); + }); Ember.run.cancel(this._timeout); }, @@ -73,9 +78,10 @@ export default Ember.Component.extend({ dispatch(eventName, key) { this._childEvents.push(eventName); - this.appEvents.on(eventName, refreshArg => { - this.eventDispatched(eventName, key, refreshArg); - }); + + const caller = refreshArg => this.eventDispatched(eventName, key, refreshArg); + this._dispatched.push([eventName, caller]); + this.appEvents.on(eventName, caller); }, queueRerender(callback) { diff --git a/app/assets/javascripts/discourse/components/topic-progress.js.es6 b/app/assets/javascripts/discourse/components/topic-progress.js.es6 index 97b9f3b54..94c99908a 100644 --- a/app/assets/javascripts/discourse/components/topic-progress.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-progress.js.es6 @@ -95,7 +95,7 @@ export default Ember.Component.extend({ .off("composer:resized", this, this._dock) .off('composer:closed', this, this._dock) .off('topic:scrolled', this, this._dock) - .off('topic:current-post-scrolled') + .off('topic:current-post-scrolled', this, this._topicScrolled) .off('topic-progress:keyboard-trigger'); }, From 9588583244788c3c3a8695f016cc23b88df8dac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 14 Jun 2016 20:01:21 +0200 Subject: [PATCH 303/320] 'Reply as new topic' link in the share dialog --- .../discourse/controllers/share.js.es6 | 5 ++ .../discourse/controllers/topic.js.es6 | 10 +-- .../javascripts/discourse/templates/share.hbs | 4 ++ .../discourse/views/quote-button.js.es6 | 3 +- .../javascripts/discourse/views/share.js.es6 | 64 +++++++++---------- .../discourse/widgets/post-menu.js.es6 | 1 + .../stylesheets/common/base/share_link.scss | 6 ++ 7 files changed, 54 insertions(+), 39 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/share.js.es6 b/app/assets/javascripts/discourse/controllers/share.js.es6 index b276fcf59..0fff39852 100644 --- a/app/assets/javascripts/discourse/controllers/share.js.es6 +++ b/app/assets/javascripts/discourse/controllers/share.js.es6 @@ -29,6 +29,11 @@ export default Ember.Controller.extend({ return false; }, + replyAsNewTopic() { + this.get("controllers.topic").send("replyAsNewTopic"); + this.send("close"); + }, + share(source) { var url = source.generateUrl(this.get('link'), this.get('title')); if (source.shouldOpenInPopup) { diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index a89f69279..2c6d56a02 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -586,10 +586,10 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { }, replyAsNewTopic(post) { - const composerController = this.get('controllers.composer'), - quoteController = this.get('controllers.quote-button'), - quotedText = Quote.build(quoteController.get('post'), quoteController.get('buffer')), - self = this; + const composerController = this.get('controllers.composer'); + const quoteController = this.get('controllers.quote-button'); + post = post || quoteController.get('post'); + const quotedText = Quote.build(post, quoteController.get('buffer')); quoteController.deselectText(); @@ -601,7 +601,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, { return Em.isEmpty(quotedText) ? "" : quotedText; }).then(q => { const postUrl = `${location.protocol}//${location.host}${post.get('url')}`; - const postLink = `[${Handlebars.escapeExpression(self.get('model.title'))}](${postUrl})`; + const postLink = `[${Handlebars.escapeExpression(this.get('model.title'))}](${postUrl})`; composerController.get('model').prependText(`${I18n.t("post.continue_discussion", { postLink })}\n\n${q}`, {new_line: true}); }); }, diff --git a/app/assets/javascripts/discourse/templates/share.hbs b/app/assets/javascripts/discourse/templates/share.hbs index c11aca002..71bf52b00 100644 --- a/app/assets/javascripts/discourse/templates/share.hbs +++ b/app/assets/javascripts/discourse/templates/share.hbs @@ -14,6 +14,10 @@ {{share-source source=s title=title action="share"}} {{/each}} + + diff --git a/app/assets/javascripts/discourse/views/quote-button.js.es6 b/app/assets/javascripts/discourse/views/quote-button.js.es6 index 681523377..e0b5e2143 100644 --- a/app/assets/javascripts/discourse/views/quote-button.js.es6 +++ b/app/assets/javascripts/discourse/views/quote-button.js.es6 @@ -3,7 +3,8 @@ function ignoreElements(e) { const $target = $(e.target); return $target.hasClass('quote-button') || $target.closest('.create').length || - $target.closest('.reply-new').length; + $target.closest('.reply-new').length || + $target.closest('.share').length; } export default Ember.View.extend({ diff --git a/app/assets/javascripts/discourse/views/share.js.es6 b/app/assets/javascripts/discourse/views/share.js.es6 index 960294812..abaa6c82b 100644 --- a/app/assets/javascripts/discourse/views/share.js.es6 +++ b/app/assets/javascripts/discourse/views/share.js.es6 @@ -1,3 +1,5 @@ +import computed from 'ember-addons/ember-computed-decorators'; +import { observes } from 'ember-addons/ember-computed-decorators'; import { wantsNewWindow } from 'discourse/lib/intercept-click'; export default Ember.View.extend({ @@ -5,45 +7,43 @@ export default Ember.View.extend({ elementId: 'share-link', classNameBindings: ['hasLink'], - hasLink: function() { - if (!Ember.isEmpty(this.get('controller.link'))) return 'visible'; - return null; - }.property('controller.link'), + @computed('controller.link') + hasLink(link) { + return !Ember.isEmpty(link) ? 'visible' : null; + }, - linkChanged: function() { - const self = this; - if (!Ember.isEmpty(this.get('controller.link'))) { - Em.run.next(function() { - if (!self.capabilities.touch) { - var $linkInput = $('#share-link input'); - $linkInput.val(self.get('controller.link')); + @observes('controller.link') + linkChanged() { + const link = this.get('controller.link'); + if (!Ember.isEmpty(link)) { + Ember.run.next(() => { + if (!this.capabilities.touch) { + const $linkInput = $('#share-link input'); + $linkInput.val(link); // Wait for the fade-in transition to finish before selecting the link: - window.setTimeout(function() { - $linkInput.select().focus(); - }, 160); + window.setTimeout(() => $linkInput.select().focus(), 160); } else { - var $linkForTouch = $('#share-link .share-for-touch a'); - $linkForTouch.attr('href',self.get('controller.link')); - $linkForTouch.html(self.get('controller.link')); - var range = window.document.createRange(); + const $linkForTouch = $('#share-link .share-for-touch a'); + $linkForTouch.attr('href', link); + $linkForTouch.html(link); + const range = window.document.createRange(); range.selectNode($linkForTouch[0]); window.getSelection().addRange(range); } }); } - }.observes('controller.link'), + }, - didInsertElement: function() { - var self = this, - $html = $('html'); + didInsertElement() { + const self = this; + const $html = $('html'); - $html.on('mousedown.outside-share-link', function(e) { + $html.on('mousedown.outside-share-link', e => { // Use mousedown instead of click so this event is handled before routing occurs when a // link is clicked (which is a click event) while the share dialog is showing. - if (self.$().has(e.target).length !== 0) { return; } - - self.get('controller').send('close'); + if (this.$().has(e.target).length !== 0) { return; } + this.get('controller').send('close'); return true; }); @@ -58,9 +58,7 @@ export default Ember.View.extend({ const shareLinkWidth = $shareLink.width(); let x = $currentTargetOffset.left - (shareLinkWidth / 2); - if (x < 25) { - x = 25; - } + if (x < 25) { x = 25; } if (x + shareLinkWidth > $(window).width()) { x -= shareLinkWidth / 2; } @@ -84,7 +82,7 @@ export default Ember.View.extend({ this.appEvents.on('share:url', (url, $target) => showPanel($target, url)); - $html.on('click.discoure-share-link', '[data-share-url]', function(e) { + $html.on('click.discoure-share-link', '[data-share-url]', e => { // if they want to open in a new tab, let it so if (wantsNewWindow(e)) { return true; } @@ -98,14 +96,14 @@ export default Ember.View.extend({ return false; }); - $html.on('keydown.share-view', function(e){ + $html.on('keydown.share-view', e => { if (e.keyCode === 27) { - self.get('controller').send('close'); + this.get('controller').send('close'); } }); }, - willDestroyElement: function() { + willDestroyElement() { this.get('controller').send('close'); $('html').off('click.discoure-share-link') diff --git a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 index c2d474ae8..f8b6f6f40 100644 --- a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 @@ -114,6 +114,7 @@ registerButton('replies', (attrs, state, siteSettings) => { registerButton('share', attrs => { return { action: 'share', + className: 'share', title: 'post.controls.share', icon: 'link', data: { diff --git a/app/assets/stylesheets/common/base/share_link.scss b/app/assets/stylesheets/common/base/share_link.scss index 2b9b6b571..33c39c86f 100644 --- a/app/assets/stylesheets/common/base/share_link.scss +++ b/app/assets/stylesheets/common/base/share_link.scss @@ -42,6 +42,12 @@ float: left; font-size: 1.571em; } + .reply-as-new-topic { + float: left; + .fa { + margin-right: 5px; + } + } .link { margin-right: 2px; float: right; From 55b300bae1115314ab42c923e79ec8a4d6426ecc Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Tue, 14 Jun 2016 11:45:50 -0700 Subject: [PATCH 304/320] better align reply action on link dialog --- app/assets/stylesheets/common/base/share_link.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/stylesheets/common/base/share_link.scss b/app/assets/stylesheets/common/base/share_link.scss index 33c39c86f..0f74cb0e7 100644 --- a/app/assets/stylesheets/common/base/share_link.scss +++ b/app/assets/stylesheets/common/base/share_link.scss @@ -44,6 +44,8 @@ } .reply-as-new-topic { float: left; + line-height: 22px; + margin-left: 8px; .fa { margin-right: 5px; } From 7efd9359ec0995ac0d87e334e9705d838ea2f746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 14 Jun 2016 20:55:58 +0200 Subject: [PATCH 305/320] reply as new topic requires a post --- app/assets/javascripts/discourse/controllers/share.js.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/share.js.es6 b/app/assets/javascripts/discourse/controllers/share.js.es6 index 0fff39852..5eb9facd6 100644 --- a/app/assets/javascripts/discourse/controllers/share.js.es6 +++ b/app/assets/javascripts/discourse/controllers/share.js.es6 @@ -30,7 +30,11 @@ export default Ember.Controller.extend({ }, replyAsNewTopic() { - this.get("controllers.topic").send("replyAsNewTopic"); + const topicController = this.get("controllers.topic"); + const postStream = topicController.get("model.postStream"); + const postId = postStream.findPostIdForPostNumber(this.get("postNumber")); + const post = postStream.findLoadedPost(postId); + topicController.send("replyAsNewTopic", post); this.send("close"); }, From c860bd07811d60efb3fc53bfdfea4276c72118eb Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Tue, 14 Jun 2016 12:27:17 -0700 Subject: [PATCH 306/320] remove Google+ as default from share link sorry Google! It was a nice try! --- config/site_settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/site_settings.yml b/config/site_settings.yml index 2d5b7f45c..a1dad3499 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -135,7 +135,7 @@ basic: share_links: client: true type: list - default: 'twitter|facebook|google+|email' + default: 'twitter|facebook|email' choices: - twitter - facebook From af4391bbda8eb3ec78bb1ff992b7199b6c2b910f Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 14 Jun 2016 16:37:34 -0400 Subject: [PATCH 307/320] UX: Don't show right arrow in quotes --- app/assets/javascripts/discourse/widgets/post-cooked.js.es6 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 index f98a90eb1..3c0c0a133 100644 --- a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 @@ -162,12 +162,7 @@ export default class PostCooked { // If it's the same topic as ours, build the URL from the topic object if (this.attrs.topicId === asideTopicId) { navLink = ``; - } else { - // Made up slug should be replaced with canonical URL - const asideLink = Discourse.getURL("/t/via-quote/") + asideTopicId + "/" + postNumber; - navLink = ``; } - } else { // assume the same topic navLink = ``; From 0f809d499391416715776656994cf5bba56ab88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 14 Jun 2016 23:03:34 +0200 Subject: [PATCH 308/320] FIX: only show the reply as new topic when user can actually reply as new topic --- app/assets/javascripts/discourse/controllers/share.js.es6 | 1 + app/assets/javascripts/discourse/templates/share.hbs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/share.js.es6 b/app/assets/javascripts/discourse/controllers/share.js.es6 index 5eb9facd6..c7cbe4651 100644 --- a/app/assets/javascripts/discourse/controllers/share.js.es6 +++ b/app/assets/javascripts/discourse/controllers/share.js.es6 @@ -6,6 +6,7 @@ export default Ember.Controller.extend({ needs: ['topic'], title: Ember.computed.alias('controllers.topic.model.title'), + canReplyAsNewTopic: Ember.computed.alias('controllers.topic.model.details.can_reply_as_new_topic'), @computed('type', 'postNumber') shareTitle(type, postNumber) { diff --git a/app/assets/javascripts/discourse/templates/share.hbs b/app/assets/javascripts/discourse/templates/share.hbs index 71bf52b00..65b332188 100644 --- a/app/assets/javascripts/discourse/templates/share.hbs +++ b/app/assets/javascripts/discourse/templates/share.hbs @@ -14,9 +14,11 @@ {{share-source source=s title=title action="share"}} {{/each}} - + {{#if canReplyAsNewTopic}} + + {{/if}}
    {{i18n 'user.watched_categories_instructions'}}
    + +
    {{category-group categories=model.trackedCategories blacklist=selectedCategories}} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index f0177aa9d..e73a69971 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -535,6 +535,7 @@ en: muted_users: "Muted" muted_users_instructions: "Suppress all notifications from these users." muted_topics_link: "Show muted topics" + watched_topics_link: "Show watched topics" automatically_unpin_topics: "Automatically unpin topics when I reach the bottom." staff_counters: From 8d46727d670801f61f3c8cca56497bdbf5006014 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 13 Jun 2016 18:21:14 +0800 Subject: [PATCH 311/320] FEATURE: Poll UI Builder. --- .../components/composer-editor.js.es6 | 9 +- .../discourse/controllers/composer.js.es6 | 8 +- .../discourse/templates/composer.hbs | 3 +- .../controllers/poll-ui-builder.js.es6 | 158 ++++++++++++ .../templates/modals/poll-ui-builder.hbs | 57 +++++ .../initializers/add-poll-ui-builder.js.es6 | 30 +++ .../javascripts/views/poll-ui-builder.js.es6 | 8 + .../stylesheets/common/poll-ui-builder.scss | 18 ++ plugins/poll/config/locales/client.en.yml | 23 ++ plugins/poll/plugin.rb | 1 + .../controllers/poll-ui-builder-test.js.es6 | 225 ++++++++++++++++++ 11 files changed, 529 insertions(+), 11 deletions(-) create mode 100644 plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 create mode 100644 plugins/poll/assets/javascripts/discourse/templates/modals/poll-ui-builder.hbs create mode 100644 plugins/poll/assets/javascripts/initializers/add-poll-ui-builder.js.es6 create mode 100644 plugins/poll/assets/javascripts/views/poll-ui-builder.js.es6 create mode 100644 plugins/poll/assets/stylesheets/common/poll-ui-builder.scss create mode 100644 plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6 diff --git a/app/assets/javascripts/discourse/components/composer-editor.js.es6 b/app/assets/javascripts/discourse/components/composer-editor.js.es6 index 76d89193c..0b5d9c4e6 100644 --- a/app/assets/javascripts/discourse/components/composer-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/composer-editor.js.es6 @@ -362,7 +362,7 @@ export default Ember.Component.extend({ this._resetUpload(true); }, - showOptions() { + showOptions(toolbarEvent) { // long term we want some smart positioning algorithm in popup-menu // the problem is that positioning in a fixed panel is a nightmare // cause offsetParent can end up returning a fixed element and then @@ -388,9 +388,8 @@ export default Ember.Component.extend({ left = replyWidth - popupWidth - 40; } - this.sendAction('showOptions', { position: "absolute", - left: left, - top: top }); + this.sendAction('showOptions', toolbarEvent, + { position: "absolute", left, top }); }, showUploadModal(toolbarEvent) { @@ -420,7 +419,7 @@ export default Ember.Component.extend({ sendAction: 'showUploadModal' }); - if (this.get('canWhisper')) { + if (this.get("popupMenuOptions").some(option => option.condition)) { toolbar.addButton({ id: 'options', group: 'extras', diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index 18784fa01..8f4b16701 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -64,7 +64,6 @@ export default Ember.Controller.extend({ init() { this._super(); - const self = this addPopupMenuOptionsCallback(function() { return { @@ -114,14 +113,12 @@ export default Ember.Controller.extend({ @computed("model.composeState") popupMenuOptions(composeState) { - const self = this; - if (composeState === 'open') { return _popupMenuOptionsCallbacks.map(callback => { let option = callback(); if (option.condition) { - option.condition = self.get(option.condition); + option.condition = this.get(option.condition); } else { option.condition = true; } @@ -193,7 +190,8 @@ export default Ember.Controller.extend({ this.toggleProperty('showToolbar'); }, - showOptions(loc) { + showOptions(toolbarEvent, loc) { + this.set('toolbarEvent', toolbarEvent); this.appEvents.trigger('popup-menu:open', loc); this.set('optionsVisible', true); }, diff --git a/app/assets/javascripts/discourse/templates/composer.hbs b/app/assets/javascripts/discourse/templates/composer.hbs index 2e3c6636b..06f01ee83 100644 --- a/app/assets/javascripts/discourse/templates/composer.hbs +++ b/app/assets/javascripts/discourse/templates/composer.hbs @@ -6,7 +6,7 @@ {{#each popupMenuOptions as |option|}} {{#if option.condition}}
  • - {{d-button action=option.action icon=option.icon label=option.label}} + {{d-button action=option.action icon=option.icon label=option.label}}
  • {{/if}} {{/each}} @@ -90,6 +90,7 @@ composer=model lastValidatedAt=lastValidatedAt canWhisper=canWhisper + popupMenuOptions=popupMenuOptions draftStatus=model.draftStatus isUploading=isUploading groupsMentioned="groupsMentioned" diff --git a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 new file mode 100644 index 000000000..6d10e459d --- /dev/null +++ b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 @@ -0,0 +1,158 @@ +import { default as computed, observes } from 'ember-addons/ember-computed-decorators'; + +export default Ember.Controller.extend({ + needs: ['modal'], + + init() { + this._super(); + this._setupPoll(); + }, + + @computed + pollTypes() { + return [I18n.t("poll.ui_builder.poll_type.number"), I18n.t("poll.ui_builder.poll_type.multiple")].map(type => { + return { name: type, value: type }; + }); + }, + + @computed("pollType", "pollOptionsCount") + isMultiple(pollType, count) { + return (pollType === I18n.t("poll.ui_builder.poll_type.multiple")) && count > 0; + }, + + @computed("pollType") + isNumber(pollType) { + return pollType === I18n.t("poll.ui_builder.poll_type.number"); + }, + + @computed("isNumber", "isMultiple") + showMinMax(isNumber, isMultiple) { + return isNumber || isMultiple; + }, + + @computed("pollOptions") + pollOptionsCount(pollOptions) { + if (pollOptions.length === 0) return 0; + + let length = 0; + + pollOptions.split("\n").forEach(option => { + if (option.length !== 0) length += 1; + }); + + return length; + }, + + @observes("isMultiple", "isNumber", "pollOptionsCount") + _setPollMax() { + const isMultiple = this.get("isMultiple"); + const isNumber = this.get("isNumber"); + if (!isMultiple && !isNumber) return; + + if (isMultiple) { + this.set("pollMax", this.get("pollOptionsCount")); + } else if (isNumber) { + this.set("pollMax", this.siteSettings.poll_maximum_options); + } + }, + + @computed("isMultiple", "isNumber", "pollOptionsCount") + pollMinOptions(isMultiple, isNumber, count) { + if (!isMultiple && !isNumber) return; + + if (isMultiple) { + return this._comboboxOptions(1, count + 1); + } else if (isNumber) { + return this._comboboxOptions(1, this.siteSettings.poll_maximum_options + 1); + } + }, + + @computed("isMultiple", "isNumber", "pollOptionsCount", "pollMin", "pollStep") + pollMaxOptions(isMultiple, isNumber, count, pollMin, pollStep) { + if (!isMultiple && !isNumber) return; + var range = []; + const pollMinInt = parseInt(pollMin); + + if (isMultiple) { + return this._comboboxOptions(pollMinInt + 1, count + 1); + } else if (isNumber) { + const pollStepInt = parseInt(pollStep); + return this._comboboxOptions(pollMinInt + 1, pollMinInt + (this.siteSettings.poll_maximum_options * pollStepInt)); + } + }, + + @computed("isNumber", "pollMax") + pollStepOptions(isNumber, pollMax) { + if (!isNumber) return; + + return this._comboboxOptions(1, parseInt(pollMax) + 1); + }, + + @computed("isNumber", "showMinMax", "pollName", "pollType", "publicPoll", "pollOptions", "pollMin", "pollMax", "pollStep") + pollOutput(isNumber, showMinMax, pollName, pollType, publicPoll, pollOptions, pollMin, pollMax, pollStep) { + let pollHeader = '[poll'; + let output = ''; + + if (pollName) pollHeader += ` name=${pollName.replace(' ', '-')}`; + if (pollType) pollHeader += ` type=${pollType}`; + if (pollMin && showMinMax) pollHeader += ` min=${pollMin}`; + if (pollMax) pollHeader += ` max=${pollMax}`; + if (isNumber) pollHeader += ` step=${pollStep}`; + if (publicPoll) pollHeader += ' public=true'; + pollHeader += ']' + output += `${pollHeader}\n`; + + if (pollOptions.length > 0 && !isNumber) { + output += `${pollOptions.split("\n").map(option => `* ${option}`).join("\n")}\n`; + } + + output += '[/poll]'; + return output; + }, + + @computed("pollOptionsCount", "isNumber") + disableInsert(count, isNumber) { + if (isNumber) { + return false; + } else { + return count < 2; + } + }, + + @computed("disableInsert") + minNumOfOptionsValidation(disableInsert) { + let options = { ok: true }; + + if (disableInsert) { + options = { failed: true, reason: I18n.t("poll.ui_builder.help.options_count") }; + } + + return Discourse.InputValidation.create(options); + }, + + _comboboxOptions(start_index, end_index) { + return _.range(start_index, end_index).map(number => { + return { value: number, name: number } + }) + }, + + _setupPoll() { + this.setProperties({ + pollName: '', + pollNamePlaceholder: I18n.t("poll.ui_builder.poll_name.placeholder"), + pollType: null, + publicPoll: false, + pollOptions: '', + pollMin: 1, + pollMax: null, + pollStep: 1 + }); + }, + + actions: { + insertPoll() { + this.get("toolbarEvent").addText(this.get("pollOutput")); + this.send("closeModal"); + } + } +}); diff --git a/plugins/poll/assets/javascripts/discourse/templates/modals/poll-ui-builder.hbs b/plugins/poll/assets/javascripts/discourse/templates/modals/poll-ui-builder.hbs new file mode 100644 index 000000000..c800db9af --- /dev/null +++ b/plugins/poll/assets/javascripts/discourse/templates/modals/poll-ui-builder.hbs @@ -0,0 +1,57 @@ + + + diff --git a/plugins/poll/assets/javascripts/initializers/add-poll-ui-builder.js.es6 b/plugins/poll/assets/javascripts/initializers/add-poll-ui-builder.js.es6 new file mode 100644 index 000000000..e1d88715a --- /dev/null +++ b/plugins/poll/assets/javascripts/initializers/add-poll-ui-builder.js.es6 @@ -0,0 +1,30 @@ +import { withPluginApi } from 'discourse/lib/plugin-api'; +import showModal from 'discourse/lib/show-modal'; + +function initializePollUIBuilder(api) { + const ComposerController = api.container.lookup("controller:composer"); + + ComposerController.reopen({ + actions: { + showPollBuilder() { + showModal("poll-ui-builder").set("toolbarEvent", this.get("toolbarEvent")); + } + } + }); + + api.addToolbarPopupMenuOptionsCallback(function() { + return { + action: 'showPollBuilder', + icon: 'bar-chart-o', + label: 'poll.ui_builder.title' + }; + }); +} + +export default { + name: "add-poll-ui-builder", + + initialize() { + withPluginApi('0.1', initializePollUIBuilder); + } +}; diff --git a/plugins/poll/assets/javascripts/views/poll-ui-builder.js.es6 b/plugins/poll/assets/javascripts/views/poll-ui-builder.js.es6 new file mode 100644 index 000000000..6ce0bf582 --- /dev/null +++ b/plugins/poll/assets/javascripts/views/poll-ui-builder.js.es6 @@ -0,0 +1,8 @@ +import ModalBodyView from "discourse/views/modal-body"; + +export default ModalBodyView.extend({ + needs: ['modal'], + + templateName: 'modals/poll-ui-builder', + title: I18n.t("poll.ui_builder.title") +}); diff --git a/plugins/poll/assets/stylesheets/common/poll-ui-builder.scss b/plugins/poll/assets/stylesheets/common/poll-ui-builder.scss new file mode 100644 index 000000000..a8467a3ab --- /dev/null +++ b/plugins/poll/assets/stylesheets/common/poll-ui-builder.scss @@ -0,0 +1,18 @@ +.poll-ui-builder-form { + .input-group { + padding: 10px; + } + + label { + font-weight: bold; + display: inline; + } + + .combobox { + margin-right: 5px; + } + + .poll-options-min, .poll-options-max, .poll-options-step { + width: 70px !important; + } +} diff --git a/plugins/poll/config/locales/client.en.yml b/plugins/poll/config/locales/client.en.yml index 4344b85bd..7113b022d 100644 --- a/plugins/poll/config/locales/client.en.yml +++ b/plugins/poll/config/locales/client.en.yml @@ -68,3 +68,26 @@ en: error_while_toggling_status: "There was an error while toggling the status of this poll." error_while_casting_votes: "There was an error while casting your votes." error_while_fetching_voters: "There was an error while displaying the voters." + + ui_builder: + title: Poll Builder + insert: Insert Poll + reset: Reset Poll + help: + options_count: You must provide a minimum of 2 options. + poll_name: + label: Poll Name + placeholder: Enter Poll Name + poll_type: + label: Poll Type + regular: regular + multiple: multiple + number: number + poll_config: + max: Max + min: Min + step: Step + poll_public: + label: Make Public Poll + poll_options: + label: "Poll Choices: (one option per line)" diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb index 075be0983..da979c275 100644 --- a/plugins/poll/plugin.rb +++ b/plugins/poll/plugin.rb @@ -7,6 +7,7 @@ enabled_site_setting :poll_enabled register_asset "stylesheets/common/poll.scss" +register_asset "stylesheets/common/poll-ui-builder.scss" register_asset "stylesheets/desktop/poll.scss", :desktop register_asset "stylesheets/mobile/poll.scss", :mobile diff --git a/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6 b/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6 new file mode 100644 index 000000000..fb4941838 --- /dev/null +++ b/plugins/poll/test/javascripts/controllers/poll-ui-builder-test.js.es6 @@ -0,0 +1,225 @@ +moduleFor("controller:poll-ui-builder", "controller:poll-ui-builder", { + needs: ['controller:modal'] +}); + +test("isMultiple", function() { + const controller = this.subject(); + + controller.setProperties({ + pollType: I18n.t("poll.ui_builder.poll_type.multiple"), + pollOptionsCount: 1 + }); + + equal(controller.get("isMultiple"), true, "it should be true"); + + controller.set("pollOptionsCount", 0); + + equal(controller.get("isMultiple"), false, "it should be false"); + + controller.setProperties({ pollType: "random", pollOptionsCount: 1 }); + + equal(controller.get("isMultiple"), false, "it should be false"); +}); + +test("isNumber", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + + controller.set("pollType", "random"); + + equal(controller.get("isNumber"), false, "it should be false"); + + controller.set("pollType", I18n.t("poll.ui_builder.poll_type.number")); + + equal(controller.get("isNumber"), true, "it should be true"); +}); + +test("showMinMax", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + + controller.setProperties({ + isNumber: true, + isMultiple: false + }); + + equal(controller.get("showMinMax"), true, "it should be true"); + + controller.setProperties({ + isNumber: false, + isMultiple: true + }); + + equal(controller.get("showMinMax"), true, "it should be true"); +}); + +test("pollOptionsCount", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + + controller.set("pollOptions", "1\n2\n") + + equal(controller.get("pollOptionsCount"), 2, "it should equal 2"); + + controller.set("pollOptions", "") + + equal(controller.get("pollOptionsCount"), 0, "it should equal 0"); +}); + +test("pollMinOptions", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + + controller.setProperties({ + isMultiple: true, + pollOptionsCount: 1 + }); + + deepEqual(controller.get("pollMinOptions"), [{ name: 1, value: 1 }], "it should return the right options"); + + controller.set("pollOptionsCount", 2); + + deepEqual(controller.get("pollMinOptions"), [ + { name: 1, value: 1 }, { name: 2, value: 2 } + ], "it should return the right options"); + + controller.set("isNumber", true); + controller.siteSettings.poll_maximum_options = 2; + + deepEqual(controller.get("pollMinOptions"), [ + { name: 1, value: 1 }, { name: 2, value: 2 } + ], "it should return the right options"); +}); + +test("pollMaxOptions", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + + controller.setProperties({ isMultiple: true, pollOptionsCount: 1, pollMin: 1 }); + + deepEqual(controller.get("pollMaxOptions"), [], "it should return the right options"); + + controller.set("pollOptionsCount", 2); + + deepEqual(controller.get("pollMaxOptions"), [ + { name: 2, value: 2 } + ], "it should return the right options"); + + controller.siteSettings.poll_maximum_options = 3; + controller.setProperties({ isMultiple: false, isNumber: true, pollStep: 2, pollMin: 1 }); + + deepEqual(controller.get("pollMaxOptions"), [ + { name: 2, value: 2 }, + { name: 3, value: 3 }, + { name: 4, value: 4 }, + { name: 5, value: 5 }, + { name: 6, value: 6 } + ], "it should return the right options"); +}); + +test("pollStepOptions", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + controller.siteSettings.poll_maximum_options = 3; + + controller.set("isNumber", false); + + equal(controller.get("pollStepOptions"), null, "is should return null"); + + controller.setProperties({ isNumber: true }); + + deepEqual(controller.get("pollStepOptions"), [ + { name: 1, value: 1 }, + { name: 2, value: 2 }, + { name: 3, value: 3 } + ], "it should return the right options"); +}); + +test("disableInsert", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + + controller.setProperties({ isNumber: true }); + + equal(controller.get("disableInsert"), false, "it should be false"); + + controller.setProperties({ isNumber: false, pollOptionsCount: 3 }); + + equal(controller.get("disableInsert"), false, "it should be false"); + + controller.setProperties({ isNumber: false, pollOptionsCount: 1 }); + + equal(controller.get("disableInsert"), true, "it should be true"); +}); + +test("number pollOutput", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + controller.siteSettings.poll_maximum_options = 20; + + controller.setProperties({ + isNumber: true, + pollType: I18n.t("poll.ui_builder.poll_type.number"), + pollMin: 1 + }); + + equal(controller.get("pollOutput"), "[poll type=number min=1 max=20 step=1]\n[/poll]", "it should return the right output"); + + controller.set("pollName", 'test'); + + equal(controller.get("pollOutput"), "[poll name=test type=number min=1 max=20 step=1]\n[/poll]", "it should return the right output"); + + controller.set("pollName", 'test poll'); + + equal(controller.get("pollOutput"), "[poll name=test-poll type=number min=1 max=20 step=1]\n[/poll]", "it should return the right output"); + + controller.set("pollStep", 2); + + equal(controller.get("pollOutput"), "[poll name=test-poll type=number min=1 max=20 step=2]\n[/poll]", "it should return the right output"); + + controller.set("publicPoll", true); + + equal(controller.get("pollOutput"), "[poll name=test-poll type=number min=1 max=20 step=2 public=true]\n[/poll]", "it should return the right output"); +}); + +test("regular pollOutput", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + controller.siteSettings.poll_maximum_options = 20; + + controller.set("pollOptions", "1\n2"); + + equal(controller.get("pollOutput"), "[poll]\n* 1\n* 2\n[/poll]", "it should return the right output"); + + controller.set("pollName", "test"); + + equal(controller.get("pollOutput"), "[poll name=test]\n* 1\n* 2\n[/poll]", "it should return the right output"); + + controller.set("publicPoll", "true"); + + equal(controller.get("pollOutput"), "[poll name=test public=true]\n* 1\n* 2\n[/poll]", "it should return the right output"); +}); + + +test("multiple pollOutput", function() { + const controller = this.subject(); + controller.siteSettings = Discourse.SiteSettings; + controller.siteSettings.poll_maximum_options = 20; + + controller.setProperties({ + isMultiple: true, + pollType: I18n.t("poll.ui_builder.poll_type.multiple"), + pollMin: 1, + pollOptions: "1\n2" + }); + + equal(controller.get("pollOutput"), "[poll type=multiple min=1 max=2]\n* 1\n* 2\n[/poll]", "it should return the right output"); + + controller.set("pollName", "test"); + + equal(controller.get("pollOutput"), "[poll name=test type=multiple min=1 max=2]\n* 1\n* 2\n[/poll]", "it should return the right output"); + + controller.set("publicPoll", "true"); + + equal(controller.get("pollOutput"), "[poll name=test type=multiple min=1 max=2 public=true]\n* 1\n* 2\n[/poll]", "it should return the right output"); +}); From ae5a033469bce7d2a054ff9c9e5bc09221388b77 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 14 Jun 2016 16:11:45 +0800 Subject: [PATCH 312/320] Start checking eslint in plugins. --- .travis.yml | 1 + .../components/poll-results-number-voters.js.es6 | 1 - .../components/poll-results-standard-voters.js.es6 | 1 - .../javascripts/controllers/poll-ui-builder.js.es6 | 14 ++++---------- .../assets/javascripts/controllers/poll.js.es6 | 1 - plugins/poll/assets/javascripts/views/poll.js.es6 | 2 -- 6 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 43ef9e816..6a2ca9143 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,6 +45,7 @@ before_install: - eslint app/assets/javascripts - eslint --ext .es6 app/assets/javascripts - eslint --ext .es6 test/javascripts + - eslint --ext .es6 plugins/**/assets/javascripts - eslint test/javascripts before_script: diff --git a/plugins/poll/assets/javascripts/components/poll-results-number-voters.js.es6 b/plugins/poll/assets/javascripts/components/poll-results-number-voters.js.es6 index e75ad84cb..412cc8acd 100644 --- a/plugins/poll/assets/javascripts/components/poll-results-number-voters.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-results-number-voters.js.es6 @@ -1,5 +1,4 @@ import computed from 'ember-addons/ember-computed-decorators'; -import User from 'discourse/models/user'; import PollVoters from 'discourse/plugins/poll/components/poll-voters'; export default PollVoters.extend({ diff --git a/plugins/poll/assets/javascripts/components/poll-results-standard-voters.js.es6 b/plugins/poll/assets/javascripts/components/poll-results-standard-voters.js.es6 index 80dc1ef8b..50332f4ae 100644 --- a/plugins/poll/assets/javascripts/components/poll-results-standard-voters.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-results-standard-voters.js.es6 @@ -1,5 +1,4 @@ import computed from 'ember-addons/ember-computed-decorators'; -import User from 'discourse/models/user'; import PollVoters from 'discourse/plugins/poll/components/poll-voters'; export default PollVoters.extend({ diff --git a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 index 6d10e459d..ce139cd45 100644 --- a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 +++ b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 @@ -70,7 +70,6 @@ export default Ember.Controller.extend({ @computed("isMultiple", "isNumber", "pollOptionsCount", "pollMin", "pollStep") pollMaxOptions(isMultiple, isNumber, count, pollMin, pollStep) { if (!isMultiple && !isNumber) return; - var range = []; const pollMinInt = parseInt(pollMin); if (isMultiple) { @@ -84,7 +83,6 @@ export default Ember.Controller.extend({ @computed("isNumber", "pollMax") pollStepOptions(isNumber, pollMax) { if (!isNumber) return; - return this._comboboxOptions(1, parseInt(pollMax) + 1); }, @@ -99,7 +97,7 @@ export default Ember.Controller.extend({ if (pollMax) pollHeader += ` max=${pollMax}`; if (isNumber) pollHeader += ` step=${pollStep}`; if (publicPoll) pollHeader += ' public=true'; - pollHeader += ']' + pollHeader += ']'; output += `${pollHeader}\n`; if (pollOptions.length > 0 && !isNumber) { @@ -112,11 +110,7 @@ export default Ember.Controller.extend({ @computed("pollOptionsCount", "isNumber") disableInsert(count, isNumber) { - if (isNumber) { - return false; - } else { - return count < 2; - } + return isNumber ? false : (count < 2); }, @computed("disableInsert") @@ -132,8 +126,8 @@ export default Ember.Controller.extend({ _comboboxOptions(start_index, end_index) { return _.range(start_index, end_index).map(number => { - return { value: number, name: number } - }) + return { value: number, name: number }; + }); }, _setupPoll() { diff --git a/plugins/poll/assets/javascripts/controllers/poll.js.es6 b/plugins/poll/assets/javascripts/controllers/poll.js.es6 index 841a3beb8..acf63314c 100644 --- a/plugins/poll/assets/javascripts/controllers/poll.js.es6 +++ b/plugins/poll/assets/javascripts/controllers/poll.js.es6 @@ -147,7 +147,6 @@ export default Ember.Controller.extend({ }).then(results => { const poll = results.poll; const votes = results.vote; - const currentUser = this.currentUser; this.setProperties({ vote: votes, showResults: true }); this.set("model", Em.Object.create(poll)); diff --git a/plugins/poll/assets/javascripts/views/poll.js.es6 b/plugins/poll/assets/javascripts/views/poll.js.es6 index ac739b3f4..c9d6e632e 100644 --- a/plugins/poll/assets/javascripts/views/poll.js.es6 +++ b/plugins/poll/assets/javascripts/views/poll.js.es6 @@ -1,5 +1,3 @@ -import { on } from "ember-addons/ember-computed-decorators"; - export default Em.View.extend({ templateName: "poll", classNames: ["poll"], From e1cfe7536c1817c5b481df8369a8975884a02e1a Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 15 Jun 2016 12:54:52 +0800 Subject: [PATCH 313/320] FIX: Add default values when no value has been selected. --- .../assets/javascripts/controllers/poll-ui-builder.js.es6 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 index ce139cd45..b8fa691cd 100644 --- a/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 +++ b/plugins/poll/assets/javascripts/controllers/poll-ui-builder.js.es6 @@ -70,12 +70,12 @@ export default Ember.Controller.extend({ @computed("isMultiple", "isNumber", "pollOptionsCount", "pollMin", "pollStep") pollMaxOptions(isMultiple, isNumber, count, pollMin, pollStep) { if (!isMultiple && !isNumber) return; - const pollMinInt = parseInt(pollMin); + const pollMinInt = parseInt(pollMin) || 1; if (isMultiple) { return this._comboboxOptions(pollMinInt + 1, count + 1); } else if (isNumber) { - const pollStepInt = parseInt(pollStep); + const pollStepInt = parseInt(pollStep) || 1; return this._comboboxOptions(pollMinInt + 1, pollMinInt + (this.siteSettings.poll_maximum_options * pollStepInt)); } }, @@ -83,7 +83,7 @@ export default Ember.Controller.extend({ @computed("isNumber", "pollMax") pollStepOptions(isNumber, pollMax) { if (!isNumber) return; - return this._comboboxOptions(1, parseInt(pollMax) + 1); + return this._comboboxOptions(1, (parseInt(pollMax) || 1) + 1); }, @computed("isNumber", "showMinMax", "pollName", "pollType", "publicPoll", "pollOptions", "pollMin", "pollMax", "pollStep") From bf642806611f2450c83c5ce27a499940ad88e20b Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 15 Jun 2016 13:45:07 +0800 Subject: [PATCH 314/320] FIX: Incorrect scope when checking for existing topic link. --- app/models/topic_link.rb | 2 +- spec/models/topic_link_spec.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index 27735689d..2f7cc7452 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -161,7 +161,7 @@ class TopicLink < ActiveRecord::Base added_urls << url topic_link = TopicLink.find_by(topic_id: post.topic_id, - user_id: post.user_id, + post_id: post.id, url: url) unless topic_link diff --git a/spec/models/topic_link_spec.rb b/spec/models/topic_link_spec.rb index 5aca2837b..314276a26 100644 --- a/spec/models/topic_link_spec.rb +++ b/spec/models/topic_link_spec.rb @@ -121,6 +121,16 @@ http://b.com/#{'a'*500} expect(reflection.user_id).to eq(link.user_id) end + PostOwnerChanger.new( + post_ids: [linked_post.id], + topic_id: topic.id, + acting_user: user, + new_owner: Fabricate(:user) + ).change_owner! + + TopicLink.extract_from(linked_post) + expect(topic.topic_links.first.url).to eq(url) + linked_post.revise(post.user, { raw: "no more linkies https://eviltrout.com" }) expect(other_topic.topic_links.where(link_post_id: linked_post.id)).to be_blank end From ed4634dc341d76f2131b979dac0d97cc8090972e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 15 Jun 2016 14:41:08 +0200 Subject: [PATCH 315/320] FIX: don't error out when deleting a topic with no user --- app/services/staff_action_logger.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/services/staff_action_logger.rb b/app/services/staff_action_logger.rb index 4793424b7..fdfc7f200 100644 --- a/app/services/staff_action_logger.rb +++ b/app/services/staff_action_logger.rb @@ -65,10 +65,12 @@ class StaffActionLogger def log_topic_deletion(deleted_topic, opts={}) raise Discourse::InvalidParameters.new(:deleted_topic) unless deleted_topic && deleted_topic.is_a?(Topic) + user = delete_topic.user ? "#{deleted_topic.user.username} (#{deleted_topic.user.name})" : "(deleted user)" + details = [ "id: #{deleted_topic.id}", "created_at: #{deleted_topic.created_at}", - "user: #{deleted_topic.user.username} (#{deleted_topic.user.name})", + "user: #{user}", "title: #{deleted_topic.title}" ] From 367954057baf0e042efb97dcbf470cbad96611ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 15 Jun 2016 14:45:18 +0200 Subject: [PATCH 316/320] should have been 'deleted_topic' --- app/services/staff_action_logger.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/staff_action_logger.rb b/app/services/staff_action_logger.rb index fdfc7f200..8623602b3 100644 --- a/app/services/staff_action_logger.rb +++ b/app/services/staff_action_logger.rb @@ -65,7 +65,7 @@ class StaffActionLogger def log_topic_deletion(deleted_topic, opts={}) raise Discourse::InvalidParameters.new(:deleted_topic) unless deleted_topic && deleted_topic.is_a?(Topic) - user = delete_topic.user ? "#{deleted_topic.user.username} (#{deleted_topic.user.name})" : "(deleted user)" + user = deleted_topic.user ? "#{deleted_topic.user.username} (#{deleted_topic.user.name})" : "(deleted user)" details = [ "id: #{deleted_topic.id}", From 1c9519636c1b4ffffc37e07864994ce58ef6cd69 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 15 Jun 2016 10:51:26 -0400 Subject: [PATCH 317/320] FEATURE: new users can be blocked from posting if enough TL3 users flag their posts --- app/models/post_action.rb | 2 +- app/services/spam_rule/auto_block.rb | 44 ++++++++++++++-- spec/services/auto_block_spec.rb | 75 ++++++++++++++++++++++++++-- 3 files changed, 110 insertions(+), 11 deletions(-) diff --git a/app/models/post_action.rb b/app/models/post_action.rb index 3ac3d5d02..f149c29ae 100644 --- a/app/models/post_action.rb +++ b/app/models/post_action.rb @@ -448,7 +448,7 @@ SQL post = Post.with_deleted.where(id: post_id).first PostAction.auto_close_if_threshold_reached(post.topic) PostAction.auto_hide_if_needed(user, post, post_action_type_key) - SpamRulesEnforcer.enforce!(post.user) if post_action_type_key == :spam + SpamRulesEnforcer.enforce!(post.user) end def notify_subscribers diff --git a/app/services/spam_rule/auto_block.rb b/app/services/spam_rule/auto_block.rb index 6c5d50187..2a3f83e45 100644 --- a/app/services/spam_rule/auto_block.rb +++ b/app/services/spam_rule/auto_block.rb @@ -17,13 +17,25 @@ class SpamRule::AutoBlock end def block? - @user.blocked? or - (!@user.staged? and - !@user.has_trust_level?(TrustLevel[1]) and - SiteSetting.num_flags_to_block_new_user > 0 and + return true if @user.blocked? + return false if @user.staged? + return false if @user.has_trust_level?(TrustLevel[1]) + + if SiteSetting.num_flags_to_block_new_user > 0 and SiteSetting.num_users_to_block_new_user > 0 and num_spam_flags_against_user >= SiteSetting.num_flags_to_block_new_user and - num_users_who_flagged_spam_against_user >= SiteSetting.num_users_to_block_new_user) + num_users_who_flagged_spam_against_user >= SiteSetting.num_users_to_block_new_user + return true + end + + if SiteSetting.num_tl3_flags_to_block_new_user > 0 and + SiteSetting.num_tl3_users_to_block_new_user > 0 and + num_tl3_flags_against_user >= SiteSetting.num_tl3_flags_to_block_new_user and + num_tl3_users_who_flagged >= SiteSetting.num_tl3_users_to_block_new_user + return true + end + + false end def num_spam_flags_against_user @@ -36,6 +48,28 @@ class SpamRule::AutoBlock PostAction.spam_flags.where(post_id: post_ids).uniq.pluck(:user_id).size end + def num_tl3_flags_against_user + if flagged_post_ids.empty? + 0 + else + PostAction.where(post_id: flagged_post_ids).joins(:user).where('users.trust_level >= ?', 3).count + end + end + + def num_tl3_users_who_flagged + if flagged_post_ids.empty? + 0 + else + PostAction.where(post_id: flagged_post_ids).joins(:user).where('users.trust_level >= ?', 3).pluck(:user_id).uniq.size + end + end + + def flagged_post_ids + Post.where(user_id: @user.id) + .where('spam_count > ? OR off_topic_count > ? OR inappropriate_count > ?', 0, 0, 0) + .pluck(:id) + end + def block_user Post.transaction do if UserBlocker.block(@user, Discourse.system_user, message: :too_many_spam_flags) && SiteSetting.notify_mods_when_user_blocked diff --git a/spec/services/auto_block_spec.rb b/spec/services/auto_block_spec.rb index d23738835..3ce463046 100644 --- a/spec/services/auto_block_spec.rb +++ b/spec/services/auto_block_spec.rb @@ -3,9 +3,9 @@ require 'rails_helper' describe SpamRule::AutoBlock do before do - SiteSetting.stubs(:flags_required_to_hide_post).returns(0) # never - SiteSetting.stubs(:num_flags_to_block_new_user).returns(2) - SiteSetting.stubs(:num_users_to_block_new_user).returns(2) + SiteSetting.flags_required_to_hide_post = 0 # never + SiteSetting.num_flags_to_block_new_user = 2 + SiteSetting.num_users_to_block_new_user = 2 end describe 'perform' do @@ -86,6 +86,44 @@ describe SpamRule::AutoBlock do end end + describe 'num_tl3_flags_against_user' do + let(:post) { Fabricate(:post) } + let(:enforcer) { described_class.new(post.user) } + + it "counts flags of all types from tl3 users only" do + Fabricate(:flag, post: post, user: Fabricate(:user, trust_level: 1), post_action_type_id: PostActionType.types[:inappropriate]) + expect(enforcer.num_tl3_flags_against_user).to eq(0) + Fabricate(:flag, post: post, user: Fabricate(:user, trust_level: 3), post_action_type_id: PostActionType.types[:inappropriate]) + expect(enforcer.num_tl3_flags_against_user).to eq(1) + Fabricate(:flag, post: post, user: Fabricate(:user, trust_level: 1), post_action_type_id: PostActionType.types[:spam]) + Fabricate(:flag, post: post, user: Fabricate(:user, trust_level: 3), post_action_type_id: PostActionType.types[:spam]) + expect(enforcer.num_tl3_flags_against_user).to eq(2) + end + end + + describe 'num_tl3_users_who_flagged' do + let(:post) { Fabricate(:post) } + let(:enforcer) { described_class.new(post.user) } + + it "counts only tl3 users who flagged with any type" do + Fabricate(:flag, post: post, user: Fabricate(:user, trust_level: 1), post_action_type_id: PostActionType.types[:inappropriate]) + expect(enforcer.num_tl3_users_who_flagged).to eq(0) + + tl3_user1 = Fabricate(:user, trust_level: 3) + Fabricate(:flag, post: post, user: tl3_user1, post_action_type_id: PostActionType.types[:inappropriate]) + expect(enforcer.num_tl3_users_who_flagged).to eq(1) + + Fabricate(:flag, post: post, user: Fabricate(:user, trust_level: 1), post_action_type_id: PostActionType.types[:spam]) + expect(enforcer.num_tl3_users_who_flagged).to eq(1) + + Fabricate(:flag, post: post, user: Fabricate(:user, trust_level: 3), post_action_type_id: PostActionType.types[:spam]) + expect(enforcer.num_tl3_users_who_flagged).to eq(2) + + Fabricate(:flag, post: Fabricate(:post, user: post.user), user: tl3_user1, post_action_type_id: PostActionType.types[:inappropriate]) + expect(enforcer.num_tl3_users_who_flagged).to eq(2) + end + end + describe 'block_user' do let!(:admin) { Fabricate(:admin) } # needed for SystemMessage let(:user) { Fabricate(:user) } @@ -109,7 +147,7 @@ describe SpamRule::AutoBlock do end it 'sends private message to moderators' do - SiteSetting.stubs(:notify_mods_when_user_blocked).returns(true) + SiteSetting.notify_mods_when_user_blocked = true moderator = Fabricate(:moderator) GroupMessage.expects(:create).with do |group, msg_type, params| group == Group[:moderators].name and msg_type == :user_automatically_blocked and params[:user].id == user.id @@ -144,6 +182,8 @@ describe SpamRule::AutoBlock do enforcer = described_class.new(user) enforcer.expects(:num_spam_flags_against_user).never enforcer.expects(:num_users_who_flagged_spam_against_user).never + enforcer.expects(:num_flags_against_user).never + enforcer.expects(:num_users_who_flagged).never expect(enforcer.block?).to eq(false) end end @@ -189,7 +229,7 @@ describe SpamRule::AutoBlock do end it 'returns false if num_flags_to_block_new_user is 0' do - SiteSetting.stubs(:num_flags_to_block_new_user).returns(0) + SiteSetting.num_flags_to_block_new_user = 0 subject.stubs(:num_spam_flags_against_user).returns(100) subject.stubs(:num_users_who_flagged_spam_against_user).returns(100) expect(subject.block?).to be_falsey @@ -207,6 +247,31 @@ describe SpamRule::AutoBlock do subject.stubs(:num_users_who_flagged_spam_against_user).returns(2) expect(subject.block?).to be_truthy end + + context "all types of flags" do + before do + SiteSetting.num_tl3_flags_to_block_new_user = 3 + SiteSetting.num_tl3_users_to_block_new_user = 2 + end + + it 'returns false if there are not enough flags' do + subject.stubs(:num_tl3_flags_against_user).returns(1) + subject.stubs(:num_tl3_users_who_flagged).returns(1) + expect(subject.block?).to be_falsey + end + + it 'returns false if enough flags but not enough users' do + subject.stubs(:num_tl3_flags_against_user).returns(3) + subject.stubs(:num_tl3_users_who_flagged).returns(1) + expect(subject.block?).to be_falsey + end + + it 'returns true if enough flags and users' do + subject.stubs(:num_tl3_flags_against_user).returns(3) + subject.stubs(:num_tl3_users_who_flagged).returns(2) + expect(subject.block?).to eq(true) + end + end end context "blocked, but has higher trust level now" do From fd91a8eee60c4854c6af59a94020e931aa0cbe50 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 15 Jun 2016 21:21:17 +0800 Subject: [PATCH 318/320] Bunch of UX changes for polls builder. --- .../discourse/templates/modals/poll-ui-builder.hbs | 10 +++++----- .../assets/stylesheets/common/poll-ui-builder.scss | 7 +++++++ plugins/poll/config/locales/client.en.yml | 11 +++++------ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/plugins/poll/assets/javascripts/discourse/templates/modals/poll-ui-builder.hbs b/plugins/poll/assets/javascripts/discourse/templates/modals/poll-ui-builder.hbs index c800db9af..bdb14b285 100644 --- a/plugins/poll/assets/javascripts/discourse/templates/modals/poll-ui-builder.hbs +++ b/plugins/poll/assets/javascripts/discourse/templates/modals/poll-ui-builder.hbs @@ -1,12 +1,12 @@