forked from OrgGo/Tasks
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()
|
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")
|
task.Created = TaskCreated.Format("Jan 01 2006")
|
||||||
|
|
||||||
tasks = append(tasks, task)
|
tasks = append(tasks, task)
|
||||||
|
@ -266,6 +272,12 @@ func SearchTask(query string) types.Context {
|
||||||
task.Content = string(md.Markdown([]byte(task.Content)))
|
task.Content = string(md.Markdown([]byte(task.Content)))
|
||||||
|
|
||||||
TaskCreated = TaskCreated.Local()
|
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")
|
task.Created = TaskCreated.Format("Jan 01 2006")
|
||||||
|
|
||||||
tasks = append(tasks, task)
|
tasks = append(tasks, task)
|
||||||
|
|
|
@ -146,6 +146,15 @@ nav .glyphicon:hover{
|
||||||
/*--------------------------------------
|
/*--------------------------------------
|
||||||
NotesFeed
|
NotesFeed
|
||||||
-------------------------------------- */
|
-------------------------------------- */
|
||||||
|
.overdue {
|
||||||
|
color: red;
|
||||||
|
margin-top: 1px;
|
||||||
|
font-size: 12px;
|
||||||
|
padding-top: -100px;
|
||||||
|
position: absolute;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.noteHeading {
|
.noteHeading {
|
||||||
font-weight:900;
|
font-weight:900;
|
||||||
font-size:17px;
|
font-size:17px;
|
||||||
|
|
|
@ -50,7 +50,9 @@
|
||||||
<div class="timeline">
|
<div class="timeline">
|
||||||
{{ if .Tasks}} {{range $key, $value := .Tasks}}
|
{{ if .Tasks}} {{range $key, $value := .Tasks}}
|
||||||
<div class="note" id="{{$value.Id}}">
|
<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">
|
<span class="noteContent">
|
||||||
{{$value.Content}}
|
{{$value.Content}}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="timeline">
|
<div class="timeline">
|
||||||
{{ if .Tasks}} {{range $key, $value := .Tasks}}
|
{{ if .Tasks}} {{range $key, $value := .Tasks}}
|
||||||
<div class="note" id="{{$value.Id}}">
|
<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">
|
<span class="noteContent">
|
||||||
{{$value.Content}}
|
{{$value.Content}}
|
||||||
|
|
|
@ -6,14 +6,15 @@ is passed while templates are executed.
|
||||||
*/
|
*/
|
||||||
//Task is the struct used to identify tasks
|
//Task is the struct used to identify tasks
|
||||||
type Task struct {
|
type Task struct {
|
||||||
Id int
|
Id int
|
||||||
Title string
|
Title string
|
||||||
Content string
|
Content string
|
||||||
Created string
|
Created string
|
||||||
Priority string
|
Priority string
|
||||||
Category string
|
Category string
|
||||||
Referer string
|
Referer string
|
||||||
Comments []Comment
|
Comments []Comment
|
||||||
|
IsOverdue bool
|
||||||
}
|
}
|
||||||
|
|
||||||
//Comment is the struct used to populate comments per tasks
|
//Comment is the struct used to populate comments per tasks
|
||||||
|
|
Loading…
Reference in New Issue