lib.itmens/common/templates/partial/_announcement.html
Henri Dickson 0ffd47ca96
new style
* new style with picocss
* djlint
* rate distribution
* collection item drag to order
* discover available for guest
* search combine movie tv
2023-05-20 11:01:18 -04:00

52 lines
1.7 KiB
HTML

{% load static %}
{% load i18n %}
{% load admin_url %}
{% load mastodon %}
{% load oauth_token %}
{% load truncate %}
{% load thumb %}
<div id="modals">
<style>
.bottom-link {
margin-top: 30px; text-align: center; margin-bottom: 5px;
}
.bottom-link a {
color: #ccc;
}
</style>
<div class="announcement-modal modal">
<div class="announcement-modal__head">
<h4 class="announcement-modal__title">{% trans '公告' %}</h4>
<span class="announcement-modal__close-button modal-close">
<i class="fa-solid fa-xmark"></i>
</span>
</div>
<div class="announcement-modal__body">
<ul>
{% for ann in request.user.unread_announcements %}
<li class="announcement">
<a href="{% url 'management:retrieve' ann.pk %}">
<h5 class="announcement__title">{{ ann.title }}</h5>
</a>
<span class="announcement__datetime">{{ ann.created_time }}</span>
<p class="announcement__content">{{ ann.get_plain_content | truncate:200 }}</p>
</li>
{% if not forloop.last %}<div class="dividing-line" style="border-top-style: dashed;"></div>{% endif %}
{% endfor %}
</ul>
<div class="bottom-link">
<a href="{% url 'management:list' %}">{% trans '查看全部公告' %}</a>
</div>
</div>
</div>
</div>
<div class="bg-mask"></div>
<script>
// because the modal and mask elements only exist when there are new announcements
$(".announcement-modal").show();
$(".bg-mask").show();
$(".modal-close").on('click', function () {
$(this).parents(".modal").hide();
$(".bg-mask").hide();
});
</script>