-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #610 from tighten/mla/resource-page
Resource page
- Loading branch information
Showing
7 changed files
with
113 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\Resource; | ||
use Carbon\Carbon; | ||
use Illuminate\View\View; | ||
|
||
class ResourceController extends Controller | ||
{ | ||
public function index(): View | ||
{ | ||
$resources = Resource::where('created_at', '>=', Carbon::now()->subDays(30)) | ||
->with('modules') | ||
->get(); | ||
|
||
return view('new-resources', [ | ||
'pageTitle' => __('New Resources'), | ||
'resources' => $resources, | ||
]); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
public/images/modules/javascript-libraries-and-frameworks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
|
||
<div class="w-full bg-white"> | ||
<x-hero> | ||
<h1 class="mb-2 font-bold tracking-wide h2 md:h1">{{ __('New Resources') }}</h1> | ||
</x-hero> | ||
|
||
<x-panel> | ||
@if ($resources->count()) | ||
<ul class="grid gap-4"> | ||
@foreach ($resources as $resource) | ||
<li class="flex gap-2"> | ||
<a href="{{ $resource['url'] }}" class="font-semibold underline"> | ||
{{ $resource['name'] }} | ||
</a> | ||
<span>-</span> | ||
<p> Modules: | ||
@forelse ($resource['modules'] as $module) | ||
{{ $module['name'] }}@if (!$loop->last), @endif | ||
@empty | ||
No Modules | ||
@endforelse | ||
</p> | ||
</li> | ||
@endforeach | ||
</ul> | ||
@else | ||
<p class="text-center">There are no new resources.</p> | ||
@endif | ||
</x-panel> | ||
</div> | ||
@endsection |
47 changes: 20 additions & 27 deletions
47
resources/views/partials/navigation/header/auth-menu.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,25 @@ | ||
<div x-data="{ open: false }" @click.away="open = false" class="relative ml-8"> | ||
<button class="flex items-center justify-center w-12 h-12 hover:no-underline focus:outline-none" x-on:click="open = ! open"> | ||
<img class="rounded-full" | ||
src="{{ auth()->user()->profile_picture }}" | ||
alt="{{ auth()->user()->name }}"> | ||
</button> | ||
<button class="flex items-center justify-center w-12 h-12 hover:no-underline focus:outline-none" x-on:click="open = ! open"> | ||
<img class="rounded-full" src="{{ auth()->user()->profile_picture }}" alt="{{ auth()->user()->name }}"> | ||
</button> | ||
|
||
<div x-show="open" x-cloak class="absolute right-0 z-50 mt-2 origin-top-right rounded-md shadow-lg w-36" | ||
x-transition:enter="transition-all ease-in duration-200 origin-top" | ||
x-transition:enter-start="opacity-0 transform scale-y-0" | ||
x-transition:enter-end="opacity-100 transform scale-y-100" | ||
x-transition:leave="transition-all ease-out duration-200 origin-top" | ||
x-transition:leave-start="opacity-100 transform scale-y-100" | ||
x-transition:leave-end="opacity-0 transform scale-y-0" | ||
> | ||
<div class="overflow-hidden bg-white rounded-md shadow-xs"> | ||
<a href="{{ route_wlocale('user.profile.show') }}" class="block px-4 py-3 text-sm font-medium leading-5 transition-colors duration-75 ease-in-out cursor-pointer hover:no-underline hover:bg-silver focus:outline-none focus:bg-silver"> | ||
{{ __('Profile') }} | ||
</a> | ||
<div x-show="open" x-cloak class="absolute right-0 z-50 mt-2 origin-top-right rounded-md shadow-lg w-36" x-transition:enter="transition-all ease-in duration-200 origin-top" x-transition:enter-start="opacity-0 transform scale-y-0" x-transition:enter-end="opacity-100 transform scale-y-100" x-transition:leave="transition-all ease-out duration-200 origin-top" x-transition:leave-start="opacity-100 transform scale-y-100" x-transition:leave-end="opacity-0 transform scale-y-0"> | ||
<div class="overflow-hidden bg-white rounded-md shadow-xs"> | ||
<a href="{{ route_wlocale('user.profile.show') }}" class="block px-4 py-3 text-sm font-medium leading-5 transition-colors duration-75 ease-in-out cursor-pointer hover:no-underline hover:bg-silver focus:outline-none focus:bg-silver"> | ||
{{ __('Profile') }} | ||
</a> | ||
|
||
<a href="{{ route_wlocale('user.preferences.index') }}" class="block px-4 py-3 text-sm font-medium leading-5 transition-colors duration-75 ease-in-out cursor-pointer hover:no-underline hover:bg-silver focus:outline-none focus:bg-silver"> | ||
{{ __('Preferences') }} | ||
</a> | ||
<a href="{{ route_wlocale('user.preferences.index') }}" class="block px-4 py-3 text-sm font-medium leading-5 transition-colors duration-75 ease-in-out cursor-pointer hover:no-underline hover:bg-silver focus:outline-none focus:bg-silver"> | ||
{{ __('Preferences') }} | ||
</a> | ||
|
||
<a href="{{ route_wlocale('logout') }}" | ||
class="block px-4 py-3 text-sm font-medium leading-5 transition-colors duration-75 ease-in-out cursor-pointer hover:no-underline hover:bg-silver focus:outline-none focus:bg-silver" | ||
onclick="event.preventDefault(); document.getElementById('logout-form').submit();"> | ||
<span>{{ __('Log out') }}</span> | ||
</a> | ||
</div> | ||
</div> | ||
<a href="{{ route_wlocale('user.new-resources') }}" class="block px-4 py-3 text-sm font-medium leading-5 transition-colors duration-75 ease-in-out cursor-pointer hover:no-underline hover:bg-silver focus:outline-none focus:bg-silver"> | ||
{{ __('New Resources') }} | ||
</a> | ||
|
||
<a href="{{ route_wlocale('logout') }}" class="block px-4 py-3 text-sm font-medium leading-5 transition-colors duration-75 ease-in-out cursor-pointer hover:no-underline hover:bg-silver focus:outline-none focus:bg-silver" onclick="event.preventDefault(); document.getElementById('logout-form').submit();"> | ||
<span>{{ __('Log out') }}</span> | ||
</a> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters