Remove pills introduced in previous commit

This commit is contained in:
Midgard 2021-06-21 02:08:32 +02:00
parent 16bd9243d4
commit e82742eb62
Signed by: midgard
GPG key ID: 511C112F1331BBB4
3 changed files with 6 additions and 12 deletions

View file

@ -71,7 +71,7 @@ class Order(db.Model):
return list(sorted(group.items(), key=lambda t: (t[0] or "", t[1] or "")))
def group_by_dish(self) \
-> typing.List[typing.Tuple[str, int, typing.List[typing.Tuple[typing.List[str], typing.List]]]]:
-> typing.List[typing.Tuple[str, int, typing.List[typing.Tuple[str, typing.List]]]]:
"Group items of an Order by dish"
group: typing.Dict[str, typing.Dict[str, typing.List]] = \
defaultdict(lambda: defaultdict(list))
@ -85,10 +85,7 @@ class Order(db.Model):
# Amount of items of this dish
sum(map(len, comment_group.values())),
sorted(
(
(list(map(str.strip, comment.split(";"))) if comment else []),
sorted(items, key=lambda x: (x.for_name or ""))
)
(comment, sorted(items, key=lambda x: (x.for_name or "")))
for comment, items in comment_group.items()
)
)

View file

@ -241,10 +241,9 @@
{% if has_comments -%}
<ul class="comments">
{% for comment, items in dish_comment_groups -%}
<li class="spacecake"><span class="comment"><span class="quantity">{{ items | length }}</span> ×
{% if comment %}
{% set semicolon = joiner(";") %}
{% for comment_part in comment %}<span class="comment_part_separator">{{ semicolon() }} </span><span class="comment_part">{{ comment_part }}</span>{% endfor %}
<li class="spacecake"><span class="comment">
<span class="quantity">{{ items | length }}</span> ×
{% if comment %}{{ comment }}
{% else %}<i>No comment</i>
{% endif %}</span><span class="spacer"> </span><span class="item_for">for {{ items | map(attribute="for_name") | join(", ") }}</span></li>
{% endfor %}

View file

@ -38,9 +38,7 @@ Haldis - Order {{ order.id }}
<ul class="comments">
{% for comment, items in dish_comment_groups -%}
<li><span class="quantity">{{ items | length }}</span> ×
{% if comment %}
{% set semicolon = joiner(";") %}
{% for comment_part in comment %}<span class="comment_part_separator">{{ semicolon() }} </span><span class="comment_part">{{ comment_part }}</span>{% endfor %}
{% if comment %}{{ comment }}
{% else %}<i>No comment</i>
{% endif %}</li>
{% endfor %}