diff --git a/funding/orm/orm.py b/funding/orm/orm.py index 66af310..7d7b5e1 100644 --- a/funding/orm/orm.py +++ b/funding/orm/orm.py @@ -379,6 +379,10 @@ class Comment(base): ix_comment_replied_to = sa.Index("ix_comment_replied_to", replied_to) ix_comment_proposal_id = sa.Index("ix_comment_proposal_id", proposal_id) + @property + def message_html(self): + return [line for line in self.message.strip().split('\r\n') if line] + @property def ago(self): from funding.bin.utils_time import TimeMagic diff --git a/funding/routes.py b/funding/routes.py index d96ca25..26e7a87 100644 --- a/funding/routes.py +++ b/funding/routes.py @@ -249,8 +249,7 @@ def donate(): if not data: daemon = Daemon(url=settings.RPC_LOCATION_DEVFUND, username=settings.RPC_USERNAME_DEVFUND, - password=settings.RPC_PASSWORD_DEVFUND - ) + password=settings.RPC_PASSWORD_DEVFUND) txs_in = daemon.get_transfers_in_simple() if not txs_in['txs']: @@ -263,7 +262,7 @@ def donate(): tx['datetime'] = dateutil_parse(tx['datetime']) txs_in = data - return make_response(render_template('devfund.html', txs_in=txs_in)) + return make_response(render_template('donate.html', txs_in=txs_in)) @app.route('/register', methods=['GET', 'POST']) diff --git a/funding/static/css/wow.css b/funding/static/css/wow.css index e6b5d74..69d4602 100644 --- a/funding/static/css/wow.css +++ b/funding/static/css/wow.css @@ -432,7 +432,7 @@ span.username a{ .comment-container a.reply{ margin-bottom:2px; - font-family: Verdana, Geneva, sans-serif; + font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; font-size: 11pt; text-decoration: underline; color: black; @@ -652,4 +652,17 @@ ul.b { .container>.content h3, .container>.content h4{ margin-bottom:20px; +} + + +.comment-container .media-body span.body { + word-wrap: break-word; + display: block; + margin-top: 4px; + margin-bottom: 4px; +} + +.comment-container .media-body span.body img { + margin-top:10px; + margin-bottom:10px; } \ No newline at end of file diff --git a/funding/static/reply.png b/funding/static/reply.png new file mode 100644 index 0000000..2447b6a Binary files /dev/null and b/funding/static/reply.png differ diff --git a/funding/templates/devfund.html b/funding/templates/donate.html similarity index 94% rename from funding/templates/devfund.html rename to funding/templates/donate.html index bf590b9..c4f9efb 100644 --- a/funding/templates/devfund.html +++ b/funding/templates/donate.html @@ -6,7 +6,7 @@

Development Fund

- Ongoing development is supported by donations and sponsorships *cough*. + Ongoing development is supported by donations.

diff --git a/funding/templates/proposal/macros/comment.html b/funding/templates/proposal/macros/comment.html index 98e50cc..4b1714b 100644 --- a/funding/templates/proposal/macros/comment.html +++ b/funding/templates/proposal/macros/comment.html @@ -17,11 +17,21 @@ {{c.date_added.strftime('%Y-%m-%d %H:%M')}} -
- {{c.message}} -
+ + + + {% for line in c.message_html %} + {{line}} + {% if loop.index != c.message_html|length %} +
+ {% endif %} + {% endfor %} +
+ {% if not c.automated %} - reply + + reply + {% endif %} {% for _c in c.comments %} @@ -45,9 +55,14 @@ {{_c.date_added.strftime('%Y-%m-%d %H:%M')}} -
- - {{_c.message}} + + + {% for line in _c.message_html %} + {{line}} + {% if loop.index != _c.message_html|length %} +
+ {% endif %} + {% endfor %}
diff --git a/funding/templates/proposal/proposal.html b/funding/templates/proposal/proposal.html index bff2ed4..1fc1e5c 100644 --- a/funding/templates/proposal/proposal.html +++ b/funding/templates/proposal/proposal.html @@ -243,9 +243,6 @@ // convert images to let html = obj.html(); let uid = obj.attr('data-id'); - if(uid == 30){ - debugger; - } var matches = html.match(regexp_imgur) || []; matches = matches.concat(html.match(regexp_imgflip)); @@ -253,7 +250,7 @@ matches.filter(function (value, index, self) { return self.indexOf(value) === index && typeof value === 'string'; }).forEach(function (obj) { - html = html.replace(new RegExp(obj, 'g'), `

`) + html = html.replace(new RegExp(obj, 'g'), ``) }); } obj.html(html);