{% endif %}
</form>
{% endblock %}
- <form action="{% if form.route is defined %}{{ url_for(form.route.name, form.route.args|default([])) }}{% endif %}" method="post" id="listform" class="ui form">
- <div class="ui basic fitted segment">
+ {% if form is defined %}
+ <form action="{% if form.route is defined %}{{ url_for(form.route.name, form.route.args|default([])) }}{% endif %}" method="post" id="listform" class="ui form">
+ <div class="ui basic fitted segment">
- {% if mode != 'ajax' and batch_actions is defined and batch_actions|length > 0 %}
- {{ macros.drawBatchActionsList(batch_actions) }}
- {% endif %}
+ {% if mode != 'ajax' and batch_actions is defined and batch_actions|length > 0 %}
+ {{ macros.drawBatchActionsList(batch_actions) }}
+ {% endif %}
+ {% endif %}
- <div class="ui basic fitted segment loader_selector">
- <table class="listing ui celled{% if basic_table is not defined %} striped{% endif %} table">
- <thead>
- <tr>
- {% block header %}
- {% for column in columns %}
- <th class="left">
- {% if column.order is defined %}
- <a href="{{ url_for(form.order.name, form.order.args|default([])|merge({"option": "order", "value": column.order})) }}">
- {{ column.label }}
- {% if filters.orderby == column.order %}
- {% if filters.ordered == constant('Galette\\Core\\Pagination::ORDER_ASC') %}
- <i class="ui angle down icon tooltip"></i>
- {% else %}
- <i class="ui angle up icon tooltip"></i>
+ {% if list_type is defined and list_type == 'cards' %}
+ <div class="{% if nb %}ui doubling {% if cards_columns is defined %}{{ cards_columns }}{% else %}six{% endif %} column cards loader_selector{% endif %}">
+ {% else %}
+ <div class="ui basic fitted segment loader_selector">
+ <table class="listing ui celled{% if basic_table is not defined %} striped{% endif %} table">
+ <thead>
+ <tr>
+ {% block header %}
+ {% for column in columns %}
+ <th class="left">
+ {% if form is defined and column.order is defined %}
+ <a href="{{ url_for(form.order.name, form.order.args|default([])|merge({"option": "order", "value": column.order})) }}">
+ {{ column.label }}
+ {% if filters.orderby == column.order %}
+ {% if filters.ordered == constant('Galette\\Core\\Pagination::ORDER_ASC') %}
+ <i class="ui angle down icon tooltip"></i>
+ {% else %}
+ <i class="ui angle up icon tooltip"></i>
+ {% endif %}
{% endif %}
+ </a>
+ {% else %}
+ {{ column.label }}
{% endif %}
- </a>
- {% else %}
- {{ column.label }}
- {% endif %}
- </th>
- {% endfor %}
- {% if mode != 'ajax' and no_action is not defined or no_action == false %}
- <th class="actions_row">{{ _T('Actions') }}</th>
- {% endif %}
- {% endblock %}
- </tr>
- </thead>
- <tbody>
- {% block body %}{% endblock %}
- </tbody>
- <tfoot>
- {% block footer %}{% endblock %}
- </tfoot>
- </table>
- </div>
+ </th>
+ {% endfor %}
+ {% if mode != 'ajax' and no_action is not defined or no_action == false %}
+ <th class="actions_row">{{ _T('Actions') }}</th>
+ {% endif %}
+ {% endblock %}
+ </tr>
+ </thead>
+ <tbody>
+ {% endif %}
+ {% block body %}{% endblock %}
+ {% if list_type is not defined %}
+ </tbody>
+ <tfoot>
+ {% block footer %}{% endblock %}
+ </tfoot>
+ </table>
+ {% endif %}
- {% if mode != 'ajax' and batch_actions is defined and batch_actions|length > 0 %}
- {{ macros.drawBatchActionsList(batch_actions) }}
- {% endif %}
+ {% if form is defined and mode != 'ajax' and batch_actions is defined and batch_actions|length > 0 %}
+ {{ macros.drawBatchActionsList(batch_actions) }}
+ {% endif %}
- </div>
+ </div>
- {% if is_paginated %}
- <div class="ui basic center aligned fitted segment">
- <div class="ui inverted pagination menu">
- <div class="header item">
- {{ _T('Pages:') }}
+ {% if is_paginated %}
+ <div class="ui basic center aligned fitted segment">
+ <div class="ui inverted pagination menu">
+ <div class="header item">
+ {{ _T('Pages:') }}
+ </div>
+ {{ pagination|raw }}
</div>
- {{ pagination|raw }}
</div>
- </div>
- {% endif %}
+ {% endif %}
- {% block extra_form %}{% endblock %}
- {% include "components/forms/csrf.html.twig" %}
- </form>
+ {% if form is defined %}
+ {% block extra_form %}{% endblock %}
+ {% include "components/forms/csrf.html.twig" %}
+ </form>
+ {% endif %}
{% block legend %}{% endblock %}
{% if mode == 'ajax' %}
</div>
-{% extends 'public_page.html.twig' %}
+{% extends 'elements/list.html.twig' %}
-{% block content %}
- <div class="ui icon info visible message">
- <i class="info circle blue icon"></i>
- <div class="content">
- {{ _T("This page shows only members who have choosen to be visible on the public lists and are up-to-date within their contributions. If you want your account to be visible here, edit your profile and check 'Be visible in the members list'") }}
- </div>
+{% set nb = members|length %}
+{% set is_public = not login.isLogged() %}
+{% set list_type = 'cards' %}
+
+{% block infoline %}
+ {% set infoline = {
+ 'label': _Tn("%count member", "%count members", nb_members)|replace({'%count': nb_members}),
+ 'route': {
+ 'name': 'filterPublicList',
+ 'args': {
+ "type": "trombi"
+ }
+ }
+ } %}
+ {{ parent() }}
+{% endblock %}
+
+{% block search %}
+ <div class="ui icon info visible message">
+ <i class="info circle blue icon"></i>
+ <div class="content">
+ {{ _T("This page shows only members who have choosen to be visible on the public lists and are up-to-date within their contributions. If you want your account to be visible here, edit your profile and check 'Be visible in the members list'") }}
</div>
-{% if members|length > 0 %}
- <form action="{{ url_for("filterPublicList", {"type": "trombi"}) }}" method="POST" class="ui form">
- <div class="infoline">
- <div class="ui basic horizontal segments">
- <div class="ui basic fitted segment">
- <div class="ui label">{{ _Tn("%count member", "%count members", nb_members)|replace({'%count': nb_members}) }}</div>
- </div>
- <div class="ui basic right aligned fitted segment">
- <div class="inline field">
- <label for="nbshow">{{ _T('Records per page:') }}</label>
- <select name="nbshow" id="nbshow" class="ui dropdown nochosen">
- {% for key, value in nbshow_options %}
- <option value="{{ key }}"{% if key == numrows %} selected="selected"{% endif %}>{{ value }}</option>
- {% endfor %}
- </select>
- <noscript> <span><input type="submit" value="{{ _T('Change') }}" /></span></noscript>
- {% include "components/forms/csrf.html.twig" %}
- </div>
- </div>
- </div>
- </div>
- </form>
- <div class="ui doubling six column cards">
+ </div>
+{% endblock %}
+
+{% block body %}
{% for member in members %}
- <div class="ui fluid card">
- {% set mid = member.id %}
- <div class="image">
- <img
- src="{{ url_for("photo", {"id": member.id, "rand": time}) }}"
- width="{{ member.picture.getOptimalWidth() }}"
- height="{{ member.picture.getOptimalHeight() }}"
- alt="{{ member.sfullname }}{% if member.nickname != '' %} ({{ member.nickname|escape }}){% endif %}"
- />
- </div>
- <div class="content">
- <div class="header">{{ member.sfullname }}</div>
- {% if member.nickname != '' %}<div class="meta">{{ member.nickname|escape }}</div>{% endif %}
- </div>
+ <div class="ui fluid card">
+ {% set mid = member.id %}
+ <div class="image">
+ <img
+ src="{{ url_for("photo", {"id": member.id, "rand": time}) }}"
+ width="{{ member.picture.getOptimalWidth() }}"
+ height="{{ member.picture.getOptimalHeight() }}"
+ alt="{{ member.sfullname }}{% if member.nickname != '' %} ({{ member.nickname|escape }}){% endif %}"
+ />
</div>
- {% endfor %}
- </div>
- <div class="ui basic center aligned fitted segment">
- <div class="ui inverted pagination menu">
- <div class="header item">
- {{ _T('Pages:') }}
- </div>
- {{ pagination|raw }}
+ <div class="content">
+ <div class="header">{{ member.sfullname }}</div>
+ {% if member.nickname != '' %}<div class="meta">{{ member.nickname|escape }}</div>{% endif %}
</div>
</div>
-{% else %}
- <div class="ui small message">
- <div class="content">
- <em>{{ _T('No member to show') }}</em>
+ {% else %}
+ <div class="ui small message">
+ <div class="content">
+ <em>{{ _T('No member to show') }}</em>
+ </div>
</div>
- </div>
-{% endif %}
+ {% endfor %}
{% endblock %}