summaryrefslogtreecommitdiffstats
path: root/adenosine-pds/templates/macro.html
blob: 1a8f5c5e84f1a5cf23a3929d15a9d34c965357ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

{% macro feed_item(item) %}

<div class="feed_item">
{# TODO: handle both thread items and feed items
{% if item.repostedBy.is_some() %}
  {% if item.author.displayName.is_some() %}{{ item.author.displayName.as_ref().unwrap() }}{% endif %}
  <b>@{{ item.author.handle }}</b>
{% endif %}
#}

<div style="float: right;">
  <a class="item_timestamp" href="/u/{{ item.author.handle }}/post/{{ item.uri|aturi_to_tid }}">
    {% if item.record["createdAt"].as_str().is_some() %}
      {{ item.record["createdAt"].as_str().unwrap() }}
    {% else %}
      {{ item.indexedAt }}
    {% endif %}
  </a>
</div>


{% if item.author.displayName.is_some() %}
  <a href="/u/{{ item.author.handle }}"><span class="display_name">{{ item.author.displayName.as_ref().unwrap() }}</span></a>
{% endif %}
<a href="/u/{{ item.author.handle }}"><span class="handle">@{{ item.author.handle }}</span></a>
<br>
{{ item.record["text"].as_str().unwrap() }}
<br>
<span class="counts">
  [<a href="#">{{ item.likeCount }} like</a> / <a href="#">{{ item.repostCount }} repost</a> / <a href="#">{{ item.replyCount }} reply</a>]
  <a href="{{ item.uri|aturi_to_path }}" class="pink">[inspect]</a>
</span>

{% if item.record.get("reply").is_some() %}
<br>
<b style="color: orange;">reply to:</b> <a href="{{ item.record["reply"]["uri"].as_str().unwrap()|aturi_to_thread_path }}">{{ item.record["reply"]["uri"] }}</a>
{% endif %}

<!-- TODO: "reposted by" -->
<!-- TODO: "reply to" -->

</div>
{% endmacro %}