updated to font-awesome 5 (#181)

This commit is contained in:
Kevin Papst
2018-06-26 19:58:20 +02:00
committed by GitHub
parent d4a46cf257
commit b58de9be9c
57 changed files with 4220 additions and 2963 deletions

View File

@@ -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