Commit 4f38fa2e authored by Hänzelmann, Antje's avatar Hänzelmann, Antje
Browse files

PY-2020.1.2 <ahaen@Anni Merge branch 'master'

parents 336ba4ee f2246244
......@@ -9,5 +9,19 @@
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:C:\Users\ahaen\PycharmProjects\oos_2020_todo\db.sqlite3</jdbc-url>
</data-source>
<data-source source="LOCAL" name="db" uuid="f83aaef1-e571-4eda-b86e-3d37c68dc36f">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:C:\Users\ahaen\PycharmProjects\oos_2020_todo\db.sqlite3</jdbc-url>
<libraries>
<library>
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.31.1/license.txt</url>
</library>
<library>
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.31.1/sqlite-jdbc-3.31.1.jar</url>
</library>
</libraries>
</data-source>
</component>
</project>
\ No newline at end of file
......@@ -37,7 +37,7 @@ Zur Sortierung wird der jeweils als nächstes anstehende Termin ermittelt, wodur
Installation:
echo 'DATABASE_URL=sqlite:///db.sqlite3' > .env
echo DATABASE_URL=sqlite:///db.sqlite3 > .env
im Hauptverzeichnis ausführen
......
No preview for this file type
......@@ -16,6 +16,7 @@ import os
import django_heroku
import dj_database_url
import dotenv
from importlib_metadata.tests import data
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
......@@ -37,7 +38,6 @@ ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django_crontab',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.auth',
......@@ -52,6 +52,7 @@ INSTALLED_APPS = [
'allauth',
'allauth.account',
'allauth.socialaccount',
'contactforms',
]
MIDDLEWARE = [
......@@ -100,10 +101,10 @@ WSGI_APPLICATION = 'oos_2020_todo.wsgi.application'
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
# }
DATABASES = {}
......@@ -140,7 +141,6 @@ USE_L10N = True
USE_TZ = True
RECURRENCE_USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
......@@ -149,10 +149,15 @@ STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
CRONJOBS = [
('0 8 * * *', 'todo.cron.email_todays_todos')
('*/1 * * * *', 'todo.cron.undo_complete_repetitive_tasks'),
]
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Activate Django-Heroku.
django_heroku.settings(locals())
......
......@@ -19,25 +19,34 @@ from django.contrib import admin
from django.urls import path, include
from django.views.i18n import JavaScriptCatalog
from django.conf import settings
from django.urls import path, include
from todo import views
from todo.views import get_landing_page, get_selection_page, todo_details, get_impressum, get_show_todo, \
get_archiv, get_selection_id, delete_todo, redirect_profile
get_archiv, get_selection_id, delete_todo, redirect_profile, get_add_category, delete_selection
urlpatterns = [
path('admin/', admin.site.urls),
path('start/', get_landing_page, name='landing_page'),
path('start/', get_landing_page, name='home'),
path('', get_landing_page, name='landing_page'),
path('selection/', get_selection_page, name='selection_page'),
path('selection/<int:pk>/', get_selection_id, name='selection_id'),
path('selection/delete/<int:pk>/', delete_selection, name='delete_selection'),
path('todo/add/', todo_details, name='add_todo'),
path('todo/edit/<int:pk>/', todo_details, name='edit_todo'),
path('todo/delete/<int:pk>/', delete_todo, name='delete_todo'),
path('todo/delete/<int:pk>/<str:source>/<int:s_id>', delete_todo, name='delete_todo_selection'),
path('impressum/', get_impressum, name='impressum'),
path('todo/show/', get_show_todo, name='show_todo'),
path('todo/archiv/', get_archiv, name='archiv'),
path('impressum/', get_impressum, name='impressum'),
path('accounts/', include('allauth.urls')),
path('accounts/profile/', redirect_profile, name="redirect_profile"),
path('contact/', include('contactforms.urls')),
path('category/add/', get_add_category, name="add_category")
# path('todo/add/', views.CreateUserFormView.as_view(), name='todo/add/')
]
if settings.DEBUG:
......
......@@ -5,15 +5,15 @@ asgiref==3.2.9
Babel==2.8.0
beautifulsoup4==4.9.1
billiard==3.3.0.23
celery==3.1.26.post2
certifi==2020.4.5.2
chardet==3.0.4
crontab==0.22.8
colorama==0.4.3
defusedxml==0.6.0
dj-database-url==0.5.0
Django==3.0.7
django-allauth==0.42.0
django-bootstrap4==2.1.0
django-contactforms==2.0
django-crontab==0.7.1
django-heroku==0.3.1
django-post-office==3.4.1
......
{% extends 'todo/base.html' %}
{% load bootstrap4 %}
{% block content %}
<div class="row">
<form action="{% url 'contact' %}" method="post">
<h3>Sende uns eine Nachricht</h3>
{% csrf_token %}
<div class="form-group">
{% if messages %}
{% for message in messages %}
<span{% if message.tags %} class="{{ message.tags }}"{% endif %} style="color: green">{{ message }}</span>
{% endfor %}
{% endif %}
</div>
<div class="form-group">
<input type="text" name="Name" class="form-control" placeholder="Dein Name" maxlength="120" required id="id_name">
</div>
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Deine Emailadresse" maxlength="120" required id="id_email">
</div>
<div class="form-group">
<input type="text" name="betreff" class="form-control" placeholder="Betreff" maxlength="120" required id="id_betreff">
</div>
<div class="form-group">
<textarea name="nachricht" cols="40" rows="10" class="form-control" placeholder="Nachricht" required id="id_nachricht"></textarea>
</div>
<button class="btn btn-primary" type="submit">Senden</button>
</form>
</div>
{% endblock %}
{% extends 'todo/base.html' %}
{% load bootstrap4 %}
{% block content %}
<form method="POST" class="post-form">
{% csrf_token %}
{{ form.media }}
{% bootstrap_form form %}
<button class="btn btn-primary" type="submit">Speichern</button>
</form>
{% endblock %}
\ No newline at end of file
{% extends 'todo/base.html' %}
{% load bootstrap4 %}
{% block content %}
<br>
<a class="btn btn-primary" href="{% url 'add_category' %}">Kategorie hinzufügen</a>
<form method="POST" class="post-form">
<br>
{% csrf_token %}
{{ form.media }}
{% bootstrap_form form %}
......@@ -10,4 +17,6 @@
</form>
{% endblock %}
\ No newline at end of file
......@@ -34,9 +34,6 @@
<li class="nav-item active">
<a class="nav-link" href="{% url 'landing_page' %}">Start<span class="sr-only">(current)</span></a>
</li>
{# <li class="nav-item active">#}
{# <a class="nav-link" href="{% url 'selection_page' %}">Aufgabenliste<span class="sr-only">(current)</span></a>#}
{# </li>#}
<li class="nav-item active">
<a class="nav-link" href="{% url 'add_todo' %}">neue Aufgabe <span class="sr-only">(current)</span></a>
</li>
......@@ -50,6 +47,7 @@
</ul>
</div>
<!-- Navbar auf rechter Seite/Log In und Register Seite-->
<a class="nav-brand">Hallo {{ username }}!</a>
<div class="navbar-nav">
<a class="nav-item nav-link active" href="{% url 'account_logout' %}">Logout</a>
</div>
......@@ -72,6 +70,7 @@
{% block footer %}
<nav class="navbar fixed-bottom navbar-light bg-light">
<a class="navbar-brand" href="{% url 'impressum' %}">Impressum</a>
<a class="navbar-brand" href="{% url 'contact' %}">Kontakt</a>
</nav>
<script type='text/javascript' src={% static 'js/selectionpage.js' %}></script>
<script type='text/javascript' src={% static 'js/showtodos.js' %}></script>
......
......@@ -4,7 +4,6 @@
{% block content %}
<br>
<p>
<b>Angaben gemäß § 5 TMG </b>
<br>
......
......@@ -3,10 +3,10 @@
{% block content %}
{% if not running_selection %}
<div class="row justify-content-center m-2">
<div class="card">
<div class="card full-width">
<div class="card-body">
<h5 class="card-title">Lege eine neue Aufgabenliste an</h5>
<p class="card-text">Du hast gerade Zeit, um ein paar Dinge zuu erledigen? Super! Dann such dir aus deiner Liste die wichtigsten Dinge aus,
<p class="card-text">Du hast gerade Zeit, um ein paar Dinge zu erledigen? Super! Dann such dir aus deiner Liste die wichtigsten Dinge aus,
schau, wie viel Zeit du hast, und los geht's! Ohne Überforderung, weil du nicht weißt, wo du anfangen sollst, und ohne Stress, weil noch so viel auf deiner Liste steht</p>
<a class="btn btn-primary btn-lg float-right" href="{% url 'selection_page' %}">Aufgabenliste
anlegen</a>
......@@ -16,7 +16,7 @@
{% endif %}
{% if running_selection %}
<div class="row justify-content-center m-2">
<div class="card">
<div class="card full-width">
<div class="card-body">
<h5 class="card-title">Schaue dir deine aktuelle Aufgabenliste an</h5>
<p class="card-text">Hier findest du die Aufgaben, die du jetzt gerade erledigen möchtest!</p>
......@@ -27,17 +27,17 @@
</div>
{% endif %}
<div class="row justify-content-center m-2">
<div class="card">
<div class="card full-width">
<div class="card-body">
<h5 class="card-title">Lege eine neue Aufgabe an</h5>
<p class="card-text">Leg eine neue Aufgabe an! Sie kann sich wiederholen, einen fixen Endtermin haben oder einfach etwas sein,
was du mal erreichen oder erledigen möchtest. Denk auch dran, dir mal ein paar Pausen einzuplanen ;)</p>
<a class="btn btn-primary btn-lg float-right" href="{% url 'add_todo' %}">Neue Aufgabe Anlegen</a>
<a class="btn btn-primary btn-lg float-right" href="{% url 'add_todo' %}">Neue Aufgabe anlegen</a>
</div>
</div>
</div>
<div class="row justify-content-center m-2">
<div class="card">
<div class="card full-width">
<div class="card-body">
<h5 class="card-title">Zeige alle Aufgaben an</h5>
<p class="card-text">Was wolltest du nochmal alles machen / erledigen / erreichen? Schaus dir hier an! Oder hast du gerade
......@@ -47,7 +47,7 @@
</div>
</div>
<div class="row justify-content-center m-2">
<div class="card">
<div class="card full-width">
<div class="card-body">
<h5 class="card-title">Schaue dir alte Aufgaben an</h5>
<p class="card-text">Was hattest du letztens nochmal erledigt und wie lang hatte das so gedauert?
......
......@@ -80,7 +80,7 @@
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordion">
<div class="card-body">
<div class="list-group list-group-flush">
{% if todos_today %}
......@@ -109,7 +109,7 @@
</button>
</h5>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree"
<div id="collapseThree" class="collapse show" aria-labelledby="headingThree"
data-parent="#accordion">
<div class="card-body">
<div class="list-group list-group-flush">
......@@ -139,7 +139,7 @@
</button>
</h5>
</div>
<div id="collapseFour" class="collapse" aria-labelledby="headingFour"
<div id="collapseFour" class="collapse show" aria-labelledby="headingFour"
data-parent="#accordion">
<div class="card-body">
<ul class="list-group list-group-flush">
......
......@@ -9,6 +9,7 @@
{{ form }}
<input type="submit" class="btn btn-primary" value="Änderungen speichern">
</form>
<a class="btn btn-outline-danger" href="{% url 'delete_selection' pk=pk %}">Aufgabenliste löschen</a>
</div>
<div class="row justify-content-center">
<div id="accordion">
......@@ -63,7 +64,7 @@
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordion">
<div class="card-body">
<div class="list-group list-group-flush">
{% if todos_today %}
......@@ -103,7 +104,7 @@
</button>
</h5>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree"
<div id="collapseThree" class="collapse show" aria-labelledby="headingThree"
data-parent="#accordion">
<div class="card-body">
<div class="list-group list-group-flush">
......@@ -144,7 +145,7 @@
</button>
</h5>
</div>
<div id="collapseFour" class="collapse" aria-labelledby="headingFour"
<div id="collapseFour" class="collapse show" aria-labelledby="headingFour"
data-parent="#accordion">
<div class="card-body">
<ul class="list-group list-group-flush">
......@@ -155,12 +156,12 @@
<div class="todo-text">{{ todo.text }}</div>
<div class="todo-duration">{{ todo.duration }} Minuten</div>
<div class="todo-edit">
<a href="{% url 'edit_todo' pk=todo.0.id %}">
<a href="{% url 'edit_todo' pk=todo.id %}">
<span class="material-icons">edit</span>
</a>
</div>
<div class="todo-delete">
<a href="{% url 'delete_todo_selection' pk=todo.0.id source='selection_id' s_id=pk %}">
<a href="{% url 'delete_todo_selection' pk=todo.id source='selection_id' s_id=pk %}">
<span class="material-icons">delete</span>
</a>
</div>
......
......@@ -63,7 +63,7 @@
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordion">
<div class="card-body">
<div class="list-group list-group-flush">
{% if todos_today %}
......@@ -103,7 +103,7 @@
</button>
</h5>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree"
<div id="collapseThree" class="collapse show" aria-labelledby="headingThree"
data-parent="#accordion">
<div class="card-body">
<div class="list-group list-group-flush">
......@@ -144,7 +144,7 @@
</button>
</h5>
</div>
<div id="collapseFour" class="collapse" aria-labelledby="headingFour"
<div id="collapseFour" class="collapse show" aria-labelledby="headingFour"
data-parent="#accordion">
<div class="card-body">
<ul class="list-group list-group-flush">
......
from django.contrib import admin
from todo.models import *
from .models import Category
admin.site.register(Todo)
admin.site.register(Selection)
admin.site.register(Category)
from post_office import mail
from django.core.mail import send_mail
def email_todays_todos():
send_mail('Hello from Feierabend',
'Mail gesendet',
'feierabend-todo@gmx.de',
['DoroKueppers@web.de'],
fail_silently=False)
from allauth.account.forms import UserForm
from django import forms
from django.forms import ModelForm
from todo.models import Todo
from todo.models import Todo, Category
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
class CategoryForm(forms.ModelForm):
class Meta:
model = Category
exclude = []
class CreateUserForm(UserCreationForm):
class Meta:
model = User
......@@ -15,14 +23,12 @@ class CreateUserForm(UserCreationForm):
class TodoForm(forms.ModelForm):
class Meta:
model = Todo
exclude = ['created', 'complete', 'rank', 'selection', 'finished']
widgets = {
'text': forms.TextInput(attrs={'placeholder': 'Küche putzen, Python lernen, Haare waschen...'}),
# 'recurrences': RecurrenceField()
}
exclude = ['created', 'complete', 'rank', 'selection', 'finished', 'user_id', 'completed_until']
widgets = {'text': forms.TextInput(attrs={'placeholder': 'Küche putzen, Python lernen, Haare waschen...'}),}
labels = {'text': 'Was ist zu tun? *',
'duration': 'Was meinst du, wie lange die Aufgabe dauert? (in Minuten) *',
'recurrences': 'Wiederholungen'}
'recurrences': 'Wiederholungen',
'category': 'Kategorie'}
class SelectionForm(forms.Form):
......
# Generated by Django 3.0.7 on 2020-07-13 10:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('todo', '0002_auto_20200706_1431'),
]
operations = [
migrations.CreateModel(
name='Choices',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(choices=[('1', 'Schwimmen'), ('2', 'Lernen'), ('3', 'Lesen'), ('4', 'Malen'), ('5', 'Einkaufen')], max_length=200)),
],
),
migrations.AlterField(
model_name='todo',
name='text',
field=models.CharField(max_length=256),
),
]
# Generated by Django 3.0.7 on 2020-07-13 15:25
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('todo', '0003_auto_20200713_1248'),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
],
),
migrations.DeleteModel(
name='Choices',
),
migrations.AddField(
model_name='todo',
name='category',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='todo.Category'),
),
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment