detail pages for customers and projects (#1371)
This commit is contained in:
@@ -1,58 +1,21 @@
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% set teams = data %}
|
||||
{% set title = options.title|default('label.my_teams') %}
|
||||
{% set title = options.title|default(title|default('label.teams')) %}
|
||||
{% set widgetId = options.id %}
|
||||
|
||||
|
||||
{% if teams|length > 0 %}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-{{ admin_lte_context.widget.type }} WidgetUserTeams" id="{{ widgetId }}">
|
||||
{% if not title is empty %}
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ title|trans }}</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="box-body">
|
||||
<table class="table table-hover dataTable" role="grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'label.team'|trans }}</th>
|
||||
<th class="text-center">{{ 'label.teamlead'|trans }}</th>
|
||||
<th>{{ 'label.user'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for team in teams %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ team.name }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ widgets.user_avatar(team.teamlead) }}
|
||||
</td>
|
||||
<td class="avatars">
|
||||
{% set userTeamCount = team.users|length %}
|
||||
{% for user in team.users %}
|
||||
{% set teamHiddenId = widgetId ~ '_' ~ team.id ~ '_hiddenUser' %}
|
||||
{{ widgets.user_avatar(user) }}
|
||||
{% if userTeamCount > 5 and loop.index == 5 and not loop.last %}
|
||||
<a href="#" onclick="$('#{{ teamHiddenId }}').toggleClass('hidden');$(this).hide();return false;" class="badge">{{ 'label.plus_more'|trans({'%count%': (userTeamCount - 5)}) }}</a>
|
||||
<span class="hidden" id="{{ teamHiddenId }}">
|
||||
{% endif %}
|
||||
{% if userTeamCount > 5 and loop.index != 5 and loop.last %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% embed '@AdminLTE/Widgets/box-widget.html.twig' with {'border': false} %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
{% block box_title %}{{ title|trans }}{% endblock %}
|
||||
{% block box_attributes %}id="{{ widgetId }}"{% endblock %}
|
||||
{% block box_body_class %}no-padding{% endblock %}
|
||||
{% block box_body %}
|
||||
{{ widgets.team_list(teams, false) }}
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user