add like; replace inline icons with font-awesome
This commit is contained in:
parent
26246e73c2
commit
eee3dbe411
39 changed files with 359 additions and 440 deletions
|
@ -58,6 +58,7 @@ INSTALLED_APPS = [
|
|||
"easy_thumbnails",
|
||||
"user_messages",
|
||||
"jsoneditor",
|
||||
"fontawesomefree",
|
||||
]
|
||||
|
||||
INSTALLED_APPS += [
|
||||
|
|
|
@ -39,3 +39,4 @@
|
|||
<script src="{% static 'catalog.js' %}"></script>
|
||||
<script src="{% static 'lib/js/tag-input.js' %}"></script>
|
||||
<link href="{% static 'lib/css/tag-input.css' %}" type="text/css" media="all" rel="stylesheet">
|
||||
<link href="{% static 'fontawesomefree/css/all.min.css' %}" rel="stylesheet" type="text/css">
|
||||
|
|
|
@ -30,22 +30,7 @@
|
|||
<div>
|
||||
{% trans '正在连线' %}{{ site.SITE_NAME.label }}
|
||||
<div hx-get="{% url 'catalog:fetch_refresh' job_id %}" hx-trigger="load delay:2s" hx-swap="outerHTML"></div>
|
||||
<div id="spinner">
|
||||
<div class="spinner">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<i class="fas fa-fan fa-spin"></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
{% load truncate %}
|
||||
{% load strip_scheme %}
|
||||
{% load thumb %}
|
||||
{% load user_actions %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
@ -143,7 +144,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if others_mark.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
|
||||
{% if others_mark.shelfmember.metadata.shared_link %}
|
||||
|
@ -153,7 +154,14 @@
|
|||
{% endif %}
|
||||
|
||||
{% if others_mark.text %}
|
||||
<p class="entity-marks__mark-content">{{ others_mark.comment_html|safe }}</p>
|
||||
<p class="entity-marks__mark-content">{{ others_mark.comment_html|safe }}
|
||||
<span class="action-bar inline">
|
||||
<span>
|
||||
{% liked_piece others_mark.shelfmember as liked %}
|
||||
{% include 'like_stats.html' with liked=liked piece=others_mark.shelfmember %}
|
||||
</span>
|
||||
</span>
|
||||
</p>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% empty %}
|
||||
|
@ -174,10 +182,16 @@
|
|||
<li class="entity-reviews__review">
|
||||
<a href="{% url 'journal:user_profile' others_review.owner.mastodon_username %}" class="entity-reviews__owner-link">{{ others_review.owner.username }}</a>
|
||||
{% if others_review.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
<span class="entity-reviews__review-time">{{ others_review.edited_time }}</span>
|
||||
<span class="entity-reviews__review-time">{{ others_review.created_time | date }}</span>
|
||||
<span class="entity-reviews__review-title"> <a href="{% url 'journal:review_retrieve' others_review.uuid %}">{{ others_review.title }}</a></span>
|
||||
<span class="action-bar inline">
|
||||
<span>
|
||||
{% liked_piece others_review as liked %}
|
||||
{% include 'like_stats.html' with liked=liked piece=others_review %}
|
||||
</span>
|
||||
</span>
|
||||
<span>{{ others_review.get_plain_content | truncate:100 }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@ -200,7 +214,7 @@
|
|||
<span class="mark-panel__rating-star rating-star" data-rating-score="{{ mark.rating | floatformat:'0' }}"></span>
|
||||
{% endif %}
|
||||
{% if mark.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
<span class="mark-panel__actions">
|
||||
<a href="#" hx-get="{% url 'journal:mark' item.uuid %}" class="edit" hx-target="body" hx-swap="beforeend">{% trans '修改' %}</a>
|
||||
|
@ -253,7 +267,7 @@
|
|||
{% if review %}
|
||||
<span class="review-panel__label">{% trans '我的评论' %}</span>
|
||||
{% if review.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
<span class="review-panel__actions">
|
||||
<a href="{% url 'journal:review_edit' item.uuid review.uuid %}">{% trans '编辑' %}</a>
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
{% load truncate %}
|
||||
{% load highlight %}
|
||||
{% load thumb %}
|
||||
{% load user_actions %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
@ -41,7 +43,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if others_mark.mark.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
|
||||
{% if others_mark.metadata.shared_link %}
|
||||
|
@ -51,7 +53,14 @@
|
|||
{% endif %}
|
||||
|
||||
{% if others_mark.mark.text %}
|
||||
<p class="entity-marks__mark-content">{{ others_mark.mark.comment_html|safe }}</p>
|
||||
<p class="entity-marks__mark-content">{{ others_mark.mark.comment_html|safe }}
|
||||
<span class="action-bar inline">
|
||||
<span>
|
||||
{% liked_piece others_mark as liked %}
|
||||
{% include 'like_stats.html' with liked=liked piece=others_mark %}
|
||||
</span>
|
||||
</span>
|
||||
</p>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% empty %}
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
{% load truncate %}
|
||||
{% load highlight %}
|
||||
{% load thumb %}
|
||||
{% load user_actions %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
@ -34,13 +36,19 @@
|
|||
<li class="entity-reviews__review entity-reviews__review--wider">
|
||||
<a href="{% url 'journal:user_profile' review.owner.mastodon_username %}" class="entity-reviews__owner-link">{{ review.owner.username }}</a>
|
||||
{% if review.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
<span class="entity-reviews__review-time">{{ review.edited_time }}</span>
|
||||
<span class="entity-reviews__review-time">{{ review.created_time | date }}</span>
|
||||
<span class="entity-reviews__review-title"><a href="{% url 'journal:review_retrieve' review.uuid %}">{{ review.title }}</a></span>
|
||||
<span class="action-bar inline">
|
||||
<span>
|
||||
{% liked_piece review as liked %}
|
||||
{% include 'like_stats.html' with liked=liked piece=review %}
|
||||
</span>
|
||||
</span>
|
||||
</li>
|
||||
{% empty %}
|
||||
<div>{% trans '无结果' %}</div>
|
||||
<div>{% trans '暂无评论' %}</div>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
|
|
|
@ -25,9 +25,16 @@
|
|||
</details>
|
||||
<div style="margin-bottom: 8px;margin-left: 32px;">
|
||||
{% if request.user.is_authenticated %}
|
||||
<a class="icon gg-comment" style="--ggs:0.5;margin-right: 10px;" title="评论单集" href="#" hx-get="{% url 'journal:comment' item.uuid ep.uuid %}" hx-target="body" hx-swap="beforeend"></a>
|
||||
<a class="icon" style="margin-right: 10px;" title="评论单集" href="#" hx-get="{% url 'journal:comment' item.uuid ep.uuid %}" hx-target="body" hx-swap="beforeend">
|
||||
<i class="fa-regular fa-comment-dots"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a class="icon gg-external" style="--ggs:0.6;" title="打开源网站" target="_blank" href="{{ep.link}}"></a>
|
||||
<!-- <a class="icon" title="详细介绍" href="{{ep.link}}">
|
||||
<i class="fa-solid fa-circle-info"></i>
|
||||
</a> -->
|
||||
<a class="icon" title="打开源网站" target="_blank" href="{{ep.link}}">
|
||||
<i class="fa-solid fa-arrow-up-right-from-square"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% if forloop.last %}
|
||||
|
|
|
@ -50,22 +50,7 @@
|
|||
{% if request.GET.q and user.is_authenticated %}
|
||||
<li class="entity-list__entity" hx-get="{% url 'catalog:external_search' %}?q={{ request.GET.q }}&c={{ request.GET.c }}&page={% if pagination.current_page %}{{ pagination.current_page }}{% else %}1{% endif %}" hx-trigger="load" hx-swap="outerHTML">
|
||||
{% trans '正在实时搜索站外条目' %}
|
||||
<div id="spinner">
|
||||
<div class="spinner">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<span><i class="fas fa-fan fa-spin"></i></span>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
|
|
@ -1,12 +1,26 @@
|
|||
.collection-item-position-edit {
|
||||
.action-bar {
|
||||
float: right;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.collection-item-position-edit a {
|
||||
.action-bar.inline {
|
||||
float: unset;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.action-bar a {
|
||||
cursor: pointer;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.action-bar>span {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.action-bar a:hover {
|
||||
color: #00a1cc;
|
||||
}
|
||||
|
||||
.action-icon svg {
|
||||
cursor: pointer;
|
||||
fill: #ccc;
|
||||
|
@ -203,6 +217,7 @@ progress {
|
|||
|
||||
.icon {
|
||||
color: grey;
|
||||
cursor: pointer;
|
||||
}
|
||||
.icon:hover {
|
||||
color: #00a1cc;
|
||||
|
@ -243,132 +258,14 @@ summary::-webkit-details-marker {
|
|||
left: 7px
|
||||
}
|
||||
|
||||
.gg-link {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
transform: rotate(-45deg) scale(var(--ggs,1));
|
||||
width: 8px;
|
||||
height: 2px;
|
||||
background: currentColor;
|
||||
border-radius: 4px
|
||||
|
||||
.icon-spin {
|
||||
transition: transform .8s ease-in-out;
|
||||
}
|
||||
.gg-link::after,
|
||||
.gg-link::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
border-radius: 3px;
|
||||
width: 8px;
|
||||
height: 10px;
|
||||
border: 2px solid;
|
||||
top: -4px
|
||||
}
|
||||
.gg-link::before {
|
||||
border-right: 0;
|
||||
border-top-left-radius: 40px;
|
||||
border-bottom-left-radius: 40px;
|
||||
left: -6px
|
||||
}
|
||||
.gg-link::after {
|
||||
border-left: 0;
|
||||
border-top-right-radius: 40px;
|
||||
border-bottom-right-radius: 40px;
|
||||
right: -6px
|
||||
.icon-spin:hover {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
||||
.gg-external {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
transform: scale(var(--ggs,1));
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
box-shadow:
|
||||
-2px 2px 0 0,
|
||||
-4px -4px 0 -2px,
|
||||
4px 4px 0 -2px;
|
||||
margin-left: -2px;
|
||||
margin-top: 1px
|
||||
}
|
||||
.gg-external::after,
|
||||
.gg-external::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
right: -4px
|
||||
}
|
||||
.gg-external::before {
|
||||
background: currentColor;
|
||||
transform: rotate(-45deg);
|
||||
width: 12px;
|
||||
height: 2px;
|
||||
top: 1px
|
||||
}
|
||||
.gg-external::after {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-right: 2px solid;
|
||||
border-top: 2px solid;
|
||||
top: -4px
|
||||
}
|
||||
|
||||
.gg-comment {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
transform: scale(var(--ggs,1));
|
||||
width: 20px;
|
||||
height: 16px;
|
||||
border: 2px solid;
|
||||
border-bottom: 0;
|
||||
box-shadow:
|
||||
-6px 8px 0 -6px,
|
||||
6px 8px 0 -6px
|
||||
}
|
||||
.gg-comment::after,
|
||||
.gg-comment::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
width: 8px
|
||||
}
|
||||
.gg-comment::before {
|
||||
border: 2px solid;
|
||||
border-top-color: transparent;
|
||||
border-bottom-left-radius: 20px;
|
||||
right: 4px;
|
||||
bottom: -6px;
|
||||
height: 6px
|
||||
}
|
||||
|
||||
.gg-bookmark,
|
||||
.gg-bookmark::after {
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
border-top-right-radius: 3px
|
||||
}
|
||||
.gg-bookmark {
|
||||
border: 2px solid;
|
||||
border-bottom: 0;
|
||||
border-top-left-radius: 3px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
transform: scale(var(--ggs,1));
|
||||
width: 14px;
|
||||
height: 16px
|
||||
}
|
||||
.gg-bookmark::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-top: 2px solid;
|
||||
border-right: 2px solid;
|
||||
transform: rotate(-45deg);
|
||||
top: 9px;
|
||||
left: -1px
|
||||
.fa-lock, .fa-spin {
|
||||
color: lightgray;
|
||||
}
|
||||
|
|
|
@ -17,15 +17,8 @@
|
|||
<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">
|
||||
<span class="icon-cross">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<polygon
|
||||
points="20 2.61 17.39 0 10 7.39 2.61 0 0 2.61 7.39 10 0 17.39 2.61 20 10 12.61 17.39 20 20 17.39 12.61 10 20 2.61">
|
||||
</polygon>
|
||||
</svg>
|
||||
</span>
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="announcement-modal__body">
|
||||
|
|
|
@ -17,3 +17,8 @@
|
|||
</footer>
|
||||
<div class="player">
|
||||
</div>
|
||||
<script>
|
||||
document.body.addEventListener('htmx:configRequest', (event) => {
|
||||
event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}';
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<img src="{% static 'img/logo.svg' %}" alt="" class="navbar__logo-img">
|
||||
</a>
|
||||
<div class="navbar__search-box">
|
||||
<!-- <input type="search" class="" name="q" id="searchInput" required="true" value="{% for v in request.GET.values %}{{ v }}{% endfor %}" -->
|
||||
<input type="search" class="" name="q" id="searchInput" required="true" value="{% if request.GET.q %}{{ request.GET.q }}{% endif %}"
|
||||
<!-- <input type="search" name="q" id="searchInput" required="true" value="{% for v in request.GET.values %}{{ v }}{% endfor %}" -->
|
||||
<input type="search" name="q" id="searchInput" required="true" value="{% if request.GET.q %}{{ request.GET.q }}{% endif %}"
|
||||
placeholder="搜索书影音游戏播客,或输入站外条目链接如 https://movie.douban.com/subject/1297880/ 支持站点列表见页底公告栏">
|
||||
<select class="navbar__search-dropdown" id="searchCategory" name="c">
|
||||
<option value="all" {% if request.GET.c and request.GET.c == 'all' or not request.GET.c %}selected{% endif %}>{% trans '任意' %}</option>
|
||||
|
|
|
@ -42,9 +42,7 @@
|
|||
<div class="relation-dropdown">
|
||||
<div class="relation-dropdown__button">
|
||||
<span class="icon-arrow">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
||||
<path d="M8.12,3.29,5,6.42,1.86,3.29H.45L5,7.84,9.55,3.29Z" />
|
||||
</svg>
|
||||
<i class="fas fa-angle-down"></i>
|
||||
</span>
|
||||
</div>
|
||||
{% if user.featured_collections.all %}
|
||||
|
|
|
@ -117,6 +117,10 @@ class Piece(PolymorphicModel, UserOwnedObjectMixin):
|
|||
def api_url(self):
|
||||
return f"/api/{self.url}" if self.url_path else None
|
||||
|
||||
@property
|
||||
def like_count(self):
|
||||
return self.likes.all().count()
|
||||
|
||||
@classmethod
|
||||
def get_by_url(cls, url_or_b62):
|
||||
b62 = url_or_b62.strip().split("/")[-1]
|
||||
|
@ -171,11 +175,11 @@ class Like(Piece):
|
|||
|
||||
@staticmethod
|
||||
def user_liked_piece(user, piece):
|
||||
return Like.objects.filter(owner=user, target=piece).first()
|
||||
return Like.objects.filter(owner=user, target=piece).exists()
|
||||
|
||||
@staticmethod
|
||||
def user_like_piece(user, piece):
|
||||
if not piece or piece.__class__ not in [Collection]:
|
||||
if not piece:
|
||||
return
|
||||
like = Like.objects.filter(owner=user, target=piece).first()
|
||||
if not like:
|
||||
|
|
|
@ -15,31 +15,25 @@
|
|||
<div class="add-to-list-modal__head">
|
||||
<span class="add-to-list-modal__title">{% trans '添加到收藏单' %}</span>
|
||||
<span class="add-to-list-modal__close-button modal-close" _="on click trigger closeModal">
|
||||
<span class="icon-cross">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<polygon
|
||||
points="20 2.61 17.39 0 10 7.39 2.61 0 0 2.61 7.39 10 0 17.39 2.61 20 10 12.61 17.39 20 20 17.39 12.61 10 20 2.61">
|
||||
</polygon>
|
||||
</svg>
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="add-to-list-modal__body">
|
||||
<form action="{% url 'journal:add_to_collection' item.uuid %}" method="post">
|
||||
{% csrf_token %}
|
||||
<select name="collection_id">
|
||||
{% for collection in collections %}
|
||||
<option value="{{ collection.id }}">{{ collection.title }}{% if collection.visibility > 0 %}🔒{% endif %}</option>
|
||||
{% endfor %}
|
||||
<option value="0">新建收藏单</option>
|
||||
</select>
|
||||
<div>
|
||||
<textarea type="text" name="note" placeholder="条目备注"></textarea>
|
||||
</div>
|
||||
<div class="add-to-list-modal__confirm-button">
|
||||
<input type="submit" class="button float-right" value="{% trans '提交' %}">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="add-to-list-modal__body">
|
||||
<form action="{% url 'journal:add_to_collection' item.uuid %}" method="post">
|
||||
{% csrf_token %}
|
||||
<select name="collection_id">
|
||||
{% for collection in collections %}
|
||||
<option value="{{ collection.id }}">{{ collection.title }}{% if collection.visibility > 0 %}🔒{% endif %}</option>
|
||||
{% endfor %}
|
||||
<option value="0">新建收藏单</option>
|
||||
</select>
|
||||
<div>
|
||||
<textarea type="text" name="note" placeholder="条目备注"></textarea>
|
||||
</div>
|
||||
<div class="add-to-list-modal__confirm-button">
|
||||
<input type="submit" class="button float-right" value="{% trans '提交' %}">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
{% load truncate %}
|
||||
{% load thumb %}
|
||||
{% load collection %}
|
||||
{% load user_actions %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
@ -40,10 +42,7 @@
|
|||
{{ collection.title }}
|
||||
</h5>
|
||||
{% if collection.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z" />
|
||||
</svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
<div class="review-head__body">
|
||||
<div class="review-head__info">
|
||||
|
@ -54,10 +53,16 @@
|
|||
<span class="review-head__time">{{ collection.edited_time }}</span>
|
||||
|
||||
</div>
|
||||
<div class="review-head__actions">
|
||||
<div class="action-bar">
|
||||
<span>
|
||||
{% liked_piece collection as liked %}
|
||||
{% include 'like_stats.html' with liked=liked piece=collection %}
|
||||
</span>
|
||||
{% if request.user == collection.owner %}
|
||||
<span>
|
||||
<a class="review-head__action-link" href="{% url 'journal:collection_edit' collection.uuid %}">{% trans '编辑' %}</a>
|
||||
<a class="review-head__action-link" href="{% url 'journal:collection_delete' collection.uuid %}">{% trans '删除' %}</a>
|
||||
</span>
|
||||
{% elif editable %}
|
||||
<span class="review-head__time">可协作整理</span>
|
||||
{% endif %}
|
||||
|
@ -93,9 +98,6 @@
|
|||
{% endif %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% if follower_count %}
|
||||
<p> {{ follower_count }}人关注 </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -15,13 +15,7 @@
|
|||
<div class="add-to-list-modal__head">
|
||||
<span class="add-to-list-modal__title">{% trans '分享收藏单' %} - {{ collection.title }}</span>
|
||||
<span class="add-to-list-modal__close-button modal-close" _="on click trigger closeModal">
|
||||
<span class="icon-cross">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<polygon
|
||||
points="20 2.61 17.39 0 10 7.39 2.61 0 0 2.61 7.39 10 0 17.39 2.61 20 10 12.61 17.39 20 20 17.39 12.61 10 20 2.61">
|
||||
</polygon>
|
||||
</svg>
|
||||
</span>
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="add-to-list-modal__body">
|
||||
|
|
|
@ -15,12 +15,7 @@
|
|||
<div class="add-to-list-modal__head">
|
||||
<span class="add-to-list-modal__title">{% trans '评论单集' %} {{ item.title }}: {{ focus_item.title }}</span>
|
||||
<span class="add-to-list-modal__close-button modal-close" _="on click trigger closeModal">
|
||||
<span class="icon-cross">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<polygon
|
||||
points="20 2.61 17.39 0 10 7.39 2.61 0 0 2.61 7.39 10 0 17.39 2.61 20 10 12.61 17.39 20 20 17.39 12.61 10 20 2.61"></polygon>
|
||||
</svg>
|
||||
</span>
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="add-to-list-modal__body">
|
||||
|
|
11
journal/templates/like_stats.html
Normal file
11
journal/templates/like_stats.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% if liked %}
|
||||
<a hx-post="{% url 'journal:unlike' piece.uuid %}?stats=1" hx-swap="outerHTML" hx-target="this" title="取消点赞">
|
||||
<i class="fa-solid fa-star icon-spin"></i>
|
||||
<span>{{ piece.like_count }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a hx-post="{% url 'journal:like' piece.uuid %}?stats=1" hx-swap="outerHTML" hx-target="this" title="点赞">
|
||||
<i class="fa-regular fa-star icon-spin"></i>
|
||||
{% if piece.like_count %}<span>{{ piece.like_count }}</span>{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<div class="entity-list__entity-text">
|
||||
{% if collection_edit %}
|
||||
<div class="collection-item-position-edit">
|
||||
<div class="action-bar">
|
||||
{% if not forloop.first %}
|
||||
<a hx-target=".entity-list" hx-post="{% url 'journal:collection_move_item' form.instance.uuid 'up' item.uuid %}">▲</a>
|
||||
{% endif %}
|
||||
|
@ -86,12 +86,9 @@
|
|||
data-rating-score="{{ mark.rating | floatformat:0 }}" style="left: -4px;"></span>
|
||||
{% endif %}
|
||||
{% if mark.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z" />
|
||||
</svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
<span class="entity-marks__mark-time" style="float:right;">
|
||||
<span style="float:right;">
|
||||
{% trans '标记于' %} {{ member.created_time|date }}
|
||||
</span>
|
||||
<p class="entity-marks__mark-content">
|
||||
|
@ -102,16 +99,13 @@
|
|||
</li>
|
||||
{% if mark.review %}
|
||||
<li class="entity-marks__mark">
|
||||
<span class="entity-marks__mark-time" style="float:right;">
|
||||
<span style="float:right;">
|
||||
{% trans '评论于' %} {{ mark.review.created_time|date }}
|
||||
</span>
|
||||
<p class="entity-marks__mark-content">
|
||||
<a href="{{ mark.review.url }}">{{ mark.review.title }}</a>
|
||||
{% if mark.review.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z" />
|
||||
</svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
</p>
|
||||
</li>
|
||||
|
@ -130,7 +124,7 @@
|
|||
|
||||
{% if collection_member.note %} {{ collection_member.note }} {% endif %}
|
||||
{% if collection_edit %}
|
||||
<a class="action-icon" hx-get="{% url 'journal:collection_update_item_note' collection.uuid item.uuid %}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M19,20H5a1,1,0,0,0,0,2H19a1,1,0,0,0,0-2Z"/><path d="M5,18h.09l4.17-.38a2,2,0,0,0,1.21-.57l9-9a1.92,1.92,0,0,0-.07-2.71h0L16.66,2.6A2,2,0,0,0,14,2.53l-9,9a2,2,0,0,0-.57,1.21L4,16.91a1,1,0,0,0,.29.8A1,1,0,0,0,5,18ZM15.27,4,18,6.73,16,8.68,13.32,6Zm-8.9,8.91L12,7.32l2.7,2.7-5.6,5.6-3,.28Z"/></g></svg></a>
|
||||
<a class="icon" hx-get="{% url 'journal:collection_update_item_note' collection.uuid item.uuid %}"><i class="fa-regular fa-pen-to-square"></i></a>
|
||||
{% endif %}
|
||||
|
||||
</p>
|
||||
|
|
|
@ -15,15 +15,9 @@
|
|||
<div class="add-to-list-modal__head">
|
||||
<span class="add-to-list-modal__title">{% trans '标记' %} {{ item.title }}</span>
|
||||
<span class="add-to-list-modal__close-button modal-close" _="on click trigger closeModal">
|
||||
<span class="icon-cross">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<polygon
|
||||
points="20 2.61 17.39 0 10 7.39 2.61 0 0 2.61 7.39 10 0 17.39 2.61 20 10 12.61 17.39 20 20 17.39 12.61 10 20 2.61">
|
||||
</polygon>
|
||||
</svg>
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="add-to-list-modal__body">
|
||||
<form action="{% url 'journal:mark' item.uuid %}" method="post">
|
||||
{% csrf_token %}
|
||||
|
@ -102,7 +96,7 @@
|
|||
},
|
||||
onLeave: function(currentIndex, currentRating, $el){
|
||||
$("input[type='hidden'][name='rating']").val(currentRating * 2);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -126,7 +120,7 @@
|
|||
} else {
|
||||
$("#modal .rating-star-edit").show();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// show confirm modal
|
||||
|
|
|
@ -28,13 +28,8 @@
|
|||
{{ piece.title }}
|
||||
</h5>
|
||||
{% if piece.visibility > 0 %}
|
||||
<span class="icon-lock">
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20">
|
||||
<path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z" />
|
||||
</svg>
|
||||
</span>
|
||||
{% endif %}
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
<div class="review-head__body">
|
||||
<div class="review-head__info">
|
||||
<a href="{% url 'journal:user_profile' piece.owner.mastodon_username %}" class="review-head__owner-link">{{ piece.owner.username }}</a>
|
||||
|
@ -56,4 +51,4 @@
|
|||
{% include "partial/_footer.html" %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -136,17 +136,10 @@
|
|||
{% trans '保存' %}
|
||||
</span>
|
||||
<span class="icon-edit" id="sortEditIcon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 383.947 383.947">
|
||||
<polygon points="0,303.947 0,383.947 80,383.947 316.053,147.893 236.053,67.893 " />
|
||||
<path
|
||||
d="M377.707,56.053L327.893,6.24c-8.32-8.32-21.867-8.32-30.187,0l-39.04,39.04l80,80l39.04-39.04 C386.027,77.92,386.027,64.373,377.707,56.053z" />
|
||||
</svg>
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</span>
|
||||
<span class="icon-save" id="sortSaveIcon" style="display: none;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 384 384" >
|
||||
<path
|
||||
d="M298.667,0h-256C19.093,0,0,19.093,0,42.667v298.667C0,364.907,19.093,384,42.667,384h298.667 C364.907,384,384,364.907,384,341.333v-256L298.667,0z M192,341.333c-35.307,0-64-28.693-64-64c0-35.307,28.693-64,64-64 s64,28.693,64,64C256,312.64,227.307,341.333,192,341.333z M256,128H42.667V42.667H256V128z" />
|
||||
</svg>
|
||||
<i class="fa-regular fa-floppy-disk"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="entity-sort-control__button" id="sortExitButton" style="display: none;">
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
{% load oauth_token %}
|
||||
{% load truncate %}
|
||||
{% load thumb %}
|
||||
{% load user_actions %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
@ -34,10 +36,7 @@
|
|||
{{ review.title }}
|
||||
</h5>
|
||||
{% if review.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z" />
|
||||
</svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
<div class="review-head__body">
|
||||
<div class="review-head__info">
|
||||
|
@ -55,10 +54,16 @@
|
|||
<span class="review-head__time">{{ review.created_time|date }}</span>
|
||||
|
||||
</div>
|
||||
<div class="review-head__actions">
|
||||
<div class="action-bar">
|
||||
<span>
|
||||
{% liked_piece review as liked %}
|
||||
{% include 'like_stats.html' with liked=liked piece=review %}
|
||||
</span>
|
||||
{% if request.user == review.owner %}
|
||||
<span>
|
||||
<a class="review-head__action-link" href="{% url 'journal:review_edit' review.item.uuid review.uuid %}">{% trans '编辑' %}</a>
|
||||
<a class="review-head__action-link" href="{% url 'journal:review_delete' review.uuid %}">{% trans '删除' %}</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -15,46 +15,42 @@
|
|||
<div class="add-to-list-modal__head">
|
||||
<span class="add-to-list-modal__title">{% trans '编辑标签' %} {{ item.title }}</span>
|
||||
<span class="add-to-list-modal__close-button modal-close" _="on click trigger closeModal">
|
||||
<span class="icon-cross">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
||||
<polygon
|
||||
points="20 2.61 17.39 0 10 7.39 2.61 0 0 2.61 7.39 10 0 17.39 2.61 20 10 12.61 17.39 20 20 17.39 12.61 10 20 2.61">
|
||||
</polygon>
|
||||
</svg>
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="add-to-list-modal__body">
|
||||
<form action="{% url 'journal:user_tag_edit' %}?tag={{tag.title}}" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{tag.id}}">
|
||||
<div class="mark-modal__tag">
|
||||
<div class="tag-input">
|
||||
<input name="title" type="text" value="{{tag.title}}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mark-modal__option">
|
||||
<div class="mark-modal__visibility-radio">
|
||||
<span>可见性:
|
||||
<ul id="id_visibility">
|
||||
<li><label for="id_visibility_0"><input type="radio" name="visibility" value="0" required="" id="id_visibility_0" {% if tag.visibility == 0 %}checked{% endif %}> 公开</label> </li>
|
||||
<li><label for="id_visibility_2"><input type="radio" name="visibility" value="2" required="" id="id_visibility_2" {% if tag.visibility != 0 %}checked{% endif %}> 仅自己</label> </li>
|
||||
</ul>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mark-modal__confirm-button">
|
||||
<input type="submit" class="button float-right" value="保存">
|
||||
</div>
|
||||
|
||||
<div class="mark-modal__option">
|
||||
<div class="mark-modal__visibility-radio">
|
||||
<span>
|
||||
<label for="_delete" title="无法撤销"><input type="checkbox" name="delete" value="1" id="_delete"> 删除这个标签</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="add-to-list-modal__body">
|
||||
<form action="{% url 'journal:user_tag_edit' %}?tag={{tag.title}}" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{tag.id}}">
|
||||
<div class="mark-modal__tag">
|
||||
<div class="tag-input">
|
||||
<input name="title" type="text" value="{{tag.title}}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mark-modal__option">
|
||||
<div class="mark-modal__visibility-radio">
|
||||
<span>可见性:
|
||||
<ul id="id_visibility">
|
||||
<li><label for="id_visibility_0"><input type="radio" name="visibility" value="0" required="" id="id_visibility_0" {% if tag.visibility == 0 %}checked{% endif %}> 公开</label> </li>
|
||||
<li><label for="id_visibility_2"><input type="radio" name="visibility" value="2" required="" id="id_visibility_2" {% if tag.visibility != 0 %}checked{% endif %}> 仅自己</label> </li>
|
||||
</ul>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mark-modal__confirm-button">
|
||||
<input type="submit" class="button float-right" value="保存">
|
||||
</div>
|
||||
|
||||
<div class="mark-modal__option">
|
||||
<div class="mark-modal__visibility-radio">
|
||||
<span>
|
||||
<label for="_delete" title="无法撤销"><input type="checkbox" name="delete" value="1" id="_delete"> 删除这个标签</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<span class="entity-reviews__review-title"><a href="{{ collection.url }}">{{ collection.title }}</a></span>
|
||||
<span class="entity-reviews__review-time">{{ collection.edited_time }}</span>
|
||||
{% if collection.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% empty %}
|
||||
|
|
|
@ -6,13 +6,17 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
{% if tag.visibility > 0 %}
|
||||
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
||||
{% endif %}
|
||||
{{ tag.title }}
|
||||
{% if user == request.user %}
|
||||
<a class="action-icon" hx-get="{% url 'journal:user_tag_edit' %}?tag={{tag.title}}" class="edit" hx-target="body" hx-swap="beforeend"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path d="M19,20H5a1,1,0,0,0,0,2H19a1,1,0,0,0,0-2Z"/><path d="M5,18h.09l4.17-.38a2,2,0,0,0,1.21-.57l9-9a1.92,1.92,0,0,0-.07-2.71h0L16.66,2.6A2,2,0,0,0,14,2.53l-9,9a2,2,0,0,0-.57,1.21L4,16.91a1,1,0,0,0,.29.8A1,1,0,0,0,5,18ZM15.27,4,18,6.73,16,8.68,13.32,6Zm-8.9,8.91L12,7.32l2.7,2.7-5.6,5.6-3,.28Z"/></g></svg></a>
|
||||
<small>
|
||||
<a class="icon" hx-get="{% url 'journal:user_tag_edit' %}?tag={{tag.title}}" class="edit" hx-target="body" hx-swap="beforeend"><i class="fa-regular fa-pen-to-square"></i></a>
|
||||
</small>
|
||||
{% endif %}
|
||||
<br>
|
||||
<small>{{ user.mastodon_username }}的{% trans '标签' %}</small>
|
||||
<small>
|
||||
{% if tag.visibility > 0 %}
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
{% endif %}
|
||||
{{ user.mastodon_username }}的{% trans '标签' %}
|
||||
</small>
|
||||
{% endblock %}
|
||||
|
|
|
@ -28,3 +28,9 @@ def like_piece_action(context, piece):
|
|||
"url": reverse("journal:like", args=[piece.uuid]),
|
||||
}
|
||||
return action
|
||||
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
def liked_piece(context, piece):
|
||||
user = context["request"].user
|
||||
return user and user.is_authenticated and Like.user_liked_piece(user, piece)
|
||||
|
|
|
@ -52,12 +52,18 @@ def wish(request, item_uuid):
|
|||
def like(request, piece_uuid):
|
||||
if request.method != "POST":
|
||||
raise BadRequest()
|
||||
piece = get_object_or_404(Collection, uid=base62.decode(piece_uuid))
|
||||
piece = get_object_or_404(Piece, uid=base62.decode(piece_uuid))
|
||||
if not piece:
|
||||
raise Http404()
|
||||
Like.user_like_piece(request.user, piece)
|
||||
if request.GET.get("back"):
|
||||
return HttpResponseRedirect(request.META.get("HTTP_REFERER"))
|
||||
elif request.GET.get("stats"):
|
||||
return render(
|
||||
request,
|
||||
"like_stats.html",
|
||||
{"piece": piece, "liked": True},
|
||||
)
|
||||
return HttpResponse(_checkmark)
|
||||
|
||||
|
||||
|
@ -65,12 +71,18 @@ def like(request, piece_uuid):
|
|||
def unlike(request, piece_uuid):
|
||||
if request.method != "POST":
|
||||
raise BadRequest()
|
||||
piece = get_object_or_404(Collection, uid=base62.decode(piece_uuid))
|
||||
piece = get_object_or_404(Piece, uid=base62.decode(piece_uuid))
|
||||
if not piece:
|
||||
raise Http404()
|
||||
Like.user_unlike_piece(request.user, piece)
|
||||
if request.GET.get("back"):
|
||||
return HttpResponseRedirect(request.META.get("HTTP_REFERER"))
|
||||
elif request.GET.get("stats"):
|
||||
return render(
|
||||
request,
|
||||
"like_stats.html",
|
||||
{"piece": piece, "liked": False},
|
||||
)
|
||||
return HttpResponse(_checkmark)
|
||||
|
||||
|
||||
|
@ -266,7 +278,7 @@ def collection_retrieve(request, collection_uuid):
|
|||
raise PermissionDenied()
|
||||
follower_count = collection.likes.all().count()
|
||||
following = (
|
||||
Like.user_liked_piece(request.user, collection) is not None
|
||||
Like.user_liked_piece(request.user, collection)
|
||||
if request.user.is_authenticated
|
||||
else False
|
||||
)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
dateparser
|
||||
mistune @ git+https://github.com/alphatownsman/mistune.git@660b1c0100ecdd6cd6aca26a554be2606a67d67b
|
||||
django~=3.2.16
|
||||
django~=3.2.17
|
||||
django-markdownx @ git+https://github.com/alphatownsman/django-markdownx.git@e69480c64ad9c5d0499f4a8625da78cf2bb7691b
|
||||
django-jsoneditor @ git+https://github.com/alphatownsman/django-jsoneditor.git@fa2ae41aeeb34447bd8a808a520e843c853fd16e
|
||||
django-sass
|
||||
|
@ -32,3 +32,4 @@ markdownify
|
|||
igdb-api-v4
|
||||
podcastparser
|
||||
listparser
|
||||
fontawesomefree~=6.3.0
|
||||
|
|
|
@ -21,15 +21,35 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<div class="entity-list__entity-text">
|
||||
<div class="collection-item-position-edit">
|
||||
<span class="entity-marks__mark-time">
|
||||
<div class="action-bar">
|
||||
{% if activity.action_object.mark.text %}
|
||||
<!--
|
||||
<span style="margin-right:8px;">
|
||||
<i class="fa-regular fa-bookmark"></i>
|
||||
</span>
|
||||
|
||||
<span style="margin-right:8px;">
|
||||
<i class="fa-regular fa-comment icon"></i>
|
||||
</span>
|
||||
|
||||
<span style="margin-right:8px;">
|
||||
<i class="fa-solid fa-repeat icon"></i>
|
||||
</span>
|
||||
-->
|
||||
<span style="margin-right:8px;">
|
||||
{% liked_piece activity.action_object as liked %}
|
||||
{% include 'like_stats.html' with liked=liked piece=activity.action_object %}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<span>
|
||||
{% if activity.action_object.metadata.shared_link %}
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" action_object="_blank">
|
||||
<img src="{% static 'img/fediverse.svg' %}" style="filter: invert(93%) sepia(1%) saturate(53%) hue-rotate(314deg) brightness(95%) contrast(80%); vertical-align:text-top; max-width:14px; margin-right:6px;" />
|
||||
<span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span>
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" target="_blank" title="打开联邦网络分享链接">
|
||||
<i class="fa-solid fa-circle-nodes icon-spin"></i>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a><span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span></a>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -19,30 +19,31 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<div class="entity-list__entity-text">
|
||||
<div class="collection-item-position-edit">
|
||||
<span class="entity-marks__mark-time">
|
||||
<div class="action-bar">
|
||||
<span>
|
||||
{% if activity.action_object.metadata.shared_link %}
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" action_object="_blank">
|
||||
<img src="{% static 'img/fediverse.svg' %}" style="filter: invert(93%) sepia(1%) saturate(53%) hue-rotate(314deg) brightness(95%) contrast(80%); vertical-align:text-top; max-width:14px; margin-right:6px;" />
|
||||
<span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span></a>
|
||||
{% else %}
|
||||
<a><span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span></a>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
<span class="entity-list__entity-info" style="top:0px;">
|
||||
<a href="{% url 'journal:user_profile' activity.owner.mastodon_username %}">{{ activity.owner.display_name }}</a> {% trans '创建了收藏单' %}
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" target="_blank" title="打开联邦网络分享链接">
|
||||
<i class="fa-solid fa-circle-nodes icon-spin"></i>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
<div class="entity-list__entity-title">
|
||||
<a href="{{ activity.action_object.url }}" class="entity-list__entity-link" style="font-weight:bold;">{{ activity.action_object.title }}
|
||||
{% if activity.action_object.year %}<small style="font-weight: lighter">({{ activity.action_object.year }})</small>{% endif %}
|
||||
</a>
|
||||
{% for res in activity.action_object.external_resources.all %}
|
||||
<a href="{{ res.url }}">
|
||||
<span class="source-label source-label__{{ res.site_name }}">{{ res.site_name.label }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<p class="entity-list__entity-brief">
|
||||
</p>
|
||||
</div>
|
||||
<span class="entity-list__entity-info" style="top:0px;">
|
||||
<a href="{% url 'journal:user_profile' activity.owner.mastodon_username %}">{{ activity.owner.display_name }}</a> {% trans '创建了收藏单' %}
|
||||
</span>
|
||||
<div class="entity-list__entity-title">
|
||||
<a href="{{ activity.action_object.url }}" class="entity-list__entity-link" style="font-weight:bold;">{{ activity.action_object.title }}
|
||||
{% if activity.action_object.year %}<small style="font-weight: lighter">({{ activity.action_object.year }})</small>{% endif %}
|
||||
</a>
|
||||
{% for res in activity.action_object.external_resources.all %}
|
||||
<a href="{{ res.url }}">
|
||||
<span class="source-label source-label__{{ res.site_name }}">{{ res.site_name.label }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<p class="entity-list__entity-brief">
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -20,15 +20,15 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<div class="entity-list__entity-text">
|
||||
<div class="collection-item-position-edit">
|
||||
<span class="entity-marks__mark-time">
|
||||
<div class="action-bar">
|
||||
<span>
|
||||
{% if activity.action_object.metadata.shared_link %}
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" action_object="_blank">
|
||||
<img src="{% static 'img/fediverse.svg' %}" style="filter: invert(93%) sepia(1%) saturate(53%) hue-rotate(314deg) brightness(95%) contrast(80%); vertical-align:text-top; max-width:14px; margin-right:6px;" />
|
||||
<span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span>
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" target="_blank" title="打开联邦网络分享链接">
|
||||
<i class="fa-solid fa-circle-nodes icon-spin"></i>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a><span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span></a>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -19,15 +19,15 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<div class="entity-list__entity-text">
|
||||
<div class="collection-item-position-edit">
|
||||
<span class="entity-marks__mark-time">
|
||||
<div class="action-bar">
|
||||
<span>
|
||||
{% if activity.action_object.metadata.shared_link %}
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" action_object="_blank">
|
||||
<img src="{% static 'img/fediverse.svg' %}" style="filter: invert(93%) sepia(1%) saturate(53%) hue-rotate(314deg) brightness(95%) contrast(80%); vertical-align:text-top; max-width:14px; margin-right:6px;" />
|
||||
<span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span>
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" target="_blank" title="打开联邦网络分享链接">
|
||||
<i class="fa-solid fa-circle-nodes icon-spin"></i>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a><span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span></a>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
{% load user_actions %}
|
||||
|
||||
{% wish_item_action activity.action_object.item as action %}
|
||||
{% like_piece_action activity.action_object as like_action %}
|
||||
|
||||
<div class="entity-list__entity-img-wrapper">
|
||||
<a href="{{ activity.action_object.item.url }}">
|
||||
|
@ -20,15 +21,35 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<div class="entity-list__entity-text">
|
||||
<div class="collection-item-position-edit">
|
||||
<span class="entity-marks__mark-time">
|
||||
<div class="action-bar">
|
||||
{% if activity.action_object.mark.text %}
|
||||
<!--
|
||||
<span style="margin-right:8px;">
|
||||
<i class="fa-regular fa-bookmark"></i>
|
||||
</span>
|
||||
|
||||
<span style="margin-right:8px;">
|
||||
<i class="fa-regular fa-comment icon"></i>
|
||||
</span>
|
||||
|
||||
<span style="margin-right:8px;">
|
||||
<i class="fa-solid fa-repeat icon"></i>
|
||||
</span>
|
||||
-->
|
||||
<span style="margin-right:8px;">
|
||||
{% liked_piece activity.action_object as liked %}
|
||||
{% include 'like_stats.html' with liked=liked piece=activity.action_object %}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<span>
|
||||
{% if activity.action_object.metadata.shared_link %}
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" action_object="_blank">
|
||||
<img src="{% static 'img/fediverse.svg' %}" style="filter: invert(93%) sepia(1%) saturate(53%) hue-rotate(314deg) brightness(95%) contrast(80%); vertical-align:text-top; max-width:14px; margin-right:6px;" />
|
||||
<span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span>
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" target="_blank" title="打开联邦网络分享链接">
|
||||
<i class="fa-solid fa-circle-nodes icon-spin"></i>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a><span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span></a>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
@ -56,4 +77,9 @@
|
|||
<p class="entity-marks__mark-content">{{ activity.action_object.mark.comment_html|safe }}</p>
|
||||
{% endif %}
|
||||
</p>
|
||||
<!--
|
||||
<p>
|
||||
reply 1
|
||||
</p>
|
||||
-->
|
||||
</div>
|
||||
|
|
|
@ -19,15 +19,35 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<div class="entity-list__entity-text">
|
||||
<div class="collection-item-position-edit">
|
||||
<span class="entity-marks__mark-time">
|
||||
<div class="action-bar">
|
||||
{% if activity.action_object.mark.text %}
|
||||
<!--
|
||||
<span style="margin-right:8px;">
|
||||
<i class="fa-regular fa-bookmark"></i>
|
||||
</span>
|
||||
|
||||
<span style="margin-right:8px;">
|
||||
<i class="fa-regular fa-comment icon"></i>
|
||||
</span>
|
||||
|
||||
<span style="margin-right:8px;">
|
||||
<i class="fa-solid fa-repeat icon"></i>
|
||||
</span>
|
||||
-->
|
||||
<span>
|
||||
{% liked_piece activity.action_object as liked %}
|
||||
{% include 'like_stats.html' with liked=liked piece=activity.action_object %}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<span>
|
||||
{% if activity.action_object.metadata.shared_link %}
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" action_object="_blank">
|
||||
<img src="{% static 'img/fediverse.svg' %}" style="filter: invert(93%) sepia(1%) saturate(53%) hue-rotate(314deg) brightness(95%) contrast(80%); vertical-align:text-top; max-width:14px; margin-right:6px;" />
|
||||
<span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span>
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" target="_blank" title="打开联邦网络分享链接">
|
||||
<i class="fa-solid fa-circle-nodes icon-spin"></i>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a><span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span></a>
|
||||
<span>{{ activity.action_object.created_time|prettydate }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -37,7 +37,9 @@
|
|||
</h5>
|
||||
</div> -->
|
||||
<ul class="entity-list__entities">
|
||||
<div hx-get="{% url 'social:data' %}" hx-trigger="revealed" hx-swap="outerHTML"></div>
|
||||
<div hx-get="{% url 'social:data' %}" hx-trigger="revealed" hx-swap="outerHTML">
|
||||
<i class="fas fa-fan fa-spin"></i>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -17,62 +17,11 @@
|
|||
</li>
|
||||
|
||||
{% if forloop.last %}
|
||||
<div class="htmx-indicator" style="margin-left: 60px;"
|
||||
<div class="htmx-indicator" style="margin-left: 60px;"
|
||||
hx-get="{% url 'social:data' %}?last={{ activity.created_time|date:'Y-m-d H:i:s.uO'|urlencode }}"
|
||||
hx-trigger="revealed"
|
||||
hx-swap="outerHTML">
|
||||
<svg width="16" height="16" viewBox="0 0 135 140" xmlns="http://www.w3.org/2000/svg" fill="#ccc">
|
||||
<rect y="10" width="15" height="120" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0.5s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0.5s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
<rect x="30" y="10" width="15" height="120" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0.25s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0.25s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
<rect x="60" width="15" height="140" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
<rect x="90" y="10" width="15" height="120" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0.25s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0.25s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
<rect x="120" y="10" width="15" height="120" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0.5s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0.5s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
</svg>
|
||||
<i class="fas fa-circle-notch fa-spin"></i>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% empty %}
|
||||
|
@ -93,4 +42,4 @@ hx-swap="outerHTML">
|
|||
starSize: 15,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -82,9 +82,7 @@
|
|||
<div class="relation-dropdown">
|
||||
<div class="relation-dropdown__button">
|
||||
<span class="icon-arrow">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
||||
<path d="M8.12,3.29,5,6.42,1.86,3.29H.45L5,7.84,9.55,3.29Z" />
|
||||
</svg>
|
||||
<i class="fas fa-angle-down"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="relation-dropdown__body">
|
||||
|
|
Loading…
Add table
Reference in a new issue