khaikang/templates/index.html

60 lines
2.1 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-13 03:02:51 +08:00
{% for public_post in public_timeline_list %}
2022-11-15 23:49:04 +08:00
<div id="post-{{public_post.id}}" class="post"><a href="/user/{{public_post.poster}}">{{public_post.poster.shown_name}}</a>
at <a href="/post/{{public_post.id}}" class="post-time">{{public_post.post_time|date:"Y-m-d H:i:s.u"}}+0000</a><br/>
2022-11-14 02:15:11 +08:00
{{public_post.text|linebreaksbr}}<br/>
2022-11-14 00:06:07 +08:00
<span id="reply-{{public_post.id}}" value="{{public_post.id}}" class="reply">↩️</span>
- <span id="repost-{{public_post.id}}" value="{{public_post.id}}" class="repost">🔁</span>
- <span id="fav-{{public_post.id}}" value="{{public_post.id}}" class="fav"></span>
</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-15 23:49:04 +08:00
<script type="text/javascript" src="{% static 'timeline.js' %}">
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 %}