Bugs von Basti umgesetzt, rest muss abgesprochen werden
This commit is contained in:
parent
3cb57ff663
commit
90d96927d0
Binary file not shown.
|
|
@ -51,7 +51,7 @@
|
|||
<img class="img-profile" style="width: 15%;" src="{{ imagelink }}">
|
||||
<div class="media-body col-6">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="col-12">
|
||||
<h6><b>Name</b></h6>
|
||||
<p>
|
||||
{{ user_fullname }}
|
||||
|
|
@ -60,7 +60,10 @@
|
|||
<p>
|
||||
{{ mail }}
|
||||
</p>
|
||||
<div style="float: left">
|
||||
<a type="button" class="btn-primary btn-sm active" href="{% url 'changeusermaindata' vieweduser %}">Stammdaten ändern</a>
|
||||
<button type="button" id="" onclick="javascript:sendPassMail({{vieweduser}})" class="btn-primary btn-sm active mt-2">E-Mail mit Link zur Passworterstellung senden</button> <span class="alert alert-success" id="mailsend" role="alert" style="display: none;"> E-Mail gesendet!</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -218,6 +221,23 @@ function removeUserFromGroup(userid, groupid){
|
|||
});
|
||||
}
|
||||
|
||||
//Call Function in view to send e-mail with pass-reset-data
|
||||
function sendPassMail(id){
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: "/dashboard/sendpassmail",
|
||||
data:{
|
||||
userid : id
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
if(data["message"] == 0){
|
||||
$("#mailsend").fadeIn().delay(4000).fadeOut();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addUserToGroup(userid, groupid){
|
||||
$.ajax(
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from users.models import AgencyJob, AgencyGroup
|
|||
from django.contrib.auth.models import User, Group, Permission
|
||||
import random
|
||||
import string
|
||||
from django.template.loader import render_to_string
|
||||
from users.usersforms import UsersPermForm
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.views.generic import CreateView
|
||||
|
|
@ -19,6 +20,7 @@ from tasks.models import Tasks
|
|||
import webcolors
|
||||
from datetime import datetime
|
||||
from standards.models import Standards
|
||||
from django.core.mail import send_mail
|
||||
|
||||
def randomString(stringLength=10):
|
||||
"""Generate a random string of fixed length """
|
||||
|
|
@ -523,7 +525,8 @@ def NewUserFirstStep(request):
|
|||
if request.method == 'POST':
|
||||
newuserform = UserNewUserForm(request.POST)
|
||||
if newuserform.is_valid():
|
||||
if(request.POST.get("sendmailnewuser")):
|
||||
if(request.POST.get("sendmailnewuser")):
|
||||
msg_html = render_to_string('users/register_mail.html', {'username': newuserform.cleaned_data.get('first_name') + " " + newuserform.cleaned_data.get('last_name')})
|
||||
send_mail(
|
||||
request.user.profile.agency.name + ' Account',
|
||||
'Hallo ' + newuserform.cleaned_data.get('first_name') + ' ' + newuserform.cleaned_data.get('last_name') + '! Bitte setzen sie sich auf https://digitale-agentur.com/password-reset/ ein Passwort.',
|
||||
|
|
|
|||
|
|
@ -1,13 +1,18 @@
|
|||
{% extends "users/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
{% if request.user.profile.agency.module_news %}
|
||||
<div class="content-section col-6">
|
||||
|
||||
|
||||
<h3>News anlegen</h3>
|
||||
<hr>
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
{{normalForm.media}}
|
||||
<link href="{% static 'users/css/datepicker.css' %}" type="text/css" media="all" rel="stylesheet">
|
||||
<script type="text/javascript" src="{% static 'users/js/datepicker.js' %}"></script>
|
||||
{{normalForm|crispy}}
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-success" href="{% url 'news-add' %} ">News speichern</button>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -19,7 +19,7 @@ class StandardAddStandard(forms.ModelForm):
|
|||
labels = {
|
||||
"name" : "Titel",
|
||||
"area" : "Übergeordneter Bereich",
|
||||
"task" : "Aufgabenbereich",
|
||||
"task" : "Tätigkeitsbereich",
|
||||
"content": "Inhalt",
|
||||
"public" : "Direkt veröffentlichen?",
|
||||
"representative" : "Vertreter",
|
||||
|
|
@ -81,7 +81,7 @@ class StandardUpdateStandard(forms.ModelForm):
|
|||
labels = {
|
||||
"name" : "Titel",
|
||||
"area" : "Übergeordneter Bereich",
|
||||
"task" : "Aufgabenbereich",
|
||||
"task" : "Tätigkeitsbereich",
|
||||
"content": "Inhalt",
|
||||
"representative" : "Vertreter",
|
||||
"executor" : "Ausführender",
|
||||
|
|
|
|||
|
|
@ -102,8 +102,5 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% for g in standard.visibleby.all %}
|
||||
{{g.agencygroupname}}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
|
@ -23,7 +23,7 @@ class StandardsManagement(LoginRequiredMixin, ListView):
|
|||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
# # Get all Users of the Same Agency as logged user
|
||||
areas = Areas.objects.filter(agency__pk=self.request.user.profile.agency.pk)
|
||||
areas = Areas.objects.filter(agency__pk=self.request.user.profile.agency.pk).order_by("areaorder")
|
||||
standards_of_user = Standards.objects.filter(agency__pk=self.request.user.profile.agency.pk, created_standard_by=self.request.user.pk)
|
||||
standards_of_agency = Standards.objects.filter(agency__pk=self.request.user.profile.agency.pk, public=True)
|
||||
unpubstandards_of_user = Standards.objects.filter(agency__pk=self.request.user.profile.agency.pk, public=False)
|
||||
|
|
@ -100,20 +100,36 @@ def StandardAdd(request):
|
|||
# GROUPS
|
||||
new_standard.save()
|
||||
|
||||
|
||||
'''
|
||||
|
||||
HIER WEITER MACHEN: Gruppen, Dateien und Files werden nicht gespeichert, Länge des übergebenen
|
||||
Arrays ist komisch, da Strings ankommen und es umgebaut werden muss. Wenn das Array aber LEER
|
||||
ist, gibt es '' zurück und das ist komisch...
|
||||
|
||||
|
||||
'''
|
||||
|
||||
# ADD GROUPS
|
||||
groups = normalForm.cleaned_data['checked_groups'].split(",")
|
||||
|
||||
|
||||
for g in groups:
|
||||
new_standard.visibleby.add(AgencyGroup.objects.get(pk=g))
|
||||
if(g.isdigit()):
|
||||
new_standard.visibleby.add(AgencyGroup.objects.get(pk=g))
|
||||
|
||||
# ADD STANDARDS
|
||||
standards = normalForm.cleaned_data['added_standards'].split(",")
|
||||
for s in standards:
|
||||
new_standard.linked_standards.add(Standards.objects.get(pk=s))
|
||||
if(s.isdigit()):
|
||||
new_standard.linked_standards.add(Standards.objects.get(pk=s))
|
||||
|
||||
# ADD FILES
|
||||
files = normalForm.cleaned_data['added_files'].split(",")
|
||||
|
||||
for f in files:
|
||||
new_standard.addedfiles.add(DataFile.objects.get(pk=f))
|
||||
if(f.isdigit()):
|
||||
new_standard.addedfiles.add(DataFile.objects.get(pk=f))
|
||||
|
||||
tempstandardname = normalForm.cleaned_data['name']
|
||||
if(new_standard.public and request.user.has_perm('users.standardmanager')):
|
||||
|
|
|
|||
|
|
@ -0,0 +1,121 @@
|
|||
@font-face {
|
||||
font-family: 'Glyphicons Halflings';
|
||||
src: url('//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/fonts/glyphicons-halflings-regular.eot');
|
||||
src: url('//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
|
||||
url('//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/fonts/glyphicons-halflings-regular.woff2') format('woff2'),
|
||||
url('//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/fonts/glyphicons-halflings-regular.woff') format('woff'),
|
||||
url('//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
|
||||
url('//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
|
||||
}
|
||||
|
||||
.glyphicon {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
display: inline-block;
|
||||
font-family: 'Glyphicons Halflings';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.glyphicon-time:before {
|
||||
content: "\e023";
|
||||
}
|
||||
|
||||
.glyphicon-chevron-left:before {
|
||||
content: "\e079";
|
||||
}
|
||||
|
||||
.glyphicon-chevron-right:before {
|
||||
content: "\e080";
|
||||
}
|
||||
|
||||
.glyphicon-chevron-up:before {
|
||||
content: "\e113";
|
||||
}
|
||||
|
||||
.glyphicon-chevron-down:before {
|
||||
content: "\e114";
|
||||
}
|
||||
|
||||
.glyphicon-calendar:before {
|
||||
content: "\e109";
|
||||
}
|
||||
|
||||
.glyphicon-screenshot:before {
|
||||
content: "\e087";
|
||||
}
|
||||
|
||||
.glyphicon-trash:before {
|
||||
content: "\e020";
|
||||
}
|
||||
|
||||
.glyphicon-remove:before {
|
||||
content: "\e014";
|
||||
}
|
||||
|
||||
.bootstrap-datetimepicker-widget .btn {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
margin-bottom: 0;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
line-height: 1.42857143;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-image: none;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.bootstrap-datetimepicker-widget.dropdown-menu {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
float: left;
|
||||
min-width: 160px;
|
||||
padding: 5px 0;
|
||||
margin: 2px 0 0;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #fff;
|
||||
-webkit-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0, 0, 0, .15);
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
|
||||
}
|
||||
|
||||
.bootstrap-datetimepicker-widget .list-unstyled {
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.bootstrap-datetimepicker-widget .collapse {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.bootstrap-datetimepicker-widget .collapse.in {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* fix for bootstrap4 */
|
||||
.bootstrap-datetimepicker-widget .table-condensed > thead > tr > th,
|
||||
.bootstrap-datetimepicker-widget .table-condensed > tbody > tr > td,
|
||||
.bootstrap-datetimepicker-widget .table-condensed > tfoot > tr > td {
|
||||
padding: 5px;
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
jQuery(function ($) {
|
||||
var datepickerDict = {};
|
||||
var isBootstrap4 = $.fn.collapse.Constructor.VERSION.split('.').shift() == "4";
|
||||
function fixMonthEndDate(e, picker) {
|
||||
e.date && picker.val().length && picker.val(e.date.endOf('month').format('YYYY-MM-DD'));
|
||||
}
|
||||
$("[dp_config]:not([disabled])").each(function (i, element) {
|
||||
var $element = $(element), data = {};
|
||||
try {
|
||||
data = JSON.parse($element.attr('dp_config'));
|
||||
}
|
||||
catch (x) { }
|
||||
if (data.id && data.options) {
|
||||
data.$element = $element.datetimepicker(data.options);
|
||||
data.datepickerdata = $element.data("DateTimePicker");
|
||||
datepickerDict[data.id] = data;
|
||||
data.$element.next('.input-group-addon').on('click', function(){
|
||||
data.datepickerdata.show();
|
||||
});
|
||||
if(isBootstrap4){
|
||||
data.$element.on("dp.show", function (e) {
|
||||
$('.collapse.in').addClass('show');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
$.each(datepickerDict, function (id, to_picker) {
|
||||
if (to_picker.linked_to) {
|
||||
var from_picker = datepickerDict[to_picker.linked_to];
|
||||
from_picker.datepickerdata.maxDate(to_picker.datepickerdata.date() || false);
|
||||
to_picker.datepickerdata.minDate(from_picker.datepickerdata.date() || false);
|
||||
from_picker.$element.on("dp.change", function (e) {
|
||||
to_picker.datepickerdata.minDate(e.date || false);
|
||||
});
|
||||
to_picker.$element.on("dp.change", function (e) {
|
||||
if (to_picker.picker_type == 'MONTH') fixMonthEndDate(e, to_picker.$element);
|
||||
from_picker.datepickerdata.maxDate(e.date || false);
|
||||
});
|
||||
if (to_picker.picker_type == 'MONTH') {
|
||||
to_picker.$element.on("dp.hide", function (e) {
|
||||
fixMonthEndDate(e, to_picker.$element);
|
||||
});
|
||||
fixMonthEndDate({ date: to_picker.datepickerdata.date() }, to_picker.$element);
|
||||
}
|
||||
}
|
||||
});
|
||||
if(isBootstrap4) {
|
||||
$('body').on('show.bs.collapse','.bootstrap-datetimepicker-widget .collapse',function(e){
|
||||
$(e.target).addClass('in');
|
||||
});
|
||||
$('body').on('hidden.bs.collapse','.bootstrap-datetimepicker-widget .collapse',function(e){
|
||||
$(e.target).removeClass('in');
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Reference in New Issue