diff --git a/README.md b/README.md index 84cb8c3..4f82195 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# squip_notes +# squip_tasks -This is a basic notes-taking program. It uses python with flask and pickle, to give a really light and simple web interface for note taking. +This is a basic todo program. It uses python with flask and pickle, to give a really light and simple web interface for task taking. It uses the [dracula](https://github.com/dracula/dracula-theme) colors. ![dark theme screenshot](./ssdark.png) ![light theme screenshot](./sslight.png) -![Screenshot of the application](./squipnotes.png) +![Screenshot of the application](./squiptasks.png) # Features * No accounts : this is made to be used as a single page (you can't have multiple user accounts). This is best suited as a personnal, self-hosted application in your own network (or it could also work for a work team). -* Simplicity: Simply get on the page and start writing. The notes syntax is markdown. +* Simplicity: Simply get on the page and start writing. The tasks syntax is markdown. * Themes : As for now, there is a default dark theme (dracula), and an optionnal light theme (loosely based on solarized light). They can be selected via the interface. # Themes (adding your own) @@ -34,7 +34,7 @@ pygmentize -S dracula -f html -a .codehilite > styles.css ## Run with Docker ### Using traefik -If you use traefik, you only have to change the url in the label "traefik.http.routers.sqnotes.rule". You can also modify the labels to rename the service from "sqnotes" to anything else. +If you use traefik, you only have to change the url in the label "traefik.http.routers.sqtasks.rule". You can also modify the labels to rename the service from "sqtasks" to anything else. Then start the service. It will create the image and start it for you: ```bash diff --git a/data/notes.pickle b/data/notes.pickle deleted file mode 100644 index da9301b..0000000 Binary files a/data/notes.pickle and /dev/null differ diff --git a/docker-compose.yml b/docker-compose.yml index a141c7a..322862c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,17 +4,17 @@ networks: external: true services: - sqnotes: + sqtasks: build: . - image: sqnotes + image: sqtasks volumes: - ./data:/app/data restart: always #ports: #- 8080:8080 labels: - - "traefik.http.routers.sqnotes.rule=Host(`notes.squi.fr`)" - - "traefik.http.services.sqnotes.loadbalancer.server.port=8080" + - "traefik.http.routers.sqtasks.rule=Host(`tasks.squi.fr`)" + - "traefik.http.services.sqtasks.loadbalancer.server.port=8080" - "traefik.docker.network=traefik_traefik" networks: traefik_traefik: diff --git a/src/app.py b/src/app.py index 26554ff..c21fd64 100755 --- a/src/app.py +++ b/src/app.py @@ -81,19 +81,6 @@ def rawtasks(): #No theme in export return render_template("export.html", rawtasks = exporttasks()) -#Read mode -@app.route('/readmode', methods=['GET','POST']) -def readmode(): - #theme - csslink = request.cookies.get('csslink') - - - #Render page - if request.method == 'GET': - tasknumber = request.args.get("task") - mytask = findtask(int(tasknumber)) - return render_template("read.html", task=mytask.flaskrender(), csslink = csslink) - #Edition mode @app.route('/edit', methods=['GET', 'POST']) @@ -133,7 +120,8 @@ def edit(): rightnow = int(time.time()) newtask = task(createtime=tasknumber, modtime=rightnow, title=tasktitle, text=tasktext, done=taskdone, priority=taskpriority) addtask(newtask) - return render_template("read.html", task=newtask.flaskrender(), csslink = csslink) + return render_template("homepage.html", ntodo = todotasks(gettasks()), ndone = donetasks(gettasks()), csslink = csslink) + #Basic route, allows task creation diff --git a/src/classes.py b/src/classes.py index ae81543..4cfc624 100644 --- a/src/classes.py +++ b/src/classes.py @@ -41,12 +41,11 @@ class task: rendered = f"""
-
{Markup.escape(self.title)}
-
Priority: {self.priority}
-
{self.donemark}
+
{self.donemark} {Markup.escape(self.title)}
|||Back
+
Priority: {self.priority}
Created : {self.rendertime(self.createtime)}
Modified : {self.rendertime(self.modtime)}

{markdown.markdown(self.text, extensions=['fenced_code', 'codehilite', 'nl2br', 'smarty'])}

diff --git a/src/static/styles/0-dracula.css b/src/static/styles/0-dracula.css index 4f51a4b..1d29972 100644 --- a/src/static/styles/0-dracula.css +++ b/src/static/styles/0-dracula.css @@ -157,6 +157,55 @@ a { white-space: pre-wrap; } +.priorityinput { + background-color: #22242e; + color: #f8f8f2; + border-radius: 5px; + border-style: none; + border-width: 1px; + width: 40px; +} + +label { + background-color: transparent; + border: none; + color: #8be9fd; + 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: #22242e; + color: #f8f8f2; + border-radius: 5px; + border-style: inset; + border-color: #ff79c6; + border-width: 1px; + width: 40px; +} + +.separator { + text-align: center; +} + + /* Syntax highlighting */ pre { line-height: 125%; } td.linenos .normal { color: #f1fa8c; background-color: #44475a; padding-left: 5px; padding-right: 5px; } diff --git a/src/static/styles/1-light.css b/src/static/styles/1-light.css index 380618b..2c6ac69 100644 --- a/src/static/styles/1-light.css +++ b/src/static/styles/1-light.css @@ -135,7 +135,7 @@ a { border-style: none; outline: none; border-width: 1px; - height: 80%; + height: 40%; font-size: 15px; -webkit-box-shadow: 0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23); } @@ -158,6 +158,55 @@ a { white-space: pre-wrap; } +.priorityinput { + background-color: #eee8d5; + color: #586e75; + border-radius: 5px; + border-style: none; + border-width: 1px; + width: 40px; +} + +label { + background-color: transparent; + border: none; + color: #2aa198; + 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: #eee8d5; + color: #586e75; + border-radius: 5px; + border-style: inset; + border-color: #ff79c6; + border-width: 1px; + width: 40px; +} + +.separator { + text-align: center; +} + + /* Syntax highlighting */ pre { line-height: 125%; } td.linenos .normal { color: #93a1a1; background-color: #eee8d5; padding-left: 5px; padding-right: 5px; } diff --git a/src/templates/homepage.html b/src/templates/homepage.html index a682411..ac6a8f4 100644 --- a/src/templates/homepage.html +++ b/src/templates/homepage.html @@ -13,16 +13,20 @@

- -
+ +
Note : you can drag the textbox to make it bigger. Scroll down to see your previous tasks.

-

Todo

+
+

Todo

+
{{ ntodo }} -

Done

+
+

Done

+
{{ ndone }}