<commit_before>{% extends 'layout/base.html' %}
{% from 'forms/form_widget.html' import form_header, form_rows, form_footer %}

{% macro group_table(groups, show_members=false, show_provider=false) %}
    <table class="i-table-widget fixed-width">
        <thead>
            <tr>
                <th>{% trans %}Name{% endtrans %}</th>
                {% if show_members %}
                    <th class="small-column">{% trans %}Members{% endtrans %}</th>
                {% endif %}
                {% if show_provider %}
                    <th class="small-column">{% trans %}Provider{% endtrans %}</th>
                {% endif %}
            </tr>
        </thead>
        <tbody>
            {% for group in groups %}
                <tr>
                    <td><a href="{{ url_for('.group_details', group) }}">{{ group.name }}</a></td>
                    {% if show_members %}
                        <td>{{ group.group.members|count }}</td>
                    {% endif %}
                    {% if show_provider %}
                        <td style="white-space: nowrap;">{{ provider_titles[group.provider] }}</td>
                    {% endif %}
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endmacro %}


{% block title %}{% trans %}Groups{% endtrans %}{% endblock %}

{%- block content %}
    {{ group_table(groups, show_members=true) }}

    {% if providers %}
        <p>
            {% trans providers=providers|map(attribute='title')|join(', ') -%}
                This Indico instance also supports external groups from identity providers ({{ providers }}).
            {%- endtrans %}
            <br>
            {% trans -%}
                The search form below will search both local groups and external groups, unless specified otherwise.
            {%- endtrans %}
        </p>
    {% endif %}

    {{ form_header() }}
    {{ form_rows(form) }}
    {% call form_footer() %}
        <input class="i-button big highlight" type="submit" value="{% trans %}Search{% endtrans %}">
    {% endcall %}

    {% if search_results is not none %}
        {% if not search_results %}
            <p>{% trans %}No groups could be found.{% endtrans %}</p>
        {% else %}
            <p>
                {% trans count=search_results|count -%}
                    There is one group matching your search criteria.
                {% pluralize %}
                    There are {{ count }} groups matching your search criteria.
                {%- endtrans %}
            </p>
            {{ group_table(search_results, show_provider=true) }}
        {% endif %}
    {% endif %}
{%- endblock %}<commit_msg>Use nice i-box layout for group page<commit_after>{% extends 'layout/base.html' %}
{% from 'forms/form_widget.html' import form_header, form_rows, form_footer %}

{% macro group_table(groups, show_members=false, show_provider=false) %}
    <table class="i-table-widget">
        <thead>
            <tr>
                <th>{% trans %}Name{% endtrans %}</th>
                {% if show_members %}
                    <th class="small-column">{% trans %}Members{% endtrans %}</th>
                {% endif %}
                {% if show_provider %}
                    <th class="small-column">{% trans %}Provider{% endtrans %}</th>
                {% endif %}
            </tr>
        </thead>
        <tbody>
            {% for group in groups %}
                <tr>
                    <td><a href="{{ url_for('.group_details', group) }}">{{ group.name }}</a></td>
                    {% if show_members %}
                        <td>{{ group.group.members|count }}</td>
                    {% endif %}
                    {% if show_provider %}
                        <td style="white-space: nowrap;">{{ provider_titles[group.provider] }}</td>
                    {% endif %}
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endmacro %}


{% block title %}{% trans %}Groups{% endtrans %}{% endblock %}

{%- block content %}
    <div class="i-box-group vert fixed-width">
        <div class="i-box titled">
            <div class="i-box-header">
                <div class="i-box-title">
                    {%- trans %}Local groups{% endtrans -%}
                </div>
                <div class="i-box-buttons toolbar right">
                    <div class="group">
                        <button type="button" class="i-button icon-plus" data-href="#">
                            {%- trans %}Create new group{% endtrans -%}
                        </button>
                    </div>
                </div>
            </div>
            <div class="i-box-content">
                {{ group_table(groups, show_members=true) }}
            </div>
        </div>
        <div class="i-box titled">
            <div class="i-box-header">
                <div class="i-box-title">
                    {%- trans %}Search groups{% endtrans -%}
                </div>
            </div>
            <div class="i-box-content">
                {% if providers %}
                    <p>
                        {% trans providers=providers|map(attribute='title')|join(', ') -%}
                            This Indico instance also supports external groups from identity providers ({{ providers }}).
                        {%- endtrans %}
                        <br>
                        {% trans -%}
                            The search form below will search both local groups and external groups, unless specified otherwise.
                        {%- endtrans %}
                    </p>
                {% endif %}

                {{ form_header() }}
                {{ form_rows(form) }}
                {% call form_footer() %}
                    <input class="i-button big highlight" type="submit" value="{% trans %}Search{% endtrans %}">
                {% endcall %}

                {% if search_results is not none %}
                    {% if not search_results %}
                        <h3>{% trans %}No groups could be found.{% endtrans %}</h3>
                    {% else %}
                        <h3>
                            {% trans count=search_results|count -%}
                                There is one group matching your search criteria.
                            {% pluralize %}
                                There are {{ count }} groups matching your search criteria.
                            {%- endtrans %}
                        </h3>
                        {{ group_table(search_results, show_provider=true) }}
                    {% endif %}
                {% endif %}
            </div>
        </div>
    </div>
{%- endblock %}
{'fraction_non_alphanumeric': 0.14692227048075482, 'fraction_numerical': 0.0005990714392691329, 'mean_word_length': 1.3083304528171449, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7314615', 'n_tokens_mistral': 1907, 'n_tokens_neox': 1631, 'n_words': 423}