Private tasks ok
This commit is contained in:
parent
8531c141d7
commit
e96ae59b7e
12
src/app.py
12
src/app.py
@ -32,13 +32,13 @@ def render():
|
|||||||
#...or using their preferred theme if do have one
|
#...or using their preferred theme if do have one
|
||||||
else:
|
else:
|
||||||
csslink = request.cookies.get('csslink')
|
csslink = request.cookies.get('csslink')
|
||||||
resp = make_response(render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), csslink = csslink))
|
resp = make_response(render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), ndone_pers = donetasks_pers(gettasks()), csslink = csslink))
|
||||||
|
|
||||||
#Delete has been clicked
|
#Delete has been clicked
|
||||||
if request.args.get("delete") is not None:
|
if request.args.get("delete") is not None:
|
||||||
todelete = request.args.get("delete")
|
todelete = request.args.get("delete")
|
||||||
deltask(int(todelete))
|
deltask(int(todelete))
|
||||||
resp = make_response(render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), csslink = csslink))
|
resp = make_response(render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), ndone_pers = donetasks_pers(gettasks()), csslink = csslink))
|
||||||
|
|
||||||
#Edit has been clicked
|
#Edit has been clicked
|
||||||
elif request.args.get("edit") is not None:
|
elif request.args.get("edit") is not None:
|
||||||
@ -71,9 +71,9 @@ def render():
|
|||||||
mytask = switchstatus(mytask)
|
mytask = switchstatus(mytask)
|
||||||
deltask(toswitch)
|
deltask(toswitch)
|
||||||
addtask(mytask)
|
addtask(mytask)
|
||||||
resp = make_response(render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), csslink = csslink))
|
resp = make_response(render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), ndone_pers = donetasks_pers(gettasks()), csslink = csslink))
|
||||||
else:
|
else:
|
||||||
resp = make_response(render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), csslink = csslink))
|
resp = make_response(render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), ndone_pers = donetasks_pers(gettasks()), csslink = csslink))
|
||||||
|
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ def homepage():
|
|||||||
except Exception as E:
|
except Exception as E:
|
||||||
print(f"!!!!!!!!!! {E} - {request.form}")
|
print(f"!!!!!!!!!! {E} - {request.form}")
|
||||||
pass
|
pass
|
||||||
return render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), csslink = csslink)
|
return render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), ndone_pers = donetasks_pers(gettasks()), csslink = csslink)
|
||||||
|
|
||||||
|
|
||||||
#Export mode
|
#Export mode
|
||||||
@ -161,7 +161,7 @@ def edit():
|
|||||||
rightnow = int(time.time())
|
rightnow = int(time.time())
|
||||||
newtask = task(createtime=tasknumber, modtime=rightnow, title=tasktitle, text=tasktext, done=taskdone, priority=taskpriority, personnal = personnal)
|
newtask = task(createtime=tasknumber, modtime=rightnow, title=tasktitle, text=tasktext, done=taskdone, priority=taskpriority, personnal = personnal)
|
||||||
addtask(newtask)
|
addtask(newtask)
|
||||||
return render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), csslink = csslink)
|
return render_template("homepage.html", ntodo = todotasks(gettasks()), npers = personnaltasks(gettasks()), ndone = donetasks(gettasks()), ndone_pers = donetasks_pers(gettasks()), csslink = csslink)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
24
src/funcs.py
24
src/funcs.py
@ -132,7 +132,7 @@ def switchstatus(task):
|
|||||||
|
|
||||||
def todotasks(tasklist):
|
def todotasks(tasklist):
|
||||||
"""
|
"""
|
||||||
Sorts tasks in tasklist: Gives todotasks sorted by priority
|
Sorts tasks in tasklist: Gives todotasks that are not private sorted by priority
|
||||||
"""
|
"""
|
||||||
buffer = []
|
buffer = []
|
||||||
finalstr = ""
|
finalstr = ""
|
||||||
@ -148,7 +148,7 @@ def todotasks(tasklist):
|
|||||||
|
|
||||||
def personnaltasks(tasklist):
|
def personnaltasks(tasklist):
|
||||||
"""
|
"""
|
||||||
Sorts tasks in tasklist: Gives todotasks sorted by priority
|
Sorts tasks in tasklist: Gives todotasks that are private sorted by priority
|
||||||
"""
|
"""
|
||||||
buffer = []
|
buffer = []
|
||||||
finalstr = ""
|
finalstr = ""
|
||||||
@ -164,12 +164,28 @@ def personnaltasks(tasklist):
|
|||||||
|
|
||||||
def donetasks(tasklist):
|
def donetasks(tasklist):
|
||||||
"""
|
"""
|
||||||
Sorts tasks in tasklist: Gives done tasks sorted by modtime
|
Sorts tasks in tasklist: Gives public done tasks sorted by modtime
|
||||||
"""
|
"""
|
||||||
buffer = []
|
buffer = []
|
||||||
finalstr = ""
|
finalstr = ""
|
||||||
for task in tasklist:
|
for task in tasklist:
|
||||||
if task.donemark == "✅":
|
if task.donemark == "✅" and not task.personnal:
|
||||||
|
buffer.append(task)
|
||||||
|
|
||||||
|
tasks = sorted(buffer, key=lambda task: task.modtime, reverse=True)
|
||||||
|
for task in tasks:
|
||||||
|
finalstr += task.flaskrender()
|
||||||
|
|
||||||
|
return finalstr
|
||||||
|
|
||||||
|
def donetasks_pers(tasklist):
|
||||||
|
"""
|
||||||
|
Sorts tasks in tasklist: Gives public done tasks sorted by modtime
|
||||||
|
"""
|
||||||
|
buffer = []
|
||||||
|
finalstr = ""
|
||||||
|
for task in tasklist:
|
||||||
|
if task.donemark == "✅" and task.personnal:
|
||||||
buffer.append(task)
|
buffer.append(task)
|
||||||
|
|
||||||
tasks = sorted(buffer, key=lambda task: task.modtime, reverse=True)
|
tasks = sorted(buffer, key=lambda task: task.modtime, reverse=True)
|
||||||
|
@ -28,6 +28,11 @@
|
|||||||
<summary>Click to expand.</summary>
|
<summary>Click to expand.</summary>
|
||||||
<p>
|
<p>
|
||||||
{{ npers }}
|
{{ npers }}
|
||||||
|
<hr>
|
||||||
|
<h2 class="separator">Private and done</h2>
|
||||||
|
<hr>
|
||||||
|
{{ ndone_pers }}
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</details>
|
</details>
|
||||||
<hr>
|
<hr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user