-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Initial commit: Using solidarity shifts from the pool and removing used solidarity shifts not yet implemented * #447 Option to give and receive Solidarity Shifts added * Solidarity checkbox not required anymore, Behavior of use solidarity button changed slightly * Solidarity shifts can be given subsequently now * New template with statistics regarding Solidarity Shifts added * Bugfix: Changed the starting month for the charts in solidarity_shifts_overview.html to Nov 2023 instead of the current month * Chart Available Solidarity Shifts removed from Solidarity Shifts Statistics * Solidarity shift checkbox adjusted + minor code improvements * 447 Possibility to give and receive Solidarity Shifts added Solidarity checkbox not required anymore, Behavior of use solidarity button changed slightly Poetry up Solidarity shifts can be given subsequently now Feature Solidarity Shifts added Bugfix: Changed the starting month for the charts in solidarity_shifts_overview.html to Nov 2023 instead of the current month Chart Available Solidarity Shifts removed from Solidarity Shifts Statistics Solidarity shift checkbox adjusted + minor code improvements * Code improvements #447
- Loading branch information
1 parent
e215737
commit dc20a19
Showing
15 changed files
with
443 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
AdressID;Nachname;Vorname;RabattN;Strasse;PLZ;Ort;eMail | ||
2200000000016;Takala;Milja;0;Tehtaankatu 7436;49219;Kouvola;[email protected] | ||
2200000000001;Cortes;TEST;18;Calle de La Almudena 7710;65621;Torrejón de Ardoz;[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tapir/shifts/migrations/0049_shiftattendance_is_solidarity.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.22 on 2023-11-05 18:01 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("shifts", "0048_auto_20231021_2102"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="shiftattendance", | ||
name="is_solidarity", | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
tapir/shifts/migrations/0050_remove_shiftattendance_is_solidarity.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 3.2.22 on 2023-11-05 18:04 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("shifts", "0049_shiftattendance_is_solidarity"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="shiftattendance", | ||
name="is_solidarity", | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
tapir/shifts/migrations/0051_shiftattendance_is_solidarity.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.22 on 2023-11-06 09:13 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("shifts", "0050_remove_shiftattendance_is_solidarity"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="shiftattendance", | ||
name="is_solidarity", | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 3.2.22 on 2023-11-07 13:35 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("shifts", "0051_shiftattendance_is_solidarity"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="SolidarityShift", | ||
fields=[ | ||
( | ||
"shiftAttendance", | ||
models.OneToOneField( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
primary_key=True, | ||
serialize=False, | ||
to="shifts.shiftattendance", | ||
), | ||
), | ||
("is_used_up", models.BooleanField(default=False)), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 3.2.23 on 2023-11-16 10:30 | ||
|
||
import datetime | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("shifts", "0052_solidarityshift"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="solidarityshift", | ||
name="date_gifted", | ||
field=models.DateField( | ||
auto_now_add=True, | ||
default=datetime.datetime(2023, 11, 16, 11, 30, 14, 216680), | ||
), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name="solidarityshift", | ||
name="date_used", | ||
field=models.DateField(null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
tapir/shifts/templates/shifts/solidarity_shifts_overview.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{% extends "shifts/base.html" %} | ||
|
||
{% load i18n %} | ||
{% load core %} | ||
{% load static %} | ||
|
||
{% block head %} | ||
<script src="{% static 'statistics/chart_4.4.0.js' %}"></script> | ||
<script src="{% static 'statistics/tapir_charts.js' %}" defer></script> | ||
{% endblock head %} | ||
|
||
{% block content %} | ||
<div class="row"> | ||
<div class="col-xl-6"> | ||
<div class="card mb-2"> | ||
<h5 class="card-header d-flex justify-content-between align-items-center"> | ||
{% translate "Available" %} | ||
</h5> | ||
<div class="card-body"> | ||
{% if available_solidarity_shifts == 1 %} | ||
<p>There is {{ available_solidarity_shifts }} solidarity shift available at the moment</p> | ||
{% else %} | ||
<p>There are {{ available_solidarity_shifts }} solidarity shifts available at the moment</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-xl-6"> | ||
<div class="card mb-2"> | ||
<h5 class="card-header d-flex justify-content-between align-items-center"> | ||
{% translate "Used" %} | ||
</h5> | ||
<div class="card-body"> | ||
{% if used_solidarity_shifts_total == 1 %} | ||
<p>{{ used_solidarity_shifts_total }} solidarity shift has been used in total</p> | ||
{% else %} | ||
<p>{{ used_solidarity_shifts_total }} solidarity shifts have been used in total</p> | ||
{% endif %} | ||
<span class="{% tapir_button_link %}" | ||
onclick="chartManager.show_stats_chart( | ||
this, | ||
'{% url "shifts:used_solidarity_shifts_json" %}', | ||
'used_solidarity_shifts_canvas', | ||
)"> | ||
<span class="material-icons">leaderboard</span> | ||
<span class="button-text">{% translate "Show graph: " %}{% translate "Solidarity shifts used" %}</span> | ||
</span> | ||
<canvas id="used_solidarity_shifts_canvas" style="display: none;"></canvas> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xl-6"> | ||
<div class="card mb-2"> | ||
<h5 class="card-header d-flex justify-content-between align-items-center"> | ||
{% translate "Gifted" %} | ||
</h5> | ||
<div class="card-body"> | ||
{% if gifted_solidarity_shifts_total == 1 %} | ||
<p>{{ gifted_solidarity_shifts_total }} solidarity shift has been gifted in total</p> | ||
{% else %} | ||
<p>{{ gifted_solidarity_shifts_total }} solidarity shifts have been gifted in total</p> | ||
{% endif %} | ||
<span class="{% tapir_button_link %}" | ||
onclick="chartManager.show_stats_chart( | ||
this, | ||
'{% url "shifts:gifted_solidarity_shifts_json" %}', | ||
'gifted_solidarity_shifts_canvas', | ||
)"> | ||
<span class="material-icons">leaderboard</span> | ||
<span class="button-text">{% translate "Show graph: " %}{% translate "Solidarity shifts gifted" %}</span> | ||
</span> | ||
<canvas id="gifted_solidarity_shifts_canvas" style="display: none;"></canvas> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.