Skip to content

Commit 59607dc

Browse files
committed
add cover option
1 parent d5784ed commit 59607dc

File tree

10 files changed

+119
-80
lines changed

10 files changed

+119
-80
lines changed

application/back_end/db_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class KeUser(MyBaseModel): # kindleEar User
3535
book_config = JSONField(default=JSONField.dict_default)
3636

3737
share_links = JSONField(default=JSONField.dict_default) #evernote/wiz/pocket/instapaper包含子字典,微博/facebook/twitter等仅包含0/1
38-
covers = JSONField(default=JSONField.dict_default) #保存封面图片数据库ID {'order':,'cover0':,...'cover6':}
38+
covers = JSONField(default=JSONField.dict_default) #保存封面图片数据库ID {'enable':,'order':,'cover0':,...'cover6':}
3939
send_mail_service = JSONField(default=JSONField.dict_default) #{'service':,...}
4040
custom = JSONField(default=JSONField.dict_default) #留着扩展,避免后续一些小特性还需要升级数据表结构
4141

application/static/base.js

+1
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,7 @@ function SetCoverToDefaultImg(idx) {
13101310
function startUploadCoversToServer(url) {
13111311
var totalSize = 0;
13121312
var fileDatas = new FormData();
1313+
fileDatas.append('enable', $('#enableCover').val());
13131314
fileDatas.append('order', $('#coverOrder').val());
13141315
for (var idx = 0; idx < 7; idx++) {
13151316
var coverName = 'cover' + idx;

application/templates/adv_uploadcover.html

+17-10
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,28 @@
44
{% endblock -%}
55

66
{% block advcontent -%}
7-
<form class="pure-form" id="uploadForm" action="{{uploadUrl}}" method="POST" enctype="multipart/form-data" onsubmit="return false;">
7+
<form class="pure-form pure-form-aligned" id="uploadForm" action="{{uploadUrl}}" method="POST" enctype="multipart/form-data" onsubmit="return false;">
88
<fieldset>
99
<legend>{{_("Upload cover image")}}</legend>
10-
<p><small>{{_("Upload cover images from local with an aspect ratio of approximately 0.65.")}}</small></p>
10+
<p><small>{{_("Upload cover images from local with an aspect ratio of approximately 0.625.")}}</small></p>
1111
<div class="box-list">
12+
<div class="pure-control-group" style="margin-top: 10px">
13+
<label>{{_("Include cover")}}</label>
14+
<select class="pure-u-1 pure-u-sm-9-24" name="enable" id="enableCover">
15+
<option value="" {% if not covers.get('enable', '') %}selected="selected"{% endif %}>{{_("Disable")}}</option>
16+
<option value="1" {% if covers.get('enable') %}selected="selected"{% endif %}>{{_("Enable")}}</option>
17+
</select>
18+
</div>
19+
<div class="pure-control-group">
20+
<label>{{_("Rule for cover")}}</label>
21+
<select class="pure-u-1 pure-u-sm-9-24" name="order" id="coverOrder">
22+
<option value="random" {% if covers.get('order', 'random') == 'random' %}selected="selected"{% endif %}>{{_("Random")}}</option>
23+
<option value="weekday" {% if covers.get('order') == 'weekday' %}selected="selected"{% endif %}>{{_("Weekday")}}</option>
24+
</select>
25+
</div>
26+
<hr style="width: 90%" />
1227
<div id="preview" class="imgupBox">
1328
<div class="imgFileUploade">
14-
<div class="pure-control-group">
15-
<label style="margin: 0px 20px">{{_("Rule to pick cover images")}}</label>
16-
<select class="pure-u-1 pure-u-sm-9-24" name="order" id="coverOrder">
17-
<option value="random" {% if covers.get('order', 'random') == 'random' %}selected="selected"{% endif %}>{{_("Random")}}</option>
18-
<option value="weekday" {% if covers.get('order') == 'weekday' %}selected="selected"{% endif %}>{{_("Weekday")}}</option>
19-
</select>
20-
</div>
21-
<hr style="width: 90%" />
2229
<div class="imgAll">
2330
<ul>
2431
{% for idx in range(7) -%}

application/translations/messages.pot

+29-21
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PROJECT VERSION\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2024-11-23 21:29-0300\n"
11+
"POT-Creation-Date: 2024-11-24 09:32-0300\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -383,6 +383,7 @@ msgid ""
383383
msgstr ""
384384

385385
#: application/templates/adv_inboundmail.html:16
386+
#: application/templates/adv_uploadcover.html:15
386387
#: application/templates/book_summarizer.html:19
387388
#: application/templates/book_translator.html:22
388389
msgid "Disable"
@@ -465,23 +466,35 @@ msgid "Upload cover image"
465466
msgstr ""
466467

467468
#: application/templates/adv_uploadcover.html:10
468-
msgid "Upload cover images from local with an aspect ratio of approximately 0.65."
469+
msgid ""
470+
"Upload cover images from local with an aspect ratio of approximately "
471+
"0.625."
469472
msgstr ""
470473

471-
#: application/templates/adv_uploadcover.html:15
472-
msgid "Rule to pick cover images"
474+
#: application/templates/adv_uploadcover.html:13
475+
msgid "Include cover"
476+
msgstr ""
477+
478+
#: application/templates/adv_uploadcover.html:16
479+
#: application/templates/book_summarizer.html:18
480+
#: application/templates/book_translator.html:21
481+
msgid "Enable"
473482
msgstr ""
474483

475-
#: application/templates/adv_uploadcover.html:17
484+
#: application/templates/adv_uploadcover.html:20
485+
msgid "Rule for cover"
486+
msgstr ""
487+
488+
#: application/templates/adv_uploadcover.html:22
476489
msgid "Random"
477490
msgstr ""
478491

479-
#: application/templates/adv_uploadcover.html:18
492+
#: application/templates/adv_uploadcover.html:23
480493
#: application/templates/base.html:127
481494
msgid "Weekday"
482495
msgstr ""
483496

484-
#: application/templates/adv_uploadcover.html:42
497+
#: application/templates/adv_uploadcover.html:49
485498
msgid "Upload/Update"
486499
msgstr ""
487500

@@ -1150,11 +1163,6 @@ msgstr ""
11501163
msgid "Your browser does not support the audio element."
11511164
msgstr ""
11521165

1153-
#: application/templates/book_summarizer.html:18
1154-
#: application/templates/book_translator.html:21
1155-
msgid "Enable"
1156-
msgstr ""
1157-
11581166
#: application/templates/book_summarizer.html:29
11591167
msgid "Model"
11601168
msgstr ""
@@ -1688,8 +1696,8 @@ msgstr ""
16881696
msgid "Word"
16891697
msgstr ""
16901698

1691-
#: application/view/admin.py:48 application/view/adv.py:434
1692-
#: application/view/adv.py:486 application/view/settings.py:66
1699+
#: application/view/admin.py:48 application/view/adv.py:437
1700+
#: application/view/adv.py:489 application/view/settings.py:66
16931701
#: application/view/translator.py:87 application/view/translator.py:171
16941702
#: application/view/translator.py:253
16951703
msgid "Settings Saved!"
@@ -1803,34 +1811,34 @@ msgstr ""
18031811
msgid "Append qrcode of url to article"
18041812
msgstr ""
18051813

1806-
#: application/view/adv.py:378 application/view/share.py:54
1814+
#: application/view/adv.py:381 application/view/share.py:54
18071815
#: application/view/subscribe.py:250
18081816
msgid "Unknown command: {}"
18091817
msgstr ""
18101818

1811-
#: application/view/adv.py:436 application/view/adv.py:488
1819+
#: application/view/adv.py:439 application/view/adv.py:491
18121820
msgid "The format is invalid."
18131821
msgstr ""
18141822

1815-
#: application/view/adv.py:520
1823+
#: application/view/adv.py:523
18161824
msgid "Authorization Error!<br/>{}"
18171825
msgstr ""
18181826

1819-
#: application/view/adv.py:541
1827+
#: application/view/adv.py:544
18201828
msgid "Success authorized by Pocket!"
18211829
msgstr ""
18221830

1823-
#: application/view/adv.py:547
1831+
#: application/view/adv.py:550
18241832
msgid ""
18251833
"Failed to request authorization of Pocket!<hr/>See details "
18261834
"below:<br/><br/>{}"
18271835
msgstr ""
18281836

1829-
#: application/view/adv.py:568
1837+
#: application/view/adv.py:571
18301838
msgid "The Instapaper service encountered an error. Please try again later."
18311839
msgstr ""
18321840

1833-
#: application/view/adv.py:581
1841+
#: application/view/adv.py:584
18341842
msgid "Request type [{}] unsupported"
18351843
msgstr ""
18361844

Binary file not shown.

application/translations/tr_TR/LC_MESSAGES/messages.po

+31-23
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: PROJECT VERSION\n"
99
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10-
"POT-Creation-Date: 2024-11-23 21:29-0300\n"
10+
"POT-Creation-Date: 2024-11-24 09:32-0300\n"
1111
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language: tr_TR\n"
@@ -386,6 +386,7 @@ msgstr ""
386386
"yapılandırmanız gerekmektedir."
387387

388388
#: application/templates/adv_inboundmail.html:16
389+
#: application/templates/adv_uploadcover.html:15
389390
#: application/templates/book_summarizer.html:19
390391
#: application/templates/book_translator.html:22
391392
msgid "Disable"
@@ -470,25 +471,37 @@ msgid "Upload cover image"
470471
msgstr "Kapak resmi yükle"
471472

472473
#: application/templates/adv_uploadcover.html:10
473-
msgid "Upload cover images from local with an aspect ratio of approximately 0.65."
474+
msgid ""
475+
"Upload cover images from local with an aspect ratio of approximately "
476+
"0.625."
474477
msgstr ""
475-
"Yaklaşık 0.65 en boy oranına sahip kapak resimlerini yerel olarak "
478+
"Yaklaşık 0.625 en boy oranına sahip kapak resimlerini yerel olarak "
476479
"yükleyin."
477480

478-
#: application/templates/adv_uploadcover.html:15
479-
msgid "Rule to pick cover images"
480-
msgstr "Kapak resimlerini seçme kuralı"
481+
#: application/templates/adv_uploadcover.html:13
482+
msgid "Include cover"
483+
msgstr "Kapak Dahil"
484+
485+
#: application/templates/adv_uploadcover.html:16
486+
#: application/templates/book_summarizer.html:18
487+
#: application/templates/book_translator.html:21
488+
msgid "Enable"
489+
msgstr "Etkinleştir"
490+
491+
#: application/templates/adv_uploadcover.html:20
492+
msgid "Rule for cover"
493+
msgstr "Kapak Kuralı"
481494

482-
#: application/templates/adv_uploadcover.html:17
495+
#: application/templates/adv_uploadcover.html:22
483496
msgid "Random"
484497
msgstr "Rastgele"
485498

486-
#: application/templates/adv_uploadcover.html:18
499+
#: application/templates/adv_uploadcover.html:23
487500
#: application/templates/base.html:127
488501
msgid "Weekday"
489502
msgstr "Hafta içi gün"
490503

491-
#: application/templates/adv_uploadcover.html:42
504+
#: application/templates/adv_uploadcover.html:49
492505
msgid "Upload/Update"
493506
msgstr "Yükle/Güncelle"
494507

@@ -1168,11 +1181,6 @@ msgstr "Metin"
11681181
msgid "Your browser does not support the audio element."
11691182
msgstr "Tarayıcınız ses öğesini desteklemiyor."
11701183

1171-
#: application/templates/book_summarizer.html:18
1172-
#: application/templates/book_translator.html:21
1173-
msgid "Enable"
1174-
msgstr "Etkinleştir"
1175-
11761184
#: application/templates/book_summarizer.html:29
11771185
msgid "Model"
11781186
msgstr "Model"
@@ -1722,8 +1730,8 @@ msgstr "Ek olarak ilet"
17221730
msgid "Word"
17231731
msgstr "Kelime"
17241732

1725-
#: application/view/admin.py:48 application/view/adv.py:434
1726-
#: application/view/adv.py:486 application/view/settings.py:66
1733+
#: application/view/admin.py:48 application/view/adv.py:437
1734+
#: application/view/adv.py:489 application/view/settings.py:66
17271735
#: application/view/translator.py:87 application/view/translator.py:171
17281736
#: application/view/translator.py:253
17291737
msgid "Settings Saved!"
@@ -1837,38 +1845,38 @@ msgstr "Tarayıcıda aç"
18371845
msgid "Append qrcode of url to article"
18381846
msgstr "Makaleye URL'nin QR kodunu ekle"
18391847

1840-
#: application/view/adv.py:378 application/view/share.py:54
1848+
#: application/view/adv.py:381 application/view/share.py:54
18411849
#: application/view/subscribe.py:250
18421850
msgid "Unknown command: {}"
18431851
msgstr "Bilinmeyen komut: {}"
18441852

1845-
#: application/view/adv.py:436 application/view/adv.py:488
1853+
#: application/view/adv.py:439 application/view/adv.py:491
18461854
msgid "The format is invalid."
18471855
msgstr "Format geçersiz."
18481856

1849-
#: application/view/adv.py:520
1857+
#: application/view/adv.py:523
18501858
msgid "Authorization Error!<br/>{}"
18511859
msgstr "Yetkilendirme Hatası!<br/>{}"
18521860

1853-
#: application/view/adv.py:541
1861+
#: application/view/adv.py:544
18541862
msgid "Success authorized by Pocket!"
18551863
msgstr "Pocket tarafından yetkilendirilen başarı!"
18561864

1857-
#: application/view/adv.py:547
1865+
#: application/view/adv.py:550
18581866
msgid ""
18591867
"Failed to request authorization of Pocket!<hr/>See details "
18601868
"below:<br/><br/>{}"
18611869
msgstr ""
18621870
"Pocket yetkilendirme isteği başarısız oldu!<hr/>Aşağıdaki ayrıntılara "
18631871
"bakın:<br/><br/>{}"
18641872

1865-
#: application/view/adv.py:568
1873+
#: application/view/adv.py:571
18661874
msgid "The Instapaper service encountered an error. Please try again later."
18671875
msgstr ""
18681876
"Instapaper servisi bir hata ile karşılaştı. Lütfen daha sonra tekrar "
18691877
"deneyin."
18701878

1871-
#: application/view/adv.py:581
1879+
#: application/view/adv.py:584
18721880
msgid "Request type [{}] unsupported"
18731881
msgstr "İstek türü [{}] desteklenmiyor"
18741882

Binary file not shown.

0 commit comments

Comments
 (0)