khaikang/templates/index.html

64 lines
2.4 KiB
HTML
Raw Normal View History

2022-11-11 01:37:16 +08:00
{% extends "base_generic.html" %}
2022-11-15 23:49:04 +08:00
{% load static %}
2022-11-13 03:02:51 +08:00
{% load tz %}
{% block meta %}
<meta id="_token" content="{{ csrf_token }}">
{% endblock %}
2022-11-15 23:49:04 +08:00
2022-11-13 03:02:51 +08:00
{% get_current_timezone as TIME_ZONE %}
2022-11-15 23:49:04 +08:00
{% block headbar %}
2022-11-17 01:51:26 +08:00
{{ request.user.shown_name }} (<a href="/user/{{ request.user.username}}">My timeline</a>) - <a href="/account/config">Configs</a> - <a href="/account/logout">Log out</a>
2022-11-15 23:49:04 +08:00
{% endblock %}
2022-11-11 01:37:16 +08:00
{% block content %}
<form method="POST" id="posting-form">
{% csrf_token %}
<div class="posting-form-group">
2022-11-13 03:02:51 +08:00
<textarea id="post_text" name="post_text" placeholder="What do you want to post?"
maxlength="500" style="resize: none;" oninput="auto_expand(this)"></textarea>
2022-11-11 01:37:16 +08:00
</div>
2022-11-13 03:02:51 +08:00
{% csrf_token %}
<label for="privilege">Privileges:</label>
<select name="privilege" id="privil_choosing">
<option value="public" selected>Public Timeline</option>
<option value="unpublic">Not in Public Timeline</option>
<option value="private">Private</option>
</select>
2022-11-26 05:01:20 +08:00
<button id="submit_post" type="button" class="btn">Kóng!</button>
2022-11-11 01:37:16 +08:00
</form>
2022-11-13 03:02:51 +08:00
<div id="public_timeline">
2022-11-14 00:06:07 +08:00
<div id="new_post_notifier" value=""></div>
<div id="latest_time" style="display: block;">{{latest_received_time|date:"Y-m-d H:i:s.u"}}+0000</div>
2022-11-27 01:34:44 +08:00
{% for public_post in public_timeline_info %}
<div id="post-{{public_post.0.id}}" class="post">
<img class="timeline-avatar-img" src="{{public_post.0.poster.avatar.url}}">
<div class="post-content">
<a href="/user/{{public_post.0.poster}}">{{public_post.0.poster.shown_name}}</a>
at <a href="/post/{{public_post.0.id}}" class="post-time">{{public_post.0.post_time|date:"Y-m-d H:i:s.u"}}+0000</a><br/>
{{public_post.0.text|linebreaksbr}}<br/>
<span id="reply-{{public_post.0.id}}" data-value="{{public_post.0.id}}" class="reply">↩️</span>
- <span id="repost-{{public_post.0.id}}" data-value="{{public_post.0.id}}" class=" {%if public_post.1 == 0 %} unchecked{% endif %} repost">🔁</span>
- <span id="fav-{{public_post.0.id}}" data-value="{{public_post.0.id}}" class=" {%if public_post.2 == 0 %} unchecked{% endif %} fav"></span>
</div>
2022-11-14 00:06:07 +08:00
</div>
2022-11-13 03:02:51 +08:00
{% endfor %}
2022-11-14 02:15:11 +08:00
<div id="previous_post_loader">More posts</div>
2022-11-14 00:06:07 +08:00
<div id="oldest_time" style="display: block;">{{oldest_received_time|date:"Y-m-d H:i:s.u"}}+0000</div>
2022-11-13 03:02:51 +08:00
</div>
2022-11-27 01:34:44 +08:00
<script type="text/javascript" src="{% static 'timeline.js' %}?{% now 'U' %}">
2022-11-15 23:49:04 +08:00
2022-11-13 03:02:51 +08:00
2022-11-14 00:06:07 +08:00
2022-11-13 03:02:51 +08:00
</script>
2022-11-11 01:37:16 +08:00
{% endblock %}