2015-11-13 14:34:42 +05:30
|
|
|
package types
|
|
|
|
|
2016-02-01 20:04:19 +05:30
|
|
|
/*
|
|
|
|
Package types is used to store the context struct which
|
|
|
|
is passed while templates are executed.
|
|
|
|
*/
|
2015-11-21 18:50:51 +05:30
|
|
|
//Task is the struct used to identify tasks
|
2015-11-13 14:34:42 +05:30
|
|
|
type Task struct {
|
2016-01-23 19:17:34 +05:30
|
|
|
Id int
|
|
|
|
Title string
|
|
|
|
Content string
|
|
|
|
Created string
|
|
|
|
Priority string
|
2016-02-05 00:06:00 +05:30
|
|
|
Category string
|
2016-02-06 15:32:46 +05:30
|
|
|
Referer string
|
2015-11-13 14:34:42 +05:30
|
|
|
}
|
2015-11-21 18:50:51 +05:30
|
|
|
|
|
|
|
//Context is the struct passed to templates
|
|
|
|
type Context struct {
|
|
|
|
Tasks []Task
|
|
|
|
Navigation string
|
2015-11-21 19:42:44 +05:30
|
|
|
Search string
|
2015-11-22 09:21:29 +05:30
|
|
|
Message string
|
2016-01-18 06:32:15 +05:30
|
|
|
CSRFToken string
|
2016-02-05 01:09:36 +05:30
|
|
|
Categories []CategoryCount
|
2016-02-06 15:32:46 +05:30
|
|
|
Referer string
|
2016-02-05 01:09:36 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
//CategoryCount is the struct used to populate the sidebar
|
|
|
|
//which contains the category name and the count of the tasks
|
|
|
|
//in each category
|
|
|
|
|
|
|
|
type CategoryCount struct {
|
|
|
|
Name string
|
|
|
|
Count int
|
2015-11-21 18:50:51 +05:30
|
|
|
}
|