Skip to content

Commit

Permalink
Top bar (#17)
Browse files Browse the repository at this point in the history
* fix dropdown

* fixes to fonts and sidebar menu

* fix nunito font as well

* added in stub for profile page

* stub in profile and user settings
  • Loading branch information
baradhili authored Nov 20, 2024
1 parent c7b49f9 commit 562cbe2
Show file tree
Hide file tree
Showing 23 changed files with 29,421 additions and 74 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ Its early stages right now, we are looking for help in:
- [ ] Allow editing of manual demand, but not uploaded
- [ ] Provide rest of skills allocation crud
- [ ] Surely there is a decent dashboard with tile system that works easily (spatie/laravel-dashboard seems to have a very specific use case)
- [ ] Do something with top nav bar
- [X] Do something with top nav bar

Yes it is currently Laravel 10 based, not 11. Bleading edge, especially for major changes is not my thing.
14 changes: 14 additions & 0 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,18 @@ public function destroy($id): RedirectResponse
return Redirect::route('users.index')
->with('success', 'User deleted successfully');
}

public function profile(): View
{
$user = auth()->user();

return view('user.profile', compact('user'));
}

public function settings(): View
{
$user = auth()->user();

return view('user.settings', compact('user'));
}
}
30 changes: 15 additions & 15 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ public function register(): void
*/
public function boot(): void
{
view()->composer('layouts.sidebar', function ($view) {
$menu = Menu::new()
->addclass('sidebar-nav')
->add(Link::to(route('home'), $this->wrapInSpan('Home'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
->add(Link::to(route('resources.index'), $this->wrapInSpan('Resources'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
->add(Link::to(route('contracts.index'), $this->wrapInSpan('Contracts'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
->add(Link::to(route('leaves.index'), $this->wrapInSpan('Leaves'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
->add(Link::to(route('skills.index'), $this->wrapInSpan('Skills'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
->add(Link::to(route('projects.index'), $this->wrapInSpan('Projects'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
->add(Link::to(route('allocations.index'), $this->wrapInSpan('Allocations'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
->add(Link::to(route('services.index'), $this->wrapInSpan('Services'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
->add(Link::to(route('demands.index'), $this->wrapInSpan('Demands'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
->setActiveFromRequest();
// view()->composer('layouts.sidebar', function ($view) {
// $menu = Menu::new()
// ->addclass('sidebar-nav')
// ->add(Link::to(route('home'), $this->wrapInSpan('Home'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
// ->add(Link::to(route('resources.index'), $this->wrapInSpan('Resources'))->addClass('sidebar-link')->addClass('collapsed')->addParentClass('sidebar-item'))
// ->add(Link::to(route('contracts.index'), $this->wrapInSpan('Contracts'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
// ->add(Link::to(route('leaves.index'), $this->wrapInSpan('Leaves'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
// ->add(Link::to(route('skills.index'), $this->wrapInSpan('Skills'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
// ->add(Link::to(route('projects.index'), $this->wrapInSpan('Projects'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
// ->add(Link::to(route('allocations.index'), $this->wrapInSpan('Allocations'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
// ->add(Link::to(route('services.index'), $this->wrapInSpan('Services'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
// ->add(Link::to(route('demands.index'), $this->wrapInSpan('Demands'))->addClass('sidebar-link')->addParentClass('sidebar-item'))
// ->setActiveFromRequest();

$view->with('sidebarMenu', $menu);
});
// $view->with('sidebarMenu', $menu);
// });
}


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"build": "vite build"
},
"devDependencies": {
"@popperjs/core": "^2.11.6",
"@popperjs/core": "^2.11.8",
"autoprefixer": "^10.4.20",
"axios": "^1.6.4",
"bootstrap": "^5.2.3",
"bootstrap": "^5.3.3",
"laravel-vite-plugin": "^1.0.0",
"postcss": "^8.4.49",
"sass": "^1.56.1",
Expand Down
Binary file added resources/fonts/fa-brands-400.ttf
Binary file not shown.
Binary file added resources/fonts/fa-brands-400.woff2
Binary file not shown.
Binary file added resources/fonts/fa-regular-400.ttf
Binary file not shown.
Binary file added resources/fonts/fa-regular-400.woff2
Binary file not shown.
Binary file added resources/fonts/fa-solid-900.ttf
Binary file not shown.
Binary file added resources/fonts/fa-solid-900.woff2
Binary file not shown.
Binary file added resources/fonts/fa-v4compatibility.ttf
Binary file not shown.
Binary file added resources/fonts/fa-v4compatibility.woff2
Binary file not shown.
Binary file added resources/fonts/nunito-latin-400-normal.woff2
Binary file not shown.
16 changes: 16 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,19 @@ document.addEventListener('DOMContentLoaded', function () {
});
});
});

document.querySelectorAll('.sidebar-link[data-bs-toggle="collapse"]').forEach(function(link) {
link.addEventListener('click', function(event) {
event.preventDefault();
var target = document.querySelector(this.getAttribute('data-bs-target'));
if (target.classList.contains('show')) {
target.classList.remove('show');
this.classList.add('collapsed');
this.setAttribute('aria-expanded', 'false');
} else {
target.classList.add('show');
this.classList.remove('collapsed');
this.setAttribute('aria-expanded', 'true');
}
});
});
8 changes: 7 additions & 1 deletion resources/sass/app.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// Fonts
@import url('https://fonts.bunny.net/css?family=Nunito');
@font-face {
font-family: 'Nunito';
font-style: normal;
font-weight: 400;
src: url('../fonts/nunito-latin-400-normal.woff2') format('woff2');
}

// Variables
@import 'variables';

// Bootstrap
@import 'bootstrap/scss/bootstrap';
@import './light.css';

//tailwind
@import "tailwindcss/base";
Expand Down
Loading

0 comments on commit 562cbe2

Please sign in to comment.