From 2762bc7be512992314dbe6257d14a7c5fdcd2fef Mon Sep 17 00:00:00 2001 From: Elliot Shepherd Date: Tue, 8 Jul 2014 15:17:48 +1000 Subject: [PATCH 01/16] FIX: avatars:regenerate rake task is now avatars:refresh --- config/locales/server.cs.yml | 2 +- config/locales/server.da.yml | 2 +- config/locales/server.en.yml | 2 +- config/locales/server.es.yml | 2 +- config/locales/server.fr.yml | 2 +- config/locales/server.he.yml | 2 +- config/locales/server.id.yml | 2 +- config/locales/server.it.yml | 2 +- config/locales/server.ja.yml | 2 +- config/locales/server.ko.yml | 2 +- config/locales/server.nl.yml | 2 +- config/locales/server.pl_PL.yml | 2 +- config/locales/server.pt.yml | 2 +- config/locales/server.pt_BR.yml | 2 +- config/locales/server.ru.yml | 2 +- config/locales/server.uk.yml | 2 +- config/locales/server.zh_CN.yml | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/config/locales/server.cs.yml b/config/locales/server.cs.yml index 5df3f89275a..765c0dcb650 100644 --- a/config/locales/server.cs.yml +++ b/config/locales/server.cs.yml @@ -723,7 +723,7 @@ cs: username_change_period: "Počet dní od registrace za kolik si uživatel může změnit svoje uživatelské jméno (0 pokud chcete změnu uživatelského jména úplně zakázat)." email_editable: "Povolit uživatelům změnit si po registraci emailovou adresu." allow_uploaded_avatars: "Allow users to upload their custom avatars" - allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:regenerate rake task after changing that setting." + allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:refresh rake task after changing that setting." digest_min_excerpt_length: "How many characters we're aiming for for each post in the email digest" default_digest_email_frequency: "How often users receive digest emails by default. They can change this setting in their preferences." default_external_links_in_new_tab: "Otevírat odkazy na externí weby v novém tabu. Uživatelé si toto můžou změnit v svém nastavení." diff --git a/config/locales/server.da.yml b/config/locales/server.da.yml index c328c7f1659..4ab3211af81 100644 --- a/config/locales/server.da.yml +++ b/config/locales/server.da.yml @@ -666,7 +666,7 @@ da: username_change_period: "Antal dage efter oprettelsen hvor brugere kan ændre deres brugernavn (0 for ikke at tillade skift af brugernavn)." email_editable: "Lad brugerne skifte deres e-mail-adresse efter oprettelsen." allow_uploaded_avatars: "Lad brugerne uploade deres egne avatarer" - allow_animated_avatars: "Lad brugerne anvende animerede GIFer som avatarer. ADVARSEL: det anbefales kraftigt at køre avatars:regenerate rake-jobbet når du har ændret denne indstilling." + allow_animated_avatars: "Lad brugerne anvende animerede GIFer som avatarer. ADVARSEL: det anbefales kraftigt at køre avatars:refresh rake-jobbet når du har ændret denne indstilling." default_digest_email_frequency: "Hvor ofte brugerne som standard modtager e-mail-sammendrag. De kan ændre indstillingen på deres profil." default_external_links_in_new_tab: "Åbn eksterne links i en nu fane; brugerne kan ændre dette på deres profil" detect_custom_avatars: "Hvorvidt det skal kontrolleres om brugerne har uploadet deres egne avatarer" diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 207d4ba42df..f3523d3bfdf 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -890,7 +890,7 @@ en: email_editable: "Allow users to change their e-mail address after registration." allow_uploaded_avatars: "Allow users to upload their custom avatars" - allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:regenerate rake task after changing that setting." + allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:refresh rake task after changing that setting." automatically_download_gravatars: "Download gravatars for users upon account creation or email change" digest_topics: "The maximum amount of topics to display in an email digest" digest_min_excerpt_length: "How many characters we're aiming for for each post in the email digest" diff --git a/config/locales/server.es.yml b/config/locales/server.es.yml index 806b0406c4c..fba83e387b4 100644 --- a/config/locales/server.es.yml +++ b/config/locales/server.es.yml @@ -766,7 +766,7 @@ es: username_change_period: "El número de días después de registrarse entre los cuales una cuenta puede cambiar su nombre de usuario (0 para deshabilitar esta opción)" email_editable: "Permitir a los usuarios cambiar su dirección de email después de registrarse." allow_uploaded_avatars: "Permitir a los usuarios subir sus propios avatars" - allow_animated_avatars: "Permitir a los usuarios usar gif animados para sus avatares. AVISO: es altamente recomendado ejecutar la tarea rake avatars:regenerate después de cambiar esta opción." + allow_animated_avatars: "Permitir a los usuarios usar gif animados para sus avatares. AVISO: es altamente recomendado ejecutar la tarea rake avatars:refresh después de cambiar esta opción." automatically_download_gravatars: "Descargar gravatars para los usuarios cuando creen una cuenta o cambien el email" digest_topics: "La cantidad máxima de temas a mostrar en el email de resumen" digest_min_excerpt_length: "Cuántos caracteres debería contener cada post en el email de resumen" diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index 7721d901447..22580c9c858 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -750,7 +750,7 @@ fr: username_change_period: "Le nombre de jours après l'enregistrement que les comptes peuvent changer leur nom d'utilisateur (0 pour empêcher le changement de pseudo)." email_editable: "Autoriser les utilisateurs à changer leur adresse e-mail après l'inscription." allow_uploaded_avatars: "Autoriser les utilisateurs d'envoyer leurs propres avatars." - allow_animated_avatars: "Autoriser les utilisateurs à utiliser des avatars avec des gif animés. ATTENTION: il est hautement recommandé d'exécuter la tâche rake avatars:regenerate après avoir changé ce paramètre." + allow_animated_avatars: "Autoriser les utilisateurs à utiliser des avatars avec des gif animés. ATTENTION: il est hautement recommandé d'exécuter la tâche rake avatars:refresh après avoir changé ce paramètre." automatically_download_gravatars: "Télécharger les gravatars pour les utilisateurs lors de la création de compte ou du changement d'email" digest_topics: "Le nombre maximum de sujets à afficher dans l'email de résumé" digest_min_excerpt_length: "Combien de caractères nous visons pour chaque message dans l'e-mail résumé" diff --git a/config/locales/server.he.yml b/config/locales/server.he.yml index 049aa30896d..1e7d03d9b66 100644 --- a/config/locales/server.he.yml +++ b/config/locales/server.he.yml @@ -734,7 +734,7 @@ he: username_change_period: "The number of days after registration that accounts can change their username (0 to disallow username change)." email_editable: "Allow users to change their e-mail address after registration." allow_uploaded_avatars: "Allow users to upload their custom avatars" - allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:regenerate rake task after changing that setting." + allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:refresh rake task after changing that setting." automatically_download_gravatars: "הורדת gravatars ממשתמשים בנוגע לירת חשבון או שינוי דוא\"ל." digest_min_excerpt_length: "How many characters we're aiming for for each post in the email digest" default_digest_email_frequency: "How often users receive digest emails by default. They can change this setting in their preferences." diff --git a/config/locales/server.id.yml b/config/locales/server.id.yml index 645cc092b7e..8835e223b82 100644 --- a/config/locales/server.id.yml +++ b/config/locales/server.id.yml @@ -164,7 +164,7 @@ id: backup_daily: "Membuat backup dari situs secara otomatis sekali per hari" newuser_max_attachments: "Berapa lampiran yang bisa ditambahkan pengguna baru ke dalam satu post" allow_uploaded_avatars: "Memperbolehkan pengguna untuk mengunggah avatar" - allow_animated_avatars: "Mengijinkan pengguna untuk menggunakan avatar gif dengan animasi. PERINGATAN: setelah mengubah pengaturan ini disarankan untuk menjalankan rake avatars:regenerate." + allow_animated_avatars: "Mengijinkan pengguna untuk menggunakan avatar gif dengan animasi. PERINGATAN: setelah mengubah pengaturan ini disarankan untuk menjalankan rake avatars:refresh." warn_reviving_old_topic_age: "Saat seseorang menjawab topik yang telah berusia lebih dari hari yang ditentukan, sebuah peringatan akan ditampilkan untuk mencegah pengguna tersebut menghidupkan kembali diskusi lama. Untuk menonaktifkan fitur ini, set nilainya menjadi 0." user: email: diff --git a/config/locales/server.it.yml b/config/locales/server.it.yml index c1a3d5f2e83..28a501ab9da 100644 --- a/config/locales/server.it.yml +++ b/config/locales/server.it.yml @@ -739,7 +739,7 @@ it: username_change_period: "Numero di giorni (dall'iscrizione) dopo i quali è possibile modificare lo username. Digita 0 per non permettere cambi di username" email_editable: "Permetti agli utenti di cambiare l'indirizzo email dopo la registrazione" allow_uploaded_avatars: "Permetti agli utenti di caricare il loro avatar custom." - allow_animated_avatars: "Permetti agli utenti di usare GIF animate come avatar. ATTENZIONE: è fortemente consigliato eseguire il task avatars:regenerate dopo aver modificato questa impostazione." + allow_animated_avatars: "Permetti agli utenti di usare GIF animate come avatar. ATTENZIONE: è fortemente consigliato eseguire il task avatars:refresh dopo aver modificato questa impostazione." automatically_download_gravatars: "Scarica i Gravatar degli utenti alla creazione dell'account o alla modifica dell'email" digest_topics: "Il numero massimo di topic da mostrare in un'email di riepilogo" digest_min_excerpt_length: "Numero caratteri ideale per ogni post nel sunto via email" diff --git a/config/locales/server.ja.yml b/config/locales/server.ja.yml index 1d037d93092..98e965de56a 100644 --- a/config/locales/server.ja.yml +++ b/config/locales/server.ja.yml @@ -582,7 +582,7 @@ ja: username_change_period: "ユーザ名の変更が可能になるまでの登録日からの日数 (0を指定でユーザ名の変更自体を無効化)。" email_editable: "登録後、ユーザによるメールアドレスの変更を許可する。" allow_uploaded_avatars: "ユーザがカスタムアバターをアップロードするのを許可する" - allow_animated_avatars: "ユーザがアニメ gif をアバターとしてアップロードするのを許可する。注意: この設定を変更した場合 avatars:regenerate rake タスクを走らせることを強く推奨します。" + allow_animated_avatars: "ユーザがアニメ gif をアバターとしてアップロードするのを許可する。注意: この設定を変更した場合 avatars:refresh rake タスクを走らせることを強く推奨します。" default_digest_email_frequency: "ユーザがダイジェストメールを受け取る頻度のデフォルト値。ユーザは設定画面でこの値をカスタマイズできます。" detect_custom_avatars: "ユーザがカスタムアバターをアップロードしたか確認する" max_daily_gravatar_crawls: "一日に、Discourse がカスタムアバターの確認を gravatar に行う最大回数" diff --git a/config/locales/server.ko.yml b/config/locales/server.ko.yml index 42defa1d15a..5ce753a0a28 100644 --- a/config/locales/server.ko.yml +++ b/config/locales/server.ko.yml @@ -527,7 +527,7 @@ ko: username_change_period: "등록 후 사용자 이름 최소 유지 기간(0은 사용자 이름 변경을 막음)" email_editable: "등록 후 이메일 주소를 바꿀수 있는 있음" allow_uploaded_avatars: "사용자가 커스텀 아바타를 올릴 수 있음" - allow_animated_avatars: "사용자가 움직이는 애니메이션으로 아바타를 이용할 수 있음. 경고: 설정 후 avatars:regenerate rake task 할 것" + allow_animated_avatars: "사용자가 움직이는 애니메이션으로 아바타를 이용할 수 있음. 경고: 설정 후 avatars:refresh rake task 할 것" default_digest_email_frequency: "사용자가 요약 이메일을 받는 횟수 기본값. 사용자는 그들의 환경설정에서 변경할 수 있음" detect_custom_avatars: "사용자가 커스텀 아바타를 올리던지 말던지 신경안씀" max_daily_gravatar_crawls: "하루에 커스텀 아바타로 gravatar를 사용하는지에 대해 체크하는 최대 횟수" diff --git a/config/locales/server.nl.yml b/config/locales/server.nl.yml index e2ef731ef83..582cea1c11f 100644 --- a/config/locales/server.nl.yml +++ b/config/locales/server.nl.yml @@ -739,7 +739,7 @@ nl: username_change_period: "The number of days after registration that accounts can change their username (0 om wijziging niet toe te staan)." email_editable: "Gebruikers mogen hun e-mailadres na registratie nog wijzigen." allow_uploaded_avatars: "Sta toe dat avatars geupload kunnen worden" - allow_animated_avatars: "Gebruikers mogen een animated GIF gebruiken als avatar. LET OP: draai de rake task avatars:regenerate nadat je deze instelling hebt geactiveerd." + allow_animated_avatars: "Gebruikers mogen een animated GIF gebruiken als avatar. LET OP: draai de rake task avatars:refresh nadat je deze instelling hebt geactiveerd." digest_topics: "Het maximum aantal topics dat in de e-maildigest opgenomen wordt" digest_min_excerpt_length: "Hoeveel karakters er ongeveer per bericht getoond worden in de mail digest" default_digest_email_frequency: "Hoe vaak ontvangen gebruikers standaard de digestmails. Ze kunnen dit in hun eigen instellingen nog aanpassen." diff --git a/config/locales/server.pl_PL.yml b/config/locales/server.pl_PL.yml index 575e751bb07..65687ce591c 100644 --- a/config/locales/server.pl_PL.yml +++ b/config/locales/server.pl_PL.yml @@ -663,7 +663,7 @@ pl_PL: username_change_period: "The number of days after registration that accounts can change their username (0 to disallow username change)." email_editable: "Allow users to change their e-mail address after registration." allow_uploaded_avatars: "Allow users to upload their custom avatars" - allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:regenerate rake task after changing that setting." + allow_animated_avatars: "Allow users to use animated gif for avatars. WARNING: it is highly recommended to run the avatars:refresh rake task after changing that setting." default_digest_email_frequency: "How often users receive digest emails by default. They can change this setting in their preferences." detect_custom_avatars: "Whether or not to check that users have uploaded custom avatars" max_daily_gravatar_crawls: "The maximum amount of times Discourse will check gravatar for custom avatars in a day" diff --git a/config/locales/server.pt.yml b/config/locales/server.pt.yml index dcd7af4a47b..1fbaa74b303 100644 --- a/config/locales/server.pt.yml +++ b/config/locales/server.pt.yml @@ -586,7 +586,7 @@ pt: username_change_period: "O número de dias após o registro para que as contas possam mudar o seu nome de usuário (0 para não permitir a mudança de nome de usuário)." email_editable: "Permitir que os usuários alterem o seu endereço de e-mail após o registro." allow_uploaded_avatars: "Permitir que os usuários façam envio de seus avatares personalizados" - allow_animated_avatars: "Permitir aos usuários usar gif animado para avatares. AVISO: é altamente recomendado executar a tarefa rake avatars:regenerate depois de mudar essa configuração." + allow_animated_avatars: "Permitir aos usuários usar gif animado para avatares. AVISO: é altamente recomendado executar a tarefa rake avatars:refresh depois de mudar essa configuração." default_digest_email_frequency: "Quantas vezes os usuários recebem emails de resumo por padrão. Eles podem alterar essa configuração em suas preferências." detect_custom_avatars: "Se deve ou não verificar se os usuários enviaram avatares personalizados" max_daily_gravatar_crawls: "A quantidade máxima de vezes que Discourse irá verificar gravatar para avatares personalizados em um dia" diff --git a/config/locales/server.pt_BR.yml b/config/locales/server.pt_BR.yml index 8c4078a5688..2b811be8c5c 100644 --- a/config/locales/server.pt_BR.yml +++ b/config/locales/server.pt_BR.yml @@ -741,7 +741,7 @@ pt_BR: username_change_period: "O número de dias após o registro para que as contas possam mudar o seu nome de usuário (0 para não permitir a mudança de nome de usuário)." email_editable: "Permitir que os usuários alterem o seu endereço de e-mail após o registro." allow_uploaded_avatars: "Permitir que os usuários façam envio de seus avatares personalizados" - allow_animated_avatars: "Permitir aos usuários usar gif animado para avatares. AVISO: é altamente recomendado executar a tarefa rake avatars:regenerate depois de mudar essa configuração." + allow_animated_avatars: "Permitir aos usuários usar gif animado para avatares. AVISO: é altamente recomendado executar a tarefa rake avatars:refresh depois de mudar essa configuração." automatically_download_gravatars: "Baixar gravatars para usuários após a criação de conta ou mudança de email" digest_topics: "O montante máximo de tópicos para exibir em um resumo por e-mail" digest_min_excerpt_length: "Quantos caracteres buscaremos em cada mensagem no e-mail de resumo" diff --git a/config/locales/server.ru.yml b/config/locales/server.ru.yml index 3a801842815..23afeeb0a9a 100644 --- a/config/locales/server.ru.yml +++ b/config/locales/server.ru.yml @@ -704,7 +704,7 @@ ru: username_change_period: "Количество дней после регистрации, когда пользователь может сменить свой логин (0 запрещает изменение логина)." email_editable: "Позволять пользователям изменять свой адрес электронной почты после регистрации." allow_uploaded_avatars: "Позволить пользователям загружать собственные аватары" - allow_animated_avatars: "Позволить пользователям использовать анимированные GIF для аватаров. ВНИМАНИЕ: после изменения данной настройки рекомендуется выполнить rake-задачу avatars:regenerate." + allow_animated_avatars: "Позволить пользователям использовать анимированные GIF для аватаров. ВНИМАНИЕ: после изменения данной настройки рекомендуется выполнить rake-задачу avatars:refresh." digest_min_excerpt_length: "На сколько символов в каждом сообщении почтовой сводки мы рассчитываем" default_digest_email_frequency: "Как часто пользователи получают дайджест по умолчанию. Возможно изменение этой настройки каждым пользователем." default_external_links_in_new_tab: "Открывать внешние ссылки в новом окне. Пользователи могут изменить данное поведение в настройках." diff --git a/config/locales/server.uk.yml b/config/locales/server.uk.yml index ed5094050f3..5289dfad580 100644 --- a/config/locales/server.uk.yml +++ b/config/locales/server.uk.yml @@ -612,7 +612,7 @@ uk: username_change_period: "Кількість днів після реєстрації, протягом яких новим обліковим записам можна змінювати своє ім'я користувача (0 щоб заборонити зміну імені користувача)." email_editable: "Дозволити користувачам змінювати свою електронну скриньку після реєстрації." allow_uploaded_avatars: "Дозволити користувачам завантажувати свої власні аватарки" - allow_animated_avatars: "Дозволити користувачам використовувати анімовані gif в якості аватарок. УВАГА: Ми дуже радимо запустити завдання rake avatars:regenerate після зміни цього налаштування." + allow_animated_avatars: "Дозволити користувачам використовувати анімовані gif в якості аватарок. УВАГА: Ми дуже радимо запустити завдання rake avatars:refresh після зміни цього налаштування." digest_min_excerpt_length: "How many characters we're aiming for for each post in the email digest" default_digest_email_frequency: "Як часто користувачі отримують листи зі стислим викладом новин за замовчуванням. Вони можуть змінити це у своїх налаштуваннях." default_external_links_in_new_tab: "Відкривати нові посилання у новій вкладці. Користувачі можуть змінити це у своїх налаштуваннях." diff --git a/config/locales/server.zh_CN.yml b/config/locales/server.zh_CN.yml index 4d064e7a9ff..75284c76be8 100644 --- a/config/locales/server.zh_CN.yml +++ b/config/locales/server.zh_CN.yml @@ -733,7 +733,7 @@ zh_CN: username_change_period: "用户在注册多少天内可以更改他们的用户名(0 表示禁用用户名更改)" email_editable: "允许用户在注册后改变他们的邮箱地址。" allow_uploaded_avatars: "允许用户上传他们自己的头像。" - allow_animated_avatars: "允许用户使用 gif 动画头像。警告:强烈建议在更改后运行 avatars:regenerate rake 任务。" + allow_animated_avatars: "允许用户使用 gif 动画头像。警告:强烈建议在更改后运行 avatars:refresh rake 任务。" automatically_download_gravatars: "为注册或更改邮箱的用户下载 Gravatar 头像" digest_topics: "邮件摘要中显示的最大主题数目" digest_min_excerpt_length: "在邮件摘要中每个帖子应有多少个字符" From 8395da5bd0619e43a2e8786fb6d631ae703884dc Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Thu, 10 Jul 2014 10:03:09 +0530 Subject: [PATCH 02/16] FIX: include topic title and domain name in topic invite mail --- app/mailers/invite_mailer.rb | 1 + config/locales/server.en.yml | 2 +- spec/mailers/invite_mailer_spec.rb | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/mailers/invite_mailer.rb b/app/mailers/invite_mailer.rb index c5c4d3bf1fc..daf01ec0c75 100644 --- a/app/mailers/invite_mailer.rb +++ b/app/mailers/invite_mailer.rb @@ -24,6 +24,7 @@ class InviteMailer < ActionMailer::Base build_email(invite.email, template: 'invite_mailer', invitee_name: invitee_name, + site_domain_name: Discourse.current_hostname, invite_link: "#{Discourse.base_url}/invites/#{invite.invite_key}", topic_title: first_topic.try(:title), topic_excerpt: topic_excerpt, diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 4b4cb07dcdc..a33f9b5a4e5 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1048,7 +1048,7 @@ en: blocked: "is blocked." invite_mailer: - subject_template: "%{invitee_name} invited you to a discussion at %{site_name}" + subject_template: "%{invitee_name} invited you to '%{topic_title}' on %{site_domain_name}" text_body_template: | %{invitee_name} invited you to a discussion diff --git a/spec/mailers/invite_mailer_spec.rb b/spec/mailers/invite_mailer_spec.rb index 5c1e90fc7ee..6c0fa6d0e97 100644 --- a/spec/mailers/invite_mailer_spec.rb +++ b/spec/mailers/invite_mailer_spec.rb @@ -42,6 +42,14 @@ describe InviteMailer do expect(invite_mail.subject).to be_present end + it 'renders topic title in subject' do + expect(invite_mail.subject).to match(topic.title) + end + + it 'renders site domain name in subject' do + expect(invite_mail.subject).to match(Discourse.current_hostname) + end + it 'renders the body' do expect(invite_mail.body).to be_present end From 95282a4c6d925e5da358cd14eeb3373e6aade29c Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Wed, 9 Jul 2014 22:00:30 -0700 Subject: [PATCH 03/16] add badge glyph to edit button --- app/assets/javascripts/admin/templates/user_index.js.handlebars | 2 +- config/locales/server.en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/templates/user_index.js.handlebars b/app/assets/javascripts/admin/templates/user_index.js.handlebars index b7f7cd69d71..dddcee6038d 100644 --- a/app/assets/javascripts/admin/templates/user_index.js.handlebars +++ b/app/assets/javascripts/admin/templates/user_index.js.handlebars @@ -101,7 +101,7 @@ {{i18n badges.badge_count count=badge_count}}
- {{#link-to 'adminUser.badges' this class="btn"}}{{i18n admin.badges.edit_badges}}{{/link-to}} + {{#link-to 'adminUser.badges' this class="btn"}}{{i18n admin.badges.edit_badges}}{{/link-to}}
{{/if}} diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index a33f9b5a4e5..7befceae7c1 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1067,7 +1067,7 @@ en: This invitation is from a trusted user, so you can reply to the discussion immediately. invite_forum_mailer: - subject_template: "[%{site_name}] %{invitee_name} invited you to join" + subject_template: "%{invitee_name} invited you to join %{site_name}" text_body_template: | %{invitee_name} invited you to join From 103e2ebba91a35cdd5b5c5c6a74583662ff8df70 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Jul 2014 15:18:31 +1000 Subject: [PATCH 04/16] FIX: properly support sendfile on all routes FIX: disable unused etags --- config/application.rb | 5 +++++ config/nginx.sample.conf | 26 ++++++++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/config/application.rb b/config/application.rb index 2452c2c7bd0..1922a73d5a5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -117,6 +117,11 @@ module Discourse # for some reason still seeing it in Rails 4 config.middleware.delete Rack::Lock + # ETags are pointless, we are dynamically compressing + # so nginx strips etags, may revisit when mainline nginx + # supports etags (post 1.7) + config.middleware.delete Rack::ETag + # route all exceptions via our router config.exceptions_app = self.routes diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf index a7d48481d15..d590f5964d0 100644 --- a/config/nginx.sample.conf +++ b/config/nginx.sample.conf @@ -51,8 +51,14 @@ server { # (This will also prevent compatibility mode in IE 8 and 9, but those browsers aren't supported anyway. add_header X-UA-Compatible "IE=edge"; + # without weak etags we get zero benefit from etags on dynamically compressed content + # further more etags are based on the file in nginx not sha of data + # use dates, it solves the problem fine even cross server + etag off; + location / { root $public; + add_header ETag ""; location ~* \.(eot|ttf|woff|ico)$ { expires 1y; @@ -62,15 +68,14 @@ server { location ~ ^/assets/ { expires 1y; + # asset pipeline enables this gzip_static on; - add_header ETag ""; add_header Cache-Control public; break; } location ~ ^/uploads/ { expires 1y; - add_header ETag ""; add_header Cache-Control public; ## optional upload anti-hotlinking rules @@ -90,25 +95,11 @@ server { try_files $uri =404; } - # attachments must go through the rails application to get the right content-disposition header - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $thescheme; - proxy_set_header X-Sendfile-Type X-Accel-Redirect; - proxy_set_header X-Accel-Mapping $public/=/downloads/; proxy_pass http://discourse; break; } location ~ ^/backups/ { - # backups must go through the rails application to handle security - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $thescheme; - proxy_set_header X-Sendfile-Type X-Accel-Redirect; - proxy_set_header X-Accel-Mapping $public/=/downloads/; proxy_pass http://discourse; break; } @@ -126,6 +117,9 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $thescheme; + proxy_set_header X-Sendfile-Type X-Accel-Redirect; + # required at parent level as various routes take advantage + proxy_set_header X-Accel-Mapping $public/=/downloads/; proxy_pass http://discourse; } From 2f6c984c8c702d051430115ac2bd71a0f7dbc1b9 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Thu, 10 Jul 2014 10:57:40 +0530 Subject: [PATCH 05/16] Improve invite email copy --- app/mailers/invite_mailer.rb | 15 ++++++++------- config/locales/server.en.yml | 2 +- spec/mailers/invite_mailer_spec.rb | 4 ++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/mailers/invite_mailer.rb b/app/mailers/invite_mailer.rb index daf01ec0c75..035dadb3b45 100644 --- a/app/mailers/invite_mailer.rb +++ b/app/mailers/invite_mailer.rb @@ -7,14 +7,14 @@ class InviteMailer < ActionMailer::Base # Find the first topic they were invited to first_topic = invite.topics.order(:created_at).first + # get invitee name (based on site setting) + invitee_name = invite.invited_by.username + if (SiteSetting.enable_names) + invitee_name = "#{invite.invited_by.name} (#{invite.invited_by.username})" + end + # If they were invited to a topic if first_topic.present? - # get invitee name (based on site setting) - invitee_name = invite.invited_by.username - if (SiteSetting.enable_names) - invitee_name = "#{invite.invited_by.name} (#{invite.invited_by.username})" - end - # get topic excerpt topic_excerpt = "" if first_topic.excerpt @@ -33,7 +33,8 @@ class InviteMailer < ActionMailer::Base else build_email(invite.email, template: 'invite_forum_mailer', - invitee_name: invite.invited_by.username, + invitee_name: invitee_name, + site_domain_name: Discourse.current_hostname, invite_link: "#{Discourse.base_url}/invites/#{invite.invite_key}", site_description: SiteSetting.site_description, site_title: SiteSetting.title) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 7befceae7c1..7f5ffdc2a69 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1067,7 +1067,7 @@ en: This invitation is from a trusted user, so you can reply to the discussion immediately. invite_forum_mailer: - subject_template: "%{invitee_name} invited you to join %{site_name}" + subject_template: "%{invitee_name} invited you to join %{site_domain_name}" text_body_template: | %{invitee_name} invited you to join diff --git a/spec/mailers/invite_mailer_spec.rb b/spec/mailers/invite_mailer_spec.rb index 6c0fa6d0e97..99695ea05ee 100644 --- a/spec/mailers/invite_mailer_spec.rb +++ b/spec/mailers/invite_mailer_spec.rb @@ -16,6 +16,10 @@ describe InviteMailer do expect(invite_mail.subject).to be_present end + it 'renders site domain name in subject' do + expect(invite_mail.subject).to match(Discourse.current_hostname) + end + it 'renders the body' do expect(invite_mail.body).to be_present end From 3deba15c182de6b37358771887ae018f81d91660 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Wed, 9 Jul 2014 22:35:42 -0700 Subject: [PATCH 06/16] minor copyedits --- config/locales/client.en.yml | 2 +- config/locales/server.en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 52681f04e58..d8e71fe0ef8 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1543,7 +1543,7 @@ en: opacity: "Opacity" copy: "Copy" css_html: - title: "CSS, HTML" + title: "CSS/HTML" long_title: "CSS and HTML Customizations" colors: title: "Colors" diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 7befceae7c1..6cb4cbd2610 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -695,7 +695,7 @@ en: track_external_right_clicks: "Track external links that are right clicked (eg: open in new tab) disabled by default because it rewrites URLs" topics_per_page: "How many topics loaded by default on the topics list page, and when loading more topics" posts_per_page: "How many posts loaded by default on a topic page, and when loading more posts" - site_contact_username: "Username for the author of automated private messages sent by the forum" + site_contact_username: "Username for the author of automated private messages sent by the forum; if left blank the default System account will be used." send_welcome_message: "Do new users get a welcome private message?" suppress_reply_directly_below: "Don't show reply count on a post when there is a single reply directly below" suppress_reply_directly_above: "Don't show in-reply-to on a post when there is a single reply directly above" From e4a7f652cc3b63d2575043fe214c60514b340996 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Wed, 9 Jul 2014 23:07:54 -0700 Subject: [PATCH 07/16] grammar tweak. It's shorter too! --- config/locales/client.en.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index d8e71fe0ef8..dcde683ae37 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -281,7 +281,7 @@ en: watched_categories: "Watched" watched_categories_instructions: "You will automatically watch all new topics in these categories. 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's listing." tracked_categories: "Tracked" - tracked_categories_instructions: "You will automatically track all new topics in these categories. The count of unread and new posts will appear next to the topic's listing." + tracked_categories_instructions: "You will automatically track all new topics in these categories. A count of unread and new posts will appear next to the topic's listing." muted_categories: "Muted" muted_categories_instructions: "You will not be notified of anything about new topics in these categories, and they will not appear on your unread tab." delete_account: "Delete My Account" @@ -834,16 +834,16 @@ en: "0": 'You are ignoring all notifications on this topic.' watching_pm: title: "Watching" - description: "You will be notified of every new post in this private message. The count of unread and new posts will also appear next to the topic's listing." + description: "You will be notified of every new post in this private message. A count of unread and new posts will also appear next to the topic's listing." watching: title: "Watching" - description: "You will be notified of every new post in this topic. The count of unread and new posts will also appear next to the topic's listing." + description: "You will be notified of every new post in this topic. A count of unread and new posts will also appear next to the topic's listing." tracking_pm: title: "Tracking" - description: "The count of unread and new posts will appear next to the private message. You will be notified only if someone mentions your @name or replies to your post." + description: "A count of unread and new posts will appear next to the private message. You will be notified only if someone mentions your @name or replies to your post." tracking: title: "Tracking" - description: "The count of unread and new posts will appear next to the topic's listing. You will be notified only if someone mentions your @name or replies to your post. " + description: "A count of unread and new posts will appear next to the topic's listing. You will be notified only if someone mentions your @name or replies to your post. " regular: title: "Regular" description: "You will be notified only if someone mentions your @name or replies to your post." @@ -1201,7 +1201,7 @@ en: description: "You will automatically watch all new topics in these categories. 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's listing." tracking: title: "Tracking" - description: "You will automatically track all new topics in these categories. The count of unread and new posts will appear next to the topic's listing." + description: "You will automatically track all new topics in these categories. A count of unread and new posts will appear next to the topic's listing." regular: title: "Regular" description: "You will be notified only if someone mentions your @name or replies to your post." From 5032c96486a69fa94728073fa06ae5963b21f2ca Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Jul 2014 16:32:06 +1000 Subject: [PATCH 08/16] FIX: disable x accl redirect for CDN assets We need to keep headers in tact --- app/controllers/static_controller.rb | 4 ++++ app/helpers/application_helper.rb | 2 +- app/views/layouts/application.html.erb | 2 +- config/application.rb | 7 +++++++ lib/middleware/optional_sendfile.rb | 11 +++++++++++ 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 lib/middleware/optional_sendfile.rb diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index b62fd03b781..12be4fd0308 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -73,6 +73,10 @@ class StaticController < ApplicationController disposition: nil } opts[:type] = "application/x-javascript" if path =~ /\.js$/ + + # we must disable acceleration otherwise NGINX strips + # access control headers + request.env['_disable_accl'] = true send_file(path, opts) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fabe1f77af2..130b9d4b866 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -15,7 +15,7 @@ module ApplicationHelper 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!(".js\"", ".js?origin=#{CGI.escape request.base_url}\"") + tags.gsub!(".js\"", ".js?v=1&origin=#{CGI.escape request.base_url}\"") tags.html_safe else javascript_include_tag(*args) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index e4f7e6536cd..2cb15528353 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -11,7 +11,7 @@ <%- end %> <%= script "preload_store" %> - <%= javascript_include_tag "locales/#{I18n.locale}" %> + <%= script "locales/#{I18n.locale}" %> <%= script "vendor" %> <%= script "application" %> <%- if staff? %> diff --git a/config/application.rb b/config/application.rb index 1922a73d5a5..674a240be17 100644 --- a/config/application.rb +++ b/config/application.rb @@ -122,6 +122,13 @@ module Discourse # supports etags (post 1.7) config.middleware.delete Rack::ETag + # We need to be able to disable for cdn assets + # x-accl-redirect strips headers we need to forward + # issue open since 2008 + require 'middleware/optional_sendfile' + config.middleware.insert_after Rack::Sendfile, Middleware::OptionalSendfile, config.action_dispatch.x_sendfile_header + config.middleware.delete Rack::Sendfile + # route all exceptions via our router config.exceptions_app = self.routes diff --git a/lib/middleware/optional_sendfile.rb b/lib/middleware/optional_sendfile.rb new file mode 100644 index 00000000000..9eb21c56f61 --- /dev/null +++ b/lib/middleware/optional_sendfile.rb @@ -0,0 +1,11 @@ +module Middleware + class OptionalSendfile < Rack::Sendfile + def call(env) + if env["_disable_accl"] == true + @app.call(env) + else + super(env) + end + end + end +end From 6019e3f2574744ffada93d5da7934f7a2f15b920 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Jul 2014 17:01:21 +1000 Subject: [PATCH 09/16] FIX: remove hardcoding from middleware stack so we can control it --- app/controllers/static_controller.rb | 2 +- config/application.rb | 7 ------- config/environments/production.rb | 3 --- lib/middleware/optional_sendfile.rb | 11 ----------- 4 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 lib/middleware/optional_sendfile.rb diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 12be4fd0308..bf2764d28fe 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -76,7 +76,7 @@ class StaticController < ApplicationController # we must disable acceleration otherwise NGINX strips # access control headers - request.env['_disable_accl'] = true + request.env['sendfile.type'] = '' send_file(path, opts) end end diff --git a/config/application.rb b/config/application.rb index 674a240be17..1922a73d5a5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -122,13 +122,6 @@ module Discourse # supports etags (post 1.7) config.middleware.delete Rack::ETag - # We need to be able to disable for cdn assets - # x-accl-redirect strips headers we need to forward - # issue open since 2008 - require 'middleware/optional_sendfile' - config.middleware.insert_after Rack::Sendfile, Middleware::OptionalSendfile, config.action_dispatch.x_sendfile_header - config.middleware.delete Rack::Sendfile - # route all exceptions via our router config.exceptions_app = self.routes diff --git a/config/environments/production.rb b/config/environments/production.rb index 5028919d26c..5ce1abeace1 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -21,9 +21,6 @@ Discourse::Application.configure do # Generate digests for assets URLs config.assets.digest = true - # Specifies the header that your server uses for sending files - config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation can not be found) config.i18n.fallbacks = true diff --git a/lib/middleware/optional_sendfile.rb b/lib/middleware/optional_sendfile.rb deleted file mode 100644 index 9eb21c56f61..00000000000 --- a/lib/middleware/optional_sendfile.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Middleware - class OptionalSendfile < Rack::Sendfile - def call(env) - if env["_disable_accl"] == true - @app.call(env) - else - super(env) - end - end - end -end From 27f85e54510a28b8215e7ad707d01e569faed99b Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Jul 2014 17:29:38 +1000 Subject: [PATCH 10/16] FIX: allow for subdirectorys for cdn assets --- app/controllers/static_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index bf2764d28fe..cee9f184c1f 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -60,8 +60,13 @@ class StaticController < ApplicationController skip_before_filter :verify_authenticity_token, only: [:cdn_asset] def cdn_asset - path = params[:path].gsub(/[^a-zA-Z0-9_\-\.]/, "") - path = (Rails.root + "public/assets/" + path).to_s + path = File.expand_path(Rails.root + "public/assets/" + params[:path]) + + # SECURITY what if path has /../ + unless path.start_with?(Rails.root.to_s + "/public/assets") + raise Discourse::NotFound + end + expires_in 1.year, public: true response.headers["Access-Control-Allow-Origin"] = params[:origin] begin From 4215b6347ce9bfda006201ba86f259c559d748f2 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 10 Jul 2014 00:09:00 -0700 Subject: [PATCH 11/16] quick temporary fix for wrapping right gutter --- app/assets/stylesheets/desktop/topic-post.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss index 0d9bf05616d..0f4b9329607 100644 --- a/app/assets/stylesheets/desktop/topic-post.scss +++ b/app/assets/stylesheets/desktop/topic-post.scss @@ -732,6 +732,8 @@ blockquote > *:last-child { float: left; margin-top: 15px; padding-left: 15px; + /* urgent fix, must set max width or long gutter width float flows under posts */ + max-width: 215px; ul {margin: 0;} li {margin-bottom: 10px;} From a56db77172a60d34fb6b23ccf0b6c5fca6084b40 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 10 Jul 2014 00:43:34 -0700 Subject: [PATCH 12/16] copyedit --- 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 3aa3bececff..76f55cf44fd 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1502,7 +1502,7 @@ en: %{respond_instructions} digest: - why: "Here's a brief summary of the discussion on %{site_link} since we last saw you on %{last_seen_at}." + why: "Here's a brief summary of %{site_link} since we last saw you on %{last_seen_at}." subject_template: "[%{site_name}] Digest for %{date}" new_activity: "New activity on your topics and posts:" top_topics: "Popular posts" From d053ad07fb66b95df7f9b75c89c2993781385501 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 10 Jul 2014 00:47:25 -0700 Subject: [PATCH 13/16] we don't want danger color on mobile category --- app/assets/stylesheets/common/base/_topic-list.scss | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/assets/stylesheets/common/base/_topic-list.scss b/app/assets/stylesheets/common/base/_topic-list.scss index bbcc3ba71dc..dcac261aefc 100644 --- a/app/assets/stylesheets/common/base/_topic-list.scss +++ b/app/assets/stylesheets/common/base/_topic-list.scss @@ -31,11 +31,6 @@ vertical-align: top; margin-top: 2px; } - &.category-description { - td { - color: $danger; - } - } &.highlighted { background-color: scale-color($tertiary, $lightness: 85%); } From 61e87a1bbc3305b2f1da67042e2b2cbf6eb23232 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 10 Jul 2014 00:57:30 -0700 Subject: [PATCH 14/16] make sure /top looks OK on mobile --- app/assets/stylesheets/mobile/topic-list.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/mobile/topic-list.scss b/app/assets/stylesheets/mobile/topic-list.scss index 9925f753a6a..e168b90c195 100644 --- a/app/assets/stylesheets/mobile/topic-list.scss +++ b/app/assets/stylesheets/mobile/topic-list.scss @@ -245,10 +245,10 @@ ol.category-breadcrumb { } } -.top-lists {margin-left: 15px; - #topic-list-bottom { - margin: 20px 0 0 0; - } +.top-lists { + h2 { margin-left: 10px; } + #topic-list { padding-bottom: 10px; } + .btn-default.pull-right { margin-right: 10px; } } .category-notification-menu { From d277932b22b5ee6dc816b705bc046ba29f331b40 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Jul 2014 17:59:07 +1000 Subject: [PATCH 15/16] Update logster --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ac45a4eb5f9..8554338ca52 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -162,7 +162,7 @@ GEM thor (~> 0.15) libv8 (3.16.14.3) listen (0.7.3) - logster (0.0.12) + logster (0.0.13) lru_redux (0.8.1) mail (2.5.4) mime-types (~> 1.16) From c6a313d4584d98efae7d9921cd5f957ca7319586 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 10 Jul 2014 11:28:49 -0400 Subject: [PATCH 16/16] Seed categories with capitalized names --- config/locales/server.en.yml | 6 +++--- db/fixtures/001_categories.rb | 4 ++-- db/migrate/20131022045114_add_uncategorized_category.rb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 76f55cf44fd..96417c6e12f 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -225,13 +225,13 @@ en: no_info_me: "
the About Me field of your profile is currently blank, would you like to fill it out?
" no_info_other: "
%{name} hasn't entered anything in the About Me field of their profile yet
" - vip_category_name: "lounge" + vip_category_name: "Lounge" vip_category_description: "A category exclusive to members with trust level 3 and higher." - meta_category_name: "meta" + meta_category_name: "Meta" meta_category_description: "Discussion about this forum, its organization, how it works, and how we can improve it." - staff_category_name: "staff" + staff_category_name: "Staff" staff_category_description: "Private category for staff discussions. Topics are only visible to admins and moderators." assets_topic_body: "This is a permanent topic, visible only to staff, for storing images and files used in the forum design. Don't delete it!\n\n\nHere's how:\n\n\n1. Reply to this topic.\n2. Upload all the images you wish to use for logos, favicons, and so forth here. (Use the upload toolbar icon in the post editor, or drag-and-drop or paste images.)\n3. Submit your reply to post it.\n4. Right click the images in your new post to get the path to the uploaded images, or click the edit icon to edit your post and retrieve the path to the images. Copy the image paths.\n5. Paste those image paths into [basic settings](/admin/site_settings/category/required).\n\n\nAlso, if you need to enable different file type uploads, edit `authorized_extensions` in the [file settings](/admin/site_settings/category/files)." diff --git a/db/fixtures/001_categories.rb b/db/fixtures/001_categories.rb index 19b5bc14897..5559eaaa2ef 100644 --- a/db/fixtures/001_categories.rb +++ b/db/fixtures/001_categories.rb @@ -5,8 +5,8 @@ SiteSetting.refresh! if SiteSetting.uncategorized_category_id == -1 || !Category.exists?(SiteSetting.uncategorized_category_id) puts "Seeding uncategorized category!" - result = Category.exec_sql "SELECT 1 FROM categories WHERE name = 'uncategorized'" - name = 'uncategorized' + result = Category.exec_sql "SELECT 1 FROM categories WHERE lower(name) = 'uncategorized'" + name = 'Uncategorized' if result.count > 0 name << SecureRandom.hex end diff --git a/db/migrate/20131022045114_add_uncategorized_category.rb b/db/migrate/20131022045114_add_uncategorized_category.rb index 126f9b7ed0e..953960fd661 100644 --- a/db/migrate/20131022045114_add_uncategorized_category.rb +++ b/db/migrate/20131022045114_add_uncategorized_category.rb @@ -1,8 +1,8 @@ class AddUncategorizedCategory < ActiveRecord::Migration def up - result = execute "SELECT 1 FROM categories WHERE name = 'uncategorized'" - name = 'uncategorized' + result = execute "SELECT 1 FROM categories WHERE lower(name) = 'uncategorized'" + name = 'Uncategorized' if result.count > 0 name << SecureRandom.hex end