Skip to content

Commit

Permalink
Replacing labels views with Label UI helper
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Apr 8, 2017
1 parent 0d33186 commit 8136d6f
Show file tree
Hide file tree
Showing 17 changed files with 811 additions and 45 deletions.
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -32,7 +32,8 @@
"autoload": {
"psr-4": {
"Arcanesoft\\Core\\": "src/"
}
},
"files": ["helpers.php"]
},
"autoload-dev": {
"psr-4": {
Expand Down
96 changes: 96 additions & 0 deletions helpers.php
@@ -0,0 +1,96 @@
<?php

use Arcanesoft\Core\Helpers\UI\Label;

/* -----------------------------------------------------------------
| Labels
| -----------------------------------------------------------------
*/

if ( ! function_exists('label_active_icon')) {
/**
* Generate active icon label.
*
* @param bool $active
* @param array $options
* @param bool $withTooltip
*
* @return \Illuminate\Support\HtmlString
*/
function label_active_icon($active, array $options = [], $withTooltip = true) {
return Label::activeIcon($active, $options, $withTooltip);
}
}

if ( ! function_exists('label_active_status')) {
/**
* Generate active status label.
*
* @param bool $active
* @param array $options
*
* @return \Illuminate\Support\HtmlString
*/
function label_active_status($active, array $options = []) {
return Label::activeStatus($active, $options);
}
}

if ( ! function_exists('label_count')) {
/**
* Generate count label.
*
* @param int|float $count
* @param array $options
*
* @return Illuminate\Support\HtmlString
*/
function label_count($count, array $options = []) {
return Label::count($count, $options);
}
}

if ( ! function_exists('label_locked_icon')) {
/**
* Generate locked icon label.
*
* @param bool $locked
* @param array $options
* @param bool $withTooltip
*
* @return \Illuminate\Support\HtmlString
*/
function label_locked_icon($locked, array $options = [], $withTooltip = true) {
return Label::lockedIcon($locked, $options, $withTooltip);
}
}

if ( ! function_exists('label_locked_status')) {
/**
* Generate locked status label.
*
* @param bool $locked
* @param array $options
* @param bool $withIcon
*
* @return \Illuminate\Support\HtmlString
*/
function label_locked_status($locked, array $options = [], $withIcon = true) {
return Label::lockedStatus($locked, $options, $withIcon);
}
}

if ( ! function_exists('label_trashed_status')) {
/**
* Generate trashed status label.
*
* @param array $options
* @param bool $withIcon
*
* @return \Illuminate\Support\HtmlString
*/
function label_trashed_status(array $options = [], $withIcon = true) {
return Label::trashedStatus($options, $withIcon);
}
}

1 change: 1 addition & 0 deletions resources/lang/en/actions.php
Expand Up @@ -13,5 +13,6 @@
'enable' => 'enable',
'restore' => 'restore',
'show' => 'show',
'sync' => 'sync',
'update' => 'update',
];
1 change: 1 addition & 0 deletions resources/lang/en/generals.php
Expand Up @@ -9,4 +9,5 @@
'created_at' => 'Created at',
'updated_at' => 'Updated at',
'deleted_at' => 'Deleted at',
'loading' => 'Loading',
];
1 change: 1 addition & 0 deletions resources/lang/fr/actions.php
Expand Up @@ -13,5 +13,6 @@
'enable' => 'activer',
'restore' => 'restaurer',
'show' => 'afficher',
'sync' => 'synchroniser',
'update' => 'mettre à jour',
];
1 change: 1 addition & 0 deletions resources/lang/fr/generals.php
Expand Up @@ -9,4 +9,5 @@
'created_at' => 'Date création',
'updated_at' => 'Date modification',
'deleted_at' => 'Date suppression',
'loading' => 'Chargement',
];
@@ -0,0 +1,8 @@
<?php
$url = isset($url) ? $url : '#';
$linkClass = isset($linkClass) ? $linkClass : 'btn btn-xs btn-danger';
$iconClass = isset($iconClass) ? $iconClass : 'fa fa-fw fa-chain-broken';
$linkTitle = isset($linkTitle) ? $linkClass : trans('core::actions.detach');
$disabled = isset($disabled) ? $disabled : false;
?>
@include('core::admin._includes.actions.icon-links._base', compact('url', 'linkClass', 'linkTitle', 'iconClass', 'disabled'))
9 changes: 0 additions & 9 deletions resources/views/admin/_includes/labels/active-icon.blade.php

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions resources/views/admin/_includes/labels/count-info.blade.php

This file was deleted.

9 changes: 0 additions & 9 deletions resources/views/admin/_includes/labels/locked-icon.blade.php

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 8136d6f

Please sign in to comment.