DB migration & timer token
This commit is contained in:
@ -13,7 +13,7 @@ templ LoginFormError(currentUser *model.User, err string) {
|
||||
<input type="password" name="password" placeholder="Password" />
|
||||
<button type="submit">Sign in</button>
|
||||
if err != "" {
|
||||
<span style="color:red;">{ err }</span>
|
||||
<span class="error">{ err }</span>
|
||||
}
|
||||
</p>
|
||||
</form>
|
||||
|
@ -37,14 +37,14 @@ func LoginFormError(currentUser *model.User, err string) templ.Component {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if err != "" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<span style=\"color:red;\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<span class=\"error\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(err)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view\login.templ`, Line: 16, Col: 50}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view\login.templ`, Line: 16, Col: 45}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
@ -37,11 +37,11 @@ templ TimerCreateForm(timerName string, err string) {
|
||||
|
||||
templ TimersList(timers []model.Timer, isSignedIn bool) {
|
||||
<div class="timers-list">
|
||||
<h1>Timers</h1>
|
||||
for _, t := range timers {
|
||||
@timer(t)
|
||||
}
|
||||
if isSignedIn {
|
||||
<h1>Timers</h1>
|
||||
for _, t := range timers {
|
||||
@timer(t)
|
||||
}
|
||||
<h4>Create timer</h4>
|
||||
@TimerCreateForm("", "")
|
||||
}
|
||||
|
@ -147,18 +147,22 @@ func TimersList(timers []model.Timer, isSignedIn bool) templ.Component {
|
||||
templ_7745c5c3_Var8 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"timers-list\"><h1>Timers</h1>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"timers-list\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, t := range timers {
|
||||
templ_7745c5c3_Err = timer(t).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if isSignedIn {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h1>Timers</h1>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
if isSignedIn {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h4>Create timer</h4>")
|
||||
for _, t := range timers {
|
||||
templ_7745c5c3_Err = timer(t).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <h4>Create timer</h4>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
Reference in New Issue
Block a user