84 lines
4.6 KiB
Twig
84 lines
4.6 KiB
Twig
{% extends 'base.html.twig' %}
|
|
{% import "macros/widgets.html.twig" as widgets %}
|
|
{% import "macros/datatables.html.twig" as tables %}
|
|
{% import "macros/search.html.twig" as search %}
|
|
{% import "project/actions.html.twig" as actions %}
|
|
|
|
{% set columns = {
|
|
'name': {'class': 'alwaysVisible'},
|
|
'customer': {'class': 'hidden-xs'},
|
|
'comment': {'class': 'hidden-xs hidden-sm', 'title': 'label.description'|trans},
|
|
'orderNumber': {'class': 'hidden-xs hidden-sm hidden'},
|
|
'orderDate': {'class': 'hidden-xs hidden-sm hidden'},
|
|
'project_start': {'class': 'hidden-xs hidden-sm hidden'},
|
|
'project_end': {'class': 'hidden-xs hidden-sm hidden'},
|
|
} %}
|
|
{% for field in metaColumns %}
|
|
{% set columns = columns|merge({
|
|
('mf_' ~ field.name): {'title': field.label|trans, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
|
|
}) %}
|
|
{% endfor %}
|
|
{% set columns = columns|merge({
|
|
'budget': {'class': 'hidden-xs hidden-sm hidden text-center w-min', 'title': 'label.budget'|trans},
|
|
'timeBudget': {'class': 'hidden-xs hidden-sm hidden text-center w-min', 'title': 'label.timeBudget'|trans},
|
|
'team': {'class': 'text-center w-min', 'orderBy': false},
|
|
'visible': {'class': 'text-center hidden w-min'},
|
|
'actions': {'class': 'actions alwaysVisible'},
|
|
}) %}
|
|
|
|
{% set tableName = 'project_admin' %}
|
|
|
|
{% block page_title %}{{ 'admin_project.title'|trans }}{% endblock %}
|
|
{% block page_search %}{{ search.searchModal(toolbarForm) }}{% endblock %}
|
|
{% block page_actions %}{{ actions.projects('index') }}{% endblock %}
|
|
|
|
{% block main_before %}
|
|
{{ tables.data_table_column_modal(tableName, columns) }}
|
|
{% endblock %}
|
|
|
|
{% block main %}
|
|
|
|
{% if entries.count == 0 %}
|
|
{{ widgets.nothing_found('kimai.projectUpdate kimai.projectTeamUpdate') }}
|
|
{% else %}
|
|
{{ tables.datatable_header(tableName, columns, query, {'reload': 'kimai.projectUpdate kimai.projectDelete kimai.projectTeamUpdate'}) }}
|
|
|
|
{% for entry in entries %}
|
|
<tr {{ widgets.project_row_attr(entry, now) }}>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'name') }}">{{ widgets.label_color_dot('project', true, entry.name, null, entry.color) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'customer') }}">{{ widgets.label_customer(entry.customer) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'comment') }}">{{ entry.comment|comment1line }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'orderNumber') }}">{{ entry.orderNumber }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'orderDate') }}">{% if entry.orderDate is not null %}{{ entry.orderDate|date_full }}{% endif %}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'project_start') }}">{% if entry.start is not null %}{{ entry.start|date_full }}{% endif %}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'project_end') }}">{% if entry.end is not null %}{{ entry.end|date_full }}{% endif %}</td>
|
|
{% for field in metaColumns %}
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'mf_' ~ field.name) }}">
|
|
{{ tables.datatable_meta_column(entry, field) }}
|
|
</td>
|
|
{% endfor %}
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'budget') }}">
|
|
{% if entry.hasBudget() %}
|
|
{{ entry.budget|money(entry.customer.currency) }}
|
|
{% else %}
|
|
–
|
|
{% endif %}
|
|
</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'timeBudget') }}">
|
|
{% if entry.hasBudget() %}
|
|
{{ entry.timeBudget|duration }}
|
|
{% else %}
|
|
–
|
|
{% endif %}
|
|
</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'team') }}">{{ widgets.badge_team_access(entry.teams) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'visible') }}">{{ widgets.label_visible(entry.visible) }}</td>
|
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'actions') }}">{{ actions.project(entry, 'index') }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
|
|
{{ tables.data_table_footer(entries, 'admin_project_paginated') }}
|
|
{% endif %}
|
|
|
|
{% endblock %}
|