Fix naming, fix tooltip and cosmetic changes

This commit is contained in:
2025-10-31 21:51:12 +01:00
parent 118a08372f
commit 917a2b50cc
4 changed files with 7 additions and 33 deletions

View File

@@ -777,7 +777,7 @@ class PosterListView(
"create_url": reverse_lazy(
"club:poster_create", kwargs={"club_id": self.club.id}
),
"edit_url_factory": lambda poster: reverse(
"get_edit_url": lambda poster: reverse(
"club:poster_edit",
kwargs={"club_id": self.club.id, "poster_id": poster.id},
),

View File

@@ -130,28 +130,6 @@
}
}
.tooltip {
visibility: hidden;
width: 120px;
background-color: hsl(210, 20%, 98%);
color: hsl(0, 0%, 0%);
text-align: center;
padding: 5px 0;
border-radius: 6px;
position: absolute;
z-index: 10;
ul {
margin-left: 0;
display: inline-block;
li {
display: list-item;
list-style-type: none;
}
}
}
&.not_moderated {
border: 1px solid red;
}

View File

@@ -29,6 +29,9 @@
class="image"
hover="{% trans %}Click to expand{% endtrans %}"
@click="active = $el.firstElementChild"
tooltip="{%- for screen in poster.screens.all() -%}
{{ screen }}
{% endfor %}"
>
<img src="{{ poster.file.url }}" alt="{{ poster.name }}">
</div>
@@ -38,7 +41,7 @@
</div>
<div class="actions">
{% if poster.is_editable %}
<a class="btn btn-blue" href="{{ edit_url_factory(poster) }}">
<a class="btn btn-blue" href="{{ get_edit_url(poster) }}">
<i class="fa fa-pen-to-square"></i>
{% trans %}Edit{% endtrans %}
</a>
@@ -46,20 +49,13 @@
{% if not poster.is_moderated and user.has_perm("com.moderate_poster") %}
<form action="{{ url("com:poster_moderate", object_id=poster.id) }}" method="post">
{% csrf_token %}
<button type="submit" class="btn btn-blue">
<button type="submit" class="btn btn-green">
<i class="fa fa-check"></i>
{% trans %}Moderate{% endtrans %}
</button>
</form>
{% endif %}
</div>
<div class="tooltip">
<ul>
{% for screen in poster.screens.all() %}
<li>{{ screen }}</li>
{% endfor %}
</ul>
</div>
</div>
{% else %}
<div id="no-posters">{% trans %}No posters{% endtrans %}</div>

View File

@@ -650,7 +650,7 @@ class PosterListView(PermissionRequiredMixin, ComTabsMixin, PosterListBaseView):
current_tab = "posters"
extra_context = {
"create_url": reverse_lazy("com:poster_create"),
"edit_url_factory": lambda poster: reverse(
"get_edit_url": lambda poster: reverse(
"com:poster_edit", kwargs={"poster_id": poster.id}
),
}