Commit 2d913264 authored by Hänzelmann, Antje's avatar Hänzelmann, Antje
Browse files

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

parents c240103d e1c051b6
web: gunicorn oos_2020_todo.wsgi
\ No newline at end of file
# Willkommen bei Feierabend!
Unsere App soll euch dabei helfen, euch noch besser zu organisieren und
dabei auch zufriedener mit eeuch selbst zu sein. Denn oft kommt man nach einem
langen Arbeitstag nach Hause und denkt darüber nach, welche Aufgaben noch alle
zu erledigen sind. Dabei verliert man leicht den Überblick oder ist von der Masse der Aufgaben so überfordert,
dass man gar erst anfängt.
Manchmal denkt man vielleicht auch, man könnte alle Aufgaben an einem Abend erledigen,
obwohl das zeitlich gar nicht möglich ist, so dass man am Ende des Abends mit dem Stand der Abarbeitung
unzufrieden ist, obwohl man viel erledigt hatm, aber eben nicht alles, wie man sich das gewünscht hat.
Deshalb gibt es in unserer App neben der üblichen Auflistung von Aufgaben,
in der sich die erledigten Aufgaben abhaken lassen, auch die Möglichkeit,
sich für eine kommnede Zeitspanne, die der/die Nutzr/in zunächst feestlegt,
eine Teilliste aller Aufgaben zusammenzustellen.
Dazu wird bei der Anlage der Aufgaben auch eine wahrscheinliche Dauer der Aufgabe abfragt,
die bei der Zusammenstellung einer Aufgabenliste genutzt wird, um dem
Nutzer darzulegen, wie viel er/Sie sich schon vorgenommeen hat, im Verhältnis zu der Zeit, die er/sie
überhaupt hat.
Ist eine Aufgabenliste einmal gestartet, kann keine weitere Aufgabenliste angelegt werden
und an der Stelle im Hauptmenü wird stattdessen eine Button zur aktuellen Liste angezeigt.
Die vorhandenen Aufgaben werden in der Anzeige nach ihrer Fälligkeit sortiert.
Dazu können bei der Anlage der Aufgaben Wiederholungen oder Stichtage angegeben werdne können.
Zur Sortierung wird der jeweils als nächstes anstehende Termin ermittelt, wodurch sich die Termine in 4 Kategorien einteilen lassen:
* Dinge, die eigentlich schon getan sein sollten (Stichtag liegt in der Vergangenheit)
* Dinge, die die heute zu erledigen sind (nächster Stichtag ist heute)
* Dinge, die bald zu erledigen sind (nächster Stichtag liegt noch in der Zukunft)
* Dinge, die keinen Zeitdruck haben (es wurde weder Stichtag noch Wiederholung angegeben)
##Viel Spaß mit der Applikation und viel Erfolg dabei, eure Zeit gut zu nutzen,
##so dass ihr eure Feierabende auch genießen könnt!
Installation:
echo 'DATABASE_URL=sqlite:///db.sqlite3' > .env
im Hauptverzeichnis ausführen
Web-URL:
https://calm-lowlands-92360.herokuapp.com/
Gitlab:
https://git.mylab.th-luebeck.de/dorothee.kueppers/oos_2020_todo
Team-Mitglieder:
Antje Hänzelmann, Dorothee Küppers
\ No newline at end of file
No preview for this file type
......@@ -13,8 +13,15 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import django_heroku
import dj_database_url
import dotenv
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
dotenv_file = os.path.join(BASE_DIR, ".env")
if os.path.isfile(dotenv_file):
dotenv.load_dotenv(dotenv_file)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
......@@ -23,15 +30,16 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '8f&^^5razouamp=m1-_a+pnd_m+4l5+yspjq2b_9q8v@45+!2!'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django_crontab',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
......@@ -40,7 +48,10 @@ INSTALLED_APPS = [
'todo',
'bootstrap4',
'recurrence',
'django_crontab',
'allauth',
'allauth.account',
'allauth.socialaccount',
]
MIDDLEWARE = [
......@@ -51,6 +62,8 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]
ROOT_URLCONF = 'oos_2020_todo.urls'
......@@ -58,8 +71,7 @@ ROOT_URLCONF = 'oos_2020_todo.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')]
,
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......@@ -72,19 +84,30 @@ TEMPLATES = [
},
]
WSGI_APPLICATION = 'oos_2020_todo.wsgi.application'
SITE_ID = 1
AUTHENTICATION_BACKENDS = [
# Needed to login by username in Django admin, regardless of `allauth`
'django.contrib.auth.backends.ModelBackend',
# `allauth` specific authentication methods, such as login by e-mail
'allauth.account.auth_backends.AuthenticationBackend',
]
WSGI_APPLICATION = 'oos_2020_todo.wsgi.application'
# Database
# 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'),
}
}
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
# }
DATABASES = {}
DATABASES['default'] = dj_database_url.config(conn_max_age=600)
# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
......@@ -104,7 +127,6 @@ AUTH_PASSWORD_VALIDATORS = [
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/
......@@ -120,18 +142,18 @@ USE_TZ = True
RECURRENCE_USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
# STATICFILES_DIRS = [
# os.path.join(BASE_DIR, "static"),
# # '/var/www/static/',
# ]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
CRONJOBS = [
('0 */1 * * * *', 'todo.cron.email_todays_todos')
]
\ No newline at end of file
('0 8 * * *', 'todo.cron.email_todays_todos')
]
# Activate Django-Heroku.
django_heroku.settings(locals())
del DATABASES['default']['OPTIONS']['sslmode']
......@@ -16,12 +16,12 @@ Including another URLconf
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from django.urls import path, include
from django.views.i18n import JavaScriptCatalog
from django.conf import settings
from todo.views import get_landing_page, get_selection_page, todo_details, get_impressum, get_show_todo, \
get_archiv, get_selection_id, delete_todo, get_register, get_login
get_archiv, get_selection_id, delete_todo, redirect_profile
urlpatterns = [
path('admin/', admin.site.urls),
......@@ -31,12 +31,13 @@ urlpatterns = [
path('selection/<int:pk>/', get_selection_id, name='selection_id'),
path('todo/add/', todo_details, name='add_todo'),
path('todo/edit/<int:pk>/', todo_details, name='edit_todo'),
path('todo/delete/<int:pk>/<str:source>/<int:s_id>', delete_todo, name='delete_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('todo/register/', get_register, name="register"),
path('todo/login/', get_login, name="login"),
path('accounts/', include('allauth.urls')),
path('accounts/profile/', redirect_profile, name="redirect_profile"),
]
if settings.DEBUG:
......
alabaster==0.7.12
amqp==1.4.9
anyjson==0.3.3
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
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-crontab==0.7.1
django-heroku==0.3.1
django-post-office==3.4.1
django-recurrence==1.10.3
docutils==0.16
gunicorn==20.0.4
idna==2.9
imagesize==1.2.0
importlib-metadata==1.6.1
Jinja2==2.11.2
jsonfield==3.1.0
kombu==3.0.37
MarkupSafe==1.1.1
oauthlib==3.1.0
packaging==20.4
psycopg2==2.8.5
Pygments==2.6.1
pyparsing==2.4.7
python-dateutil==2.8.1
python-dotenv==0.14.0
python3-openid==3.2.0
pytz==2020.1
requests==2.24.0
requests-oauthlib==1.3.0
six==1.15.0
snowballstemmer==2.0.0
soupsieve==2.0.1
......@@ -30,6 +51,5 @@ sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
sqlparse==0.3.1
urllib3==1.25.9
whitenoise==5.1.0
zipp==3.1.0
django-recurrence~=1.10.3
\ No newline at end of file
python-3.7.3
\ No newline at end of file
......@@ -54,4 +54,57 @@ div.form-control.recurrence-widget {
.todo-soon, .todo-someday {
background: darkseagreen;
color: floralwhite;
}
.warning {
color: indianred;
}
/*show todos*/
.list-group-item.select-todo-grid-show {
display: grid;
grid-template-columns: 20px auto auto 50px 50px;
grid-template-rows: auto auto;
}
.select-todo-grid-show .todo-check {
grid-column-start: 1;
grid-row: 1 / 2;
align-self: center;
}
.select-todo-grid-show .todo-text {
grid-column-start: 2;
align-self: center;
}
.select-todo-grid-show .todo-due {
grid-row-start: 2;
grid-column-start: 3;
font-size: small;
justify-self: end;
width: fit-content;
}
.select-todo-grid-show .todo-duration {
grid-column-start: 3;
justify-self: end;
width: fit-content;
}
.select-todo-grid-show .todo-edit {
grid-column-start: 4;
justify-self: end;
width: fit-content;
}
.select-todo-grid-show .todo-delete {
grid-column-start: 5;
justify-self: end;
width: fit-content;
}
#show-todos #accordion {
width: -webkit-fill-available;
}
\ No newline at end of file
{% extends "account/base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Account Inactive" %}{% endblock %}
{% block content %}
<h1>{% trans "Account Inactive" %}</h1>
<p>{% trans "This account is inactive." %}</p>
{% endblock %}
{% extends "base.html" %}
{% extends "account/base.html" %}
{% load i18n %}
{% block head_title %}{% trans "E-mail Addresses" %}{% endblock %}
{% block content %}
<h1>{% trans "E-mail Addresses" %}</h1>
{% if user.emailaddress_set.all %}
<p>{% trans 'The following e-mail addresses are associated with your account:' %}</p>
<form action="{% url 'account_email' %}" class="email_list" method="post">
{% csrf_token %}
<fieldset class="blockLabels">
{% for emailaddress in user.emailaddress_set.all %}
<div class="ctrlHolder">
<label for="email_radio_{{forloop.counter}}" class="{% if emailaddress.primary %}primary_email{%endif%}">
<input id="email_radio_{{forloop.counter}}" type="radio" name="email" {% if emailaddress.primary or user.emailaddress_set.count == 1 %}checked="checked"{%endif %} value="{{emailaddress.email}}"/>
{{ emailaddress.email }}
{% if emailaddress.verified %}
<span class="verified">{% trans "Verified" %}</span>
{% else %}
<span class="unverified">{% trans "Unverified" %}</span>
{% endif %}
{% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %}
</label>
</div>
{% endfor %}
<div class="buttonHolder">
<button class="secondaryAction" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
<button class="secondaryAction" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button>
<button class="primaryAction" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
</div>
</fieldset>
</form>
{% else %}
<p><strong>{% trans 'Warning:'%}</strong> {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}</p>
{% endif %}
<h2>{% trans "Add E-mail Address" %}</h2>
<form method="post" action="{% url 'account_email' %}" class="add_email">
{% csrf_token %}
{{ form.as_p }}
<button name="action_add" type="submit">{% trans "Add E-mail" %}</button>
</form>
{% endblock %}
{% block extra_body %}
<script type="text/javascript">
(function() {
var message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
var actions = document.getElementsByName('action_remove');
if (actions.length) {
actions[0].addEventListener("click", function(e) {
if (! confirm(message)) {
e.preventDefault();
}
});
}
})();
</script>
{% endblock %}
{% load account %}{% user_display user as user_display %}{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Hello from {{ site_name }}!
You're receiving this e-mail because user {{ user_display }} has given yours as an e-mail address to connect their account.
To confirm this is correct, go to {{ activate_url }}
{% endblocktrans %}
{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you from {{ site_name }}!
{{ site_domain }}{% endblocktrans %}
{% endautoescape %}
{% include "account/email/email_confirmation_message.txt" %}
{% include "account/email/email_confirmation_subject.txt" %}
{% load i18n %}
{% autoescape off %}
{% blocktrans %}Please Confirm Your E-mail Address{% endblocktrans %}
{% endautoescape %}
{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Hello from {{ site_name }}!
You're receiving this e-mail because you or someone else has requested a password for your user account.
It can be safely ignored if you did not request a password reset. Click the link below to reset your password.{% endblocktrans %}
{{ password_reset_url }}
{% if username %}{% blocktrans %}In case you forgot, your username is {{ username }}.{% endblocktrans %}
{% endif %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you for using {{ site_name }}!
{{ site_domain }}{% endblocktrans %}
{% endautoescape %}
{% load i18n %}
{% autoescape off %}
{% blocktrans %}Password Reset E-mail{% endblocktrans %}
{% endautoescape %}
{% extends "account/base.html" %}
{% load i18n %}
{% load account %}
{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %}
{% block content %}
<h1>{% trans "Confirm E-mail Address" %}</h1>
{% if confirmation %}
{% user_display confirmation.email_address.user as user_display %}
<p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktrans %}</p>
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}">
{% csrf_token %}
<button type="submit">{% trans 'Confirm' %}</button>
</form>
{% else %}
{% url 'account_email' as email_url %}
<p>{% blocktrans %}This e-mail confirmation link expired or is invalid. Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>.{% endblocktrans %}</p>
{% endif %}
{% endblock %}
{% extends "account/base.html" %}
{% load bootstrap4 %}
{% load i18n %}
{% load account socialaccount %}
{% block head_title %}{% trans "Sign In" %}{% endblock %}
{% block content %}
<h1>{% trans "Sign In" %}</h1>
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
<p>{% blocktrans with site.name as site_name %}Please sign in with one
of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a>
for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
<div class="socialaccount_ballot">
<ul class="socialaccount_providers">
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
</ul>
<div class="login-or">{% trans 'or' %}</div>
</div>
{% include "socialaccount/snippets/login_extra.html" %}
{% else %}
<p>{% blocktrans %}If you have not created an account yet, then please
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p>
{% endif %}
<form class="login" method="POST" action="{% url 'account_login' %}">
{% csrf_token %}
{{ form.as_p }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<a class="button secondaryAction" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
<button class="primaryAction" type="submit">{% trans "Sign In" %}</button>
</form>
{% endblock %}
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