-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrss_template.html
82 lines (76 loc) · 2.82 KB
/
rss_template.html
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<div class="message type-{{ m.type }}" id="{{ m.id }}">
<div class="avatar">
{% if m.user.avatar %}
<img src="{{ config.site_url }}/{{ config.media_dir }}/{{ m.user.avatar }}" alt="" />
{% endif %}
</div>
<div class="body">
<div class="meta">
<a href="{{ config.telegram_url.format(id=m.user.username) }}" class="username" rel="noreferer nopener nofollow">
{% if config.show_sender_fullname %}
{{ m.user.first_name }} {{ m.user.last_name }} (@{{ m.user.username }})
{% else %}
@{{ m.user.username }}
{% endif %}
</a>
{% if m.reply_to %}
<a class="reply" href="{{ page_ids[m.reply_to] }}#{{ m.reply_to }}">↶ Reply to #{{ m.reply_to }}</a>
{% endif %}
<a class="id" href="#{{ m.id }}">#{{ m.id }}</a>
{% if m.user.tags %}
{% for t in m.user.tags %}
<span class="tags">{{ t }}</span>
{% endfor %}
{% endif %}
<span class="date">{{ m.date.strftime("%I:%M %p, %d %b %Y") }}</span>
</div>
<div class="text">
{% if m.type == "message" %}
{{ nl2br(m.content | escape) | safe | urlize }}
{% else %}
{% if m.type == "user_joined" %}
Joined.
{% elif m.type == "user_left" %}
Left.
{% endif %}
{% endif %}
</div>
{% if m.media %}
<div class="media">
{% if m.media.type == "webpage" and (m.media.title or m.media.description) %}
<a href="{{ m.media.url }}" rel="noreferer nopener nofollow">{{ m.media.title or "Link" }}</a>
{% if m.media.description %}
<p>{{ m.media.description }}</p>
{% endif %}
{% elif m.media.type == "poll" %}
<div class="poll">
<h4 class="title">{{ m.media.title }}</h4>
<span class="total-count">
{{ m.media.description | sum(attribute="count") }} vote(s).
</span>
<ul class="options">
{% for o in m.media.description %}
<li>
<span class="count">{{ o.percent }}%, {{ o.count }} votes</span>
<span class="bar" style="width: {{ o.percent }}%"></span>
<label>{{ o.label }}</label>
</li>
{% endfor %}
</ul>
</div>
{% elif m.media.thumb %}
<a href="{{ config.site_url }}/{{ config.media_dir }}/{{ m.media.url }}">
{% if media_mime.startswith("image/") %}
<img src="{{ config.site_url }}/{{ config.media_dir }}/{{ m.media.url }}" alt="{{ m.media.title }}" /><br />
{% else %}
<img src="{{ config.site_url }}/{{ config.media_dir }}/{{ m.media.thumb }}" class="thumb" /><br />
{% endif %}
<span class="filename">{{ m.media.title }}</span>
</a>
{% else %}
<a href="{{ config.site_url }}/{{ config.media_dir }}/{{ m.media.url }}">{{ m.media.title }}</a>
{% endif %}
</div>
{% endif %}
</div>
</div>