user profile, editing and more statistics
This commit is contained in:
@@ -26,19 +26,19 @@ class AppKernel extends Kernel
|
||||
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
new Symfony\Bundle\MonologBundle\MonologBundle(),
|
||||
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
|
||||
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
||||
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
|
||||
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
|
||||
new Avanzu\AdminThemeBundle\AvanzuAdminThemeBundle(),
|
||||
new AppBundle\AppBundle(),
|
||||
new TimesheetBundle\TimesheetBundle(),
|
||||
new Avanzu\AdminThemeBundle\AvanzuAdminThemeBundle(),
|
||||
];
|
||||
|
||||
// Bundles only used for development or unit and functional tests
|
||||
if (in_array($this->getEnvironment(), ['dev', 'test'])) {
|
||||
//$bundles[] = new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle();
|
||||
//$bundles[] = new Symfony\Bundle\AsseticBundle\AsseticBundle();
|
||||
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
|
||||
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
|
||||
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
|
||||
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
{# 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">
|
||||
@@ -10,8 +10,8 @@
|
||||
<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>
|
||||
{{user.name}}
|
||||
<small>{{user.title}}</small>
|
||||
</p>
|
||||
</li>
|
||||
{#
|
||||
@@ -28,10 +28,10 @@
|
||||
<!-- 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>
|
||||
<a href="{{ path('user_profile', {'username' : user.username}) }}" class="btn btn-default btn-flat">{{ 'label.user_profile'|trans }}</a>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="{{ logout_path() }}" class="btn btn-default btn-flat">{{ 'Sign out'|trans({}, 'AvanzuAdminTheme') }}</a>
|
||||
<a href="{{ logout_path() }}" class="btn btn-default btn-flat">{{ 'label.logout'|trans }}</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
{# Tell the browser to be responsive to screen width #}
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
{# Bootstrap 3.3.6 #}
|
||||
<link rel="stylesheet" href="{{ asset('theme/bootstrap/css/bootstrap.min.css') }}">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
{# Ionicons #}
|
||||
{#<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">#}
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="{{ asset('theme/dist/css/AdminLTE.min.css') }}">
|
||||
{# AdminLTE Skins. We have chosen the skin-blue for this starter page. However, you can choose
|
||||
any other skin. Make sure you apply the skin class to the body tag so the changes take effect. #}
|
||||
<link rel="stylesheet" href="{{ asset("theme/dist/css/skins/"~avanzu_admin_context.options.skin~".min.css") }}">
|
||||
{# HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries.
|
||||
WARNING: Respond.js doesn't work if you view the page via file:// #}
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
@@ -1,19 +0,0 @@
|
||||
<?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>
|
||||
@@ -25,10 +25,22 @@
|
||||
<source>security.label.password</source>
|
||||
<target>Passwort</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="security.label.password_repeat">
|
||||
<source>security.label.password_repeat</source>
|
||||
<target>Passwort wiederholen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="security.action.sign_in">
|
||||
<source>security.action.sign_in</source>
|
||||
<target>Los geht's</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.logout">
|
||||
<source>label.logout</source>
|
||||
<target>Abmelden</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.user_profile">
|
||||
<source>label.user_profile</source>
|
||||
<target>Mein Profil</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Menu / Navbar items
|
||||
@@ -173,6 +185,46 @@
|
||||
<source>label.project</source>
|
||||
<target>Projekt</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.hourly_rate">
|
||||
<source>label.hourly_rate</source>
|
||||
<target>Stundenlohn</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.hours">
|
||||
<source>label.hours</source>
|
||||
<target>Stunden</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.rate">
|
||||
<source>label.rate</source>
|
||||
<target>Umsatz</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.language">
|
||||
<source>label.language</source>
|
||||
<target>Sprache</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Buttons & Actions
|
||||
-->
|
||||
<trans-unit id="label.actions">
|
||||
<source>label.actions</source>
|
||||
<target>Aktionen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.edit">
|
||||
<source>action.edit</source>
|
||||
<target>Bearbeiten</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.delete">
|
||||
<source>action.delete</source>
|
||||
<target>Löschen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.save">
|
||||
<source>action.save</source>
|
||||
<target>Speichern</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.updated_successfully">
|
||||
<source>action.updated_successfully</source>
|
||||
<target>Änderungen erfolgreich gespeichert</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Dashboard
|
||||
@@ -213,6 +265,10 @@
|
||||
<source>badge.invisible</source>
|
||||
<target>Nein</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.toggle_dropdown">
|
||||
<source>label.toggle_dropdown</source>
|
||||
<target>Menü anzeigen</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Timesheet
|
||||
@@ -237,6 +293,30 @@
|
||||
<source>profile.subtitle</source>
|
||||
<target>Verwalte Deine Einstellungen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.about_me">
|
||||
<source>profile.about_me</source>
|
||||
<target>Über mich</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.first_entry">
|
||||
<source>profile.first_entry</source>
|
||||
<target>Arbeitet seit</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.tab_monthly">
|
||||
<source>profile.tab_monthly</source>
|
||||
<target>Jahresstatistik</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.avatar">
|
||||
<source>profile.avatar</source>
|
||||
<target>Profilbild</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.settings">
|
||||
<source>profile.settings</source>
|
||||
<target>Einstellungen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.password">
|
||||
<source>profile.password</source>
|
||||
<target>Passwort</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Admin: Timesheet
|
||||
@@ -285,6 +365,14 @@
|
||||
<source>admin_user.subtitle</source>
|
||||
<target>Alle registrierten Nutzer</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="edit_profile.title">
|
||||
<source>edit_profile.title</source>
|
||||
<target>Profil editieren</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="edit_profile.subtitle">
|
||||
<source>edit_profile.subtitle</source>
|
||||
<target>Einstellungen von %username% ändern</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.alias">
|
||||
<source>label.alias</source>
|
||||
<target>Name</target>
|
||||
@@ -346,6 +434,57 @@
|
||||
<target>Umsatz total</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Month names
|
||||
-->
|
||||
<trans-unit id="month.1">
|
||||
<source>month.1</source>
|
||||
<target>Januar</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.2">
|
||||
<source>month.2</source>
|
||||
<target>Februar</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.3">
|
||||
<source>month.3</source>
|
||||
<target>März</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.4">
|
||||
<source>month.4</source>
|
||||
<target>April</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.5">
|
||||
<source>month.5</source>
|
||||
<target>Mai</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.6">
|
||||
<source>month.6</source>
|
||||
<target>Juni</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.7">
|
||||
<source>month.7</source>
|
||||
<target>Juli</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.8">
|
||||
<source>month.8</source>
|
||||
<target>August</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.9">
|
||||
<source>month.9</source>
|
||||
<target>September</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.10">
|
||||
<source>month.10</source>
|
||||
<target>Oktober</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.11">
|
||||
<source>month.11</source>
|
||||
<target>November</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.12">
|
||||
<source>month.12</source>
|
||||
<target>Dezember</target>
|
||||
</trans-unit>
|
||||
|
||||
</body>
|
||||
</file>
|
||||
|
||||
@@ -16,17 +16,24 @@
|
||||
'label.title': 'graduation-cap',
|
||||
'label.active': 'lock',
|
||||
'label.roles': 'users',
|
||||
'label.actions': 'pencil-square-o',
|
||||
}) }}
|
||||
|
||||
{% for entry in entries %}
|
||||
<tr>
|
||||
<td>{{ entry.id }}</td>
|
||||
<td>{{ entry.username }}</td>
|
||||
<td><a href="{{ path('user_profile', {'username' : entry.username}) }}">{{ entry.username }}</a></td>
|
||||
<td>{{ entry.alias }}</td>
|
||||
<td>{{ entry.email }}</td>
|
||||
<td>{{ entry.title }}</td>
|
||||
<td>{{ widgets.label_visible(entry.active) }}</td>
|
||||
<td>{{ entry.roles|join(',')|trans }}</td>
|
||||
<td>
|
||||
{{ widgets.button_group({
|
||||
'edit': path('user_profile', {'username' : entry.username}),
|
||||
'trash': path('user_profile_delete', {'username' : entry.username})
|
||||
}) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
13
app/Resources/views/admin/user/_form.html.twig
Normal file
13
app/Resources/views/admin/user/_form.html.twig
Normal file
@@ -0,0 +1,13 @@
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ user.username }}</h3>
|
||||
</div>
|
||||
{{ form_start(form) }}
|
||||
<div class="box-body">
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
13
app/Resources/views/admin/user/edit.html.twig
Normal file
13
app/Resources/views/admin/user/edit.html.twig
Normal file
@@ -0,0 +1,13 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block page_title %}{{ 'edit_profile.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'edit_profile.subtitle'|trans({'%username%': user.username}) }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{{ include('default/_flash_messages.html.twig') }}
|
||||
|
||||
{{ include('admin/user/_form.html.twig', {
|
||||
user: user,
|
||||
form: form,
|
||||
}, with_context = false) }}
|
||||
{% endblock %}
|
||||
@@ -38,11 +38,14 @@
|
||||
|
||||
{% block avanzu_head %}
|
||||
<link rel="stylesheet" href="{{ asset('css/kimai.css') }}">
|
||||
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
|
||||
<script src="{{ asset('theme/bootstrap/js/bootstrap.min.js') }}"></script>
|
||||
<script src="{{ asset('js/kimai.js') }}"></script>
|
||||
<script src="{{ asset('js/Chart.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.dropdown-toggle').dropdown();
|
||||
$(document).kimai({imagePath: '{{ asset('images') }}'});
|
||||
$(document).kimai('ticktac', 'a#ticktac');
|
||||
});
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
{% block main %}
|
||||
|
||||
{# FIXME Übersetzungen hinzufügen #}
|
||||
|
||||
{# blue / yellow / purple / green / black #}
|
||||
{# bar-chart / line-chart / calendar / clock-o #}
|
||||
{#
|
||||
@@ -30,16 +31,16 @@
|
||||
{{ widgets.page_header('dashboard.you') }}
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
{{ widgets.info_box_counter('stats.durationThisMonth', timesheetUser.durationThisMonth|duration(true), 'hourglass-o', 'blue') }}
|
||||
{{ widgets.info_box_counter('stats.durationThisMonth', timesheetUser.durationThisMonth|duration(true), 'hourglass-o', 'green') }}
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
{{ widgets.info_box_counter('stats.amountThisMonth', timesheetUser.amountThisMonth|money, 'money', 'green') }}
|
||||
{{ widgets.info_box_counter('stats.amountThisMonth', timesheetUser.amountThisMonth|money, 'money', 'blue') }}
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
{{ widgets.info_box_counter('stats.durationTotal', timesheetUser.durationTotal|duration(true), 'hourglass-o', 'yellow') }}
|
||||
{{ widgets.info_box_counter('stats.durationTotal', timesheetUser.durationTotal|duration(true), 'hourglass-o', 'red') }}
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
{{ widgets.info_box_counter('stats.amountTotal', timesheetUser.amountTotal|money, 'money', 'red') }}
|
||||
{{ widgets.info_box_counter('stats.amountTotal', timesheetUser.amountTotal|money, 'money', 'yellow') }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -65,13 +66,13 @@
|
||||
{% if is_granted('ROLE_TEAMLEAD') %}
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
{{ widgets.info_box_counter('Anzahl Benutzer', user.totalAmount, 'users', 'blue') }}
|
||||
{{ widgets.info_box_counter('Anzahl Benutzer', user.totalAmount, 'users', 'red') }}
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
{{ widgets.info_box_counter('Aktive Benutzer diesen Monat', timesheetGlobal.activeThisMonth, 'users', 'yellow') }}
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
{{ widgets.info_box_counter('Aktive Benutzer jemals', timesheetGlobal.activeTotal, 'users', 'red') }}
|
||||
{{ widgets.info_box_counter('Aktive Benutzer jemals', timesheetGlobal.activeTotal, 'users', 'blue') }}
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
{{ widgets.info_box_counter('Momentan aktiv', timesheetGlobal.activeCurrently, 'users', 'green') }}
|
||||
|
||||
@@ -89,3 +89,33 @@
|
||||
</a>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro button_group_dropdown(title, actions) %}
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default">{{ title|trans }}</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||
<span class="caret"></span>
|
||||
<span class="sr-only">{{ 'label.toggle_dropdown'|trans }}</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
{% for url, entry in actions %}
|
||||
<li><a href="{{ url }}">{{ entry|trans }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro button_group(actions) %}
|
||||
{% import _self as macro %}
|
||||
<div class="btn-group">
|
||||
{% for icon, url in actions %}
|
||||
{{ macro.button_action(icon, url) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro button_action(icon, url) %}
|
||||
<a href="{{ url }}" class="btn btn-default">
|
||||
<i class="fa fa-{{ icon }}"></i>
|
||||
</a>
|
||||
{% endmacro %}
|
||||
|
||||
@@ -5,17 +5,165 @@
|
||||
|
||||
{% block main %}
|
||||
{% import _self as widgets %}
|
||||
|
||||
{{ include('default/_flash_messages.html.twig') }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12 col-xs-12">
|
||||
{{ widgets.profile_list(user, settings, 'aqua-active') }}
|
||||
<div class="col-md-3">
|
||||
{{ widgets.profile_box(user, stats) }}
|
||||
{{ widgets.profile_infos(user, stats) }}
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12 col-xs-12">
|
||||
{{ widgets.profile_box(user, stats, 'aqua-active') }}
|
||||
<div class="col-md-9">
|
||||
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li {% if tab == "charts" %}class="active"{% endif %}><a href="#charts" data-toggle="tab" aria-expanded="true">{{ 'profile.tab_monthly'|trans }}</a></li>
|
||||
<li {% if tab == "profile" %}class="active"{% endif %}><a href="#profile" data-toggle="tab" aria-expanded="false">{{ 'profile.settings'|trans }}</a></li>
|
||||
<li {% if tab == "password" %}class="active"{% endif %}><a href="#password" data-toggle="tab" aria-expanded="false">{{ 'profile.password'|trans }}</a></li>
|
||||
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane {% if tab == "charts" %}active{% endif %}" id="charts">
|
||||
<script type="text/javascript">
|
||||
var barChartOptions = {
|
||||
scaleBeginAtZero: true,
|
||||
scaleShowGridLines: true,
|
||||
scaleGridLineColor: "rgba(0,0,0,.05)",
|
||||
scaleGridLineWidth: 1,
|
||||
scaleShowHorizontalLines: true,
|
||||
scaleShowVerticalLines: true,
|
||||
barShowStroke: true,
|
||||
barStrokeWidth: 2,
|
||||
barValueSpacing: 5,
|
||||
barDatasetSpacing: 1,
|
||||
responsive: true,
|
||||
maintainAspectRatio: true,
|
||||
tooltipTemplate: "{% raw %}<%= value %>{% endraw %} {{ 'label.hours'|trans }}",
|
||||
};
|
||||
var barChartLabels = [
|
||||
{% for i in 1..11 %}
|
||||
"{{ ('month.' ~i)|trans }}",
|
||||
{% endfor %}
|
||||
"{{ 'month.12'|trans }}"
|
||||
];
|
||||
</script>
|
||||
|
||||
{% for year,yearStat in years %}
|
||||
<h2>{{ year }}</h2>
|
||||
<div class="chart">
|
||||
<canvas id="barChart{{ year }}" style="height: 230px;"></canvas>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var barChartData{{ year }} = {
|
||||
labels: barChartLabels,
|
||||
datasets: [
|
||||
{
|
||||
{# label: '# hours',#}
|
||||
fillColor: "#00a65a",
|
||||
strokeColor: "#00a65a",
|
||||
pointColor: "#00a65a",
|
||||
pointStrokeColor: "#c1c7d1",
|
||||
pointHighlightFill: "#fff",
|
||||
pointHighlightStroke: "rgba(220,220,220,1)",
|
||||
data: [
|
||||
{% for i in 1..11 %}
|
||||
{{ (yearStat.month(i).totalDuration / 3600)|round }},
|
||||
{% endfor %}
|
||||
{{ (yearStat.month(12).totalDuration / 3600)|round }}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
{% if tab == "charts" %}
|
||||
$(function () {
|
||||
var barChartCanvas{{ year }} = $("#barChart{{ year }}").get(0).getContext("2d");
|
||||
var barChart = new Chart(barChartCanvas{{ year }});
|
||||
barChart.Bar(barChartData{{ year }}, barChartOptions);
|
||||
});
|
||||
{% endif %}
|
||||
$('a[href="#charts"]').on('shown.bs.tab', function(e){
|
||||
var barChartCanvas{{ year }} = $("#barChart{{ year }}").get(0).getContext("2d");
|
||||
var barChart = new Chart(barChartCanvas{{ year }});
|
||||
barChart.Bar(barChartData{{ year }}, barChartOptions);
|
||||
});
|
||||
</script>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
<div class="tab-pane {% if tab == "profile" %}active{% endif %}" id="profile">
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
<div class="tab-pane {% if tab == "password" %}active{% endif %}" id="password">
|
||||
{{ form_start(form_password) }}
|
||||
{{ form_widget(form_password) }}
|
||||
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
|
||||
{{ form_end(form_password) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% macro profile_list(user, items, color) %}
|
||||
{% macro profile_infos(user, stats) %}
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'profile.about_me'|trans }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<ul class="nav nav-stacked">
|
||||
{# colors = purple, blue, aqua, red, green #}
|
||||
{# FIXME hourly rate must be dynamic <li><a href="#">{{ 'label.hourly_rate'|trans }} <span class="pull-right badge bg-blue">70</span></a></li> #}
|
||||
<li><a href="#">{{ 'label.id'|trans }} <span class="pull-right badge bg-aqua">{{ user.id }}</span></a></li>
|
||||
<li><a href="#">{{ 'label.username'|trans }} <span class="pull-right badge bg-blue">{{ user.username }}</span></a></li>
|
||||
<li><a href="#">{{ 'label.language'|trans }} <span class="pull-right badge bg-green">{{ user.language }}</span></a></li>
|
||||
<li><a href="#">{{ 'profile.first_entry'|trans }} <span class="pull-right badge bg-purple">{{ stats.firstEntry|date }}</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro profile_box(user, stats) %}
|
||||
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-body box-profile">
|
||||
{{ macro.avatar(user.avatar, user.username, 'profile-user-img img-responsive img-circle') }}
|
||||
<h3 class="profile-username text-center">{{ user.alias }}</h3>
|
||||
|
||||
<p class="text-muted text-center">{{ user.title }}</p>
|
||||
|
||||
<ul class="list-group list-group-unbordered">
|
||||
|
||||
<li class="list-group-item">
|
||||
<b>{{ 'stats.durationThisMonth'|trans }}</b> <a class="pull-right">{{ stats.durationThisMonth|duration }}</a>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<b>{{ 'stats.amountThisMonth'|trans }}</b> <a class="pull-right">{{ stats.amountThisMonth|money }}</a>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<b>{{ 'stats.durationTotal'|trans }}</b> <a class="pull-right">{{ stats.durationTotal|duration }}</a>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<b>{{ 'stats.amountTotal'|trans }}</b> <a class="pull-right">{{ stats.amountTotal|money }}</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
{# <a href="#" class="btn btn-primary btn-block"><b>Follow</b></a> #}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{# -------------------------------- UNUSED FOR NOW -------------------------------- #}
|
||||
{% macro profile_list_unused(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 -->
|
||||
@@ -37,11 +185,11 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro profile_box(user, stats, color) %}
|
||||
{# -------------------------------- UNUSED FOR NOW -------------------------------- #}
|
||||
{% macro profile_box_unused(user, stats, color) %}
|
||||
{% 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>
|
||||
@@ -78,4 +226,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
{% endmacro %}
|
||||
@@ -64,16 +64,16 @@ twig:
|
||||
table_icons: false
|
||||
|
||||
# Assetic Configuration (used for managing web assets: CSS, JavaScript, Sass, etc.)
|
||||
assetic:
|
||||
debug: "%kernel.debug%"
|
||||
use_controller: false
|
||||
bundles: [ ]
|
||||
filters:
|
||||
cssrewrite: ~
|
||||
jsqueeze: ~
|
||||
scssphp:
|
||||
# the formatter must be the FQCN (don't use the 'compressed' value)
|
||||
formatter: "Leafo\\ScssPhp\\Formatter\\Compressed"
|
||||
#assetic:
|
||||
# debug: "%kernel.debug%"
|
||||
# use_controller: false
|
||||
# bundles: [ ]
|
||||
# filters:
|
||||
# cssrewrite: ~
|
||||
# jsqueeze: ~
|
||||
# scssphp:
|
||||
# # the formatter must be the FQCN (don't use the 'compressed' value)
|
||||
# formatter: "Leafo\\ScssPhp\\Formatter\\Compressed"
|
||||
|
||||
# Doctrine Configuration (used to access databases and manipulate their information)
|
||||
doctrine:
|
||||
@@ -85,12 +85,12 @@ doctrine:
|
||||
auto_mapping: true
|
||||
|
||||
# Swiftmailer Configuration (used to send emails)
|
||||
swiftmailer:
|
||||
transport: "%mailer_transport%"
|
||||
host: "%mailer_host%"
|
||||
username: "%mailer_user%"
|
||||
password: "%mailer_password%"
|
||||
spool: { type: memory }
|
||||
#swiftmailer:
|
||||
# transport: "%mailer_transport%"
|
||||
# host: "%mailer_host%"
|
||||
# username: "%mailer_user%"
|
||||
# password: "%mailer_password%"
|
||||
# spool: { type: memory }
|
||||
|
||||
avanzu_admin_theme:
|
||||
use_twig : true
|
||||
|
||||
@@ -29,8 +29,8 @@ monolog:
|
||||
# type: chromephp
|
||||
# level: info
|
||||
|
||||
assetic:
|
||||
use_controller: true
|
||||
#assetic:
|
||||
# use_controller: true
|
||||
|
||||
#swiftmailer:
|
||||
# delivery_address: me@example.com
|
||||
|
||||
86
app/config/mysql.yml
Normal file
86
app/config/mysql.yml
Normal file
@@ -0,0 +1,86 @@
|
||||
doctrine:
|
||||
orm:
|
||||
dql:
|
||||
datetime_functions:
|
||||
convert_tz: DoctrineExtensions\Query\Mysql\ConvertTz
|
||||
date: DoctrineExtensions\Query\Mysql\Date
|
||||
date_format: DoctrineExtensions\Query\Mysql\DateFormat
|
||||
dateadd: DoctrineExtensions\Query\Mysql\DateAdd
|
||||
datesub: DoctrineExtensions\Query\Mysql\DateSub
|
||||
datediff: DoctrineExtensions\Query\Mysql\DateDiff
|
||||
day: DoctrineExtensions\Query\Mysql\Day
|
||||
dayname: DoctrineExtensions\Query\Mysql\DayName
|
||||
dayofweek: DoctrineExtensions\Query\Mysql\DayOfWeek
|
||||
dayofyear: DoctrineExtensions\Query\Mysql\DayOfYear
|
||||
div: DoctrineExtensions\Query\Mysql\Div
|
||||
from_unixtime: DoctrineExtensions\Query\Mysql\FromUnixtime
|
||||
last_day: DoctrineExtensions\Query\Mysql\LastDay
|
||||
minute: DoctrineExtensions\Query\Mysql\Minute
|
||||
now: DoctrineExtensions\Query\Mysql\Now
|
||||
month: DoctrineExtensions\Query\Mysql\Month
|
||||
monthname: DoctrineExtensions\Query\Mysql\MonthName
|
||||
second: DoctrineExtensions\Query\Mysql\Second
|
||||
strtodate: DoctrineExtensions\Query\Mysql\StrToDate
|
||||
time: DoctrineExtensions\Query\Mysql\Time
|
||||
timediff: DoctrineExtensions\Query\Mysql\TimeDiff
|
||||
timestampadd: DoctrineExtensions\Query\Mysql\TimestampAdd
|
||||
timestampdiff: DoctrineExtensions\Query\Mysql\TimestampDiff
|
||||
timetosec: DoctrineExtensions\Query\Mysql\TimeToSec
|
||||
week: DoctrineExtensions\Query\Mysql\Week
|
||||
weekday: DoctrineExtensions\Query\Mysql\WeekDay
|
||||
year: DoctrineExtensions\Query\Mysql\Year
|
||||
yearweek: DoctrineExtensions\Query\Mysql\YearWeek
|
||||
unix_timestamp: DoctrineExtensions\Query\Mysql\UnixTimestamp
|
||||
|
||||
numeric_functions:
|
||||
acos: DoctrineExtensions\Query\Mysql\Acos
|
||||
asin: DoctrineExtensions\Query\Mysql\Asin
|
||||
atan2: DoctrineExtensions\Query\Mysql\Atan2
|
||||
atan: DoctrineExtensions\Query\Mysql\Atan
|
||||
bit_count: DoctrineExtensions\Query\Mysql\BitCount
|
||||
bit_xor: DoctrineExtensions\Query\Mysql\BitXor
|
||||
ceil: DoctrineExtensions\Query\Mysql\Ceil
|
||||
cos: DoctrineExtensions\Query\Mysql\Cos
|
||||
cot: DoctrineExtensions\Query\Mysql\Cot
|
||||
floor: DoctrineExtensions\Query\Mysql\Floor
|
||||
hour: DoctrineExtensions\Query\Mysql\Hour
|
||||
pi: DoctrineExtensions\Query\Mysql\Pi
|
||||
power: DoctrineExtensions\Query\Mysql\Power
|
||||
quarter: DoctrineExtensions\Query\Mysql\Quarter
|
||||
rand: DoctrineExtensions\Query\Mysql\Rand
|
||||
round: DoctrineExtensions\Query\Mysql\Round
|
||||
stddev: DoctrineExtensions\Query\Mysql\StdDev
|
||||
sin: DoctrineExtensions\Query\Mysql\Sin
|
||||
std: DoctrineExtensions\Query\Mysql\Std
|
||||
tan: DoctrineExtensions\Query\Mysql\Tan
|
||||
|
||||
string_functions:
|
||||
ascii: DoctrineExtensions\Query\Mysql\Ascii
|
||||
binary: DoctrineExtensions\Query\Mysql\Binary
|
||||
char_length: DoctrineExtensions\Query\Mysql\CharLength
|
||||
concat_ws: DoctrineExtensions\Query\Mysql\ConcatWs
|
||||
countif: DoctrineExtensions\Query\Mysql\CountIf
|
||||
crc32: DoctrineExtensions\Query\Mysql\Crc32
|
||||
degrees: DoctrineExtensions\Query\Mysql\Degrees
|
||||
field: DoctrineExtensions\Query\Mysql\Field
|
||||
find_in_set: DoctrineExtensions\Query\Mysql\FindInSet
|
||||
greatest: DoctrineExtensions\Query\Mysql\Greatest
|
||||
group_concat: DoctrineExtensions\Query\Mysql\GroupConcat
|
||||
ifelse: DoctrineExtensions\Query\Mysql\IfElse
|
||||
ifnull: DoctrineExtensions\Query\Mysql\IfNull
|
||||
least: DoctrineExtensions\Query\Mysql\Least
|
||||
lpad: DoctrineExtensions\Query\Mysql\Lpad
|
||||
match_against: DoctrineExtensions\Query\Mysql\MatchAgainst
|
||||
md5: DoctrineExtensions\Query\Mysql\Md5
|
||||
nullif: DoctrineExtensions\Query\Mysql\NullIf
|
||||
radians: DoctrineExtensions\Query\Mysql\Radians
|
||||
regexp: DoctrineExtensions\Query\Mysql\Regexp
|
||||
replace: DoctrineExtensions\Query\Mysql\Replace
|
||||
rpad: DoctrineExtensions\Query\Mysql\Rpad
|
||||
sha1: DoctrineExtensions\Query\Mysql\Sha1
|
||||
sha2: DoctrineExtensions\Query\Mysql\Sha2
|
||||
soundex: DoctrineExtensions\Query\Mysql\Soundex
|
||||
substring_index: DoctrineExtensions\Query\Mysql\SubstringIndex
|
||||
uuid_short: DoctrineExtensions\Query\Mysql\UuidShort
|
||||
hex: DoctrineExtensions\Query\Mysql\Hex
|
||||
unhex: DoctrineExtensions\Query\Mysql\Unhex
|
||||
@@ -4,6 +4,9 @@
|
||||
# See http://symfony.com/doc/current/best_practices/configuration.html#canonical-parameters
|
||||
parameters:
|
||||
|
||||
# used to load additional doctrine functions (possible values: mysql, sqlite)
|
||||
database_engine: sqlite
|
||||
|
||||
# Define the database connection string
|
||||
database_url: 'sqlite:///%kernel.root_dir%/data/timesheet.sqlite'
|
||||
# database_url: 'mysql://root:pass@127.0.0.1:3306/timesheet'
|
||||
|
||||
@@ -34,6 +34,6 @@ homepage:
|
||||
permanent: true
|
||||
|
||||
avanzu_admin_profile:
|
||||
path: /{_locale}/profile/{ident}/
|
||||
path: /{_locale}/profile/{username}
|
||||
options:
|
||||
avanzu_admin_route: profile
|
||||
|
||||
50
app/config/sqlite.yml
Normal file
50
app/config/sqlite.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
doctrine:
|
||||
orm:
|
||||
dql:
|
||||
datetime_functions:
|
||||
date: DoctrineExtensions\Query\Sqlite\Date
|
||||
date_format: DoctrineExtensions\Query\Sqlite\DateFormat
|
||||
#dateadd: DoctrineExtensions\Query\Sqlite\DateAdd
|
||||
#datediff: DoctrineExtensions\Query\Sqlite\DateDiff
|
||||
day: DoctrineExtensions\Query\Sqlite\Day
|
||||
dayname: DoctrineExtensions\Query\Sqlite\DayName
|
||||
minute: DoctrineExtensions\Query\Sqlite\Minute
|
||||
#month: DoctrineExtensions\Query\Sqlite\Month
|
||||
#monthname: DoctrineExtensions\Query\Sqlite\MonthName
|
||||
second: DoctrineExtensions\Query\Sqlite\Second
|
||||
month: DoctrineExtensions\Query\Sqlite\Month
|
||||
strftime: DoctrineExtensions\Query\Sqlite\StrfTime
|
||||
#strtodate: DoctrineExtensions\Query\Sqlite\StrToDate
|
||||
#time: DoctrineExtensions\Query\Sqlite\Time
|
||||
#timestampadd: DoctrineExtensions\Query\Sqlite\TimestampAdd
|
||||
#timestampdiff: DoctrineExtensions\Query\Sqlite\TimestampDiff
|
||||
week: DoctrineExtensions\Query\Sqlite\Week
|
||||
weekday: DoctrineExtensions\Query\Sqlite\WeekDay
|
||||
year: DoctrineExtensions\Query\Sqlite\Year
|
||||
|
||||
|
||||
string_functions:
|
||||
# binary: DoctrineExtensions\Query\Sqlite\Binary
|
||||
# char_length: DoctrineExtensions\Query\Sqlite\CharLength
|
||||
concat_ws: DoctrineExtensions\Query\Sqlite\ConcatWs
|
||||
# countif: DoctrineExtensions\Query\Sqlite\CountIf
|
||||
# crc32: DoctrineExtensions\Query\Sqlite\Crc32
|
||||
# degrees: DoctrineExtensions\Query\Sqlite\Degrees
|
||||
# field: DoctrineExtensions\Query\Sqlite\Field
|
||||
# find_in_set: DoctrineExtensions\Query\Sqlite\FindInSet
|
||||
# group_concat: DoctrineExtensions\Query\Sqlite\GroupConcat
|
||||
# ifelse: DoctrineExtensions\Query\Sqlite\IfElse
|
||||
ifnull: DoctrineExtensions\Query\Sqlite\IfNull
|
||||
# match_against: DoctrineExtensions\Query\Sqlite\MatchAgainst
|
||||
# md5: DoctrineExtensions\Query\Sqlite\Md5
|
||||
# nullif: DoctrineExtensions\Query\Sqlite\NullIf
|
||||
# radians: DoctrineExtensions\Query\Sqlite\Radians
|
||||
# regexp: DoctrineExtensions\Query\Sqlite\Regexp
|
||||
replace: DoctrineExtensions\Query\Sqlite\Replace
|
||||
# sha1: DoctrineExtensions\Query\Sqlite\Sha1
|
||||
# sha2: DoctrineExtensions\Query\Sqlite\Sha2
|
||||
# soundex: DoctrineExtensions\Query\Sqlite\Soundex
|
||||
# uuid_short: DoctrineExtensions\Query\Sqlite\UuidShort
|
||||
|
||||
numeric_functions:
|
||||
round: DoctrineExtensions\Query\Sqlite\Round
|
||||
Reference in New Issue
Block a user