mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 08:40:00 +00:00
Minor improvements
This commit is contained in:
parent
2cd2dbf66d
commit
0bcd782695
|
@ -525,8 +525,10 @@ class User(db.Model):
|
||||||
return 'User'
|
return 'User'
|
||||||
elif self.level == UserLevelType.TRUSTED:
|
elif self.level == UserLevelType.TRUSTED:
|
||||||
return 'Trusted'
|
return 'Trusted'
|
||||||
elif self.level >= UserLevelType.MODERATOR:
|
elif self.level == UserLevelType.MODERATOR:
|
||||||
return 'Moderator'
|
return 'Moderator'
|
||||||
|
elif self.level >= UserLevelType.SUPERADMIN:
|
||||||
|
return 'Administrator'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def userstatus_str(self):
|
def userstatus_str(self):
|
||||||
|
|
|
@ -251,18 +251,24 @@ ul.nav-tabs#profileTabs {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
.comment-panel .panel-body {
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
.comment-panel .col-md-2 p {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
.comment-panel:target {
|
.comment-panel:target {
|
||||||
border-color: black;
|
border-color: black;
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-purple, a.text-purple:visited {
|
.text-purple, a.text-purple:visited {
|
||||||
color: #a760bc;
|
color: #a760bc;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.text-purple:hover, a.text-purple:active, a.text-purple:focus {
|
a.text-purple:hover, a.text-purple:active, a.text-purple:focus {
|
||||||
color: #a760e0;
|
color: #a760e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-content {
|
.comment-content {
|
||||||
|
@ -385,13 +391,13 @@ h6:hover .header-anchor {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#navFilter-criteria > .bootstrap-select:first-child > button {
|
#navFilter-criteria > .bootstrap-select:first-child > button {
|
||||||
/* !important is used here to override the programmatically added style on element */
|
/* !important is used here to override the programmatically added style on element */
|
||||||
border-top-left-radius: 0 !important;
|
border-top-left-radius: 0 !important;
|
||||||
border-bottom-left-radius: 0 !important;
|
border-bottom-left-radius: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-container > .search-bar {
|
.search-container > .search-bar {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<dt>Email address:</dt>
|
<dt>Email address:</dt>
|
||||||
<dd>{{ user.email }}</dd>
|
<dd>{{ user.email }}</dd>
|
||||||
<dt>User class:</dt>
|
<dt>User class:</dt>
|
||||||
<dd>{{ level }}</dd>
|
<dd>{{ user.userlevel_str }}</dd>
|
||||||
<dt>User status:</dt>
|
<dt>User status:</dt>
|
||||||
<dd>{{ user.userstatus_str }}</dt>
|
<dd>{{ user.userstatus_str }}</dt>
|
||||||
{%- if g.user.is_superadmin -%}
|
{%- if g.user.is_superadmin -%}
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
Browsing <span class="text-{{ user.userlevel_color }}">{{ user.username }}</span>'{{ '' if user.username[-1] == 's' else 's' }} torrents
|
Browsing <span class="text-{{ user.userlevel_color }}" data-toggle="tooltip" title="{{ user.userlevel_str }}">{{ user.username }}</span>'{{ '' if user.username[-1] == 's' else 's' }} torrents
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
{% include "search_results.html" %}
|
{% include "search_results.html" %}
|
||||||
|
|
|
@ -31,9 +31,9 @@
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
{% set user_url = torrent.user and url_for('users.view_user', user_name=torrent.user.username) %}
|
{% set user_url = torrent.user and url_for('users.view_user', user_name=torrent.user.username) %}
|
||||||
{%- if not torrent.anonymous and torrent.user -%}
|
{%- if not torrent.anonymous and torrent.user -%}
|
||||||
<a class="text-{{ torrent.user.userlevel_color }}" href="{{ user_url }}">{{ torrent.user.username }}</a>
|
<a class="text-{{ torrent.user.userlevel_color }}" href="{{ user_url }}" data-toggle="tooltip" title="{{ torrent.user.userlevel_str }}">{{ torrent.user.username }}</a>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
Anonymous {% if torrent.user and (g.user == torrent.user or g.user.is_moderator) %}(<a href="{{ user_url }}">{{ torrent.user.username }}</a>){% endif %}
|
Anonymous {% if torrent.user and (g.user == torrent.user or g.user.is_moderator) %}(<a class="text-{{ torrent.user.userlevel_color }}" href="{{ user_url }}" data-toggle="tooltip" title="{{ torrent.user.userlevel_str }}">{{ torrent.user.username }}</a>){% endif %}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{% if g.user and g.user.is_superadmin and torrent.uploader_ip %}
|
{% if g.user and g.user.is_superadmin and torrent.uploader_ip %}
|
||||||
({{ torrent.uploader_ip_string }})
|
({{ torrent.uploader_ip_string }})
|
||||||
|
@ -145,12 +145,12 @@
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<p>
|
<p>
|
||||||
<a class="text-{{ comment.user.userlevel_color }}" href="{{ url_for('users.view_user', user_name=comment.user.username) }}">{{ comment.user.username }}</a>
|
<a class="text-{{ comment.user.userlevel_color }}" href="{{ url_for('users.view_user', user_name=comment.user.username) }}" data-toggle="tooltip" title="{{ comment.user.userlevel_str }}">{{ comment.user.username }}</a>
|
||||||
{% if comment.user.id == torrent.uploader_id and not torrent.anonymous %}
|
{% if comment.user.id == torrent.uploader_id and not torrent.anonymous %}
|
||||||
(uploader)
|
(uploader)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p><img class="avatar" src="{{ comment.user.gravatar_url() }}" alt="{{ comment.user.userlevel_str }}"></p>
|
<img class="avatar" src="{{ comment.user.gravatar_url() }}" alt="{{ comment.user.userlevel_str }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -53,8 +53,6 @@ def view_user(user_name):
|
||||||
|
|
||||||
return flask.redirect(url)
|
return flask.redirect(url)
|
||||||
|
|
||||||
user_level = ['Regular', 'Trusted', 'Moderator', 'Administrator'][user.level]
|
|
||||||
|
|
||||||
req_args = flask.request.args
|
req_args = flask.request.args
|
||||||
|
|
||||||
search_term = chain_get(req_args, 'q', 'term')
|
search_term = chain_get(req_args, 'q', 'term')
|
||||||
|
@ -119,7 +117,6 @@ def view_user(user_name):
|
||||||
user=user,
|
user=user,
|
||||||
user_page=True,
|
user_page=True,
|
||||||
rss_filter=rss_query_string,
|
rss_filter=rss_query_string,
|
||||||
level=user_level,
|
|
||||||
admin_form=admin_form)
|
admin_form=admin_form)
|
||||||
# Similar logic as home page
|
# Similar logic as home page
|
||||||
else:
|
else:
|
||||||
|
@ -135,7 +132,6 @@ def view_user(user_name):
|
||||||
user=user,
|
user=user,
|
||||||
user_page=True,
|
user_page=True,
|
||||||
rss_filter=rss_query_string,
|
rss_filter=rss_query_string,
|
||||||
level=user_level,
|
|
||||||
admin_form=admin_form)
|
admin_form=admin_form)
|
||||||
|
|
||||||
|
|
||||||
|
@ -166,9 +162,10 @@ def _create_user_class_choices(user):
|
||||||
if flask.g.user:
|
if flask.g.user:
|
||||||
if flask.g.user.is_moderator:
|
if flask.g.user.is_moderator:
|
||||||
choices.append(('trusted', 'Trusted'))
|
choices.append(('trusted', 'Trusted'))
|
||||||
choices.append(('banned', 'Banned'))
|
|
||||||
if flask.g.user.is_superadmin:
|
if flask.g.user.is_superadmin:
|
||||||
choices.append(('moderator', 'Moderator'))
|
choices.append(('moderator', 'Moderator'))
|
||||||
|
if flask.g.user.is_moderator:
|
||||||
|
choices.append(('banned', 'Banned'))
|
||||||
|
|
||||||
if user:
|
if user:
|
||||||
if user.is_moderator:
|
if user.is_moderator:
|
||||||
|
|
Loading…
Reference in a new issue