@ -109,7 +109,7 @@ type templateData struct {
Motion * models . MotionForDisplay
Motion * models . MotionForDisplay
Motions [ ] * models . MotionForDisplay
Motions [ ] * models . MotionForDisplay
Request * http . Request
Request * http . Request
Flash es [ ] string
Flash string
Form any
Form any
ActiveNav topLevelNavItem
ActiveNav topLevelNavItem
ActiveSubNav subLevelNavItem
ActiveSubNav subLevelNavItem
@ -130,6 +130,7 @@ func (app *application) newTemplateData(
User : user ,
User : user ,
ActiveNav : nav ,
ActiveNav : nav ,
ActiveSubNav : subNav ,
ActiveSubNav : subNav ,
Flash : app . sessionManager . PopString ( r . Context ( ) , "flash" ) ,
}
}
}
}
@ -434,7 +435,7 @@ func (app *application) newMotionSubmit(w http.ResponseWriter, r *http.Request)
decision : & models . NewMotion { Decision : decision , Proposer : user } ,
decision : & models . NewMotion { Decision : decision , Proposer : user } ,
}
}
// TODO: add flash message for new motion
app . sessionManager . Put ( r . Context ( ) , "flash" , fmt . Sprintf ( "Started new motion %s: %s" , decision . Tag , decision . Title ) )
http . Redirect ( w , r , fmt . Sprintf ( "/motions/%s" , decision . Tag ) , http . StatusSeeOther )
http . Redirect ( w , r , fmt . Sprintf ( "/motions/%s" , decision . Tag ) , http . StatusSeeOther )
}
}