diff --git a/news/__pycache__/models.cpython-38.pyc b/news/__pycache__/models.cpython-38.pyc index f9078a4..e4beecc 100644 Binary files a/news/__pycache__/models.cpython-38.pyc and b/news/__pycache__/models.cpython-38.pyc differ diff --git a/news/migrations/0004_auto_20191209_2227.py b/news/migrations/0004_auto_20191209_2227.py new file mode 100644 index 0000000..1331670 --- /dev/null +++ b/news/migrations/0004_auto_20191209_2227.py @@ -0,0 +1,24 @@ +# Generated by Django 2.2.7 on 2019-12-09 21:27 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('news', '0003_auto_20191209_1828'), + ] + + operations = [ + migrations.AlterField( + model_name='news', + name='created_date', + field=models.DateTimeField(blank=True, default=datetime.date.today), + ), + migrations.AlterField( + model_name='news', + name='last_modified_on', + field=models.DateTimeField(blank=True, default=datetime.date.today), + ), + ] diff --git a/news/migrations/__pycache__/0004_auto_20191209_2227.cpython-38.pyc b/news/migrations/__pycache__/0004_auto_20191209_2227.cpython-38.pyc new file mode 100644 index 0000000..fef0d53 Binary files /dev/null and b/news/migrations/__pycache__/0004_auto_20191209_2227.cpython-38.pyc differ diff --git a/news/models.py b/news/models.py index 1655d6a..897cf7d 100644 --- a/news/models.py +++ b/news/models.py @@ -13,16 +13,16 @@ class News(models.Model): content = RichTextUploadingField(blank=True, verbose_name='Inhalt') created_by = models.ForeignKey(User, on_delete=models.PROTECT) - created_date = models.DateField(default=datetime.date.today, blank=True) + created_date = models.DateTimeField(default=datetime.date.today, blank=True) go_online_on = models.DateTimeField(default=datetime.date.today, blank=True) go_offline_on = models.DateTimeField(default=datetime.date.today, blank=True) last_modified_by = models.ForeignKey(User, on_delete=models.PROTECT, related_name='news_mod_by', default=None) - last_modified_on = models.DateField(default=datetime.date.today, blank=True) - - + last_modified_on = models.DateTimeField(default=datetime.date.today, blank=True) + + def __str__(self): return f'{self.name}' diff --git a/standards/__pycache__/models.cpython-38.pyc b/standards/__pycache__/models.cpython-38.pyc index d7f1d7e..e56e73e 100644 Binary files a/standards/__pycache__/models.cpython-38.pyc and b/standards/__pycache__/models.cpython-38.pyc differ diff --git a/standards/migrations/0003_auto_20191209_2226.py b/standards/migrations/0003_auto_20191209_2226.py new file mode 100644 index 0000000..3dc16c7 --- /dev/null +++ b/standards/migrations/0003_auto_20191209_2226.py @@ -0,0 +1,29 @@ +# Generated by Django 2.2.7 on 2019-12-09 21:26 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('standards', '0002_auto_20191209_1802'), + ] + + operations = [ + migrations.AlterField( + model_name='standards', + name='created_standard_date', + field=models.DateTimeField(blank=True, default=datetime.date.today), + ), + migrations.AlterField( + model_name='standards', + name='last_modified_on', + field=models.DateTimeField(blank=True, default=datetime.date.today), + ), + migrations.AlterField( + model_name='standards', + name='published_on', + field=models.DateTimeField(blank=True, default=datetime.date.today), + ), + ] diff --git a/standards/migrations/__pycache__/0003_auto_20191209_2226.cpython-38.pyc b/standards/migrations/__pycache__/0003_auto_20191209_2226.cpython-38.pyc new file mode 100644 index 0000000..ccfef80 Binary files /dev/null and b/standards/migrations/__pycache__/0003_auto_20191209_2226.cpython-38.pyc differ diff --git a/standards/models.py b/standards/models.py index ffb5eb0..087cab5 100644 --- a/standards/models.py +++ b/standards/models.py @@ -16,13 +16,13 @@ class Standards(models.Model): content = RichTextUploadingField(blank=True, verbose_name='Inhalt') created_standard_by = models.ForeignKey(User, on_delete=models.PROTECT) - created_standard_date = models.DateField(default=datetime.date.today, blank=True) + created_standard_date = models.DateTimeField(default=datetime.date.today, blank=True) published_by = models.ForeignKey(User, on_delete=models.PROTECT, related_name='user_published_standard', default=None) - published_on = models.DateField(default=datetime.date.today, blank=True) + published_on = models.DateTimeField(default=datetime.date.today, blank=True) last_modified_by = models.ForeignKey(User, on_delete=models.PROTECT, related_name='user_modified_standard', default=None) - last_modified_on = models.DateField(default=datetime.date.today, blank=True) + last_modified_on = models.DateTimeField(default=datetime.date.today, blank=True) public = models.BooleanField(default=False) diff --git a/standards/templates/standards/standard_area.html b/standards/templates/standards/standard_area.html index bf827fd..1320706 100644 --- a/standards/templates/standards/standard_area.html +++ b/standards/templates/standards/standard_area.html @@ -27,9 +27,9 @@ {{item.name}} {{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}} - {{ item.created_standard_date}} + {{ item.created_standard_date|date:"d.m.Y, H:i"}} {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} - {{ item.last_modified_on }} + {{ item.last_modified_on|date:"d.m.Y, H:i"}} {{item.public|yesno:"Öffentlich,Nicht öffentlich"}} {% if item.created_standard_by == user or perms.users.standard_management %} diff --git a/standards/templates/standards/standard_area_OLD.html b/standards/templates/standards/standard_area_OLD.html deleted file mode 100644 index d8125b9..0000000 --- a/standards/templates/standards/standard_area_OLD.html +++ /dev/null @@ -1,50 +0,0 @@ -{% extends "users/base.html" %} -{% block content %} -
- -

Standards aus dem Bereich {{areaname}}

-
-
- {% for item in standards_of_agency_area %} - {% if item.public or item.created_standard_by == user or perms.users.standard_management %} -
-
-
- - {% if item.public %} -

{{item.name}}

- {% else %} -

{{item.name}}

- {% endif %} -
- {% if item.created_standard_by == user or perms.users.standard_management %} - - {% endif %} -
-
-
{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}}
Zuletzt bearbeitet von {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} am {{ item.last_modified_on }}
- -

{{ item.content|truncatechars:250|safe}}

-
-
-
- {% endif %} - {% endfor%} -
-
-{% endblock content %} diff --git a/standards/templates/standards/standard_task.html b/standards/templates/standards/standard_task.html index 1baf176..3091910 100644 --- a/standards/templates/standards/standard_task.html +++ b/standards/templates/standards/standard_task.html @@ -28,9 +28,9 @@ {{item.name}} {{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}} - {{ item.created_standard_date}} + {{ item.created_standard_date|date:"d.m.Y, H:i"}} {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} - {{ item.last_modified_on }} + {{ item.last_modified_on|date:"d.m.Y, H:i"}} {{item.public|yesno:"Öffentlich,Nicht öffentlich"}} {% if item.created_standard_by == user or perms.users.standard_management %} diff --git a/standards/templates/standards/standard_task_OLD.html b/standards/templates/standards/standard_task_OLD.html deleted file mode 100644 index 2ea2f08..0000000 --- a/standards/templates/standards/standard_task_OLD.html +++ /dev/null @@ -1,51 +0,0 @@ -{% extends "users/base.html" %} -{% block content %} -
- -

Standards aus dem Aufgabenbereich {{taskname}} des Bereichs {{areaname}}

-
-
- {% for item in standards_of_agency_task %} - {% if item.public or item.created_standard_by == user or perms.users.standard_management %} -
-
-
- - {% if item.public %} -

{{item.name}}

- {% else %} -

{{item.name}}

- {% endif %} -
- {% if item.created_standard_by == user or perms.users.standard_management %} - - {% endif %} -
-
-
{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}}
Zuletzt bearbeitet von {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} am {{ item.last_modified_on }}
- -

{{ item.content|truncatechars:250|safe}}

-
-
-
- {% endif %} - {% endfor%} -
-
-{% endblock content %} diff --git a/standards/templates/standards/standards_management.html b/standards/templates/standards/standards_management.html index 3d2bb95..6955979 100644 --- a/standards/templates/standards/standards_management.html +++ b/standards/templates/standards/standards_management.html @@ -67,9 +67,9 @@ {% for standard in standards_of_user %} {{standard.name}} - {{standard.created_standard_date}} + {{standard.created_standard_date|date:"d.m.Y, H:i"}} {{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}} - {{standard.last_modified_on}} + {{standard.last_modified_on|date:"d.m.Y, H:i"}} {{standard.public|yesno:"Öffentlich,Nicht öffentlich"}} diff --git a/users/__pycache__/views.cpython-38.pyc b/users/__pycache__/views.cpython-38.pyc index 00aacf8..e466373 100644 Binary files a/users/__pycache__/views.cpython-38.pyc and b/users/__pycache__/views.cpython-38.pyc differ diff --git a/users/migrations/0002_auto_20191209_2226.py b/users/migrations/0002_auto_20191209_2226.py new file mode 100644 index 0000000..bd5b4fa --- /dev/null +++ b/users/migrations/0002_auto_20191209_2226.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.7 on 2019-12-09 21:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='profile', + name='func', + field=models.CharField(choices=[('lead', 'Agenturleitung'), ('external', 'Außendienst'), ('indoor', 'Innendienst'), ('trainee', 'Azubi')], default='lead', max_length=50), + ), + ] diff --git a/users/migrations/__pycache__/0002_auto_20191209_2226.cpython-38.pyc b/users/migrations/__pycache__/0002_auto_20191209_2226.cpython-38.pyc new file mode 100644 index 0000000..5aa46d1 Binary files /dev/null and b/users/migrations/__pycache__/0002_auto_20191209_2226.cpython-38.pyc differ diff --git a/users/templates/users/dashboard.html b/users/templates/users/dashboard.html index bc958fc..b1b9ef6 100644 --- a/users/templates/users/dashboard.html +++ b/users/templates/users/dashboard.html @@ -22,7 +22,7 @@ {{news_single.name }} {{ news_single.created_by.first_name }} {{ news_single.created_by.last_name }} - {{ news_single.created_date }} + {{ news_single.created_date|date:"d.m.Y, H:i" }} {% endfor %} @@ -41,12 +41,10 @@ {% for standard in standards_of_agency %} {{standard.name}} - {{standard.created_standard_date}} + {{standard.created_standard_date|date:"d.m.Y, H:i"}} {{standard.created_standard_by.first_name}} {{standard.created_standard_by.last_name}} - {{standard.last_modified_on}} + {{standard.last_modified_on|date:"d.m.Y, H:i"}} {{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}} - - {% endfor %} diff --git a/users/views.py b/users/views.py index 08a8074..120def8 100644 --- a/users/views.py +++ b/users/views.py @@ -61,7 +61,7 @@ def dashboard(request): # Loading only user same agency # Change context and return for template-data # # Get all Users of the Same Agency as logged user - standards_of_agency = Standards.objects.filter(agency__pk=request.user.profile.agency.pk).order_by('-last_modified_on')[:10] + standards_of_agency = Standards.objects.filter(agency__pk=request.user.profile.agency.pk).order_by('-created_standard_date')[:10] filterdate = datetime.now() news = News.objects.filter(agency__pk=request.user.profile.agency.pk).filter(go_online_on__lt=filterdate).filter(go_offline_on__gt=filterdate)