use collapsible element instead of collapsible card (#4096)

This commit is contained in:
Kevin Papst
2023-06-09 18:17:32 +02:00
committed by GitHub
parent 2e2bf986a4
commit 053a1d9017
6 changed files with 52 additions and 62 deletions

View File

@@ -59,11 +59,10 @@
{% if form.metaFields is defined and form.metaFields is not empty %}
{{ form_row(form.metaFields) }}
{% endif %}
{% embed '@theme/embeds/card.html.twig' with {collapsed: true} %}
{% embed '@theme/embeds/collapsible.html.twig' with {id: 'activity_invoice_settings'} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}{{ 'invoices'|trans }}{% endblock %}
{% block box_body_class %}{% endblock %}
{% block box_body %}
{% block title %}{{ 'invoices'|trans }}{% endblock %}
{% block body %}
{% if form.invoiceText is defined %}
{{ form_row(form.invoiceText) }}
{% endif %}

View File

@@ -98,11 +98,10 @@
{% if form.metaFields is defined and form.metaFields is not empty %}
{{ form_row(form.metaFields) }}
{% endif %}
{% embed '@theme/embeds/card.html.twig' with {collapsed: true} %}
{% embed '@theme/embeds/collapsible.html.twig' with {id: 'customer_invoice_settings'} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}{{ 'invoices'|trans }}{% endblock %}
{% block box_body_class %}{% endblock %}
{% block box_body %}
{% block title %}{{ 'invoices'|trans }}{% endblock %}
{% block body %}
{% if form.invoiceTemplate is defined %}
{{ form_row(form.invoiceTemplate) }}
{% endif %}

View File

@@ -20,16 +20,16 @@
{% endembed %}
{% endif %}
{% set permissionOpts = {collapsed: true, boxtype: 'success'} %}
{% set permissionOpts = {boxtype: 'success'} %}
{% for name, value in directories %}
{% if value is same as (false) %}
{% set permissionOpts = {boxtype: 'danger'} %}
{% set permissionOpts = {boxtype: 'danger', open: true} %}
{% endif %}
{% endfor %}
{% embed '@theme/embeds/card.html.twig' with permissionOpts %}
{% block box_title %}File permissions{% endblock %}
{% block box_body %}
{% embed '@theme/embeds/collapsible.html.twig' with permissionOpts %}
{% block title %}File permissions{% endblock %}
{% block body %}
<p>
If you see a warning icon <i class="{{ 'warning'|icon(false) }} text-red"></i> in the list below, you should talk to your administrator.
The path is either not readable or not writable and Kimai might not work as expected.
@@ -51,16 +51,16 @@
{% endblock %}
{% endembed %}
{% set extensionOpts = {collapsed: true, boxtype: 'success'} %}
{% set extensionOpts = {boxtype: 'success'} %}
{% for name, value in extensions %}
{% if value is same as (false) %}
{% set extensionOpts = {boxtype: 'danger'} %}
{% set extensionOpts = {boxtype: 'danger', open: true} %}
{% endif %}
{% endfor %}
{% embed '@theme/embeds/card.html.twig' with extensionOpts %}
{% block box_title %}PHP extensions{% endblock %}
{% block box_body %}
{% embed '@theme/embeds/collapsible.html.twig' with extensionOpts %}
{% block title %}PHP extensions{% endblock %}
{% block body %}
<p>
If you see a warning icon <i class="{{ 'warning'|icon(false) }} text-red"></i> in the list below, you should talk to your administrator, as there is a missing PHP extension causing Kimai not to work as expected.
</p>
@@ -81,19 +81,14 @@
{% endblock %}
{% endembed %}
{% set logOpts = {collapsed: true} %}
{% set logOpts = {} %}
{% if logSize > 52428800 %}
{% set logOpts = {boxtype: 'danger'} %}
{% set logOpts = {boxtype: 'danger', open: true} %}
{% endif %}
{% embed '@theme/embeds/card.html.twig' with logOpts %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}Logfile (max. {{ logLines }} last lines){% endblock %}
{% block box_tools %}
{% if log_delete %}
{{ widgets.card_tool_button('delete', {'class': 'confirmation-link', 'title': 'delete', 'url': path('doctor_flush_log', {'token': csrf_token('doctor.flush_log')}), 'attr': {'data-question': 'confirm.delete'}}) }}
{% endif %}
{% endblock %}
{% block box_body %}
{% embed '@theme/embeds/collapsible.html.twig' with logOpts %}
{% from "@theme/components/button.html.twig" import button %}
{% block title %}Logfile (max. {{ logLines }} last lines){% endblock %}
{% block body %}
{% if logSize > 52428800 %}
<p>Your logfile is larger than 50 MB, consider deleting it (it will be re-created automatically).</p>
{% endif %}
@@ -110,33 +105,32 @@
{%- endif -%}
<span class="{{ logLineClass }}">{{- logLine -}}</span>
{%- endfor %}</pre>
{% endblock %}
{% endembed %}
{% embed '@theme/embeds/card.html.twig' with {collapsed: true} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}Composer{% endblock %}
{% block box_body_class %}{% if composer|length > 0 %}p-0{% endif %}{% endblock %}
{% block box_body %}
{% if composer|length == 0 %}
{{ widgets.alert('warning', 'Could not detect installed composer packages, please upgrade your Composer installation to version 2.x.') }}
{% else %}
<table class="table table-hover">
{% for name, value in composer %}
<tr>
<th class="text-nowrap w-min">{{ name }}</th>
<td class="text-break">{{ value }}</td>
</tr>
{% endfor %}
</table>
{% if log_delete %}
{{ button('delete', {combined: true, 'class': 'confirmation-link btn-danger', 'title': 'delete', 'url': path('doctor_flush_log', {'token': csrf_token('doctor.flush_log')}), 'attr': {'data-question': 'confirm.delete'}}) }}
{% endif %}
{% endblock %}
{% endembed %}
{% embed '@theme/embeds/card.html.twig' with {collapsed: true} %}
{% block box_title %}PHP{% endblock %}
{% block box_body_class %}p-0{% endblock %}
{% block box_body %}
{% embed '@theme/embeds/collapsible.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% block title %}Composer{% endblock %}
{% block body_class %}p-0{% endblock %}
{% block body %}
<table class="table table-hover">
{% for name, value in composer %}
<tr>
<th class="text-nowrap w-min">{{ name }}</th>
<td class="text-break">{{ value }}</td>
</tr>
{% endfor %}
</table>
{% endblock %}
{% endembed %}
{% embed '@theme/embeds/collapsible.html.twig' %}
{% block title %}PHP{% endblock %}
{% block body_class %}p-0{% endblock %}
{% block body %}
<table class="table table-hover">
<tr>
<th class="text-nowrap w-min">{{ 'version'|trans }}</th>

View File

@@ -73,11 +73,10 @@
{% if form.metaFields is defined and form.metaFields is not empty %}
{{ form_row(form.metaFields) }}
{% endif %}
{% embed '@theme/embeds/card.html.twig' with {collapsed: true} %}
{% embed '@theme/embeds/collapsible.html.twig' with {id: 'project_invoice_settings'} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}{{ 'invoices'|trans }}{% endblock %}
{% block box_body_class %}{% endblock %}
{% block box_body %}
{% block title %}{{ 'invoices'|trans }}{% endblock %}
{% block body %}
{% if form.invoiceText is defined %}
{{ form_row(form.invoiceText) }}
{% endif %}

View File

@@ -74,11 +74,10 @@
{{ form_row(form.metaFields) }}
{% endif %}
{% if form.fixedRate is defined or form.hourlyRate is defined or form.billable is defined or form.billableMode is defined or form.exported is defined %}
{% embed '@theme/embeds/card.html.twig' with {collapsed: true, id: 'timesheet_extended_settings'} %}
{% embed '@theme/embeds/collapsible.html.twig' with {id: 'timesheet_extended_settings'} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}{{ 'extended_settings'|trans }}{% endblock %}
{% block box_body_class %}{% endblock %}
{% block box_body %}
{% block title %}{{ 'extended_settings'|trans }}{% endblock %}
{% block body %}
{% if form.fixedRate is defined %}
{{ form_row(form.fixedRate, {'row_attr': {'class': 'mb-3 ' ~ form.vars.name ~ '_row_' ~ form.fixedRate.vars.name}}) }}
{% endif %}

View File

@@ -31,7 +31,7 @@ class DoctorControllerTest extends ControllerBaseTest
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
$this->assertAccessIsGranted($client, '/doctor');
$result = $client->getCrawler()->filter('.content .card-header');
$result = $client->getCrawler()->filter('.content .accordion-header');
$counter = \count($result);
// this can contain a warning box, that a new release is available
self::assertTrue($counter === 6 || $counter === 5);