simple-web-app

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

story_row.html (1960B)


      1 <li class="story-item" id="story-{{ story.id }}">
      2   <div class="story-vote">
      3     <span id="vote-story-{{ story.id }}">
      4       {% if is_logged_in %}
      5       <button
      6         class="vote-btn{% if story.user_voted %} voted{% endif %}"
      7         data-on:click="@post('/vote/story/{{ story.id }}')"
      8       >&#9650;</button>
      9       {% else %}
     10       <span class="vote-placeholder">&#9650;</span>
     11       {% endif %}
     12     </span>
     13   </div>
     14   <div class="story-content">
     15     <div class="story-title">
     16       <span class="story-rank">{{ story.rank }}.</span>
     17       {% match story.url %}
     18       {% when Some with (url) %}
     19       <a href="{{ url }}" class="story-link" rel="nofollow">{{ story.title }}</a>
     20       {% match story.domain %}
     21       {% when Some with (domain) %}
     22       <span class="story-domain">(<a href="/search?q=site:{{ domain }}">{{ domain }}</a>)</span>
     23       {% when None %}
     24       {% endmatch %}
     25       {% when None %}
     26       <a href="/story/{{ story.id }}" class="story-link">{{ story.title }}</a>
     27       {% endmatch %}
     28     </div>
     29     <div class="story-meta">
     30       <span class="story-score" id="score-story-{{ story.id }}">{{ story.score }} point{% if story.score != 1 %}s{% endif %}</span>
     31       by
     32       {% match story.author_username %}
     33       {% when Some with (username) %}
     34       <a href="/user/{{ username }}" class="story-author">{{ username }}</a>
     35       {% when None %}
     36       <span class="story-author">anonymous</span>
     37       {% endmatch %}
     38       <span class="story-time">{{ story.time_ago }}</span>
     39       |
     40       <a href="/story/{{ story.id }}" class="story-comments">{{ story.comment_count }} comment{% if story.comment_count != 1 %}s{% endif %}</a>
     41       {% if !story.tags.is_empty() %}
     42       |
     43       {% for tag in story.tags %}
     44       {% match tag.name %}
     45       {% when Some with (name) %}
     46       <a href="/tag/{{ name }}" class="story-tag">{{ name }}</a>
     47       {% when None %}
     48       {% endmatch %}
     49       {% endfor %}
     50       {% endif %}
     51     </div>
     52   </div>
     53 </li>