Compare commits
No commits in common. "7e7de28b143805b6b32d70dd62d1acefdc2cf257" and "959e1e96b3918d49d272b9a52231675c83f9acff" have entirely different histories.
7e7de28b14
...
959e1e96b3
44
.air.toml
44
.air.toml
@ -1,44 +0,0 @@
|
|||||||
root = "."
|
|
||||||
testdata_dir = "testdata"
|
|
||||||
tmp_dir = "tmp"
|
|
||||||
|
|
||||||
[build]
|
|
||||||
args_bin = []
|
|
||||||
bin = "./tmp/main -key tmp/key.gob -log tmp/cpolis.log -pics tmp/pics -rss tmp/orientexpress_alle.rss -web web"
|
|
||||||
cmd = "go build -o ./tmp/main ./cmd/main.go"
|
|
||||||
delay = 0
|
|
||||||
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
|
|
||||||
exclude_file = []
|
|
||||||
exclude_regex = ["_test.go"]
|
|
||||||
exclude_unchanged = false
|
|
||||||
follow_symlink = false
|
|
||||||
full_bin = ""
|
|
||||||
include_dir = []
|
|
||||||
include_ext = ["go", "tpl", "tmpl", "html", "css"]
|
|
||||||
include_file = []
|
|
||||||
kill_delay = "0s"
|
|
||||||
log = "build-errors.log"
|
|
||||||
poll = false
|
|
||||||
poll_interval = 0
|
|
||||||
rerun = false
|
|
||||||
rerun_delay = 500
|
|
||||||
send_interrupt = false
|
|
||||||
stop_on_error = false
|
|
||||||
|
|
||||||
[color]
|
|
||||||
app = ""
|
|
||||||
build = "yellow"
|
|
||||||
main = "magenta"
|
|
||||||
runner = "green"
|
|
||||||
watcher = "cyan"
|
|
||||||
|
|
||||||
[log]
|
|
||||||
main_only = false
|
|
||||||
time = false
|
|
||||||
|
|
||||||
[misc]
|
|
||||||
clean_on_exit = false
|
|
||||||
|
|
||||||
[screen]
|
|
||||||
clear_on_rebuild = false
|
|
||||||
keep_scroll = true
|
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -23,4 +23,3 @@ go.work
|
|||||||
|
|
||||||
# Custom stuff
|
# Custom stuff
|
||||||
tmp/
|
tmp/
|
||||||
style.css
|
|
||||||
|
24
cmd/main.go
24
cmd/main.go
@ -54,14 +54,8 @@ func main() {
|
|||||||
mux.HandleFunc("GET /edit-user/", view.EditUser(args, db, store))
|
mux.HandleFunc("GET /edit-user/", view.EditUser(args, db, store))
|
||||||
mux.HandleFunc("GET /hub/", view.ShowHub(args, db, store))
|
mux.HandleFunc("GET /hub/", view.ShowHub(args, db, store))
|
||||||
mux.HandleFunc("GET /logout/", view.Logout(args, store))
|
mux.HandleFunc("GET /logout/", view.Logout(args, store))
|
||||||
mux.HandleFunc("GET /publish-issue/",
|
mux.HandleFunc("GET /publish-issue/", view.PublishLatestIssue(args, db, store))
|
||||||
view.PublishLatestIssue(args, db, store))
|
mux.HandleFunc("GET /rejected-articles/", view.ShowRejectedArticles(args, db, store))
|
||||||
mux.HandleFunc("GET /rejected-articles/",
|
|
||||||
view.ShowRejectedArticles(args, db, store))
|
|
||||||
mux.HandleFunc("GET /review-rejected-article/{id}/",
|
|
||||||
view.ReviewRejectedArticle(args, db, store))
|
|
||||||
mux.HandleFunc("GET /review-unpublished-article/{id}/",
|
|
||||||
view.ReviewUnpublishedArticle(args, db, store))
|
|
||||||
mux.HandleFunc("GET /rss/", view.ShowRSS(args,
|
mux.HandleFunc("GET /rss/", view.ShowRSS(args,
|
||||||
db,
|
db,
|
||||||
"Freimaurer Distrikt Niedersachsen und Sachsen-Anhalt",
|
"Freimaurer Distrikt Niedersachsen und Sachsen-Anhalt",
|
||||||
@ -69,19 +63,17 @@ func main() {
|
|||||||
"Freiheit, Gleichheit, Brüderlichkeit, Toleranz und Humanität",
|
"Freiheit, Gleichheit, Brüderlichkeit, Toleranz und Humanität",
|
||||||
))
|
))
|
||||||
mux.HandleFunc("GET /this-issue/", view.ShowCurrentArticles(args, db))
|
mux.HandleFunc("GET /this-issue/", view.ShowCurrentArticles(args, db))
|
||||||
mux.HandleFunc("GET /unpublished-articles/",
|
mux.HandleFunc("GET /unpublished-articles/", view.ShowUnpublishedArticles(args, db))
|
||||||
view.ShowUnpublishedArticles(args, db))
|
|
||||||
mux.HandleFunc("GET /write-article/", view.WriteArticle(args, db))
|
mux.HandleFunc("GET /write-article/", view.WriteArticle(args, db))
|
||||||
|
|
||||||
mux.HandleFunc("POST /add-tag/", view.AddTag(args, db, store))
|
mux.HandleFunc("POST /add-tag/", view.AddTag(args, db, store))
|
||||||
mux.HandleFunc("POST /add-user/", view.AddUser(args, db, store))
|
mux.HandleFunc("POST /add-user/", view.AddUser(args, db, store))
|
||||||
mux.HandleFunc("POST /login/", view.Login(args, db, store))
|
mux.HandleFunc("POST /login/", view.Login(args, db, store))
|
||||||
mux.HandleFunc("POST /publish-article/{id}/",
|
mux.HandleFunc("POST /publish-article/", view.PublishArticle(args, db, store))
|
||||||
view.PublishArticle(args, db, store))
|
mux.HandleFunc("POST /reject-article/", view.RejectArticle(args, db, store))
|
||||||
mux.HandleFunc("POST /reject-article/{id}/",
|
mux.HandleFunc("POST /resubmit-article/", view.ResubmitArticle(args, db, store))
|
||||||
view.RejectArticle(args, db, store))
|
mux.HandleFunc("POST /review-rejected-article/", view.ReviewRejectedArticle(args, db, store))
|
||||||
mux.HandleFunc("POST /resubmit-article/{id}/",
|
mux.HandleFunc("POST /review-unpublished-article/", view.ReviewUnpublishedArticle(args, db, store))
|
||||||
view.ResubmitArticle(args, db, store))
|
|
||||||
mux.HandleFunc("POST /submit-article/", view.SubmitArticle(args, db, store))
|
mux.HandleFunc("POST /submit-article/", view.SubmitArticle(args, db, store))
|
||||||
mux.HandleFunc("POST /update-user/", view.UpdateUser(args, db, store))
|
mux.HandleFunc("POST /update-user/", view.UpdateUser(args, db, store))
|
||||||
mux.HandleFunc("POST /upload-image/", view.UploadImage(args))
|
mux.HandleFunc("POST /upload-image/", view.UploadImage(args))
|
||||||
|
@ -92,7 +92,7 @@ func SubmitArticle(c *control.CliArgs, db *model.DB, s *control.CookieStore) htt
|
|||||||
|
|
||||||
func ResubmitArticle(c *control.CliArgs, db *model.DB, s *control.CookieStore) http.HandlerFunc {
|
func ResubmitArticle(c *control.CliArgs, db *model.DB, s *control.CookieStore) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
id, err := strconv.ParseInt(r.PathValue("id"), 10, 64)
|
id, err := strconv.ParseInt(r.PostFormValue("article-id"), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
@ -202,7 +202,7 @@ func ReviewUnpublishedArticle(c *control.CliArgs, db *model.DB, s *control.Cooki
|
|||||||
}
|
}
|
||||||
data := new(htmlData)
|
data := new(htmlData)
|
||||||
|
|
||||||
id, err := strconv.ParseInt(r.PathValue("id"), 10, 64)
|
id, err := strconv.ParseInt(r.PostFormValue("id"), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
@ -238,7 +238,7 @@ func ReviewRejectedArticle(c *control.CliArgs, db *model.DB, s *control.CookieSt
|
|||||||
}
|
}
|
||||||
data := new(htmlData)
|
data := new(htmlData)
|
||||||
|
|
||||||
id, err := strconv.ParseInt(r.PathValue("id"), 10, 64)
|
id, err := strconv.ParseInt(r.PostFormValue("id"), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
@ -278,7 +278,7 @@ func ReviewRejectedArticle(c *control.CliArgs, db *model.DB, s *control.CookieSt
|
|||||||
|
|
||||||
func PublishArticle(c *control.CliArgs, db *model.DB, s *control.CookieStore) http.HandlerFunc {
|
func PublishArticle(c *control.CliArgs, db *model.DB, s *control.CookieStore) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
id, err := strconv.ParseInt(r.PathValue("id"), 10, 64)
|
id, err := strconv.ParseInt(r.PostFormValue("id"), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
@ -333,7 +333,7 @@ func PublishArticle(c *control.CliArgs, db *model.DB, s *control.CookieStore) ht
|
|||||||
|
|
||||||
func RejectArticle(c *control.CliArgs, db *model.DB, s *control.CookieStore) http.HandlerFunc {
|
func RejectArticle(c *control.CliArgs, db *model.DB, s *control.CookieStore) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
id, err := strconv.ParseInt(r.PathValue("id"), 10, 64)
|
id, err := strconv.ParseInt(r.PostFormValue("id"), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
|
||||||
module.exports = {
|
|
||||||
content: ["./web/templates/*.html"],
|
|
||||||
theme: {
|
|
||||||
extend: {}
|
|
||||||
},
|
|
||||||
plugins: [],
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
@tailwind base;
|
|
||||||
@tailwind components;
|
|
||||||
@tailwind utilities;
|
|
||||||
|
|
||||||
body {
|
|
||||||
width: 800px;
|
|
||||||
@apply mx-auto text-slate-900;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
@apply font-bold mb-2 text-2xl;
|
|
||||||
}
|
|
||||||
|
|
||||||
form {
|
|
||||||
@apply flex flex-col gap-y-3;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="file"] {
|
|
||||||
@apply border rounded-md w-full;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="password"],
|
|
||||||
input[type="text"] {
|
|
||||||
@apply border h-8 rounded-md;
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea {
|
|
||||||
@apply border h-32 rounded-md;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-area {
|
|
||||||
@apply flex gap-4 mt-4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
@apply bg-slate-50 border my-2 px-3 py-2 rounded-md w-full hover:bg-slate-100;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn {
|
|
||||||
@apply bg-slate-800 border my-2 px-3 py-2 rounded-md text-slate-50 w-full hover:bg-slate-700;
|
|
||||||
}
|
|
0
web/static/css/style.css
Normal file
0
web/static/css/style.css
Normal file
@ -2,11 +2,9 @@
|
|||||||
<h2>Neuer Tag</h2>
|
<h2>Neuer Tag</h2>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
<input required name="tag" placeholder="Tag eingeben" type="text" />
|
<input required name="tag" placeholder="Tag" type="text" />
|
||||||
<div class="btn-area">
|
<input type="submit" value="Anlegen" hx-post="/add-tag/" hx-target="#page-content" />
|
||||||
<input class="action-btn" type="submit" value="Anlegen" hx-post="/add-tag/" hx-target="#page-content" />
|
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<button hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -1,54 +1,33 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<h2>Neuer Benutzer</h2>
|
<h2>Neuer Benutzer</h2>
|
||||||
<form>
|
<form>
|
||||||
<div class="grid grid-cols-3 gap-4">
|
|
||||||
<div>
|
<div>
|
||||||
<label for="username">Benutzername</label>
|
<input required name="username" placeholder="Benutzername" type="text" value="{{.UserName}}" />
|
||||||
<input class="w-full" required name="username" type="text" value="{{.UserName}}" />
|
<input required name="password" placeholder="Passwort" type="password" />
|
||||||
</div>
|
<input required name="password2" placeholder="Passwort wiederholen" type="password" />
|
||||||
<div>
|
</div>
|
||||||
<label for="password">Passwort</label>
|
|
||||||
<input class="w-full" required name="password" placeholder="***" type="password" />
|
<div>
|
||||||
</div>
|
<input required name="first-name" placeholder="Vorname" type="text" value="{{.FirstName}}" />
|
||||||
<div>
|
<input required name="last-name" placeholder="Nachname" type="text" value="{{.LastName}}" />
|
||||||
<label for="password2">Passwort wiederholen</label>
|
|
||||||
<input class="w-full" required name="password2" placeholder="***" type="password" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="first-name">Vorname</label>
|
|
||||||
<input class="w-full" required name="first-name" type="text" value="{{.FirstName}}" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="last-name">Nachname</label>
|
|
||||||
<input class="w-full" required name="last-name" type="text" value="{{.LastName}}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-4">
|
|
||||||
<div>
|
<div>
|
||||||
<input required id="author" name="role" type="radio" value="3" {{if eq .Role 3 }}checked{{end}} />
|
<input required id="author" name="role" type="radio" value="3" {{if eq .Role 3 }}checked{{end}} />
|
||||||
<label for="author">Autor</label>
|
<label for="author">Autor</label>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input required id="editor" name="role" type="radio" value="2" {{if eq .Role 2 }}checked{{end}} />
|
<input required id="editor" name="role" type="radio" value="2" {{if eq .Role 2 }}checked{{end}} />
|
||||||
<label for="editor">Redakteur</label>
|
<label for="editor">Redakteur</label>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input required id="publisher" name="role" type="radio" value="1" {{if eq .Role 1 }}checked{{end}} />
|
<input required id="publisher" name="role" type="radio" value="1" {{if eq .Role 1 }}checked{{end}} />
|
||||||
<label for="publisher">Herausgeber</label>
|
<label for="publisher">Herausgeber</label>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input required id="admin" name="role" type="radio" value="0" {{if eq .Role 0 }}checked{{end}} />
|
<input required id="admin" name="role" type="radio" value="0" {{if eq .Role 0 }}checked{{end}} />
|
||||||
<label for="admin">Admin</label>
|
<label for="admin">Admin</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="btn-area">
|
<input type="submit" value="Anlegen" hx-post="/add-user/" hx-target="#page-content" />
|
||||||
<input class="action-btn" type="submit" value="Anlegen" hx-post="/add-user/" hx-target="#page-content" />
|
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<button hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var msg = "{{.Msg}}";
|
var msg = "{{.Msg}}";
|
||||||
if (msg != "") {
|
if (msg != "") {
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<div class="flex flex-col gap-4">
|
<div>
|
||||||
{{range .}}
|
{{range .}}
|
||||||
<div class="border px-2 py-1 rounded-md">
|
<div>
|
||||||
<h1 class="font-bold text-2xl">{{.Title}}</h1>
|
<h1>{{.Title}}</h1>
|
||||||
<p>{{.Description}}</p>
|
<p>{{.Description}}</p>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-area">
|
<button hx-get="/publish-issue/" hx-target="#page-content">Ausgabe publizieren</button>
|
||||||
<button class="action-btn" hx-get="/publish-issue/" hx-target="#page-content">Ausgabe publizieren</button>
|
<button hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -1,36 +1,19 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<form>
|
<form>
|
||||||
<div class="grid grid-cols-3 gap-4">
|
|
||||||
<div>
|
<div>
|
||||||
<label for="username">Benutzername</label>
|
<input name="username" type="text" value="{{.UserName}}" />
|
||||||
<input class="w-full" name="username" type="text" value="{{.UserName}}" />
|
<input name="first-name" type="text" value="{{.FirstName}}" />
|
||||||
</div>
|
<input name="last-name" type="text" value="{{.LastName}}" />
|
||||||
<div>
|
|
||||||
<label for="first-name">Vorname</label>
|
|
||||||
<input class="w-full" name="first-name" type="text" value="{{.FirstName}}" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="last-name">Nachname</label>
|
|
||||||
<input class="w-full" name="last-name" type="text" value="{{.LastName}}" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="old-password">Altes Passwort</label>
|
|
||||||
<input class="w-full" name="old-password" placeholder="***" type="password" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="password">Passwort</label>
|
|
||||||
<input class="w-full" name="password" placeholder="***" type="password" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="password2">Passwort wiederholen</label>
|
|
||||||
<input class="w-full" name="password2" placeholder="***" type="password" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-area">
|
<div>
|
||||||
<input class="action-btn" type="submit" value="Aktualisieren" hx-post="/update-user/"
|
<input name="old-password" placeholder="Altes Passwort" type="password" />
|
||||||
hx-target="#page-content" />
|
<input name="password" placeholder="Neues Passwort" type="password" />
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
<input name="password2" placeholder="Wiederholen" type="password" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<input type="submit" value="Aktualisieren" hx-post="/update-user/" hx-target="#page-content" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<button hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -1,20 +1,13 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<h2>Editor</h2>
|
<h2>Editor</h2>
|
||||||
<form>
|
<form>
|
||||||
<div class="flex flex-col gap-y-1">
|
<div>
|
||||||
<label for="article-title">Titel</label>
|
<input name="article-title" placeholder="Titel" type="text" />
|
||||||
<input name="article-title" type="text" />
|
<textarea name="article-description" placeholder="Beschreibung"></textarea>
|
||||||
</div>
|
<textarea name="article-content" placeholder="Artikel"></textarea>
|
||||||
<div class="flex flex-col">
|
|
||||||
<label for="article-description">Beschreibung</label>
|
|
||||||
<textarea name="article-description"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col">
|
|
||||||
<label for="article-content">Artikel</label>
|
|
||||||
<textarea name="article-content"></textarea>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-4">
|
<div>
|
||||||
{{range .}}
|
{{range .}}
|
||||||
<div>
|
<div>
|
||||||
<input id="{{.Name}}" name="tags" type="checkbox" value="{{.ID}}" />
|
<input id="{{.Name}}" name="tags" type="checkbox" value="{{.ID}}" />
|
||||||
@ -24,16 +17,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="editor-images">
|
<div id="editor-images">
|
||||||
<input class="mb-2" name="article-image" type="file" hx-encoding="multipart/form-data" hx-post="/upload-image/"
|
<input name="article-image" type="file" hx-encoding="multipart/form-data" hx-post="/upload-image/"
|
||||||
hx-swap="beforeend" hx-target="#editor-images" />
|
hx-swap="beforeend" hx-target="#editor-images" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-area">
|
<input type="submit" value="Senden" hx-post="/submit-article/" hx-target="#page-content" />
|
||||||
<input class="action-btn" type="submit" value="Senden" hx-post="/submit-article/" hx-target="#page-content" />
|
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<button hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function copyToClipboard(text) {
|
function copyToClipboard(text) {
|
||||||
event.preventDefault(); // Get-Request verhindern
|
event.preventDefault(); // Get-Request verhindern
|
||||||
@ -57,10 +49,9 @@
|
|||||||
|
|
||||||
{{define "editor-images"}}
|
{{define "editor-images"}}
|
||||||
{{if gt (len .) 0}}
|
{{if gt (len .) 0}}
|
||||||
<div class="border px-2 py-1 rounded-md flex gap-4 justify-between">
|
<div>
|
||||||
<div class="self-center">{{.}}</div>
|
{{.}}
|
||||||
<button class="bg-slate-50 border my-2 px-3 py-2 rounded-md w-32 hover:bg-slate-100"
|
<button onclick="copyToClipboard('{{.}}')">Kopieren</button>
|
||||||
onclick="copyToClipboard('{{.}}')">Kopieren</button>
|
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -1,40 +1,25 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<div class="flex flex-col gap-4">
|
<h2>Hub</h2>
|
||||||
<div class="mb-3">
|
<div>
|
||||||
<h2>Autor</h2>
|
<button hx-get="/write-article/" hx-target="#page-content">Artikel schreiben</button>
|
||||||
<div class="grid grid-cols-2 gap-x-4 gap-y-2">
|
<button hx-get="/rejected-articles/" hx-target="#page-content">Abgelehnte Artikel</button>
|
||||||
<button class="btn" hx-get="/write-article/" hx-target="#page-content">Artikel schreiben</button>
|
<button hx-get="/rss/" hx-target="#page-content">RSS Feed</button>
|
||||||
<button class="btn" hx-get="/rejected-articles/" hx-target="#page-content">Abgelehnte Artikel</button>
|
<button hx-get="/edit-user/" hx-target="#page-content">Benutzer bearbeiten</button>
|
||||||
<button class="btn" hx-get="/rss/" hx-target="#page-content">RSS Feed</button>
|
</div>
|
||||||
<button class="btn" hx-get="/edit-user/" hx-target="#page-content">Benutzer bearbeiten</button>
|
{{if lt . 3}}
|
||||||
</div>
|
<div>
|
||||||
</div>
|
<button hx-get="/unpublished-articles/" hx-target="#page-content">Unveröffentlichte Artikel</button>
|
||||||
{{if lt . 3}}
|
<button hx-get="/create-tag/" hx-target="#page-content">Neuer Tag</button>
|
||||||
<div class="mb-3">
|
|
||||||
<h2>Redakteur</h2>
|
|
||||||
<div class="grid grid-cols-2 gap-4">
|
|
||||||
<button class="btn" hx-get="/unpublished-articles/" hx-target="#page-content">
|
|
||||||
Unveröffentlichte Artikel
|
|
||||||
</button>
|
|
||||||
<button class="btn" hx-get="/create-tag/" hx-target="#page-content">Neuer Tag</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
{{if lt . 2}}
|
|
||||||
<div class="mb-3">
|
|
||||||
<h2>Herausgeber</h2>
|
|
||||||
<div class="grid grid-cols-2 gap-4">
|
|
||||||
<button class="btn" hx-get="/this-issue/" hx-target="#page-content">Diese Ausgabe</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
{{if eq . 0}}
|
|
||||||
<div class="mb-3">
|
|
||||||
<h2>Administrator</h2>
|
|
||||||
<div class="grid grid-cols-2 gap-4">
|
|
||||||
<button class="btn" hx-get="/create-user/" hx-target="#page-content">Benutzer hinzufügen</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{if lt . 2}}
|
||||||
|
<div>
|
||||||
|
<button hx-get="/this-issue/" hx-target="#page-content">Diese Ausgabe</button>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{if eq . 0}}
|
||||||
|
<div>
|
||||||
|
<button hx-get="/create-user/" hx-target="#page-content">Benutzer hinzufügen</button>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Orient Editor</title>
|
<title>Orient Editor</title>
|
||||||
<link href="/web/static/css/style.css" rel="stylesheet">
|
<link href="web/static/css/style.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="flex flex-col justify-between min-h-[100dvh] bg-slate-50">
|
<body>
|
||||||
<header class="my-8">
|
<header>
|
||||||
<h1 class="font-bold text-4xl text-center">Orient Editor</h1>
|
<h1>Orient Editor</h1>
|
||||||
<button class="btn" hx-get="logout" hx-target="#page-content">Abmelden</button>
|
<button hx-get="logout" hx-target="#page-content">Abmelden</button>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
@ -19,13 +19,11 @@
|
|||||||
{{template "page-content" .}}
|
{{template "page-content" .}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/web/static/js/htmx.min.js"></script>
|
<script src="web/static/js/htmx.min.js"></script>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="my-8">
|
<footer>
|
||||||
<p class="text-center text-gray-500 dark:text-gray-400">
|
<p>© 2024 Jason Streifling. Alle Rechte vorbehalten.</p>
|
||||||
© 2024 Jason Streifling. Alle Rechte vorbehalten.
|
|
||||||
</p>
|
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<h2>Anmeldung</h2>
|
<h2>Anmeldung</h2>
|
||||||
<form>
|
<form>
|
||||||
<div class="btn-area">
|
<div>
|
||||||
<input class="w-full" name="username" placeholder="Benutzername" type="text" />
|
<input name="username" placeholder="Benutzername" type="text" />
|
||||||
<input class="w-full" name="password" placeholder="Passwort" type="password" />
|
<input name="password" placeholder="Passwort" type="password" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input class="action-btn" type="submit" value="Anmelden" hx-post="/login/" hx-target="#page-content" />
|
<input type="submit" value="Anmelden" hx-post="/login/" hx-target="#page-content" />
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<div class="flex flex-col gap-4">
|
<form>
|
||||||
|
<div>
|
||||||
{{range .RejectedArticles}}
|
{{range .RejectedArticles}}
|
||||||
|
<div>
|
||||||
{{if index $.MyIDs .ID}}
|
{{if index $.MyIDs .ID}}
|
||||||
<button class="btn" hx-get="/review-rejected-article/{{.ID}}/" hx-target="#page-content">
|
<input required id="{{.ID}}" name="id" type="radio" value="{{.ID}}" />
|
||||||
<h1 class="font-bold text-2xl">{{.Title}}</h1>
|
<label for="{{.ID}}">{{.Title}}</label>
|
||||||
<p>{{.Description}}</p>
|
|
||||||
</button>
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
<button class="action-btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
<input type="submit" value="Auswählen" hx-post="/review-rejected-article/" hx-target="#page-content" />
|
||||||
</div>
|
</form>
|
||||||
|
|
||||||
|
<button hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -1,20 +1,14 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<h2>Editor</h2>
|
<h2>Editor</h2>
|
||||||
<form>
|
<form>
|
||||||
<div class="flex flex-col gap-y-1">
|
<div>
|
||||||
<label for="article-title">Titel</label>
|
<input name="article-title" placeholder="Titel" type="text" value="{{.Article.Title}}" />
|
||||||
<input name="article-title" type="text" value="{{.Article.Title}}" />
|
<textarea name="article-description" placeholder="Beschreibung">{{.Article.Description}}</textarea>
|
||||||
</div>
|
|
||||||
<div class="flex flex-col">
|
|
||||||
<label for="article-description">Beschreibung</label>
|
|
||||||
<textarea name="article-description">{{.Article.Description}}</textarea>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col">
|
|
||||||
<label for="article-content">Artikel</label>
|
|
||||||
<textarea name="article-content" placeholder="Artikel">{{.Article.Content}}</textarea>
|
<textarea name="article-content" placeholder="Artikel">{{.Article.Content}}</textarea>
|
||||||
|
<input name="article-id" type="hidden" value="{{.Article.ID}}" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-4">
|
<div>
|
||||||
{{range .Tags}}
|
{{range .Tags}}
|
||||||
<div>
|
<div>
|
||||||
<input id="tag-{{.Name}}" name="tags" type="checkbox" value="{{.ID}}" {{if index $.Selected
|
<input id="tag-{{.Name}}" name="tags" type="checkbox" value="{{.ID}}" {{if index $.Selected
|
||||||
@ -25,17 +19,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="editor-images">
|
<div id="editor-images">
|
||||||
<input class="mb-2" name="article-image" type="file" hx-encoding="multipart/form-data" hx-post="/upload-image/"
|
<input name="article-image" type="file" hx-encoding="multipart/form-data" hx-post="/upload-image/"
|
||||||
hx-swap="beforeend" hx-target="#editor-images" />
|
hx-swap="beforeend" hx-target="#editor-images" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-area">
|
<input type="submit" value="Senden" hx-post="/resubmit-article/" hx-target="#page-content" />
|
||||||
<input class="action-btn" type="submit" value="Senden" hx-post="/resubmit-article/{{.Article.ID}}/"
|
|
||||||
hx-target="#page-content" />
|
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<button hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function copyToClipboard(text) {
|
function copyToClipboard(text) {
|
||||||
event.preventDefault(); // Get-Request verhindern
|
event.preventDefault(); // Get-Request verhindern
|
||||||
@ -59,10 +51,9 @@
|
|||||||
|
|
||||||
{{define "editor-images"}}
|
{{define "editor-images"}}
|
||||||
{{if gt (len .) 0}}
|
{{if gt (len .) 0}}
|
||||||
<div class="border px-2 py-1 rounded-md flex gap-4 justify-between">
|
<div>
|
||||||
<div class="self-center">{{.}}</div>
|
{{.}}
|
||||||
<button class="bg-slate-50 border my-2 px-3 py-2 rounded-md w-32 hover:bg-slate-100"
|
<button onclick="copyToClipboard('{{.}}')">Kopieren</button>
|
||||||
onclick="copyToClipboard('{{.}}')">Kopieren</button>
|
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -10,12 +10,10 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="btn-area">
|
<input name="id" type="hidden" value="{{.Article.ID}}" />
|
||||||
<input class="action-btn" type="submit" value="Veröffentlichen" hx-post="/publish-article/{{.Article.ID}}/"
|
<input type="submit" value="Veröffentlichen" hx-post="/publish-article/" hx-target="#page-content" />
|
||||||
hx-target="#page-content" />
|
<input type="submit" value="Ablehnen" hx-post="/reject-article/" hx-target="#page-content" />
|
||||||
<input class="btn" type="submit" value="Ablehnen" hx-post="/reject-article/{{.Article.ID}}/"
|
|
||||||
hx-target="#page-content" />
|
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<button hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
{{define "page-content"}}
|
{{define "page-content"}}
|
||||||
<div class="flex flex-col gap-4">
|
<form>
|
||||||
|
<div>
|
||||||
{{range .}}
|
{{range .}}
|
||||||
<button class="btn" hx-get="/review-unpublished-article/{{.ID}}/" hx-target="#page-content">
|
<div>
|
||||||
<h1 class="font-bold text-2xl">{{.Title}}</h1>
|
<input required id="{{.ID}}" name="id" type="radio" value="{{.ID}}" />
|
||||||
<p>{{.Description}}</p>
|
<label for="{{.ID}}">{{.Title}}</label>
|
||||||
</button>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<button class="btn" hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
</div>
|
||||||
</div>
|
|
||||||
|
<input type="submit" value="Auswählen" hx-post="/review-unpublished-article/" hx-target="#page-content" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<button hx-get="/hub/" hx-target="#page-content">Zurück</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user