added documentation links to all screens (#1044)

This commit is contained in:
Kevin Papst
2019-08-19 12:53:36 +02:00
committed by GitHub
parent 025c6b0e7b
commit 299fcb091a
7 changed files with 45 additions and 12 deletions

View File

@@ -2,6 +2,7 @@
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/toolbar.html.twig" as toolbar %}
{% import "macros/datatables.html.twig" as tables %}
{% import "macros/actions.html.twig" as actions %}
{% set columns = {
'date': 'alwaysVisible',
@@ -20,14 +21,7 @@
{% block page_title %}{{ 'export.title'|trans }}{% endblock %}
{% block page_subtitle %}{{ 'export.subtitle'|trans }}{% endblock %}
{% block page_actions %}
{% set actions = {
'filter': '#collapseExport',
'visibility': '#modal_export',
'off': {'id':'export-toggle-button'}
} %}
{{ widgets.page_actions(actions) }}
{% endblock %}
{% block page_actions %}{{ actions.export('index') }}{% endblock %}
{% block main_before %}
{{ toolbar.toolbar(form, 'collapseExport', true) }}

View File

@@ -7,6 +7,8 @@
{% set actions = actions|merge({'create': path('admin_activity_create')}) %}
{% endif %}
{% set actions = actions|merge({'help': {'url': 'activity.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.activities', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
@@ -73,6 +75,8 @@
{% set actions = actions|merge({'help': {'url': 'permissions.html'|docu_link, 'target': '_blank'}}) %}
{% endif %}
{% set actions = actions|merge({'help': {'url': 'users.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.users', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
@@ -126,6 +130,8 @@
{% set actions = actions|merge({'create': path('admin_project_create')}) %}
{% endif %}
{% set actions = actions|merge({'help': {'url': 'project.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.projects', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
@@ -182,6 +188,8 @@
{% set actions = actions|merge({'create': path('admin_customer_create')}) %}
{% endif %}
{% set actions = actions|merge({'help': {'url': 'customer.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.customers', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
@@ -257,6 +265,8 @@
{% set actions = actions|merge({'create': {'url': path('timesheet_create'), 'class': 'modal-ajax-form'}}) %}
{% endif %}
{% set actions = actions|merge({'help': {'url': 'timesheet.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.timesheets', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
@@ -313,6 +323,8 @@
{% set actions = actions|merge({'create': {'url': path('admin_timesheet_create'), 'class': 'modal-ajax-form'}}) %}
{% endif %}
{% set actions = actions|merge({'help': {'url': 'timesheet.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.timesheets_team', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
@@ -359,6 +371,7 @@
{% import "macros/widgets.html.twig" as widgets %}
{% set actions = {'shop': {'url': constant('App\\Constants::HOMEPAGE') ~ '/store/', 'target': '_blank'}} %}
{% set actions = actions|merge({'help': {'url': 'plugins.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.plugins', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
@@ -393,6 +406,8 @@
{% import "macros/widgets.html.twig" as widgets %}
{% set actions = {'filter': '#collapseTags'} %}
{% set actions = actions|merge({'help': {'url': 'tags.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.tags', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
@@ -414,6 +429,26 @@
{{ widgets.table_actions(event.payload.actions) }}
{% endmacro %}
{% macro system_configuration(view) %}
{% import "macros/widgets.html.twig" as widgets %}
{% set actions = {} %}
{% set actions = actions|merge({'help': {'url': 'configurations.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.system_configuration', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
{% macro export(view) %}
{% import "macros/widgets.html.twig" as widgets %}
{% set actions = {'filter': '#collapseExport', 'visibility': '#modal_export', 'off': {'id':'export-toggle-button'}} %}
{% set actions = actions|merge({'help': {'url': 'export.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.export', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}
{% macro invoices(view) %}
{% import "macros/widgets.html.twig" as widgets %}
@@ -457,6 +492,8 @@
{% set actions = actions|merge({'create': {'url': path('admin_team_create')}}) %}
{% endif %}
{% set actions = actions|merge({'help': {'url': 'teams.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.teams', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}

View File

@@ -1,7 +1,9 @@
{% extends 'base.html.twig' %}
{% import "macros/actions.html.twig" as actions %}
{% block page_title %}{{ 'title'|trans({}, 'system-configuration') }}{% endblock %}
{% block page_subtitle %}{{ 'subtitle'|trans({}, 'system-configuration') }}{% endblock %}
{% block page_actions %}{{ actions.system_configuration('index') }}{% endblock %}
{% block main %}

View File

@@ -29,7 +29,7 @@ class PluginControllerTest extends ControllerBaseTest
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
$this->assertAccessIsGranted($client, '/admin/plugins/');
$this->assertCalloutWidgetWithMessage($client, 'You have no plugins installed yet');
$this->assertPageActions($client, ['shop' => 'https://www.kimai.org/store/']);
$this->assertPageActions($client, ['shop' => 'https://www.kimai.org/store/', 'help' => 'https://www.kimai.org/documentation/plugins.html']);
}
public function testIndexActionWithInstalledPlugins()

View File

@@ -37,7 +37,7 @@ class TeamControllerTest extends ControllerBaseTest
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->assertAccessIsGranted($client, '/admin/teams/');
$this->assertPageActions($client, ['create' => $this->createUrl('/admin/teams/create')]);
$this->assertPageActions($client, ['create' => $this->createUrl('/admin/teams/create'), 'help' => 'https://www.kimai.org/documentation/teams.html']);
$this->assertHasDataTable($client);
$this->assertDataTableRowCount($client, 'datatable_admin_teams', 5);
}

View File

@@ -35,7 +35,7 @@ class TimesheetControllerTest extends ControllerBaseTest
$this->assertHasNoEntriesWithFilter($client);
$result = $client->getCrawler()->filter('div.breadcrumb div.box-tools div.btn-group a.btn');
$this->assertEquals(4, count($result));
$this->assertEquals(5, count($result));
foreach ($result as $item) {
$this->assertContains('btn btn-default', $item->getAttribute('class'));

View File

@@ -35,7 +35,7 @@ class TimesheetTeamControllerTest extends ControllerBaseTest
$this->assertHasNoEntriesWithFilter($client);
$result = $client->getCrawler()->filter('div.breadcrumb div.box-tools div.btn-group a.btn');
$this->assertEquals(4, count($result));
$this->assertEquals(5, count($result));
foreach ($result as $item) {
$this->assertContains('btn btn-default', $item->getAttribute('class'));