added team permissions (#996)

This commit is contained in:
Kevin Papst
2019-08-16 01:22:33 +02:00
committed by GitHub
parent 9611646bc6
commit 561ec3b1e9
124 changed files with 4122 additions and 362 deletions

View File

@@ -0,0 +1,34 @@
{% extends 'base.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/actions.html.twig" as actions %}
{% block page_title %}{{ 'teams.title'|trans({}, 'teams') }}{% endblock %}
{% block page_subtitle %}{{ 'teams.subtitle'|trans({}, 'teams') }}{% endblock %}
{% block page_actions %}{{ actions.team(team, 'edit') }}{% endblock %}
{% block main %}
<div class="row">
<div class="col-md-6">
{{ include('default/_form.html.twig', {
'title': team.name|default('create'|trans),
'form': form,
'back': path('admin_team')
}) }}
</div>
<div class="col-md-6">
{% if not customerForm is null %}
{{ include('default/_form.html.twig', {
'title': 'teams.customer_access'|trans({}, 'teams'),
'form': customerForm,
}) }}
{% endif %}
{% if not projectForm is null %}
{{ include('default/_form.html.twig', {
'title': 'teams.project_access'|trans({}, 'teams'),
'form': projectForm,
}) }}
{% endif %}
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,49 @@
{% extends 'base.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/actions.html.twig" as actions %}
{% import "macros/datatables.html.twig" as tables %}
{% import "macros/toolbar.html.twig" as toolbar %}
{% block page_title %}{{ 'teams.title'|trans({}, 'teams') }}{% endblock %}
{% block page_subtitle %}{{ 'teams.subtitle'|trans({}, 'teams') }}{% endblock %}
{% block page_actions %}{{ actions.teams('index') }}{% endblock %}
{% block main_before %}
{{ toolbar.toolbar(toolbarForm, 'collapseTeams', showFilter) }}
{% endblock %}
{% block main %}
{% if teams|length == 0 %}
{{ widgets.callout('warning', 'error.no_entries_found') }}
{% else %}
{% set columns = {
'name': '',
'teamlead': '',
'user': '',
'actions': 'actions alwaysVisible',
} %}
{% set tableName = 'admin_teams' %}
{{ tables.data_table_header(tableName, columns, false, 'kimai.teamUpdate') }}
{% for team in teams %}
<tr{% if is_granted('edit', team) %} class="open-edit alternative-link" data-href="{{ path('admin_team_edit', {'id': team.id}) }}"{% endif %}>
<td>{{ team.name }}</td>
<td>{{ widgets.label_user(team.teamlead) }}</td>
<td>
{% for user in team.users %}
{{ widgets.label_user(user) }}&nbsp;
{% endfor %}
</td>
<td class="actions">
{{ actions.team(team, 'index') }}
</td>
</tr>
{% endfor %}
{{ tables.data_table_footer(teams, 'admin_team_paginated') }}
{% endif %}
{% endblock %}