Skip to content

Commit

Permalink
Add start and due dates to todos (#436)
Browse files Browse the repository at this point in the history
* Add start date and due date field for todos

* Add the dates field on the frontend

* Add the day of week to the date picker

* Migration: adding date columns to todo

* Add date pickers

* Do not generate the start date automatically

* Show the dumb version of the deadline

* Use datetime instead of date

* Add a time-input

* Date time input

* Send the datetime string to the server

* Remove prior migrations

* Change the model and group the migrations into one

* Show the due datetime on the task page

* Clear the date time input once the customer submit

* Update comments

* Remove debug prints

* Fix a line that was too long

* Update a column name

* Update the column name references on the frontend

* Update the column for real

* Remove redundant logic

* Move the hour logic to the time-input directive

* Try switching order

* Oh well

* Grrr

* Grrr

* Change the appearance of the todos

* Update some style stuff

* Update the test

* Update the list

* Fix indents

* Fix white space

* Fix white space

* Fix white space

* Fix white space

* Fix white space

* Change import order

* Fix import

* Create a checklist directive for todos and completed

* Update the tests

* Checklist directive

* Remove a print

* Update the task pending logic and add two columns to show start and due time of selectecd todo

* Show pretty start/due dates on the dashboard

* Update todo list titles

* Set the color of the todos in danger to red

* Fix whitespaces

* Update test

* Change a function name

* Fix misnamed variable

* Fix whitespaces

* Fix whitespaces

* Fix whitespaces

* Fix whitespaces

* Remove isort from the build process

* Add tests

* Fix the pending task logic

* Fix whitespaces

* Fix whitespaces

* Debugging

* Debugging

* Debugging

* Debugging

* Debugging

* Debugging

* Debugging

* Debugging

* Add a stricter sort query

* Remove debugging printout

* Fix whitespaces

* Update tasktable.directive.es6.js
  • Loading branch information
paopow committed Jan 19, 2018
1 parent 8105a73 commit e2bc33f
Show file tree
Hide file tree
Showing 28 changed files with 1,321 additions and 539 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ clean:
find . -name '*~' -delete

lint:
flake8 . && isort --check-only --recursive .
flake8 .
gulp lint --production
!(find . -wholename '**migrations**/*.py' -print0 | xargs -0 grep 'RemoveField\|DeleteModel\|AlterModelTable\|AlterUniqueTogether\|RunSQL\|RunPython\|SeparateDatabaseAndState' | grep -v '# manually-reviewed') || { echo "Migrations need to be manually reviewed!"; exit 1; }
!(cd example_project && python3 manage.py makemigrations --dry-run --exit) || { printf "Migrations need to be created. Try: \n\t python3 manage.py makemigrations\n"; exit 1; }
Expand Down
26 changes: 26 additions & 0 deletions orchestra/migrations/0074_auto_20180116_1523.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-01-16 15:23
from __future__ import unicode_literals

from django.db import migrations
from django.db import models


class Migration(migrations.Migration):

dependencies = [
('orchestra', '0073_remove_worker_staffing_priority'),
]

operations = [
migrations.AddField(
model_name='todo',
name='start_by_datetime',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
model_name='todo',
name='due_datetime',
field=models.DateTimeField(blank=True, null=True),
),
]
6 changes: 6 additions & 0 deletions orchestra/models/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@ class Todo(TodoMixin, BaseModel):
Whether the todo has been completed.
description (str):
A text description of the Todo.
start_by_datetime (datetime.datetime):
The time to start the todo. (inclusive)
due_datetime (datetime.datetime):
The time the todo is due.
Constraints:
`task` and `assignment_counter` are taken to be unique_together.
Expand All @@ -594,3 +598,5 @@ class Meta:
Task, related_name='todos', on_delete=models.CASCADE)
description = models.CharField(max_length=200)
completed = models.BooleanField(default=False)
start_by_datetime = models.DateTimeField(null=True, blank=True)
due_datetime = models.DateTimeField(null=True, blank=True)
50 changes: 37 additions & 13 deletions orchestra/static/dist/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1984,15 +1984,19 @@ a.logo {
border-radius: 3px; }
.is-disabled .pika-button,
.is-outside-current-month .pika-button {
pointer-events: none;
cursor: default;
color: #999;
opacity: .3; }
.is-disabled .pika-button {
pointer-events: none;
cursor: default; }
.pika-button:hover {
color: #fff;
background: #ff8000;
box-shadow: none;
border-radius: 3px; }
.pika-button .is-selection-disabled {
pointer-events: none;
cursor: default; }

.pika-week {
font-size: 11px;
Expand Down Expand Up @@ -2253,22 +2257,42 @@ a.logo {
box-shadow: none; }
.timer .popover .tgl-ios:checked + .tgl-btn:active:after {
margin-left: -.8em; }
.time-input {
color: black; }
.todo-list .section-body {
padding-top: 1.5rem;
padding-bottom: 1.5rem; }

.todo-list .new-todo {
float: left; }
.todo-list .new-todo__box {
display: inline-block; }
.todo-list .new-todo__box-details {
width: 600px; }
.todo-list .new-todo__description {
width: 300px; }

.todo-list .existing-todos {
width: 600px; }
.todo-list .new-todo__description__datetime {
display: inline-block;
padding-left: 10px; }
.existing-todos {
padding-top: 5px; }
.todo-list .existing-todos .todo input[type=checkbox] {
transform: scale(1.1); }
.todo-list .existing-todos .todo label {
align-items: end;
display: flex; }
.todo-list .existing-todos .todo__role {
font-weight: 500;
padding-left: 5px; }
.existing-todos .list-by-status {
padding-top: 20px; }
.existing-todos .list-by-status h4 {
padding-bottom: 10px; }
.existing-todos .list-by-status .todo input[type=checkbox] {
transform: scale(1.1); }
.existing-todos .list-by-status .todo label {
align-items: end;
display: flex; }
.existing-todos .list-by-status .todo__role {
font-weight: 500;
padding-left: 5px; }
.existing-todos .list-by-status .todo__dates {
padding-left: 5px;
font-style: italic;
color: #999; }
.existing-todos .list-by-status .todo__dates-danger {
color: #a94442; }
.existing-todos .list-by-status .todo__dates-separator {
font-style: normal; }

0 comments on commit e2bc33f

Please sign in to comment.