improvements
This commit is contained in:
@@ -38,8 +38,8 @@ $ composer install
|
|||||||
|
|
||||||
Lets prepare the environment
|
Lets prepare the environment
|
||||||
```bash
|
```bash
|
||||||
$ php bin/console assets:install --symlink
|
$ php bin/console assets:install --symlink --relative
|
||||||
$ php bin/console avanzu:admin:fetch-vendor
|
$ php bin/console avanzu:admin:initialize --symlink --relative
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<!-- User Account: style can be found in dropdown.less -->
|
||||||
|
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||||
|
<li class="dropdown user user-menu">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||||
|
{{ macro.avatar(user.avatar, user.username, 'user-image') }}
|
||||||
|
<span class="hidden-xs">{{ user.name }}</span>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<!-- User image -->
|
||||||
|
<li class="user-header">
|
||||||
|
{{ macro.avatar(user.avatar, user.username) }}
|
||||||
|
<p>
|
||||||
|
{{user.name}} - {{user.title}}
|
||||||
|
<small>{{ 'Member since %date%'|trans({'%date%': user.memberSince|date('m.Y') }, 'AvanzuAdminTheme') }}</small>
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
{#
|
||||||
|
<!-- Menu Body -->
|
||||||
|
<li class="user-body">
|
||||||
|
<div class="col-xs-4 text-center">
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-4 text-center">
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-4 text-center">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
#}
|
||||||
|
<!-- Menu Footer-->
|
||||||
|
<li class="user-footer">
|
||||||
|
<div class="pull-left">
|
||||||
|
<a href="{{ path('profile'|route_alias, {'ident' : user.identifier}) }}" class="btn btn-default btn-flat">{{'Profile'|trans({}, 'AvanzuAdminTheme')}}</a>
|
||||||
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
<a href="{{ logout_path() }}" class="btn btn-default btn-flat">{{ 'Sign out'|trans({}, 'AvanzuAdminTheme') }}</a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
19
app/Resources/translations/AvanzuAdminTheme.de.xliff
Normal file
19
app/Resources/translations/AvanzuAdminTheme.de.xliff
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
|
<file source-language="en" target-language="de" datatype="plaintext" original="not.available">
|
||||||
|
<body>
|
||||||
|
<trans-unit id="Member since %date%">
|
||||||
|
<source>Member since %date%</source>
|
||||||
|
<target>Mitglied seit %date%</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="Profile">
|
||||||
|
<source>Profile</source>
|
||||||
|
<target>Profil</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="Sign out">
|
||||||
|
<source>Sign out</source>
|
||||||
|
<target>Abmelden</target>
|
||||||
|
</trans-unit>
|
||||||
|
</body>
|
||||||
|
</file>
|
||||||
|
</xliff>
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
<file date="2016-10-19T21:46:45Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
|
<file date="2016-10-19T21:46:45Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
|
||||||
<body>
|
<body>
|
||||||
|
<!--
|
||||||
|
Global template keys
|
||||||
|
-->
|
||||||
<trans-unit id="browser.title">
|
<trans-unit id="browser.title">
|
||||||
<source>browser.title</source>
|
<source>browser.title</source>
|
||||||
<target>Kimai - Time Tracking</target>
|
<target>Kimai - Time Tracking</target>
|
||||||
@@ -11,6 +14,57 @@
|
|||||||
<target>Kimai</target>
|
<target>Kimai</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Login / Security
|
||||||
|
-->
|
||||||
|
<trans-unit id="security.title.login">
|
||||||
|
<source>security.title.login</source>
|
||||||
|
<target>Anmelden</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="security.label.username">
|
||||||
|
<source>security.label.username</source>
|
||||||
|
<target>Benutzername</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="security.label.password">
|
||||||
|
<source>security.label.password</source>
|
||||||
|
<target>Passwort</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="security.action.sign_in">
|
||||||
|
<source>security.action.sign_in</source>
|
||||||
|
<target>Los geht's</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Menu / Navbar items
|
||||||
|
-->
|
||||||
|
<trans-unit id="menu.homepage">
|
||||||
|
<source>menu.homepage</source>
|
||||||
|
<target>Dashboard</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="menu.admin">
|
||||||
|
<source>menu.admin</source>
|
||||||
|
<target>Administration</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="menu.logout">
|
||||||
|
<source>menu.logout</source>
|
||||||
|
<target>Abmelden</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="menu.timesheet">
|
||||||
|
<source>menu.timesheet</source>
|
||||||
|
<target>Zeiterfassung</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Footer
|
||||||
|
-->
|
||||||
|
<trans-unit id="footer.license">
|
||||||
|
<source>footer.license</source>
|
||||||
|
<target>Alle Rechte vorbehalten.</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Error templates
|
||||||
|
-->
|
||||||
<trans-unit id="http_error.name">
|
<trans-unit id="http_error.name">
|
||||||
<source>http_error.name</source>
|
<source>http_error.name</source>
|
||||||
<target>Error</target>
|
<target>Error</target>
|
||||||
@@ -48,58 +102,34 @@
|
|||||||
<target>Error</target>
|
<target>Error</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
|
||||||
<trans-unit id="action.browse_admin">
|
<!--
|
||||||
<source>action.browse_admin</source>
|
General labels
|
||||||
<target>Zum Backend</target>
|
-->
|
||||||
|
<trans-unit id="label.date">
|
||||||
|
<source>label.date</source>
|
||||||
|
<target>Datum</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="help.browse_admin">
|
<trans-unit id="label.starttime">
|
||||||
<source>help.browse_admin</source>
|
<source>label.starttime</source>
|
||||||
<target>Zum Backend</target>
|
<target>Begin</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="action.browse_app">
|
<trans-unit id="label.endtime">
|
||||||
<source>action.browse_app</source>
|
<source>label.endtime</source>
|
||||||
<target>Zum Frontend</target>
|
<target>Ende</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="help.browse_app">
|
<trans-unit id="label.duration">
|
||||||
<source>help.browse_app</source>
|
<source>label.duration</source>
|
||||||
<target>Zum Frontend</target>
|
<target>Dauer</target>
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="title.login">
|
|
||||||
<source>title.login</source>
|
|
||||||
<target>Anmelden</target>
|
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="label.username">
|
<trans-unit id="label.username">
|
||||||
<source>label.username</source>
|
<source>label.username</source>
|
||||||
<target>Benutzername</target>
|
<target>Benutzer</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="label.password">
|
<trans-unit id="label.description">
|
||||||
<source>label.password</source>
|
<source>label.description</source>
|
||||||
<target>Passwort</target>
|
<target>Beschreibung</target>
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="action.sign_in">
|
|
||||||
<source>action.sign_in</source>
|
|
||||||
<target>Los geht's</target>
|
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="menu.logout">
|
|
||||||
<source>menu.logout</source>
|
|
||||||
<target>Abmelden</target>
|
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="menu.admin">
|
|
||||||
<source>menu.admin</source>
|
|
||||||
<target>Backend</target>
|
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="menu.timesheet">
|
|
||||||
<source>menu.timesheet</source>
|
|
||||||
<target>Zeiterfassung</target>
|
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="kimai.license">
|
|
||||||
<source>kimai.license</source>
|
|
||||||
<target>Copyright Kevin Papst. Alle Rechte vorbehalten.</target>
|
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="kimai.footer">
|
|
||||||
<source>kimai.footer</source>
|
|
||||||
<target>Kimai Time-Tracking</target>
|
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|||||||
@@ -1,18 +1,68 @@
|
|||||||
{% extends 'AvanzuAdminThemeBundle:layout:base-layout.html.twig' %}
|
{% extends 'AvanzuAdminThemeBundle:layout:default-layout.html.twig' %}
|
||||||
|
|
||||||
{% block page_content %}
|
{% block avanzu_page_content %}
|
||||||
{% block main %}
|
{% block main %}{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block avanzu_document_title %}
|
||||||
|
{% block title %}{{ 'browser.title'|trans }}{% endblock %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block avanzu_sidebar_search %}
|
||||||
|
<!-- right now we simply deactivate that box -->
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block avanzu_page_title %}
|
||||||
|
{% block page_title %}{% endblock %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block avanzu_page_subtitle %}
|
||||||
|
{% block page_subtitle %}{% endblock %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block avanzu_logo_path %}
|
||||||
|
{{ path('dashboard') }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block avanzu_logo_mini %}
|
||||||
|
<b>K</b>TT
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block avanzu_logo_lg %}
|
||||||
|
<b>Kimai</b> - Time Tracking
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block flash_messages %}
|
{% block flash_messages %}
|
||||||
{{ include('default/_flash_messages.html.twig') }}
|
{{ include('default/_flash_messages.html.twig') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block avanzu_footer %}
|
||||||
|
{% block footer %}
|
||||||
|
<footer class="main-footer">
|
||||||
|
<div class="pull-right hidden-xs">
|
||||||
|
<b>Version</b> 2.0
|
||||||
|
</div>
|
||||||
|
<strong>Copyright © {{ 'now'|date('Y') }} - <a href="http://www.kevinpapst.de">Kevin Papst</a></strong>.
|
||||||
|
{{ 'footer.license'|trans }}
|
||||||
|
</footer>
|
||||||
|
{% endblock %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{#
|
{#
|
||||||
<title>{% block title %}{{ 'browser.title'|trans }}{% endblock %}</title>
|
|
||||||
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
|
avanzu_head
|
||||||
|
avanzu_navbar_toggle
|
||||||
|
avanzu_navbar_messages
|
||||||
|
avanzu_navbar_notifications
|
||||||
|
avanzu_navbar_tasks
|
||||||
|
avanzu_navbar_user
|
||||||
|
avanzu_navbar_control_sidebar_toggle
|
||||||
|
avanzu_sidebar_user
|
||||||
|
avanzu_sidebar_nav
|
||||||
|
avanzu_breadcrumb
|
||||||
|
avanzu_control_sidebar
|
||||||
|
avanzu_javascripts
|
||||||
|
avanzu_javascripts_inline
|
||||||
|
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-globe"></i> <span class="caret"></span></a>
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-globe"></i> <span class="caret"></span></a>
|
||||||
@@ -23,11 +73,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p>© {{ 'now'|date('Y') }} - {{ 'kimai.footer'|trans }}</p>
|
|
||||||
<p>{{ 'kimai.license'|trans }}</p>
|
|
||||||
|
|
||||||
<!-- Page rendered on {{ 'now'|localizeddate('long', 'long', null, 'UTC') }} -->
|
<!-- Page rendered on {{ 'now'|localizeddate('long', 'long', null, 'UTC') }} -->
|
||||||
|
|
||||||
#}
|
#}
|
||||||
@@ -1,7 +1,53 @@
|
|||||||
{% extends 'base.html.twig' %}
|
{% extends 'base.html.twig' %}
|
||||||
|
{% import "macros/widgets.html.twig" as widgets %}
|
||||||
|
|
||||||
{% block page_title %}Dashboard{% endblock %}
|
{% block page_title %}Dashboard{% endblock %}
|
||||||
{% block page_subtitle %}Welcome!{% endblock %}
|
{% block page_subtitle %}Welcome!{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_counter('Bla blub', 300, 'bar-chart', 'blue') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_counter('Steigerungsrate', 80, 'line-chart', 'red') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_counter('Anzahl Tage', 27, 'calendar', 'yellow') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_counter('Stunden total / Monat', 460, 'clock-o', 'green') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_progress('Bewilligte Stunden', 'Stunden zur Abrechnung bewilligt', 120, 10, 'star-o') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_progress('Umsatz / Monat', '70% Increase in 30 Days', 6830, 30, 'credit-card', 'black') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_progress('Stunden persönlich', 'Das ist noch nicht genug', 135, 60, 'hourglass-o') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_progress('Anzahl Benutzer', 'Mehr ist besser!', 5, 90, 'user') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_more('Bewilligte Stunden', 120, 'h', 'star-o', 'purple') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_more('Umsatz / Monat', 6830, '$', '', 'yellow') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_more('Stunden persönlich', 135, '€', 'hourglass-o', 'red') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||||
|
{{ widgets.info_box_more('Anzahl Benutzer', 5, '', 'user') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
94
app/Resources/views/macros/widgets.html.twig
Normal file
94
app/Resources/views/macros/widgets.html.twig
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
|
||||||
|
{% macro profile_list(user, items, color) %}
|
||||||
|
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||||
|
<div class="box box-widget widget-user-2">
|
||||||
|
<!-- Add the bg color to the header using any of the bg-* classes -->
|
||||||
|
<div class="widget-user-header bg-{{ color|default(kimai_context.box_color) }}">
|
||||||
|
<div class="widget-user-image">
|
||||||
|
{{ macro.avatar(user.avatar, user.username) }}
|
||||||
|
</div>
|
||||||
|
<!-- /.widget-user-image -->
|
||||||
|
<h3 class="widget-user-username">{{ user.alias }} ({{ user.username }})</h3>
|
||||||
|
<h5 class="widget-user-desc">{{ user.title }}</h5>
|
||||||
|
</div>
|
||||||
|
<div class="box-footer no-padding">
|
||||||
|
<ul class="nav nav-stacked">
|
||||||
|
{% for entry in items %}
|
||||||
|
<li><a href="{{ entry.url }}">{{ entry.title|trans }} <span class="pull-right badge bg-{{ entry.color }}">{{ entry.amount }}</span></a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro profile_box(user, items) %}
|
||||||
|
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||||
|
|
||||||
|
<div class="box box-widget widget-user">
|
||||||
|
<!-- Add the bg color to the header using any of the bg-* classes -->
|
||||||
|
<div class="widget-user-header bg-{{ color|default(kimai_context.box_color) }}">
|
||||||
|
<h3 class="widget-user-username">{{ user.alias }} ({{ user.username }})</h3>
|
||||||
|
<h5 class="widget-user-desc">{{ user.title }}</h5>
|
||||||
|
</div>
|
||||||
|
<div class="widget-user-image">
|
||||||
|
{{ macro.avatar(user.avatar, user.username) }}
|
||||||
|
</div>
|
||||||
|
<div class="box-footer">
|
||||||
|
<div class="row">
|
||||||
|
{% for entry in items|slice(0, 3) %}
|
||||||
|
<div class="col-sm-4 border-right">
|
||||||
|
<div class="description-block">
|
||||||
|
<h5 class="description-header">{{ entry.amount }}</h5>
|
||||||
|
<span class="description-text">{{ entry.title|trans }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro info_box_counter(title, amount, icon, color) %}
|
||||||
|
<div class="info-box">
|
||||||
|
<span class="info-box-icon bg-{{ color|default(kimai_context.box_color) }}"><i class="fa fa-{{ icon|default('flag-o') }}"></i></span>
|
||||||
|
|
||||||
|
<div class="info-box-content">
|
||||||
|
<span class="info-box-text">{{ title|trans }}</span>
|
||||||
|
<span class="info-box-number">{{ amount }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro info_box_progress(title, description, amount, percentage, icon, color) %}
|
||||||
|
<div class="info-box bg-{{ color|default(kimai_context.box_color) }}">
|
||||||
|
<span class="info-box-icon"><i class="fa fa-{{ icon|default('thumbs-o-up') }}"></i></span>
|
||||||
|
|
||||||
|
<div class="info-box-content">
|
||||||
|
<span class="info-box-text">{{ title|trans }}</span>
|
||||||
|
<span class="info-box-number">{{ amount }}</span>
|
||||||
|
|
||||||
|
<div class="progress">
|
||||||
|
<div class="progress-bar" style="width: {{ percentage }}%"></div>
|
||||||
|
</div>
|
||||||
|
<span class="progress-description">
|
||||||
|
{{ description }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<!-- /.info-box-content -->
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro info_box_more(title, amount, unit, icon, color) %}
|
||||||
|
<div class="small-box bg-{{ color|default(kimai_context.box_color) }}">
|
||||||
|
<div class="inner">
|
||||||
|
<h3>{{ amount }}<sup style="font-size: 20px">{{ unit|default('%') }}</sup></h3>
|
||||||
|
<p>{{ title|trans }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="fa fa-{{ icon|default('bar-chart') }}"></i>
|
||||||
|
</div>
|
||||||
|
<a href="#" class="small-box-footer">
|
||||||
|
{{ 'more.info.link'|trans }} <i class="fa fa-arrow-circle-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
@@ -15,18 +15,18 @@
|
|||||||
<div class="well">
|
<div class="well">
|
||||||
<form action="{{ path('security_login') }}" method="post">
|
<form action="{{ path('security_login') }}" method="post">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><i class="fa fa-lock"></i> {{ 'title.login'|trans }}</legend>
|
<legend><i class="fa fa-lock"></i> {{ 'security.title.login'|trans }}</legend>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="username">{{ 'label.username'|trans }}</label>
|
<label for="username">{{ 'security.label.username'|trans }}</label>
|
||||||
<input type="text" id="username" name="_username" value="{{ last_username }}" class="form-control"/>
|
<input type="text" id="username" name="_username" value="{{ last_username }}" class="form-control"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="password">{{ 'label.password'|trans }}</label>
|
<label for="password">{{ 'security.label.password'|trans }}</label>
|
||||||
<input type="password" id="password" name="_password" class="form-control" />
|
<input type="password" id="password" name="_password" class="form-control" />
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
|
||||||
<button type="submit" class="btn btn-primary">
|
<button type="submit" class="btn btn-primary">
|
||||||
<i class="fa fa-sign-in"></i> {{ 'action.sign_in'|trans }}
|
<i class="fa fa-sign-in"></i> {{ 'security.action.sign_in'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
10
app/Resources/views/user/profile.html.twig
Normal file
10
app/Resources/views/user/profile.html.twig
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
{% import "macros/widgets.html.twig" as widgets %}
|
||||||
|
|
||||||
|
{% block page_title %}Profile{% endblock %}
|
||||||
|
{% block page_subtitle %}manage your settings{% endblock %}
|
||||||
|
|
||||||
|
{% block main %}
|
||||||
|
{{ widgets.profile_list(user, items, 'aqua-active') }}
|
||||||
|
{{ widgets.profile_box(user, items, 'aqua-active') }}
|
||||||
|
{% endblock %}
|
||||||
@@ -58,7 +58,9 @@ twig:
|
|||||||
- "bootstrap_3_layout.html.twig"
|
- "bootstrap_3_layout.html.twig"
|
||||||
- "form/fields.html.twig"
|
- "form/fields.html.twig"
|
||||||
globals:
|
globals:
|
||||||
admin_skin: skin-blue
|
kimai_context:
|
||||||
|
date_1: "d.m.Y" # used for display in timesheets
|
||||||
|
box_color: "green"
|
||||||
|
|
||||||
# Assetic Configuration (used for managing web assets: CSS, JavaScript, Sass, etc.)
|
# Assetic Configuration (used for managing web assets: CSS, JavaScript, Sass, etc.)
|
||||||
assetic:
|
assetic:
|
||||||
@@ -89,5 +91,13 @@ swiftmailer:
|
|||||||
password: "%mailer_password%"
|
password: "%mailer_password%"
|
||||||
spool: { type: memory }
|
spool: { type: memory }
|
||||||
|
|
||||||
#avanzu_admin_theme:
|
avanzu_admin_theme:
|
||||||
# use_assetic: false
|
use_twig : true
|
||||||
|
theme:
|
||||||
|
default_avatar : avatars/default.png
|
||||||
|
skin : skin-blue
|
||||||
|
fixed_layout : false
|
||||||
|
boxed_layout : false
|
||||||
|
collapsed_sidebar: true
|
||||||
|
mini_sidebar : true
|
||||||
|
control_sidebar : false
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ framework:
|
|||||||
strict_requirements: true
|
strict_requirements: true
|
||||||
profiler: { only_exceptions: false }
|
profiler: { only_exceptions: false }
|
||||||
|
|
||||||
web_profiler:
|
#web_profiler:
|
||||||
toolbar: '%kernel.debug%'
|
# toolbar: '%kernel.debug%'
|
||||||
intercept_redirects: false
|
# intercept_redirects: false
|
||||||
|
|
||||||
monolog:
|
monolog:
|
||||||
handlers:
|
handlers:
|
||||||
@@ -40,3 +40,6 @@ services:
|
|||||||
class: Twig_Extensions_Extension_Text
|
class: Twig_Extensions_Extension_Text
|
||||||
tags:
|
tags:
|
||||||
- name: twig.extension
|
- name: twig.extension
|
||||||
|
|
||||||
|
avanzu_admin_theme:
|
||||||
|
enable_demo: false
|
||||||
|
|||||||
@@ -34,6 +34,6 @@ homepage:
|
|||||||
permanent: true
|
permanent: true
|
||||||
|
|
||||||
avanzu_admin_profile:
|
avanzu_admin_profile:
|
||||||
path: /profile/{userid}/
|
path: /{_locale}/profile/{ident}/
|
||||||
avanzu_admin_logout:
|
options:
|
||||||
path: /logout
|
avanzu_admin_route: profile
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
# this imports the routes used to display the web debug toolbar at the bottom of each page
|
# this imports the routes used to display the web debug toolbar at the bottom of each page
|
||||||
_wdt:
|
#_wdt:
|
||||||
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
|
# resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
|
||||||
prefix: /_wdt
|
# prefix: /_wdt
|
||||||
|
|
||||||
# this imports the routes needed to display the Symfony Profiler information
|
# this imports the routes needed to display the Symfony Profiler information
|
||||||
_profiler:
|
#_profiler:
|
||||||
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
|
# resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
|
||||||
prefix: /_profiler
|
# prefix: /_profiler
|
||||||
|
|
||||||
# this imports the route used to test error pages. Just browse the following URL:
|
# this imports the route used to test error pages. Just browse the following URL:
|
||||||
# /{_locale}/_error/{status_code}.{format}
|
# /{_locale}/_error/{status_code}.{format}
|
||||||
# (e.g. /en/_error/404, /en/_error/403.json, /fr/_error/500.xml)
|
# (e.g. /en/_error/404, /en/_error/403.json, /fr/_error/500.xml)
|
||||||
# See http://symfony.com/doc/current/cookbook/controller/error_pages.html#testing-error-pages-during-development
|
# See http://symfony.com/doc/current/cookbook/controller/error_pages.html#testing-error-pages-during-development
|
||||||
|
|
||||||
_errors:
|
_errors:
|
||||||
resource: "@TwigBundle/Resources/config/routing/errors.xml"
|
resource: "@TwigBundle/Resources/config/routing/errors.xml"
|
||||||
prefix: /{_locale}/_error
|
prefix: /{_locale}/_error
|
||||||
@@ -20,6 +21,76 @@ _errors:
|
|||||||
defaults:
|
defaults:
|
||||||
_locale: '%locale%'
|
_locale: '%locale%'
|
||||||
|
|
||||||
|
|
||||||
|
# ======================================================================
|
||||||
|
# Template routes, that we need once we use those features
|
||||||
|
# ======================================================================
|
||||||
|
|
||||||
|
#avanzu_admin_login:
|
||||||
|
# path: /{_locale}/login
|
||||||
|
# options:
|
||||||
|
# avanzu_admin_route: login
|
||||||
|
#
|
||||||
|
#avanzu_admin_logout:
|
||||||
|
# path: /logout
|
||||||
|
# options:
|
||||||
|
# avanzu_admin_route: logout
|
||||||
|
#
|
||||||
|
#avanzu_admin_all_tasks:
|
||||||
|
# path: /tasks/
|
||||||
|
# options:
|
||||||
|
# avanzu_admin_route: all_tasks
|
||||||
|
#
|
||||||
|
#avanzu_admin_show_task:
|
||||||
|
# path: /tasks/{ident}/
|
||||||
|
# options:
|
||||||
|
# avanzu_admin_route: task
|
||||||
|
#
|
||||||
|
#avanzu_admin_all_notifications:
|
||||||
|
# path: /notifications/
|
||||||
|
# options:
|
||||||
|
# avanzu_admin_route: all_notifications
|
||||||
|
#
|
||||||
|
#avanzu_admin_show_notification:
|
||||||
|
# path: /notifications/{ident}/
|
||||||
|
# options:
|
||||||
|
# avanzu_admin_route: notification
|
||||||
|
#
|
||||||
|
#avanzu_admin_all_messages:
|
||||||
|
# path: /messages/
|
||||||
|
# options:
|
||||||
|
# avanzu_admin_route: all_messages
|
||||||
|
#
|
||||||
|
#avanzu_admin_show_message:
|
||||||
|
# path: /messages/{ident}/
|
||||||
|
# options:
|
||||||
|
# avanzu_admin_route: message
|
||||||
|
|
||||||
|
# ======================================================================
|
||||||
|
# Template demo screen
|
||||||
|
# Activate full demo mode by setting "enable_demo" in config_dev.xml
|
||||||
|
# ======================================================================
|
||||||
|
|
||||||
|
avanzu_admin_home:
|
||||||
|
path: /{_locale}/demo-admin/
|
||||||
|
defaults: {_controller: AvanzuAdminThemeBundle:Default:index}
|
||||||
|
options:
|
||||||
|
avanzu_admin_route: welcome
|
||||||
|
|
||||||
|
avanzu_admin_form_demo:
|
||||||
|
path: /{_locale}/demo-admin/form-demo/
|
||||||
|
defaults: {_controller: AvanzuAdminThemeBundle:Default:form}
|
||||||
|
|
||||||
|
avanzu_admin_login_demo:
|
||||||
|
path: /{_locale}/demo-admin/login/
|
||||||
|
defaults: {_controller: AvanzuAdminThemeBundle:Default:login}
|
||||||
|
|
||||||
|
avanzu_admin_dash_demo:
|
||||||
|
path: /{_locale}/demo-admin/dashboard/
|
||||||
|
defaults: {_controller: AvanzuAdminThemeBundle:Default:dashboard}
|
||||||
|
|
||||||
|
# ======================================================================
|
||||||
|
|
||||||
# this loads the main routing file, which usually defines the routes available
|
# this loads the main routing file, which usually defines the routes available
|
||||||
# in any environment (production, development, etc.)
|
# in any environment (production, development, etc.)
|
||||||
_main:
|
_main:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ security:
|
|||||||
# The route name the user can go to in order to logout
|
# The route name the user can go to in order to logout
|
||||||
path: security_logout
|
path: security_logout
|
||||||
# The name of the route to redirect to after logging out
|
# The name of the route to redirect to after logging out
|
||||||
target: timesheet
|
target: homepage
|
||||||
|
|
||||||
role_hierarchy:
|
role_hierarchy:
|
||||||
ROLE_USER: ROLE_CUSTOMER
|
ROLE_USER: ROLE_CUSTOMER
|
||||||
|
|||||||
@@ -61,3 +61,31 @@ services:
|
|||||||
#
|
#
|
||||||
# // same code using repository services
|
# // same code using repository services
|
||||||
# $posts = $this->get('app.post_repository')->findAll();
|
# $posts = $this->get('app.post_repository')->findAll();
|
||||||
|
|
||||||
|
avanzu_admin_theme.navbar_user_listener:
|
||||||
|
class: AppBundle\EventListener\NavbarShowUserListener
|
||||||
|
arguments: ["@security.token_storage"]
|
||||||
|
tags:
|
||||||
|
- { name: kernel.event_listener, event: theme.navbar_user, method: onShowUser }
|
||||||
|
- { name: kernel.event_listener, event: theme.sidebar_user, method: onShowUser }
|
||||||
|
|
||||||
|
# avanzu_admin_theme.navbar_task_listener:
|
||||||
|
# class: "%avanzu_admin_theme.navbar_task_listener.class%"
|
||||||
|
# tags:
|
||||||
|
# - { name: kernel.event_listener, event: theme.tasks, method: onListTasks }
|
||||||
|
#
|
||||||
|
# avanzu_admin_theme.navbar_notify_listener:
|
||||||
|
# class: "%avanzu_admin_theme.navbar_notify_listener.class%"
|
||||||
|
# tags:
|
||||||
|
# - { name: kernel.event_listener, event: theme.notifications, method: onListNotifications }
|
||||||
|
#
|
||||||
|
# avanzu_admin_theme.navbar_msg_listener:
|
||||||
|
# class: "%avanzu_admin_theme.navbar_msg_listener.class%"
|
||||||
|
# tags:
|
||||||
|
# - { name: kernel.event_listener, event: theme.messages, method: onListMessages }
|
||||||
|
#
|
||||||
|
# avanzu_admin_theme.setup_menu_listener:
|
||||||
|
# class: "%avanzu_admin_theme.setup_menu_listener.class%"
|
||||||
|
# tags:
|
||||||
|
# - { name: kernel.event_listener, event: theme.sidebar_setup_menu, method: onSetupMenu }
|
||||||
|
# - { name: kernel.event_listener, event: theme.breadcrumb, method: onSetupMenu }
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
"symfony/symfony": "^3.1",
|
"symfony/symfony": "^3.1",
|
||||||
"twig/extensions": "^1.3",
|
"twig/extensions": "^1.3",
|
||||||
"white-october/pagerfanta-bundle": "^1.0",
|
"white-october/pagerfanta-bundle": "^1.0",
|
||||||
"avanzu/admin-theme-bundle": "^1.3"
|
"avanzu/admin-theme-bundle": "dev-feature/2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"sensio/generator-bundle": "~3.0",
|
"sensio/generator-bundle": "~3.0",
|
||||||
|
|||||||
71
src/AppBundle/Controller/ProfileController.php
Normal file
71
src/AppBundle/Controller/ProfileController.php
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Kimai package.
|
||||||
|
*
|
||||||
|
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace AppBundle\Controller;
|
||||||
|
|
||||||
|
use TimesheetBundle\Entity\Timesheet;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||||
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||||
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||||
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User profile controller
|
||||||
|
*
|
||||||
|
* @Route("/profile")
|
||||||
|
* @Security("has_role('ROLE_USER')")
|
||||||
|
*
|
||||||
|
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||||
|
*/
|
||||||
|
class ProfileController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @Route("/", defaults={"ident": null}, name="user_profile")
|
||||||
|
* @Route("/{ident}/", requirements={"ident": "[a-zA-Z0-9\-].*"}, name="user_profile_ident")
|
||||||
|
* @Method("GET")
|
||||||
|
*/
|
||||||
|
public function indexAction($ident)
|
||||||
|
{
|
||||||
|
// FIXME fetch values dynamically and add trans filter to macros
|
||||||
|
$items = [
|
||||||
|
[
|
||||||
|
'title' => 'Projects',
|
||||||
|
'url' => '#',
|
||||||
|
'color' => 'blue',
|
||||||
|
'amount' => 12
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => 'Tasks',
|
||||||
|
'url' => '#',
|
||||||
|
'color' => 'aqua',
|
||||||
|
'amount' => 5
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => 'Projects',
|
||||||
|
'url' => '#',
|
||||||
|
'color' => 'red',
|
||||||
|
'amount' => 27
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'title' => 'Einträge',
|
||||||
|
'url' => '#',
|
||||||
|
'color' => 'green',
|
||||||
|
'amount' => 842
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
return $this->render(
|
||||||
|
'user/profile.html.twig',
|
||||||
|
['user' => $this->getUser(), 'items' => $items]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,6 +31,7 @@ class SecurityController extends Controller
|
|||||||
{
|
{
|
||||||
$helper = $this->get('security.authentication_utils');
|
$helper = $this->get('security.authentication_utils');
|
||||||
|
|
||||||
|
//return $this->render('AvanzuAdminThemeBundle:Security:login.html.twig', [
|
||||||
return $this->render('security/login.html.twig', [
|
return $this->render('security/login.html.twig', [
|
||||||
// last username entered by the user (if any)
|
// last username entered by the user (if any)
|
||||||
'last_username' => $helper->getLastUsername(),
|
'last_username' => $helper->getLastUsername(),
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ class LoadFixtures implements FixtureInterface, ContainerAwareInterface
|
|||||||
$passwordEncoder = $this->container->get('security.password_encoder');
|
$passwordEncoder = $this->container->get('security.password_encoder');
|
||||||
|
|
||||||
$claraCustomer = new User();
|
$claraCustomer = new User();
|
||||||
|
$claraCustomer->setAlias('Clara Haynes');
|
||||||
|
$claraCustomer->setTitle('CFO');
|
||||||
$claraCustomer->setUsername('clara_customer');
|
$claraCustomer->setUsername('clara_customer');
|
||||||
$claraCustomer->setEmail('clara_customer@example.com');
|
$claraCustomer->setEmail('clara_customer@example.com');
|
||||||
$claraCustomer->setRoles(['ROLE_CUSTOMER']);
|
$claraCustomer->setRoles(['ROLE_CUSTOMER']);
|
||||||
@@ -49,6 +51,8 @@ class LoadFixtures implements FixtureInterface, ContainerAwareInterface
|
|||||||
$manager->persist($claraCustomer);
|
$manager->persist($claraCustomer);
|
||||||
|
|
||||||
$johnUser = new User();
|
$johnUser = new User();
|
||||||
|
$johnUser->setAlias('John Doe');
|
||||||
|
$johnUser->setTitle('Lead Developer');
|
||||||
$johnUser->setUsername('john_user');
|
$johnUser->setUsername('john_user');
|
||||||
$johnUser->setEmail('john_user@example.com');
|
$johnUser->setEmail('john_user@example.com');
|
||||||
$johnUser->setRoles(['ROLE_USER']);
|
$johnUser->setRoles(['ROLE_USER']);
|
||||||
@@ -57,6 +61,8 @@ class LoadFixtures implements FixtureInterface, ContainerAwareInterface
|
|||||||
$manager->persist($johnUser);
|
$manager->persist($johnUser);
|
||||||
|
|
||||||
$tonyTeamlead = new User();
|
$tonyTeamlead = new User();
|
||||||
|
$tonyTeamlead->setAlias('Tony Maier');
|
||||||
|
$tonyTeamlead->setTitle('Head of Development');
|
||||||
$tonyTeamlead->setUsername('tony_teamlead');
|
$tonyTeamlead->setUsername('tony_teamlead');
|
||||||
$tonyTeamlead->setEmail('tony_teamlead@example.com');
|
$tonyTeamlead->setEmail('tony_teamlead@example.com');
|
||||||
$tonyTeamlead->setRoles(['ROLE_TEAMLEAD']);
|
$tonyTeamlead->setRoles(['ROLE_TEAMLEAD']);
|
||||||
@@ -65,6 +71,8 @@ class LoadFixtures implements FixtureInterface, ContainerAwareInterface
|
|||||||
$manager->persist($tonyTeamlead);
|
$manager->persist($tonyTeamlead);
|
||||||
|
|
||||||
$annaAdmin = new User();
|
$annaAdmin = new User();
|
||||||
|
$annaAdmin->setAlias('Anna Smith');
|
||||||
|
$annaAdmin->setTitle('Administrator');
|
||||||
$annaAdmin->setUsername('anna_admin');
|
$annaAdmin->setUsername('anna_admin');
|
||||||
$annaAdmin->setEmail('anna_admin@example.com');
|
$annaAdmin->setEmail('anna_admin@example.com');
|
||||||
$annaAdmin->setRoles(['ROLE_ADMIN']);
|
$annaAdmin->setRoles(['ROLE_ADMIN']);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* KimaiUsers
|
* User
|
||||||
*
|
*
|
||||||
* @ORM\Entity(repositoryClass="AppBundle\Repository\UserRepository")
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\UserRepository")
|
||||||
* @ORM\Table(name="users", uniqueConstraints={@ORM\UniqueConstraint(name="name", columns={"name"}), @ORM\UniqueConstraint(name="apikey", columns={"apikey"})})
|
* @ORM\Table(name="users", uniqueConstraints={@ORM\UniqueConstraint(name="name", columns={"name"}), @ORM\UniqueConstraint(name="apikey", columns={"apikey"})})
|
||||||
@@ -46,6 +46,8 @@ class User implements UserInterface
|
|||||||
private $alias;
|
private $alias;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* FIXME remove me
|
||||||
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="trash", type="boolean", nullable=false)
|
* @ORM\Column(name="trash", type="boolean", nullable=false)
|
||||||
@@ -67,6 +69,8 @@ class User implements UserInterface
|
|||||||
private $passwordresethash;
|
private $passwordresethash;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* FIXME remove me
|
||||||
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="ban", type="integer", nullable=false)
|
* @ORM\Column(name="ban", type="integer", nullable=false)
|
||||||
@@ -74,6 +78,7 @@ class User implements UserInterface
|
|||||||
private $ban = '0';
|
private $ban = '0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* FIXME remove me
|
||||||
* @var integer
|
* @var integer
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="banTime", type="integer", nullable=false)
|
* @ORM\Column(name="banTime", type="integer", nullable=false)
|
||||||
@@ -88,7 +93,7 @@ class User implements UserInterface
|
|||||||
private $secure = '0';
|
private $secure = '0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FIXME
|
* FIXME manytoone relation
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*
|
*
|
||||||
@@ -97,7 +102,7 @@ class User implements UserInterface
|
|||||||
private $lastproject = '1';
|
private $lastproject = '1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FIXME
|
* FIXME manytoone
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*
|
*
|
||||||
@@ -133,17 +138,32 @@ class User implements UserInterface
|
|||||||
*/
|
*/
|
||||||
private $apikey;
|
private $apikey;
|
||||||
|
|
||||||
|
// ======= new columns for kimai 2 =======
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="json_array")
|
* @ORM\Column(type="json_array")
|
||||||
*/
|
*/
|
||||||
private $roles = [];
|
private $roles = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="title", type="string", length=50, nullable=true)
|
||||||
|
*/
|
||||||
|
private $title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="avatar", type="string", length=50, nullable=true)
|
||||||
|
*/
|
||||||
|
private $avatar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set alias
|
* Set alias
|
||||||
*
|
*
|
||||||
* @param string $alias
|
* @param string $alias
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setAlias($alias)
|
public function setAlias($alias)
|
||||||
{
|
{
|
||||||
@@ -167,7 +187,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param boolean $trash
|
* @param boolean $trash
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setTrash($trash)
|
public function setTrash($trash)
|
||||||
{
|
{
|
||||||
@@ -191,7 +211,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param boolean $active
|
* @param boolean $active
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setActive($active)
|
public function setActive($active)
|
||||||
{
|
{
|
||||||
@@ -215,7 +235,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param string $password
|
* @param string $password
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setPassword($password)
|
public function setPassword($password)
|
||||||
{
|
{
|
||||||
@@ -239,7 +259,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param string $passwordresethash
|
* @param string $passwordresethash
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setPasswordresethash($passwordresethash)
|
public function setPasswordresethash($passwordresethash)
|
||||||
{
|
{
|
||||||
@@ -263,7 +283,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param integer $ban
|
* @param integer $ban
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setBan($ban)
|
public function setBan($ban)
|
||||||
{
|
{
|
||||||
@@ -287,7 +307,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param integer $bantime
|
* @param integer $bantime
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setBantime($bantime)
|
public function setBantime($bantime)
|
||||||
{
|
{
|
||||||
@@ -311,7 +331,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param string $secure
|
* @param string $secure
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setSecure($secure)
|
public function setSecure($secure)
|
||||||
{
|
{
|
||||||
@@ -335,7 +355,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param integer $lastproject
|
* @param integer $lastproject
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setLastproject($lastproject)
|
public function setLastproject($lastproject)
|
||||||
{
|
{
|
||||||
@@ -359,7 +379,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param integer $lastactivity
|
* @param integer $lastactivity
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setLastactivity($lastactivity)
|
public function setLastactivity($lastactivity)
|
||||||
{
|
{
|
||||||
@@ -383,7 +403,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param integer $lastrecord
|
* @param integer $lastrecord
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setLastrecord($lastrecord)
|
public function setLastrecord($lastrecord)
|
||||||
{
|
{
|
||||||
@@ -407,7 +427,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param string $timeframebegin
|
* @param string $timeframebegin
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setTimeframebegin($timeframebegin)
|
public function setTimeframebegin($timeframebegin)
|
||||||
{
|
{
|
||||||
@@ -431,7 +451,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param string $timeframeend
|
* @param string $timeframeend
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setTimeframeend($timeframeend)
|
public function setTimeframeend($timeframeend)
|
||||||
{
|
{
|
||||||
@@ -455,7 +475,7 @@ class User implements UserInterface
|
|||||||
*
|
*
|
||||||
* @param string $apikey
|
* @param string $apikey
|
||||||
*
|
*
|
||||||
* @return KimaiUsers
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function setApikey($apikey)
|
public function setApikey($apikey)
|
||||||
{
|
{
|
||||||
@@ -474,30 +494,6 @@ class User implements UserInterface
|
|||||||
return $this->apikey;
|
return $this->apikey;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set globalroleid
|
|
||||||
*
|
|
||||||
* @param integer $globalroleid
|
|
||||||
*
|
|
||||||
* @return KimaiUsers
|
|
||||||
*/
|
|
||||||
public function setGlobalroleid($globalroleid)
|
|
||||||
{
|
|
||||||
$this->globalroleid = $globalroleid;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get globalroleid
|
|
||||||
*
|
|
||||||
* @return integer
|
|
||||||
*/
|
|
||||||
public function getGlobalroleid()
|
|
||||||
{
|
|
||||||
return $this->globalroleid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
@@ -565,8 +561,40 @@ class User implements UserInterface
|
|||||||
// $this->plainPassword = null;
|
// $this->plainPassword = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getTitle()
|
||||||
|
{
|
||||||
|
return $this->title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $title
|
||||||
|
*/
|
||||||
|
public function setTitle($title)
|
||||||
|
{
|
||||||
|
$this->title = $title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getAvatar()
|
||||||
|
{
|
||||||
|
return $this->avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $avatar
|
||||||
|
*/
|
||||||
|
public function setAvatar($avatar)
|
||||||
|
{
|
||||||
|
$this->avatar = $avatar;
|
||||||
|
}
|
||||||
|
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
return $this->getUsername();
|
return $this->getAlias() ?: $this->getUsername();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ class MenuBuilder
|
|||||||
|
|
||||||
if ($isAdmin) {
|
if ($isAdmin) {
|
||||||
$event->addItem(
|
$event->addItem(
|
||||||
new MenuItemModel('admin', 'menu.admin_dashboard', '', [], 'fa fa-dashboard')
|
new MenuItemModel('admin', 'menu.admin', '', [], 'fa fa-dashboard')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->eventDispatcher->dispatch(
|
$this->eventDispatcher->dispatch(
|
||||||
|
|||||||
59
src/AppBundle/EventListener/NavbarShowUserListener.php
Normal file
59
src/AppBundle/EventListener/NavbarShowUserListener.php
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Kimai package.
|
||||||
|
*
|
||||||
|
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace AppBundle\EventListener;
|
||||||
|
|
||||||
|
use AppBundle\Entity\User;
|
||||||
|
use Avanzu\AdminThemeBundle\Event\ShowUserEvent;
|
||||||
|
use Avanzu\AdminThemeBundle\Model\UserModel;
|
||||||
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
|
use Symfony\Component\Security\Core\User\UserInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class NavbarShowUserListener
|
||||||
|
*
|
||||||
|
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||||
|
*/
|
||||||
|
class NavbarShowUserListener
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var TokenStorageInterface
|
||||||
|
*/
|
||||||
|
protected $storage;
|
||||||
|
|
||||||
|
public function __construct(TokenStorageInterface $tokenStorage)
|
||||||
|
{
|
||||||
|
$this->storage = $tokenStorage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onShowUser(ShowUserEvent $event)
|
||||||
|
{
|
||||||
|
/* @var $myUser User */
|
||||||
|
$myUser = $this->storage->getToken()->getUser();
|
||||||
|
|
||||||
|
$titles = [];
|
||||||
|
$roles = $this->storage->getToken()->getRoles();
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$titles[] = ucfirst(strtolower(str_replace('ROLE_', '', $role->getRole())));
|
||||||
|
}
|
||||||
|
|
||||||
|
$user = new UserModel();
|
||||||
|
$user->setName($myUser->getAlias() ?: $myUser->getUsername())
|
||||||
|
->setUsername($myUser->getUsername())
|
||||||
|
->setIsOnline(true)
|
||||||
|
->setTitle($myUser->getTitle())
|
||||||
|
->setAvatar($myUser->getAvatar())
|
||||||
|
->setMemberSince(new \DateTime()) // FIXME add column to entity
|
||||||
|
;
|
||||||
|
|
||||||
|
$event->setUser($user);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,7 +36,7 @@ class TimesheetController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function indexAction($page)
|
public function indexAction($page)
|
||||||
{
|
{
|
||||||
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($page);
|
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findAll($page);
|
||||||
|
|
||||||
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
|
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,13 +30,14 @@ class TimesheetController extends Controller
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @Route("/", defaults={"page": 1}, name="timesheet")
|
* @Route("/", defaults={"page": 1}, name="timesheet")
|
||||||
* @Route("/timesheet/{page}", requirements={"page": "[1-9]\d*"}, name="timesheet_paginated")
|
* @Route("/page/{page}", requirements={"page": "[1-9]\d*"}, name="timesheet_paginated")
|
||||||
* @Method("GET")
|
* @Method("GET")
|
||||||
* @Cache(smaxage="10")
|
* @Cache(smaxage="10")
|
||||||
*/
|
*/
|
||||||
public function indexAction($page)
|
public function indexAction($page)
|
||||||
{
|
{
|
||||||
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($page);
|
$user = $this->getUser();
|
||||||
|
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($user, $page);
|
||||||
|
|
||||||
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
|
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace TimesheetBundle\Repository;
|
namespace TimesheetBundle\Repository;
|
||||||
|
|
||||||
|
use AppBundle\Entity\User;
|
||||||
use TimesheetBundle\Entity\Timesheet;
|
use TimesheetBundle\Entity\Timesheet;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
@@ -26,16 +27,33 @@ class TimesheetRepository extends EntityRepository
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param User $user
|
||||||
* @return Query
|
* @return Query
|
||||||
*/
|
*/
|
||||||
public function queryLatest()
|
public function queryLatest(User $user = null)
|
||||||
{
|
{
|
||||||
return $this->getEntityManager()
|
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||||
->createQuery('
|
|
||||||
SELECT p
|
$qb->select('p')
|
||||||
FROM TimesheetBundle:Timesheet p
|
->from('TimesheetBundle:Timesheet', 'p')
|
||||||
ORDER BY p.start DESC
|
->orderBy('p.start', 'DESC');
|
||||||
');
|
|
||||||
|
if (null !== $user) {
|
||||||
|
$qb->where('p.user = :user')
|
||||||
|
->setParameter('user', $user);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $qb->getQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param User $user
|
||||||
|
* @param int $page
|
||||||
|
* @return Pagerfanta
|
||||||
|
*/
|
||||||
|
public function findLatest(User $user, $page = 1)
|
||||||
|
{
|
||||||
|
return $this->getPager($this->queryLatest($user), $page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,9 +61,19 @@ class TimesheetRepository extends EntityRepository
|
|||||||
*
|
*
|
||||||
* @return Pagerfanta
|
* @return Pagerfanta
|
||||||
*/
|
*/
|
||||||
public function findLatest($page = 1)
|
public function findAll($page = 1)
|
||||||
{
|
{
|
||||||
$paginator = new Pagerfanta(new DoctrineORMAdapter($this->queryLatest(), false));
|
return $this->getPager($this->queryLatest(), $page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Query $query
|
||||||
|
* @param int $page
|
||||||
|
* @return Pagerfanta
|
||||||
|
*/
|
||||||
|
protected function getPager(Query $query, $page = 1)
|
||||||
|
{
|
||||||
|
$paginator = new Pagerfanta(new DoctrineORMAdapter($query, false));
|
||||||
$paginator->setMaxPerPage(25);
|
$paginator->setMaxPerPage(25);
|
||||||
$paginator->setCurrentPage($page);
|
$paginator->setCurrentPage($page);
|
||||||
|
|
||||||
|
|||||||
@@ -9,17 +9,17 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><i class="fa fa-calendar"></i> {{ 'label.date'|trans }}</th>
|
<th><i class="fa fa-calendar"></i> {{ 'label.date'|trans }}</th>
|
||||||
<th><i class="fa fa-circle-o"></i> {{ 'label.start'|trans }}</th>
|
<th><i class="fa fa-hourglass-start"></i> {{ 'label.starttime'|trans }}</th>
|
||||||
<th><i class="fa fa-circle"></i> {{ 'label.end'|trans }}</th>
|
<th><i class="fa fa-hourglass-end"></i> {{ 'label.endtime'|trans }}</th>
|
||||||
<th><i class="fa fa-clock-o"></i> {{ 'label.duration'|trans }}</th>
|
<th><i class="fa fa-clock-o"></i> {{ 'label.duration'|trans }}</th>
|
||||||
<th><i class="fa fa-user"></i> {{ 'label.user'|trans }}</th>
|
<th><i class="fa fa-user"></i> {{ 'label.username'|trans }}</th>
|
||||||
<th>{{ 'label.description'|trans }}</th>
|
<th><i class="fa fa-pencil-square-o"></i> {{ 'label.description'|trans }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for entry in entries %}
|
{% for entry in entries %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ entry.start|date("m/d/Y") }}</td>
|
<td>{{ entry.start|date(kimai_context.date_1) }}</td>
|
||||||
<td>{{ entry.start|date("H:i") }}</td>
|
<td>{{ entry.start|date("H:i") }}</td>
|
||||||
<td>{{ entry.end|date("H:i") }}</td>
|
<td>{{ entry.end|date("H:i") }}</td>
|
||||||
<td>{{ entry.duration|gmdate }}</td>
|
<td>{{ entry.duration|gmdate }}</td>
|
||||||
|
|||||||
BIN
web/avatars/default.png
Normal file
BIN
web/avatars/default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user