fnschool 20251013.81919.815__py3-none-any.whl → 20251013.81959.843__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fnschoo1/__init__.py CHANGED
@@ -6,4 +6,4 @@ import random
6
6
  import sys
7
7
  from pathlib import Path
8
8
 
9
- __version__ = "20251013.81919.815"
9
+ __version__ = "20251013.81959.843"
@@ -22,8 +22,8 @@
22
22
  <input class=" form-control"
23
23
  onkeydown="if(event.keyCode==13){list_consumptions();}"
24
24
  title="{% trans 'The starting date of storage.' %}"
25
- id="storage_date_start"
26
- value="{{ request.COOKIES.storage_date_start }}">
25
+ id="storage_date_start_input"
26
+ value="{{ storage_date_start|date:"Y/m/d" }}">
27
27
  </input>
28
28
  </div>
29
29
  <div class="col col-3 col-md-2 col-lg-2">
@@ -96,14 +96,18 @@
96
96
  {{ months|json_script:'months' }}
97
97
  {{ meal_types|json_script:'meal_types' }}
98
98
  {{ date_range|json_script:'date_range' }}
99
+ {{ storage_date_start|json_script:'storage_date_start' }}
99
100
  <script>
100
101
  var ingredient_ids = JSON.parse($("#ingredient_ids").text())
101
102
  var ingredient_ids_length = ingredient_ids.length
102
103
  var months = JSON.parse($("#months").text())
103
104
  var meal_types = JSON.parse($("#meal_types").text())
105
+ var date_range = JSON.parse($("#date_range").text())
106
+
107
+ var storage_date_start = $('#storage_date_start').text().replace(new RegExp('"', 'g'), "")
108
+
104
109
  var dont_submit = false
105
110
 
106
- date_range = JSON.parse($("#date_range").text())
107
111
 
108
112
  function list_consumptions_rapidly() {
109
113
  query = {
@@ -154,6 +158,13 @@
154
158
 
155
159
  });
156
160
 
161
+ $(document).ready(function() {
162
+ if (get_cookie('storage_date_start') === null) {
163
+ set_cookies({
164
+ "storage_date_start": storage_date_start
165
+ })
166
+ }
167
+ });
157
168
 
158
169
  $(document).ready(function() {
159
170
  var last_meal_type = ""
@@ -391,20 +402,20 @@
391
402
  });
392
403
 
393
404
  function list_consumptions() {
394
- var storage_date_start = $('#storage_date_start').val()
395
- var storage_date_end = $('#storage_date_end').val()
405
+ var new_storage_date_start = $('#storage_date_start_input').val()
406
+ var new_storage_date_end = $('#storage_date_end_input').val()
396
407
  query = {}
397
- if (storage_date_start) {
398
- query["storage_date_start"] = storage_date_start
399
- set_simple_cookie("storage_date_start", storage_date_start)
408
+ if (new_storage_date_start) {
409
+ query["storage_date_start"] = new_storage_date_start
410
+ set_simple_cookie("storage_date_start", new_storage_date_start)
400
411
  } else {
401
412
  query["storage_date_start"] = ""
402
413
  delete_cookie("storage_date_start")
403
414
  }
404
415
 
405
- if (storage_date_end) {
406
- query["storage_date_end"] = storage_date_end
407
- set_simple_cookie("storage_date_end", storage_date_end)
416
+ if (new_storage_date_end) {
417
+ query["storage_date_end"] = new_storage_date_end
418
+ set_simple_cookie("storage_date_end", new_storage_date_end)
408
419
  } else {
409
420
  query["storage_date_end"] = ""
410
421
  delete_cookie("storage_date_end")
@@ -420,7 +431,7 @@
420
431
  position: absolute;
421
432
  }
422
433
 
423
- #storage_date_start,
434
+ #storage_date_start_input,
424
435
  #storage_date_end {
425
436
  text-align: center;
426
437
  font-family: Mono;
fnschoo1/canteen/views.py CHANGED
@@ -297,6 +297,7 @@ def create_consumptions(request, ingredient_id=None):
297
297
  "meal_types": meal_types,
298
298
  "ingredient_ids": ingredient_ids,
299
299
  "months": months,
300
+ "storage_date_start": date_start,
300
301
  },
301
302
  )
302
303
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fnschool
3
- Version: 20251013.81919.815
3
+ Version: 20251013.81959.843
4
4
  Summary: Just some school related scripts, without any ambition.
5
5
  Author-email: larryw3i <larryw3i@163.com>, Larry Wei <larryw3i@126.com>, Larry W3i <larryw3i@yeah.net>
6
6
  Maintainer-email: larryw3i <larryw3i@163.com>, Larry Wei <larryw3i@126.com>
@@ -1,4 +1,4 @@
1
- fnschoo1/__init__.py,sha256=WSDGaE349YUVvVkCJW2Z7ZyVBVTTahlxerGH_D7vSY0,197
1
+ fnschoo1/__init__.py,sha256=P5QYmb7ozN6bO6SBiWzHKv5mAxye_K2A3X_5bGBmfXc,197
2
2
  fnschoo1/manage.py,sha256=Cr5OtPrRWfEc7KEjW4yYnMKj_qlb0-qpwFRz3vFXvC0,1565
3
3
  fnschoo1/canteen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  fnschoo1/canteen/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
@@ -7,7 +7,7 @@ fnschoo1/canteen/forms.py,sha256=4Y75VHpnONdN5hM8aShyr7tbQSElLa-22PQK7fDRflw,229
7
7
  fnschoo1/canteen/models.py,sha256=20r24iNJW0hmPwhY96pQLYaIgqf8kc_Tx76IqORR_LE,5219
8
8
  fnschoo1/canteen/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
9
9
  fnschoo1/canteen/urls.py,sha256=4GtrqC9L59c8zopfjRgqhbcvA5iPnGcAUVuM6CrKWpk,2797
10
- fnschoo1/canteen/views.py,sha256=gY-dcBqIAxvZS5ToIHNijU-DDj2GAAaSnP31VTYHF_w,26269
10
+ fnschoo1/canteen/views.py,sha256=AXMO6dEMjBMTO-D6sWEV2sDwYZcms0L6hSgq8NHvVfw,26315
11
11
  fnschoo1/canteen/migrations/0001_initial.py,sha256=IHlyfT9sNc-kRQZy7NyjgWzp4EGus405QCAUw4oNdAQ,3943
12
12
  fnschoo1/canteen/migrations/0002_ingredient_is_disabled.py,sha256=j8oGWb2b99YwsEk-uwESLA_JRITEcz6b35ekoYOUGGc,444
13
13
  fnschoo1/canteen/migrations/0003_consumption_is_disabled_alter_ingredient_is_disabled.py,sha256=9RB5SHjINgrrqtDpcVIUXEBa3C_MTcR_keXLGG_PcOs,619
@@ -28,7 +28,7 @@ fnschoo1/canteen/templates/canteen/category/delete.html,sha256=MnPyFzjO3HonOljwx
28
28
  fnschoo1/canteen/templates/canteen/category/list.html,sha256=aj81uoA-jmdv8mZT-Y9DxjOHVGrSfI1z0DB1YnJWb4w,2045
29
29
  fnschoo1/canteen/templates/canteen/category/update.html,sha256=8Nzdbe8UorrJHzElkrdqvLaPnUvcvGhrViZB4D86wqo,815
30
30
  fnschoo1/canteen/templates/canteen/consumption/_create.html,sha256=lpST1R0vL1PEI1YE9d0-bcWWpCMH-INjIF-7pweAHuU,1008
31
- fnschoo1/canteen/templates/canteen/consumption/create.html,sha256=UQOwZ5yS5g98LSxzSdRxUCzzR5R_RID0DGkbq9M_HFc,15568
31
+ fnschoo1/canteen/templates/canteen/consumption/create.html,sha256=NOUKb48EueRHHN3tb1KwTkCsmpWwdWWCwX3Kwqi-A7o,15954
32
32
  fnschoo1/canteen/templates/canteen/ingredient/close.html,sha256=pLYeJmGaOEJKMUJdZmYzz_n--l28IRDQ4fXvetP_Vsc,200
33
33
  fnschoo1/canteen/templates/canteen/ingredient/create.html,sha256=xZvh0tP_cv2HPQ96JSHChO6Ni23tzHc5YJCUhE2yEqM,807
34
34
  fnschoo1/canteen/templates/canteen/ingredient/create_one.html,sha256=O8EPSvAnEZ-4VJiwFdoyxJrMOoMpRkH6CyfvWwHaVgc,599
@@ -93,14 +93,14 @@ fnschoo1/templates/includes/_navigation.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
93
93
  fnschoo1/templates/includes/_paginator.html,sha256=Z-Hxcdmun4SJ1YcHnWTDLfW8wrngROiBTwr4NZWaPP4,1246
94
94
  fnschoo1/templates/registration/logged_out.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
95
  fnschoo1/templates/registration/login.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
- fnschool-20251013.81919.815.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
97
- fnschool-20251013.81919.815.dist-info/METADATA,sha256=yixkF9j3Fzj8y4Qz2QpRMoMB9rQwEV3_vJvgLfl7KZU,4752
98
- fnschool-20251013.81919.815.dist-info/SOURCES.txt.py,sha256=2LY2mshgNtxI3ICB-oBjyMYgJk2bQqeGFM5J5ay5TQs,4954
99
- fnschool-20251013.81919.815.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
- fnschool-20251013.81919.815.dist-info/dependency_links.txt.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
101
- fnschool-20251013.81919.815.dist-info/entry_points.txt,sha256=Ow5nChVFJY3O4TJAIE1ZydMev1MUtgRsT1b8eFP6728,54
102
- fnschool-20251013.81919.815.dist-info/entry_points.txt.py,sha256=7iOwIx_m9Y6xJt___BZHWJh27LV5hqWnUjmj77MoRys,47
103
- fnschool-20251013.81919.815.dist-info/requires.txt.py,sha256=PqRcHIQSMPUb271hacYrlSDHwB1WDZmlWUkh6RnBz_g,113
104
- fnschool-20251013.81919.815.dist-info/top_level.txt,sha256=s6ZKnNm94Q0-247a50eI7jDK98uPF6P2kC9Ovd3LUlM,9
105
- fnschool-20251013.81919.815.dist-info/top_level.txt.py,sha256=_7CbrSihm0dzBn_tTy2ass_Y2VlkVNT2eylE8mcfwHY,9
106
- fnschool-20251013.81919.815.dist-info/RECORD,,
96
+ fnschool-20251013.81959.843.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
97
+ fnschool-20251013.81959.843.dist-info/METADATA,sha256=DC-zwFsEtLabNxJmkbl26HyKqHjaJ_6S-Mm5MvvktP8,4752
98
+ fnschool-20251013.81959.843.dist-info/SOURCES.txt.py,sha256=2LY2mshgNtxI3ICB-oBjyMYgJk2bQqeGFM5J5ay5TQs,4954
99
+ fnschool-20251013.81959.843.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
+ fnschool-20251013.81959.843.dist-info/dependency_links.txt.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
101
+ fnschool-20251013.81959.843.dist-info/entry_points.txt,sha256=Ow5nChVFJY3O4TJAIE1ZydMev1MUtgRsT1b8eFP6728,54
102
+ fnschool-20251013.81959.843.dist-info/entry_points.txt.py,sha256=7iOwIx_m9Y6xJt___BZHWJh27LV5hqWnUjmj77MoRys,47
103
+ fnschool-20251013.81959.843.dist-info/requires.txt.py,sha256=PqRcHIQSMPUb271hacYrlSDHwB1WDZmlWUkh6RnBz_g,113
104
+ fnschool-20251013.81959.843.dist-info/top_level.txt,sha256=s6ZKnNm94Q0-247a50eI7jDK98uPF6P2kC9Ovd3LUlM,9
105
+ fnschool-20251013.81959.843.dist-info/top_level.txt.py,sha256=_7CbrSihm0dzBn_tTy2ass_Y2VlkVNT2eylE8mcfwHY,9
106
+ fnschool-20251013.81959.843.dist-info/RECORD,,