mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-15 04:27:46 +02:00
feat: add breadcrumb in admin area
- add Breadcrumb library and service - update authorizations - add missing routes to avoid 404 links in breadcrumb - add svg_helper globally in base controller - update purgecss config to check .ts files closes #17
This commit is contained in:
parent
ed6e953010
commit
7fb1de2cf3
35 changed files with 397 additions and 82 deletions
|
|
@ -26,7 +26,7 @@ class BaseController extends Controller
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $helpers = ['auth'];
|
||||
protected $helpers = ['auth', 'breadcrumb', 'svg'];
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
|
|
|||
|
|
@ -41,7 +41,24 @@ class Contributor extends BaseController
|
|||
'podcast' => $this->podcast,
|
||||
];
|
||||
|
||||
echo view('admin/contributor/list', $data);
|
||||
replace_breadcrumb_params([0 => $this->podcast->title]);
|
||||
return view('admin/contributor/list', $data);
|
||||
}
|
||||
|
||||
public function view()
|
||||
{
|
||||
$data = [
|
||||
'contributor' => (new UserModel())->getPodcastContributor(
|
||||
$this->user->id,
|
||||
$this->podcast->id
|
||||
),
|
||||
];
|
||||
|
||||
replace_breadcrumb_params([
|
||||
0 => $this->podcast->title,
|
||||
1 => $this->user->username,
|
||||
]);
|
||||
return view('admin/contributor/view', $data);
|
||||
}
|
||||
|
||||
public function add()
|
||||
|
|
@ -52,7 +69,8 @@ class Contributor extends BaseController
|
|||
'roles' => (new GroupModel())->getContributorRoles(),
|
||||
];
|
||||
|
||||
echo view('admin/contributor/add', $data);
|
||||
replace_breadcrumb_params([0 => $this->podcast->title]);
|
||||
return view('admin/contributor/add', $data);
|
||||
}
|
||||
|
||||
public function attemptAdd()
|
||||
|
|
@ -87,7 +105,11 @@ class Contributor extends BaseController
|
|||
'roles' => (new GroupModel())->getContributorRoles(),
|
||||
];
|
||||
|
||||
echo view('admin/contributor/edit', $data);
|
||||
replace_breadcrumb_params([
|
||||
0 => $this->podcast->title,
|
||||
1 => $this->user->username,
|
||||
]);
|
||||
return view('admin/contributor/edit', $data);
|
||||
}
|
||||
|
||||
public function attemptEdit()
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ class Episode extends BaseController
|
|||
'podcast' => $this->podcast,
|
||||
];
|
||||
|
||||
replace_breadcrumb_params([
|
||||
0 => $this->podcast->title,
|
||||
]);
|
||||
return view('admin/episode/list', $data);
|
||||
}
|
||||
|
||||
|
|
@ -49,6 +52,10 @@ class Episode extends BaseController
|
|||
{
|
||||
$data = ['episode' => $this->episode];
|
||||
|
||||
replace_breadcrumb_params([
|
||||
0 => $this->podcast->title,
|
||||
1 => $this->episode->title,
|
||||
]);
|
||||
return view('admin/episode/view', $data);
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +67,10 @@ class Episode extends BaseController
|
|||
'podcast' => $this->podcast,
|
||||
];
|
||||
|
||||
echo view('admin/episode/create', $data);
|
||||
replace_breadcrumb_params([
|
||||
0 => $this->podcast->title,
|
||||
]);
|
||||
return view('admin/episode/create', $data);
|
||||
}
|
||||
|
||||
public function attemptCreate()
|
||||
|
|
@ -115,7 +125,11 @@ class Episode extends BaseController
|
|||
'episode' => $this->episode,
|
||||
];
|
||||
|
||||
echo view('admin/episode/edit', $data);
|
||||
replace_breadcrumb_params([
|
||||
0 => $this->podcast->title,
|
||||
1 => $this->episode->title,
|
||||
]);
|
||||
return view('admin/episode/edit', $data);
|
||||
}
|
||||
|
||||
public function attemptEdit()
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ class Podcast extends BaseController
|
|||
{
|
||||
$data = ['podcast' => $this->podcast];
|
||||
|
||||
replace_breadcrumb_params([0 => $this->podcast->title]);
|
||||
return view('admin/podcast/view', $data);
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +70,7 @@ class Podcast extends BaseController
|
|||
),
|
||||
];
|
||||
|
||||
echo view('admin/podcast/create', $data);
|
||||
return view('admin/podcast/create', $data);
|
||||
}
|
||||
|
||||
public function attemptCreate()
|
||||
|
|
@ -145,7 +146,8 @@ class Podcast extends BaseController
|
|||
'categories' => (new CategoryModel())->findAll(),
|
||||
];
|
||||
|
||||
echo view('admin/podcast/edit', $data);
|
||||
replace_breadcrumb_params([0 => $this->podcast->title]);
|
||||
return view('admin/podcast/edit', $data);
|
||||
}
|
||||
|
||||
public function attemptEdit()
|
||||
|
|
|
|||
|
|
@ -34,13 +34,21 @@ class User extends BaseController
|
|||
return view('admin/user/list', $data);
|
||||
}
|
||||
|
||||
public function view()
|
||||
{
|
||||
$data = ['user' => $this->user];
|
||||
|
||||
replace_breadcrumb_params([0 => $this->user->username]);
|
||||
return view('admin/user/view', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = [
|
||||
'roles' => (new GroupModel())->getUserRoles(),
|
||||
];
|
||||
|
||||
echo view('admin/user/create', $data);
|
||||
return view('admin/user/create', $data);
|
||||
}
|
||||
|
||||
public function attemptCreate()
|
||||
|
|
@ -99,7 +107,8 @@ class User extends BaseController
|
|||
'roles' => (new GroupModel())->getUserRoles(),
|
||||
];
|
||||
|
||||
echo view('admin/user/edit', $data);
|
||||
replace_breadcrumb_params([0 => $this->user->username]);
|
||||
return view('admin/user/edit', $data);
|
||||
}
|
||||
|
||||
public function attemptEdit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue