diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/templates/mail.css | 21 | ||||
-rw-r--r-- | res/templates/notif.html | 34 | ||||
-rw-r--r-- | res/templates/notif_mail.html | 22 | ||||
-rw-r--r-- | res/templates/room.html | 25 |
4 files changed, 102 insertions, 0 deletions
diff --git a/res/templates/mail.css b/res/templates/mail.css new file mode 100644 index 0000000000..61953ba51c --- /dev/null +++ b/res/templates/mail.css @@ -0,0 +1,21 @@ +.room_avatar { + width: 48px; + height: 48px; + float: left; +} + +.room_content { + clear: left; +} + +.historical { + color: #888; +} + +.sender_name { + display: inline; +} + +.message_time { + display: inline; +} diff --git a/res/templates/notif.html b/res/templates/notif.html new file mode 100644 index 0000000000..3112df9704 --- /dev/null +++ b/res/templates/notif.html @@ -0,0 +1,34 @@ +<div class="notif"> + <div> + {% for message in notif.messages %} + <div class="message {% if message.is_historical %}historical{% endif %}"> + {% if message.sender_avatar_url %} + <img class="sender_avatar" src="{{ message.sender_avatar_url|mxc_to_http(48,48) }}" /> + {% else %} + {% if message.sender_hash % 3 == 0 %} + <img class="sender_avatar" src="https://vector.im/beta/img/76cfa6.png" /> + {% elif message.sender_hash % 3 == 1 %} + <img class="sender_avatar" src="https://vector.im/beta/img/50e2c2.png" /> + {% else %} + <img class="sender_avatar" src="https://vector.im/beta/img/f4c371.png" /> + {% endif %} + <img class="sender_avatar" src="{{ message.sender_avatar_url }}" /> + {% endif %} + <div class="sender_name">{{ message.sender_name }}</div> + <div class="message_time">{{ message.ts|format_ts("%H:%M") }}</div> + <div class="message_body"> + {% if message.msgtype == "m.text" %} + {{ message.body_text_html }} + {% elif message.msgtype == "m.image" %} + <img src="{{ message.image_url|mxc_to_http(640, 480, scale) }}" /> + {% elif message.msgtype == "m.file" %} + <span class="filename">{{ message.body_text_plain }}</span> + {% endif %} + </div> + </div> + {% endfor %} + </div> + <div class="notif_link"> + <a href="{{ notif.link }}">View</a> + </div> +</div> diff --git a/res/templates/notif_mail.html b/res/templates/notif_mail.html new file mode 100644 index 0000000000..cc3573e65a --- /dev/null +++ b/res/templates/notif_mail.html @@ -0,0 +1,22 @@ +<!doctype html> +<html lang="en"> + <head> + <style type="text/css"> + {% include 'mail.css' without context %} + </style> + </head> + <body> + <div id="page"> + <div className="salutation">Hi {{ user_display_name }},</div> + <div className="summarytext">{{ summary_text }}</div> + <div class="content"> + {% for room in rooms %} + {% include 'room.html' with context %} + {% endfor %} + </div> + <div class="footer"> + <a href="{{ unsubscribe_link }}">Unsubscribe</a> + </div> + </div> + </body> +</html> diff --git a/res/templates/room.html b/res/templates/room.html new file mode 100644 index 0000000000..3c0a4607b3 --- /dev/null +++ b/res/templates/room.html @@ -0,0 +1,25 @@ +<div class="room"> + <div class="room_avatar"> + {% if room.avatar_url %} + <img src="{{ room.avatar_url|mxc_to_http(48,48) }}" /> + {% else %} + {% if room.hash % 3 == 0 %} + <img src="https://vector.im/beta/img/76cfa6.png" /> + {% elif room.hash % 3 == 1 %} + <img src="https://vector.im/beta/img/50e2c2.png" /> + {% else %} + <img src="https://vector.im/beta/img/f4c371.png" /> + {% endif %} + {% endif %} + </div> + <h2>{{ room.title }}</h2> + <div class="room_content"> + {% if room.invite %} + <a href="{{ room.link }}">Join the conversation.</a> + {% else %} + {% for notif in room.notifs %} + {% include 'notif.html' with context %} + {% endfor %} + {% endif %} + </div> +</div> |