tethys/routes/breadcrumbs.php

92 lines
3.6 KiB
PHP
Raw Permalink Normal View History

2018-08-31 14:47:04 +00:00
<?php
2021-02-26 16:02:07 +00:00
// use DaveJamesMiller\Breadcrumbs\Facades\Breadcrumbs;
use Diglactic\Breadcrumbs\Breadcrumbs;
2018-08-31 14:47:04 +00:00
// Dashboard
Breadcrumbs::for('settings.dashboard', function ($trail) {
2018-08-31 14:47:04 +00:00
$trail->push('Dashboard', route('settings.dashboard'));
});
Breadcrumbs::for('publish.dataset.create', function ($breadcrumbs) {
2018-08-31 14:47:04 +00:00
$breadcrumbs->parent('settings.dashboard');
$breadcrumbs->push('Publish', route('publish.dataset.create'));
});
2018-09-04 14:51:04 +00:00
Breadcrumbs::for('access.user.index', function ($breadcrumbs) {
2018-09-04 14:51:04 +00:00
$breadcrumbs->parent('settings.dashboard');
$breadcrumbs->push('User Management', route('access.user.index'));
});
Breadcrumbs::for('access.user.edit', function ($breadcrumbs, $id) {
2018-09-04 14:51:04 +00:00
$breadcrumbs->parent('access.user.index');
$breadcrumbs->push("edit" . $id, route('access.user.edit', $id));
});
Breadcrumbs::for('access.user.create', function ($breadcrumbs) {
2018-09-04 14:51:04 +00:00
$breadcrumbs->parent('access.user.index');
$breadcrumbs->push('users.create', route('access.user.create'));
});
Breadcrumbs::for('access.role.index', function ($breadcrumbs) {
2018-09-04 14:51:04 +00:00
$breadcrumbs->parent('settings.dashboard');
$breadcrumbs->push('Role Management', route('access.role.index'));
});
Breadcrumbs::for('access.role.edit', function ($breadcrumbs, $id) {
2018-09-04 14:51:04 +00:00
$breadcrumbs->parent('access.role.index');
$breadcrumbs->push('edit ' . $id, route('access.role.edit', $id));
});
Breadcrumbs::for('settings.document', function ($breadcrumbs) {
2018-08-31 14:47:04 +00:00
$breadcrumbs->parent('settings.dashboard');
2018-09-04 14:51:04 +00:00
$breadcrumbs->push('Dataset Management', route('settings.document'));
2018-08-31 14:47:04 +00:00
});
Breadcrumbs::for('settings.document.edit', function ($breadcrumbs, $id) {
2018-09-04 14:51:04 +00:00
$breadcrumbs->parent('settings.document');
$breadcrumbs->push('edit ' . $id, route('settings.document.edit', $id));
2018-08-31 14:47:04 +00:00
});
Breadcrumbs::for('settings.document.show', function ($breadcrumbs, $id) {
2018-09-04 14:51:04 +00:00
$breadcrumbs->parent('settings.document');
$breadcrumbs->push('show ' . $id, route('settings.document.show', $id));
2018-08-31 14:47:04 +00:00
});
2018-09-06 15:58:54 +00:00
Breadcrumbs::for('settings.page.index', function ($breadcrumbs) {
2018-09-06 15:58:54 +00:00
$breadcrumbs->parent('settings.dashboard');
$breadcrumbs->push('Page Management', route('settings.page.index'));
});
2018-10-04 14:41:29 +00:00
Breadcrumbs::for('settings.collectionrole.index', function ($breadcrumbs) {
2018-10-04 14:41:29 +00:00
$breadcrumbs->parent('settings.dashboard');
$breadcrumbs->push('Collection Roles', route('settings.collectionrole.index'));
});
Breadcrumbs::for('settings.collectionrole.show', function ($breadcrumbs, $collectionrole) {
2018-10-04 14:41:29 +00:00
$breadcrumbs->parent('settings.collectionrole.index');
$breadcrumbs->push(
'top level collections of role ' . $collectionrole->name,
route('settings.collectionrole.show', $collectionrole)
);
});
Breadcrumbs::for('settings.collection.show', function ($breadcrumbs, $collection) {
2018-10-04 14:41:29 +00:00
// $breadcrumbs->parent('settings.collectionrole.show', $collection->collectionrole);
if ($collection->parent()->exists()) {
$breadcrumbs->parent('settings.collection.show', $collection->parent);
} else {
$breadcrumbs->parent('settings.collectionrole.show', $collection->collectionrole);
}
$breadcrumbs->push('show collection: ' . $collection->name, route('settings.collection.show', $collection));
});
Breadcrumbs::for('settings.collection.edit', function ($breadcrumbs, $id) {
2018-10-04 14:41:29 +00:00
$collection = App\Models\Collection::findOrFail($id);
if ($collection->parent()->exists()) {
$breadcrumbs->parent('settings.collection.show', $collection->parent);
} else {
$breadcrumbs->parent('settings.collectionrole.show', $collection->collectionrole);
}
$breadcrumbs->push('edit collection: ' . $collection->name, route('settings.collection.edit', $id));
});