forked from jason/cpolis
Make creator's author checkbox work sensibly
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user