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
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
This release mostly consists of backend improvements
* 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.
### Config options:
Below are the available configuration options and their defaults.
The settings are defined as newline separated `key=value` pairs in the config file.
If you do not provide an option, the default will be used.
Below are available configuration options and their defaults.
The settings are defined as newline separated key=value pairs in config.txt.
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,
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
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.
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)
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
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

View file

@ -1,7 +1,6 @@
# TODO
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
## Brainstorming

View file

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

View file

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

View file

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

View file

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

View file

@ -1,11 +1,11 @@
{{ define "header" }}
{{define "header"}}
<header>
<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>
{{ end }}
{{end}}
{{- define "base" -}}
{{define "base"}}
<!DOCTYPE html>
<html lang="{{ translatableText "lang" }}">
<head>
@ -14,16 +14,16 @@
<link rel="manifest" href="/public/manifest.json" />
<link rel="icon" type="image/x-icon" href="/public/favicon.ico">
<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>
<title>Hibiscus.txt</title>
</head>
<body>
{{- template "header" . -}}
{{template "header" .}}
<main>
{{- template "main" . -}}
{{template "main" .}}
</main>
{{- template "footer" . -}}
{{template "footer" .}}
<script defer>
const langName="{{ config.Language }}";
const timeZone="{{ config.Timezone }}";
@ -31,11 +31,11 @@
</script>
</body>
</html>
{{ end }}
{{end}}
{{ define "footer" }}
{{define "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>
<span style="float:right;"><a class="no-accent" href="/info" title="{{ translatableText "link.info" }}">v{{ info.Version }}</a></span></p>
</footer>
{{ end }}
{{end}}

View file

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

View file

@ -1,4 +1,4 @@
{{ define "main" }}
{{define "main"}}
<h2><label for="text">{{ .Title }}</label></h2>
<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>
<ul>
<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="/api/export" download="hibiscus">{{ translatableText "info.export" }}</a></li>
</ul>
{{ end }}
{{end}}

View file

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

View file

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