Add themed UI, favicon, plan deletion, regrow cycles, and crop prep/post tasks
This commit is contained in:
@@ -31,6 +31,11 @@ func (a *App) handleDashboard(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "plans read failed", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
stepMap, err := a.listCropStepsMap()
|
||||
if err != nil {
|
||||
http.Error(w, "steps read failed", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
data := DashboardPage{
|
||||
BasePage: BasePage{
|
||||
ActivePath: "/",
|
||||
@@ -39,8 +44,8 @@ func (a *App) handleDashboard(w http.ResponseWriter, r *http.Request) {
|
||||
},
|
||||
Settings: settings,
|
||||
CurrentMonth: monthNames[settings.CurrentMonth-1],
|
||||
TodayTasks: buildTasksForDay(plans, settings.CurrentMonth, settings.CurrentDay),
|
||||
Calendar: buildCalendar(plans, settings.CurrentMonth, settings.CurrentDay, settings.DaysPerMonth, 14),
|
||||
TodayTasks: buildTasksForDay(plans, stepMap, settings.CurrentMonth, settings.CurrentDay),
|
||||
Calendar: buildCalendar(plans, stepMap, settings.CurrentMonth, settings.CurrentDay, settings.DaysPerMonth, 14),
|
||||
PlanningCount: len(plans),
|
||||
}
|
||||
a.renderTemplate(w, "templates/dashboard.html", data)
|
||||
@@ -78,13 +83,19 @@ func (a *App) handleCropsPage(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "crops read failed", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
steps, err := a.listCropSteps()
|
||||
if err != nil {
|
||||
http.Error(w, "steps read failed", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
data := CropsPage{
|
||||
BasePage: BasePage{
|
||||
ActivePath: "/crops",
|
||||
Error: r.URL.Query().Get("error"),
|
||||
Info: r.URL.Query().Get("info"),
|
||||
},
|
||||
Crops: crops,
|
||||
Crops: crops,
|
||||
CropSteps: steps,
|
||||
}
|
||||
a.renderTemplate(w, "templates/crops.html", data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user