Compare commits

..

No commits in common. "master" and "v1.1.3" have entirely different histories.

13 changed files with 31 additions and 40 deletions

View file

@ -1,11 +1,6 @@
# Changelog # Changelog
This file keeps track of changes in a human-readable fashion This file keeps track of changes in a human-readable fashion
## v1.1.4
* Fixed HTML `lang` tag
* Theme CSS link is now only present if non-default is set
* Improved template consistency (backend)
## v1.1.3 ## v1.1.3
This release mostly consists of backend improvements This release mostly consists of backend improvements
* List items no longer replace hyphens with spaces for consistency * List items no longer replace hyphens with spaces for consistency

View file

@ -39,11 +39,11 @@ config
Deleting notes is done by clearing contents and clicking "Save" - the app deletes empty files when saving. Deleting notes is done by clearing contents and clicking "Save" - the app deletes empty files when saving.
### Config options: ### Config options:
Below are the available configuration options and their defaults. Below are available configuration options and their defaults.
The settings are defined as newline separated `key=value` pairs in the config file. The settings are defined as newline separated key=value pairs in config.txt.
If you do not provide an option, the default will be used. If you do not provide an option in your config, it will be using the default.
Please don't include the bash-style "comments" in your actual config, Please don't include the bash-style "comments" in your actual config,
they are provided purely for demonstration and **will break the config if present**. they are provided purely for demonstration only and **will break the config if present**.
``` ```
username=admin # Your username username=admin # Your username
password=admin # Your password password=admin # Your password
@ -51,7 +51,7 @@ port=7101 # What port to run on (probably leave on 7101 if using docker)
timezone=Local # IANA Time zone database identifier ("UTC", Local", "Europe/Moscow" etc.), Defaults to Local if can't parse. timezone=Local # IANA Time zone database identifier ("UTC", Local", "Europe/Moscow" etc.), Defaults to Local if can't parse.
grace_period=0s # Time after a new day begins, but before the switch to next day's file. e.g. 3h26m - files will change at 3:26am grace_period=0s # Time after a new day begins, but before the switch to next day's file. e.g. 3h26m - files will change at 3:26am
language=en # ISO-639 language code (available - en, ru) language=en # ISO-639 language code (available - en, ru)
theme="" # Picked theme (available - default (if left empty), high-contrast, lavender, gruvbox, sans) theme=default # Picked theme (available - default, high-contrast, lavender, gruvbox, sans)
title=🌺 Hibiscus.txt # The text in the header title=🌺 Hibiscus.txt # The text in the header
log_to_file=false # Whether to write logs to a file log_to_file=false # Whether to write logs to a file
log_file=config/log.txt # Where to store the log file if it is enabled log_file=config/log.txt # Where to store the log file if it is enabled

View file

@ -1,7 +1,6 @@
# TODO # TODO
List of things to add to this project List of things to add to this project
* Auth improvement so it DOESN'T ASK ME FOR PASSWORD EVERY DAY UGH XD
* Forward/backward buttons for days * Forward/backward buttons for days
## Brainstorming ## Brainstorming

View file

@ -41,7 +41,7 @@ var DefaultConfig = Config{
Timezone: time.Local, Timezone: time.Local,
GraceTime: 0, GraceTime: 0,
Language: "en", Language: "en",
Theme: "", Theme: "default",
Title: "🌺 Hibiscus.txt", Title: "🌺 Hibiscus.txt",
LogToFile: false, LogToFile: false,
LogFile: "config/log.txt", LogFile: "config/log.txt",

View file

@ -1,6 +1,4 @@
{ {
"lang": "en-UK",
"title.today": "Your day so far", "title.today": "Your day so far",
"title.days": "Previous days", "title.days": "Previous days",
"title.notes": "Notes", "title.notes": "Notes",

View file

@ -1,6 +1,4 @@
{ {
"lang": "ru",
"title.today": "Сегодняшний день", "title.today": "Сегодняшний день",
"title.days": "Предыдущие дни", "title.days": "Предыдущие дни",
"title.notes": "Заметки", "title.notes": "Заметки",
@ -13,7 +11,7 @@
"link.info": "системная информация", "link.info": "системная информация",
"time.date": "Сегодня", "time.date": "Сегодня",
"time.grace": "редактируется вчерашний день", "time.grace": "льготный период",
"button.save": "Сохранить", "button.save": "Сохранить",
"button.notes": "Новая заметка", "button.notes": "Новая заметка",
"prompt.notes": "Название заметки", "prompt.notes": "Название заметки",

View file

@ -15,7 +15,7 @@ type AppInfo struct {
// Info contains app information. // Info contains app information.
var Info = AppInfo{ var Info = AppInfo{
Version: "1.1.4", Version: "1.1.3",
SourceLink: "https://git.a71.su/Andrew71/hibiscus", SourceLink: "https://git.a71.su/Andrew71/hibiscus",
} }

View file

@ -1,11 +1,11 @@
{{ define "header" }} {{define "header"}}
<header> <header>
<h1>{{ config.Title }}</h1> <h1>{{ config.Title }}</h1>
<p>{{ translatableText "time.date" }} <span id="today-date">a place</span> <span id="grace" hidden>({{ translatableText "time.grace" }})</span></p> <p>{{translatableText "time.date"}} <span id="today-date">a place</span> <span id="grace" hidden>({{ translatableText "time.grace" }})</span></p>
</header> </header>
{{ end }} {{end}}
{{- define "base" -}} {{define "base"}}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ translatableText "lang" }}"> <html lang="{{ translatableText "lang" }}">
<head> <head>
@ -14,16 +14,16 @@
<link rel="manifest" href="/public/manifest.json" /> <link rel="manifest" href="/public/manifest.json" />
<link rel="icon" type="image/x-icon" href="/public/favicon.ico"> <link rel="icon" type="image/x-icon" href="/public/favicon.ico">
<link rel="stylesheet" href="/public/main.css"> <link rel="stylesheet" href="/public/main.css">
{{- if config.Theme -}}<link rel="stylesheet" href="/public/themes/{{ config.Theme }}.css">{{ end }} <link rel="stylesheet" href="/public/themes/{{ config.Theme }}.css">
<script src="/public/main.js"></script> <script src="/public/main.js"></script>
<title>Hibiscus.txt</title> <title>Hibiscus.txt</title>
</head> </head>
<body> <body>
{{- template "header" . -}} {{template "header" .}}
<main> <main>
{{- template "main" . -}} {{template "main" .}}
</main> </main>
{{- template "footer" . -}} {{template "footer" .}}
<script defer> <script defer>
const langName="{{ config.Language }}"; const langName="{{ config.Language }}";
const timeZone="{{ config.Timezone }}"; const timeZone="{{ config.Timezone }}";
@ -31,11 +31,11 @@
</script> </script>
</body> </body>
</html> </html>
{{ end }} {{end}}
{{ define "footer" }} {{define "footer"}}
<footer id="footer"> <footer id="footer">
<p><a href="/">{{ translatableText "link.today" }}</a> | <a href="/day">{{ translatableText "link.days" }}</a> | <a href="/notes">{{ translatableText "link.notes" }}</a> <p><a href="/">{{ translatableText "link.today" }}</a> | <a href="/day">{{ translatableText "link.days" }}</a> | <a href="/notes">{{ translatableText "link.notes" }}</a>
<span style="float:right;"><a class="no-accent" href="/info" title="{{ translatableText "link.info" }}">v{{ info.Version }}</a></span></p> <span style="float:right;"><a class="no-accent" href="/info" title="{{ translatableText "link.info" }}">v{{ info.Version }}</a></span></p>
</footer> </footer>
{{ end }} {{end}}

View file

@ -1,7 +1,7 @@
{{ define "main" }} {{define "main"}}
<form method="POST"> <form method="POST">
<h2><label for="text">{{ .Title }}:</label></h2> <h2><label for="text">{{ .Title }}:</label></h2>
<textarea id="text" cols="40" rows="15" name="text">{{ .Content }}</textarea> <textarea id="text" cols="40" rows="15" name="text">{{ .Content }}</textarea>
<button type="submit">{{ translatableText "button.save" }}</button> <button type="submit">{{ translatableText "button.save" }}</button>
</form> </form>
{{ end }} {{end}}

View file

@ -1,4 +1,4 @@
{{ define "main" }} {{define "main"}}
<h2><label for="text">{{ .Title }}</label></h2> <h2><label for="text">{{ .Title }}</label></h2>
<textarea id="text" cols="40" rows="15" readonly>{{ .Content }}</textarea> <textarea id="text" cols="40" rows="15" readonly>{{ .Content }}</textarea>
{{ end }} {{end}}

View file

@ -1,4 +1,4 @@
{{ define "main" }} {{define "main"}}
<h2>{{ translatableText "title.info" }}</h2> <h2>{{ translatableText "title.info" }}</h2>
<ul> <ul>
<li>{{ translatableText "info.version" }} - {{ info.Version }} (<a href="{{ .SourceLink }}">{{ translatableText "info.version.link" }}</a>)</li> <li>{{ translatableText "info.version" }} - {{ info.Version }} (<a href="{{ .SourceLink }}">{{ translatableText "info.version.link" }}</a>)</li>
@ -6,4 +6,4 @@
<li><a href="/readme">{{ translatableText "info.readme" }}</a></li> <li><a href="/readme">{{ translatableText "info.readme" }}</a></li>
<li><a href="/api/export" download="hibiscus">{{ translatableText "info.export" }}</a></li> <li><a href="/api/export" download="hibiscus">{{ translatableText "info.export" }}</a></li>
</ul> </ul>
{{ end }} {{end}}

View file

@ -1,9 +1,9 @@
{{ define "main" }} {{define "main"}}
<h2 class="list-title">{{ .Title }}</h2> <h2 class="list-title">{{.Title}}</h2>
<p class="list-desc">{{ .Description }}</p> <p class="list-desc">{{.Description}}</p>
<ul> <ul>
{{ range .Entries }} {{range .Entries}}
<li><a href="/{{.Link}}">{{.Title}}</a></li> <li><a href="/{{.Link}}">{{.Title}}</a></li>
{{ end }} {{end}}
</ul> </ul>
{{end}} {{end}}

View file

@ -0,0 +1 @@
/* Default theme is defined in main.css */