Edit to Sort Names by Second Name && show field for additional cleaning

main
Samuel Zielke 2 years ago
parent 858ac18edd
commit 085b20c092

BIN
.DS_Store vendored

Binary file not shown.

@ -67,7 +67,7 @@
#week { page-break-after: always; }
div#outgoing:not(:first-child) { display: none; }
</style>
<!--@JS-DATA@--><script>const myDATA ={'15.04.24': ['', '5', 'Russisch', '0', ' - 14:30 Uhr', '1', ' - Samuel Zielke', '1', ' - 09:30 Uhr', '1', ' - Peter Dörsam', '4', ' - 14:00 Uhr', '2', ' - Fred Schlöffel', '5', ' - 09:30 Uhr', '2', ' - Friedhelm Schlöffel', '', '', '', '', '', '', '', '', 'Fred Schlöffel', 'Jürgen Zielke', 'Gary George', 'Axel Hahn', 'Samuel Zielke', 'Daniel Zielke', 'Talita Hahn', 'Erwin Gert', 'Jürgen Zielke']}</script>
<!--@JS-DATA@--><script>const myDATA ={'29.04.24': ['', '2', 'Russisch', '0', ' - 14:30 Uhr', '1', ' - Lothar Hoffmann', '1', ' - 09:30 Uhr', '1', ' - Peter Dörsam', '4', ' - 14:00 Uhr', '2', ' - Jürgen Zielke', '5', '', '3', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']}</script>
</head>
@ -673,4 +673,17 @@
</script>
</body>
</html>window.weekdate[weeklistpos]][myIndex];
}
}
myIndex = myIndex + 1;
});
}
setData(myDATA)
</script>
</body>
</html>

@ -0,0 +1,19 @@
# Generated by Django 5.0.4 on 2024-05-02 07:14
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0027_week_info_field'),
]
operations = [
migrations.AddField(
model_name='info',
name='additional_cleaning',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='additional_cleaning_Person', to='main.group'),
),
]

@ -0,0 +1,17 @@
# Generated by Django 5.0.4 on 2024-05-02 07:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0028_info_additional_cleaning'),
]
operations = [
migrations.RemoveField(
model_name='info',
name='additional_cleaning',
),
]

@ -0,0 +1,19 @@
# Generated by Django 5.0.4 on 2024-05-02 07:25
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0029_remove_info_additional_cleaning'),
]
operations = [
migrations.AddField(
model_name='info',
name='additional_cleaning',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='additional_cleaning_Person', to='main.group'),
),
]

@ -96,6 +96,7 @@ class info(models.Model):
week = models.ForeignKey(week, on_delete=models.CASCADE)
gast = models.ForeignKey(group, on_delete=models.CASCADE, related_name="gastPerson", null=True)
cleaning = models.ForeignKey(group, on_delete=models.CASCADE, related_name="CleanPerson", null=True)
additional_cleaning = models.ForeignKey(group, on_delete=models.CASCADE, related_name="additional_cleaning_Person", null=True)
def __str__(self):
return str(self.week)

@ -82,6 +82,17 @@
</select>
</p>
</td>
<td><p class="theme" style="text-align: left">
<b>Zwischen-Reinigung </b>
<span class="info">Gruppe:</span>
<select name="info" id="info">
<option value="0"{% if not info_data.additional_cleaning.id %}selected{% endif %}></option>
{% for i in gruppen_data %}
<option value="{{ i.id }}"{% if info_data.additional_cleaning.id == i.id %}selected{% endif %}>{{ i.Name }}</option>
{% endfor %}
</select>
</p>
</td>
<td><p class="theme" style="text-align: left">
<b>Wocheninfo: </b>
<input type="text" name="week_info" id="week_info" value="{{ week_info|default_if_none:"" }}">

@ -4,6 +4,13 @@ import datetime
from . import models as MainModel
from django.http import JsonResponse
from . import library
from django import template
register = template.Library()
@register.filter
def sort_lower(lst, key_name):
return sorted(lst, key=lambda item: getattr(item, key_name).lower())
def actualMonday():
today = datetime.date.today()
@ -47,7 +54,7 @@ def createApi():
my_list = {}
# Wir wollen 8 Wochen übertragen (Wenn so viele gepflegt sind)
for i in range(0, 8):
for i in range(0, 12):
# Aktuelle Woche abfragen und String generieren
new_actual = actual + datetime.timedelta(weeks=+i)
new_actual = new_actual.strftime("%d.%m.%y")
@ -73,15 +80,15 @@ def createApi():
DatesOfServiceWeek = []
date = str(db_service_weekly.__getattribute__("date_"+str(i)).weekday()) if db_service_weekly.__getattribute__("date_"+str(i)) != None else ""
DatesOfServiceWeek.append(date)
time = " - " + db_service_weekly.__getattribute__("time_"+str(i)).strftime("%H:%M Uhr") if db_service_weekly.__getattribute__("time_"+str(i)) != None else ""
time = " " + db_service_weekly.__getattribute__("time_"+str(i)).strftime("%H:%M Uhr") if db_service_weekly.__getattribute__("time_"+str(i)) != None else ""
DatesOfServiceWeek.append(time)
type = str(db_service_weekly.__getattribute__("type_"+str(i))) if db_service_weekly.__getattribute__("type_"+str(i)) != None else ""
DatesOfServiceWeek.append(str(type))
if db_service_weekly.__getattribute__("speaker_"+str(i)) != None:
name = " - " + str(db_service_weekly.__getattribute__("speaker_"+str(i))) + " " + str(db_service_weekly.__getattribute__("speaker_"+str(i)).name)
name = " " + str(db_service_weekly.__getattribute__("speaker_"+str(i)))[:3] + ". " + str(db_service_weekly.__getattribute__("speaker_"+str(i)).name)
else:
name = ""
DatesOfServiceWeek.append(name)
type = str(db_service_weekly.__getattribute__("type_"+str(i))) if db_service_weekly.__getattribute__("type_"+str(i)) != None else ""
DatesOfServiceWeek.append(str(type))
DatesOfService[i] = DatesOfServiceWeek
@ -93,6 +100,7 @@ def createApi():
str("- " + week.info_field) if week.info_field != "" else "",
str(db_info.get(week=week).gast.Name) if db_info.get(week=week).gast != None else "",
str(db_info.get(week=week).cleaning.Name) if db_info.get(week=week).cleaning != None else "",
str(db_info.get(week=week).additional_cleaning.Name) if db_info.get(week=week).additional_cleaning != None else "",
# PREDIGTDIENST
DatesOfService[1][0], DatesOfService[1][1],
@ -225,7 +233,7 @@ def index(request):
regie_data.stage = persons.get(id=post_regie[4]) if post_regie[4] != "0" else None
regie_data.save()
library.writeToHtml(createApi())
# library.writeToHtml(createApi())
@ -235,7 +243,7 @@ def index(request):
regie_data = MainModel.regie.objects.filter(week__date_of_monday=strDate)[0] if MainModel.regie.objects.filter(week__date_of_monday=strDate).count() > 0 else {}
info_data = MainModel.info.objects.filter(week__date_of_monday=strDate)[0] if MainModel.info.objects.filter(week__date_of_monday=strDate).count() > 0 else {}
gruppen_data = MainModel.group.objects.all()
persons = MainModel.contributors.objects.all()
persons = MainModel.contributors.objects.all().order_by('name')
service_data = MainModel.service.objects.filter(week__date_of_monday=strDate)[0] if MainModel.service.objects.filter(week__date_of_monday=strDate).count() > 0 else {}
return render(request, 'main/index.html', {'actual' : actual,
'error' : error,
@ -258,5 +266,4 @@ def index(request):
'info_data' : info_data,
'gruppen_data' : gruppen_data,
'service_data' : service_data
})
})

Binary file not shown.

@ -77,7 +77,7 @@
<h2 style="color: black; margin-top: 1rem; margin-bottom: -1rem;">
!CONGREGATION_TITLE! - !WEEKSTARTING!#IF !EXCEPTION!# (!EXCEPTION!)#ELSEIF !CONVENTION!# (!EXCEPTION! !NO_MEETING!)#ENDIF#
<br>
<p style="font-size: 0.75rem; color: gray;">Zoom-Versammlung: ID:612 011 9044 / PW: 918 915</p>
<p style="font-size: 0.75rem; color: gray;">Zoom-Versammlung: ID:612 011 9044 / PW: 918 915 -- Zoom-Dienst: ID: 922 886 3912 / PW: 918915</p>
</h2>
</section>
<p style="display: none;">!Service_START!</p>
@ -95,21 +95,21 @@
<table>
<tr>
<td style="width: 2.750rem;"><div class="infobox starttime s">Infos</div></td>
<td><p class="theme" style="text-align: left"><b>Gastfreundschaft </b> <span class="info CustomElem"></p></td>
<td><p class="theme" style="text-align: left"><b>Reinigung </b> <span class="info CustomElem"></p></td>
<td><p class="theme" style="text-align: left"><b>Zoom-Dienst</b> <span class="info">ID: 922 886 3912 / PW: 918915</p></p></td>
<td><p class="theme" style="text-align: left"><b>Gastfreundschaft: </b> <span class="info CustomElem"></p></td>
<td><p class="theme" style="text-align: left"><b>Allgemein-Reinigung: </b> <span class="info CustomElem"></p></td>
<td><p class="theme" style="text-align: left"><b>Zwischen-Reinigung: </b> <span class="info CustomElem"></p></td>
</tr>
<tr>
<td style="width: 2.750rem;"><div class="infobox starttime s">Dienst</div></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><br> <span class="info CustomElem"></span><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><br> <span class="info CustomElem"></span><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><br> <span class="info CustomElem"></span><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><span class="info CustomElem"></span><br><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><span class="info CustomElem"></span><br><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><span class="info CustomElem"></span><br><span class="info CustomElem"></span></p></td>
</tr>
<tr>
<td style="width: 2.750rem;"><div class="infobox starttime s">Dienst</div></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><br> <span class="info CustomElem"></span><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><br> <span class="info CustomElem"></span><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><br> <span class="info CustomElem"></span><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><span class="info CustomElem"></span><br><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><span class="info CustomElem"></span><br><span class="info CustomElem"></span></p></td>
<td><p class="theme" style="text-align: left"><b><span class="CustomElem"></span><span class="CustomElem"></span></b><span class="info CustomElem"></span><br><span class="info CustomElem"></span></p></td>
</tr>
</table>
</div>
@ -157,11 +157,13 @@
<table>
<!--GW Title-->
<tr>
<td>#IF !DURATION!#<div class="infobox duration gw"></div>#ELSE#
<div class="infobox starttime gw"></div>#ENDIF#
<td style="background-color: rgba(101, 97, 100, 1); width: 2.750rem; height: 2.000rem; text-align: center;">
<svg width="66.7%" height="66.7%" viewBox="0 0 1024 1024">
<path d="M1019 295L879 28q-6-12-20-20t-27-8H192q-13 0-27 8t-20 20L5 290q-6 12-5 28t9 26l480 670q8 10 19 10q5 0 10-2.5t9-7.5l488-664q16-23 6-50q-1-3-2-5zm-77-7H771l69-197zM575 64h206l-64 183zm93 224H371L511 86zm-354-31L250 64h199zm367 95L509 844L345 352h336zM437 831L93 352h185zm312-479h185L581 832zM188 82l69 206H79z" fill="#ffffff" />
</svg>
</td>
<td colspan="4">
<p><b><span class="gw">!GW! (!LM_SOURCE!)</span></b></p>
<p><b><span class="gw" style="font-size: 0.85rem;">!GW! (!LM_SOURCE!)</span></b></p>
</td>
</tr>
<!--GW Talk-->
@ -235,11 +237,21 @@
<table>
<!--FM Title-->
<tr>
<td style="width: 2.750rem;">#IF !DURATION!#<div class="infobox duration fm"></div>#ELSE#
<div class="infobox starttime fm"></div>#ENDIF#
<td style="background-color: rgba(199, 137, 9, 1); width: 2.750rem; height: 2.000rem; text-align: center;">
<svg width="75%" height="75%" viewBox="0 0 33.334 100">
<path d="M19.445,41.667l11.11-11.111c2.778-2.778,2.778-2.778,2.778-13.889l-11.111,11.11C19.445,30.556,19.445,30.556,19.445,41.667z" fill="white" />
<path d="M33.334,0L22.223,11.111c-2.777,2.777-2.777,2.777-2.777,13.889l11.11-11.111C33.334,11.111,33.334,11.111,33.334,0z" fill="white" />
<path d="M13.89,41.667c0-11.111,0-11.111-2.778-13.89L0,16.667c0,11.11,0,11.11,2.778,13.889L13.89,41.667z" fill="white" />
<path d="M19.445,58.333l11.11-11.11c2.778-2.778,2.778-2.778,2.778-13.89L22.223,44.444C19.445,47.223,19.445,47.223,19.445,58.333z" fill="white" />
<path d="M13.89,58.333c0-11.11,0-11.11-2.778-13.889L0,33.333c0,11.111,0,11.111,2.778,13.89L13.89,58.333z" fill="white" />
<path d="M19.445,75l11.11-11.111c2.778-2.777,2.778-2.777,2.778-13.889L22.223,61.111C19.445,63.889,19.445,63.889,19.445,75z" fill="white" />
<path d="M13.89,75c0-11.111,0-11.111-2.778-13.889L0,50c0,11.111,0,11.111,2.778,13.889L13.89,75z" fill="white" />
<path d="M13.89,25c0-11.111,0-11.111-2.778-13.889L0,0c0,11.111,0,11.111,2.778,13.889L13.89,25z" fill="white" />
<path d="M16.667,83.333L0,66.667c0,11.11,0,11.11,2.778,13.889L13.89,91.667V100h5.556v-8.333l11.11-11.111c2.778-2.778,2.778-2.778,2.778-13.889L16.667,83.333z" fill="white" />
</svg>
</td>
<td colspan="4">
<p><b><span class="fm">!FM!</span></b></p>
<p><b><span class="fm" style="font-size: 0.85rem;">!FM!</span></b></p>
</td>
</tr>
<!--FM Talk 1-->
@ -345,11 +357,13 @@
<div id="cl">
<table>
<tr>
<td>#IF !DURATION!#<div class="infobox duration cl"></div>#ELSE#
<div class="infobox starttime cl"></div>#ENDIF#
<td style="background-color: rgba(153, 19, 30, 1); width: 2.750rem; height: 2.000rem; text-align: center;">
<svg width="90%" height="90%" viewBox="0 0 100 100">
<path d="m 55.597646,70.013108 -5.940517,18.033439 -4.230019,0 2.745531,-18.056554 7.425005,0.02311 0,0 z m -37.547513,0.887353 6.517105,17.146086 -4.230019,0 -7.780717,-13.954952 5.493631,-3.191134 0,0 z M 64.304242,15.884538 c 0,-2.168944 1.758013,-3.928241 3.928241,-3.928241 0,0 14.891103,-0.0064 15.023372,0 1.738751,0.09117 3.46466,0.739675 4.901633,1.9455 L 100,23.837332 l 0,1.832494 c 0,2.709575 -2.197201,4.905486 -4.905491,4.905486 l -16.792938,0 0,1.421564 6.113879,2.676186 c 0,0 -4.626824,10.388844 -8.018286,18.843744 -4.087477,10.188514 -10.301521,12.493579 -11.416171,12.82746 l 2.199764,21.700997 -4.228734,0 -6.03683,-21.654767 -38.107407,-0.115574 -11.9439587,6.92932 -2.63381,14.841021 -4.23001806500003,0 0,-18.934919 L 6.2384423,62.873186 l 0,-11.045049 c -1.118503,0.895059 -2.367989,1.632166 -3.716355,2.177933 l 0,-12.860848 c 0,-3.77029 1.403585,-7.213119 3.716355,-9.834087 1.516591,-1.718204 3.4222815,-3.083265 5.5809527,-3.957777 1.722057,-0.696014 3.604633,-1.079977 5.575817,-1.079977 l 45.335936,0 9.602938,-8.058095 c -0.453308,0.0565 -0.914321,0.08604 -1.383039,0.08604 -2.49512,0 -4.797617,-0.829567 -6.646805,-2.226731 l 0,-0.190056 0,0 z" fill="white" />
</svg>
</td>
<td colspan="2">
<p><b><span class="cl">!CL!</span></b></p>
<p><b><span class="cl" style="font-size: 0.85rem;">!CL!</span></b></p>
<p class="info">!SONG! !SONG2_NO!#IF !SONG2_NAME!#: !SONG2_NAME!#ENDIF#</p>
</td>
</tr>
@ -628,14 +642,22 @@
</div>
<script>
window.weekdate.push("!WEEKSTARTING!".replace("Woche vom ", ""))
// window.weekdate.push("20.10.2024".replace("Woche vom ", ""))
</script>
<p>!REPEAT_END!</p>
</main>
<script>
const ordner_elements = document.querySelectorAll('.CustomElem');
const weekdays = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag']
const weekdays_comp = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag']
const weekdays = ['Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.', 'So.']
const service_type = ['Zoom', 'Saal', 'Gruppe']
weekdate_i = 0
window.weekdate.forEach((element) => {
window.weekdate[weekdate_i] = element.replace(".20", ".")
weekdate_i = weekdate_i + 1
})
function setData(myDATA){
let weeklistpos = 0;
let myIndex = 0;
@ -643,14 +665,14 @@
if (myIndex == 36){
myIndex = 0;
weeklistpos = weeklistpos + 1;
} else if ([4, 8, 12, 16, 20, 24].includes(myIndex+1) && myDATA[window.weekdate[weeklistpos]][myIndex] != "") {
} else if ([5, 9, 13, 17, 21, 25].includes(myIndex+1) && myDATA[window.weekdate[weeklistpos]][myIndex] != "") {
element.innerHTML = weekdays[myDATA[window.weekdate[weeklistpos]][myIndex]];
}
else if ([6, 10, 14, 18, 22, 26].includes(myIndex+1) && myDATA[window.weekdate[weeklistpos]][myIndex] != "") {
else if ([8, 12, 16, 20, 24, 28].includes(myIndex+1) && myDATA[window.weekdate[weeklistpos]][myIndex] != "") {
element.innerHTML = service_type[myDATA[window.weekdate[weeklistpos]][myIndex]-1];
element.innerHTML = "<b style='color: black'>Ort:</b> " + service_type[myDATA[window.weekdate[weeklistpos]][myIndex]-1];
}
else {
@ -663,13 +685,14 @@
}
const req = new XMLHttpRequest();
req.open("GET", "http://mo.samuelzielke.de/api/", false);
// req.open("GET", "http://localhost:8000/api/", false);
// req.open("GET", "https://mo.samuelzielke.de/api/", false);
req.open("GET", "http://localhost:8000/api/", false);
req.send()
myDATA = JSON.parse(req.response);
setData(myDATA)
</script>
</body>

Loading…
Cancel
Save

Powered by TurnKey Linux.