added a new fatfree extension to offer <icons type="status|priority">
This commit is contained in:
parent
c14a7948a5
commit
7083a55e03
@ -3,16 +3,23 @@
|
|||||||
class IconsHelper extends \Prefab {
|
class IconsHelper extends \Prefab {
|
||||||
|
|
||||||
static public $status_icons = [
|
static public $status_icons = [
|
||||||
'New' => ['fas fa-plus-circle has-text-warning', "🆕"],
|
'New' => ['fas fa-circle-dot has-text-success', "🆕"],
|
||||||
'In Progress' => ['fas fa-repeat has-text-link', "🔄"],
|
'In Progress' => ['fas fa-circle-play has-text-link', "🔄"],
|
||||||
'On Hold' => ['fas fa-pause-circle has-text-danger',"⏸️"],
|
'On Hold' => ['fas fa-pause-circle has-text-warning',"⏸️"],
|
||||||
'Completed' => ['fas fa-check-circle has-text-success', "✅"]
|
'Completed' => ['fas fa-check-circle has-text-danger', "✅"]
|
||||||
];
|
];
|
||||||
|
|
||||||
static public $priority_icons = [
|
static public $priority_icons = [
|
||||||
'Low' => ['fas fa-arrow-down',"🟢"],
|
'Low' => ['fas fa-circle-down',"🟢"],
|
||||||
'Medium' => ['fas fa-minus', "🟡"],
|
'Medium' => ['fas fa-circle-dot', "🟡"],
|
||||||
'High' => ['fas fa-arrow-up', "🔴"]
|
'High' => ['fas fa-circle-up', "🔴"]
|
||||||
|
];
|
||||||
|
|
||||||
|
static public $priority_colors = [
|
||||||
|
'Low' => 'success',
|
||||||
|
'Medium' => 'warning',
|
||||||
|
'High' => 'danger',
|
||||||
|
'' => 'info'
|
||||||
];
|
];
|
||||||
|
|
||||||
static public function icons($node){
|
static public function icons($node){
|
||||||
@ -38,13 +45,21 @@ class IconsHelper extends \Prefab {
|
|||||||
break;
|
break;
|
||||||
case 'priority':
|
case 'priority':
|
||||||
$icon_class = IconsHelper::$priority_icons[$value] ?? ['fas fa-question-circle', "🔲"];
|
$icon_class = IconsHelper::$priority_icons[$value] ?? ['fas fa-question-circle', "🔲"];
|
||||||
|
$icon_color = IconsHelper::$priority_colors[$value] ?? 'info';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$icon_class = 'fas fa-question-circle';
|
$icon_class = 'fas fa-question-circle';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($type == 'priority'){
|
||||||
|
// return '<p class="button"><span class="icon is-small">'
|
||||||
|
return '<span class="icon is-medium">
|
||||||
|
<i class="'.$icon_class[0].' fa-lg has-text-'.$icon_color.'"></i>
|
||||||
|
</span>';
|
||||||
|
} else {
|
||||||
|
return '<span class="icon is-medium"><i class="'.$icon_class[0].' fa-lg"></i></span>';
|
||||||
|
}
|
||||||
return '<span class="is-size-5">'.$icon_class[1].'</span>';
|
return '<span class="is-size-5">'.$icon_class[1].'</span>';
|
||||||
return '<i class="'.$icon_class[0].' is-size-4"></i>';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user