diff --git a/digitaleagentur/__pycache__/urls.cpython-38.pyc b/digitaleagentur/__pycache__/urls.cpython-38.pyc index 370844a..7905a5b 100644 Binary files a/digitaleagentur/__pycache__/urls.cpython-38.pyc and b/digitaleagentur/__pycache__/urls.cpython-38.pyc differ diff --git a/digitaleagentur/urls.py b/digitaleagentur/urls.py index f4547f2..7dd686f 100644 --- a/digitaleagentur/urls.py +++ b/digitaleagentur/urls.py @@ -42,7 +42,7 @@ urlpatterns = [ if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -urlpatterns += [ - path('ckeditor/upload/', login_required(upload), name='ckeditor_upload'), - path('ckeditor/', include('ckeditor_uploader.urls')), -] \ No newline at end of file +#urlpatterns += [ +# path('ckeditor/upload/', login_required(upload), name='ckeditor_upload'), +# path('ckeditor/', include('ckeditor_uploader.urls')), +#] \ No newline at end of file diff --git a/news/__pycache__/forms.cpython-38.pyc b/news/__pycache__/forms.cpython-38.pyc index 4f2a036..b6d63ab 100644 Binary files a/news/__pycache__/forms.cpython-38.pyc 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 index bd27abd..98b06b3 100644 Binary files a/news/__pycache__/models.cpython-38.pyc and b/news/__pycache__/models.cpython-38.pyc differ diff --git a/news/__pycache__/views.cpython-38.pyc b/news/__pycache__/views.cpython-38.pyc index 5498663..e68e3e3 100644 Binary files a/news/__pycache__/views.cpython-38.pyc and b/news/__pycache__/views.cpython-38.pyc differ diff --git a/news/forms.py b/news/forms.py index 497ac48..974e52e 100644 --- a/news/forms.py +++ b/news/forms.py @@ -2,7 +2,7 @@ from bootstrap_datepicker_plus import DatePickerInput from django import forms from django.forms import ModelForm from .models import News -from ckeditor.widgets import CKEditorWidget +#from ckeditor.widgets import CKEditorWidget class NewsAddNews(forms.ModelForm): @@ -13,14 +13,15 @@ class NewsAddNews(forms.ModelForm): labels = { "name" : "Titel", "go_online_on" : "Veröffentlichen", - "go_offline_on" : "Ins Archiv" + "go_offline_on" : "Ins Archiv", + "content" : "Inhalt" } - fields = ['name', 'go_online_on', 'go_offline_on'] + fields = ['name', 'go_online_on', 'go_offline_on', 'content'] 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: @@ -29,7 +30,4 @@ class NewsAddNewsEditor(forms.ModelForm): "content" : "Inhalt" } fields = ['content'] - - - - \ No newline at end of file +''' \ No newline at end of file diff --git a/news/models.py b/news/models.py index 0c9ec2c..7ead2c3 100644 --- a/news/models.py +++ b/news/models.py @@ -3,14 +3,15 @@ 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 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') + #content = RichTextUploadingField(blank=True, verbose_name='Inhalt') + content = models.TextField(blank=True, verbose_name='Inhalt') created_by = models.ForeignKey(User, on_delete=models.PROTECT) created_date = models.DateTimeField(default=datetime.datetime.now(), blank=True) diff --git a/news/templates/news/news_addnews.html b/news/templates/news/news_addnews.html index b00e2ff..c858488 100644 --- a/news/templates/news/news_addnews.html +++ b/news/templates/news/news_addnews.html @@ -7,12 +7,17 @@
{% csrf_token %} {{normalForm.media}} - {{normalForm|crispy}} - {{editorForm.media}} - {{editorForm}} + {{normalForm|crispy}}
  Abbrechen
+ {% endblock content %} \ No newline at end of file diff --git a/news/templates/news/news_update.html b/news/templates/news/news_update.html index bb7a26e..da53bfc 100644 --- a/news/templates/news/news_update.html +++ b/news/templates/news/news_update.html @@ -7,12 +7,17 @@
{% csrf_token %} {{normalForm.media}} - {{normalForm|crispy}} - {{editorForm.media}} - {{editorForm}} + {{normalForm|crispy}}
  Abbrechen
+ {% endblock content %} \ No newline at end of file diff --git a/news/views.py b/news/views.py index 2f81499..461fe6d 100644 --- a/news/views.py +++ b/news/views.py @@ -3,7 +3,7 @@ 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 .forms import NewsAddNews from django.contrib.auth.decorators import login_required from datetime import datetime from django.contrib import messages @@ -31,14 +31,15 @@ class NewsAddNews(LoginRequiredMixin, CreateView): def NewsAdd(request): if request.method == 'POST': normalForm = NewsAddNews(request.POST, instance=request.user) - editorForm = NewsAddNewsEditor(request.POST, instance=request.user) + #editorForm = NewsAddNewsEditor(request.POST, instance=request.user) - if editorForm.is_valid() and normalForm.is_valid(): + #if editorForm.is_valid() and normalForm.is_valid(): + if normalForm.is_valid(): normalForm.agency = request.user.profile.agency normalForm.created_by = request.user normalForm.last_modified_by = request.user normalForm.save() - editorForm.save() + #editorForm.save() new_news = News() new_news.agency = request.user.profile.agency new_news.created_by = request.user @@ -48,7 +49,7 @@ def NewsAdd(request): new_news.last_modified_on = datetime.now() new_news.name = normalForm.cleaned_data['name'] - new_news.content = editorForm.cleaned_data['content'] + new_news.content = normalForm.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'] @@ -58,12 +59,12 @@ def NewsAdd(request): else: normalForm = NewsAddNews(instance=request.user) - editorForm = NewsAddNewsEditor(instance=request.user) + #editorForm = NewsAddNewsEditor(instance=request.user) context = { 'normalForm' : normalForm, - 'editorForm' : editorForm, + #'editorForm' : editorForm, 'active_link' : 'newsmanagement' } return render(request, 'news/news_addnews.html', context) @@ -73,28 +74,28 @@ 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) + #editorForm = NewsAddNewsEditor(request.POST, instance=news) - if editorForm.is_valid() and normalForm.is_valid(): + if 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.content = normalForm.cleaned_data['content'] news.save() messages.success(request, f'News aktualisiert!') return redirect('/news') else: normalForm = NewsAddNews(instance=news) - editorForm = NewsAddNewsEditor(instance=news) + #editorForm = NewsAddNewsEditor(instance=news) context = { 'normalForm' : normalForm, - 'editorForm' : editorForm, + #'editorForm' : editorForm, 'active_link' : 'newsmanagement', 'news_id' : news.pk, } diff --git a/orga/templates/orga/orga_main.html b/orga/templates/orga/orga_main.html index 82fb7e2..952b1f9 100644 --- a/orga/templates/orga/orga_main.html +++ b/orga/templates/orga/orga_main.html @@ -77,9 +77,6 @@ function connectorDefaults(connector) { connector.targetDecorator.shape = 'None'; connector.type = 'Orthogonal'; connector.style.strokeColor = 'gray'; - - console.log(connector); - return connector; } diff --git a/standards/__pycache__/forms.cpython-38.pyc b/standards/__pycache__/forms.cpython-38.pyc index 67b284e..3aa4028 100644 Binary files a/standards/__pycache__/forms.cpython-38.pyc and b/standards/__pycache__/forms.cpython-38.pyc differ diff --git a/standards/__pycache__/models.cpython-38.pyc b/standards/__pycache__/models.cpython-38.pyc index b603fee..8a2526f 100644 Binary files a/standards/__pycache__/models.cpython-38.pyc and b/standards/__pycache__/models.cpython-38.pyc differ diff --git a/standards/__pycache__/views.cpython-38.pyc b/standards/__pycache__/views.cpython-38.pyc index ae43db0..08a5a43 100644 Binary files a/standards/__pycache__/views.cpython-38.pyc and b/standards/__pycache__/views.cpython-38.pyc differ diff --git a/standards/forms.py b/standards/forms.py index c5ffbba..bbb20ba 100644 --- a/standards/forms.py +++ b/standards/forms.py @@ -13,8 +13,9 @@ class StandardAddStandard(forms.ModelForm): "name" : "Titel", "area" : "Übergeordneter Bereich", "task" : "Aufgabenbereich", + "content": "Inhalt" } - fields = ['name', 'area', 'task'] + fields = ['name', 'area', 'task', 'content'] ''' Hier werden die Elemente für die DropDowns erstellt, damit @@ -59,8 +60,9 @@ class StandardUpdateStandard(forms.ModelForm): "name" : "Titel", "area" : "Übergeordneter Bereich", "task" : "Aufgabenbereich", + "content": "Inhalt" } - fields = ['name', 'area', 'task'] + fields = ['name', 'area', 'task', 'content'] ''' Hier werden die Elemente für die DropDowns erstellt, damit diff --git a/standards/models.py b/standards/models.py index e48fcda..d5f431b 100644 --- a/standards/models.py +++ b/standards/models.py @@ -6,7 +6,7 @@ from areas.models import Areas from tasks.models import Tasks import datetime from django.utils import timezone -from ckeditor_uploader.fields import RichTextUploadingField +#from ckeditor_uploader.fields import RichTextUploadingField class Standards(models.Model): @@ -14,7 +14,8 @@ class Standards(models.Model): area = models.ForeignKey(Areas, on_delete=models.CASCADE) task = models.ForeignKey(Tasks, on_delete=models.CASCADE) name = models.CharField(max_length=200, blank=False, default="") - content = RichTextUploadingField(blank=True, verbose_name='Inhalt') + #content = RichTextUploadingField(blank=True, verbose_name='Inhalt') + content = models.TextField(blank=True, verbose_name='Inhalt') created_standard_by = models.ForeignKey(User, on_delete=models.PROTECT) created_standard_date = models.DateTimeField(default=datetime.datetime.now(), blank=True) diff --git a/standards/templates/standards/standards_add.html b/standards/templates/standards/standards_add.html index 7bd6f81..dd316be 100644 --- a/standards/templates/standards/standards_add.html +++ b/standards/templates/standards/standards_add.html @@ -7,8 +7,7 @@
{% csrf_token %} {{normalForm|crispy}} - {{editorForm.media}} - {{editorForm}} +

Wenn ein Standard erstellt wurde, kann er nur von einer Person mit dem Recht Standards bearbeiten und freischalten veröffentlicht werden.


@@ -32,5 +31,11 @@ $("#id_area").change(function () { } }); }); +$(document).ready(function() { + $('#id_content').summernote({ + height: 400 + }); +}); + {% endblock content %} diff --git a/standards/templates/standards/standards_update.html b/standards/templates/standards/standards_update.html index dea388d..e818e89 100644 --- a/standards/templates/standards/standards_update.html +++ b/standards/templates/standards/standards_update.html @@ -7,8 +7,7 @@ {% csrf_token %} {{normalForm|crispy}} - {{editorForm.media}} - {{editorForm}} +

Wenn ein Standard bearbeitet wurde, kann er nur von einer Person mit dem Recht Standards bearbeiten und freischalten wieder veröffentlicht werden. Ein Standard wird nach Bearbeitung als Nicht veröffentlicht gesetzt.


  @@ -39,6 +38,10 @@ $("#id_area").change(function () { } }); }); - +$(document).ready(function() { + $('#id_content').summernote({ + height: 400 + }); +}); {% endblock content %} diff --git a/standards/views.py b/standards/views.py index 67b5ae2..60b239a 100644 --- a/standards/views.py +++ b/standards/views.py @@ -76,6 +76,7 @@ def StandardAdd(request): def StandardUpdate(request, id): standard = Standards.objects.get(pk=id) if request.method == 'POST': + #normalForm = StandardUpdateStandard(request.POST, instance=standard) normalForm = StandardUpdateStandard(request.POST, instance=standard) editorForm = StandardUpdateStandardEditor(request.POST, instance=standard) @@ -108,6 +109,7 @@ def StandardUpdate(request, id): return redirect('/standards') else: + #normalForm = StandardUpdateStandard(instance=standard) normalForm = StandardUpdateStandard(instance=standard) editorForm = StandardUpdateStandardEditor(instance=standard) diff --git a/users/__pycache__/usersforms.cpython-38.pyc b/users/__pycache__/usersforms.cpython-38.pyc index 698c2ac..e00b415 100644 Binary files a/users/__pycache__/usersforms.cpython-38.pyc and b/users/__pycache__/usersforms.cpython-38.pyc differ diff --git a/users/__pycache__/views.cpython-38.pyc b/users/__pycache__/views.cpython-38.pyc index 077c412..ea11457 100644 Binary files a/users/__pycache__/views.cpython-38.pyc and b/users/__pycache__/views.cpython-38.pyc differ diff --git a/users/templates/users/base.html b/users/templates/users/base.html index 11a7643..86bb513 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -28,6 +28,10 @@ + + + + @@ -315,6 +319,7 @@ + diff --git a/users/templates/users/support.html b/users/templates/users/support.html index 7b80976..751b46b 100644 --- a/users/templates/users/support.html +++ b/users/templates/users/support.html @@ -14,5 +14,12 @@
+ {% endblock content %} diff --git a/users/views.py b/users/views.py index d2001ff..05e347b 100644 --- a/users/views.py +++ b/users/views.py @@ -423,6 +423,7 @@ def GlobalSearch(request): final_results_st.append(tempele) i += 1 ''' + #return JsonResponse({'standards' : final_results_st}) html = render_to_string('users/searchres.html', {'res_standard': res_standard, 'res_areas': res_areas, 'res_tasks': res_tasks, 'res_pers': res_pers}) return HttpResponse(html)