Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Aggiunto il breadcrumb, aggiornati gli stili
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxelweb committed Mar 22, 2020
1 parent 5fefd1a commit 220d2f2
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 9 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"require": {
"php": "^7.3",
"ext-json": "*",
"davejamesmiller/laravel-breadcrumbs": "5.x",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.5",
"laravel/framework": "^6.2",
Expand Down
75 changes: 75 additions & 0 deletions config/breadcrumbs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| View Name
|--------------------------------------------------------------------------
|
| Choose a view to display when Breadcrumbs::render() is called.
| Built in templates are:
|
| - 'breadcrumbs::bootstrap4' - Bootstrap 4
| - 'breadcrumbs::bootstrap3' - Bootstrap 3
| - 'breadcrumbs::bootstrap2' - Bootstrap 2
| - 'breadcrumbs::bulma' - Bulma
| - 'breadcrumbs::foundation6' - Foundation 6
| - 'breadcrumbs::materialize' - Materialize
| - 'breadcrumbs::uikit' - UIkit
| - 'breadcrumbs::json-ld' - JSON-LD Structured Data
|
| Or a custom view, e.g. '_partials/breadcrumbs'.
|
*/

'view' => 'breadcrumbs::bootstrap4',

/*
|--------------------------------------------------------------------------
| Breadcrumbs File(s)
|--------------------------------------------------------------------------
|
| The file(s) where breadcrumbs are defined. e.g.
|
| - base_path('routes/breadcrumbs.php')
| - glob(base_path('breadcrumbs/*.php'))
|
*/

'files' => base_path('routes/breadcrumbs.php'),

/*
|--------------------------------------------------------------------------
| Exceptions
|--------------------------------------------------------------------------
|
| Determine when to throw an exception.
|
*/

// When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException)
'unnamed-route-exception' => true,

// When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException)
'missing-route-bound-breadcrumb-exception' => true,

// When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException)
'invalid-named-breadcrumb-exception' => true,

/*
|--------------------------------------------------------------------------
| Classes
|--------------------------------------------------------------------------
|
| Subclass the default classes for more advanced customisations.
|
*/

// Manager
'manager-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,

// Generator
'generator-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,

];
4 changes: 4 additions & 0 deletions resources/css/theme-edit.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
text-align: center;
font-size: 1.1rem !important;
}

.breadcrumb{
background-color: transparent !important;
}
2 changes: 1 addition & 1 deletion resources/views/dashboard/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@extends('layouts.app')

@section('breadcrumbs', Breadcrumbs::render('home'))
@section('content')
<div class="container-fluid">

Expand Down
5 changes: 2 additions & 3 deletions resources/views/layouts/sidebar.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!-- TODO only auth -->
<!-- Sidebar -->
<ul class="navbar-nav bg-gradient-dark sidebar sidebar-dark accordion" id="accordionSidebar">
<ul class="navbar-nav bg-gradient-dark sidebar sidebar-dark accordion toggled" id="accordionSidebar">

<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{{ route('dashboard.index') }}">
Expand All @@ -16,7 +15,7 @@
Generale
</div>

<li class="nav-item active">
<li class="nav-item">
<a class="nav-link" href="{{ route('dashboard.index') }}">
<i class="fas fa-fw fa-tachometer-alt"></i>
<span>Dashboard</span></a>
Expand Down
5 changes: 3 additions & 2 deletions resources/views/layouts/topbar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
<i class="fa fa-bars"></i>
</button>

<div class="d-none d-sm-inline-block form-inline mr-auto ml-md-3 mt-3 mw-100">
@yield('breadcrumbs')
</div>

<!-- Topbar Navbar -->
<ul class="navbar-nav ml-auto">


<!-- Nav Item - Alerts -->
<li class="nav-item dropdown no-arrow mx-1">
<a class="nav-link dropdown-toggle" href="#" id="alertsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down
6 changes: 3 additions & 3 deletions resources/views/profile/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@extends('layouts.app')

@section('breadcrumbs', Breadcrumbs::render('settings'))
@section('content')
<div class="container-fluid">
<div class="d-sm-flex mb-4">
Expand Down Expand Up @@ -56,7 +56,7 @@
<span class="icon text-white-50">
<i class="fas fa-edit"></i>
</span>
<span class="text">Modifica informazioni</span>
<span class="text">Modifica</span>
</button>
</form>
</div>
Expand Down Expand Up @@ -103,7 +103,7 @@
<span class="icon text-white-50">
<i class="fas fa-edit"></i>
</span>
<span class="text">Modifica password</span>
<span class="text">Modifica</span>
</button>
</form>
</div>
Expand Down
12 changes: 12 additions & 0 deletions routes/breadcrumbs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

// Home
Breadcrumbs::for('home', function ($trail) {
$trail->push('Home', route('dashboard.index'));
});

// Home > Impostazioni
Breadcrumbs::for('settings', function ($trail) {
$trail->parent('home');
$trail->push('Impostazioni account', route('profile.index'));
});

0 comments on commit 220d2f2

Please sign in to comment.