0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-05-10 03:40:46 +00:00
kevinpapst_kimai2/templates/plugin/index.html.twig
Kevin Papst dfd97fd6f3
Release 2.34 (#5465)
* fix timing issue in timesheet edit form with deactivated rounding
* bump packages
* only show update messages for newer plugin versions
* replace deprecated method
* remove internal from API
* remove technical terms from translation
* prevent calls to internal symfony methods
* helper method to flag entry as modified
* support meta-fields in weekly-hourse view
* fix running timesheets were deleted in weekly-hourse
2025-05-09 14:22:47 +02:00

84 lines
4.7 KiB
Twig

{% extends 'base.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/datatables.html.twig" as tables %}
{% block main %}
{% if plugins|length == 0 %}
{{ widgets.callout('warning', 'plugin.none_installed'|trans({}, 'plugins')) }}
{% else %}
{% embed '@theme/embeds/card.html.twig' %}
{% block box_title %}{{ 'plugin.installed'|trans }}{% endblock %}
{% block box_body_class %}p-0{% endblock %}
{% block box_body %}
{% set columns = {
'name': {'class': 'alwaysVisible w-25'},
'description': {'class': 'd-none d-md-table-cell'},
'version': {'class': 'text-center w-min'},
} %}
{% set tableName = 'plugins' %}
{% import "macros/datatables.html.twig" as tables %}
{% import "macros/widgets.html.twig" as widgets %}
{{ tables.datatable_header(tableName, columns, null, {columnConfig: false}) }}
{% for plugin in plugins|sort((p1, p2) => p1.name|lower <=> p2.name|lower) %}
<tr>
<td class="{{ tables.data_table_column_class(tableName, columns, 'name') }}">
<a href="{{ plugin.metadata.homepage }}" title="{{ 'homepage'|trans }}" target="_blank">{{ plugin.name }}</a>
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'description') }}">
{{ plugin.metadata.description }}
{% if updates[plugin.id] is defined and updates[plugin.id] == true %}
{{ widgets.alert('warning', 'update_available'|trans({'%version%': bundles[plugin.id]['latest_release']}, 'plugins')) }}
{% endif %}
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'version') }}">
{{ widgets.label(plugin.metadata.version, 'primary', plugin.id) }}
</td>
</tr>
{% endfor %}
{{ tables.data_table_footer(plugins) }}
{% endblock %}
{% endembed %}
{% endif %}
{% if extensions|length > 0 %}
{% embed '@theme/embeds/card.html.twig' %}
{% from "macros/widgets.html.twig" import card_tool_button %}
{% block box_title %}{{ 'plugin.marketplace'|trans({}, 'plugins') }}{% endblock %}
{% block box_body_class %}p-0{% endblock %}
{% block box_tools %}
{{ card_tool_button('shop', {'title': 'shop', 'translation_domain': 'plugins', 'target': '_blank', 'url': constant('App\\Constants::HOMEPAGE') ~ '/store/', 'icon': false, 'class': 'btn-warning'}) }}
{% endblock %}
{% block box_body %}
{% set columns = {
'name': {'class': 'alwaysVisible w-25'},
'description': {'class': 'd-none d-md-table-cell'},
'shop': {'class': 'w-min alwaysVisible'},
} %}
{% set tableName = 'extensions' %}
{% import "macros/datatables.html.twig" as tables %}
{% import "macros/widgets.html.twig" as widgets %}
{{ tables.datatable_header(tableName, columns, null, {columnConfig: false}) }}
{% for extension in extensions|filter(e => e.bundle is not null and e.bundle not in installed) %}
<tr>
<td class="{{ tables.data_table_column_class(tableName, columns, 'name') }}">
<a href="{{ extension.url }}" title="{{ 'homepage'|trans }}" target="_blank">{{ extension.name }}</a>
</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'description') }}">{{ extension.description }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'shop') }}">
{% if extension.buy is defined and extension.buy is not empty and (extension.minimum_version is not defined or (extension.minimum_version is not empty and constant('App\\Constants::VERSION') >= extension.minimum_version)) %}
<a class="btn btn-icon btn-outline-secondary" href="{{ extension.buy }}" title="{{ 'buy'|trans({}, 'plugins') }}" target="_blank">{{ icon('shop') }}</a>
{% endif %}
</td>
</tr>
{% endfor %}
{{ tables.data_table_footer(plugins) }}
{% endblock %}
{% endembed %}
{% endif %}
{% endblock %}