mirror of
https://git.wownero.com/wownero/wownero-funding-system.git
synced 2024-08-15 00:53:45 +00:00
Jinja2 macro for comments
This commit is contained in:
parent
8cfa556c04
commit
e3d2834ea6
1 changed files with 57 additions and 0 deletions
57
funding/templates/proposal/macros/comment.html
Normal file
57
funding/templates/proposal/macros/comment.html
Normal file
|
@ -0,0 +1,57 @@
|
|||
{% macro comment_entry(c, proposal) %}
|
||||
<div class="media mb-4 comment-container" id="comment-{{c.id}}">
|
||||
<div class="votearrow" title="upvote"></div>
|
||||
<div class="media-body">
|
||||
<span class="username">
|
||||
<a href="/user/{{ c.user.username }}">
|
||||
{{c.user.username}}
|
||||
{% if c.user.username == proposal.user.username %}
|
||||
<small>[op]</small>
|
||||
{% endif %}
|
||||
{% if c.user.admin %}
|
||||
<small>[admin]</small>
|
||||
{% endif %}
|
||||
</a>
|
||||
</span>
|
||||
<span class="date_posted">
|
||||
<a href="/proposal/{{proposal.id}}#comment-{{c.id}}">
|
||||
{{c.date_added.strftime('%Y-%m-%d %H:%M')}}
|
||||
</a>
|
||||
</span><br>
|
||||
<span data-id="{{c.id}}" class="body" style="{% if c.automated %}color:blue;{% endif %};word-break: break-all;">{{c.message}}</span>
|
||||
<br>
|
||||
{% if not c.automated %}
|
||||
<a class="reply" href="{{url_for('propsal_comment_reply', cid=c.id, pid=proposal.id)}}">reply</a>
|
||||
{% endif %}
|
||||
|
||||
{% for _c in c.comments %}
|
||||
<div class="media mt-4 comment-container" id="comment-{{_c.id}}">
|
||||
<div class="votearrow" title="upvote"></div>
|
||||
<div class="media-body" id="comment">
|
||||
<span class="username">
|
||||
<a href="/user/{{ _c.user.username }}">
|
||||
{{_c.user.username}}
|
||||
{% if _c.user.username == proposal.user.username %}
|
||||
<small>[op]</small>
|
||||
{% endif %}
|
||||
{% if _c.user.admin %}
|
||||
<small>[admin]</small>
|
||||
{% endif %}
|
||||
|
||||
</a>
|
||||
</span>
|
||||
<span class="date_posted">
|
||||
<a href="/proposal/{{proposal.id}}#comment-{{_c.id}}">
|
||||
{{_c.date_added.strftime('%Y-%m-%d %H:%M')}}
|
||||
</a>
|
||||
</span>
|
||||
<br>
|
||||
<span data-id="{{_c.id}}" class="body" style="word-break: break-all;">
|
||||
{{_c.message}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
Loading…
Reference in a new issue