Added color field to tasks
This commit is contained in:
@ -192,4 +192,11 @@
|
||||
list_id: 1
|
||||
created: 1543626724
|
||||
updated: 1543626724
|
||||
- id: 31
|
||||
text: 'task #31 with color'
|
||||
created_by_id: 1
|
||||
list_id: 1
|
||||
hex_color: f0f0f0
|
||||
created: 1543626724
|
||||
updated: 1543626724
|
||||
|
||||
|
@ -52,6 +52,8 @@ type ListTask struct {
|
||||
Assignees []*User `xorm:"-" json:"assignees"`
|
||||
// An array of labels which are associated with this task.
|
||||
Labels []*Label `xorm:"-" json:"labels"`
|
||||
// The task color in hex
|
||||
HexColor string `xorm:"varchar(6) null" json:"hexColor" valid:"runelength(0|6)" maxLength:"6"`
|
||||
|
||||
Sorting string `xorm:"-" json:"-" query:"sort"` // Parameter to sort by
|
||||
StartDateSortUnix int64 `xorm:"-" json:"-" query:"startdate"`
|
||||
|
@ -173,6 +173,10 @@ func (t *ListTask) Update() (err error) {
|
||||
if t.EndDateUnix == 0 {
|
||||
ot.EndDateUnix = 0
|
||||
}
|
||||
// Color
|
||||
if t.HexColor == "" {
|
||||
ot.HexColor = ""
|
||||
}
|
||||
|
||||
_, err = x.ID(t.ID).
|
||||
Cols("text",
|
||||
@ -184,7 +188,8 @@ func (t *ListTask) Update() (err error) {
|
||||
"parent_task_id",
|
||||
"priority",
|
||||
"start_date_unix",
|
||||
"end_date_unix").
|
||||
"end_date_unix",
|
||||
"hex_color").
|
||||
Update(ot)
|
||||
*t = ot
|
||||
return
|
||||
|
Reference in New Issue
Block a user