simple-web-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

comments.html (1143B)


      1 {% for comment in comments %}
      2 <div class="comment" id="comment-{{ comment.id }}" style="margin-left: {{ comment.indent_px }}px;">
      3   <div class="comment-header">
      4     <span id="vote-comment-{{ comment.id }}">
      5       {% if is_logged_in %}
      6       <button
      7         class="vote-btn comment-vote{% if comment.user_voted %} voted{% endif %}"
      8         data-on:click="@post('/vote/comment/{{ comment.id }}')"
      9       >&#9650;</button>
     10       {% endif %}
     11     </span>
     12     {% match comment.author_username %}
     13     {% when Some with (username) %}
     14     <a href="/user/{{ username }}" class="comment-author">{{ username }}</a>
     15     {% when None %}
     16     <span class="comment-author">anonymous</span>
     17     {% endmatch %}
     18     <span class="comment-score" id="score-comment-{{ comment.id }}">{{ comment.score }} point{% if comment.score != 1 %}s{% endif %}</span>
     19     <span class="comment-time">{{ comment.time_ago }}</span>
     20   </div>
     21   <div class="comment-text">
     22     {{ comment.text }}
     23   </div>
     24   <div class="comment-actions">
     25     {% if is_logged_in %}
     26     <a href="/comment/{{ comment.id }}/reply" class="comment-reply">reply</a>
     27     {% endif %}
     28   </div>
     29 </div>
     30 {% endfor %}