+
+
+
+
-
-
-
-
-
-

-
-
- {% if book.isbn %}
-
ISBN: {{ book.isbn }}
+ {% if marks.pagination.has_prev %}
+
+
{% endif %}
-
-
{% if book.pub_house %}{% trans '出版社:' %}{{ book.pub_house }}{% endif %}
- {% if book.rating %}
- {% trans '评分: ' %}
+
+ {% for page in marks.pagination.page_range %}
+
+ {% if page == marks.pagination.current_page %}
+
+ {% else %}
+
{% endif %}
-
+
+ {% endfor %}
+
+ {% if marks.pagination.has_next %}
+
+
+ {% endif %}
+
+
+
+
+
+
+

+
+
+
+
+ {% if book.isbn %}
+
ISBN: {{ book.isbn }}
+ {% endif %}
+
+
{% if book.pub_house %}{% trans '出版社:' %}{{ book.pub_house }}{% endif %}
+ {% if book.rating %}
+ {% trans '评分: ' %}
+
{{ book.rating }}
+ {% endif %}
+
+
+
+
+
+
-
+ {% include "partial/_footer.html" %}
@@ -161,16 +143,7 @@
if (q)
location.href = "{% url 'common:search' %}" + "?q=" + q;
}
- });
- ratingLabels = $("#aside .rating-star");
- $(ratingLabels).each( function(index, value) {
- let ratingScore = $(this).data("rating-score") / 2;
- $(this).starRating({
- initialRating: ratingScore,
- readOnly: true,
- starSize: 15,
- });
- });
+ });
diff --git a/books/templates/books/review_detail.html b/books/templates/books/review_detail.html
index afca679c..83f8cb72 100644
--- a/books/templates/books/review_detail.html
+++ b/books/templates/books/review_detail.html
@@ -9,105 +9,103 @@
-
+ {% include "partial/_navbar.html" %}
-
-
-
-
-
-
-
-
-
- {{ review.title }}
- {% if review.is_private %}
-
- {% endif %}
-
-
{{ review.owner.username }}
-
- {% if mark %}
-
- {% if mark.rating %}
-
- {% endif %}
-
- {% endif %}
-
-
{{ review.edited_time }}
-
-
- {% if request.user == review.owner %}
-
-
+
+
+
+
+
+
+ {{ review.title }}
+
+ {% if review.is_private %}
+
+
+
{% endif %}
-
+
+
+
+
{{ review.owner.username }}
+
+ {% if mark %}
+
+ {% if mark.rating %}
+
+ {% endif %}
+
+ {% endif %}
+
+
{{ review.edited_time }}
+
+
+
+
+
+
+ {{ form.content }}
+
+ {{ form.media }}
-
-
- {{ form.content }}
+
+
+
+
+
+
+
+

+
+
+
+
+ {% if book.isbn %}
+
ISBN: {{ book.isbn }}
+ {% endif %}
+
+
{% if book.pub_house %}{% trans '出版社:' %}{{ book.pub_house }}{% endif %}
+ {% if book.rating %}
+ {% trans '评分: ' %}
+
{{ book.rating }}
+ {% endif %}
+
+
- {{ form.media }}
-
-
-
-

-
-
- {% if book.isbn %}
-
ISBN: {{ book.isbn }}
- {% endif %}
-
{% if book.author %}{% trans '作者:' %}
- {% for author in book.author %}
- {{ author }}
- {% endfor %}
- {% endif %}
-
{% if book.pub_house %}{% trans '出版社:' %}{{ book.pub_house }}{% endif %}
-
{%if book.pub_year %}{% trans '出版时间:' %}{{ book.pub_year }}{% trans '年' %}{% if book.pub_month %}{{ book.pub_month }}{% trans '月' %}{% endif %}{% endif %}
-
- {% if book.rating %}
- {% trans '评分: ' %}
- {% endif %}
-
-
-
-
+
-
+ {% include "partial/_footer.html" %}
@@ -126,15 +124,7 @@
location.href = "{% url 'common:search' %}" + "?q=" + q;
}
});
- ratingLabels = $("#aside .rating-star");
- $(ratingLabels).each( function(index, value) {
- let ratingScore = $(this).data("rating-score") / 2;
- $(this).starRating({
- initialRating: ratingScore,
- readOnly: true,
- starSize: 15,
- });
- });
+
$(".markdownx textarea").hide();
diff --git a/books/templates/books/review_list.html b/books/templates/books/review_list.html
index 1630ac57..9ee12197 100644
--- a/books/templates/books/review_list.html
+++ b/books/templates/books/review_list.html
@@ -10,135 +10,109 @@
-
-
{% trans 'Nicedb - 搜索结果' %}
+
+
{% trans 'Nicedb - ' %}{{ book.title }}{% trans '的评论' %}
-
-
+
+
+
-
+ {% include "partial/_navbar.html" %}
-
-
-
-
-
-
- {% for review in reviews %}
-
-
-
-
-
{{ review.title }}
-
-
+
+
+
+
+
- {% empty %}
- {% trans '无结果' %}
- {% endfor %}
-
-
-
-
-
-
-
-

-
-
- {% if book.isbn %}
-
ISBN: {{ book.isbn }}
+ {% if reviews.pagination.has_prev %}
+
+
{% endif %}
-
-
{% if book.pub_house %}{% trans '出版社:' %}{{ book.pub_house }}{% endif %}
- {% if book.rating %}
- {% trans '评分: ' %}
+
+ {% for page in reviews.pagination.page_range %}
+
+ {% if page == reviews.pagination.current_page %}
+
+ {% else %}
+
{% endif %}
-
+
+ {% endfor %}
+
+ {% if reviews.pagination.has_next %}
+
+
+ {% endif %}
+
+
+
+
+
+
+

+
+
+
+
+ {% if book.isbn %}
+
ISBN: {{ book.isbn }}
+ {% endif %}
+
+
{% if book.pub_house %}{% trans '出版社:' %}{{ book.pub_house }}{% endif %}
+ {% if book.rating %}
+ {% trans '评分: ' %}
+
{{ book.rating }}
+ {% endif %}
+
+
+
+
+
+
-
+ {% include "partial/_footer.html" %}
@@ -157,15 +131,6 @@
location.href = "{% url 'common:search' %}" + "?q=" + q;
}
});
- ratingLabels = $("#aside .rating-star");
- $(ratingLabels).each( function(index, value) {
- let ratingScore = $(this).data("rating-score") / 2;
- $(this).starRating({
- initialRating: ratingScore,
- readOnly: true,
- starSize: 15,
- });
- });
diff --git a/books/templates/books/scrape.html b/books/templates/books/scrape.html
index 2f5af257..d3e0cea2 100644
--- a/books/templates/books/scrape.html
+++ b/books/templates/books/scrape.html
@@ -9,54 +9,49 @@
-
+
{% trans 'Nicedb - 主页' %}
-
-
+
+
+
-
+ {% include "partial/_navbar.html" %}
+
+
+
+
+
+
+
+ {% trans '根据豆瓣内容填写下方表单' %}
+
+
+
+
-
-
+ {% include "partial/_footer.html" %}
-
-
+
+
+
+
-
-
-
-
-
-
-
-
- {% trans '想读的书' %}
-
- {% if wish_books_more %}
-
{% trans '更多' %}
- {% endif %}
-
-
-
-
-
- {% trans '在读的书' %}
-
- {% if do_books_more %}
-
{% trans '更多' %}
- {% endif %}
-
-
-
-
-
- {% trans '读过的书' %}
-
- {% if collect_books_more %}
-
{% trans '更多' %}
- {% endif %}
-
-
-
-
-
-
-
-
-
![{{ user.username }}]()
-
-
-
+ {% include "partial/_navbar.html" %}
+
+
+
+
+
+
+
+
+
+ {% trans '想读的书' %}
+
+ {% if wish_books_more %}
+
{% trans '更多' %}
+ {% endif %}
+
+
-
-
-
- {% if request.user != user %}
-
{% trans '举报用户' %}
- {% endif %}
-
+
+
+
+ {% trans '在读的书' %}
+
+ {% if do_books_more %}
+
{% trans '更多' %}
+ {% endif %}
+
+
+
+
+
+
+ {% trans '读过的书' %}
+
+ {% if collect_books_more %}
+
{% trans '更多' %}
+ {% endif %}
+
+
+
+
-
-
- {% if request.user.is_staff %}
-
-
{% trans '举报信息' %}
-
-
全部举报
-
- {% endif %}
-
+
+
+
+
+
+
+
+
+
+
+ {% if request.user.is_staff and request.user == user%}
+
+
{% trans '举报信息' %}
+
全部举报
+
+
+ {% endif %}
+
+
+
+
+
+
-
+ {% include "partial/_footer.html" %}
{% oauth_token %}
{% mastodon %}
-
+
{{ user.mastodon_id }}
{% url 'users:home' 0 %}?is_mastodon_id=true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
-
+
-
-
-
+ {% include 'partial/_navbar.html' %}
+
+
+
+
+
+
+
+ {% if request.GET.q %}
+
“{{ request.GET.q }}”{% trans '的搜索结果' %}
+ {% endif %}
+
+
+ {% for book in items %}
+
+ -
+
+
+
+
+
+ {% if book.rating %}
+
+
{{ book.rating }}
+ {% else %}
+
{% trans '暂无评分' %}
+ {% endif %}
+
+
+ {% if book.pub_year %}
+ {{ book.pub_year }}{% trans '年' %}
+ {% if book.pub_month %}
+ {{book.pub_month }}{% trans '月' %} /
+ {% endif %}
+ {% endif %}
+
+ {% if book.author %}
+ {% trans '作者' %}
+ {% for author in book.author %}
+ {{ author }}{% if not forloop.last %},{% endif %}
+ {% endfor %}/
+ {% endif %}
+
+ {% if book.translator %}
+ {% trans '译者' %}
+ {% for translator in book.translator %}
+ {{ translator }}{% if not forloop.last %},{% endif %}
+ {% endfor %}/
+ {% endif %}
+
+ {% if book.orig_title %}
+ {% trans '原名' %}
+ {{ book.orig_title }}
+ {% endif %}
+
+
+ {{ book.brief }}
+
+
+
+ {% empty %}
+ {% trans '无结果' %}
+ {% endfor %}
+
+
+
+
+
+
+
+
+
-
-
-
-
- {% if request.GET.q %}
-
-
- “{{ request.GET.q }}” {% trans '的搜索结果' %}
-
-
- {% endif %}
-
-
- {% for book in items %}
-
- -
-
-
-
-
-
-
- {% if request.GET.q %}
- {{ book.title | highlight:request.GET.q }}
- {% else %}
- {{ book.title }}
- {% endif %}
-
- {% if book.rating %}
-
-
-
- {{ book.rating }}
-
- {% else %}
-
{% trans '暂无评分' %}
- {% endif %}
-
- {% if book.pub_year %}
- {{ book.pub_year }}{% trans '年' %} /
- {% if book.pub_month %}
- {{book.pub_month }}{% trans '月' %} /
- {% endif %}
- {% endif %}
-
- {% if book.author %}
- {% trans '作者' %}
- {% for author in book.author %}
- {{ author }}{% if not forloop.last %},{% endif %}
- {% endfor %}/
- {% endif %}
-
- {% if book.translator %}
- {% trans '译者' %}
- {% for translator in book.translator %}
- {{ translator }}{% if not forloop.last %},{% endif %}
- {% endfor %}/
- {% endif %}
-
- {% if book.orig_title %}
- {% trans '原名' %}
- {{ book.orig_title }}
- {% endif %}
-
-
- {{ book.brief | truncate:170 }}
-
-
-
- {% empty %}
- {% trans '无结果' %}
- {% endfor %}
-
-
-
-
-
-
-
-
+ {% include 'partial/_footer.html' %}
diff --git a/common/templates/partial/_footer.html b/common/templates/partial/_footer.html
new file mode 100644
index 00000000..ca67fb66
--- /dev/null
+++ b/common/templates/partial/_footer.html
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/common/templates/partial/_navbar.html b/common/templates/partial/_navbar.html
new file mode 100644
index 00000000..2f586f69
--- /dev/null
+++ b/common/templates/partial/_navbar.html
@@ -0,0 +1,28 @@
+{% load static %}
+{% load i18n %}
+{% load admin_url %}
+
+
+
\ No newline at end of file
diff --git a/common/templates/widgets/image.html b/common/templates/widgets/image.html
index f469416d..114541bb 100644
--- a/common/templates/widgets/image.html
+++ b/common/templates/widgets/image.html
@@ -1,2 +1,15 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/common/utils.py b/common/utils.py
new file mode 100644
index 00000000..b3f1ed98
--- /dev/null
+++ b/common/utils.py
@@ -0,0 +1,57 @@
+class PageLinksGenerator:
+ # TODO inherit django paginator
+ """
+ Calculate the pages for multiple links pagination.
+ length -- the number of page links in pagination
+ """
+ def __init__(self, length, current_page, total_pages):
+ current_page = int(current_page)
+ self.current_page = current_page
+ self.start_page = None
+ self.end_page = None
+ self.page_range = None
+ self.has_prev = None
+ self.has_next = None
+
+ start_page = current_page - length // 2
+ end_page = current_page + length // 2
+
+ # decision is based on the start page and the end page
+ # both sides overflow
+ if (start_page < 1 and end_page > total_pages)\
+ or length >= total_pages:
+ self.start_page = 1
+ self.end_page = total_pages
+ self.has_prev = False
+ self.has_next = False
+
+ elif start_page < 1 and not end_page > total_pages:
+ self.start_page = 1
+ # this won't overflow because the total pages are more than the length
+ self.end_page = end_page - (start_page - 1)
+ self.has_prev = False
+ if end_page == total_pages:
+ self.has_next = False
+ else:
+ self.has_next = True
+
+ elif not start_page < 1 and end_page > total_pages:
+ self.end_page = total_pages
+ self.start_page = start_page - (end_page - total_pages)
+ self.has_next = False
+ if start_page == 1:
+ self.has_prev = False
+ else:
+ self.has_prev = True
+
+ # both sides do not overflow
+ elif not start_page < 1 and not end_page > total_pages:
+ self.start_page = start_page
+ self.end_page = end_page
+ self.has_prev = True
+ self.has_next = True
+
+ self.first_page = 1
+ self.last_page = total_pages
+ self.page_range = range(self.start_page, self.end_page + 1)
+ # assert self.has_prev is not None and self.has_next is not None
\ No newline at end of file
diff --git a/common/views.py b/common/views.py
index 38114751..80bdcb4c 100644
--- a/common/views.py
+++ b/common/views.py
@@ -2,6 +2,7 @@ from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from books.models import Book
from common.models import MarkStatusEnum
+from common.utils import PageLinksGenerator
from users.models import Report, User
from django.core.paginator import Paginator
from django.db.models import Q
@@ -14,6 +15,9 @@ BOOKS_PER_SET = 5
# how many items are showed in one search result page
ITEMS_PER_PAGE = 20
+# how many pages links in the pagination
+PAGE_LINK_NUMBER = 7
+
@login_required
def home(request):
@@ -66,6 +70,7 @@ def search(request):
paginator = Paginator(queryset, ITEMS_PER_PAGE)
page_number = request.GET.get('page', default=1)
items = paginator.get_page(page_number)
+ items.pagination = PageLinksGenerator(PAGE_LINK_NUMBER, page_number, paginator.num_pages)
return render(
request,
diff --git a/users/auth.py b/users/auth.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/users/forms.py b/users/forms.py
index cf04969a..6de4bd53 100644
--- a/users/forms.py
+++ b/users/forms.py
@@ -1,7 +1,7 @@
from django import forms
from .models import Report
from django.utils.translation import gettext_lazy as _
-
+from common.forms import PreviewImageInput
class ReportForm(forms.ModelForm):
class Meta:
@@ -13,6 +13,8 @@ class ReportForm(forms.ModelForm):
]
widgets = {
'message': forms.Textarea(attrs={'placeholder': _("详情")}),
+ 'image': PreviewImageInput()
+ # 'reported_user': forms.TextInput(),
}
labels = {
'reported_user': _("举报的用户"),
diff --git a/users/static/js/followers_list.js b/users/static/js/followers_list.js
index 75b04ece..7c5f31ce 100644
--- a/users/static/js/followers_list.js
+++ b/users/static/js/followers_list.js
@@ -11,29 +11,29 @@ $(document).ready( function() {
let followingSpinner = $("#spinner").clone().removeAttr("hidden");
let mainSpinner = $("#spinner").clone().removeAttr("hidden");
- $("#main .user:first").hide();
+ $(".mast-user:first").hide();
- $("#main").append(mainSpinner);
+ $(".mast-user-list").append(mainSpinner);
$("#userInfoCard").append(userInfoSpinner);
- $("#userRelationCard h5:first").append(followingSpinner);
- $("#userRelationCard h5:last").append(followersSpinner);
+ $("#followings h5").after(followingSpinner);
+ $("#followers h5").after(followersSpinner);
$(".mast-following-more").hide();
$(".mast-followers-more").hide();
getUserInfo(
- id,
- mast_uri,
- token,
- function(userData) {
+ id,
+ mast_uri,
+ token,
+ function (userData) {
let userName;
if (userData.display_name) {
- userName = translateEmojis(userData.display_name, userData.emojis);
+ userName = translateEmojis(userData.display_name, userData.emojis, true);
} else {
userName = userData.username;
}
- $(".mast-user .mast-avatar").attr("src", userData.avatar);
- $(".mast-user .mast-displayname").html(userName);
- $(".mast-user .mast-brief").text($(userData.note).text());
+ $("#userInfoCard .mast-avatar").attr("src", userData.avatar);
+ $("#userInfoCard .mast-displayname").html(userName);
+ $("#userInfoCard .mast-brief").text($(userData.note).text());
$(userInfoSpinner).remove();
}
);
@@ -46,6 +46,7 @@ $(document).ready( function() {
let subUserList = null;
if (userList.length == 0) {
$(".mast-followers").hide();
+ $(".mast-followers").before("暂无
");
} else {
if (userList.length > 4){
subUserList = userList.slice(0, 4);
@@ -57,9 +58,9 @@ $(document).ready( function() {
temp = $(template).clone();
temp.find("img").attr("src", data.avatar);
if (data.display_name) {
- temp.find("a").html(translateEmojis(data.display_name, data.emojis));
+ temp.find(".mast-displayname").html(translateEmojis(data.display_name, data.emojis));
} else {
- temp.find("a").text(data.username);
+ temp.find(".mast-displayname").text(data.username);
}
let url = $("#userPageURL").text().replace('0', data.id);
temp.find("a").attr('href', url);
@@ -68,20 +69,20 @@ $(document).ready( function() {
}
$(followersSpinner).remove();
// main
- let template = $("#main .user").clone().show();
+ let template = $(".mast-user").clone().show();
userList.forEach(data => {
temp = $(template).clone();
- temp.find(".avatar").attr("src", data.avatar);
+ temp.find("img").attr("src", data.avatar);
if (data.display_name) {
- temp.find(".user-name").html(translateEmojis(data.display_name, data.emojis));
+ temp.find(".mast-displayname").html(translateEmojis(data.display_name, data.emojis));
} else {
- temp.find(".user-name").text(data.username);
+ temp.find(".mast-displayname").text(data.username);
}
let url = $("#userPageURL").text().replace('0', data.id);
temp.find("a").attr('href', url);
- temp.find(".user-brief").text(data.note.replace(/(<([^>]+)>)/ig,""));
- $("#main .user:last").after(temp);
+ temp.find(".mast-brief").text(data.note.replace(/(<([^>]+)>)/ig,""));
+ $(".mast-user:last").after(temp);
});
mainSpinner.hide();
@@ -99,30 +100,31 @@ $(document).ready( function() {
mast_uri,
token,
function(userList, request) {
- // aside
if (userList.length == 0) {
- $("#aside .mast-following").hide();
+ $(".mast-following").hide();
+ $(".mast-following").before("暂无
");
} else {
if (userList.length > 4){
userList = userList.slice(0, 4);
- $("#aside .mast-following-more").show();
+ $(".mast-following-more").show();
}
- let template = $("#aside .mast-following li").clone();
- $("#aside .mast-following").html("");
+ let template = $(".mast-following li").clone();
+ $(".mast-following").html("");
userList.forEach(data => {
temp = $(template).clone()
temp.find("img").attr("src", data.avatar);
if (data.display_name) {
- temp.find("a").html(translateEmojis(data.display_name, data.emojis));
+ temp.find(".mast-displayname").html(translateEmojis(data.display_name, data.emojis));
} else {
- temp.find("a").text(data.username);
+ temp.find(".mast-displayname").text(data.username);
}
let url = $("#userPageURL").text().replace('0', data.id);
temp.find("a").attr('href', url);
- $("#aside .mast-following").append(temp);
+ $(".mast-following").append(temp);
});
}
$(followingSpinner).remove();
+
}
);
@@ -149,7 +151,7 @@ $(document).ready( function() {
mainSpinner.hide();
return;
}
- let template = $("#main .user:first").clone().show();
+ let template = $(".mast-user:first").clone().show();
let newUrlFlag = false;
request.getResponseHeader('link').split(',').forEach(link => {
if (link.includes('next')) {
@@ -163,16 +165,17 @@ $(document).ready( function() {
}
userList.forEach(data => {
temp = $(template).clone()
- temp.find(".avatar").attr("src", data.avatar);
+ temp.find("img").attr("src", data.avatar);
if (data.display_name) {
- temp.find(".user-name").html(translateEmojis(data.display_name, data.emojis));
+ temp.find(".mast-displayname").html(translateEmojis(data.display_name, data.emojis));
} else {
- temp.find(".user-name").text(data.username);
+ temp.find(".mast-displayname").text(data.username);
}
let url = $("#userPageURL").text().replace('0', data.id);
temp.find("a").attr('href', url);
- temp.find(".user-brief").text($(data.note).text());
- $("#main .user:last").after(temp);
+ temp.find(".mast-brief").text($(data.note).text());
+ // console.log($(temp).html())
+ $(".mast-user:last").after(temp);
});
mainSpinner.hide();
// release lock
diff --git a/users/static/js/following_list.js b/users/static/js/following_list.js
index 1bb15910..c27dfc3f 100644
--- a/users/static/js/following_list.js
+++ b/users/static/js/following_list.js
@@ -11,29 +11,29 @@ $(document).ready( function() {
let followingSpinner = $("#spinner").clone().removeAttr("hidden");
let mainSpinner = $("#spinner").clone().removeAttr("hidden");
- $("#main .user:first").hide();
+ $(".mast-user:first").hide();
- $("#main").append(mainSpinner);
+ $(".mast-user-list").append(mainSpinner);
$("#userInfoCard").append(userInfoSpinner);
- $("#userRelationCard h5:first").append(followingSpinner);
- $("#userRelationCard h5:last").append(followersSpinner);
+ $("#followings h5").after(followingSpinner);
+ $("#followers h5").after(followersSpinner);
$(".mast-following-more").hide();
$(".mast-followers-more").hide();
getUserInfo(
- id,
- mast_uri,
- token,
- function(userData) {
+ id,
+ mast_uri,
+ token,
+ function (userData) {
let userName;
if (userData.display_name) {
- userName = translateEmojis(userData.display_name, userData.emojis);
+ userName = translateEmojis(userData.display_name, userData.emojis, true);
} else {
userName = userData.username;
}
- $(".mast-user .mast-avatar").attr("src", userData.avatar);
- $(".mast-user .mast-displayname").html(userName);
- $(".mast-user .mast-brief").text($(userData.note).text());
+ $("#userInfoCard .mast-avatar").attr("src", userData.avatar);
+ $("#userInfoCard .mast-displayname").html(userName);
+ $("#userInfoCard .mast-brief").text($(userData.note).text());
$(userInfoSpinner).remove();
}
);
@@ -42,11 +42,12 @@ $(document).ready( function() {
id,
mast_uri,
token,
- function(userList, request) {
+ function (userList, request) {
if (userList.length == 0) {
$(".mast-followers").hide();
+ $(".mast-followers").before("暂无
");
} else {
- if (userList.length > 4){
+ if (userList.length > 4) {
userList = userList.slice(0, 4);
$(".mast-followers-more").show();
}
@@ -56,9 +57,9 @@ $(document).ready( function() {
temp = $(template).clone();
temp.find("img").attr("src", data.avatar);
if (data.display_name) {
- temp.find("a").html(translateEmojis(data.display_name, data.emojis));
+ temp.find(".mast-displayname").html(translateEmojis(data.display_name, data.emojis));
} else {
- temp.find("a").text(data.username);
+ temp.find(".mast-displayname").text(data.username);
}
let url = $("#userPageURL").text().replace('0', data.id);
temp.find("a").attr('href', url);
@@ -77,43 +78,44 @@ $(document).ready( function() {
// aside
let subUserList = null;
if (userList.length == 0) {
- $("#aside .mast-following").hide();
+ $(".mast-following").hide();
+ $(".mast-following").before("暂无
");
} else {
if (userList.length > 4){
subUserList = userList.slice(0, 4);
- $("#aside .mast-following-more").show();
+ $(".mast-following-more").show();
}
- let template = $("#aside .mast-following li").clone();
- $("#aside .mast-following").html("");
+ let template = $(".mast-following li").clone();
+ $(".mast-following").html("");
subUserList.forEach(data => {
temp = $(template).clone()
temp.find("img").attr("src", data.avatar);
if (data.display_name) {
- temp.find("a").html(translateEmojis(data.display_name, data.emojis));
+ temp.find(".mast-displayname").html(translateEmojis(data.display_name, data.emojis));
} else {
- temp.find("a").text(data.username);
+ temp.find(".mast-displayname").text(data.username);
}
let url = $("#userPageURL").text().replace('0', data.id);
temp.find("a").attr('href', url);
- $("#aside .mast-following").append(temp);
+ $(".mast-following").append(temp);
});
}
$(followingSpinner).remove();
// main
- let template = $("#main .user").clone().show();
+ let template = $(".mast-user").clone().show();
userList.forEach(data => {
temp = $(template).clone()
- temp.find(".avatar").attr("src", data.avatar);
+ temp.find("img").attr("src", data.avatar);
if (data.display_name) {
- temp.find(".user-name").html(translateEmojis(data.display_name, data.emojis));
+ temp.find(".mast-displayname").html(translateEmojis(data.display_name, data.emojis));
} else {
- temp.find(".user-name").text(data.username);
+ temp.find(".mast-displayname").text(data.username);
}
let url = $("#userPageURL").text().replace('0', data.id);
temp.find("a").attr('href', url);
- temp.find(".user-brief").text(data.note.replace(/(<([^>]+)>)/ig,""));
- $("#main .user:last").after(temp);
+ temp.find(".mast-brief").text(data.note.replace(/(<([^>]+)>)/ig,""));
+ $(".mast-user:last").after(temp);
});
mainSpinner.hide();
@@ -149,7 +151,7 @@ $(document).ready( function() {
mainSpinner.hide();
return;
}
- let template = $("#main .user:first").clone().show();
+ let template = $(".mast-user:first").clone().show();
let newUrlFlag = false;
request.getResponseHeader('link').split(',').forEach(link => {
if (link.includes('next')) {
@@ -161,23 +163,25 @@ $(document).ready( function() {
if (!newUrlFlag) {
nextUrl = null;
}
+ // console.log(userList.length)
userList.forEach(data => {
temp = $(template).clone()
- temp.find(".avatar").attr("src", data.avatar);
+ temp.find("img").attr("src", data.avatar);
if (data.display_name) {
- temp.find(".user-name").html(translateEmojis(data.display_name, data.emojis));
+ temp.find(".mast-displayname").html(translateEmojis(data.display_name, data.emojis));
} else {
- temp.find(".user-name").text(data.username);
+ temp.find(".mast-displayname").text(data.username);
}
let url = $("#userPageURL").text().replace('0', data.id);
temp.find("a").attr('href', url);
- temp.find(".user-brief").text($(data.note).text());
- $("#main .user:last").after(temp);
+ temp.find(".mast-brief").text($(data.note).text());
+ // console.log($(temp).html())
+ $(".mast-user:last").after(temp);
});
mainSpinner.hide();
- // release lock
// console.log(userList[userList.length-1].username)
// console.log(nextUrl)
+ // release lock
requesting = false;
},
});
diff --git a/users/templates/users/list.html b/users/templates/users/list.html
deleted file mode 100644
index 6563b50a..00000000
--- a/users/templates/users/list.html
+++ /dev/null
@@ -1,157 +0,0 @@
-{% load static %}
-{% load i18n %}
-{% load admin_url %}
-{% load mastodon %}
-{% load oauth_token %}
-{% load truncate %}
-{% load highlight %}
-
-
-
-
-
-
- {% if is_followers_page %}
- {% trans 'Nicedb - 被他们关注' %}
- {% else %}
- {% trans 'Nicedb - 关注的人' %}
- {% endif %}
-
-
-
- {% if is_followers_page %}
-
- {% else %}
-
- {% endif %}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {% if is_followers_page %}
- {% trans ' 被他们关注' %}
- {% else %}
- {% trans '关注的人' %}
- {% endif %}
-
-
-
![]()
-
-
-
-
-
-
-
-
-
-
-
-
-
{% oauth_token %}
-
{% mastodon %}
-
-
{{ user.mastodon_id }}
-
{% url 'users:home' 0 %}?is_mastodon_id=true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/users/templates/users/login.html b/users/templates/users/login.html
index 13a2d431..3891917d 100644
--- a/users/templates/users/login.html
+++ b/users/templates/users/login.html
@@ -5,7 +5,7 @@
-
+
@@ -13,7 +13,8 @@
-
+
+
@@ -25,6 +26,7 @@
{% endif %}
+
\ No newline at end of file
diff --git a/users/templates/users/manage_report.html b/users/templates/users/manage_report.html
index a9f4f208..a4332c5f 100644
--- a/users/templates/users/manage_report.html
+++ b/users/templates/users/manage_report.html
@@ -9,37 +9,23 @@
-
+
{% trans 'Nicedb - 管理举报' %}
-
-
+
+
+
-
+ {% include "partial/_navbar.html" %}
-
-
-
+
+
+
{% for report in reports %}
@@ -57,14 +43,11 @@
{% endfor %}
-
+
+
-
+ {% include "partial/_footer.html" %}
diff --git a/users/templates/users/register.html b/users/templates/users/register.html
index ccadbadc..38c9333a 100644
--- a/users/templates/users/register.html
+++ b/users/templates/users/register.html
@@ -5,7 +5,7 @@
-
+
@@ -23,11 +23,10 @@
里瓣书影音继承了长毛象的用户关系,比如您在里瓣屏蔽了某人,那您将不会在书影音的公共区域看到TA的痕迹。
这里仍是一片处女地,丰富的内容需要大家共同创造!
请注意虽然您可以随意发表任何言论,但试图添加垃圾数据到公共数据领域(如添加不存在的乱码的书籍)将会受到制裁!
- 本站使用了Cookie,请理解!
+ BTW欧盟惯例本站使用了Cookie,请理解!
- 此外里瓣书影音现处于“公开阿尔法测试”阶段,您的数据存在丢失的可能,现阶段将不对用户数据负责,请您理解风险后再决定继续使用!
-
+ 此外里瓣书影音现处于“公开阿尔法测试”阶段,您的数据存在丢失的可能