Standards haben ein Uhrzeitfeld bekommen
This commit is contained in:
parent
41af242423
commit
d0169c8cfc
Binary file not shown.
|
|
@ -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),
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
|
|
@ -13,13 +13,13 @@ class News(models.Model):
|
||||||
content = RichTextUploadingField(blank=True, verbose_name='Inhalt')
|
content = RichTextUploadingField(blank=True, verbose_name='Inhalt')
|
||||||
|
|
||||||
created_by = models.ForeignKey(User, on_delete=models.PROTECT)
|
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_online_on = models.DateTimeField(default=datetime.date.today, blank=True)
|
||||||
go_offline_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_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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -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),
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
|
|
@ -16,13 +16,13 @@ class Standards(models.Model):
|
||||||
content = RichTextUploadingField(blank=True, verbose_name='Inhalt')
|
content = RichTextUploadingField(blank=True, verbose_name='Inhalt')
|
||||||
|
|
||||||
created_standard_by = models.ForeignKey(User, on_delete=models.PROTECT)
|
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_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_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)
|
public = models.BooleanField(default=False)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'standard-single' item.pk %}">{{item.name}}</a></td>
|
<td><a href="{% url 'standard-single' item.pk %}">{{item.name}}</a></td>
|
||||||
<td>{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}}</td>
|
<td>{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}}</td>
|
||||||
<td>{{ item.created_standard_date}}</td>
|
<td>{{ item.created_standard_date|date:"d.m.Y, H:i"}}</td>
|
||||||
<td>{{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }}</td>
|
<td>{{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }}</td>
|
||||||
<td>{{ item.last_modified_on }}</td>
|
<td>{{ item.last_modified_on|date:"d.m.Y, H:i"}}</td>
|
||||||
<td>{{item.public|yesno:"Öffentlich,Nicht öffentlich"}}</td>
|
<td>{{item.public|yesno:"Öffentlich,Nicht öffentlich"}}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if item.created_standard_by == user or perms.users.standard_management %}
|
{% if item.created_standard_by == user or perms.users.standard_management %}
|
||||||
|
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
{% extends "users/base.html" %}
|
|
||||||
{% block content %}
|
|
||||||
<div class="content-section col-12">
|
|
||||||
<nav aria-label="breadcrumb">
|
|
||||||
<ol class="breadcrumb">
|
|
||||||
<li class="breadcrumb-item"><a href="{% url 'standards' %}">Standards</a></li>
|
|
||||||
<li class="breadcrumb-item active" aria-current="page"><a href="{% url 'standard-area' areaid %}">{{areaname}}</a></li>
|
|
||||||
</ol>
|
|
||||||
</nav>
|
|
||||||
<h4>Standards aus dem Bereich {{areaname}}</h4>
|
|
||||||
<hr>
|
|
||||||
<div class="row">
|
|
||||||
{% for item in standards_of_agency_area %}
|
|
||||||
{% if item.public or item.created_standard_by == user or perms.users.standard_management %}
|
|
||||||
<div class=" mb-4 col-5">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
|
|
||||||
<a href="{% url 'standard-single' item.pk%}">
|
|
||||||
{% if item.public %}
|
|
||||||
<h4><u>{{item.name}}</u></h4>
|
|
||||||
{% else %}
|
|
||||||
<h4 class="text-warning"><u>{{item.name}}</u></h4>
|
|
||||||
{% endif %}
|
|
||||||
</a>
|
|
||||||
{% if item.created_standard_by == user or perms.users.standard_management %}
|
|
||||||
<div class="dropdown no-arrow">
|
|
||||||
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
||||||
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
|
|
||||||
</a>
|
|
||||||
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
|
|
||||||
<!--<div class="dropdown-header">Benutzerdaten</div>-->
|
|
||||||
<a class="dropdown-item" href="{% url 'standard-update' item.pk %}">Bearbeiten</a>
|
|
||||||
<div class="dropdown-divider"></div>
|
|
||||||
<a class="dropdown-item text-danger" href="{% url 'standard-delete' item.pk %}" >Löschen</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title">{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}} <h6>Zuletzt bearbeitet von {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} am {{ item.last_modified_on }}</h6>
|
|
||||||
</h5>
|
|
||||||
<p class="card-text">{{ item.content|truncatechars:250|safe}}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor%}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
|
||||||
|
|
@ -28,9 +28,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'standard-single' item.pk %}">{{item.name}}</a></td>
|
<td><a href="{% url 'standard-single' item.pk %}">{{item.name}}</a></td>
|
||||||
<td>{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}}</td>
|
<td>{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}}</td>
|
||||||
<td>{{ item.created_standard_date}}</td>
|
<td>{{ item.created_standard_date|date:"d.m.Y, H:i"}}</td>
|
||||||
<td>{{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }}</td>
|
<td>{{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }}</td>
|
||||||
<td>{{ item.last_modified_on }}</td>
|
<td>{{ item.last_modified_on|date:"d.m.Y, H:i"}}</td>
|
||||||
<td>{{item.public|yesno:"Öffentlich,Nicht öffentlich"}}</td>
|
<td>{{item.public|yesno:"Öffentlich,Nicht öffentlich"}}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if item.created_standard_by == user or perms.users.standard_management %}
|
{% if item.created_standard_by == user or perms.users.standard_management %}
|
||||||
|
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
{% extends "users/base.html" %}
|
|
||||||
{% block content %}
|
|
||||||
<div class="content-section col-12">
|
|
||||||
<nav aria-label="breadcrumb">
|
|
||||||
<ol class="breadcrumb">
|
|
||||||
<li class="breadcrumb-item"><a href="{% url 'standards' %}">Standards</a></li>
|
|
||||||
<li class="breadcrumb-item active"><a href="{% url 'standard-area' areaid %}">{{areaname}}</a></li>
|
|
||||||
<li class="breadcrumb-item active" aria-current="page"><a href="{% url 'standard-task' taskid %}">{{taskname}}</a></li>
|
|
||||||
</ol>
|
|
||||||
</nav>
|
|
||||||
<h4>Standards aus dem Aufgabenbereich {{taskname}} des Bereichs {{areaname}}</h4>
|
|
||||||
<hr>
|
|
||||||
<div class="row">
|
|
||||||
{% for item in standards_of_agency_task %}
|
|
||||||
{% if item.public or item.created_standard_by == user or perms.users.standard_management %}
|
|
||||||
<div class=" mb-4 col-5">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
|
|
||||||
<a href="{% url 'standard-single' item.pk%}">
|
|
||||||
{% if item.public %}
|
|
||||||
<h4><u>{{item.name}}</u></h4>
|
|
||||||
{% else %}
|
|
||||||
<h4 class="text-warning"><u>{{item.name}}</u></h4>
|
|
||||||
{% endif %}
|
|
||||||
</a>
|
|
||||||
{% if item.created_standard_by == user or perms.users.standard_management %}
|
|
||||||
<div class="dropdown no-arrow">
|
|
||||||
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
||||||
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
|
|
||||||
</a>
|
|
||||||
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
|
|
||||||
<!--<div class="dropdown-header">Benutzerdaten</div>-->
|
|
||||||
<a class="dropdown-item" href="{% url 'standard-update' item.pk %}">Bearbeiten</a>
|
|
||||||
<div class="dropdown-divider"></div>
|
|
||||||
<a class="dropdown-item text-danger" href="{% url 'standard-delete' item.pk %}" >Löschen</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title">{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}} <h6>Zuletzt bearbeitet von {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} am {{ item.last_modified_on }}</h6>
|
|
||||||
</h5>
|
|
||||||
<p class="card-text">{{ item.content|truncatechars:250|safe}}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor%}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
|
||||||
|
|
@ -67,9 +67,9 @@
|
||||||
{% for standard in standards_of_user %}
|
{% for standard in standards_of_user %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></td>
|
<td><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></td>
|
||||||
<td>{{standard.created_standard_date}}</td>
|
<td>{{standard.created_standard_date|date:"d.m.Y, H:i"}}</td>
|
||||||
<td>{{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}}</td>
|
<td>{{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}}</td>
|
||||||
<td>{{standard.last_modified_on}}</td>
|
<td>{{standard.last_modified_on|date:"d.m.Y, H:i"}}</td>
|
||||||
<td>{{standard.public|yesno:"Öffentlich,Nicht öffentlich"}}</td>
|
<td>{{standard.public|yesno:"Öffentlich,Nicht öffentlich"}}</td>
|
||||||
<td><a href="{% url 'standard-update' standard.pk %}" class="btn"><i class="fas fa-cog"></i></a></td>
|
<td><a href="{% url 'standard-update' standard.pk %}" class="btn"><i class="fas fa-cog"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -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),
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
|
|
@ -22,7 +22,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'news-single' news_single.pk %}">{{news_single.name }}</a></td>
|
<td><a href="{% url 'news-single' news_single.pk %}">{{news_single.name }}</a></td>
|
||||||
<td>{{ news_single.created_by.first_name }} {{ news_single.created_by.last_name }}</td>
|
<td>{{ news_single.created_by.first_name }} {{ news_single.created_by.last_name }}</td>
|
||||||
<td>{{ news_single.created_date }}</td>
|
<td>{{ news_single.created_date|date:"d.m.Y, H:i" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
@ -41,12 +41,10 @@
|
||||||
{% for standard in standards_of_agency %}
|
{% for standard in standards_of_agency %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></td>
|
<td><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></td>
|
||||||
<td>{{standard.created_standard_date}}</td>
|
<td>{{standard.created_standard_date|date:"d.m.Y, H:i"}}</td>
|
||||||
<td>{{standard.created_standard_by.first_name}} {{standard.created_standard_by.last_name}}</td>
|
<td>{{standard.created_standard_by.first_name}} {{standard.created_standard_by.last_name}}</td>
|
||||||
<td><small>{{standard.last_modified_on}}</small></td>
|
<td><small>{{standard.last_modified_on|date:"d.m.Y, H:i"}}</small></td>
|
||||||
<td><small>{{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}}</small></td>
|
<td><small>{{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}}</small></td>
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ def dashboard(request):
|
||||||
# Loading only user same agency
|
# Loading only user same agency
|
||||||
# Change context and return for template-data
|
# Change context and return for template-data
|
||||||
# # Get all Users of the Same Agency as logged user
|
# # 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()
|
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)
|
news = News.objects.filter(agency__pk=request.user.profile.agency.pk).filter(go_online_on__lt=filterdate).filter(go_offline_on__gt=filterdate)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue