concept of overdue tasks
This commit is contained in:
parent
fa271dfaeb
commit
7a0b369dcb
12
db/tasks.go
12
db/tasks.go
|
@ -118,6 +118,12 @@ func GetTasks(status, category string) (types.Context, error) {
|
|||
}
|
||||
|
||||
TaskCreated = TaskCreated.Local()
|
||||
CurrentTime := time.Now().Local()
|
||||
week := TaskCreated.AddDate(0, 0, 7)
|
||||
|
||||
if (week.String() < CurrentTime.String()) && (task.Priority != "1") {
|
||||
task.IsOverdue = true // If one week then overdue by default
|
||||
}
|
||||
task.Created = TaskCreated.Format("Jan 01 2006")
|
||||
|
||||
tasks = append(tasks, task)
|
||||
|
@ -266,6 +272,12 @@ func SearchTask(query string) types.Context {
|
|||
task.Content = string(md.Markdown([]byte(task.Content)))
|
||||
|
||||
TaskCreated = TaskCreated.Local()
|
||||
CurrentTime := time.Now().Local()
|
||||
week := TaskCreated.AddDate(0, 0, 7)
|
||||
|
||||
if (week.String() < CurrentTime.String()) && (task.Priority != "1") {
|
||||
task.IsOverdue = true // If one week then overdue by default
|
||||
}
|
||||
task.Created = TaskCreated.Format("Jan 01 2006")
|
||||
|
||||
tasks = append(tasks, task)
|
||||
|
|
|
@ -146,10 +146,19 @@ nav .glyphicon:hover{
|
|||
/*--------------------------------------
|
||||
NotesFeed
|
||||
-------------------------------------- */
|
||||
.overdue {
|
||||
color: red;
|
||||
margin-top: 1px;
|
||||
font-size: 12px;
|
||||
padding-top: -100px;
|
||||
position: absolute;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.noteHeading {
|
||||
font-weight:900;
|
||||
font-size:17px;
|
||||
color:#666666;
|
||||
color:#666666;
|
||||
margin-bottom:0px;
|
||||
padding-bottom:5px;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,9 @@
|
|||
<div class="timeline">
|
||||
{{ if .Tasks}} {{range $key, $value := .Tasks}}
|
||||
<div class="note" id="{{$value.Id}}">
|
||||
<p class="noteHeading">{{ $value.Title}}</p> <span class="toggle glyphicon glyphicon-resize-full"></span>
|
||||
<p class="noteHeading ">{{ $value.Title}}
|
||||
{{if $value.IsOverdue}}<span class="overdue">Overdue</span>{{end}}
|
||||
</p> <span class="toggle glyphicon glyphicon-resize-full"></span>
|
||||
|
||||
<span class="noteContent">
|
||||
{{$value.Content}}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="timeline">
|
||||
{{ if .Tasks}} {{range $key, $value := .Tasks}}
|
||||
<div class="note" id="{{$value.Id}}">
|
||||
<p class="noteHeading">{{ $value.Title}}</p> <span class="toggle glyphicon glyphicon-resize-full"></span>
|
||||
<p class="noteHeading">{{ $value.Title}}{{if $value.IsOverdue}}<span class="overdue">Overdue</span>{{end}}</p> <span class="toggle glyphicon glyphicon-resize-full"></span>
|
||||
|
||||
<span class="noteContent">
|
||||
{{$value.Content}}
|
||||
|
|
|
@ -6,14 +6,15 @@ is passed while templates are executed.
|
|||
*/
|
||||
//Task is the struct used to identify tasks
|
||||
type Task struct {
|
||||
Id int
|
||||
Title string
|
||||
Content string
|
||||
Created string
|
||||
Priority string
|
||||
Category string
|
||||
Referer string
|
||||
Comments []Comment
|
||||
Id int
|
||||
Title string
|
||||
Content string
|
||||
Created string
|
||||
Priority string
|
||||
Category string
|
||||
Referer string
|
||||
Comments []Comment
|
||||
IsOverdue bool
|
||||
}
|
||||
|
||||
//Comment is the struct used to populate comments per tasks
|
||||
|
|
Loading…
Reference in New Issue