{% load static %}
{% load i18n %}
{% load admin_url %}
{% load mastodon %}
{% load oauth_token %}
{% load truncate %}
{% load thumb %}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ site_name }} - 设置</title>
    {% include "common_libs.html" %}
    <script src="{% static 'js/mastodon.js' %}"></script>
    <script src="{% static 'js/home.js' %}"></script>
</head>

<body>
    <div id="page-wrapper">
        <div id="content-wrapper">
            {% include "partial/_navbar.html" with current="preferences" %}

            <section id="content">
                <div class="grid grid--reverse-order">
                    <div class="grid__main grid__main--reverse-order">
                        <div class="main-section-wrapper">
                            <form action="{% url 'users:preferences' %}" method="POST">
                                {% csrf_token %}
                                <div class="tools-section-wrapper">
                                    <div class="import-panel">
                                        <h5 class="import-panel__label">{% trans '使用偏好设置' %}</h5>
                                        <div class="import-panel__body">
                                            <span>{% trans '新标记默认可见性：' %}</span>
                                            <div class="import-panel__checkbox import-panel__checkbox--last">
                                                <label for="id_visibility_0"><input type="radio" name="default_visibility" value="0" required="" id="id_visibility_0" {%if request.user.preference.default_visibility == 0 %}checked{% endif %}>
                                                 公开</label>
                                                <label for="id_visibility_1"><input type="radio" name="default_visibility" value="1" required="" id="id_visibility_1" {%if request.user.preference.default_visibility == 1 %}checked{% endif %}>
                                                 仅关注者</label>
                                                <label for="id_visibility_2"><input type="radio" name="default_visibility" value="2" required="" id="id_visibility_2" {%if request.user.preference.default_visibility == 2 %}checked{% endif %}>
                                                 仅自己</label>
                                            </div>
                                            <br>
                                            <span>{% trans '登录后显示个人主页：' %}</span>
                                            <div class="import-panel__checkbox import-panel__checkbox--last">
                                                <input type="checkbox" name="classic_homepage" id="classic_homepage" {%if request.user.preference.classic_homepage %}checked{% endif %}>
                                                <label for="classic_homepage">{% trans '默认登录后显示好友动态，如果希望登录后显示本人主页可选中此处' %}</label>
                                            </div>
                                            <br style="margin-bottom:1.5em">
                                            <span>{% trans '不允许未登录用户访问个人主页：' %}</span>
                                            <div class="import-panel__checkbox import-panel__checkbox--last">
                                                <input type="checkbox" name="no_anonymous_view" id="no_anonymous_view" {%if request.user.preference.no_anonymous_view %}checked{% endif %}>
                                                <label for="no_anonymous_view">{% trans '选中后匿名访客无法看到你的个人主页或通过RSS订阅你的评论' %}</label>
                                            </div>
                                            <br style="margin-bottom:1.5em">
                                            <span>{% trans '显示最近编辑者：' %}</span>
                                            <div class="import-panel__checkbox import-panel__checkbox--last">
                                                <input type="checkbox" name="show_last_edit" id="show_last_edit" {%if request.user.preference.show_last_edit %}checked{% endif %}>
                                                <label for="show_last_edit">{% trans '默认不显示最近编辑条目的用户，除非该用户选中此选项。' %}</label>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="tools-section-wrapper" style="margin-top: 2em;">
                                    <div class="import-panel">
                                        <h5 class="import-panel__label">{% trans '社交网络分享相关设置' %}</h5>
                                        <div class="import-panel__body">
                                            <span>{% trans '在联邦网络上以公开方式分享的帖文是否发布到公共时间轴上：' %}</span>
                                            <div class="import-panel__checkbox import-panel__checkbox--last">
                                                <input type="checkbox" name="mastodon_publish_public" id="visibility" {%if request.user.preference.mastodon_publish_public %}checked{% endif %}>
                                                <label for="visibility">{% trans '选中时为public，未选中时为unlisted' %}</label>
                                            </div>
                                            <br><br>
                                            <span>{% trans '在联邦网络上分享帖文时附加标签：' %}</span>
                                            <div class="import-panel__checkbox import-panel__checkbox--last">
                                                <input name="mastodon_append_tag" id="tag" placeholder="#我的书影音" value="{{ request.user.preference.mastodon_append_tag }}" >
                                                <label for="tag">{% trans '输入标签文字会被添加到帖文结尾' %}</label>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div style="margin-top: 2em;">
                                    <input type="submit" class="import-panel__button" value="{% trans '保存' %}">
                                </div>
                            </form>
                        </div>
                    </div>

                    {% include "partial/_sidebar.html" %}
                </div>
            </section>

        </div>

        {% include "partial/_footer.html" %}
    </div>

</body>


</html>
