#todo: temporary thing, for now lets just assume that the site owner will always be the first user of the application
return self.id == 1
+ @property
+ def decorated_name(self):
+ if settings.SHOW_STATUS_DIAMONDS:
+ if self.is_superuser:
+ return u"%s \u2666\u2666" % self.username
+
+ if self.is_staff:
+ return u"%s \u2666" % self.username
+
+ return self.username
+
@property
def gravatar(self):
return md5(self.email).hexdigest()
try:
all.append(__import__('%s.%s' % (m.__name__, script_name), globals(), locals(), [m.__name__]))
except ImportError, e:
- #repr(type(e)) + m.__name__ + ":" + str(e)
+ #print repr(type(e)) + m.__name__ + ":" + str(e)
pass
except:
pass
help_text = _("A comma separated list of disabled usernames (usernames not allowed during a new user registration)."),
widget=CommaStringListWidget))
+SHOW_STATUS_DIAMONDS = Setting('SHOW_STATUS_DIAMONDS', True, USERS_SET, dict(
+label=_("Show status diamonds"),
+help_text = _("Show status \"diamonds\" next to moderators or superusers usernames.")
+))
+
EMAIL_UNIQUE = Setting('EMAIL_UNIQUE', True, USERS_SET, dict(
label = _("Force unique email"),
help_text = _("Should each user have an unique email.")))
WARN_PENDING_POSTS_MINUTES = Setting('WARN_PENDING_POSTS_MINUTES', 15, USERS_SET, dict(
label=_("Warn about pending posts afer X minutes"),
help_text=_("How much time in minutes a user that just logged in or validated his email should be warned about a pending post instead of publishing it automatically.")
-))
\ No newline at end of file
+))
+
<strong>{% diff_date node.added_at %}</strong>
</p>
{% gravatar node.author 32 %}
- <p><a {% if node.author.is_suspended %}class="suspended-user" {% endif %}href="{{ node.author.get_profile_url }}">{{ node.author.username }}</a><br/>
+ <p><a {% if node.author.is_suspended %}class="suspended-user" {% endif %}href="{{ node.author.get_profile_url }}">{{ node.author.decorated_name }}</a><br/>
{% get_score_badge node.author %}</p>
</div>
{% if node.last_edited %}
</p>
{% ifnotequal node.author node.last_edited.by %}
{% gravatar node.last_edited.by 32 %}
- <p><a {% if node.last_edited.by.is_suspended %}class="suspended-user" {% endif %}href="{{ node.last_edited.by.get_profile_url }}">{{ node.last_edited.by.username }}</a><br/>
+ <p><a {% if node.last_edited.by.is_suspended %}class="suspended-user" {% endif %}href="{{ node.last_edited.by.get_profile_url }}">{{ node.last_edited.by.decorated_name }}</a><br/>
{% get_score_badge node.last_edited.by %}</p>
{% endifnotequal %}
</div>
{% load user_tags %}
<div id="subheader" class="headUser{% if view_user.is_suspended %} suspended-user{% endif %}">
- {{view_user.username}}
+ {{view_user.decorated_name}}
</div>
<table class="user-info-table">
<tr>
{% ifequal format "full" %}\r
\r
{% else %}\r
- <a href="{{ user.get_absolute_url }}">{{ user.username }}</a>\r
+ <a href="{{ user.get_absolute_url }}">{{ user.decorated_name }}</a>\r
<span class="score" title="{{ user.reputation }} {% trans "reputation" %}">{{ user.reputation }}</span>\r
{% ifequal format "badges" %}\r
{% if user.gold %}\r
{% endifequal %}\r
{% endifequal %}\r
{% else %}\r
- <a class="suspended-user" href="{{ user.get_absolute_url }}">{{ user.username }}</a>{% trans "(suspended)" %}\r
+ <a class="suspended-user" href="{{ user.get_absolute_url }}">{{ user.decorated_name }}</a>{% trans "(suspended)" %}\r
{% endif %}\r
{% endspaceless %}\r