simple-web-app

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

user.html (1637B)


      1 <div class="user-page">
      2   <header class="user-header">
      3     <h2>{{ profile.username }}</h2>
      4     <div class="user-stats">
      5       <span class="user-karma">{{ profile.karma }} karma</span>
      6       <span class="user-joined">joined {{ profile.created_at }}</span>
      7     </div>
      8     {% match profile.about %}
      9     {% when Some with (about) %}
     10     <div class="user-about">{{ about }}</div>
     11     {% when None %}
     12     {% endmatch %}
     13   </header>
     14 
     15   <nav class="user-tabs">
     16     <a href="/user/{{ profile.username }}?tab=submissions" class="user-tab{% if tab == "submissions" %} active{% endif %}">submissions</a>
     17     <a href="/user/{{ profile.username }}?tab=comments" class="user-tab{% if tab == "comments" %} active{% endif %}">comments</a>
     18   </nav>
     19 
     20   {% if tab == "submissions" %}
     21   <section class="user-submissions">
     22     {% if submissions.is_empty() %}
     23     <p class="empty-message">No submissions yet.</p>
     24     {% else %}
     25     <ol class="story-list">
     26       {% for story in submissions %}
     27       {% include "story_row.html" %}
     28       {% endfor %}
     29     </ol>
     30     {% endif %}
     31   </section>
     32   {% else if tab == "comments" %}
     33   <section class="user-comments">
     34     {% if comments.is_empty() %}
     35     <p class="empty-message">No comments yet.</p>
     36     {% else %}
     37     {% for comment in comments %}
     38     <div class="user-comment">
     39       <div class="user-comment-meta">
     40         <a href="/story/{{ comment.story_id }}">on story #{{ comment.story_id }}</a>
     41         <span class="comment-time">{{ comment.time_ago }}</span>
     42       </div>
     43       <div class="user-comment-text">{{ comment.text }}</div>
     44     </div>
     45     {% endfor %}
     46     {% endif %}
     47   </section>
     48   {% endif %}
     49 </div>