From aab3eaccaaab5cc58c6096275afd09240ef973e3 Mon Sep 17 00:00:00 2001 From: snowfag Date: Mon, 22 May 2017 12:58:09 -0400 Subject: [PATCH] Spruce up comments. --- nyaa/models.py | 2 +- nyaa/static/css/main.css | 23 +++++++++++++++ nyaa/templates/view.html | 62 ++++++++++++++++++---------------------- 3 files changed, 52 insertions(+), 35 deletions(-) diff --git a/nyaa/models.py b/nyaa/models.py index 2f6d730..1e1e8dc 100644 --- a/nyaa/models.py +++ b/nyaa/models.py @@ -394,7 +394,7 @@ class User(db.Model): def gravatar_url(self): # from http://en.gravatar.com/site/implement/images/python/ - size = 40 + size = 120 # construct the url gravatar_url = 'https://www.gravatar.com/avatar/' + \ hashlib.md5(self.email.encode('utf-8').lower()).hexdigest() + '?' diff --git a/nyaa/static/css/main.css b/nyaa/static/css/main.css index 07e5a6a..46390ff 100644 --- a/nyaa/static/css/main.css +++ b/nyaa/static/css/main.css @@ -218,3 +218,26 @@ table.torrent-list tbody tr td a:visited { ul.nav-tabs#profileTabs { margin-bottom: 15px; } + +.comments-panel { + width: 99%; + margin: 0 auto; + margin-top:10px; + margin-bottom:10px; +} + +.comment-box { + width: 95%; + margin: 0 auto; + margin-top:30px; + margin-bottom:10px; +} + +.delete-btn { + position: relative; + float: right; +} + +.avatar { + max-width: 120px; +} diff --git a/nyaa/templates/view.html b/nyaa/templates/view.html index 68471d7..f651f71 100644 --- a/nyaa/templates/view.html +++ b/nyaa/templates/view.html @@ -137,34 +137,29 @@ {% for comment in comments %} -
-
-
-
-

- {% set user_url = torrent.user and url_for('view_user', user_name=comment.user.username) %} - {{ comment.user.username }} - {% if comment.user.id == torrent.uploader_id and not torrent.anonymous %} - (uploader) - {% endif %} -

-

{{ comment.user.userlevel_str }}

-

- -

- {% if g.user.is_moderator or g.user.id == comment.user_id %} -
-
- -
-
+
+
+
+

+ {% set user_url = torrent.user and url_for('view_user', user_name=comment.user.username) %} + {{ comment.user.username }} + {% if comment.user.id == torrent.uploader_id and not torrent.anonymous %} + (uploader) + {% endif %} +

+

{{ comment.user.userlevel_str }}

+

+ +

+
+
+
+ {{comment.created_time | timesince}} + {% if g.user.is_moderator or g.user.id == comment.user_id %} +
Delete
{% endif %} -
-
- {{comment.created_time | timesince}}

+
{# Escape newlines into html entities because CF strips blank newlines #}
{{ comment.text }}
@@ -180,16 +175,15 @@ target.innerHTML = writer.render(parsed); {% endfor %} + {% if g.user %} +
+ {{ form.csrf_token }} + {{ render_field(form.comment, class_='form-control') }} + +
+ {% endif %}
-{% if g.user %} -
- {{ form.csrf_token }} - {{ render_field(form.comment, class_='form-control') }} - -
-{% endif %} -