added plugin screen (#671)
This commit is contained in:
@@ -1,38 +1,57 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% block page_title %}{{ 'about.title'|trans({}, 'about') }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'about.subtitle'|trans({}, 'about') }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
{{ widgets.callout('info', 'Thank you for using Kimai ' ~ constant('App\\Constants::VERSION') ~ ' ' ~ constant('App\\Constants::STATUS') ~ ' - ' ~ constant('App\\Constants::NAME'), 'Kimai ' ~ constant('App\\Constants::VERSION'), 'fas fa-thumbs-up') }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#kimai" data-toggle="tab" aria-expanded="true">Kimai</a></li>
|
||||
<li><a href="#system" data-toggle="tab" aria-expanded="true">System</a></li>
|
||||
<li><a href="#license" data-toggle="tab" aria-expanded="true">License</a></li>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation"class ="active"><a href="#systeminfo" aria-controls="systeminfo" role="tab" data-toggle="tab">{{ 'tab.system'|trans({}, 'about') }}</a></li>
|
||||
<li role="presentation"><a href="#license" aria-controls="license" role="tab" data-toggle="tab">{{ 'tab.license'|trans({}, 'about') }}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="kimai">
|
||||
<dl>
|
||||
<dt>Version</dt><dd>{{ constant('App\\Constants::VERSION') }}</dd>
|
||||
<dt>Status</dt><dd>{{ constant('App\\Constants::STATUS') }}</dd>
|
||||
<dt>Name</dt><dd>{{ constant('App\\Constants::NAME') }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="tab-pane" id="system">
|
||||
|
||||
<div role="tabpanel" class="tab-pane active" id="systeminfo">
|
||||
<div class="box-group" id="accordion">
|
||||
{% if is_granted('system_actions') %}
|
||||
<div class="panel box">
|
||||
<div class="box-header with-border">
|
||||
<h4 class="box-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" class="" aria-expanded="true">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapseSystemAction" aria-expanded="true">
|
||||
{{ 'label.actions'|trans }}
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseSystemAction" class="panel-collapse collapse in" aria-expanded="true">
|
||||
<div class="box-body">
|
||||
<p>
|
||||
<a href="{{ path('system_flush_cache') }}" class="btn btn-primary" onclick="$(this).html('Clear cache <i class=\'fas fa-spinner fa-spin\'></i>')">Clear cache</a>
|
||||
</p>
|
||||
|
||||
{% if content_action is defined and content_action is not empty %}
|
||||
<pre>
|
||||
{{ content_action }}
|
||||
</pre>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel box">
|
||||
<div class="box-header with-border">
|
||||
<h4 class="box-title">
|
||||
<a data-toggle="collapse" role="button" data-parent="#accordion" href="#collapseEnvironment" aria-expanded="false" aria-controls="collapseEnvironment">
|
||||
Environment
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseTwo" class="panel-collapse collapse in" aria-expanded="true" style="">
|
||||
<div id="collapseEnvironment" class="panel-collapse collapse" aria-expanded="false" role="tabpanel">
|
||||
<div class="box-body">
|
||||
|
||||
<dl>
|
||||
@@ -48,12 +67,12 @@
|
||||
<div class="panel box">
|
||||
<div class="box-header with-border">
|
||||
<h4 class="box-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapseThree" class="collapsed" aria-expanded="false">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapsePhp" class="collapsed" aria-expanded="false">
|
||||
PHP
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseThree" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">
|
||||
<div id="collapsePhp" class="panel-collapse collapse" aria-expanded="false">
|
||||
<div class="box-body">
|
||||
|
||||
<dl>
|
||||
@@ -77,12 +96,12 @@
|
||||
<div class="panel box">
|
||||
<div class="box-header with-border">
|
||||
<h4 class="box-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapseFour" class="collapsed" aria-expanded="false">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapseSystem" class="collapsed" aria-expanded="false">
|
||||
Server
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseFour" class="panel-collapse collapse" aria-expanded="false" style="height: 0px;">
|
||||
<div id="collapseSystem" class="panel-collapse collapse" aria-expanded="false">
|
||||
<div class="box-body">
|
||||
|
||||
<dl>
|
||||
@@ -96,9 +115,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="tab-pane" id="license">
|
||||
<div role="tabpanel" class="tab-pane" id="license">
|
||||
<pre>{{ license }}</pre>
|
||||
<p>
|
||||
<a href="https://choosealicense.com/licenses/mit/" target="_blank">choosealicense.com</a>,
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_page_content_before %}
|
||||
{% set event = trigger(constant('App\\Event\\ThemeEvent::CONTENT_BEFORE')) %}
|
||||
{{ event.content|raw }}
|
||||
<div class="toolbar-pad no-print">
|
||||
{% block main_before %}{% endblock %}
|
||||
</div>
|
||||
@@ -17,10 +19,16 @@
|
||||
|
||||
{% block avanzu_page_content_after %}
|
||||
{% block main_after %}{% endblock %}
|
||||
{% set event = trigger(constant('App\\Event\\ThemeEvent::CONTENT_AFTER')) %}
|
||||
{{ event.content|raw }}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_page_content %}
|
||||
{% set event = trigger(constant('App\\Event\\ThemeEvent::CONTENT_START')) %}
|
||||
{{ event.content|raw }}
|
||||
{% block main %}{% endblock %}
|
||||
{% set event = trigger(constant('App\\Event\\ThemeEvent::CONTENT_END')) %}
|
||||
{{ event.content|raw }}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_document_title %}
|
||||
|
||||
@@ -222,3 +222,25 @@
|
||||
{{ widgets.page_actions(event.payload.actions) }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro plugins(view) %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% set actions = {'shop': {'url': constant('App\\Constants::HOMEPAGE') ~ '/store/', 'target': '_blank'}} %}
|
||||
|
||||
{% set event = trigger('actions.plugins', {'actions': actions, 'view': view}) %}
|
||||
{{ widgets.page_actions(event.payload.actions) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro plugin(plugin, view) %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% set actions = {'home': {'url': plugin.metadata.homepage, 'target': '_blank'}} %}
|
||||
|
||||
{% set event = trigger('actions.plugin', {'actions': actions, 'view': view}) %}
|
||||
{% if view == 'index' %}
|
||||
{{ widgets.button_group(event.payload.actions) }}
|
||||
{% else %}
|
||||
{{ widgets.page_actions(event.payload.actions) }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
@@ -153,6 +153,7 @@
|
||||
{% set modal = null %}
|
||||
{% set toggle = null %}
|
||||
{% set url = null %}
|
||||
{% set target = null %}
|
||||
{% set class = "btn btn-default btn-" ~ icon ~ " " %}
|
||||
|
||||
{% if not values is iterable %}
|
||||
@@ -173,6 +174,7 @@
|
||||
{% set onclick = values.onclick ?? null %}
|
||||
{% set modal = values.modal ?? null %}
|
||||
{% set toggle = values.toggle ?? null %}
|
||||
{% set target = values.target ?? null %}
|
||||
{% set id = values.id ?? null %}
|
||||
{% set class = class ~ ( values.class | default("")) %}
|
||||
{% endif %}
|
||||
@@ -190,6 +192,9 @@
|
||||
{%- if onclick is not empty -%}
|
||||
onclick="{{ onclick }}"
|
||||
{%- endif -%}
|
||||
{%- if target is not empty -%}
|
||||
target="{{ target }}"
|
||||
{%- endif -%}
|
||||
>{{ macro.icon(icon) }}</a>
|
||||
{% endfor -%}
|
||||
</div>
|
||||
|
||||
58
templates/plugin/index.html.twig
Normal file
58
templates/plugin/index.html.twig
Normal file
@@ -0,0 +1,58 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
{% import "macros/actions.html.twig" as actions %}
|
||||
|
||||
{% block page_title %}{{ 'plugins.title'|trans({}, 'plugins') }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'plugins.subtitle'|trans({}, 'plugins') }}{% endblock %}
|
||||
{% block page_actions %}{{ actions.plugins('index') }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
{% if plugins|length == 0 %}
|
||||
{{ widgets.callout('warning', 'plugin.none_installed'|trans({}, 'plugins')) }}
|
||||
{% else %}
|
||||
<div class="box data_table" id="datatable_plugins">
|
||||
<div class="box-body no-padding">
|
||||
<div class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-striped table-hover dataTable" role="grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'label.name'|trans }}</th>
|
||||
<th>{{ 'label.version'|trans({}, 'plugins') }}</th>
|
||||
<th class="hidden-xs">{{ 'label.description'|trans }}</th>
|
||||
<th class="hidden-xs hidden-sm">{{ 'label.required_version'|trans({}, 'plugins') }}</th>
|
||||
<th>{{ 'label.actions'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for plugin in plugins %}
|
||||
<tr>
|
||||
<td>{{ plugin.name }}</td>
|
||||
<td>{{ widgets.label(plugin.metadata.version, 'primary') }}</td>
|
||||
<td class="hidden-xs">{{ plugin.metadata.description }}</td>
|
||||
<td class="hidden-xs hidden-sm">
|
||||
{% if plugin.metadata.kimaiVersion > constant('App\\Constants::VERSION') %}
|
||||
{{ widgets.label(plugin.metadata.kimaiVersion, 'danger') }}
|
||||
{% elseif plugin.metadata.kimaiVersion < constant('App\\Constants::VERSION') %}
|
||||
{{ widgets.label(plugin.metadata.kimaiVersion, 'warning') }}
|
||||
{% else %}
|
||||
{{ widgets.label(plugin.metadata.kimaiVersion, 'success') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ actions.plugin(plugin, 'index') }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user