Skip to content

Commit

Permalink
Merge branch 'master' into react
Browse files Browse the repository at this point in the history
  • Loading branch information
Theophile-Madet committed Oct 18, 2024
2 parents e0536ff + 7326718 commit 7c2835a
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 197 deletions.
53 changes: 26 additions & 27 deletions tapir/coop/templates/coop/draftuser_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
{% endblock head %}
{% block content %}
<div class="card mb-2">
<div class="card-header d-flex justify-content-between align-items-center">
<div class="card-header d-flex flex-wrap justify-content-between align-items-center">
<h5>{% translate "Applicants" %}</h5>
<div class="btn-group">
<button type="button"
class="{% tapir_button_link %} btn dropdown-toggle m-1"
class="{% tapir_button_link %} dropdown-toggle m-1"
data-bs-toggle="dropdown">{% translate "Export" %}</button>
<div class="dropdown-menu dropdown-menu-right">
{% for format in view.export_formats %}
Expand All @@ -45,34 +45,33 @@ <h5>{% translate "Applicants" %}</h5>
</div>
</div>
</div>
{% if filter %}
<div class="collapse" id="collapseFilter">
<ul class="list-group list-group-flush">
<li class="list-group-item">
<form action="" method="get" class="form member-filter-form">
<div class="member-filter-form-filters">{% bootstrap_form filter.form %}</div>
<div class="member-filter-form-buttons">
<button class=" {% tapir_button_link %}">
<span class="material-icons">filter_alt</span>{% translate 'Filter' %}
</button>
<a class="{% tapir_button_link %}"
href="{% url 'coop:draftuser_list' %}">
<span class="material-icons">clear</span>
{% translate "Clear all filters" %}
</a>
<div class="ms-2">
{% blocktranslate with filtered=filtered_draftuser_count total=total_draftuser_count %}
<ul class="list-group list-group-flush">
{% if filter %}
<li class="list-group-item collapse" id="collapseFilter">
<form action="" method="get" class="form member-filter-form">
<div class="member-filter-form-filters">{% bootstrap_form filter.form %}</div>
<div class="member-filter-form-buttons">
<button class=" {% tapir_button_link %}">
<span class="material-icons">filter_alt</span>{% translate 'Filter' %}
</button>
<a class="{% tapir_button_link %}"
href="{% url 'coop:draftuser_list' %}">
<span class="material-icons">clear</span>
{% translate "Clear all filters" %}
</a>
<div class="ms-2">
{% blocktranslate with filtered=filtered_draftuser_count total=total_draftuser_count %}
Filtered {{ filtered }} of {{ total }}
{% endblocktranslate %}
</div>
</div>
</form>
</li>
</ul>
</div>
{% endif %}
<ul>
<li class="list-group-item">{% render_table table %}</li>
</div>
</form>
</li>
{% endif %}
<li class="list-group-item table-responsive"
style="padding-left: 0px;
padding-right: 0px;
padding-top: 0px">{% render_table table %}</li>
</ul>
</div>
{% endblock content %}
65 changes: 37 additions & 28 deletions tapir/coop/templates/coop/membership_resignation_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,53 @@
<div class="card mb-2">
<div class="card-header d-flex justify-content-between align-items-center">
<h5>{% translate "List of resigned members" %} ({{ total_of_resigned_members }})</h5>
<div>
<div class="btn-group">
<button type="button"
class="{% tapir_button_link %} btn dropdown-toggle"
data-bs-toggle="dropdown">{% translate "Export" %}</button>
<div class="dropdown-menu dropdown-menu-right">
{% for format in view.export_formats %}
<a class="dropdown-item" href="{% export_url format %}">
download <code>.{{ format }}</code>
</a>
{% endfor %}
</div>
<div class="d-flex flex-wrap gap-2 justify-content-end">
<button type="button"
class="{% tapir_button_link %} btn dropdown-toggle"
data-bs-toggle="dropdown">{% translate "Export" %}</button>
<div class="dropdown-menu dropdown-menu-right">
{% for format in view.export_formats %}
<a class="dropdown-item" href="{% export_url format %}">
download <code>.{{ format }}</code>
</a>
{% endfor %}
</div>
<a class="{% tapir_button_link_to_action %}"
href="{% url 'coop:resign_new_membership' %}">
<span class="material-icons">add_circle_outline</span>
{% translate "Resign new member" %}
</a>
<button class="{% tapir_button_link_to_action %}"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseFilter"
aria-expanded="false"
aria-controls="collapseFilter">
{% translate "Filters" %}
<span class="material-icons">unfold_more</span>
</button>
</div>
</div>
<br>
<form method="get">
<div class="px-3 mt-1">
<div class="member-filter-form-filters">{% bootstrap_form filter.form %}</div>
<div class="member-filter-form-buttons">
<button class="{% tapir_button_link %}">
<span class="material-icons">filter_alt</span>{% translate 'Filter' %}
</button>
<a class="{% tapir_button_link %}"
href="{% url 'coop:resigned_members_list' %}">
<span class="material-icons">clear</span>
{% translate "Clear all filters" %}
</a>
<div class="collapse" id="collapseFilter">
<form method="get">
<div class="px-3 mt-1">
<div class="member-filter-form-filters">{% bootstrap_form filter.form %}</div>
<div class="member-filter-form-buttons">
<button class="{% tapir_button_link %}">
<span class="material-icons">filter_alt</span>{% translate 'Filter' %}
</button>
<a class="{% tapir_button_link %}"
href="{% url 'coop:resigned_members_list' %}">
<span class="material-icons">clear</span>
{% translate "Clear all filters" %}
</a>
</div>
</div>
</div>
</form>
<ul>
<li class="list-group-item">{% render_table table %}</li>
</form>
</div>
<ul style="padding: 0px">
<li class="list-group-item table-responsive">{% render_table table %}</li>
</ul>
</div>
{% endblock content %}
53 changes: 26 additions & 27 deletions tapir/coop/templates/coop/shareowner_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
{% endblock head %}
{% block content %}
<div class="card mb-2">
<div class="card-header d-flex justify-content-between">
<div class="card-header d-flex justify-content-between align-items-center">
<h5>{% translate "Cooperative Members" %}</h5>
<div class="btn-group">
<button type="button"
class="{% tapir_button_link %} btn-sm dropdown-toggle m-1"
class="{% tapir_button_link %} dropdown-toggle m-1"
data-bs-toggle="dropdown">{% translate "Export" %}</button>
<div class="dropdown-menu dropdown-menu-right">
{% for format in view.export_formats %}
Expand All @@ -41,34 +41,33 @@ <h5>{% translate "Cooperative Members" %}</h5>
</div>
</div>
</div>
{% if filter %}
<div class="collapse" id="collapseFilter">
<ul class="list-group list-group-flush" id="share_owner_table">
<li class="list-group-item">
<form action="" method="get" class="form member-filter-form">
<div class="member-filter-form-filters">{% bootstrap_form filter.form %}</div>
<div class="member-filter-form-buttons">
<button class="{% tapir_button_link %}">
<span class="material-icons">filter_alt</span>{% translate 'Filter' %}
</button>
<a class="{% tapir_button_link %}"
href="{% url 'coop:shareowner_list' %}">
<span class="material-icons">clear</span>
{% translate "Clear all filters" %}
</a>
<div class="ms-2">
{% blocktranslate %}
<ul class="list-group list-group-flush" id="share_owner_table">
{% if filter %}
<li class="list-group-item collapse" id="collapseFilter">
<form action="" method="get" class="form member-filter-form">
<div class="member-filter-form-filters">{% bootstrap_form filter.form %}</div>
<div class="member-filter-form-buttons">
<button class="{% tapir_button_link %}">
<span class="material-icons">filter_alt</span>{% translate 'Filter' %}
</button>
<a class="{% tapir_button_link %}"
href="{% url 'coop:shareowner_list' %}">
<span class="material-icons">clear</span>
{% translate "Clear all filters" %}
</a>
<div class="ms-2">
{% blocktranslate %}
Filtered {{ filtered_member_count }} of {{ total_member_count }}
{% endblocktranslate %}
</div>
</div>
</form>
</li>
</ul>
</div>
{% endif %}
<ul>
<li class="list-group-item">{% render_table table %}</li>
</div>
</form>
</li>
{% endif %}
<li class="list-group-item table-responsive"
style="padding-left: 0px;
padding-right: 0px;
padding-top: 0px">{% render_table table %}</li>
</ul>
</div>
{% endblock content %}
8 changes: 3 additions & 5 deletions tapir/coop/views/membership_resignation.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,15 @@ class Meta:
empty_text = "No entries"
default = "No entries"

cancellation_reason = django_tables2.Column(
attrs={"td": {"class": "col-3 text-break"}}
)
cancellation_reason = django_tables2.Column(attrs={"td": {"class": "col-3"}})
pay_out_day = django_tables2.DateColumn(
format="d/m/Y",
verbose_name="Membership ends",
default="",
attrs={"td": {"class": "col-2 text-break"}},
attrs={"td": {"class": "col-2"}},
)
paid_out = django_tables2.Column(
attrs={"td": {"class": "col-2 text-break"}},
attrs={"td": {"class": "col-2"}},
)
add_buttons = django_tables2.Column(
empty_values=(),
Expand Down
9 changes: 6 additions & 3 deletions tapir/coop/views/shareowner.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
UpdateShareOwnershipLogEntry,
ExtraSharesForAccountingRecap,
)
from tapir.coop.services.InvestingStatusService import InvestingStatusService
from tapir.coop.services.MembershipPauseService import MembershipPauseService
from tapir.coop.services.NumberOfSharesService import NumberOfSharesService
from tapir.core.config import TAPIR_TABLE_CLASSES, TAPIR_TABLE_TEMPLATE
Expand Down Expand Up @@ -526,9 +527,8 @@ def render_status(self, value, record: ShareOwner):
}
return Template(template_string).render(Context(template_context))

@staticmethod
def value_status(value, record: ShareOwner):
return record.get_member_status()
def value_status(self, value, record: ShareOwner):
return record.get_member_status(self.reference_time)

@staticmethod
def value_email(value, record: ShareOwner):
Expand Down Expand Up @@ -823,6 +823,9 @@ def get_queryset(self):
queryset, self.reference_date
)
)
queryset = InvestingStatusService.annotate_share_owner_queryset_with_investing_status_at_datetime(
queryset, self.reference_time
)
return queryset

def get_context_data(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ def is_from_attendance_template(cls, attendance: ShiftAttendance):
if not hasattr(attendance, cls.ANNOTATION_IS_FROM_ATTENDANCE_TEMPLATE):
attendance = cls.annotate_shift_attendances(
ShiftAttendance.objects.filter(id=attendance.id)
)
).first()
return getattr(attendance, cls.ANNOTATION_IS_FROM_ATTENDANCE_TEMPLATE)
2 changes: 1 addition & 1 deletion tapir/shifts/static/shifts/css/shifts.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@

.shift-filter-legend {
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2);
}
}
5 changes: 3 additions & 2 deletions tapir/shifts/templates/shifts/shift_block_tag.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load i18n %}
{% load django_bootstrap5 %}
<div class="shift-block-container" style="{{ shift.style }}">
<div id="{% if shift.is_template %}template{% else %}shift{% endif %}_{{ shift.id }}"
class="shift-block btn btn-outline-dark {{ shift.filter_classes }}"
Expand All @@ -11,9 +12,9 @@
{{ shift.weekday|slice:":3" }}
{% endif %}
</div>
<div style="display: flex; flex-direction: column">
<div class="d-flex flex-column">
{% for slot_name, attendances in shift.attendances.items %}
<div>
<div style="max-width: 220px">
{{ slot_name }}:
{% for state in attendances %}
{% if state == "regular" %}
Expand Down
45 changes: 18 additions & 27 deletions tapir/shifts/templates/shifts/shift_calendar_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,26 @@ <h5 class="card-header">
{% for week, shifts_by_day in shifts_by_weeks_and_days.items %}
<div class="card mb-2">
{% with week_group=week_to_group|dictionary_get:week %}
<div class="card-header">
<div class="d-flex flex-row justify-content-between">
<div class="col-5 d-flex flex-column justify-content-center">
<h5 style="margin-bottom: 0">
KW {{ week|date:"W" }} {% translate 'starting' %} {{ week }},
{% translate 'Week ' %}{{ week_group.name }}
</h5>
<div class="card-header d-flex flex-wrap justify-content-between align-items-center">
<h5 style="margin-bottom: 0">
KW {{ week|date:"W" }} {% translate 'starting' %} {{ week }},
{% translate 'Week ' %}{{ week_group.name }}
</h5>
<div class="d-flex flex-wrap align-items-end align-items-center">
<div class="d-inline-flex align-items-baseline p-2 ">
<label for="date-from" class="form-label pe-2">{% translate "From" %}</label>
<input id="date-from"
type="date"
value="{{ date_from }}"
class="form-control" />
</div>
<div class="col-7 d-flex justify-content-end gap-2">
<div class="d-flex align-items-baseline gap-2">
<label for="date-from" class="form-label">{% translate "From" %}</label>
<input id="date-from"
type="date"
value="{{ date_from }}"
class="form-control"
style="max-width: 160px" />
</div>
<div class="d-flex align-items-baseline gap-2">
<label for="date-to" class="form-label">{% translate "To" %}</label>
<input id="date-to"
type="date"
value="{{ date_to }}"
class="form-control"
style="max-width: 160px" />
</div>
<button class="{% tapir_button_link %}" onclick="onFilter()">
<span class="material-icons">filter_alt</span>{% translate "Filter" %}
</button>
<div class="d-inline-flex align-items-baseline p-2">
<label for="date-to" class="form-label pe-2">{% translate "To" %}</label>
<input id="date-to" type="date" value="{{ date_to }}" class="form-control" />
</div>
<button class="{% tapir_button_link %} btn" onclick="onFilter()">
<span class="material-icons">filter_alt</span>{% translate "Filter" %}
</button>
</div>
</div>
{% endwith %}
Expand Down
Loading

0 comments on commit 7c2835a

Please sign in to comment.