prepare release 1.13 (#2290)

* make voters a final class
* upgrade dependencies
* sort project alphabetically in dashboard widget
* open detail page on row click
* do not break on null tag name
* added max height to scrollable widgets on dashboard
* added timesheet duplicate event
* allow to deactivate browser title update
* improve comment box
* moved role permissions to own menu
* removed tabs in user screen
* fix user can remove super-admin from own account
This commit is contained in:
Kevin Papst
2021-02-01 23:43:47 +01:00
committed by GitHub
parent a034b3519e
commit 8d41fa20bd
59 changed files with 693 additions and 232 deletions

View File

@@ -237,6 +237,7 @@
autoReloadDatatable: {% if theme_config('auto_reload_datatable') %}true{% else %}false{% endif %},
autoComplete: {{ theme_config('autocomplete_chars') }},
defaultColor: '{{ constant('App\\Constants::DEFAULT_COLOR') }}',
updateBrowserTitle: {% if app.user.preferenceValue('theme.update_browser_title') %}true{% else %}false{% endif %}
},
{
{% for key, translation in javascript_translations() -%}

View File

@@ -1,8 +1,8 @@
{% embed '@AdminLTE/Widgets/box-widget.html.twig' with {'form': form, 'comments': comments, 'route_pin': route_pin|default(null), 'route_delete': route_delete|default(null)} %}
{% embed '@AdminLTE/Widgets/box-widget.html.twig' with {'form': form, 'comments': comments, 'route_pin': route_pin|default(null), 'route_delete': route_delete|default(null), 'delete_by_user': delete_by_user|default(false)} %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}{{ 'label.comment'|trans }}{% endblock %}
{% block box_attributes %}id="comments_box"{% endblock %}
{% block box_body_class %}box-comments{% endblock %}
{% block box_body_class %}box-body-scrollable{% endblock %}
{% block box_body %}
{% set replacer = {} %}
{% for pref in app.user.preferences %}
@@ -10,42 +10,52 @@
{% endfor %}
{% if comments|length == 0 %}
{{ 'error.no_comments_found'|trans }}
{% endif %}
{% for comment in comments %}
<div class="box-comment">
{{ widgets.user_avatar(comment.createdBy, comment.createdAt|date_full, 'img-sm') }}
<div class="comment-text">
<span class="username">
{{ widgets.username(comment.createdBy) }}
<span class="text-muted pull-right">
{% if route_pin is not null %}
<a href="{{ path(route_pin, {'id': comment.id}) }}" class="btn btn-default btn-xs {% if comment.pinned %}active{% endif %}"><i class="{{ 'pin'|icon }}"></i></a>
{% elseif comment.pinned %}
<i class="{{ 'pin'|icon }}"></i>
{% endif %}
{% if route_delete is not null %}
<a href="{{ path(route_delete, {'id': comment.id}) }}" class="confirmation-link btn btn-default btn-xs" data-question="confirm.delete"><i class="{{ 'delete'|icon }}"></i></a>
{% endif %}
{% else %}
{% for comment in comments %}
<div class="direct-chat-msg">
<div class="direct-chat-info clearfix">
<span class="direct-chat-name pull-left">
{{ widgets.username(comment.createdBy) }}
</span>
</span>
{{ comment.message|replace(replacer)|md2html }}
<span class="direct-chat-timestamp pull-left">
&nbsp;
{{ comment.createdAt|date_full }}
&nbsp;
</span>
<span class="pull-right">
{% if route_pin is not null %}
<a href="{{ path(route_pin, {'id': comment.id}) }}" class="btn btn-default btn-xs {% if comment.pinned %}active{% endif %}"><i class="{{ 'pin'|icon }}"></i></a>
{% elseif comment.pinned %}
<i class="{{ 'pin'|icon }}"></i>
{% endif %}
{% if route_delete is not null and ((not delete_by_user) or (delete_by_user and comment.createdBy.id == app.user.id)) %}
<a href="{{ path(route_delete, {'id': comment.id}) }}" class="confirmation-link btn btn-default btn-xs" data-question="confirm.delete"><i class="{{ 'delete'|icon }}"></i></a>
{% endif %}
</span>
</div>
{{ widgets.user_avatar(comment.createdBy, false, 'direct-chat-img img-sm') }}
<div class="direct-chat-text">
{{ comment.message|replace(replacer)|md2html }}
</div>
</div>
</div>
{% endfor %}
{% endfor %}
{% endif %}
{% endblock %}
{% block box_footer -%}
{% if form is not null %}
{{ form_start(form) }}
<div class="input-group">
{{ widgets.user_avatar(app.user, false, 'img-responsive img-sm') }}
<div class="img-push">
{{ form_widget(form.message, {'attr': {'rows': '1', 'placeholder': 'placeholder.type_message'|trans}}) }}
</div>
<span class="input-group-btn">
<div class="row">
<div class="col-md-12">
{{ form_widget(form.message, {'attr': {'rows': '3', 'placeholder': 'placeholder.type_message'|trans, 'style': 'margin-bottom: 5px'}}) }}
<button type="submit" class="btn btn-default">
<i class="{{ 'comment'|icon }}"></i>
{{ 'label.comment'|trans }}
</button>
</span>
</div>
</div>
<div class="row">
<div class="col-md-12">
</div>
</div>
{{ form_widget(form) }}
{{ form_end(form) }}

View File

@@ -232,14 +232,16 @@
<ul class="dropdown-menu dropdown-menu-right">
{%- apply spaceless -%}
{%- for icon,values in actions %}
{% if icon == 'divider' and values is null %}
{% if 'divider' in icon and values is null %}
{% if not loop.last and divider is same as (false) %}
<li class="divider"></li>
{% endif %}
{% set divider = true %}
{% else %}
{% if values is iterable %}
{% set values = values|merge({'title': icon|trans({}, 'actions')}) %}
{% if values['title'] is not defined %}
{% set values = values|merge({'title': icon|trans({}, 'actions')}) %}
{% endif %}
{% else %}
{% set values = {'url': values, 'title': icon|trans({}, 'actions')} %}
{% endif %}
@@ -301,6 +303,7 @@
{% set url = '#' %}
{% endif %}
{% else %}
{% set icon = values.icon ?? icon %}
{% set disabled = values.disabled ?? false %}
{% set url = values.url ?? '#' %}
{% set onclick = values.onclick ?? null %}

View File

@@ -60,12 +60,12 @@
{% endif %}
{% endif %}
{% if view != 'index' %}
{% if view != 'index' and view != 'custom' %}
{% set actions = actions|merge({'back': options.back|default(path('timesheet'))}) %}
{% endif %}
{% set event = trigger('actions.timesheet', {'actions': actions, 'view': view, 'timesheet': timesheet}) %}
{% if view == 'index' %}
{% if view == 'index' or view == 'custom' %}
{{ widgets.table_actions(event.payload.actions) }}
{% else %}
{{ widgets.entity_actions(event.payload.actions) }}

View File

@@ -11,10 +11,6 @@
{% set actions = actions|merge({'download': {'url': path('user_export'), 'class': 'toolbar-action'}}) %}
{% if is_granted('role_permissions') %}
{% set actions = actions|merge({'permissions': path('admin_user_permissions')}) %}
{% endif %}
{% if is_granted('create_user') %}
{% set actions = actions|merge({'create': {'url': path('admin_user_create')}}) %}
{% endif %}
@@ -35,16 +31,12 @@
{% import "macros/widgets.html.twig" as widgets %}
{% set actions = {} %}
{% if is_granted('view_user') %}
{% set actions = actions|merge({'back': path('admin_user')}) %}
{% endif %}
{% if view != 'index' and is_granted('role_permissions') %}
{% set actions = actions|merge({'permissions': path('admin_user_permissions')}) %}
{% endif %}
{% if view != 'role' and is_granted('role_permissions') %}
{% set actions = actions|merge({'roles': {'url': path('admin_user_roles'), 'class': 'modal-ajax-form'}}) %}
{% set actions = actions|merge({'create': {'url': path('admin_user_roles'), 'class': 'modal-ajax-form'}}) %}
{% endif %}
{% set actions = actions|merge({'help': {'url': 'permissions.html'|docu_link, 'target': '_blank'}}) %}
@@ -62,15 +54,34 @@
{% if is_granted('view', user) %}
{% set actions = actions|merge({'profile-stats': {'url': path('user_profile', {'username' : user.username})}}) %}
{% endif %}
{% if is_granted('edit', user) %}
{% set actions = actions|merge({'edit': path('user_profile_edit', {'username' : user.username})}) %}
{% endif %}
{% if is_granted('preferences', user) %}
{% set actions = actions|merge({'settings': {'url': path('user_profile_preferences', {'username' : user.username})}}) %}
{% endif %}
{% if actions|length > 0 %}
{% set actions = actions|merge({'divider': null}) %}
{% endif %}
{% set subActions = {} %}
{% if is_granted('edit', user) %}
{% set subActions = subActions|merge({'edit': path('user_profile_edit', {'username' : user.username})}) %}
{% endif %}
{% if is_granted('preferences', user) %}
{% set subActions = subActions|merge({'settings': {'url': path('user_profile_preferences', {'username' : user.username})}}) %}
{% endif %}
{% if is_granted('password', user) %}
{% set subActions = subActions|merge({'password': {'url': path('user_profile_password', {'username' : user.username}), 'title': ('profile.password'|trans)}}) %}
{% endif %}
{% if is_granted('api-token', user) %}
{% set subActions = subActions|merge({'api-token': {'url': path('user_profile_api_token', {'username' : user.username}), 'title': ('profile.api-token'|trans)}}) %}
{% endif %}
{% if is_granted('teams', user) %}
{% set subActions = subActions|merge({'teams': {'url': path('user_profile_teams', {'username' : user.username}), 'title': ('profile.teams'|trans)}}) %}
{% endif %}
{% if is_granted('roles', user) %}
{% set subActions = subActions|merge({'roles': {'url': path('user_profile_roles', {'username' : user.username}), 'title': ('profile.roles'|trans)}}) %}
{% endif %}
{% if subActions|length > 0 %}
{% set actions = actions|merge(subActions) %}
{% set actions = actions|merge({'divider2': null}) %}
{% endif %}
{% if is_granted('view_reporting') %}
{% if view_other or app.user.id == user.id %}
{% set actions = actions|merge({'report': path('report_user_month', {'user': user.id})}) %}
@@ -87,7 +98,6 @@
{% if options.back is defined %}
{% set actions = actions|merge({'back': options.back}) %}
{% endif %}
{% set event = trigger('actions.user', {'actions': actions, 'view': view, 'user': user}) %}
{% if view == 'index' %}
{{ widgets.table_actions(event.payload.actions) }}

View File

@@ -0,0 +1,20 @@
{% extends 'user/layout.html.twig' %}
{% block main %}
{% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}{{ ('profile.' ~ tab)|trans }}{% endblock %}
{% block box_tools %}
<a class="btn btn-box-tool" target="_blank" href="{{ path('app.swagger_ui') }}"><i class="{{ 'api'|icon('fas fa-book') }}"></i></a>
<a class="btn btn-box-tool" target="_blank" href="{{ 'rest-api.html'|docu_link }}"><i class="{{ 'help'|icon }}"></i></a>
{% endblock %}
{% block box_body %}
{{ form_start(form) }}
{{ form_widget(form) }}
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
{{ form_end(form) }}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -23,7 +23,7 @@
{% set tableName = 'user_admin_permissions' %}
{% block page_title %}{{ 'user_permissions.title'|trans }}{% endblock %}
{% block page_title %}{{ 'profile.roles'|trans }}{% endblock %}
{% block page_actions %}{{ actions.user_permissions('index') }}{% endblock %}
{% block main %}

View File

@@ -1,25 +1,16 @@
{% extends 'user/layout.html.twig' %}
{% block main %}
<div class="row">
<div class="col-md-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
{% for formName, form in forms %}
<li {% if tab == formName %}class="active"{% endif %}><a href="#{{ formName }}" data-toggle="tab" aria-expanded="false">{{ ('profile.' ~ formName)|trans }}</a></li>
{% endfor %}
</ul>
<div class="tab-content">
{% for formName, form in forms %}
<div class="tab-pane {% if tab == formName %}active{% endif %}" id="{{ formName }}">
{{ form_start(form) }}
{{ form_widget(form) }}
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
{{ form_end(form) }}
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
{% import "macros/widgets.html.twig" as widgets %}
{% block box_title %}{{ ('profile.' ~ tab)|trans }}{% endblock %}
{% block box_body %}
{{ form_start(form) }}
{{ form_widget(form) }}
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
{{ form_end(form) }}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -9,17 +9,17 @@
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/progressbar.html.twig" as progress %}
{% block box_attributes %}id="{{ widgetId }}"{% endblock %}
{% block box_body_class %}no-padding{% endblock %}
{% block box_body_class %}no-padding box-body-scrollable{% endblock %}
{% block box_title %}
{% if not title is empty %}{{ title|trans }}{% endif %}
{% endblock %}
{% block box_body %}
<table class="table table-hover dataTable" role="grid">
<tbody>
{% for stats in projectStats %}
{% for stats in projectStats|sort((a, b) => a.project.name <=> b.project.name) %}
{% set project = stats.project %}
<tr>
<td>
<td{% if is_granted('details', stats.project) %} class="alternative-link open-edit" data-href="{{ path('project_details', {'id': stats.project.id}) }}"{% endif %}>
{{ widgets.label_project(stats.project) }}
<br>
<small>{{ widgets.label_customer(stats.project.customer) }}</small>

View File

@@ -9,7 +9,7 @@
{% 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_class %}no-padding box-body-scrollable{% endblock %}
{% block box_body %}
{{ widgets.team_list(teams, false) }}
{% endblock %}