trust level 0 is highlighted in light gray as opposed to having special semantics around account age.

This commit is contained in:
Sam 2013-04-04 12:24:10 +11:00
parent 9068fdae99
commit 86cf7b1524
18 changed files with 21 additions and 28 deletions

View file

@ -8,6 +8,11 @@
**/ **/
Discourse.Post = Discourse.Model.extend({ Discourse.Post = Discourse.Model.extend({
new_user:(function(){
return this.get('trust_level') === 0;
}).property('trust_level'),
url: (function() { url: (function() {
return Discourse.Utilities.postUrl(this.get('topic.slug') || this.get('topic_slug'), this.get('topic_id'), this.get('post_number')); 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'), }).property('post_number', 'topic_id', 'topic.slug'),

1
app/models/site_setting.rb Normal file → Executable file
View file

@ -157,7 +157,6 @@ class SiteSetting < ActiveRecord::Base
setting(:body_min_entropy, 7) setting(:body_min_entropy, 7)
setting(:max_word_length, 30) setting(:max_word_length, 30)
setting(:new_user_period_days, 2)
setting(:visitor_max_links, 2) setting(:visitor_max_links, 2)
setting(:visitor_max_images, 0) setting(:visitor_max_images, 0)

13
app/serializers/post_serializer.rb Normal file → Executable file
View file

@ -37,21 +37,16 @@ class PostSerializer < ApplicationSerializer
:bookmarked, :bookmarked,
:raw, :raw,
:actions_summary, :actions_summary,
:new_user?,
:moderator?, :moderator?,
:avatar_template, :avatar_template,
:user_id, :user_id,
:draft_sequence, :draft_sequence,
:hidden, :hidden,
:hidden_reason_id, :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? def moderator?
object.user.moderator? object.user.moderator?
end end
@ -128,6 +123,10 @@ class PostSerializer < ApplicationSerializer
object.user.name object.user.name
end end
def trust_level
object.user.trust_level
end
def reply_to_user def reply_to_user
{ {
username: object.reply_to_user.username, username: object.reply_to_user.username,

View file

@ -388,6 +388,9 @@ pseudo:
unread: '[[ Ťĥéřé ářé ɳó ɱóřé ůɳřéáď ťóƿíčš ťó řéáď. ]]' unread: '[[ Ťĥéřé ářé ɳó ɱóřé ůɳřéáď ťóƿíčš ťó řéáď. ]]'
favorited: '[[ Ťĥéřé ářé ɳó ɱóřé ƒáνóříťéď ťóƿíčš ťó řéáď. ]]' favorited: '[[ Ťĥéřé ářé ɳó ɱóřé ƒáνóříťéď ťóƿíčš ťó řéáď. ]]'
category: '[[ Ťĥéřé ářé ɳó ɱóřé {{category}} ťóƿíčš. ]]' category: '[[ Ťĥéřé ářé ɳó ɱóřé {{category}} ťóƿíčš. ]]'
rank_details:
show: '[[ šĥóŵ ťóƿíč řáɳǩ ďéťáíłš ]]'
title: '[[ Ťóƿíč Řáɳǩ Ďéťáíłš ]]'
topic: topic:
create_in: '[[ Čřéáťé {{categoryName}} Ťóƿíč ]]' create_in: '[[ Čřéáťé {{categoryName}} Ťóƿíč ]]'
create: '[[ Čřéáťé Ťóƿíč ]]' create: '[[ Čřéáťé Ťóƿíč ]]'
@ -463,8 +466,8 @@ pseudo:
ƿóšťš. ]]' ƿóšťš. ]]'
tracking: tracking:
title: '[[ Ťřáčǩíɳǧ ]]' title: '[[ Ťřáčǩíɳǧ ]]'
description: '[[ ýóů ŵíłł ƀé ɳóťíƒíéď óƒ ůɳřéáď ƿóšťš, @ɳáɱé ɱéɳťíóɳš, áɳď description: '[[ ýóů ŵíłł ƀé ɳóťíƒíéď óƒ @ɳáɱé ɱéɳťíóɳš áɳď řéƿłíéš ťó ýóůř
řéƿłíéš ťó ýóůř ƿóšťš. ]]' ƿóšťš, ƿłůš ýóů ŵíłł šéé á čóůɳť óƒ ůɳřéáď áɳď ɳéŵ ƿóšťš. ]]'
regular: regular:
title: '[[ Řéǧůłář ]]' title: '[[ Řéǧůłář ]]'
description: '[[ ýóů ŵíłł ƀé ɳóťíƒíéď óɳłý íƒ šóɱéóɳé ɱéɳťíóɳš ýóůř @ɳáɱé description: '[[ ýóů ŵíłł ƀé ɳóťíƒíéď óɳłý íƒ šóɱéóɳé ɱéɳťíóɳš ýóůř @ɳáɱé
@ -711,7 +714,7 @@ pseudo:
other: '[[ {{categoryName}} ({{count}}) ]]' other: '[[ {{categoryName}} ({{count}}) ]]'
help: '[[ łáťéšť ťóƿíčš íɳ ťĥé {{categoryName}} čáťéǧóřý ]]' help: '[[ łáťéšť ťóƿíčš íɳ ťĥé {{categoryName}} čáťéǧóřý ]]'
browser_update: '[[ Ůɳƒóřťůɳáťéłý, <á ĥřéƒ="ĥťťƿ://ŵŵŵ.ďíščóůřšé.óřǧ/ƒáƣ/#ƀřóŵšéř">ýóůř browser_update: '[[ Ůɳƒóřťůɳáťéłý, <á ĥřéƒ="ĥťťƿ://ŵŵŵ.ďíščóůřšé.óřǧ/ƒáƣ/#ƀřóŵšéř">ýóůř
ƀřóŵšéř íš ťóó ółď ťó ŵóřǩ óɳ ťĥíš Ďíščóůřšé ƒóřůɱ</á>. Рłéášé <á ĥřéƒ="%{url}">ůƿǧřáďé ƀřóŵšéř íš ťóó ółď ťó ŵóřǩ óɳ ťĥíš Ďíščóůřšé ƒóřůɱ</á>. Рłéášé <á ĥřéƒ="ĥťťƿ://ƀřóŵšéĥáƿƿý.čóɱ">ůƿǧřáďé
ýóůř ƀřóŵšéř</á>. ]]' ýóůř ƀřóŵšéř</á>. ]]'
admin_js: admin_js:
type_to_filter: '[[ ťýƿé ťó ƒíłťéř... ]]' type_to_filter: '[[ ťýƿé ťó ƒíłťéř... ]]'

1
config/locales/server.cs.yml Normal file → Executable file
View file

@ -480,7 +480,6 @@ cs:
max_word_length: "Maximální povolená délka slova ve znacích v názvu tématu" 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" 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" 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" title_fancy_entities: "Převádět HTML entity v názvech témat"

View file

@ -417,7 +417,6 @@ da:
max_word_length: "The maximum allowed word length, in characters, in a topic title" 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" 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" 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" 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" min_title_similar_length: "The minimum length of a title before it will be checked for similar topics"

View file

@ -439,7 +439,6 @@ de:
max_word_length: "Maximale Wortlänge in Zeichen in Thementiteln." max_word_length: "Maximale Wortlänge in Zeichen in Thementiteln."
title_min_entropy: "Minimal nötige Entropie (einzigartige Zeichen) in einem Thementitel." title_min_entropy: "Minimal nötige Entropie (einzigartige Zeichen) in einem Thementitel."
body_min_entropy: "Minimal nötige Entropie (einzigartige Zeichen) in einem Beitragstext." 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." title_fancy_entities: "Konvertiere HTML-Entitys in Thementiteln."

View file

@ -450,7 +450,6 @@ en:
max_word_length: "The maximum allowed word length, in characters, in a topic title" 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" 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" 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" title_fancy_entities: "Convert fancy HTML entities in topic titles"

1
config/locales/server.es.yml Normal file → Executable file
View file

@ -407,7 +407,6 @@ es:
max_word_length: "The maximum allowed word length, in characters, in a topic title" 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" 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" 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" title_fancy_entities: "Convert fancy HTML entities in topic titles"
notification_types: notification_types:

View file

@ -455,7 +455,6 @@ fr:
max_word_length: "Le nombre maximum de mots dans un titre de discussion" 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" 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" 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" 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" min_title_similar_length: "La taille minimale du titre avant que l'on vérifie l'existence de discussions identiques"

View file

@ -422,7 +422,6 @@ id:
max_word_length: "The maximum allowed word length, in characters, in a topic title" 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" 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" 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" 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" min_title_similar_length: "The minimum length of a title before it will be checked for similar topics"

View file

@ -423,7 +423,6 @@ it:
max_word_length: "Numero massimo di caratteri che compongono una parola del titolo di un topic" 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" 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" 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" 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" min_title_similar_length: "Lunghezza minima di un titolo per attivare il controllo su topic simili"

View file

@ -342,8 +342,6 @@ nl:
title_min_entropy: "De minimale entropie die een topictitel moet bevatten" 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" 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: notification_types:

View file

@ -11,6 +11,10 @@ pseudo:
via: '[[ %{username} νíá %{site_name} ]]' via: '[[ %{username} νíá %{site_name} ]]'
is_reserved: '[[ íš řéšéřνéď ]]' is_reserved: '[[ íš řéšéřνéď ]]'
too_many_mentions: too_many_mentions:
zero: '[[ Šóřřý, ýóů čáɳ''ť ɱéɳťíóɳ óťĥéř ůšéřš. ]]'
one: '[[ Šóřřý, ýóů čáɳ óɳłý ɱéɳťíóɳ óɳé óťĥéř ůšéř íɳ á ƿóšť. ]]'
other: '[[ Šóřřý, ýóů čáɳ óɳłý ɱéɳťíóɳ %{count} ůšéřš íɳ á ƿóšť. ]]'
too_many_mentions_visitor:
zero: '[[ Šóřřý, νíšíťóřš čáɳ''ť ɱéɳťíóɳ óťĥéř ůšéřš. ]]' zero: '[[ Šóřřý, νíšíťóřš čáɳ''ť ɱéɳťíóɳ óťĥéř ůšéřš. ]]'
one: '[[ Šóřřý, νíšíťóřš čáɳ óɳłý ɱéɳťíóɳ óɳé óťĥéř ůšéř íɳ á ƿóšť. ]]' one: '[[ Šóřřý, νíšíťóřš čáɳ óɳłý ɱéɳťíóɳ óɳé óťĥéř ůšéř íɳ á ƿóšť. ]]'
other: '[[ Šóřřý, νíšíťóřš čáɳ óɳłý ɱéɳťíóɳ %{count} ůšéřš íɳ á ƿóšť. ]]' other: '[[ Šóřřý, νíšíťóřš čáɳ óɳłý ɱéɳťíóɳ %{count} ůšéřš íɳ á ƿóšť. ]]'
@ -523,8 +527,6 @@ pseudo:
ƒóř á ťóƿíč ťíťłé ]]' ƒóř á ťóƿíč ťíťłé ]]'
body_min_entropy: '[[ Ťĥé ɱíɳíɱůɱ áłłóŵéď éɳťřóƿý (ůɳíƣůé čĥářáčťéřš) řéƣůířéď body_min_entropy: '[[ Ťĥé ɱíɳíɱůɱ áłłóŵéď éɳťřóƿý (ůɳíƣůé čĥářáčťéřš) řéƣůířéď
ƒóř á ƿóšť ƀóďý ]]' ƒóř á ƿóšť ƀóďý ]]'
new_user_period_days: '[[ Ĥóŵ łóɳǧ á ůšéř íš ĥíǧĥłíǧĥťéď áš ƀéíɳǧ ɳéŵ, íɳ ďáýš
]]'
title_fancy_entities: '[[ Čóɳνéřť ƒáɳčý ĤŤϺŁ éɳťíťíéš íɳ ťóƿíč ťíťłéš ]]' title_fancy_entities: '[[ Čóɳνéřť ƒáɳčý ĤŤϺŁ éɳťíťíéš íɳ ťóƿíč ťíťłéš ]]'
min_title_similar_length: '[[ Ťĥé ɱíɳíɱůɱ łéɳǧťĥ óƒ á ťíťłé ƀéƒóřé íť ŵíłł ƀé min_title_similar_length: '[[ Ťĥé ɱíɳíɱůɱ łéɳǧťĥ óƒ á ťíťłé ƀéƒóřé íť ŵíłł ƀé
čĥéčǩéď ƒóř šíɱíłář ťóƿíčš ]]' čĥéčǩéď ƒóř šíɱíłář ťóƿíčš ]]'

View file

@ -348,8 +348,6 @@ pt:
title_min_entropy: "The minimum entropy for a topic title" title_min_entropy: "The minimum entropy for a topic title"
body_min_entropy: "The minimum entropy for post body" 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: notification_types:
mentioned: "%{display_username} mencionou-te em %{link}" mentioned: "%{display_username} mencionou-te em %{link}"
liked: "%{display_username} gostou do teu post em %{link}" liked: "%{display_username} gostou do teu post em %{link}"

View file

@ -422,7 +422,6 @@ sv:
max_word_length: "The maximum allowed word length, in characters, in a topic title" 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" 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" 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" 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" min_title_similar_length: "The minimum length of a title before it will be checked for similar topics"

View file

@ -431,7 +431,6 @@ zh_CN:
max_word_length: "在主题的标题中,允许的词语长度的最大字符数" max_word_length: "在主题的标题中,允许的词语长度的最大字符数"
title_min_entropy: "在主题的标题中,允许的最低熵值(单个字符)" title_min_entropy: "在主题的标题中,允许的最低熵值(单个字符)"
body_min_entropy: "在一个帖子内文中,允许的最低熵值(单个字符)" body_min_entropy: "在一个帖子内文中,允许的最低熵值(单个字符)"
new_user_period_days: "在多少天以内一个用户会被高亮显示为新用户"
title_fancy_entities: "转换主题标题中的 HTML 实体" title_fancy_entities: "转换主题标题中的 HTML 实体"
min_title_similar_length: "开始检查相似主题的帖子标题的最小长度" min_title_similar_length: "开始检查相似主题的帖子标题的最小长度"

View file

@ -431,7 +431,6 @@ zh_TW:
max_word_length: "在主題的標題中,允許的詞語長度的最大字符數" max_word_length: "在主題的標題中,允許的詞語長度的最大字符數"
title_min_entropy: "在主題的標題中,允許的最低熵值(單個字符)" title_min_entropy: "在主題的標題中,允許的最低熵值(單個字符)"
body_min_entropy: "在一個帖子內文中,允許的最低熵值(單個字符)" body_min_entropy: "在一個帖子內文中,允許的最低熵值(單個字符)"
new_user_period_days: "在多少天以內一個用戶會被高亮顯示爲新用戶"
title_fancy_entities: "轉換主題標題中的 HTML 實體" title_fancy_entities: "轉換主題標題中的 HTML 實體"
min_title_similar_length: "開始檢查相似主題的帖子標題的最小長度" min_title_similar_length: "開始檢查相似主題的帖子標題的最小長度"