updated to font-awesome 5 (#181)
This commit is contained in:
@@ -62,7 +62,7 @@ class DashboardController extends Controller
|
||||
|
||||
/**
|
||||
* colors: blue / yellow / purple / green / black
|
||||
* icons: bar-chart / line-chart / calendar / clock-o
|
||||
* icons: bar-chart / line-chart / calendar / clock
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -74,9 +74,9 @@ class DashboardController extends Controller
|
||||
[
|
||||
'header' => 'dashboard.you',
|
||||
'widgets' => [
|
||||
"{{ widgets.info_box_progress('Bewilligte Stunden', 'Stunden zur Abrechnung bewilligt', 120, 10, 'star-o') }}",
|
||||
"{{ widgets.info_box_progress('Bewilligte Stunden', 'Stunden zur Abrechnung bewilligt', 120, 10, 'star') }}",
|
||||
"{{ widgets.info_box_progress('Umsatz / Monat', '70% Increase in 30 Days', 6830, 30, 'credit-card', 'black') }}",
|
||||
"{{ widgets.info_box_progress('Stunden persönlich', 'Das ist noch nicht genug', 135, 60, 'hourglass-o') }}",
|
||||
"{{ widgets.info_box_progress('Stunden persönlich', 'Das ist noch nicht genug', 135, 60, 'hourglass') }}",
|
||||
"{{ widgets.info_box_progress('Anzahl Benutzer', 'Mehr ist besser!', 5, 90, 'user') }}",
|
||||
],
|
||||
],
|
||||
@@ -85,9 +85,9 @@ class DashboardController extends Controller
|
||||
'id' => 'profile.stats',
|
||||
'header' => 'dashboard.you',
|
||||
'widgets' => [
|
||||
"{{ widgets.info_box_counter('stats.durationThisMonth', timesheetUser.durationThisMonth|duration(true), 'hourglass-o', 'green') }}",
|
||||
"{{ widgets.info_box_counter('stats.durationThisMonth', timesheetUser.durationThisMonth|duration(true), 'far fa-hourglass', 'green') }}",
|
||||
//"{{ widgets.info_box_counter('stats.amountThisMonth', timesheetUser.amountThisMonth|money, 'money', 'blue') }}",
|
||||
"{{ widgets.info_box_counter('stats.durationTotal', timesheetUser.durationTotal|duration(true), 'hourglass-o', 'red') }}",
|
||||
"{{ widgets.info_box_counter('stats.durationTotal', timesheetUser.durationTotal|duration(true), 'far fa-hourglass', 'red') }}",
|
||||
//"{{ widgets.info_box_counter('stats.amountTotal', timesheetUser.amountTotal|money, 'money', 'yellow') }}",
|
||||
],
|
||||
],
|
||||
@@ -101,11 +101,11 @@ class DashboardController extends Controller
|
||||
'id' => 'alluser.stats',
|
||||
'header' => 'dashboard.all',
|
||||
'widgets' => [
|
||||
"{{ widgets.info_box_counter('stats.durationThisMonth', timesheetGlobal.durationThisMonth|duration(true), 'hourglass-o', 'blue') }}",
|
||||
"{{ widgets.info_box_counter('stats.durationThisMonth', timesheetGlobal.durationThisMonth|duration(true), 'far fa-hourglass', 'blue') }}",
|
||||
//"{{ widgets.info_box_counter('stats.amountThisMonth', timesheetGlobal.amountThisMonth|money, 'money', 'green') }}",
|
||||
"{{ widgets.info_box_counter('stats.durationTotal', timesheetGlobal.durationTotal|duration(true), 'hourglass-o', 'yellow') }}",
|
||||
"{{ widgets.info_box_counter('stats.durationTotal', timesheetGlobal.durationTotal|duration(true), 'far fa-hourglass', 'yellow') }}",
|
||||
//"{{ widgets.info_box_counter('stats.amountTotal', timesheetGlobal.amountTotal|money, 'money', 'red') }}",
|
||||
"{{ widgets.info_box_counter('stats.activeRecordings', timesheetGlobal.activeCurrently, 'hourglass-o', 'red', path('admin_timesheet', {'state': " . TimesheetQuery::STATE_RUNNING . '})) }}',
|
||||
"{{ widgets.info_box_counter('stats.activeRecordings', timesheetGlobal.activeCurrently, 'far fa-hourglass', 'red', path('admin_timesheet', {'state': " . TimesheetQuery::STATE_RUNNING . '})) }}',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -128,9 +128,9 @@ class DashboardController extends Controller
|
||||
'header' => 'dashboard.admin',
|
||||
'widgets' => [
|
||||
"{{ widgets.info_box_more('stats.userTotal', user.totalAmount, ' ', path('admin_user'), 'user') }}",
|
||||
"{{ widgets.info_box_more('stats.customerTotal', customer.count, '', path('admin_customer'), 'users', 'blue') }}",
|
||||
"{{ widgets.info_box_more('stats.projectsTotal', project.count, '', path('admin_project'), 'book', 'yellow') }}",
|
||||
"{{ widgets.info_box_more('stats.activitiesTotal', activity.count, '', path('admin_activity'), 'tasks', 'purple') }}",
|
||||
"{{ widgets.info_box_more('stats.customerTotal', customer.count, '', path('admin_customer'), 'customer', 'blue') }}",
|
||||
"{{ widgets.info_box_more('stats.projectsTotal', project.count, '', path('admin_project'), 'project', 'yellow') }}",
|
||||
"{{ widgets.info_box_more('stats.activitiesTotal', activity.count, '', path('admin_activity'), 'activity', 'purple') }}",
|
||||
],
|
||||
];
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
@@ -64,7 +64,7 @@ class MenuBuilderSubscriber implements EventSubscriberInterface
|
||||
$isTeamlead = $isLoggedIn && $this->security->isGranted('ROLE_TEAMLEAD');
|
||||
|
||||
$event->addItem(
|
||||
new MenuItemModel('dashboard', 'menu.homepage', 'dashboard', [], 'fa fa-dashboard')
|
||||
new MenuItemModel('dashboard', 'menu.homepage', 'dashboard', [], 'fas fa-tachometer-alt')
|
||||
);
|
||||
|
||||
$this->eventDispatcher->dispatch(
|
||||
@@ -76,7 +76,7 @@ class MenuBuilderSubscriber implements EventSubscriberInterface
|
||||
);
|
||||
|
||||
if ($isTeamlead) {
|
||||
$admin = new MenuItemModel('admin', 'menu.admin', '', [], 'fa fa-wrench');
|
||||
$admin = new MenuItemModel('admin', 'menu.admin', '', [], 'fas fa-wrench');
|
||||
$event->addItem($admin);
|
||||
|
||||
$this->eventDispatcher->dispatch(
|
||||
@@ -89,7 +89,7 @@ class MenuBuilderSubscriber implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
$event->addItem(
|
||||
new MenuItemModel('logout', 'menu.logout', 'security_logout', [], 'fa fa-sign-out')
|
||||
new MenuItemModel('logout', 'menu.logout', 'security_logout', [], 'fas fa-sign-out-alt')
|
||||
);
|
||||
|
||||
$this->activateByRoute(
|
||||
|
||||
@@ -63,7 +63,7 @@ class MenuSubscriber implements EventSubscriberInterface
|
||||
|
||||
$menu = $event->getMenu();
|
||||
$menu->addItem(
|
||||
new MenuItemModel('timesheet', 'menu.timesheet', 'timesheet', [], 'fa fa-clock-o')
|
||||
new MenuItemModel('timesheet', 'menu.timesheet', 'timesheet', [], 'far fa-clock')
|
||||
);
|
||||
|
||||
if (!$isTeamlead) {
|
||||
@@ -71,7 +71,7 @@ class MenuSubscriber implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
$menu->addItem(
|
||||
new MenuItemModel('invoice', 'menu.invoice', 'invoice', [], 'fa fa-print')
|
||||
new MenuItemModel('invoice', 'menu.invoice', 'invoice', [], 'fas fa-file-invoice')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class MenuSubscriber implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
$menu->addChild(
|
||||
new MenuItemModel('timesheet_admin', 'menu.admin_timesheet', 'admin_timesheet', [], 'fa fa-clock-o')
|
||||
new MenuItemModel('timesheet_admin', 'menu.admin_timesheet', 'admin_timesheet', [], 'far fa-clock')
|
||||
);
|
||||
|
||||
if (!$auth->isGranted('ROLE_ADMIN')) {
|
||||
@@ -97,16 +97,16 @@ class MenuSubscriber implements EventSubscriberInterface
|
||||
|
||||
if ($auth->isGranted('ROLE_SUPER_ADMIN')) {
|
||||
$menu->addChild(
|
||||
new MenuItemModel('user_admin', 'menu.admin_user', 'admin_user', [], 'fa fa-user')
|
||||
new MenuItemModel('user_admin', 'menu.admin_user', 'admin_user', [], 'fas fa-user')
|
||||
);
|
||||
}
|
||||
|
||||
$menu->addChild(
|
||||
new MenuItemModel('customer_admin', 'menu.admin_customer', 'admin_customer', [], 'fa fa-users')
|
||||
new MenuItemModel('customer_admin', 'menu.admin_customer', 'admin_customer', [], 'fas fa-users')
|
||||
)->addChild(
|
||||
new MenuItemModel('project_admin', 'menu.admin_project', 'admin_project', [], 'fa fa-book')
|
||||
new MenuItemModel('project_admin', 'menu.admin_project', 'admin_project', [], 'fas fa-project-diagram')
|
||||
)->addChild(
|
||||
new MenuItemModel('activity_admin', 'menu.admin_activity', 'admin_activity', [], 'fa fa-tasks')
|
||||
new MenuItemModel('activity_admin', 'menu.admin_activity', 'admin_activity', [], 'fas fa-tasks')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ class Extensions extends \Twig_Extension
|
||||
new TwigFilter('money', [$this, 'money']),
|
||||
new TwigFilter('currency', [$this, 'currency']),
|
||||
new TwigFilter('country', [$this, 'country']),
|
||||
new TwigFilter('icon', [$this, 'icon']),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -119,6 +120,42 @@ class Extensions extends \Twig_Extension
|
||||
return Intl::getRegionBundle()->getCountryName($country);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $default
|
||||
* @return string
|
||||
*/
|
||||
public function icon($name, $default = '')
|
||||
{
|
||||
$icons = [
|
||||
'user' => 'fas fa-user',
|
||||
'customer' => 'fas fa-users',
|
||||
'project' => 'fas fa-project-diagram',
|
||||
'activity' => 'fas fa-tasks',
|
||||
'admin' => 'fas fa-wrench',
|
||||
'invoice' => 'fas fa-file-invoice',
|
||||
'timesheet' => 'far fa-clock',
|
||||
'dashboard' => 'fas fa-tachometer-alt',
|
||||
'logout' => 'fas fa-sign-out-alt',
|
||||
'trash' => 'far fa-trash-alt',
|
||||
'delete' => 'far fa-trash-alt',
|
||||
'repeat' => 'fas fa-redo-alt',
|
||||
'edit' => 'far fa-edit',
|
||||
'manual' => 'fas fa-book',
|
||||
'help' => 'far fa-question-circle',
|
||||
'start' => 'fas fa-play-circle',
|
||||
'start-small' => 'fas fa-play-circle',
|
||||
'stop' => 'fas fa-stop',
|
||||
'stop-small' => 'far fa-stop-circle',
|
||||
'filter' => 'fas fa-filter',
|
||||
'create' => 'far fa-plus-square',
|
||||
'list' => 'fas fa-list',
|
||||
'print' => 'fas fa-print',
|
||||
];
|
||||
|
||||
return $icons[$name] ?? $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $amount
|
||||
* @param string $currency
|
||||
|
||||
Reference in New Issue
Block a user