-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.html
102 lines (102 loc) · 3.16 KB
/
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Telegram Messages - {{chat_name}}</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
line-height: 1.4;
color: #000;
background-color: #fff;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.header {
background-color: #5682a3;
color: white;
padding: 10px 20px;
font-size: 18px;
font-weight: bold;
}
.message {
border-bottom: 1px solid #e8e8e8;
padding: 10px 0;
}
.message-header {
display: flex;
justify-content: space-between;
color: #3a6d99;
font-size: 14px;
margin-bottom: 5px;
}
.message-content {
white-space: pre-wrap;
word-wrap: break-word;
}
.message-media {
max-width: 100%;
height: auto;
margin-top: 10px;
}
.button {
display: inline-block;
padding: 5px 10px;
margin: 5px 5px 5px 0;
background-color: #f0f0f0;
border-radius: 3px;
color: #3a6d99;
text-decoration: none;
}
.forwarded {
color: #3a6d99;
font-style: italic;
margin-bottom: 5px;
}
</style>
</head>
<body>
<div class="header">
Messages from {{chat_name}}
</div>
<div class="container">
{% for message in messages %}
<div class="message">
<div class="message-header">
<span>{{message[1]}}</span>
{% if message[7] %}
<span>👁 {{message[7]}}</span>
{% endif %}
</div>
{% if message[5] %}
<div class="forwarded">
Forwarded from: <a href="{{get_url_from_forwarded(message[5])}}">{{get_url_from_forwarded(message[5])}}</a>
</div>
{% endif %}
{% if message[2] %}
<div class="message-content">{{message[2]}}</div>
{% endif %}
{% if message[4] %}
<img src="{{message[4]}}" alt="Media" class="message-media">
{% endif %}
{% if message[8] %}
<div>
{% for button in message[8].split('|') %}
{% set button_parts = button.split(',') %}
{% if button_parts|length == 2 %}
<a href="{{button_parts[1]}}" class="button" target="_blank">{{button_parts[0]}}</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
</body>
</html>