-
-
diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc
index c2c88dc..1b9fb5b 100644
Binary files a/digitaleagentur/__pycache__/settings.cpython-38.pyc and b/digitaleagentur/__pycache__/settings.cpython-38.pyc differ
diff --git a/digitaleagentur/__pycache__/urls.cpython-38.pyc b/digitaleagentur/__pycache__/urls.cpython-38.pyc
index ccf04f6..a45d73b 100644
Binary files a/digitaleagentur/__pycache__/urls.cpython-38.pyc and b/digitaleagentur/__pycache__/urls.cpython-38.pyc differ
diff --git a/digitaleagentur/settings.py b/digitaleagentur/settings.py
index 9b4611a..6f80711 100644
--- a/digitaleagentur/settings.py
+++ b/digitaleagentur/settings.py
@@ -35,6 +35,7 @@ INSTALLED_APPS = [
'orga.apps.OrgaConfig',
'tasks.apps.TasksConfig',
'standards.apps.StandardsConfig',
+ 'news.apps.NewsConfig',
'crispy_forms',
'colorful',
'ckeditor',
@@ -45,6 +46,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
+ 'bootstrap_datepicker_plus',
]
MIDDLEWARE = [
@@ -193,3 +195,8 @@ EMAIL_USE_TLS = True
EMAIL_HOST_USER = "support@digitale-agentur.com"
EMAIL_HOST_PASSWORD = "aPx9m3!7x3m@8o!t"
+
+# FOR DATEPICKER
+BOOTSTRAP4 = {
+ 'include_jquery': True,
+}
\ No newline at end of file
diff --git a/digitaleagentur/urls.py b/digitaleagentur/urls.py
index aa0a82a..80e84f1 100644
--- a/digitaleagentur/urls.py
+++ b/digitaleagentur/urls.py
@@ -17,6 +17,7 @@ from django.contrib.auth.decorators import login_required
tasks
standards
orga
+ news
-> Rest ist von Django
@@ -28,6 +29,7 @@ urlpatterns = [
path('areas/', include('areas.urls'), name="areas-management"),
path('tasks/', include('tasks.urls'), name="tasks-management"),
path('standards/', include('standards.urls'), name="standards"),
+ path('news/', include('news.urls'), name="dashboard"),
path('orga/', include('orga.urls'), name="orga"),
path('password-reset/', auth_views.PasswordResetView.as_view(template_name='users/password_reset.html'), name='password-reset'),
path('password-reset/done/', auth_views.PasswordResetDoneView.as_view(template_name='users/password_reset_done.html'), name='password_reset_done'),
diff --git a/media/userprofilepics/Makris_Philipp_7zkFtau.jpg b/media/userprofilepics/Makris_Philipp_7zkFtau.jpg
index 56f88cc..d5db87e 100644
Binary files a/media/userprofilepics/Makris_Philipp_7zkFtau.jpg and b/media/userprofilepics/Makris_Philipp_7zkFtau.jpg differ
diff --git a/media/userprofilepics/Timm_Hannes.jpg b/media/userprofilepics/Timm_Hannes.jpg
index 0b6d00c..b2e134e 100644
Binary files a/media/userprofilepics/Timm_Hannes.jpg and b/media/userprofilepics/Timm_Hannes.jpg differ
diff --git a/media/userprofilepics/Valentiner_Sebastian_apbr5VU.jpg b/media/userprofilepics/Valentiner_Sebastian_apbr5VU.jpg
index a337ebf..0f86948 100644
Binary files a/media/userprofilepics/Valentiner_Sebastian_apbr5VU.jpg and b/media/userprofilepics/Valentiner_Sebastian_apbr5VU.jpg differ
diff --git a/news/__init__.py b/news/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/news/__pycache__/__init__.cpython-38.pyc b/news/__pycache__/__init__.cpython-38.pyc
new file mode 100644
index 0000000..50d4891
Binary files /dev/null and b/news/__pycache__/__init__.cpython-38.pyc differ
diff --git a/news/__pycache__/admin.cpython-38.pyc b/news/__pycache__/admin.cpython-38.pyc
new file mode 100644
index 0000000..8692976
Binary files /dev/null and b/news/__pycache__/admin.cpython-38.pyc differ
diff --git a/news/__pycache__/apps.cpython-38.pyc b/news/__pycache__/apps.cpython-38.pyc
new file mode 100644
index 0000000..45a5cfe
Binary files /dev/null and b/news/__pycache__/apps.cpython-38.pyc differ
diff --git a/news/__pycache__/forms.cpython-38.pyc b/news/__pycache__/forms.cpython-38.pyc
new file mode 100644
index 0000000..4f2a036
Binary files /dev/null and b/news/__pycache__/forms.cpython-38.pyc differ
diff --git a/news/__pycache__/models.cpython-38.pyc b/news/__pycache__/models.cpython-38.pyc
new file mode 100644
index 0000000..efe672a
Binary files /dev/null and b/news/__pycache__/models.cpython-38.pyc differ
diff --git a/news/__pycache__/urls.cpython-38.pyc b/news/__pycache__/urls.cpython-38.pyc
new file mode 100644
index 0000000..4f0ef46
Binary files /dev/null and b/news/__pycache__/urls.cpython-38.pyc differ
diff --git a/news/__pycache__/views.cpython-38.pyc b/news/__pycache__/views.cpython-38.pyc
new file mode 100644
index 0000000..f23ea34
Binary files /dev/null and b/news/__pycache__/views.cpython-38.pyc differ
diff --git a/news/admin.py b/news/admin.py
new file mode 100644
index 0000000..a0137d8
--- /dev/null
+++ b/news/admin.py
@@ -0,0 +1,4 @@
+from django.contrib import admin
+from .models import News
+# Register your models here.
+admin.site.register(News)
\ No newline at end of file
diff --git a/news/apps.py b/news/apps.py
new file mode 100644
index 0000000..5a7b92d
--- /dev/null
+++ b/news/apps.py
@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class NewsConfig(AppConfig):
+ name = 'news'
diff --git a/news/forms.py b/news/forms.py
new file mode 100644
index 0000000..497ac48
--- /dev/null
+++ b/news/forms.py
@@ -0,0 +1,35 @@
+from bootstrap_datepicker_plus import DatePickerInput
+from django import forms
+from django.forms import ModelForm
+from .models import News
+from ckeditor.widgets import CKEditorWidget
+
+
+class NewsAddNews(forms.ModelForm):
+
+
+ class Meta:
+ model = News
+ labels = {
+ "name" : "Titel",
+ "go_online_on" : "Veröffentlichen",
+ "go_offline_on" : "Ins Archiv"
+ }
+ fields = ['name', 'go_online_on', 'go_offline_on']
+ widgets = {
+ 'go_online_on': DatePickerInput(options={"format":'DD.MM.YYYY HH:mm', "locale":'de'}),
+ 'go_offline_on': DatePickerInput(options={"format":'DD.MM.YYYY HH:mm', "locale":'de'}),
+ }
+
+class NewsAddNewsEditor(forms.ModelForm):
+
+ class Meta:
+ model = News
+ labels = {
+ "content" : "Inhalt"
+ }
+ fields = ['content']
+
+
+
+
\ No newline at end of file
diff --git a/news/migrations/0001_initial.py b/news/migrations/0001_initial.py
new file mode 100644
index 0000000..859bf21
--- /dev/null
+++ b/news/migrations/0001_initial.py
@@ -0,0 +1,28 @@
+# Generated by Django 2.2.7 on 2019-12-09 17:02
+
+import ckeditor_uploader.fields
+import datetime
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='News',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', models.CharField(default='', max_length=200)),
+ ('content', ckeditor_uploader.fields.RichTextUploadingField(blank=True, verbose_name='Inhalt')),
+ ('created_date', models.DateField(blank=True, default=datetime.date.today)),
+ ('go_online_on', models.DateField(blank=True, default=datetime.date.today)),
+ ('go_offline_on', models.DateField(blank=True, default=datetime.date.today)),
+ ('last_modified_on', models.DateField(blank=True, default=datetime.date.today)),
+ ],
+ ),
+ ]
diff --git a/news/migrations/0002_auto_20191209_1802.py b/news/migrations/0002_auto_20191209_1802.py
new file mode 100644
index 0000000..ee73a8a
--- /dev/null
+++ b/news/migrations/0002_auto_20191209_1802.py
@@ -0,0 +1,34 @@
+# Generated by Django 2.2.7 on 2019-12-09 17:02
+
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ('news', '0001_initial'),
+ ('users', '0001_initial'),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='news',
+ name='agency',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Agency'),
+ ),
+ migrations.AddField(
+ model_name='news',
+ name='created_by',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
+ ),
+ migrations.AddField(
+ model_name='news',
+ name='last_modified_by',
+ field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, related_name='news_mod_by', to=settings.AUTH_USER_MODEL),
+ ),
+ ]
diff --git a/news/migrations/0003_auto_20191209_1828.py b/news/migrations/0003_auto_20191209_1828.py
new file mode 100644
index 0000000..ebba84d
--- /dev/null
+++ b/news/migrations/0003_auto_20191209_1828.py
@@ -0,0 +1,24 @@
+# Generated by Django 2.2.7 on 2019-12-09 17:28
+
+import datetime
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('news', '0002_auto_20191209_1802'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='news',
+ name='go_offline_on',
+ field=models.DateTimeField(blank=True, default=datetime.date.today),
+ ),
+ migrations.AlterField(
+ model_name='news',
+ name='go_online_on',
+ field=models.DateTimeField(blank=True, default=datetime.date.today),
+ ),
+ ]
diff --git a/news/migrations/__init__.py b/news/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/news/migrations/__pycache__/0001_initial.cpython-38.pyc b/news/migrations/__pycache__/0001_initial.cpython-38.pyc
new file mode 100644
index 0000000..5c9082c
Binary files /dev/null and b/news/migrations/__pycache__/0001_initial.cpython-38.pyc differ
diff --git a/news/migrations/__pycache__/0002_auto_20191209_1753.cpython-38.pyc b/news/migrations/__pycache__/0002_auto_20191209_1753.cpython-38.pyc
new file mode 100644
index 0000000..0a3ee48
Binary files /dev/null and b/news/migrations/__pycache__/0002_auto_20191209_1753.cpython-38.pyc differ
diff --git a/news/migrations/__pycache__/0002_auto_20191209_1802.cpython-38.pyc b/news/migrations/__pycache__/0002_auto_20191209_1802.cpython-38.pyc
new file mode 100644
index 0000000..87961de
Binary files /dev/null and b/news/migrations/__pycache__/0002_auto_20191209_1802.cpython-38.pyc differ
diff --git a/news/migrations/__pycache__/0003_auto_20191209_1757.cpython-38.pyc b/news/migrations/__pycache__/0003_auto_20191209_1757.cpython-38.pyc
new file mode 100644
index 0000000..23af06f
Binary files /dev/null and b/news/migrations/__pycache__/0003_auto_20191209_1757.cpython-38.pyc differ
diff --git a/news/migrations/__pycache__/0003_auto_20191209_1828.cpython-38.pyc b/news/migrations/__pycache__/0003_auto_20191209_1828.cpython-38.pyc
new file mode 100644
index 0000000..4af0db9
Binary files /dev/null and b/news/migrations/__pycache__/0003_auto_20191209_1828.cpython-38.pyc differ
diff --git a/news/migrations/__pycache__/__init__.cpython-38.pyc b/news/migrations/__pycache__/__init__.cpython-38.pyc
new file mode 100644
index 0000000..a1952a4
Binary files /dev/null and b/news/migrations/__pycache__/__init__.cpython-38.pyc differ
diff --git a/news/models.py b/news/models.py
new file mode 100644
index 0000000..4c866e3
--- /dev/null
+++ b/news/models.py
@@ -0,0 +1,29 @@
+from django.db import models
+from django.contrib.auth.models import User
+from users.models import Agency
+from django.urls import reverse
+import datetime
+from ckeditor_uploader.fields import RichTextUploadingField
+from bootstrap_datepicker_plus import DatePickerInput
+
+class News(models.Model):
+
+ agency = models.ForeignKey(Agency, on_delete=models.CASCADE)
+ name = models.CharField(max_length=200, blank=False, default="")
+ 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)
+
+ 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)
+
+ def __str__(self):
+ return f'{self.name}'
+
+ # Hier Path für Templates des Models mit Parametern
+ def get_absolute_url(self):
+ return reverse('news-update', kwargs={'pk':self.pk})
\ No newline at end of file
diff --git a/news/templates/news/news_addnews.html b/news/templates/news/news_addnews.html
new file mode 100644
index 0000000..b00e2ff
--- /dev/null
+++ b/news/templates/news/news_addnews.html
@@ -0,0 +1,18 @@
+{% extends "users/base.html" %}
+{% load crispy_forms_tags %}
+{% block content %}
+
+{% endblock content %}
\ No newline at end of file
diff --git a/news/templates/news/news_confirm_delete.html b/news/templates/news/news_confirm_delete.html
new file mode 100644
index 0000000..f51ccaa
--- /dev/null
+++ b/news/templates/news/news_confirm_delete.html
@@ -0,0 +1,19 @@
+{% extends "users/base.html" %}
+{% load crispy_forms_tags %}
+{% block content %}
+
+{% endblock content %}
\ No newline at end of file
diff --git a/news/templates/news/news_management.html b/news/templates/news/news_management.html
new file mode 100644
index 0000000..ea239c8
--- /dev/null
+++ b/news/templates/news/news_management.html
@@ -0,0 +1,51 @@
+{% extends "users/base.html" %}
+{% block content %}
+
+
News
+
+
+ Newsbereich verwalten
+
+
+
+
+
+
+
+ Titel
+ Erstellt von
+ Erstellt am
+ Sichtbar von/bis
+
+
+
+ {% for news_single in news %}
+
+ {{news_single.name }}
+ {{ news_single.created_by.first_name }} {{ news_single.created_by.last_name }}
+ {{ news_single.created_date }}
+ {{ news_single.go_online_on|date:"d.m.Y, h:i"}} bis {{ news_single.go_offline_on|date:"d.m.Y, h:i"}}
+
+ {% if news_single.created_by == request.user or perms.users.news_management %}
+
+
+ {% endif %}
+
+
+
+ {% endfor %}
+
+
+{% endblock content %}
diff --git a/news/templates/news/news_single.html b/news/templates/news/news_single.html
new file mode 100644
index 0000000..228a5d4
--- /dev/null
+++ b/news/templates/news/news_single.html
@@ -0,0 +1,15 @@
+{% extends "users/base.html" %}
+{% block content %}
+
+
+ {{news.name}}
+ Erstellt durch {{news.created_by.first_name}} {{news.created_by.last_name}} am {{news.created_date}} | Zuletzt bearbeitet von {{ news.last_modified_by.first_name}} {{ news.last_modified_by.last_name}} am {{ news.last_modified_on}}
+ {% if news.created_by == user or perms.users.news_management %}
+ | Bearbeiten
+ {% endif %}
+
+
+ {{news.media}}
+ {{news.content|safe}}
+
+{% endblock content %}
\ No newline at end of file
diff --git a/news/templates/news/news_update.html b/news/templates/news/news_update.html
new file mode 100644
index 0000000..bb7a26e
--- /dev/null
+++ b/news/templates/news/news_update.html
@@ -0,0 +1,18 @@
+{% extends "users/base.html" %}
+{% load crispy_forms_tags %}
+{% block content %}
+
+{% endblock content %}
\ No newline at end of file
diff --git a/news/tests.py b/news/tests.py
new file mode 100644
index 0000000..7ce503c
--- /dev/null
+++ b/news/tests.py
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/news/urls.py b/news/urls.py
new file mode 100644
index 0000000..6e3ca0e
--- /dev/null
+++ b/news/urls.py
@@ -0,0 +1,18 @@
+from django.urls import path
+from .views import NewsManagement, NewsAdd, NewsDeleteView
+from . import views
+'''
+Permissions definiert in models.py bei USERS und dann hier vor die View geschrieben!
+'''
+
+urlpatterns = [
+ path('', NewsManagement.as_view(template_name="news/news_management.html"), name='news-management'),
+ path('newsadd/', views.NewsAdd, name='news-add'),
+ path('newsupdate/
/', views.NewsUpdate, name='news-update'),
+ path('news//delete', NewsDeleteView.as_view(), name='news-delete'),
+ #path('ajax/loadtasks/', views.load_tasks, name='ajax_loadtasks'),
+ #path('standard//changestat', views.StandardChangePublic, name="standard-status"),
+ path('news//single', views.NewsSingle, name="news-single"),
+ #path('standard//area', views.StandardArea, name="standard-area"),
+ #path('standard//task', views.StandardTask, name="standard-task")
+]
diff --git a/news/views.py b/news/views.py
new file mode 100644
index 0000000..92a0494
--- /dev/null
+++ b/news/views.py
@@ -0,0 +1,121 @@
+from django.shortcuts import render, redirect
+from django.contrib.auth.mixins import LoginRequiredMixin
+from django.views.generic import CreateView, ListView, UpdateView, DetailView, DeleteView
+from django.contrib.auth.models import User
+from .models import News
+from .forms import NewsAddNews, NewsAddNewsEditor
+from django.contrib.auth.decorators import login_required
+from datetime import datetime
+from django.contrib import messages
+from django.utils.dateparse import parse_date
+# Create your views here.
+# ALLE STANDARDS EINER AGENTUR
+class NewsManagement(LoginRequiredMixin, ListView):
+ model = News
+ # Adding active_link
+ # Loading only user same agency
+ # Change context and return for template-data
+ def get_context_data(self, **kwargs):
+ filterdate = datetime.now()
+ news = News.objects.filter(agency__pk=self.request.user.profile.agency.pk)
+ context = super().get_context_data(**kwargs)
+ context.update({'active_link' : 'newsmanagement', 'news' : news})
+ return context
+'''
+class NewsAddNews(LoginRequiredMixin, CreateView):
+ model = News
+ fields = ['name', 'content','go_online_on', 'go_offline_on']
+ success_url = '/dashboard/news/'
+'''
+@login_required
+def NewsAdd(request):
+ if request.method == 'POST':
+ normalForm = NewsAddNews(request.POST, instance=request.user)
+ editorForm = NewsAddNewsEditor(request.POST, instance=request.user)
+
+ if editorForm.is_valid() and normalForm.is_valid():
+ normalForm.agency = request.user.profile.agency
+ normalForm.created_by = request.user
+ normalForm.last_modified_by = request.user
+ normalForm.save()
+ editorForm.save()
+ new_news = News()
+ new_news.agency = request.user.profile.agency
+ new_news.created_by = request.user
+
+ new_news.last_modified_by = request.user
+ new_news.created_date = datetime.now()
+ new_news.last_modified_on = datetime.now()
+
+ new_news.name = normalForm.cleaned_data['name']
+ new_news.content = editorForm.cleaned_data['content']
+ new_news.go_online_on = normalForm.cleaned_data['go_online_on']
+ new_news.go_offline_on = normalForm.cleaned_data['go_offline_on']
+
+ new_news.save()
+ messages.success(request, f'News gespeichert!')
+ return redirect('news-management')
+
+ else:
+ normalForm = NewsAddNews(instance=request.user)
+ editorForm = NewsAddNewsEditor(instance=request.user)
+
+
+ context = {
+ 'normalForm' : normalForm,
+ 'editorForm' : editorForm,
+ 'active_link' : 'newsmanagement'
+ }
+ return render(request, 'news/news_addnews.html', context)
+
+@login_required
+def NewsUpdate(request, id):
+ news = News.objects.get(pk=id)
+ if request.method == 'POST':
+ normalForm = NewsAddNews(request.POST, instance=news)
+ editorForm = NewsAddNewsEditor(request.POST, instance=news)
+
+ if editorForm.is_valid() and normalForm.is_valid():
+ news = News.objects.get(pk=id)
+ news.last_modified_by = request.user
+ news.last_modified_on = datetime.now()
+ news.go_online_on = normalForm.cleaned_data['go_online_on']
+ news.go_offline_on = normalForm.cleaned_data['go_offline_on']
+ news.name = normalForm.cleaned_data['name']
+ news.content = editorForm.cleaned_data['content']
+ news.save()
+ messages.success(request, f'News aktualisiert!')
+ return redirect('/news')
+
+ else:
+ normalForm = NewsAddNews(instance=news)
+ editorForm = NewsAddNewsEditor(instance=news)
+
+
+ context = {
+ 'normalForm' : normalForm,
+ 'editorForm' : editorForm,
+ 'active_link' : 'newsmanagement',
+ 'news_id' : news.pk,
+ }
+ return render(request, 'news/news_update.html', context)
+
+class NewsDeleteView(LoginRequiredMixin, DeleteView):
+ model = News
+ success_url = '/news'
+ template_name = 'news/news_confirm_delete.html'
+
+ def get_context_data(self, **kwargs):
+ context = super(NewsDeleteView, self).get_context_data(**kwargs)
+ context['active_link'] = 'newsmanagement'
+ return context
+
+
+@login_required
+def NewsSingle(request, pk):
+ news = News.objects.get(pk=pk)
+ context = {
+ 'active_link':'newsmanagement',
+ 'news' : news
+ }
+ return render(request, 'news/news_single.html', context)
\ No newline at end of file
diff --git a/orga/templates/orga/orga_main.html b/orga/templates/orga/orga_main.html
index 97d75f9..6500efe 100644
--- a/orga/templates/orga/orga_main.html
+++ b/orga/templates/orga/orga_main.html
@@ -16,7 +16,7 @@
{{ leader.first_name }} {{ leader.last_name }}
- {{ leader.profile.get_func_display }}
+ {{ leader.profile.get_func_display }}
@@ -67,8 +67,6 @@
{% endfor %}
-
-
diff --git a/standards/__pycache__/urls.cpython-38.pyc b/standards/__pycache__/urls.cpython-38.pyc
index ad0fdc8..67f12f1 100644
Binary files a/standards/__pycache__/urls.cpython-38.pyc and b/standards/__pycache__/urls.cpython-38.pyc differ
diff --git a/standards/migrations/0001_initial.py b/standards/migrations/0001_initial.py
index ca2973e..a3bf549 100644
--- a/standards/migrations/0001_initial.py
+++ b/standards/migrations/0001_initial.py
@@ -1,9 +1,8 @@
-# Generated by Django 2.2.7 on 2019-12-04 16:51
+# Generated by Django 2.2.7 on 2019-12-09 17:02
+import ckeditor_uploader.fields
import datetime
-from django.conf import settings
from django.db import migrations, models
-import django.db.models.deletion
class Migration(migrations.Migration):
@@ -11,10 +10,6 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- ('users', '0002_auto_20191204_0857'),
- ('tasks', '0002_tasks_name'),
- ('areas', '0001_initial'),
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
@@ -23,13 +18,11 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(default='', max_length=200)),
- ('content', models.TextField(blank=True, max_length=3000)),
- ('created_area_date', models.DateField(blank=True, default=datetime.date.today)),
- ('public', models.BooleanField(default=True)),
- ('agency', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='users.Agency')),
- ('area', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='areas.Areas')),
- ('created_area_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
- ('task', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='tasks.Tasks')),
+ ('content', ckeditor_uploader.fields.RichTextUploadingField(blank=True, verbose_name='Inhalt')),
+ ('created_standard_date', models.DateField(blank=True, default=datetime.date.today)),
+ ('published_on', models.DateField(blank=True, default=datetime.date.today)),
+ ('last_modified_on', models.DateField(blank=True, default=datetime.date.today)),
+ ('public', models.BooleanField(default=False)),
],
),
]
diff --git a/standards/migrations/0002_auto_20191205_0809.py b/standards/migrations/0002_auto_20191209_1802.py
similarity index 53%
rename from standards/migrations/0002_auto_20191205_0809.py
rename to standards/migrations/0002_auto_20191209_1802.py
index f3b2d12..7731721 100644
--- a/standards/migrations/0002_auto_20191205_0809.py
+++ b/standards/migrations/0002_auto_20191209_1802.py
@@ -1,7 +1,5 @@
-# Generated by Django 3.0 on 2019-12-05 07:09
+# Generated by Django 2.2.7 on 2019-12-09 17:02
-import ckeditor_uploader.fields
-import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
@@ -9,66 +7,43 @@ import django.db.models.deletion
class Migration(migrations.Migration):
+ initial = True
+
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('tasks', '0002_tasks_name'),
- ('areas', '0001_initial'),
- ('users', '0002_auto_20191204_0857'),
('standards', '0001_initial'),
+ ('tasks', '0001_initial'),
+ ('areas', '0002_auto_20191209_1802'),
+ ('users', '0001_initial'),
]
operations = [
- migrations.RenameField(
+ migrations.AddField(
model_name='standards',
- old_name='created_area_by',
- new_name='created_standard_by',
+ name='agency',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Agency'),
),
- migrations.RenameField(
+ migrations.AddField(
model_name='standards',
- old_name='created_area_date',
- new_name='created_standard_date',
+ name='area',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='areas.Areas'),
+ ),
+ migrations.AddField(
+ model_name='standards',
+ name='created_standard_by',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='standards',
name='last_modified_by',
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, related_name='user_modified_standard', to=settings.AUTH_USER_MODEL),
),
- migrations.AddField(
- model_name='standards',
- name='last_modified_on',
- field=models.DateField(blank=True, default=datetime.date.today),
- ),
migrations.AddField(
model_name='standards',
name='published_by',
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, related_name='user_published_standard', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
- model_name='standards',
- name='published_on',
- field=models.DateField(blank=True, default=datetime.date.today),
- ),
- migrations.AlterField(
- model_name='standards',
- name='agency',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Agency'),
- ),
- migrations.AlterField(
- model_name='standards',
- name='area',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='areas.Areas'),
- ),
- migrations.AlterField(
- model_name='standards',
- name='content',
- field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, verbose_name='Inhalt'),
- ),
- migrations.AlterField(
- model_name='standards',
- name='public',
- field=models.BooleanField(default=False),
- ),
- migrations.AlterField(
model_name='standards',
name='task',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tasks.Tasks'),
diff --git a/standards/migrations/__pycache__/0001_initial.cpython-38.pyc b/standards/migrations/__pycache__/0001_initial.cpython-38.pyc
index 7411eab..c923d66 100644
Binary files a/standards/migrations/__pycache__/0001_initial.cpython-38.pyc and b/standards/migrations/__pycache__/0001_initial.cpython-38.pyc differ
diff --git a/standards/migrations/__pycache__/0002_auto_20191209_1802.cpython-38.pyc b/standards/migrations/__pycache__/0002_auto_20191209_1802.cpython-38.pyc
new file mode 100644
index 0000000..d05a16b
Binary files /dev/null and b/standards/migrations/__pycache__/0002_auto_20191209_1802.cpython-38.pyc differ
diff --git a/standards/templates/standards/standard_area.html b/standards/templates/standards/standard_area.html
index d8125b9..bf827fd 100644
--- a/standards/templates/standards/standard_area.html
+++ b/standards/templates/standards/standard_area.html
@@ -4,47 +4,59 @@
Standards
- {{areaname}}
+ {{areaname}}
Standards aus dem Bereich {{areaname}}
+
+
+
+ Titel
+ Erstellt von
+ Erstellt am
+ Geändert von
+ Geändert am
+ Öffentlichkeitsstatus
+
+
+
{% for item in standards_of_agency_area %}
- {% if item.public or item.created_standard_by == user or perms.users.standard_management %}
-
-
-
-
-
{{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%}
+ {% if item.public or item.created_standard_by == user or perms.users.standard_management %}
+
+ {{item.name}}
+ {{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}}
+ {{ item.created_standard_date}}
+ {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }}
+ {{ item.last_modified_on }}
+ {{item.public|yesno:"Öffentlich,Nicht öffentlich"}}
+
+ {% if item.created_standard_by == user or perms.users.standard_management %}
+
+ {% endif %}
+
+
+ {% endif %}
+ {% endfor %}
+
{% endblock content %}
+
+
+
+
+
+
+
+
+
diff --git a/users/templates/users/dashboard_SAVE_standardcards.html b/standards/templates/standards/standard_area_OLD.html
similarity index 60%
rename from users/templates/users/dashboard_SAVE_standardcards.html
rename to standards/templates/standards/standard_area_OLD.html
index ae02b2d..d8125b9 100644
--- a/users/templates/users/dashboard_SAVE_standardcards.html
+++ b/standards/templates/standards/standard_area_OLD.html
@@ -1,25 +1,25 @@
{% extends "users/base.html" %}
{% block content %}
{% endblock content %}
diff --git a/standards/templates/standards/standard_task_OLD.html b/standards/templates/standards/standard_task_OLD.html
new file mode 100644
index 0000000..2ea2f08
--- /dev/null
+++ b/standards/templates/standards/standard_task_OLD.html
@@ -0,0 +1,51 @@
+{% extends "users/base.html" %}
+{% block content %}
+
+{% endblock content %}
diff --git a/standards/urls.py b/standards/urls.py
index 033a13c..19e8171 100644
--- a/standards/urls.py
+++ b/standards/urls.py
@@ -17,4 +17,4 @@ urlpatterns = [
path('standard/