From a61c202ac43e8247dd4f1f1ac074cdbbeb5913ec Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 17 Apr 2015 12:01:50 -0400 Subject: [PATCH] Rewrite `/private-messages` to `/messages` --- .../javascripts/discourse/initializers/url-redirects.js.es6 | 1 + app/assets/javascripts/discourse/routes/app-route-map.js.es6 | 2 +- config/locales/server.en.yml | 2 +- config/locales/server.es.yml | 2 +- config/locales/server.fa_IR.yml | 2 +- config/locales/server.fi.yml | 2 +- config/locales/server.fr.yml | 2 +- config/locales/server.he.yml | 2 +- config/locales/server.it.yml | 2 +- config/locales/server.pt_BR.yml | 2 +- config/locales/server.ro.yml | 2 +- config/locales/server.zh_CN.yml | 2 +- config/routes.rb | 2 ++ 13 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/discourse/initializers/url-redirects.js.es6 b/app/assets/javascripts/discourse/initializers/url-redirects.js.es6 index 46300a65d..2164be025 100644 --- a/app/assets/javascripts/discourse/initializers/url-redirects.js.es6 +++ b/app/assets/javascripts/discourse/initializers/url-redirects.js.es6 @@ -5,5 +5,6 @@ export default { // URL rewrites (usually due to refactoring) Discourse.URL.rewrite(/^\/category\//, "/c/"); Discourse.URL.rewrite(/^\/group\//, "/groups/"); + Discourse.URL.rewrite(/\/private-messages\/$/, "/messages/"); } }; diff --git a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 index 922183aeb..21d61cda2 100644 --- a/app/assets/javascripts/discourse/routes/app-route-map.js.es6 +++ b/app/assets/javascripts/discourse/routes/app-route-map.js.es6 @@ -66,7 +66,7 @@ export default function() { this.route('flaggedPosts', { path: '/flagged-posts' }); this.route('deletedPosts', { path: '/deleted-posts' }); - this.resource('userPrivateMessages', { path: '/private-messages' }, function() { + this.resource('userPrivateMessages', { path: '/messages' }, function() { this.route('mine'); this.route('unread'); }); diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index e69873aef..07e3b323e 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -530,7 +530,7 @@ en: email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

Your post was flagged by the community. Please see your messages.

' + you_must_edit: '

Your post was flagged by the community. Please see your messages.

' user_must_edit: '

This post was flagged by the community and is temporarily hidden.

' archetypes: diff --git a/config/locales/server.es.yml b/config/locales/server.es.yml index 239147959..1055ca3f1 100644 --- a/config/locales/server.es.yml +++ b/config/locales/server.es.yml @@ -457,7 +457,7 @@ es: email_title: 'El tema "%{title}" requiere la atención de un moderador' email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

Tu post ha sido reportado por la comunidad. Por favor mira tus mensajes.

' + you_must_edit: '

Tu post ha sido reportado por la comunidad. Por favor mira tus mensajes.

' user_must_edit: '

Este post fue reportado por la comunidad y está oculto temporalmente.

' archetypes: regular: diff --git a/config/locales/server.fa_IR.yml b/config/locales/server.fa_IR.yml index 6383fd29d..89272f2a7 100644 --- a/config/locales/server.fa_IR.yml +++ b/config/locales/server.fa_IR.yml @@ -410,7 +410,7 @@ fa_IR: email_title: 'این موضوع "%{title}" نیاز به توجه مدیر دارد. ' email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

نوشته شما توسط انجمن پرچم گزاری شده. لطفا پیامت را نگاه کن.

' + you_must_edit: '

نوشته شما توسط انجمن پرچم گزاری شده. لطفا پیامت را نگاه کن.

' user_must_edit: '

این نوشته توسط انجمن پرچم گزاری شده و بطور موقت مخفی شده است.

' archetypes: regular: diff --git a/config/locales/server.fi.yml b/config/locales/server.fi.yml index e310d4c82..163f2fa2b 100644 --- a/config/locales/server.fi.yml +++ b/config/locales/server.fi.yml @@ -457,7 +457,7 @@ fi: email_title: 'Viestiketju"%{title}" kaipaa valvojan huomiota' email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

Viestisi on liputettu muiden käyttäjien toimesta. Käy lukemassa saapuneet viestisi.

' + you_must_edit: '

Viestisi on liputettu muiden käyttäjien toimesta. Käy lukemassa saapuneet viestisi.

' user_must_edit: '

Tämä viesti on liputettu ja siksi piilotettu väliaikaisesti.

' archetypes: regular: diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index fc2b578f4..7a3360934 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -450,7 +450,7 @@ fr: email_title: 'Ce sujet "%{title}" requière l''attention d''un modérateur' email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

Votre message a été signalé par la communauté. Veuillez regarder vos messages.

' + you_must_edit: '

Votre message a été signalé par la communauté. Veuillez regarder vos messages.

' user_must_edit: '

Ce message a été signalé par la communauté et temporairement masqué.

' archetypes: regular: diff --git a/config/locales/server.he.yml b/config/locales/server.he.yml index 234e55ef6..58425fb1f 100644 --- a/config/locales/server.he.yml +++ b/config/locales/server.he.yml @@ -440,7 +440,7 @@ he: email_title: 'הנושא "%{title}" דורש תשומת לב של מנהל' email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

הפרסום שלך סומן על ידי הקהילה. אנא בדוק/בדקי את ההודעות שלך.

' + you_must_edit: '

הפרסום שלך סומן על ידי הקהילה. אנא בדוק/בדקי את ההודעות שלך.

' user_must_edit: '

פרסום זה סומן על ידי הקהילה וכרגע מוסתר באופן זמני.

' archetypes: regular: diff --git a/config/locales/server.it.yml b/config/locales/server.it.yml index 09ca9ec8d..6fb46b13c 100644 --- a/config/locales/server.it.yml +++ b/config/locales/server.it.yml @@ -423,7 +423,7 @@ it: email_title: 'L''argomento "%{title}" richiede l''attenzione di un moderatore' email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

Il tuo messaggio è stato segnalato dalla comunità. Controlla i tuoi messaggi.

' + you_must_edit: '

Il tuo messaggio è stato segnalato dalla comunità. Controlla i tuoi messaggi.

' user_must_edit: '

Questo messaggio è stato segnalato dalla comunità ed è stato temporaneamente nascosto.

' archetypes: regular: diff --git a/config/locales/server.pt_BR.yml b/config/locales/server.pt_BR.yml index 4d751e2ef..fe49ed8ee 100644 --- a/config/locales/server.pt_BR.yml +++ b/config/locales/server.pt_BR.yml @@ -447,7 +447,7 @@ pt_BR: email_title: 'O tópico "%{title}" requer atenção do moderador' email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

Sua mensagem foi marcada pela comunidade. Por favor veja suas mensagens.

' + you_must_edit: '

Sua mensagem foi marcada pela comunidade. Por favor veja suas mensagens.

' user_must_edit: '

Conteúdo sinalizado escondido.

' archetypes: regular: diff --git a/config/locales/server.ro.yml b/config/locales/server.ro.yml index ed43d14a9..4f584eef9 100644 --- a/config/locales/server.ro.yml +++ b/config/locales/server.ro.yml @@ -459,7 +459,7 @@ ro: email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

Postarea ta a fost marcată de către comunitate, te rugăm verifică mesajele private.

' + you_must_edit: '

Postarea ta a fost marcată de către comunitate, te rugăm verifică mesajele private.

' user_must_edit: '

Conţinutul marcat ascuns temporar.

' archetypes: diff --git a/config/locales/server.zh_CN.yml b/config/locales/server.zh_CN.yml index b623a7afe..329ee6760 100644 --- a/config/locales/server.zh_CN.yml +++ b/config/locales/server.zh_CN.yml @@ -423,7 +423,7 @@ zh_CN: email_title: '"%{title}" 主题需要你的关注' email_body: "%{link}\n\n%{message}" flagging: - you_must_edit: '

你的帖子被社群成员标记了。请查看你的消息

' + you_must_edit: '

你的帖子被社群成员标记了。请查看你的消息

' user_must_edit: '

你的帖子已经被社群标记并被临时隐藏。

' archetypes: regular: diff --git a/config/routes.rb b/config/routes.rb index 17a9c307f..536a0929a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -244,6 +244,8 @@ Discourse::Application.routes.draw do get "user_preferences" => "users#user_preferences_redirect" get "users/:username/private-messages" => "user_actions#private_messages", constraints: {username: USERNAME_ROUTE_FORMAT} get "users/:username/private-messages/:filter" => "user_actions#private_messages", constraints: {username: USERNAME_ROUTE_FORMAT} + get "users/:username/messages" => "user_actions#private_messages", constraints: {username: USERNAME_ROUTE_FORMAT} + get "users/:username/messages/:filter" => "user_actions#private_messages", constraints: {username: USERNAME_ROUTE_FORMAT} get "users/:username" => "users#show", as: 'user', constraints: {username: USERNAME_ROUTE_FORMAT} put "users/:username" => "users#update", constraints: {username: USERNAME_ROUTE_FORMAT} put "users/:username/emails" => "users#check_emails", constraints: {username: USERNAME_ROUTE_FORMAT}