diff --git a/skolehjem/app/Http/Controllers/EventController.php b/skolehjem/app/Http/Controllers/EventController.php index c6076ac..fa772f2 100644 --- a/skolehjem/app/Http/Controllers/EventController.php +++ b/skolehjem/app/Http/Controllers/EventController.php @@ -82,11 +82,11 @@ class EventController extends Controller $news->name = "Ny aktivitet"; $news->subname = $event->name; - $news->content = "
" . $this->closetags(substr($event->description, 0, 300)) . "
" . - '" . $this->closetags(substr($event->description, 0, 300)). "
" . + '" . $this->closetags(substr($event->description, 0, 300)). "
" . - 'Du har allerede tilmeldt dig denne Aktivitet!
'; + if (request()->cookie('languagesSetting') == "en") + return 'You are already participating in this event!
'; + + return 'Du har allerede tilmeldt dig denne Aktivitet!
'; + } + + // If not, then it keeps going and saves and shows a success message + $UserEvent = new UserEvent($data); + $UserEvent->user_id = auth()->user()->id; + $UserEvent->save(); + + if (request()->cookie('languagesSetting') == "dk") + return 'Du er hermed tilmeldt denne aktivitet!
'; + if (request()->cookie('languagesSetting') == "en") + return 'You are now participating in this event!
'; + + return 'Du er hermed tilmeldt denne aktivitet!
'; + } } diff --git a/skolehjem/public/css/webapp.css b/skolehjem/public/css/webapp.css index b5c435a..5b62e83 100644 --- a/skolehjem/public/css/webapp.css +++ b/skolehjem/public/css/webapp.css @@ -6977,3 +6977,71 @@ main { display: inline-block; } +#snackbar { + visibility: hidden; + width: calc(90% - 16px); + background-color: #333; + color: #fff; + text-align: center; + border-radius: 2px; + position: fixed; + z-index: 1; + left: calc(5% + 8px); + right: calc(5% + 8px); + bottom: 30px; +} + +#snackbar.show { + visibility: visible; + -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; + animation: fadein 0.5s, fadeout 0.5s 2.5s; +} + +@-webkit-keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + + to { + bottom: 30px; + opacity: 1; + } +} + +@keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + + to { + bottom: 30px; + opacity: 1; + } +} + +@-webkit-keyframes fadeout { + from { + bottom: 30px; + opacity: 1; + } + + to { + bottom: 0; + opacity: 0; + } +} + +@keyframes fadeout { + from { + bottom: 30px; + opacity: 1; + } + + to { + bottom: 0; + opacity: 0; + } +} + diff --git a/skolehjem/public/css/webappdark.css b/skolehjem/public/css/webappdark.css index 3a0976f..b3471b3 100644 --- a/skolehjem/public/css/webappdark.css +++ b/skolehjem/public/css/webappdark.css @@ -6977,6 +6977,74 @@ main { display: inline-block; } +#snackbar { + visibility: hidden; + width: calc(90% - 16px); + background-color: #333; + color: #fff; + text-align: center; + border-radius: 2px; + position: fixed; + z-index: 1; + left: calc(5% + 8px); + right: calc(5% + 8px); + bottom: 30px; +} + +#snackbar.show { + visibility: visible; + -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; + animation: fadein 0.5s, fadeout 0.5s 2.5s; +} + +@-webkit-keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + + to { + bottom: 30px; + opacity: 1; + } +} + +@keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + + to { + bottom: 30px; + opacity: 1; + } +} + +@-webkit-keyframes fadeout { + from { + bottom: 30px; + opacity: 1; + } + + to { + bottom: 0; + opacity: 0; + } +} + +@keyframes fadeout { + from { + bottom: 30px; + opacity: 1; + } + + to { + bottom: 0; + opacity: 0; + } +} + html, body { background-color: #666666; diff --git a/skolehjem/resources/sass/webapp/_default.scss b/skolehjem/resources/sass/webapp/_default.scss index 0d23f7f..4fdfc07 100644 --- a/skolehjem/resources/sass/webapp/_default.scss +++ b/skolehjem/resources/sass/webapp/_default.scss @@ -485,3 +485,43 @@ $primary-color: $blue; display: inline-block; } } + +#snackbar { + visibility: hidden; + width: calc(90% - 16px); + background-color: #333; + color: #fff; + text-align: center; + border-radius: 2px; + position: fixed; + z-index: 1; + left: calc(5% + 8px); + right: calc(5% + 8px); + bottom: 30px; +} + +#snackbar.show { + visibility: visible; + -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; + animation: fadein 0.5s, fadeout 0.5s 2.5s; +} + +@-webkit-keyframes fadein { + from {bottom: 0; opacity: 0;} + to {bottom: 30px; opacity: 1;} +} + +@keyframes fadein { + from {bottom: 0; opacity: 0;} + to {bottom: 30px; opacity: 1;} +} + +@-webkit-keyframes fadeout { + from {bottom: 30px; opacity: 1;} + to {bottom: 0; opacity: 0;} +} + +@keyframes fadeout { + from {bottom: 30px; opacity: 1;} + to {bottom: 0; opacity: 0;} +} diff --git a/skolehjem/resources/views/app/layout/base.blade.php b/skolehjem/resources/views/app/layout/base.blade.php index 44a8999..cb33c2d 100644 --- a/skolehjem/resources/views/app/layout/base.blade.php +++ b/skolehjem/resources/views/app/layout/base.blade.php @@ -8,6 +8,14 @@ @else @endif + +