Fill fields with default values
This commit is contained in:
parent
11163f059b
commit
a4df681f88
3 changed files with 14 additions and 3 deletions
|
|
@ -30,10 +30,13 @@ func DeclareNoJSRoutes(router *gin.Engine, cfg *config.Config, db *reveil.LevelD
|
|||
return
|
||||
}
|
||||
|
||||
defaultAlarm := time.Now().Add(460 * time.Minute)
|
||||
|
||||
if alarm == nil {
|
||||
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
||||
"noAlarm": true,
|
||||
"isPlaying": player.CommonPlayer != nil,
|
||||
"defaultAlarm": defaultAlarm.Format("15:04"),
|
||||
"noAlarm": true,
|
||||
"isPlaying": player.CommonPlayer != nil,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
@ -43,6 +46,7 @@ func DeclareNoJSRoutes(router *gin.Engine, cfg *config.Config, db *reveil.LevelD
|
|||
nMinutes := int((time.Until(*alarm) / time.Minute) % 90)
|
||||
|
||||
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
||||
"defaultAlarm": defaultAlarm.Format("15:04"),
|
||||
"noAlarm": false,
|
||||
"nextAlarmDate": alarm.Format("Mon 2"),
|
||||
"nextAlarmTime": alarm.Format("15:04"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue