Conflicts:
	skolehjem/app/Http/Controllers/MenuPlanController.php
This commit is contained in:
frederikpyt 2020-08-12 15:28:15 +02:00
commit 5c871c3fb7
37 changed files with 582 additions and 244 deletions

View File

@ -4,7 +4,6 @@
<include_path>
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/container" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/event-dispatcher" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/http-factory" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/log" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/simple-cache" />
@ -26,8 +25,6 @@
<path value="$PROJECT_DIR$/skolehjem/vendor/vlucas/phpdotenv" />
<path value="$PROJECT_DIR$/skolehjem/vendor/dnoegel/php-xdg-base-dir" />
<path value="$PROJECT_DIR$/skolehjem/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laminas/laminas-diactoros" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laminas/laminas-zendframework-bridge" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/framework" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/passport" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/tinker" />
@ -62,8 +59,6 @@
<path value="$PROJECT_DIR$/skolehjem/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/skolehjem/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/skolehjem/vendor/firebase/php-jwt" />
<path value="$PROJECT_DIR$/skolehjem/vendor/lcobucci/jwt" />
<path value="$PROJECT_DIR$/skolehjem/vendor/php-http/message-factory" />
<path value="$PROJECT_DIR$/skolehjem/vendor/fideloper/proxy" />
<path value="$PROJECT_DIR$/skolehjem/vendor/fruitcake/laravel-cors" />
<path value="$PROJECT_DIR$/skolehjem/vendor/paragonie/random_compat" />
@ -120,6 +115,14 @@
<path value="$PROJECT_DIR$/skolehjem/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravelcollective/html" />
<path value="$PROJECT_DIR$/skolehjem/vendor/directorytree/ldaprecord" />
<path value="$PROJECT_DIR$/skolehjem/vendor/directorytree/ldaprecord-laravel" />
<path value="$PROJECT_DIR$/skolehjem/vendor/tightenco/collect" />
<path value="$PROJECT_DIR$/skolehjem/vendor/dompdf/dompdf" />
<path value="$PROJECT_DIR$/skolehjem/vendor/barryvdh/laravel-dompdf" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phenx/php-font-lib" />
<path value="$PROJECT_DIR$/skolehjem/vendor/sabberworm/php-css-parser" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phenx/php-svg-lib" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />

View File

@ -7,6 +7,7 @@
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/asm89/stack-cors" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/barryvdh/laravel-dompdf" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/brick/math" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/defuse/php-encryption" />
@ -14,6 +15,7 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/inflector" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/lexer" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dompdf/dompdf" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dragonmantank/cron-expression" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/facade/flare-client-php" />
@ -30,14 +32,11 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/hamcrest/hamcrest-php" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jaybizzle/crawler-detect" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jenssegers/agent" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laminas/laminas-diactoros" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laminas/laminas-zendframework-bridge" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/framework" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/passport" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/tinker" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/ui" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravelcollective/html" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/lcobucci/jwt" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/commonmark" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/event" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/flysystem" />
@ -54,7 +53,8 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/paragonie/random_compat" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/php-http/message-factory" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phenx/php-font-lib" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phenx/php-svg-lib" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/reflection-common" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/type-resolver" />
@ -69,7 +69,6 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/http-factory" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/simple-cache" />
@ -77,6 +76,7 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ramsey/collection" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ramsey/uuid" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sabberworm/php-css-parser" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/scrivo/highlight.php" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/comparator" />

View File

@ -86,12 +86,9 @@ class EventController extends Controller
$news->name = "Ny aktivitet";
$news->subname = $event->name;
$news->content = "<p>" . $this->closetags(substr($event->description, 0, 300)). "</p>" .
'<div class="row align-items-center">'. //route("userevents.createajax", ["event_id" => $event->id ])
'<a style="width: 33%; margin: 0; padding: 0; font-weight: 700;" class="sde-blue" href="javascript:void(0);" onclick="ajaxCall('. $event->id .')">Tilmeld</a>'.
'<a style="width: 33%; margin: 0; padding: 0; text-align: center; font-weight: 700;" class="sde-blue" href="'. route("events.show", ["event" => $event->id ]) .'">Læs mere</a>'.
'<a style="width: 33%; margin: 0; padding: 0; text-align: end; font-weight: 700;" class="sde-blue" href="'. route("events.accountsignups", ["event" => $event->id ]) .'">Se deltagere</a>'.
'</div>';
$news->arrangement_id = $event->id;
$news->type_id = '3';
$news->content = $event->description;
$news->resource_id = $event->resource_id;
$news->save();
}
@ -184,11 +181,13 @@ class EventController extends Controller
$news->name = "Aktivitet opdateret";
$news->subname = $event->name;
$news->arrangement_id = $event->id;
$news->type_id = '3';
$news->content = "<p>" . $this->closetags(substr($event->description, 0, 300)). "</p>" .
'<div class="row align-items-center">'. //route("userevents.createajax", ["event_id" => $event->id ])
'<a style="width: 33%; margin: 0; padding: 0; font-weight: 700;" class="sde-blue" href="javascript:void(0);" onclick="ajaxCall('. $event->id .')">Tilmeld</a>'.
'<a style="width: 33%; margin: 0; padding: 0; text-align: center; font-weight: 700;" class="sde-blue" href="'. route("events.show", ["event" => $event->id ]) .'">Læs mere</a>'.
'<a style="width: 33%; margin: 0; padding: 0; text-align: end; font-weight: 700;" class="sde-blue" href="'. route("events.accountsignups", ["event" => $event->id ]) .'">Se deltagere</a>'.
'<div class="row" style="justify-content: space-between;">'. //route("userevents.createajax", ["event_id" => $event->id ])
'<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue" href="javascript:void(0);" onclick="ajaxCall('. $event->id .')">Tilmeld</a>'.
'<a style="margin: 0; padding: 0; text-align: center; font-weight: 700;" class="sde-blue" href="'. route("events.show", ["event" => $event->id ]) .'">Læs mere</a>'.
'<a style="margin: 0; padding: 0; text-align: end; font-weight: 700;" class="sde-blue" href="'. route("events.accountsignups", ["event" => $event->id ]) .'">Se deltagere</a>'.
'</div>';
$news->save();
}

View File

@ -80,8 +80,10 @@ class GuideController extends Controller
$news->name = "Ny Vejledning";
$news->subname = $guide->name;
$news->arrangement_id = $guide->id;
$news->type_id = '4';
$news->content = $this->closetags(substr($guide->guide_articles, 0, 300)). '<br><a style="font-weight: 700;" href="' . route("guides.show", ["guide" => $guide]). '" class="sde-blue ">Læs mere</a>';
$news->content = $guide->guide_articles;
$news->resource_id = $guide->resource_id;
$news->save();
@ -142,6 +144,8 @@ class GuideController extends Controller
$news->name = "Vejledning opdateret";
$news->subname = $guidee->name;
$news->arrangement_id = $guide->id;
$news->type_id = '4';
$news->content = $this->closetags(substr($guidee->guide_articles, 0, 300)). '<br><a style="font-weight: 700;" href="' . route("guides.show", ["guide" => $guide]). '" class="sde-blue ">Læs mere</a>';

View File

@ -2,10 +2,12 @@
namespace App\Http\Controllers;
use App;
use App\ExternalLink;
use App\MenuPlan;
use App\News;
use App\User;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
@ -77,6 +79,8 @@ class MenuPlanController extends Controller
$news->name = "Ny menuplan";
$news->subname = "Uge " . $menuPlan->week;
$news->arrangement_id = $menuPlan->id;
$news->type_id = '2';
$news->content = $menuPlan->menu;
if($request->file("resource")) {
@ -143,6 +147,12 @@ class MenuPlanController extends Controller
"subname" => "Uge " . $menuplan->week,
"content" => $menuplan->menu
];
//Sæt ind i $news array'et
$news->name = "Opdateret menuplan";
$news->subname = "Uge " . $menuplan->week;
$news->arrangement_id = $menuplan->id;
$news->type_id = '2';
$news->content = $menuplan->menu;
NewsController::storeAndGet($news);
}
@ -156,7 +166,7 @@ class MenuPlanController extends Controller
* Remove the specified resource from storage.
* Test delete return index function.
* @param int $id
* @return \Illuminate\Http\RedirectResponse
* @return RedirectResponse
*/
public function destroy($id)
{
@ -165,5 +175,19 @@ class MenuPlanController extends Controller
return redirect()->route("menu-plans.index");
}
/**
* Remove the specified resource from storage.
* Test delete return index function.
* @param $Id
* @return RedirectResponse
*/
public function genPDF($Id){
$menuPlan = MenuPlan::query()->where("id", "=", $Id)->first();
$pdf = \Illuminate\Support\Facades\App::make('dompdf.wrapper');
$data = '<div style="text-align: center">'. '<h1 style="font-size: 36px">Uge '. $menuPlan->week. '</h1>' .$menuPlan->menu. '</div>';
$pdf->loadHTML($data);
return $pdf->stream();
}
}

View File

@ -60,6 +60,7 @@ class NewsController extends Controller
$news = new News($data);
$news->name = "";
$news->type_id = '1';
$news->save();
Helpers::sendNewsNotification($news, User::all());
@ -115,7 +116,7 @@ class NewsController extends Controller
public function update(Request $request, News $news)
{
$data = $request->validate([
"name" => "required",
"subname" => "required",
"content" => "required"
]);

View File

@ -0,0 +1,24 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class NewsTypeController extends Controller
{
public function index() {
}
public function store() {
}
public function update() {
}
public function show() {
}
}

View File

@ -140,4 +140,25 @@ class UserEventController extends Controller
return '<p class="text-center"><b>Du er hermed tilmeldt denne aktivitet!</b></p>';
}
public function createajaxcancel(Request $request)
{
// Check the UserEvent table if there is a row that has the user_id AND the event_id
$UserEvent = UserEvent::where('user_id', auth()->user()->id)
->where('event_id', $request->event_id);
// If you are in the Event, then remove yourself.
if (count($UserEvent->get()) > 0) {
// If not, then it keeps going and saves and shows a success message
$UserEvent->delete();
if (request()->cookie('languagesSetting') == "dk")
return '<p class="text-center"><b>Du er hermed afmeldt aktiviteten!</b></p>';
if (request()->cookie('languagesSetting') == "en")
return '<p class="text-center"><b>You are no longer participating in this event!</b></p>';
return '<p class="text-center"><b>Du er hermed afmeldt aktiviteten!</b></p>';
}
}
}

View File

@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class News extends Model
{
protected $fillable = [
'name', 'subname', 'content', 'resource_id'
'name', 'subname', 'content', 'resource_id', 'arrangement_id', 'type'
];
}

View File

@ -0,0 +1,12 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class NewsType extends Model
{
protected $fillable = [
'type'
];
}

View File

@ -9,6 +9,7 @@
"license": "MIT",
"require": {
"php": "^7.2.5",
"barryvdh/laravel-dompdf": "^0.8.6",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",

416
skolehjem/composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8ba128c6252a57bde3eb22750ed51bef",
"content-hash": "8e62a745d683f5494f4d1efefc047dfd",
"packages": [
{
"name": "asm89/stack-cors",
@ -58,6 +58,62 @@
],
"time": "2019-12-24T22:41:47+00:00"
},
{
"name": "barryvdh/laravel-dompdf",
"version": "v0.8.6",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-dompdf.git",
"reference": "d7108f78cf5254a2d8c224542967f133e5a6d4e8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/d7108f78cf5254a2d8c224542967f133e5a6d4e8",
"reference": "d7108f78cf5254a2d8c224542967f133e5a6d4e8",
"shasum": ""
},
"require": {
"dompdf/dompdf": "^0.8",
"illuminate/support": "^5.5|^6|^7",
"php": ">=7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.8-dev"
},
"laravel": {
"providers": [
"Barryvdh\\DomPDF\\ServiceProvider"
],
"aliases": {
"PDF": "Barryvdh\\DomPDF\\Facade"
}
}
},
"autoload": {
"psr-4": {
"Barryvdh\\DomPDF\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "A DOMPDF Wrapper for Laravel",
"keywords": [
"dompdf",
"laravel",
"pdf"
],
"time": "2020-02-25T20:44:34+00:00"
},
{
"name": "brick/math",
"version": "0.8.15",
@ -102,12 +158,6 @@
"brick",
"math"
],
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/brick/math",
"type": "tidelift"
}
],
"time": "2020-04-15T15:59:35+00:00"
},
{
@ -218,20 +268,6 @@
"uppercase",
"words"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
"type": "tidelift"
}
],
"time": "2020-05-29T15:13:26+00:00"
},
{
@ -294,21 +330,73 @@
"parser",
"php"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
"time": "2020-05-25T17:44:05+00:00"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
"name": "dompdf/dompdf",
"version": "v0.8.5",
"source": {
"type": "git",
"url": "https://github.com/dompdf/dompdf.git",
"reference": "6782abfc090b132134cd6cea0ec6d76f0fce2c56"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/6782abfc090b132134cd6cea0ec6d76f0fce2c56",
"reference": "6782abfc090b132134cd6cea0ec6d76f0fce2c56",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-mbstring": "*",
"phenx/php-font-lib": "^0.5.1",
"phenx/php-svg-lib": "^0.3.3",
"php": "^7.1"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"ext-gd": "Needed to process images",
"ext-gmagick": "Improves image processing performance",
"ext-imagick": "Improves image processing performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "0.7-dev"
}
},
"autoload": {
"psr-4": {
"Dompdf\\": "src/"
},
"classmap": [
"lib/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
"type": "tidelift"
"name": "Brian Sweeney",
"email": "eclecticgeek@gmail.com"
},
{
"name": "Gabriel Bull",
"email": "me@gabrielbull.com"
}
],
"time": "2020-05-25T17:44:05+00:00"
"description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
"homepage": "https://github.com/dompdf/dompdf",
"time": "2020-02-20T03:52:51+00:00"
},
{
"name": "dragonmantank/cron-expression",
@ -542,12 +630,6 @@
"crossdomain",
"laravel"
],
"funding": [
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2020-04-28T08:47:37+00:00"
},
{
@ -1356,12 +1438,6 @@
"sftp",
"storage"
],
"funding": [
{
"url": "https://offset.earth/frankdejonge",
"type": "other"
}
],
"time": "2020-05-18T15:13:39+00:00"
},
{
@ -1495,16 +1571,6 @@
"logging",
"psr-3"
],
"funding": [
{
"url": "https://github.com/Seldaek",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
"type": "tidelift"
}
],
"time": "2020-05-22T08:12:19+00:00"
},
{
@ -1709,6 +1775,83 @@
],
"time": "2020-06-07T11:41:29+00:00"
},
{
"name": "phenx/php-font-lib",
"version": "0.5.2",
"source": {
"type": "git",
"url": "https://github.com/PhenX/php-font-lib.git",
"reference": "ca6ad461f032145fff5971b5985e5af9e7fa88d8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/ca6ad461f032145fff5971b5985e5af9e7fa88d8",
"reference": "ca6ad461f032145fff5971b5985e5af9e7fa88d8",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5 || ^6 || ^7"
},
"type": "library",
"autoload": {
"psr-4": {
"FontLib\\": "src/FontLib"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
}
],
"description": "A library to read, parse, export and make subsets of different types of font files.",
"homepage": "https://github.com/PhenX/php-font-lib",
"time": "2020-03-08T15:31:32+00:00"
},
{
"name": "phenx/php-svg-lib",
"version": "v0.3.3",
"source": {
"type": "git",
"url": "https://github.com/PhenX/php-svg-lib.git",
"reference": "5fa61b65e612ce1ae15f69b3d223cb14ecc60e32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/5fa61b65e612ce1ae15f69b3d223cb14ecc60e32",
"reference": "5fa61b65e612ce1ae15f69b3d223cb14ecc60e32",
"shasum": ""
},
"require": {
"sabberworm/php-css-parser": "^8.3"
},
"require-dev": {
"phpunit/phpunit": "^5.5|^6.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Svg\\": "src/Svg"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
}
],
"description": "A library to read, parse and export to PDF SVG files.",
"homepage": "https://github.com/PhenX/php-svg-lib",
"time": "2019-09-11T20:02:13+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.7.4",
@ -1762,16 +1905,6 @@
"php",
"type"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
"type": "tidelift"
}
],
"time": "2020-06-07T10:40:07+00:00"
},
{
@ -2266,13 +2399,52 @@
"identifier",
"uuid"
],
"funding": [
"time": "2020-03-29T20:13:32+00:00"
},
{
"url": "https://github.com/ramsey",
"type": "github"
"name": "sabberworm/php-css-parser",
"version": "8.3.1",
"source": {
"type": "git",
"url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
"reference": "d217848e1396ef962fb1997cf3e2421acba7f796"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/d217848e1396ef962fb1997cf3e2421acba7f796",
"reference": "d217848e1396ef962fb1997cf3e2421acba7f796",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"codacy/coverage": "^1.4",
"phpunit/phpunit": "~4.8"
},
"type": "library",
"autoload": {
"psr-0": {
"Sabberworm\\CSS": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Raphael Schweikert"
}
],
"time": "2020-03-29T20:13:32+00:00"
"description": "Parser for CSS Files written in PHP",
"homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser",
"keywords": [
"css",
"parser",
"stylesheet"
],
"time": "2020-06-01T09:10:00+00:00"
},
{
"name": "spatie/laravel-permission",
@ -2340,12 +2512,6 @@
"security",
"spatie"
],
"funding": [
{
"url": "https://spatie.be/open-source/support-us",
"type": "custom"
}
],
"time": "2020-05-20T00:31:29+00:00"
},
{
@ -2586,20 +2752,6 @@
],
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-27T08:34:37+00:00"
},
{
@ -2787,20 +2939,6 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@ -3507,20 +3645,6 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
@ -3845,20 +3969,6 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@ -4300,16 +4410,6 @@
"env",
"environment"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
"type": "tidelift"
}
],
"time": "2020-06-07T18:25:35+00:00"
},
{
@ -4416,20 +4516,6 @@
"constructor",
"instantiate"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2020-05-29T17:27:14+00:00"
},
{
@ -4484,12 +4570,6 @@
"flare",
"reporting"
],
"funding": [
{
"url": "https://www.patreon.com/spatie",
"type": "patreon"
}
],
"time": "2020-03-02T15:52:04+00:00"
},
{
@ -4950,20 +5030,6 @@
"php",
"symfony"
],
"funding": [
{
"url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L",
"type": "custom"
},
{
"url": "https://github.com/nunomaduro",
"type": "github"
},
{
"url": "https://www.patreon.com/nunomaduro",
"type": "patreon"
}
],
"time": "2020-04-04T19:56:08+00:00"
},
{
@ -5681,12 +5747,6 @@
"highlight.php",
"syntax"
],
"funding": [
{
"url": "https://github.com/allejo",
"type": "github"
}
],
"time": "2020-03-02T05:59:21+00:00"
},
{

View File

@ -161,6 +161,7 @@ return [
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Barryvdh\DomPDF\ServiceProvider::class,
/*
* Package Service Providers...

View File

@ -19,6 +19,8 @@ class CreateNewsTable extends Migration
$table->string('subname');
$table->text("content");
$table->foreignId('resource_id')->nullable()->constrained('resources', 'id');
$table->integer("arrangement_id")->nullable(); //Gets ID from given event, menu, guide or news
$table->foreignid("type_id")->nullable()->constrained("news_types", "id");
$table->timestamps();
});
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNewsType extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('news_types', function (Blueprint $table) {
$table->id();
$table->string("type");
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('news_types');
}
}

View File

@ -16,5 +16,6 @@ class DatabaseSeeder extends Seeder
$this->call(UserSeeder::class);
$this->call(ContactSeeder::class);
$this->call(LocationSeeder::class);
$this->call(NewsTypeSeeder::class);
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Seeder;
class NewsTypeSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$newstypedata = [
[
'type' => "News",
],
[
'type' => "Menu",
],
[
'type' => "Activity",
],
[
'type' => "Guide",
],
];
foreach ($newstypedata as $data) {
$newsType = new \App\NewsType();
$newsType->type = $data["type"];
$newsType->save();
}
}
}

View File

@ -7019,6 +7019,10 @@ main {
bottom: 30px;
}
.container > * {
word-break: break-word;
}
#snackbar.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;

View File

@ -7019,6 +7019,10 @@ main {
bottom: 30px;
}
.container > * {
word-break: break-word;
}
#snackbar.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;

View File

@ -53,6 +53,9 @@ return[
"ændrer" => "Skift",
"profilbillede" => "Upload profil billede",
"omkring" => "Omkring",
"læsmere" => "Læs mere",
"sedeltagere" => "Se deltagere",
"af" => "Af"

View File

@ -17,7 +17,7 @@ return[
"dereringenmenuplanerdenneuge" => "There is no menu for this week",
"uge" => "week",
"ugestor" => "Week",
"dereringenaktiviteter" => "There is no activity this week",
"dereringenaktiviteter" => "There are no activities",
"setilmeldteaktiviteter" => "See registered Activities",
"tilmeldteaktiviteter" => "Your registered Activities",
"tilmeldtesnavn" => "Participants",
@ -61,5 +61,8 @@ return[
"ændrebillede" => "Change picture",
"ændrer" => "Change",
"profilbillede" => "Upload profile picture",
"Omkring" => "About",
"omkring" => "About",
"læsmere" => "Read more",
"sedeltagere" => "See participants",
"af" => "By"
];

View File

@ -524,6 +524,10 @@ $primary-color: $blue;
bottom: 30px;
}
.container > * {
word-break: break-word;
}
#snackbar.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;

View File

@ -53,9 +53,9 @@
modules: {
'toolbar': [
[ 'bold', 'italic', 'underline', 'strike' ],
[{ 'color': [] }, { 'background': [] }],
[{ 'color': [] }],
[{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link' ],

View File

@ -52,9 +52,9 @@
modules: {
'toolbar': [
[ 'bold', 'italic', 'underline', 'strike' ],
[{ 'color': [] }, { 'background': [] }],
[{ 'color': [] }],
[{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link' ],

View File

@ -48,9 +48,9 @@
modules: {
'toolbar': [
[ 'bold', 'italic', 'underline', 'strike' ],
[{ 'color': [] }, { 'background': [] }],
[{ 'color': [] }],
[{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link' ],

View File

@ -48,9 +48,9 @@
modules: {
'toolbar': [
[ 'bold', 'italic', 'underline', 'strike' ],
[{ 'color': [] }, { 'background': [] }],
[{ 'color': [] }],
[{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link' ],

View File

@ -63,9 +63,9 @@
modules: {
'toolbar': [
[ 'bold', 'italic', 'underline', 'strike' ],
[{ 'color': ['#ffffff-#000000'] }, { 'background': [] }],
[{ 'color': [] }],
[{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link' ],

View File

@ -47,9 +47,9 @@
modules: {
'toolbar': [
[ 'bold', 'italic', 'underline', 'strike' ],
[{ 'color': [] }, { 'background': [] }],
[{ 'color': [] }],
[{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link' ],

View File

@ -19,12 +19,14 @@
<table class="tbl mt-2">
<tr>
<th>Uge</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/print.svg') }}" alt="Print"></th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
</tr>
@foreach($menuPlans as $menuplan)
<tr>
<td>{{$menuplan->week}}</td>
<td><a href="{{ route("pdf.genPDF", [ "menuPlan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/print.svg') }}" alt="Print"></a></td>
<td><a href="{{ route("menu-plans.edit", [ "menu_plan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
<td><form method="post" action="{{ route("menu-plans.destroy", [ "menu_plan" => $menuplan ]) }}" class="w-100 nostyle">
@csrf

View File

@ -33,9 +33,9 @@
modules: {
'toolbar': [
[ 'bold', 'italic', 'underline', 'strike' ],
[{ 'color': [] }, { 'background': [] }],
[{ 'color': [] }],
[{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link' ],

View File

@ -34,9 +34,9 @@
modules: {
'toolbar': [
[ 'bold', 'italic', 'underline', 'strike' ],
[{ 'color': [] }, { 'background': [] }],
[{ 'color': [] }],
[{ 'script': 'super' }, { 'script': 'sub' }],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
[{ 'header': '1' }, { 'header': '2' }, 'blockquote' ],
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
[ {'direction': 'rtl'}, { 'align': [] }],
[ 'link' ],

View File

@ -41,7 +41,7 @@
@if($event->resource_id !== null)
<div class="header" style="background-size: cover; background-image: url('{{ asset(\App\Resource::query()->where("id", "=", $event->resource_id)->first()->filename) }}');">
<h3 style="text-shadow: 2px 2px 2px #00078A;">{{ $event->name }}</h3>
<p style="text-shadow: 2px 2px 2px #00078A"; class="text-center mt-0">Af: {{ $event->accountable }}</p>
<p style="text-shadow: 2px 2px 2px #00078A"; class="text-center mt-0">{{__('msg.af')}}: {{ $event->accountable }}</p>
<p style="text-shadow: 2px 2px 2px #00078A"; class="text-center mt-0">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}</p>
</div>
@else
@ -51,14 +51,15 @@
<p class="text-center mt-0">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}</p>
</div>
@endif
<div class="container">
<div class="container" style="margin-top: 8px;">
{!! \App\Helpers::closetags(substr($event->description, 0, 300) )!!}
<input type="hidden" name="event_id" value="{{ $event->id }}">
{!! session()->get('error#' . $event->id) !!}
{!! session()->get('signup#' . $event->id) !!}
<div class="row">
<a style="width: 50%; margin: 0; padding: 0; text-align: start; font-weight: 700;" class="sde-blue" href="javascript:;" onclick="document.getElementById('form{{$event->id}}').submit();" >Tilmeld</a>
<a style="width: 50%; margin: 0; padding: 0; text-align: end; font-weight: 700;" class="sde-blue" href="{{route("events.show", ["event" => $event->id ])}}">Læs mere</a>
<div class="row" style="justify-content: space-between; margin-top: 16px;">
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:;" onclick="document.getElementById('form{{$event->id}}').submit();" >{{__('msg.tilmeld')}}</a>
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.show", ["event" => $event->id ])}}">{{__('msg.læsmere')}}</a>
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.accountsignups", ["event" => $event->id ])}}">{{__('msg.sedeltagere')}}</a>
</div>
</div>
</div>

View File

@ -13,7 +13,9 @@
<main>
<h1 style="margin-bottom: 2rem" class="text-center sde-blue mt-0">{{__('msg.aktiviteter')}}</h1>
<div style="padding: 4px; margin-top: .25rem; text-align: justify; ">
<h2 class="text-center sde-blue mt-0">{{ $event->name }}</h2>
<h2 class="text-center sde-blue mt-0 mb-1">{{ $event->name }}</h2>
<p class="text-center mt-0">{{__('msg.af')}}: {{ $event->accountable }}</p>
<p class="text-center mt-0">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}</p>
{!!$event->description!!}
</div>
<button style="margin-top: auto" onclick="window.history.back()" class="btn btn-sde-blue text-white mb-1 mt-1" >{{__('msg.tilbage')}}</button>

View File

@ -4,6 +4,34 @@
@endsection
@section("content")
<style>
div.card {
margin-top: 1rem;
margin-bottom: 30px;
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);
}
div.header {
background-color: #00788a;
color: white;
padding: 8px;
font-size: 10px;
text-align: center;
}
div.container {
padding: 8px;
text-align: justify;
line-height: 1.5;
}
ol {
padding-right: 8px;
}
</style>
<main>
<h1 class="text-center sde-blue mb-0" style="margin-bottom: 2rem">{{__('msg.tilmeldteaktiviteter')}}</h1>
{!! session()->get('eventunsubscribed') !!}
@ -12,10 +40,29 @@
<form method="post" action="{{ route("userevents.destroy", $userevent) }}">
@csrf
@method("delete")
<h3 class="sde-blue bold text-center mb-0">{{$userevent->name}}</h3>
<p class="text-center mt-0">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($userevent->date))->format('d/m/Y \k\l\. H:i') }}</p>
<p class="text-center">{!! $userevent->description !!}</p>
<button type="submit" class="btn text-center btn-sde-blue" onclick="return confirm('Are you sure you want to remove this event?');">{{__('msg.afmeld')}}</button>
<div class="card">
@if($userevent->resource_id !== null)
<div class="header" style="background-size: cover; background-image: url('{{ asset(\App\Resource::query()->where("id", "=", $userevent->resource_id)->first()->filename) }}');">
<h3 style="text-shadow: 2px 2px 2px #00078A;">{{ $userevent->name }}</h3>
<p style="text-shadow: 2px 2px 2px #00078A"; class="text-center mt-0">{{__('msg.af')}}: {{ $userevent->accountable }}</p>
<p style="text-shadow: 2px 2px 2px #00078A"; class="text-center mt-0">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($userevent->date))->format('d/m/Y \k\l\. H:i') }}</p>
</div>
@else
<div class="header">
<h3>{{ $userevent->name }}</h3>
<p class="text-center mt-0">{{__('msg.af')}}: {{ $userevent->accountable }}</p>
<p class="text-center mt-0">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}</p>
</div>
@endif
<div class="container">
{!! \App\Helpers::closetags(substr($userevent->description, 0, 300) )!!}
<div class="row" style="justify-content: space-between;">
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:;" onclick="return confirm('Are you sure you want to remove this event?');" >{{__('msg.afmeld')}}</a>
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.show", ["event" => $userevent->id ])}}">{{__('msg.læsmere')}}</a>
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.accountsignups", ["event" => $userevent->id ])}}">{{__('msg.sedeltagere')}}</a>
</div>
</div>
</div>
</form>
@endforeach
@else

View File

@ -48,7 +48,9 @@
@endif
<div class="container">
{!! \App\Helpers::closetags(substr($guide->guide_articles, 0, 300)) !!}
<a style="width: 33%; margin: 0; padding: 0; text-align: center; font-weight: 700;" class="sde-blue" href="{{route("guides.show", ["guide" => $guide->id ])}}">Læs mere</a>
<div class="row" style="justify-content: center;">
<a style="margin: 0; padding: 0; text-align: center; font-weight: 700;" class="sde-blue" href="{{route("guides.show", ["guide" => $guide->id ])}}">{{__('msg.læsmere')}}</a>
</div>
</div>
</div>
@endforeach

View File

@ -41,8 +41,29 @@
<h3>{{ $new->subname }}</h3>
</div>
@endif
<div class="container">
<div class="container" style="margin-top: 8px;">
@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
@if ($new->type_id == 3) {{-- If it's displaying an event, then show `Tilmeld`, `Læs mere` & `Se deltagere` --}}
<div class="row" style="justify-content: space-between; margin-top: 16px;">
@if (count(\App\UserEvent::query()->where('event_id', '=', $new->arrangement_id)->where('user_id', '=', Auth::user()->id)->get()) > 0)
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:void(0);" onclick="ajaxCallCancel({{ $new->arrangement_id }})" >{{__('msg.afmeld')}}</a>
@else {{-- ^ If you're already participating in the event, then show a ´cancel´ button - v Else show a ´participate´ button --}}
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="javascript:void(0);" onclick="ajaxCall({{ $new->arrangement_id }})" >{{__('msg.tilmeld')}}</a>
@endif
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.show", ["event" => $new->arrangement_id ])}}">{{__('msg.læsmere')}}</a>
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.accountsignups", ["event" => $new->arrangement_id ])}}">{{__('msg.sedeltagere')}}</a>
</div>
@elseif ($new->type_id == 4) {{-- Else if's displaying guides, then show `Læs mere` --}}
<div class="row" style="justify-content: center">
<a style="font-weight: 700;" href="{{route("guides.show", ["guide" => $new->arrangement_id])}}" class="sde-blue">{{__('msg.læsmere')}}</a>
</div>
@endif {{-- Else if it's a menu or news, then don't show a button at bottom --}}
</div>
</div>
@endforeach
@ -58,10 +79,12 @@
var x = document.getElementById("snackbar");
x.innerHTML = data;
x.className = "show";
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
}
function ajaxCall(event_id) {
axios.post("{{ route("userevents.createajax") }}",
{
event_id: event_id
@ -70,10 +93,26 @@
var data = response.data;
snackbar(data);
setTimeout(function(){document.location.reload(false)}, 2000);
}).catch(function (error) {
console.log(error);
});
}
function ajaxCallCancel(event_id) {
axios.post("{{ route("userevents.createajaxcancel") }}",
{
event_id: event_id
}
).then(function (response) {
var data = response.data;
snackbar(data);
setTimeout(function(){document.location.reload(false)}, 2000);
}).catch(function (error) {
console.log(error);
});
}
</script>
@endsection

View File

@ -34,6 +34,7 @@ Route::get("/app/washing-reservations", "WashingReservationController@appindex")
Route::get("/settings", "SettingsController@index")->name("settings.index");
Route::post("/events/signup", "UserEventController@createajax")->name("userevents.createajax");
Route::get("/about", "AboutController@index")->name("about.index");
Route::post("/events/cancelsignup", "UserEventController@createajaxcancel")->name("userevents.createajaxcancel");
//Search/Filter
@ -49,6 +50,9 @@ Route::get("/risrosapi", "FeedbackController@search")->name("feedbacks.search");
Route::get("/languages", "UserController@setLanguages")->name("users.setLanguages");
Route::get("/darkmode", "UserController@setDarkMode")->name("users.setDarkMode");
//Convert to PDF
Route::get("/pdf/{menuPlan}", "MenuPlanController@genPDF")->name("pdf.genPDF")->hasParameter("Id");
Route::resource("contacts", "ContactController");
Route::resource("menu-plans", "MenuPlanController");
@ -65,3 +69,4 @@ Route::resource("roles", "RolesController");
Route::resource("guides", "GuideController");
Route::resource("locations", "LocationController");
Route::resource("news", "NewsController");
Route::resource("newstype", "NewsTypeController");