Major redesign #73

Merged
lukas merged 45 commits from manage-purchases into main 2024-09-02 15:47:44 +00:00
3 changed files with 24 additions and 2 deletions
Showing only changes of commit bb0d24809e - Show all commits

View File

@ -2249,6 +2249,10 @@ input:checked + .toggle-bg {
max-width: 20ch;
}
.min-w-30char {
min-width: 30ch;
}
.max-w-30char {
max-width: 30ch;
}

View File

@ -1,9 +1,16 @@
{% fragment as default_content %}
{% load randomid %}
{% for td in data %}
{% if forloop.first %}
<th scope="row"
class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white min-w-30-char max-w-30char text-ellipsis overflow-hidden">
<span title="{{ td }}">{{ td }}</span>
class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white min-w-30char">
{% randomid td as th_popover_id %}
<span data-popover-target="{{ th_popover_id }}">{{ td|truncatechars:30 }}</span>
{% if td|length > 30 %}
{% #popover id=th_popover_id %}
{{ td }}
{% /popover %}
{% endif %}
</th>
{% else %}
{% #table_td %}

View File

@ -0,0 +1,11 @@
import random
import string
from django import template
register = template.Library()
@register.simple_tag
def randomid(seed: str = "") -> str:
return str(hash(seed + "".join(random.choices(string.ascii_lowercase, k=10))))