QS Commit 0.8.3
This commit is contained in:
parent
d8d00279ed
commit
6fc1958626
|
|
@ -40,7 +40,7 @@
|
||||||
<td>{{agn.creator.first_name }} {{agn.creator.last_name }}</td>
|
<td>{{agn.creator.first_name }} {{agn.creator.last_name }}</td>
|
||||||
<td>{{agn.created_on }}</td>
|
<td>{{agn.created_on }}</td>
|
||||||
<td>{{agn.lastactivity}}</td>
|
<td>{{agn.lastactivity}}</td>
|
||||||
<td>{% if is_adminag %} <a href="{% url 'managagn' agn.pk %}"><i class="far fa-eye"></i> {% endif %} {% if outstanding %}<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" title="Es gibt ausstehende Einladung."></i> {% endif %} {{agsum}}{% if is_adminag %}</a>{% endif %}</td>
|
<td>{% if is_adminag %} <a href="{% url 'managagn' agn.pk %}">{% endif %} {% if outstanding %}<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="top" title="Es gibt ausstehende Einladung."></i> {% endif %}{{agsum}}{% if is_adminag %}</a>{% endif %}</td>
|
||||||
<td>{{agn.standards.all|length}}</td>
|
<td>{{agn.standards.all|length}}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if is_adminag %}
|
{% if is_adminag %}
|
||||||
|
|
|
||||||
|
|
@ -685,7 +685,19 @@ def ManageAgInAgn(request, pk):
|
||||||
else:
|
else:
|
||||||
|
|
||||||
network = list(agn)[0]
|
network = list(agn)[0]
|
||||||
allagofagn = network.members.all() | network.sharemembers.all() | network.adminagencys.all()
|
|
||||||
|
allagofagn = []
|
||||||
|
for a in network.members.all():
|
||||||
|
allagofagn.append(a)
|
||||||
|
|
||||||
|
for a in network.sharemembers.all():
|
||||||
|
allagofagn.append(a)
|
||||||
|
|
||||||
|
for a in network.adminagencys.all():
|
||||||
|
allagofagn.append(a)
|
||||||
|
|
||||||
|
print(allagofagn)
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
'active_link' : 'dasettings',
|
'active_link' : 'dasettings',
|
||||||
'agn' : list(agn)[0],
|
'agn' : list(agn)[0],
|
||||||
|
|
@ -738,7 +750,6 @@ def AgencyNetworkAjaxSettings(request):
|
||||||
AgencyNetworkPreperation.objects.get(pk=request.GET['agn_inv']).delete()
|
AgencyNetworkPreperation.objects.get(pk=request.GET['agn_inv']).delete()
|
||||||
success = True
|
success = True
|
||||||
elif request.method == 'GET' and request.GET['action'] == "changeagrights":
|
elif request.method == 'GET' and request.GET['action'] == "changeagrights":
|
||||||
print("UPDATE")
|
|
||||||
agency = Agency.objects.get(pk=request.GET['agency'])
|
agency = Agency.objects.get(pk=request.GET['agency'])
|
||||||
agn = AgencyNetwork.objects.get(pk=request.GET['agnid'])
|
agn = AgencyNetwork.objects.get(pk=request.GET['agnid'])
|
||||||
if(agency != None and agn != None):
|
if(agency != None and agn != None):
|
||||||
|
|
@ -751,8 +762,6 @@ def AgencyNetworkAjaxSettings(request):
|
||||||
agn.sharemembers.add(agency)
|
agn.sharemembers.add(agency)
|
||||||
elif (request.GET['newstatus'] == "2"):
|
elif (request.GET['newstatus'] == "2"):
|
||||||
agn.adminagencys.add(agency)
|
agn.adminagencys.add(agency)
|
||||||
|
|
||||||
|
|
||||||
success = True
|
success = True
|
||||||
else:
|
else:
|
||||||
success = False
|
success = False
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -15,8 +15,8 @@ import os
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
#BASE_URL = "https://digitale-agentur.com/"
|
BASE_URL = "https://digitale-agentur.com/"
|
||||||
BASE_URL = "http://localhost:8000/"
|
#BASE_URL = "http://localhost:8000/"
|
||||||
CRONAPIKEY = "gCddsaz6NOnE9QbXZM5LasdEk122D"
|
CRONAPIKEY = "gCddsaz6NOnE9QbXZM5LasdEk122D"
|
||||||
|
|
||||||
# FOR SUMMERNOTE ORIGIN
|
# FOR SUMMERNOTE ORIGIN
|
||||||
|
|
@ -174,20 +174,13 @@ GRAPPELLI_CLEAN_INPUT_TYPES = False
|
||||||
|
|
||||||
# EMAILs
|
# EMAILs
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
'''
|
|
||||||
EMAIL_HOST = 'smtp.strato.de'
|
EMAIL_HOST = 'smtp.strato.de'
|
||||||
EMAIL_PORT = 587
|
EMAIL_PORT = 587
|
||||||
EMAIL_USE_TLS = True
|
EMAIL_USE_TLS = True
|
||||||
EMAIL_HOST_USER = "support@digitale-agentur.com"
|
EMAIL_HOST_USER = "support@digitale-agentur.com"
|
||||||
EMAIL_HOST_PASSWORD = "aPx9m3!7x3m@8o!t"
|
EMAIL_HOST_PASSWORD = "aPx9m3!7x3m@8o!t"
|
||||||
DEFAULT_FROM_EMAIL = "support@digitale-agentur.com"
|
DEFAULT_FROM_EMAIL = "support@digitale-agentur.com"
|
||||||
'''
|
|
||||||
EMAIL_HOST = 'gymhum.de'
|
|
||||||
EMAIL_PORT = 587
|
|
||||||
EMAIL_USE_TLS = True
|
|
||||||
EMAIL_HOST_USER = "holger.trampe@gymhum.de"
|
|
||||||
EMAIL_HOST_PASSWORD = "Motte2016_!"
|
|
||||||
DEFAULT_FROM_EMAIL = "holger.trampe@gymhum.de"
|
|
||||||
|
|
||||||
|
|
||||||
# FOR DATEPICKER
|
# FOR DATEPICKER
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,12 @@ from cloud.models import DataFile
|
||||||
from users.models import AgencyGroup
|
from users.models import AgencyGroup
|
||||||
import datetime
|
import datetime
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
#from ckeditor_uploader.fields import RichTextUploadingField
|
|
||||||
class StandardCommentRate(models.Model):
|
class StandardCommentRate(models.Model):
|
||||||
standard = models.ForeignKey("Standards", on_delete=models.CASCADE)
|
#standard = models.ForeignKey("Standards", on_delete=models.CASCADE)
|
||||||
rated_by = models.ForeignKey(User, on_delete=models.PROTECT)
|
rated_by = models.ForeignKey(User, on_delete=models.PROTECT)
|
||||||
rate_stats = models.IntegerField(default=0)
|
rate_stats = models.IntegerField(default=0)
|
||||||
oncomment = models.ForeignKey("StandardComments", on_delete=models.PROTECT)
|
oncomment = models.ForeignKey("StandardComments", on_delete=models.CASCADE)
|
||||||
|
|
||||||
class StandardComments(models.Model):
|
class StandardComments(models.Model):
|
||||||
standard = models.ForeignKey("Standards", on_delete=models.CASCADE)
|
standard = models.ForeignKey("Standards", on_delete=models.CASCADE)
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,13 @@
|
||||||
<div class="content-section col-12">
|
<div class="content-section col-12">
|
||||||
<h2>{{standard.name}}
|
<h2>{{standard.name}}
|
||||||
{% checkifsharedstandardinagency request.user.profile.agency standard as isshared %}
|
{% checkifsharedstandardinagency request.user.profile.agency standard as isshared %}
|
||||||
{% if isshared == False %}
|
{% if isshared == False and standard.agency != request.user.profile.agency %}
|
||||||
<span style="float: right">
|
<span style="float: right">
|
||||||
<button style="float: right" class="btn btn-secondary btn-sm ml-2" onclick="javascript:askForCopy()" data-toggle="tooltip" data-placement="top" title="Übernehmen Sie diesen Standard in Ihre Agentur."><small><i class="fas fa-file-import" ></i></small></button>
|
<button style="float: right" class="btn btn-primary ml-2" onclick="javascript:askForCopy()" data-toggle="tooltip" data-placement="top" title="Übernehmen Sie diesen Standard in Ihre Agentur."><!--<small><i class="fas fa-file-import" ></i></small>-->Standard in meine Agentur übernehmen</button>
|
||||||
|
</span>
|
||||||
|
{% elif standard.agency == request.user.profile.agency %}
|
||||||
|
<span style="float: right; padding-top:16px; font-size: 16pt;">
|
||||||
|
<small>Standard ist aus ihrer Agentur</small>
|
||||||
</span>
|
</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span style="float: right; padding-top:16px; font-size: 16pt;">
|
<span style="float: right; padding-top:16px; font-size: 16pt;">
|
||||||
|
|
@ -67,7 +71,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<small>
|
<small>
|
||||||
Erstellt in Agentur <b>{{standard.agency.name}}</b> und zuletzt bearbeitet am {{ standard.last_modified_on}}. Der Standard wurde bereits {{standard.agencynetworkcounter}} mal geteilt.
|
Erstellt in Agentur <b>{{standard.agency.name}}</b> und zuletzt bearbeitet am {{ standard.last_modified_on}}. Der Standard wurde bereits {{standard.agencynetworkcounter}} mal übernommen.
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
@ -77,20 +81,41 @@
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<p><span id="comments_counter">{{comments|length}}</span> <span id="comments_word">{% if comments|length < 2 %} Kommentar {% else %} Kommentare {% endif %}</span></p>
|
<p><span id="comments_counter">{{comments|length}}</span> <span id="comments_word">{% if comments|length < 2 %} Kommentar {% else %} Kommentare {% endif %}</span></p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
{% getifuserdidcomment standard request.user as userdidcomment%}
|
||||||
|
|
||||||
|
{% if userdidcomment == False %}
|
||||||
<input maxlength="199" type="text" class="form-control" id="newcomment" placeholder="Mein Kommentar zum Standard {{standard.name}}">
|
<input maxlength="199" type="text" class="form-control" id="newcomment" placeholder="Mein Kommentar zum Standard {{standard.name}}">
|
||||||
|
{% else %}
|
||||||
|
Sie haben diesen Standard bereits kommentiert.
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" onclick="javascript:newComment()">Kommentieren</button>
|
{% if userdidcomment == False %}
|
||||||
|
<button type="button" id="newcommentbtn" class="btn btn-primary" onclick="javascript:newComment()">Kommentieren</button>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div id="commentsection">
|
<div id="commentsection">
|
||||||
{% for comment in comments %}
|
|
||||||
|
{% for comment in comments %}
|
||||||
|
{% getcommentstat_user comment.pk request.user as cstat %}
|
||||||
|
|
||||||
<div id="comment_{{comment.pk}}">
|
<div id="comment_{{comment.pk}}">
|
||||||
<small>Von {{comment.comment_by.first_name}} {{comment.comment_by.last_name}} am {{comment.last_modified_on|date:"d.m.Y H:i"}}</small><br />
|
<small>Von {{comment.comment_by.first_name}} {{comment.comment_by.last_name}} am {{comment.last_modified_on|date:"d.m.Y H:i"}}</small><br />
|
||||||
{{comment.content}}<br/>
|
{{comment.content}}<br/>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<button type="button" class="btn btn-sm btn-secondary" {% if comment.comment_by == request.user %} disabled="true" {% endif %}><i class="far fa-thumbs-down"></i></button>
|
<button type="button" id="comment_{{comment.pk}}_rate_down" class="btn btn-sm {% if cstat == 0 %} btn-primary {% elif cstat == 'nostat' %} btn-secondary {% endif %}" {% if comment.comment_by == request.user %} disabled="true" {% endif %} onclick="javascript:rateComment({{comment.pk}}, 0)">
|
||||||
<button type="button" class="btn btn-sm btn-secondary" {% if comment.comment_by == request.user %} disabled="true" {% endif %}><i class="far fa-thumbs-up"></i></button>
|
<i class="far fa-thumbs-down"></i>
|
||||||
|
</button>
|
||||||
|
{% getcommentsdown comment.pk as cdown %}
|
||||||
|
{% if cdown > 0 %}{{cdown}} {% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
<button type="button" id="comment_{{comment.pk}}_rate_up" class="btn btn-sm {% if cstat == 1 %} btn-primary {% elif cstat == 'nostat' %} btn-secondary {% endif %}" {% if comment.comment_by == request.user %} disabled="true" {% endif %} onclick="javascript:rateComment({{comment.pk}}, 1)">
|
||||||
|
<i class="far fa-thumbs-up"></i>
|
||||||
|
</button>
|
||||||
|
{% getcommentsup comment.pk as cup %}
|
||||||
|
{% if cup > 0 %}{{cup}}{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% if comment.comment_by == request.user or standard.created_standard_by == request.user or standard.last_modified_by == request.user %}
|
{% if comment.comment_by == request.user or standard.created_standard_by == request.user or standard.last_modified_by == request.user %}
|
||||||
<span style="float: right;">
|
<span style="float: right;">
|
||||||
|
|
@ -159,13 +184,30 @@
|
||||||
$("#comments_word").html("Kommentr")
|
$("#comments_word").html("Kommentr")
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#commentsection").prepend('<div id="comment_'+data["sc_id"]+'"><small>Von '+data['sc_user'] +' am '+data['sc_date'] +'</small><br />'+data['sc_c'] +'<br/><div class="mt-2"><button type="button" class="btn btn-sm btn-secondary" disabled="true"><i class="far fa-thumbs-down"></i></button> <button type="button" class="btn btn-sm btn-secondary" disabled="true"><i class="far fa-thumbs-up"></i></button> <span style="float: right;"><button type="button" class="btn btn-sm btn-secondary" onclick="javascript:delComment('+data['sc_id']+')" ><i class="fa fa-trash"></i></button></span></div><hr></div>');
|
$("#commentsection").prepend('<div id="comment_'+data["sc_id"]+'"><small>Von '+data['sc_user'] +' am '+data['sc_date'] +'</small><br />'+data['sc_c'] +'<br/><div class="mt-2"><button type="button" class="btn btn-sm btn-secondary" disabled="true"><i class="far fa-thumbs-down"></i></button> <button type="button" class="btn btn-sm btn-secondary" disabled="true" ><i class="far fa-thumbs-up"></i></button> <span style="float: right;"><button type="button" class="btn btn-sm btn-secondary" onclick="javascript:delComment('+data['sc_id']+')" ><i class="fa fa-trash"></i></button></span></div><hr></div>');
|
||||||
|
|
||||||
$("#newcomment").val("");
|
$("#newcomment").remove();
|
||||||
|
$("#newcommentbtn").remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var workingid = "";
|
var workingid = "";
|
||||||
|
|
||||||
|
function rateComment(commentid, newstat){
|
||||||
|
$.ajax({
|
||||||
|
url: "{% url 'update_standard_by_ajax_agn' standard.pk %}",
|
||||||
|
data: {
|
||||||
|
action : 'update_comment_rate',
|
||||||
|
id : commentid,
|
||||||
|
newstat : newstat
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function delComment(id){
|
function delComment(id){
|
||||||
workingid = id;
|
workingid = id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
@ -178,11 +220,11 @@
|
||||||
comments_counter = comments_counter - 1;
|
comments_counter = comments_counter - 1;
|
||||||
$("#comments_counter").html(comments_counter);
|
$("#comments_counter").html(comments_counter);
|
||||||
if(comments_counter < 2){
|
if(comments_counter < 2){
|
||||||
$("#comments_word").html("Kommentr")
|
$("#comments_word").html("Kommentar")
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$("#comments_word").html("Kommentr")
|
$("#comments_word").html("Kommentare")
|
||||||
}s
|
}
|
||||||
$("#comment_" + workingid).remove();
|
$("#comment_" + workingid).remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,7 @@
|
||||||
{% ifaginadminagn agn.pk request.user.profile.agency.pk as is_admin %}
|
{% ifaginadminagn agn.pk request.user.profile.agency.pk as is_admin %}
|
||||||
{% ifsharemember agn.pk request.user.profile.agency.pk as is_sharemember %}
|
{% ifsharemember agn.pk request.user.profile.agency.pk as is_sharemember %}
|
||||||
{% ifstandardinagn agn.pk standard.pk as standard_in_agn %}
|
{% ifstandardinagn agn.pk standard.pk as standard_in_agn %}
|
||||||
|
|
||||||
{% if is_admin or is_sharemember %}
|
{% if is_admin or is_sharemember %}
|
||||||
<div class="custom-control custom-checkbox mb-2">
|
<div class="custom-control custom-checkbox mb-2">
|
||||||
<input type="checkbox" class="custom-control-input groupclass" onclick="javascript:standardAgn({{agn.pk}}, this.checked)" name="agn_{{agn.pk}}" id="agn_{{agn.pk}}" {% if standard_in_agn %} checked {% endif %} >
|
<input type="checkbox" class="custom-control-input groupclass" onclick="javascript:standardAgn({{agn.pk}}, this.checked)" name="agn_{{agn.pk}}" id="agn_{{agn.pk}}" {% if standard_in_agn %} checked {% endif %} >
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
||||||
from django import template
|
from django import template
|
||||||
from django.contrib.auth.models import Group, User
|
from django.contrib.auth.models import Group, User
|
||||||
from users.models import AgencyGroup, Agency, AgencyNetwork, AgencyNetworkPreperation
|
from users.models import AgencyGroup, Agency, AgencyNetwork, AgencyNetworkPreperation
|
||||||
from standards.models import Standards
|
from standards.models import Standards, StandardCommentRate, StandardComments
|
||||||
from message.models import Message
|
from message.models import Message
|
||||||
import os
|
import os
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
@ -171,3 +171,47 @@ def checkifsharedstandardinagency(agency, standard):
|
||||||
if len(checkstandard) > 0:
|
if len(checkstandard) > 0:
|
||||||
in_agency = True
|
in_agency = True
|
||||||
return in_agency
|
return in_agency
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def getcommentsdown(comment):
|
||||||
|
|
||||||
|
|
||||||
|
comment_ratings = StandardCommentRate.objects.filter(oncomment_id=comment)
|
||||||
|
counter_down = len(StandardCommentRate.objects.filter(oncomment=comment, rate_stats=0))
|
||||||
|
|
||||||
|
return counter_down
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def getcommentsup(comment):
|
||||||
|
comment_ratings = StandardCommentRate.objects.filter(oncomment_id=comment)
|
||||||
|
counter_up = len(StandardCommentRate.objects.filter(oncomment=comment, rate_stats=1))
|
||||||
|
|
||||||
|
return counter_up
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def getcommentstat_user(comment, user):
|
||||||
|
|
||||||
|
|
||||||
|
comment_rating = list(StandardCommentRate.objects.filter(oncomment_id=comment, rated_by=user))
|
||||||
|
|
||||||
|
stat = "nostat"
|
||||||
|
|
||||||
|
if len(comment_rating) == 1:
|
||||||
|
stat = comment_rating[0].rate_stats
|
||||||
|
|
||||||
|
return stat
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def getifuserdidcomment(standard, user):
|
||||||
|
comment = list(StandardComments.objects.filter(standard=standard, comment_by=user))
|
||||||
|
|
||||||
|
didcomment = False
|
||||||
|
|
||||||
|
if len(comment) > 0:
|
||||||
|
didcomment = True
|
||||||
|
|
||||||
|
return didcomment
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from django.shortcuts import render, redirect
|
||||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.views.generic import CreateView, ListView, UpdateView, DetailView, DeleteView, View
|
from django.views.generic import CreateView, ListView, UpdateView, DetailView, DeleteView, View
|
||||||
from .models import Standards, StandardComments
|
from .models import Standards, StandardComments, StandardCommentRate
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.http import HttpResponse, JsonResponse
|
from django.http import HttpResponse, JsonResponse
|
||||||
from .forms import StandardAddStandard, StandardAddStandardEditor, StandardUpdateStandard, StandardUpdateStandardEditor
|
from .forms import StandardAddStandard, StandardAddStandardEditor, StandardUpdateStandard, StandardUpdateStandardEditor
|
||||||
|
|
@ -515,10 +515,7 @@ def updatesbyajax(request, pk):
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def StandardFromAgn(request, pk):
|
def StandardFromAgn(request, pk):
|
||||||
|
|
||||||
agn = AgencyNetwork.objects.get(pk=pk)
|
agn = AgencyNetwork.objects.get(pk=pk)
|
||||||
|
|
||||||
print(agn.standards.all())
|
|
||||||
context = {
|
context = {
|
||||||
'active_link':'standards',
|
'active_link':'standards',
|
||||||
'standards_of_agency_network' : agn.standards.all(),
|
'standards_of_agency_network' : agn.standards.all(),
|
||||||
|
|
@ -551,6 +548,25 @@ def updatesbyajax_agn(request, pk):
|
||||||
elif(request.GET["action"] == "del_comment"):
|
elif(request.GET["action"] == "del_comment"):
|
||||||
StandardComments.objects.get(pk=request.GET.get("id")).delete()
|
StandardComments.objects.get(pk=request.GET.get("id")).delete()
|
||||||
return JsonResponse({})
|
return JsonResponse({})
|
||||||
|
elif(request.GET["action"] == "update_comment_rate"):
|
||||||
|
|
||||||
|
user = request.user
|
||||||
|
comment = StandardComments.objects.get(pk=request.GET.get("id"))
|
||||||
|
|
||||||
|
rate = list(StandardCommentRate.objects.filter(oncomment=comment, rated_by=request.user))
|
||||||
|
|
||||||
|
if len(rate) == 0:
|
||||||
|
new_s_c_rate = StandardCommentRate(oncomment=comment, rated_by=request.user, rate_stats=request.GET.get("newstat"))
|
||||||
|
new_s_c_rate.save()
|
||||||
|
else:
|
||||||
|
s_c_rate = StandardCommentRate.objects.get(pk=rate[0].pk)
|
||||||
|
s_c_rate.rate_stats=request.GET.get("newstat")
|
||||||
|
s_c_rate.save()
|
||||||
|
|
||||||
|
counter_up = len(StandardCommentRate.objects.filter(oncomment=comment, rate_stats=1))
|
||||||
|
counter_down = len(StandardCommentRate.objects.filter(oncomment=comment, rate_stats=0))
|
||||||
|
|
||||||
|
return JsonResponse({"up" : counter_up, "down" : counter_down})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from .models import Profile, Agency, AgencyGroup, AgencyJob, AgencyNetwork, AgencyNetworkPreperation
|
from .models import Profile, Agency, AgencyGroup, AgencyJob, AgencyNetwork, AgencyNetworkPreperation
|
||||||
from .priomodel import Prio
|
from .priomodel import Prio
|
||||||
|
from standards.models import StandardCommentRate, StandardComments
|
||||||
from django.contrib.auth.models import Permission
|
from django.contrib.auth.models import Permission
|
||||||
from message.models import Message
|
from message.models import Message
|
||||||
|
|
||||||
|
admin.site.register(StandardComments)
|
||||||
|
admin.site.register(StandardCommentRate)
|
||||||
admin.site.register(Permission)
|
admin.site.register(Permission)
|
||||||
admin.site.register(Profile)
|
admin.site.register(Profile)
|
||||||
admin.site.register(Agency)
|
admin.site.register(Agency)
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@
|
||||||
<a style="color: #999; text-decoration: none;" href="{% url 'impressumda' %}">Impressum</a>
|
<a style="color: #999; text-decoration: none;" href="{% url 'impressumda' %}">Impressum</a>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 10px; margin-bottom: 5px;" class="sidebar-heading">
|
<div style="margin-top: 10px; margin-bottom: 5px;" class="sidebar-heading">
|
||||||
Version 0.8.2
|
Version 0.8.3
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
<!-- Divider -->
|
<!-- Divider -->
|
||||||
<hr class="sidebar-divider my-0">
|
<hr class="sidebar-divider my-0">
|
||||||
<div style="bottom: 10px; position: absolute;" class="sidebar-heading">
|
<div style="bottom: 10px; position: absolute;" class="sidebar-heading">
|
||||||
Version 0.8.2
|
Version 0.8.3
|
||||||
</div>
|
</div>
|
||||||
<div style="bottom: 40px; position: absolute;" class="sidebar-heading">
|
<div style="bottom: 40px; position: absolute;" class="sidebar-heading">
|
||||||
<a style="color: #999; text-decoration: none;" href="{% url 'datenschutzda' %}">Datenschutz</a><br />
|
<a style="color: #999; text-decoration: none;" href="{% url 'datenschutzda' %}">Datenschutz</a><br />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue