From 86cf7b1524bb19bd940f2aa2f664bf3905bb3f6f Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 4 Apr 2013 12:24:10 +1100 Subject: [PATCH] trust level 0 is highlighted in light gray as opposed to having special semantics around account age. --- app/assets/javascripts/discourse/models/post.js | 5 +++++ app/models/site_setting.rb | 1 - app/serializers/post_serializer.rb | 13 ++++++------- config/locales/client.pseudo.yml | 9 ++++++--- config/locales/server.cs.yml | 1 - config/locales/server.da.yml | 1 - config/locales/server.de.yml | 1 - config/locales/server.en.yml | 1 - config/locales/server.es.yml | 1 - config/locales/server.fr.yml | 1 - config/locales/server.id.yml | 1 - config/locales/server.it.yml | 1 - config/locales/server.nl.yml | 2 -- config/locales/server.pseudo.yml | 6 ++++-- config/locales/server.pt.yml | 2 -- config/locales/server.sv.yml | 1 - config/locales/server.zh_CN.yml | 1 - config/locales/server.zh_TW.yml | 1 - 18 files changed, 21 insertions(+), 28 deletions(-) mode change 100644 => 100755 app/models/site_setting.rb mode change 100644 => 100755 app/serializers/post_serializer.rb mode change 100644 => 100755 config/locales/server.cs.yml mode change 100644 => 100755 config/locales/server.es.yml diff --git a/app/assets/javascripts/discourse/models/post.js b/app/assets/javascripts/discourse/models/post.js index 482ff08894..ecb8796a6e 100644 --- a/app/assets/javascripts/discourse/models/post.js +++ b/app/assets/javascripts/discourse/models/post.js @@ -8,6 +8,11 @@ **/ Discourse.Post = Discourse.Model.extend({ + + new_user:(function(){ + return this.get('trust_level') === 0; + }).property('trust_level'), + url: (function() { return Discourse.Utilities.postUrl(this.get('topic.slug') || this.get('topic_slug'), this.get('topic_id'), this.get('post_number')); }).property('post_number', 'topic_id', 'topic.slug'), diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb old mode 100644 new mode 100755 index 3dfdf23fdf..7215c1d4a1 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -157,7 +157,6 @@ class SiteSetting < ActiveRecord::Base setting(:body_min_entropy, 7) setting(:max_word_length, 30) - setting(:new_user_period_days, 2) setting(:visitor_max_links, 2) setting(:visitor_max_images, 0) diff --git a/app/serializers/post_serializer.rb b/app/serializers/post_serializer.rb old mode 100644 new mode 100755 index adb6f894e7..d8b62a1f7f --- a/app/serializers/post_serializer.rb +++ b/app/serializers/post_serializer.rb @@ -37,21 +37,16 @@ class PostSerializer < ApplicationSerializer :bookmarked, :raw, :actions_summary, - :new_user?, :moderator?, :avatar_template, :user_id, :draft_sequence, :hidden, :hidden_reason_id, - :deleted_at + :deleted_at, + :trust_level - def new_user? - # 21 calls = 5ms ... if there was a proper date in the RHS it would be 1ms - object.user.created_at > SiteSetting.new_user_period_days.days.ago - end - def moderator? object.user.moderator? end @@ -128,6 +123,10 @@ class PostSerializer < ApplicationSerializer object.user.name end + def trust_level + object.user.trust_level + end + def reply_to_user { username: object.reply_to_user.username, diff --git a/config/locales/client.pseudo.yml b/config/locales/client.pseudo.yml index 97246771d8..a4f0f37dfe 100644 --- a/config/locales/client.pseudo.yml +++ b/config/locales/client.pseudo.yml @@ -388,6 +388,9 @@ pseudo: unread: '[[ Ťĥéřé ářé ɳó ɱóřé ůɳřéáď ťóƿíčš ťó řéáď. ]]' favorited: '[[ Ťĥéřé ářé ɳó ɱóřé ƒáνóříťéď ťóƿíčš ťó řéáď. ]]' category: '[[ Ťĥéřé ářé ɳó ɱóřé {{category}} ťóƿíčš. ]]' + rank_details: + show: '[[ šĥóŵ ťóƿíč řáɳǩ ďéťáíłš ]]' + title: '[[ Ťóƿíč Řáɳǩ Ďéťáíłš ]]' topic: create_in: '[[ Čřéáťé {{categoryName}} Ťóƿíč ]]' create: '[[ Čřéáťé Ťóƿíč ]]' @@ -463,8 +466,8 @@ pseudo: ƿóšťš. ]]' tracking: title: '[[ Ťřáčǩíɳǧ ]]' - description: '[[ ýóů ŵíłł ƀé ɳóťíƒíéď óƒ ůɳřéáď ƿóšťš, @ɳáɱé ɱéɳťíóɳš, áɳď - řéƿłíéš ťó ýóůř ƿóšťš. ]]' + description: '[[ ýóů ŵíłł ƀé ɳóťíƒíéď óƒ @ɳáɱé ɱéɳťíóɳš áɳď řéƿłíéš ťó ýóůř + ƿóšťš, ƿłůš ýóů ŵíłł šéé á čóůɳť óƒ ůɳřéáď áɳď ɳéŵ ƿóšťš. ]]' regular: title: '[[ Řéǧůłář ]]' description: '[[ ýóů ŵíłł ƀé ɳóťíƒíéď óɳłý íƒ šóɱéóɳé ɱéɳťíóɳš ýóůř @ɳáɱé @@ -711,7 +714,7 @@ pseudo: other: '[[ {{categoryName}} ({{count}}) ]]' help: '[[ łáťéšť ťóƿíčš íɳ ťĥé {{categoryName}} čáťéǧóřý ]]' browser_update: '[[ Ůɳƒóřťůɳáťéłý, <á ĥřéƒ="ĥťťƿ://ŵŵŵ.ďíščóůřšé.óřǧ/ƒáƣ/#ƀřóŵšéř">ýóůř - ƀřóŵšéř íš ťóó ółď ťó ŵóřǩ óɳ ťĥíš Ďíščóůřšé ƒóřůɱ. Рłéášé <á ĥřéƒ="%{url}">ůƿǧřáďé + ƀřóŵšéř íš ťóó ółď ťó ŵóřǩ óɳ ťĥíš Ďíščóůřšé ƒóřůɱ. Рłéášé <á ĥřéƒ="ĥťťƿ://ƀřóŵšéĥáƿƿý.čóɱ">ůƿǧřáďé ýóůř ƀřóŵšéř. ]]' admin_js: type_to_filter: '[[ ťýƿé ťó ƒíłťéř... ]]' diff --git a/config/locales/server.cs.yml b/config/locales/server.cs.yml old mode 100644 new mode 100755 index 306243dacc..b0d8cce25b --- a/config/locales/server.cs.yml +++ b/config/locales/server.cs.yml @@ -480,7 +480,6 @@ cs: max_word_length: "Maximální povolená délka slova ve znacích v názvu tématu" title_min_entropy: "Minimální entropie (unikátní znaky) požadovaná v názvu tématu" body_min_entropy: "Minimální entropie (unikátní znaky) požadovaná v obsahu příspěvku" - new_user_period_days: "Jak dlouho je uživatel zvýrazněn jako nový, ve dnech" title_fancy_entities: "Převádět HTML entity v názvech témat" diff --git a/config/locales/server.da.yml b/config/locales/server.da.yml index 4b72104dc4..4ba9e113c3 100644 --- a/config/locales/server.da.yml +++ b/config/locales/server.da.yml @@ -417,7 +417,6 @@ da: max_word_length: "The maximum allowed word length, in characters, in a topic title" title_min_entropy: "The minimum allowed entropy (unique characters) required for a topic title" body_min_entropy: "The minimum allowed entropy (unique characters) required for a post body" - new_user_period_days: "How long a user is highlighted as being new, in days" title_fancy_entities: "Convert fancy HTML entities in topic titles" min_title_similar_length: "The minimum length of a title before it will be checked for similar topics" diff --git a/config/locales/server.de.yml b/config/locales/server.de.yml index 41154affbd..887202b919 100644 --- a/config/locales/server.de.yml +++ b/config/locales/server.de.yml @@ -439,7 +439,6 @@ de: max_word_length: "Maximale Wortlänge in Zeichen in Thementiteln." title_min_entropy: "Minimal nötige Entropie (einzigartige Zeichen) in einem Thementitel." body_min_entropy: "Minimal nötige Entropie (einzigartige Zeichen) in einem Beitragstext." - new_user_period_days: "Tage, die ein Nutzer als neu hervorgehoben wird." title_fancy_entities: "Konvertiere HTML-Entitys in Thementiteln." diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 26022c77c6..910af47e09 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -450,7 +450,6 @@ en: max_word_length: "The maximum allowed word length, in characters, in a topic title" title_min_entropy: "The minimum allowed entropy (unique characters) required for a topic title" body_min_entropy: "The minimum allowed entropy (unique characters) required for a post body" - new_user_period_days: "How long a user is highlighted as being new, in days" title_fancy_entities: "Convert fancy HTML entities in topic titles" diff --git a/config/locales/server.es.yml b/config/locales/server.es.yml old mode 100644 new mode 100755 index 6f563c5499..048e84ac4c --- a/config/locales/server.es.yml +++ b/config/locales/server.es.yml @@ -407,7 +407,6 @@ es: max_word_length: "The maximum allowed word length, in characters, in a topic title" title_min_entropy: "The minimum allowed entropy (unique characters) required for a topic title" body_min_entropy: "The minimum allowed entropy (unique characters) required for a post body" - new_user_period_days: "How long a user is highlighted as being new, in days" title_fancy_entities: "Convert fancy HTML entities in topic titles" notification_types: diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index 7cedb7b021..37bcace2f4 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -455,7 +455,6 @@ fr: max_word_length: "Le nombre maximum de mots dans un titre de discussion" title_min_entropy: "L'entropie minimale (ie. nombre de caractères) d'un titre de discussion" body_min_entropy: "L'entropie minimale (ie. nombre de caractères) du contenu d'un message" - new_user_period_days: "Combien de temps en jours, un utilisateur est-il consideré comme nouveau." title_fancy_entities: "Convertir les entitées HTML dans les titres des discussion" min_title_similar_length: "La taille minimale du titre avant que l'on vérifie l'existence de discussions identiques" diff --git a/config/locales/server.id.yml b/config/locales/server.id.yml index 04be2caf91..24393d944b 100644 --- a/config/locales/server.id.yml +++ b/config/locales/server.id.yml @@ -422,7 +422,6 @@ id: max_word_length: "The maximum allowed word length, in characters, in a topic title" title_min_entropy: "The minimum allowed entropy (unique characters) required for a topic title" body_min_entropy: "The minimum allowed entropy (unique characters) required for a post body" - new_user_period_days: "How long a user is highlighted as being new, in days" title_fancy_entities: "Convert fancy HTML entities in topic titles" min_title_similar_length: "The minimum length of a title before it will be checked for similar topics" diff --git a/config/locales/server.it.yml b/config/locales/server.it.yml index 779b84243b..802ddbf05b 100644 --- a/config/locales/server.it.yml +++ b/config/locales/server.it.yml @@ -423,7 +423,6 @@ it: max_word_length: "Numero massimo di caratteri che compongono una parola del titolo di un topic" title_min_entropy: "Entropia (caratteri unici) richiesta per il titolo di un topic" body_min_entropy: "Entropia (caratteri unici) richiesta per il contenuto di un post" - new_user_period_days: "Per quanti giorni un utente è considerato 'nuovo'" title_fancy_entities: "Converti caratteri HTML strani nei titoli dei topic" min_title_similar_length: "Lunghezza minima di un titolo per attivare il controllo su topic simili" diff --git a/config/locales/server.nl.yml b/config/locales/server.nl.yml index 84963683ae..fa6fd5ced7 100644 --- a/config/locales/server.nl.yml +++ b/config/locales/server.nl.yml @@ -342,8 +342,6 @@ nl: title_min_entropy: "De minimale entropie die een topictitel moet bevatten" body_min_entropy: "De minimale entropie die de inhoud van een post moet bevatten" - new_user_period_days: "Hoe lang een gebruiker als nieuw wordt aangetoond, in dagen." - notification_types: diff --git a/config/locales/server.pseudo.yml b/config/locales/server.pseudo.yml index 1c8831b680..7c17695c4b 100644 --- a/config/locales/server.pseudo.yml +++ b/config/locales/server.pseudo.yml @@ -11,6 +11,10 @@ pseudo: via: '[[ %{username} νíá %{site_name} ]]' is_reserved: '[[ íš řéšéřνéď ]]' too_many_mentions: + zero: '[[ Šóřřý, ýóů čáɳ''ť ɱéɳťíóɳ óťĥéř ůšéřš. ]]' + one: '[[ Šóřřý, ýóů čáɳ óɳłý ɱéɳťíóɳ óɳé óťĥéř ůšéř íɳ á ƿóšť. ]]' + other: '[[ Šóřřý, ýóů čáɳ óɳłý ɱéɳťíóɳ %{count} ůšéřš íɳ á ƿóšť. ]]' + too_many_mentions_visitor: zero: '[[ Šóřřý, νíšíťóřš čáɳ''ť ɱéɳťíóɳ óťĥéř ůšéřš. ]]' one: '[[ Šóřřý, νíšíťóřš čáɳ óɳłý ɱéɳťíóɳ óɳé óťĥéř ůšéř íɳ á ƿóšť. ]]' other: '[[ Šóřřý, νíšíťóřš čáɳ óɳłý ɱéɳťíóɳ %{count} ůšéřš íɳ á ƿóšť. ]]' @@ -523,8 +527,6 @@ pseudo: ƒóř á ťóƿíč ťíťłé ]]' body_min_entropy: '[[ Ťĥé ɱíɳíɱůɱ áłłóŵéď éɳťřóƿý (ůɳíƣůé čĥářáčťéřš) řéƣůířéď ƒóř á ƿóšť ƀóďý ]]' - new_user_period_days: '[[ Ĥóŵ łóɳǧ á ůšéř íš ĥíǧĥłíǧĥťéď áš ƀéíɳǧ ɳéŵ, íɳ ďáýš - ]]' title_fancy_entities: '[[ Čóɳνéřť ƒáɳčý ĤŤϺŁ éɳťíťíéš íɳ ťóƿíč ťíťłéš ]]' min_title_similar_length: '[[ Ťĥé ɱíɳíɱůɱ łéɳǧťĥ óƒ á ťíťłé ƀéƒóřé íť ŵíłł ƀé čĥéčǩéď ƒóř šíɱíłář ťóƿíčš ]]' diff --git a/config/locales/server.pt.yml b/config/locales/server.pt.yml index 74a2665ab7..d477a2e017 100644 --- a/config/locales/server.pt.yml +++ b/config/locales/server.pt.yml @@ -348,8 +348,6 @@ pt: title_min_entropy: "The minimum entropy for a topic title" body_min_entropy: "The minimum entropy for post body" - new_user_period_days: "How long a user is highlighted as being new, in days." - notification_types: mentioned: "%{display_username} mencionou-te em %{link}" liked: "%{display_username} gostou do teu post em %{link}" diff --git a/config/locales/server.sv.yml b/config/locales/server.sv.yml index 2edeac5aa9..d14ef6eb57 100644 --- a/config/locales/server.sv.yml +++ b/config/locales/server.sv.yml @@ -422,7 +422,6 @@ sv: max_word_length: "The maximum allowed word length, in characters, in a topic title" title_min_entropy: "The minimum allowed entropy (unique characters) required for a topic title" body_min_entropy: "The minimum allowed entropy (unique characters) required for a post body" - new_user_period_days: "How long a user is highlighted as being new, in days" title_fancy_entities: "Convert fancy HTML entities in topic titles" min_title_similar_length: "The minimum length of a title before it will be checked for similar topics" diff --git a/config/locales/server.zh_CN.yml b/config/locales/server.zh_CN.yml index 77497870a0..f07586720e 100644 --- a/config/locales/server.zh_CN.yml +++ b/config/locales/server.zh_CN.yml @@ -431,7 +431,6 @@ zh_CN: max_word_length: "在主题的标题中,允许的词语长度的最大字符数" title_min_entropy: "在主题的标题中,允许的最低熵值(单个字符)" body_min_entropy: "在一个帖子内文中,允许的最低熵值(单个字符)" - new_user_period_days: "在多少天以内一个用户会被高亮显示为新用户" title_fancy_entities: "转换主题标题中的 HTML 实体" min_title_similar_length: "开始检查相似主题的帖子标题的最小长度" diff --git a/config/locales/server.zh_TW.yml b/config/locales/server.zh_TW.yml index d67d0a6c3a..5ad832a354 100644 --- a/config/locales/server.zh_TW.yml +++ b/config/locales/server.zh_TW.yml @@ -431,7 +431,6 @@ zh_TW: max_word_length: "在主題的標題中,允許的詞語長度的最大字符數" title_min_entropy: "在主題的標題中,允許的最低熵值(單個字符)" body_min_entropy: "在一個帖子內文中,允許的最低熵值(單個字符)" - new_user_period_days: "在多少天以內一個用戶會被高亮顯示爲新用戶" title_fancy_entities: "轉換主題標題中的 HTML 實體" min_title_similar_length: "開始檢查相似主題的帖子標題的最小長度"