mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-23 00:20:00 +00:00
some html + css changes around comments
This commit is contained in:
parent
f76593a3fb
commit
af61e5b1e9
|
@ -414,6 +414,15 @@ class User(db.Model):
|
||||||
elif self.level >= UserLevelType.MODERATOR:
|
elif self.level >= UserLevelType.MODERATOR:
|
||||||
return 'Moderator'
|
return 'Moderator'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def userlevel_color(self):
|
||||||
|
if self.level == UserLevelType.REGULAR:
|
||||||
|
return 'default'
|
||||||
|
elif self.level == UserLevelType.TRUSTED:
|
||||||
|
return 'success'
|
||||||
|
elif self.level >= UserLevelType.MODERATOR:
|
||||||
|
return 'purple'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ip_string(self):
|
def ip_string(self):
|
||||||
if self.last_login_ip:
|
if self.last_login_ip:
|
||||||
|
|
|
@ -824,7 +824,7 @@ def timesince(dt, default='just now'):
|
||||||
for period, singular, plural in periods:
|
for period, singular, plural in periods:
|
||||||
|
|
||||||
if period >= 1:
|
if period >= 1:
|
||||||
return '%d %s ago' % (period, singular if period == 1 else plural)
|
return '%d %s ago' % (period, singular if int(period) == 1 else plural)
|
||||||
|
|
||||||
return default
|
return default
|
||||||
|
|
||||||
|
|
|
@ -219,12 +219,27 @@ ul.nav-tabs#profileTabs {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comments-panel {
|
.comment-panel {
|
||||||
width: 99%;
|
width: 99%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
.comment-panel:target {
|
||||||
|
border-color: black;
|
||||||
|
border-width: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-purple, a.text-purple:visited { color: #a760bc; }
|
||||||
|
a.text-purple:hover, a.text-purple:active, a.text-purple:focus { color: #a760e0; }
|
||||||
|
|
||||||
|
.comment-content {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
.comment-content img {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
.comment-box {
|
.comment-box {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||||
|
|
||||||
<!-- Custom styles for this template -->
|
<!-- Custom styles for this template -->
|
||||||
<link href="/static/css/main.css" rel="stylesheet">
|
<link href="/static/css/main.css?v=2" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Core JavaScript -->
|
<!-- Core JavaScript -->
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
|
||||||
|
|
|
@ -100,7 +100,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
{%- if value is iterable %}
|
{%- if value is iterable %}
|
||||||
<td colspan="2" {% if loop.depth0 is greaterthan 0 %}style="padding-left: {{ loop.depth0 * 20 }}px"{% endif %}>
|
<td colspan="2" {% if loop.depth0 is greaterthan 0 %}style="padding-left: {{ loop.depth0 * 20 }}px"{% endif %}>
|
||||||
<i class="glyphicon glyphicon-folder-open"></i> <b>{{ key }}</b></td>
|
<i class="glyphicon glyphicon-folder-open"></i> <b>{{ key }}</b>
|
||||||
|
</td>
|
||||||
{{ loop(value.items()) }}
|
{{ loop(value.items()) }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
<td{% if loop.depth0 is greaterthan 0 %} style="padding-left: {{ loop.depth0 * 20 }}px"{% endif %}>
|
<td{% if loop.depth0 is greaterthan 0 %} style="padding-left: {{ loop.depth0 * 20 }}px"{% endif %}>
|
||||||
|
@ -137,31 +138,29 @@
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
{% for comment in comments %}
|
{% for comment in comments %}
|
||||||
<div class="panel panel-default comments-panel">
|
<div class="panel panel-default comment-panel" id="com-{{ comment.id }}">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<p>
|
<p>
|
||||||
{% set user_url = torrent.user and url_for('view_user', user_name=comment.user.username) %}
|
<a class="text-{{ comment.user.userlevel_color }}" href="{{ url_for('view_user', user_name=comment.user.username) }}">{{ comment.user.username }}</a>
|
||||||
<a href="{{ user_url }}">{{ 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>{{ comment.user.userlevel_str }}</p>
|
|
||||||
<p><img class="avatar" src="{{ comment.user.gravatar_url() }}"></p>
|
<p><img class="avatar" src="{{ comment.user.gravatar_url() }}"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<small>{{ comment.created_time | timesince }}</small>
|
<a href="#com-{{ comment.id }}"><small>{{ comment.created_time | timesince }}</small></a>
|
||||||
{% if g.user.is_moderator or g.user.id == comment.user_id %}
|
{% if g.user.is_moderator or g.user.id == comment.user_id %}
|
||||||
<form class="delete-comment-form" action="{{ url_for('delete_comment', torrent_id=torrent.id, comment_id=comment.id) }}" method="POST">
|
<form class="delete-comment-form" action="{{ url_for('delete_comment', torrent_id=torrent.id, comment_id=comment.id) }}" method="POST">
|
||||||
<button name="submit" type="submit" class="btn btn-danger btn-sm" title="Delete">Delete</button>
|
<button name="submit" type="submit" class="btn btn-danger btn-xs" title="Delete">Delete</button>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{# Escape newlines into html entities because CF strips blank newlines #}
|
{# Escape newlines into html entities because CF strips blank newlines #}
|
||||||
<div id="torrent-comment{{ comment.id }}">{{ comment.text }}</div>
|
<div class="comment-content" id="torrent-comment{{ comment.id }}">{{ comment.text }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue