💄 Better titles; go fmt
This commit is contained in:
parent
b8de119cc6
commit
8f3a5b35c8
4 changed files with 12 additions and 8 deletions
10
http/main.go
10
http/main.go
|
@ -94,7 +94,9 @@ func handleNewVoting(ctx echo.Context) error {
|
|||
}
|
||||
|
||||
func handleVotingForm(ctx echo.Context) error {
|
||||
return ctx.Render(http.StatusOK, "voting_form", nil)
|
||||
return ctx.Render(http.StatusOK, "voting_form", map[string]interface{}{
|
||||
"Title": "cvote",
|
||||
})
|
||||
}
|
||||
|
||||
func handleVote(ctx echo.Context) error {
|
||||
|
@ -122,8 +124,9 @@ func handleVote(ctx echo.Context) error {
|
|||
}
|
||||
store.PlaceVote(id, vid, elector, c)
|
||||
return ctx.Render(http.StatusFound, "thanks", map[string]interface{}{
|
||||
"Id": id,
|
||||
"Vid": vid,
|
||||
"Title": "cvote | thx",
|
||||
"Id": id,
|
||||
"Vid": vid,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -138,6 +141,7 @@ func handleShowVoting(ctx echo.Context) error {
|
|||
}
|
||||
}
|
||||
return ctx.Render(http.StatusOK, "voting", map[string]interface{}{
|
||||
"Title": "cvote | " + v.Referendum(),
|
||||
"Voting": v,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ func getVotes(id string) ([]vote.Vote, error) {
|
|||
return nil, err
|
||||
}
|
||||
var (
|
||||
i string
|
||||
i string
|
||||
e string
|
||||
c vote.Choice
|
||||
ts time.Time
|
||||
|
|
|
@ -129,7 +129,7 @@ func (v Voting) Electors() []string {
|
|||
}
|
||||
|
||||
func (v Voting) Anonymous() bool {
|
||||
return v.annonymous
|
||||
return v.annonymous
|
||||
}
|
||||
|
||||
func (v Voting) IsOpen() bool {
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
)
|
||||
|
||||
type Vote struct {
|
||||
Id string
|
||||
Id string
|
||||
Elector string
|
||||
Choice Choice
|
||||
timestamp time.Time
|
||||
|
@ -14,7 +14,7 @@ type Vote struct {
|
|||
|
||||
func NewVote(id, elector string, choice Choice) Vote {
|
||||
return Vote{
|
||||
Id: id,
|
||||
Id: id,
|
||||
Elector: elector,
|
||||
Choice: choice,
|
||||
timestamp: time.Now().UTC(),
|
||||
|
@ -23,7 +23,7 @@ func NewVote(id, elector string, choice Choice) Vote {
|
|||
|
||||
func NewVoteWithTimestamp(id, elector string, choice Choice, timestamp time.Time) Vote {
|
||||
return Vote{
|
||||
Id: id,
|
||||
Id: id,
|
||||
Elector: elector,
|
||||
Choice: choice,
|
||||
timestamp: timestamp,
|
||||
|
|
Loading…
Reference in a new issue