Merge pull request #42 from doubaniux/css-restructure

Css restructure
This commit is contained in:
doubaniux 2020-07-03 16:31:44 +08:00 committed by GitHub
commit e089e37d14
19 changed files with 45 additions and 17 deletions

View file

@ -104,14 +104,15 @@ def update(request, id):
@mastodon_request_included
@login_required
# @login_required
def retrieve(request, id):
if request.method == 'GET':
book = get_object_or_404(Book, pk=id)
mark = None
review = None
try:
mark = BookMark.objects.get(owner=request.user, book=book)
if request.user.is_authenticated:
mark = BookMark.objects.get(owner=request.user, book=book)
except ObjectDoesNotExist:
mark = None
if mark:
@ -123,18 +124,27 @@ def retrieve(request, id):
})
try:
review = BookReview.objects.get(owner=request.user, book=book)
if request.user.is_authenticated:
review = BookReview.objects.get(owner=request.user, book=book)
except ObjectDoesNotExist:
review = None
mark_list = BookMark.get_available(book, request.user, request.session['oauth_token'])
mark_list_more = True if len(mark_list) > MARK_NUMBER else False
mark_list = mark_list[:MARK_NUMBER]
for m in mark_list:
m.get_status_display = BookMarkStatusTranslator(m.status)
review_list = BookReview.get_available(book, request.user, request.session['oauth_token'])
review_list_more = True if len(review_list) > REVIEW_NUMBER else False
review_list = review_list[:REVIEW_NUMBER]
if request.user.is_anonymous:
mark_list = None
review_list = None
mark_list_more = None
review_list_more = None
else:
mark_list = BookMark.get_available(book, request.user, request.session['oauth_token'])
review_list = BookReview.get_available(book, request.user, request.session['oauth_token'])
mark_list_more = True if len(mark_list) > MARK_NUMBER else False
mark_list = mark_list[:MARK_NUMBER]
for m in mark_list:
m.get_status_display = BookMarkStatusTranslator(m.status)
review_list_more = True if len(review_list) > REVIEW_NUMBER else False
review_list = review_list[:REVIEW_NUMBER]
# def strip_html_tags(text):
# import re

View file

@ -144,10 +144,6 @@ textarea {
width: 100%;
}
input, select {
width: 100%;
}
label,
legend {
display: block;
@ -1073,6 +1069,11 @@ select::placeholder {
.main-section-wrapper {
padding: 32px 48px 32px 36px;
background-color: #f7f7f7;
overflow: auto;
}
.main-section-wrapper input, .main-section-wrapper select {
width: 100%;
}
.entity-list .entity-list__title {
@ -1525,6 +1526,7 @@ select::placeholder {
padding: 28px 25px 12px 25px;
background-color: #f7f7f7;
margin-bottom: 30px;
overflow: auto;
}
.aside-section-wrapper--transparent {
@ -1896,6 +1898,10 @@ select::placeholder {
overflow: auto;
}
.single-section-wrapper input, .single-section-wrapper select {
width: 100%;
}
.entity-form, .review-form {
overflow: auto;
}

View file

@ -10,6 +10,7 @@ $aside-section-padding-mobile: 24px 25px 10px 25px
padding: $aside-section-padding
background-color: $color-bright
margin-bottom: 30px
overflow: auto
&--transparent
background-color: unset

View file

@ -15,8 +15,8 @@ textarea
min-height: 6.5rem
width: 100%
input, select
width: 100%
// input, select
// width: 100%
label,
legend

View file

@ -9,6 +9,10 @@ $sub-section-title-margin: 8px
.main-section-wrapper
padding: $main-section-padding
background-color: $color-bright
overflow: auto
& input, & select
width: 100%
// for search result etc
.entity-list

View file

@ -5,6 +5,9 @@ $single-section-padding-mobile: 32px 28px
padding: $single-section-padding
background-color: $color-bright
overflow: auto
& input, & select
width: 100%
.entity-form, .review-form
overflow: auto

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

View file

@ -6,6 +6,10 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:title" content="{% trans 'Nicedb - 登录' %}">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ request.build_absolute_uri }}">
<meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{% static 'img/logo_square.svg' %}">
<link rel="stylesheet" href="{% static 'lib/css/milligram.css' %}">
<link rel="stylesheet" href="{% static 'css/boofilsic_edit.css' %}">
<link rel="stylesheet" href="{% static 'css/boofilsic_box.css' %}">