diff --git a/cmd/party/api/votes.go b/cmd/party/api/votes.go index 5c87896..e049b55 100644 --- a/cmd/party/api/votes.go +++ b/cmd/party/api/votes.go @@ -8,6 +8,11 @@ import ( ) func (api *Api) Vote(w http.ResponseWriter, r *http.Request) { + if authHeader := r.Header.Get("Authorization"); authHeader != "" { + api.errorResponse(w, r, data.ErrAuthenticatedVoteRejected) + return + } + var input struct { IssueID int64 `json:"issue_id"` OptionID int64 `json:"option_id"` diff --git a/internal/data/errors.go b/internal/data/errors.go index b6be00d..d1450c0 100644 --- a/internal/data/errors.go +++ b/internal/data/errors.go @@ -76,8 +76,9 @@ var ( ErrAuthRequired = New(401, errCodeAuthRequired, "you must be authenticated to access this resource") // 403 Forbidden - ErrInactiveAccount = New(403, errCodeInactiveAccount, "your user account must be activated to access this resource") - ErrNotPermitted = New(403, errCodeNotPermitted, "your user account doesn't have the necessary permissions to access this resource") + ErrInactiveAccount = New(403, errCodeInactiveAccount, "your user account must be activated to access this resource") + ErrNotPermitted = New(403, errCodeNotPermitted, "your user account doesn't have the necessary permissions to access this resource") + ErrAuthenticatedVoteRejected = New(403, errCodeNotPermitted, "authenticated vote rejected") // 404 Not Found ErrRecordNotFound = New(404, 404, "record not found") diff --git a/web/html/profile.page.tmpl b/web/html/profile.page.tmpl index f7fa45b..e31b610 100644 --- a/web/html/profile.page.tmpl +++ b/web/html/profile.page.tmpl @@ -3,25 +3,59 @@ {{define "title"}}Mein Profil{{end}} {{define "body"}} - +
-
-
{{.User.Name}}{{if .User.AltName}} / {{.User.AltName}}{{end}}
-
-
E-Mail   {{.User.Email}}
-
Telefon   {{.User.PhoneNumber}}
-
Land   {{.User.Country}}
-
Adresse   {{.User.Address}}
-
Geburtsdatum   {{.User.DateOfBirth.Format "02.01.2006"}}
-
Mitglied seit   {{.User.Created.Format "02.01.2006"}}
+
+ {{slice .User.Name 0 1}}
-
- +

+ {{.User.Name}}{{if .User.AltName}} / {{.User.AltName}}{{end}} +

+

Mitglied

+ +
+ +
+ Profildaten +
+ +
+
+ E-Mail + {{.User.Email}} +
+
+ Telefon + {{.User.PhoneNumber}} +
+
+ Land + {{.User.Country}} +
+
+ Adresse + {{.User.Address}} +
+
+ Geburtsdatum + {{.User.DateOfBirth.Format "02.01.2006"}} +
+
+ Mitglied seit + {{.User.Created.Format "02.01.2006"}} +
+
+ +
+
+
Gefahrenzone
+
Diese Aktion kann nicht rückgängig gemacht werden.
+
+ +
{{end}} diff --git a/web/static/style.css b/web/static/style.css index a4698cb..d801d20 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -373,6 +373,17 @@ a:hover { color: var(--text); } +.btn--danger { + background: #dc2626; + color: #fff; +} + +.btn--danger:hover { + background: #b91c1c; + color: #fff; + box-shadow: 0 2px 8px rgba(220,38,38,0.3); +} + .btn--full { width: 100%; margin-top: 4px;