From 20aa9c52afb2a579068a01d4dfbbbd7035bb1aa4 Mon Sep 17 00:00:00 2001 From: Neerholt Date: Mon, 31 Aug 2020 14:28:15 +0200 Subject: [PATCH] v0.10.20 - Made some small design changes to home pages --- .../app/Http/Controllers/RootController.php | 4 +- .../views/app/events/index.blade.php | 40 ++++- .../resources/views/app/news/index.blade.php | 139 +++++++++++++----- 3 files changed, 144 insertions(+), 39 deletions(-) diff --git a/skolehjem/app/Http/Controllers/RootController.php b/skolehjem/app/Http/Controllers/RootController.php index d34cb52..9267b65 100644 --- a/skolehjem/app/Http/Controllers/RootController.php +++ b/skolehjem/app/Http/Controllers/RootController.php @@ -21,12 +21,12 @@ class RootController extends Controller if(Response::detect("root.index")->name() == "admin.root.index") return view("admin.root.index"); else { - $news = News::query()->orderBy('id', 'desc')->paginate($perPage); + $news = News::query()->orderBy('id', 'desc')->get(); return view("app.root.index", ["news" => $news]); } } else { - $news = News::query()->orderBy('id', 'desc')->paginate($perPage, ['*'], "page"); + $news = News::query()->orderBy('id', 'desc')->get(); return Response::detect('root.index', ["news" => $news]); } diff --git a/skolehjem/resources/views/app/events/index.blade.php b/skolehjem/resources/views/app/events/index.blade.php index 283daed..50ca69c 100644 --- a/skolehjem/resources/views/app/events/index.blade.php +++ b/skolehjem/resources/views/app/events/index.blade.php @@ -34,15 +34,49 @@ ol { padding-right: 8px; } + + + + /*Alert box*/ + .alert { + padding: 20px; + background-color: #f44336; + color: white; + border-radius: 10px; + } + + .closebtn { + margin-left: 15px; + color: white; + font-weight: bold; + float: right; + font-size: 22px; + line-height: 20px; + cursor: pointer; + transition: 0.3s; + } + + .closebtn:hover { + color: black; + } + + alertBoxBackground { + margin-top: 1rem; + margin-bottom: 30px; + width: auto; + heigt: auto; + } +

{{ __('msg.aktiviteter') }}

@if(count(\App\Notification::query()->where("user_id", "=", auth()->user()->id)->get()) > 0) -
-
- +
+
+ × + Event Canceled @foreach(\App\Notification::query()->where("user_id", "=", auth()->user()->id)->get() as $notification)

{{ $notification->message }}{{ __("msg.canceled") }}

@endforeach diff --git a/skolehjem/resources/views/app/news/index.blade.php b/skolehjem/resources/views/app/news/index.blade.php index 09bdd50..1f40b66 100644 --- a/skolehjem/resources/views/app/news/index.blade.php +++ b/skolehjem/resources/views/app/news/index.blade.php @@ -6,11 +6,11 @@ } div.card { - margin-top: 1rem; - margin-bottom: 30px; + margin-top: .5rem; + margin-bottom: 7px; width: auto; heigt: auto; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + background-color: white; } div.header { @@ -19,10 +19,12 @@ padding: 8px; font-size: 10px; text-align: center; + height: 200px; + width: auto; } div.container { - padding: 8px; + padding: 3px 13px 13px 13px; text-align: justify; line-height: 1.5; } @@ -30,51 +32,120 @@ ol { padding-right: 8px; } + + .title{ + margin-left: 50px; + padding: 10px 10px; + font-size: 22px; + line-height: 30px; + } + + .img{ + width: 1em; + margin-top: 5px; + margin-bottom: 5px; + margin-left: 5px; + font-size: 20px; + padding: 3px 10px; + border-color: cadetblue; + border-radius: 100%; + background-color: cadetblue; + line-height: 30px; + float: left; + } + + .information{ + text-align: center; + background-color: rgba(211, 211, 211, 0.3); + width: 100%; + height: 25px; + } + + .card > .img > a > img, .card > .img > img { + width: 100%; + } { + width: 100%; + } + + html,body,main{ + background-color: rgb(200,200,200); + } + + -
+
@foreach($news as $new) -
- @if($new->resource_id !== null) -
-

{{ $new->name }}

-

{{ $new->subname }}

-
- @else -
-

{{ $new->name }}

-

{{ $new->subname }}

-
- @endif + + @if($new->type_id == 1) +
+
News:
+
{{ $new->subname }}
+ @if($new->resource_id !== null) +
+ @endif -
- @if ($new->type_id == 1 || $new->type_id == 2) {{-- If it's a news or menu then display the whole message --}} - {!! $new->content !!} - @else {{-- If it's a menu, guide or event. Then display up to 300 characters of text --}} - {!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!} +
+ {!! $new->content !!} +
+
+ @elseif($new->type_id == 2) +
+
Menuplan:
+
{{ $new->subname }}
+ @if($new->resource_id !== null) +
+ @endif +
+ @if ($new->type_id == 1 || $new->type_id == 2) {{-- If it's a news or menu then display the whole message --}} + {!! $new->content !!} + @else {{-- If it's a menu, guide or event. Then display up to 300 characters of text --}} + {!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!} + @endif +
+
+ @elseif($new->type_id == 3) +
+
Aktiviteter:
+
{{ $new->subname }}
+ @if($new->resource_id !== null) +
@endif - - @if ($new->type_id == 3) {{-- If it's displaying an event, then show `Tilmeld`, `Læs mere` & `Se deltagere` --}} -
+
{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime(\App\Event::query()->where('id', '=', $new->arrangement_id)->first()->date))->format('d/m/Y \k\l\. H:i') }} | {{\App\Event::query()->where('id', '=', $new->arrangement_id)->first()->accountable}}
+
+ {!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!} +
@if (count(\App\UserEvent::query()->where('event_id', '=', $new->arrangement_id)->where('user_id', '=', Auth::user()->id)->get()) > 0) {{__('msg.afmeld')}} @else {{-- ^ If you're already participating in the event, then show a ´cancel´ button - v Else show a ´participate´ button --}} - {{__('msg.tilmeld')}} + {{__('msg.tilmeld')}} @endif $new->arrangement_id ])}}">{{__('msg.læsmere')}} $new->arrangement_id ])}}">{{__('msg.sedeltagere')}}
- @elseif ($new->type_id == 4) {{-- Else if's displaying guides, then show `Læs mere` --}} - - @endif {{-- Else if it's a menu or news, then don't show a button at bottom --}} +
-
+ @else +
+
Vejledninger:
+
{{ $new->subname }}
+ @if($new->resource_id !== null) +
+ @endif + +
+ {!! \App\Helpers::closetags(substr($new->content, 0, 300) ) !!} + @if ($new->type_id == 4) {{-- Else if's displaying guides, then show `Læs mere` --}} + + @endif {{-- Else if it's a menu or news, then don't show a button at bottom --}} +
+
+ + @endif @endforeach @if(count(\App\News::query()->orderBy("created_at", "desc")->get()) == 0)

{{__('msg.ingennyheder')}}

- @else - {{ $news->links() }} @endif