Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Küppers, Dorothee
oos_2020_todo
Commits
0593a758
Commit
0593a758
authored
Jul 05, 2020
by
Hänzelmann, Antje
Browse files
login register
parent
1721df9b
Changes
7
Hide whitespace changes
Inline
Side-by-side
templates/todo/archiv.html
View file @
0593a758
...
...
@@ -4,5 +4,4 @@
{% block content %}
{% endblock %}
\ No newline at end of file
templates/todo/base.html
View file @
0593a758
...
...
@@ -42,10 +42,13 @@
</ul>
</div>
<!-- Navbar auf rechter Seite-->
<!-- Navbar auf rechter
Seite/Log In und Register
Seite-->
<div
class=
"navbar-nav"
>
<a
class=
"nav-item nav-link"
href=
"#"
>
Login
</a>
<a
class=
"nav-item nav-link"
href=
"#"
>
Register
</a>
<a
class=
"nav-item nav-link"
href=
"todo/login"
>
Login
</a>
</div>
<div
class=
"navbar-nav"
>
<a
class=
"nav-item nav-link"
href=
"todo/register"
>
Register
</a>
</div>
</nav>
...
...
templates/todo/impressum.html
View file @
0593a758
...
...
@@ -36,8 +36,10 @@
<b>
Wirtschafts-ID:
</b>
<br>
Verantwortlich für den Inhalt nach § 55 Abs. 2 RstV:
<br>
<br>
Dorothee Küppers
<br>
Antje Hänzelmann
<br>
<br>
Musterstraße 5,
<br>
21900 Hamburg
<br>
</p>
...
...
templates/todo/login.html
0 → 100644
View file @
0593a758
{% extends 'todo/base.html' %}
{% load bootstrap4 %}
{% block content %}
{% endblock %}
\ No newline at end of file
templates/todo/register.html
0 → 100644
View file @
0593a758
{% extends 'todo/base.html' %}
{% load bootstrap4 %}
{% block content %}
{% endblock %}
\ No newline at end of file
todo/models.py
View file @
0593a758
...
...
@@ -16,6 +16,7 @@ class Selection(models.Model):
return
f
'
{
self
.
name
}
, total time:
{
self
.
total_time
.
__str__
()
}
'
class
Todo
(
models
.
Model
):
text
=
models
.
CharField
(
max_length
=
200
)
complete
=
models
.
BooleanField
(
default
=
False
)
...
...
todo/views.py
View file @
0593a758
...
...
@@ -75,6 +75,32 @@ def get_selection_page(request):
'todos_selection'
:
[],
}
return
render
(
request
,
'todo/selection_page.html'
,
content
)
# show to do Anfang
todos_with_recurrence
=
Todo
.
objects
.
filter
(
complete
=
False
).
exclude
(
recurrences__exact
=
''
)
todos_without_recurrence
=
Todo
.
objects
.
filter
(
complete
=
False
).
filter
(
recurrences__exact
=
''
)
todos_today
=
[]
todos_soon
=
[]
todos_late
=
[]
for
recur_todo
in
todos_with_recurrence
:
next_occur
=
recur_todo
.
recurrences
.
after
(
datetime
.
datetime
.
now
()
-
datetime
.
timedelta
(
days
=
1
),
inc
=
True
,
)
if
next_occur
is
None
:
last_occur
=
recur_todo
.
recurrences
.
before
(
datetime
.
datetime
.
now
(),
inc
=
True
,
)
todos_late
.
append
((
recur_todo
,
last_occur
.
date
()))
else
:
recur_todo
=
(
recur_todo
,
next_occur
.
date
())
if
next_occur
.
date
()
==
datetime
.
date
.
today
():
todos_today
.
append
(
recur_todo
)
else
:
todos_soon
.
append
(
recur_todo
)
# show to do - Ende
def
sort_todos
(
todos_late
,
todos_someday
,
todos_soon
,
todos_today
):
...
...
@@ -144,3 +170,11 @@ def get_show_todo(request):
def
get_archiv
(
request
):
content
=
{
'page_title'
:
'Archiv'
}
return
render
(
request
,
'todo/archiv.html'
,
content
)
def
get_login
(
request
):
content
=
{
'page_title'
:
'Log In'
}
return
render
(
request
,
'todo/login.html'
,
content
)
def
get_register
(
request
):
content
=
{
'page_title'
:
'Register'
}
return
render
(
request
,
'todo/register.html'
,
content
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment