Compare commits
4 Commits
8531c141d7
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f76ab2c2b1 | |||
| 26244330b7 | |||
| 2d191db378 | |||
| e96ae59b7e |
43
.gitea/workflows/docker.yml
Normal file
43
.gitea/workflows/docker.yml
Normal file
@ -0,0 +1,43 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
- "master"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # all history for all branches and tags
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: gitea.squi.fr
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
env:
|
||||
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
push: true
|
||||
tags: gitea.squi.fr/justine/sqtasks:latest
|
||||
|
||||
|
||||
14
src/app.py
14
src/app.py
@ -32,13 +32,13 @@ def render():
|
||||
#...or using their preferred theme if do have one
|
||||
else:
|
||||
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
|
||||
if request.args.get("delete") is not None:
|
||||
todelete = request.args.get("delete")
|
||||
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
|
||||
elif request.args.get("edit") is not None:
|
||||
@ -71,9 +71,9 @@ def render():
|
||||
mytask = switchstatus(mytask)
|
||||
deltask(toswitch)
|
||||
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:
|
||||
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
|
||||
|
||||
@ -99,12 +99,12 @@ def homepage():
|
||||
print(f"Got new task with prio {priority}")
|
||||
|
||||
rightnow = int(time.time())
|
||||
newtask = task(createtime=rightnow, modtime=rightnow, title=tasktitle, text=tasktext, done=False, priority=int(priority), personnal=False)
|
||||
newtask = task(createtime=rightnow, modtime=rightnow, title=tasktitle, text=tasktext, done=False, priority=int(priority), personnal=personnal)
|
||||
addtask(newtask)
|
||||
except Exception as E:
|
||||
print(f"!!!!!!!!!! {E} - {request.form}")
|
||||
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
|
||||
@ -161,7 +161,7 @@ def edit():
|
||||
rightnow = int(time.time())
|
||||
newtask = task(createtime=tasknumber, modtime=rightnow, title=tasktitle, text=tasktext, done=taskdone, priority=taskpriority, personnal = personnal)
|
||||
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)
|
||||
|
||||
|
||||
|
||||
|
||||
25
src/funcs.py
25
src/funcs.py
@ -87,6 +87,7 @@ def exporttasks():
|
||||
rawtext += f"#{task.title}\n"
|
||||
rawtext += f"* Created: {task.rendertime(task.createtime)}\n"
|
||||
rawtext += f"* Modified: {task.rendertime(task.modtime)}\n"
|
||||
rawtext += f"* Marked private: {task.personnal}\n"
|
||||
rawtext += f"{task.text}\n"
|
||||
rawtext += f"-----\n\n"
|
||||
|
||||
@ -132,7 +133,7 @@ def switchstatus(task):
|
||||
|
||||
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 = []
|
||||
finalstr = ""
|
||||
@ -148,7 +149,7 @@ def todotasks(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 = []
|
||||
finalstr = ""
|
||||
@ -164,12 +165,28 @@ def personnaltasks(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 = []
|
||||
finalstr = ""
|
||||
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)
|
||||
|
||||
tasks = sorted(buffer, key=lambda task: task.modtime, reverse=True)
|
||||
|
||||
@ -1,306 +0,0 @@
|
||||
@font-face {
|
||||
font-family: "Work Sans";
|
||||
src: url(WorkSans-Regular.ttf);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Work Sans";
|
||||
src: url(WorkSans-Bold.ttf);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Work Sans";
|
||||
src: url(WorkSans-Italic.ttf);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Work Sans";
|
||||
src: url(WorkSans-BoldItalic.ttf);
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
|
||||
html {
|
||||
background-color: #2e2e2e;
|
||||
font-family: 'Work Sans';
|
||||
color: #ffbc80;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #f76e11;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #f76e11;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #f76e11;
|
||||
}
|
||||
|
||||
h4 {
|
||||
color: #f76e11;
|
||||
}
|
||||
|
||||
h5 {
|
||||
color: #f76e11;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
color: #b958a5;
|
||||
padding: 1px 2px;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
font-size: 1em;
|
||||
font-style: normal;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: 3px dotted;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #b958a5;
|
||||
text-decoration: underline;
|
||||
font-style: normal;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.globalcontainer {
|
||||
text-align: left;
|
||||
margin: auto;
|
||||
padding: 10px;
|
||||
width: 900px;
|
||||
}
|
||||
|
||||
.taskcontainer {
|
||||
border: 3px dotted;
|
||||
margin: 20px;
|
||||
padding: 10px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
background-color: #eee8d5;
|
||||
border: none;
|
||||
color: #ff9f45;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
font-style: normal;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.topbutton {
|
||||
float: right;
|
||||
text-decoration: none;
|
||||
color: #ff9f45;
|
||||
}
|
||||
|
||||
.exportlink {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
.pagetitle {
|
||||
font-size: 3em;
|
||||
color: #fc4f4f;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.backlink {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.tasktitle {
|
||||
color: #f76e11;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.tasktime {
|
||||
color: #ff9f45;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/*
|
||||
.title {
|
||||
background: #44475a;
|
||||
color: #f76e11;
|
||||
font-weight: bold;
|
||||
font-size: 2em
|
||||
border-style: none;
|
||||
border-radius: 1px;
|
||||
outline: none;
|
||||
border-width: 1px;
|
||||
}
|
||||
*/
|
||||
|
||||
.text {
|
||||
width: 100%;
|
||||
background: #404040;
|
||||
color: #ff9f45;
|
||||
border-radius: 5px;
|
||||
border-style: none;
|
||||
outline: none;
|
||||
border-width: 1px;
|
||||
height: 40%;
|
||||
font-size: 15px;
|
||||
-webkit-box-shadow: 0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
background: #404040;
|
||||
color: #ff9f45;
|
||||
border-radius: 5px;
|
||||
border-style: none;
|
||||
outline: none;
|
||||
border-width: 1px;
|
||||
height: 25px;
|
||||
margin: 5px 0px 5px 0px;
|
||||
font-size: 15px;
|
||||
-webkit-box-shadow: 0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);
|
||||
}
|
||||
|
||||
.rawtext {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.priorityinput {
|
||||
background-color: #404040;
|
||||
color: #ff9f45;
|
||||
border-radius: 5px;
|
||||
border-style: none;
|
||||
border-width: 1px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
label {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
color: #ff9f45;
|
||||
padding: 1px 2px;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
font-size: 1em;
|
||||
font-style: normal;
|
||||
cursor: pointer;
|
||||
}
|
||||
/* Hide priority select arrows
|
||||
Chrome, Safari, Edge, Opera */
|
||||
input::-webkit-outer-spin-button,
|
||||
input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Firefox */
|
||||
input[type=number] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.donemarkselect {
|
||||
background-color: #404040;
|
||||
color: #ff9f45;
|
||||
border-radius: 5px;
|
||||
border-style: inset;
|
||||
border-color: #ff79c6;
|
||||
border-width: 1px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.separator {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
pre { line-height: 125%; }
|
||||
td.linenos .normal { color: #5d6262; background-color: #353535; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos { color: #5d6262; background-color: #353535; padding-left: 5px; padding-right: 5px; }
|
||||
td.linenos .special { color: #7a8080; background-color: #353535; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos.special { color: #7a8080; background-color: #353535; padding-left: 5px; padding-right: 5px; }
|
||||
.codehilite .hll { background-color: #484848 }
|
||||
.codehilite { background: #3f3f3f; color: #dcdccc }
|
||||
.codehilite .c { color: #7f9f7f; font-style: italic } /* Comment */
|
||||
.codehilite .err { color: #e37170; font-weight: bold } /* Error */
|
||||
.codehilite .esc { color: #dcdccc } /* Escape */
|
||||
.codehilite .g { color: #ecbcbc; font-weight: bold } /* Generic */
|
||||
.codehilite .k { color: #efdcbc } /* Keyword */
|
||||
.codehilite .l { color: #9fafaf } /* Literal */
|
||||
.codehilite .n { color: #dcdccc } /* Name */
|
||||
.codehilite .o { color: #f0efd0 } /* Operator */
|
||||
.codehilite .x { color: #dcdccc } /* Other */
|
||||
.codehilite .p { color: #f0efd0 } /* Punctuation */
|
||||
.codehilite .ch { color: #7f9f7f; font-style: italic } /* Comment.Hashbang */
|
||||
.codehilite .cm { color: #7f9f7f; font-style: italic } /* Comment.Multiline */
|
||||
.codehilite .cp { color: #dfaf8f; font-weight: bold; font-style: italic } /* Comment.Preproc */
|
||||
.codehilite .cpf { color: #cc9393; font-style: italic } /* Comment.PreprocFile */
|
||||
.codehilite .c1 { color: #7f9f7f; font-style: italic } /* Comment.Single */
|
||||
.codehilite .cs { color: #dfdfdf; font-weight: bold; font-style: italic } /* Comment.Special */
|
||||
.codehilite .gd { color: #c3bf9f; font-weight: bold; background-color: #313c36 } /* Generic.Deleted */
|
||||
.codehilite .ge { color: #ffffff; font-weight: bold } /* Generic.Emph */
|
||||
.codehilite .gr { color: #ecbcbc; font-weight: bold } /* Generic.Error */
|
||||
.codehilite .gh { color: #efefef; font-weight: bold } /* Generic.Heading */
|
||||
.codehilite .gi { color: #709080; font-weight: bold; background-color: #313c36 } /* Generic.Inserted */
|
||||
.codehilite .go { color: #5b605e; font-weight: bold } /* Generic.Output */
|
||||
.codehilite .gp { color: #ecbcbc; font-weight: bold } /* Generic.Prompt */
|
||||
.codehilite .gs { color: #ecbcbc; font-weight: bold } /* Generic.Strong */
|
||||
.codehilite .gu { color: #efefef; font-weight: bold } /* Generic.Subheading */
|
||||
.codehilite .gt { color: #80d4aa; font-weight: bold; background-color: #2f2f2f } /* Generic.Traceback */
|
||||
.codehilite .kc { color: #dca3a3 } /* Keyword.Constant */
|
||||
.codehilite .kd { color: #f0dfaf } /* Keyword.Declaration */
|
||||
.codehilite .kn { color: #f0dfaf } /* Keyword.Namespace */
|
||||
.codehilite .kp { color: #efdcbc } /* Keyword.Pseudo */
|
||||
.codehilite .kr { color: #efdcbc } /* Keyword.Reserved */
|
||||
.codehilite .kt { color: #dfdfbf; font-weight: bold } /* Keyword.Type */
|
||||
.codehilite .ld { color: #9fafaf } /* Literal.Date */
|
||||
.codehilite .m { color: #8cd0d3 } /* Literal.Number */
|
||||
.codehilite .s { color: #cc9393 } /* Literal.String */
|
||||
.codehilite .na { color: #efef8f } /* Name.Attribute */
|
||||
.codehilite .nb { color: #efef8f } /* Name.Builtin */
|
||||
.codehilite .nc { color: #efef8f } /* Name.Class */
|
||||
.codehilite .no { color: #dca3a3 } /* Name.Constant */
|
||||
.codehilite .nd { color: #dcdccc } /* Name.Decorator */
|
||||
.codehilite .ni { color: #cfbfaf } /* Name.Entity */
|
||||
.codehilite .ne { color: #c3bf9f; font-weight: bold } /* Name.Exception */
|
||||
.codehilite .nf { color: #efef8f } /* Name.Function */
|
||||
.codehilite .nl { color: #dcdccc } /* Name.Label */
|
||||
.codehilite .nn { color: #dcdccc } /* Name.Namespace */
|
||||
.codehilite .nx { color: #dcdccc } /* Name.Other */
|
||||
.codehilite .py { color: #dcdccc } /* Name.Property */
|
||||
.codehilite .nt { color: #e89393; font-weight: bold } /* Name.Tag */
|
||||
.codehilite .nv { color: #dcdccc } /* Name.Variable */
|
||||
.codehilite .ow { color: #f0efd0 } /* Operator.Word */
|
||||
.codehilite .w { color: #dcdccc } /* Text.Whitespace */
|
||||
.codehilite .mb { color: #8cd0d3 } /* Literal.Number.Bin */
|
||||
.codehilite .mf { color: #c0bed1 } /* Literal.Number.Float */
|
||||
.codehilite .mh { color: #8cd0d3 } /* Literal.Number.Hex */
|
||||
.codehilite .mi { color: #8cd0d3 } /* Literal.Number.Integer */
|
||||
.codehilite .mo { color: #8cd0d3 } /* Literal.Number.Oct */
|
||||
.codehilite .sa { color: #cc9393 } /* Literal.String.Affix */
|
||||
.codehilite .sb { color: #cc9393 } /* Literal.String.Backtick */
|
||||
.codehilite .sc { color: #cc9393 } /* Literal.String.Char */
|
||||
.codehilite .dl { color: #cc9393 } /* Literal.String.Delimiter */
|
||||
.codehilite .sd { color: #7f9f7f } /* Literal.String.Doc */
|
||||
.codehilite .s2 { color: #cc9393 } /* Literal.String.Double */
|
||||
.codehilite .se { color: #cc9393 } /* Literal.String.Escape */
|
||||
.codehilite .sh { color: #cc9393 } /* Literal.String.Heredoc */
|
||||
.codehilite .si { color: #dca3a3; font-weight: bold } /* Literal.String.Interpol */
|
||||
.codehilite .sx { color: #cc9393 } /* Literal.String.Other */
|
||||
.codehilite .sr { color: #cc9393 } /* Literal.String.Regex */
|
||||
.codehilite .s1 { color: #cc9393 } /* Literal.String.Single */
|
||||
.codehilite .ss { color: #cc9393 } /* Literal.String.Symbol */
|
||||
.codehilite .bp { color: #dcdccc } /* Name.Builtin.Pseudo */
|
||||
.codehilite .fm { color: #efef8f } /* Name.Function.Magic */
|
||||
.codehilite .vc { color: #dcdccc } /* Name.Variable.Class */
|
||||
.codehilite .vg { color: #dcdccc } /* Name.Variable.Global */
|
||||
.codehilite .vi { color: #dcdccc } /* Name.Variable.Instance */
|
||||
.codehilite .vm { color: #dcdccc } /* Name.Variable.Magic */
|
||||
.codehilite .il { color: #8cd0d3 } /* Literal.Number.Integer.Long */
|
||||
|
||||
@ -28,6 +28,11 @@
|
||||
<summary>Click to expand.</summary>
|
||||
<p>
|
||||
{{ npers }}
|
||||
<hr>
|
||||
<h2 class="separator">Private and done</h2>
|
||||
<hr>
|
||||
{{ ndone_pers }}
|
||||
|
||||
</p>
|
||||
</details>
|
||||
<hr>
|
||||
|
||||
Reference in New Issue
Block a user