Compare commits
3 Commits
v0.14.0
...
d239a86444
Author | SHA1 | Date | |
---|---|---|---|
d239a86444 | |||
8b1b99d0f7 | |||
c0e446d6d9 |
@ -52,7 +52,7 @@ func newConfig() *Config {
|
||||
PDFDir: "/var/www/cpolis/pdfs",
|
||||
PicsDir: "/var/www/cpolis/pics",
|
||||
Port: ":8080",
|
||||
Version: "v0.14.0",
|
||||
Version: "v0.14.1",
|
||||
WebDir: "/var/www/cpolis/web",
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ func WriteArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
data.Creator = data.ArticleUsers[fmt.Sprint(creator.LastName, creator.FirstName, creator.ID)]
|
||||
data.Creator.ArticleRole = Author
|
||||
delete(data.ArticleUsers, fmt.Sprint(creator.LastName, creator.FirstName, creator.ID))
|
||||
|
||||
data.Tags, err = db.GetTagList()
|
||||
@ -155,10 +156,10 @@ func SubmitArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
if r.PostFormValue("creator") == "contributor" {
|
||||
contributors = append(contributors, article.CreatorID)
|
||||
} else {
|
||||
if r.PostFormValue("creator") == "author" {
|
||||
authors = append(authors, article.CreatorID)
|
||||
} else {
|
||||
contributors = append(contributors, article.CreatorID)
|
||||
}
|
||||
if len(authors) == 0 {
|
||||
http.Error(w, "Es muss mindestens einen Autor geben.", http.StatusBadRequest)
|
||||
@ -274,10 +275,10 @@ func ResubmitArticle(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
if r.PostFormValue("creator") == "contributor" {
|
||||
contributors = append(contributors, article.CreatorID)
|
||||
} else {
|
||||
if r.PostFormValue("creator") == "author" {
|
||||
authors = append(authors, article.CreatorID)
|
||||
} else {
|
||||
contributors = append(contributors, article.CreatorID)
|
||||
}
|
||||
if len(authors) == 0 {
|
||||
http.Error(w, "Es muss mindestens einen Autor geben.", http.StatusBadRequest)
|
||||
|
@ -1,9 +1,14 @@
|
||||
[Unit]
|
||||
Description=cpolis
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/cpolis
|
||||
Restart=on-failure
|
||||
User=cpolis
|
||||
Group=cpolis
|
||||
Restart=always
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
WantedBy=multi-user.target
|
||||
|
@ -75,9 +75,9 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input id="creator" name="creator" type="checkbox" value="contributor" {{if eq .Creator.ArticleRole
|
||||
2}}checked{{end}} />
|
||||
<label for="creator">Ich bin nicht der Autor.</label>
|
||||
<input id="creator" name="creator" type="checkbox" value="author" {{if eq .Creator.ArticleRole
|
||||
1}}checked{{end}} />
|
||||
<label for="creator">Ich bin Autor.</label>
|
||||
</div>
|
||||
|
||||
<div class="btn-area">
|
||||
|
Reference in New Issue
Block a user