feat: show upcoming traits
This commit is contained in:
@@ -85,6 +85,12 @@ class Person(models.Model):
|
|||||||
return self.traits_at_date(datetime.now()).values_list(
|
return self.traits_at_date(datetime.now()).values_list(
|
||||||
'pk', 'trait__key', 'trait__label')
|
'pk', 'trait__key', 'trait__label')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def upcoming_attributes(self):
|
||||||
|
today = datetime.now()
|
||||||
|
return self.traits.filter(Q(valid_from__gt=today)).values_list(
|
||||||
|
'pk', 'trait__key', 'trait__label', 'valid_from')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_checkin(self):
|
def current_checkin(self):
|
||||||
return Booking.currently_open_checkin(self)
|
return Booking.currently_open_checkin(self)
|
||||||
|
|||||||
@@ -223,7 +223,10 @@ table.clickable tbody>tr:hover>td {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.border1 {
|
.border1 {
|
||||||
border: 1px solid
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
.border1d {
|
||||||
|
border: 1px dashed;
|
||||||
}
|
}
|
||||||
.font-sm {
|
.font-sm {
|
||||||
font-size: 90%
|
font-size: 90%
|
||||||
|
|||||||
@@ -18,6 +18,10 @@
|
|||||||
{% for attr in object.attributes|dictsort:2 %}
|
{% for attr in object.attributes|dictsort:2 %}
|
||||||
<a class="badge text-primary border1" href="{% url 'trait-mapping:detail' attr.0 %}">{{ attr.2 }}</a>
|
<a class="badge text-primary border1" href="{% url 'trait-mapping:detail' attr.0 %}">{{ attr.2 }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% for attr in object.upcoming_attributes|dictsort:3 %}
|
||||||
|
<span class="small text-secondary">, ab {{ attr.3|date:'d.m.' }}:</span>
|
||||||
|
<a class="badge text-primary border1d" href="{% url 'trait-mapping:detail' attr.0 %}">{{ attr.2 }}</a>
|
||||||
|
{% endfor %}
|
||||||
<a class="badge bg-secondary" href="{% url 'trait-mapping:create' %}{{ back_query_w_user }}" title="Attribut hinzufügen"><i class="fas fa-plus"></i></a>
|
<a class="badge bg-secondary" href="{% url 'trait-mapping:create' %}{{ back_query_w_user }}" title="Attribut hinzufügen"><i class="fas fa-plus"></i></a>
|
||||||
<a class="small text-secondary" href="{% url 'trait-mapping:list' %}{{ back_query_w_user }}">(alle anzeigen)</a>
|
<a class="small text-secondary" href="{% url 'trait-mapping:list' %}{{ back_query_w_user }}">(alle anzeigen)</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user