Skip to content

Commit

Permalink
Improvements on lists
Browse files Browse the repository at this point in the history
- fix tooltips
- improve listing headers display on mobile
  • Loading branch information
gagnieray authored and trasher committed Dec 4, 2023
1 parent b1c107e commit 99e26ec
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
12 changes: 6 additions & 6 deletions templates/default/categories_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<i class="search icon"></i>
{{ _T('Filter') }}
</button>
<button type="submit" name="clear_filter" class="ui labeled icon button" title="{{ _T('Reset all filters to defaults') }}">
<button type="submit" name="clear_filter" class="ui labeled icon button tooltip" title="{{ _T('Reset all filters to defaults') }}">
<i class="trash alt red icon" aria-hidden="true"></i>
{{ _T('Clear filter') }}
</button>
Expand All @@ -85,10 +85,10 @@
{% block body %}
{% for categ in categories %}
<tr class="{% if loop.index is odd %}odd{% else %}even{% endif %}">
<td>
<td data-col-label="#">
{{ categ.category_id }}
</td>
<td>
<td data-col-label="{{ _T("Name", "objectslend") }}">
{% if olendsprefs.imagesInLists() %}
<img src="{{ url_for("objectslend_photo", {"type": "category", "mode": "thumbnail", "id": categ.category_id}) }}"
class="ui middle aligned image"
Expand All @@ -98,12 +98,12 @@
{% endif %}
{{ categ.name }}
</td>
<td class="center {% if categ.is_active %}use{% else %}delete{% endif %}">
<i class="thumbs {% if categ.is_active%}up green{% else %}down red{% endif %} icon"></i>
<td class="center" data-col-label="{{ _T("Active", "objectslend") }}">
<i class="thumbs {% if categ.is_active%}up green{% else %}down red{% endif %} icon tooltip" data-html="{% if categ.is_active %}{{ _T("Active", "objectslend") }}{% else %}{{ _T("Inactive", "objectslend") }}{% endif %}"></i>
<span class="visually-hidden">{% if categ.is_active %}{{ _T("Active", "objectslend") }}{% else %}{{ _T("Inactive", "objectslend") }}{% endif %}</span>
</td>
{% if login.isAdmin() or login.isStaff() %}
<td class="center nowrap">
<td class="center actions_row nowrap">
{% set actions = [
{
'label': _T("Edit \"%category\"", "objectslend")|replace({"%category": categ.name}),
Expand Down
32 changes: 16 additions & 16 deletions templates/default/objects_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<i class="search icon"></i>
{{ _T("Filter") }}
</button>
<button type="submit" name="clear_filter" class="ui labeled icon button" title="{{ _T("Reset all filters to defaults") }}">
<button type="submit" name="clear_filter" class="ui labeled icon button tooltip" title="{{ _T("Reset all filters to defaults") }}">
<i class="trash alt red icon" aria-hidden="true"></i>
{{ _T("Clear filter") }}
</button>
Expand Down Expand Up @@ -201,37 +201,37 @@
{% for object in objects %}
<tr class="{% if loop.index is odd %}even{% else %}odd{% endif %}">
{% if login.isAdmin() or login.isStaff() %}
<td class="center">
<td class="center" data-scope="row">
<input type="checkbox" name="entries_sel[]" value="{{ object.getId() }}">
</td>
{% endif %}
{% if olendsprefs.imagesInLists() %}
<td class="center">
<td class="center" data-col-label="{{ _T("Picture") }}">
<img src="{{ url_for("objectslend_photo", {"type": "object", "mode": "thumbnail", "id": object.getId()}) }}"
class="picture"
width="{{ object.getPicture().getOptimalThumbWidth(olendsprefs) }}"
height="{{ object.getPicture().getOptimalThumbHeight(olendsprefs) }}"
alt="{{ _T("Object photo", "objectslend") }}"/>
</td>
{% endif %}
<td>
<td data-col-label="{{ _T("Name", "objectslend") }}">
<strong>{{ object.displayName(filters)|raw }}</strong>
{% if lendsprefs.VIEW_DESCRIPTION %}
<br/>{{ object.displayDescription(filters)|raw }}
{% endif %}
</td>
{% if lendsprefs.VIEW_SERIAL %}
<td>
<td data-col-label="{{ _T("Serial", "objectslend") }}">
{{ object.displaySerial(filters)|raw }}
</td>
{% endif %}
{% if lendsprefs.VIEW_PRICE %}
<td class="right nowrap">
<td class="right nowrap" data-col-label="{{ _T("Price", "objectslend") }}">
{{ object.getPrice() }}&euro;
</td>
{% endif %}
{% if lendsprefs.VIEW_LEND_PRICE %}
<td class="right">
<td class="right" data-col-label="{{ _T("Borrow price", "objectslend") }}">
{{ object.getRentPrice() }}&euro;<br/>
{% if object.isPricePerDay() %}
{{ _T("(per day)", "objectslend") }}
Expand All @@ -241,41 +241,41 @@
</td>
{% endif %}
{% if lendsprefs.VIEW_DIMENSION %}
<td>
<td data-col-label="{{ _T("Dimensions", "objectslend") }}">
{{ object.displayDimension(filters)|raw }}
</td>
{% endif %}
{% if lendsprefs.VIEW_WEIGHT %}
<td>
<td data-col-label="{{ _T("Weight", "objectslend") }}">
{{ object.weight }}
</td>
{% endif %}
<td>
<td data-col-label="{{ _T("Status", "objectslend") }}">
{% if object.getStatusText() %}
{{ object.getStatusText() }}{% if object.inStock() %} ({{ _T("In stock", "objectslend") }}){% endif %}
{% else %}-{% endif %}
</td>
<td class="center nowrap">
<td class="center nowrap" data-col-label="{{ _T("Since", "objectslend") }}">
{{ object.getDateBegin() }}
</td>
<td>
<td data-col-label="{{ _T("By", "objectslend") }}">
{% if object.getIdAdh() %}
<a href="{{ url_for("member", {"id": object.getIdAdh()}) }}">{{ memberName({'id': object.getIdAdh()}) }}</a>
{% else %}-{% endif %}
</td>
{% if lendsprefs.VIEW_DATE_FORECAST %}
<td class="center nowrap">
<td class="center nowrap" data-col-label="{{ _T("Return", "objectslend") }}">
{{ object.getDateForecast() }}
</td>
{% endif %}
<td class="center {% if object.isActive() %}use{% else %}delete{% endif %}">
<td class="center" data-col-label="{{ _T("Active", "objectslend") }}">
<i
class="thumbs {% if object.isActive() %}up green{% else %}down red{% endif %} icon"
class="thumbs {% if object.isActive() %}up green{% else %}down red{% endif %} icon tooltip"
title="{% if object.isActive() %}{{ _T("Object is active", "objectslend") }}{% else %}{{ _T("Object is inactive", "objectslend") }}{% endif %}">
</i>
<span class="visually-hidden">{% if object.isActive() %}{{ _T("Active", "objectslend") }}{% else %}{{ _T("Inactive", "objectslend") }}{% endif %}</span>
</td>
<td class="center nowrap">
<td class="center actions_row nowrap">
{% set actions = [] %}
{% if login.isAdmin() or login.isStaff() %}
{% set actions = [
Expand Down
24 changes: 12 additions & 12 deletions templates/default/status_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<i class="search icon"></i>
{{ _T('Filter') }}
</button>
<button type="submit" name="clear_filter" class="ui labeled icon button" title="{{ _T('Reset all filters to defaults') }}">
<button type="submit" name="clear_filter" class="ui labeled icon button tooltip" title="{{ _T('Reset all filters to defaults') }}">
<i class="trash alt red icon" aria-hidden="true"></i>
{{ _T('Clear filter') }}
</button>
Expand All @@ -114,39 +114,39 @@

{% block body %}
{% for status in statuses %}
<tr class="{if $status@index is odd}even{else}odd{/if}">
<td>
<tr class="{% if loop.index is odd %}even{% else %}odd{% endif %}">
<td data-scope="id">
{{ status.status_id }}
</td>
<td>
<td data-col-label="{{ _T("Status", "objectslend") }}">
{{ status.status_text }}
</td>
<td class="center {if $status->is_active}use{else}delete{/if}">
<td class="center" data-col-label="{{ _T("Active", "objectslend") }}">
{% if status.is_active %}
<i class="thumbs up green icon"></i>
<i class="thumbs up green icon tooltip" data-html="{{ _T("Active", "objectslend") }}"></i>
<span class="visually-hidden">{{ _T("Active", "objectslend") }}</span>
{% else %}
<i class="thumbs down red icon"></i>
<i class="thumbs down red icon tooltip" data-html="{{ _T("Inactive", "objectslend") }}"></i>
<span class="visually-hidden">{{ _T("Inactive", "objectslend") }}</span>
{% endif %}
</td>
<td class="center {if $status->in_stock}use{else}delete{/if}">
<td class="center" data-col-label="{{ _T("Stock", "objectslend") }}">
{% if status.in_stock %}
<i class="thumbs up green icon"></i>
<i class="thumbs up green icon tooltip" data-html="{{ _T("In stock", "objectslend") }}"></i>
<span class="visually-hidden">{{ _T("In stock", "objectslend") }}</span>
{% else %}
<i class="thumbs down red icon"></i>
<i class="thumbs down red icon tooltip" data-html="{{ _T("Not in stock", "objectslend") }}"></i>
<span class="visually-hidden">{{ _T("Not in stock", "objectslend") }}</span>
{% endif %}
</td>
<td>
<td data-col-label="{{ _T("Days for rent", "objectslend") }}">
{% if status.rent_day_number %}
{{ _T("%days days", "objectslend")|replace({'%days': status.rent_day_number}) }}
{% else %}
-
{% endif %}
</td>
<td class="center nowrap">
<td class="center actions_row nowrap">
{% set actions = [
{
'label': _T("Edit %status", "objectslend")|replace({'%status': status.status_text}),
Expand Down

0 comments on commit 99e26ec

Please sign in to comment.