mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
Merge branch '3.2.1' into 'dev'
3.2.1 See merge request TheGamecraft/c-cms!51
This commit is contained in:
133
app/Http/Controllers/ArticleController.php
Normal file
133
app/Http/Controllers/ArticleController.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ArticleController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
return view('admin.article.index',['activity' => \App\ComplementaryActivity::all()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function editActivity($id)
|
||||
{
|
||||
return view('admin.article.editActivity',['article' => \App\ComplementaryActivity::find($id)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function updateActivity(Request $request, $id)
|
||||
{
|
||||
$a = \App\ComplementaryActivity::find($id);
|
||||
|
||||
$a->public_slogan = $request->public_slogan;
|
||||
$a->public_body = $request->public_body;
|
||||
$a->public_header_picture = $request->public_header_picture;
|
||||
|
||||
$a->save();
|
||||
return redirect('/admin/article')->with('success','Article modifié avec succès');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function pictureActivity($id)
|
||||
{
|
||||
return view('admin.article.pictureActivity',['article' => \App\ComplementaryActivity::find($id)]);
|
||||
}
|
||||
|
||||
public function pictureActivityCreate($id)
|
||||
{
|
||||
return view('admin.article.picture.add',['article' => \App\ComplementaryActivity::find($id)]);
|
||||
}
|
||||
|
||||
public function pictureActivityStore(Request $request, $id)
|
||||
{
|
||||
$p = new \App\Picture();
|
||||
|
||||
$p->url = $request->url;
|
||||
$p->title = $request->title;
|
||||
$p->desc = $request->desc;
|
||||
$p->pictureable_id = $id;
|
||||
$p->pictureable_type = "App\ComplementaryActivity";
|
||||
|
||||
$p->save();
|
||||
|
||||
return redirect('/admin/article/activity/picture/'.$id)->with('success','Photo ajoutéé avec succès');
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,12 @@ class NewsController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('public.allnews',['news' => \App\News::paginate(9)]);
|
||||
return view('public.allnews',['news' => News::where('publish','=','1')->paginate(9)]);
|
||||
}
|
||||
|
||||
public function indexAdmin()
|
||||
{
|
||||
return view('admin.news.index',['news' => \App\News::paginate(9)]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,7 +29,7 @@ class NewsController extends Controller
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
return view('admin.news.create');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +40,24 @@ class NewsController extends Controller
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
$n = new News();
|
||||
|
||||
$n->title = $request->title;
|
||||
$n->body = $request->body;
|
||||
if ($request->publish == "1")
|
||||
{
|
||||
$n->publish = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$n->publish = 0;
|
||||
}
|
||||
$n->user_id = \Auth::user()->id;
|
||||
|
||||
$n->save();
|
||||
|
||||
return redirect('/admin/news')->with('success','Nouvelle ajouté avec succès');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,9 +77,9 @@ class NewsController extends Controller
|
||||
* @param \App\News $news
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(News $news)
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
return view('admin.news.update',['news' => News::find($id)]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,9 +89,25 @@ class NewsController extends Controller
|
||||
* @param \App\News $news
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, News $news)
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
$n = News::find($id);
|
||||
|
||||
$n->title = $request->title;
|
||||
$n->body = $request->body;
|
||||
if ($request->publish == "1")
|
||||
{
|
||||
$n->publish = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$n->publish = 0;
|
||||
}
|
||||
$n->user_id = \Auth::user()->id;
|
||||
|
||||
$n->save();
|
||||
|
||||
return redirect('/admin/news')->with('success','Nouvelle modifié avec succès');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,8 +116,10 @@ class NewsController extends Controller
|
||||
* @param \App\News $news
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(News $news)
|
||||
public function destroy()
|
||||
{
|
||||
//
|
||||
$news = News::find(request('id'));
|
||||
|
||||
$news->delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,8 +92,15 @@ class PictureController extends Controller
|
||||
|
||||
$pic->save();
|
||||
|
||||
if ($pic->pictureable_type == "App\ComplementaryActivity")
|
||||
{
|
||||
return redirect('admin/article/activity/picture/'.$pic->pictureable->id)->with('success','Image sauvegarder avec succès');
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('/admin/picture')->with('success','Image sauvegarder avec succès');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
|
||||
@@ -14,7 +14,7 @@ class PublicController extends Controller
|
||||
public function index()
|
||||
{
|
||||
return view('public.index',[
|
||||
'news' => \App\News::all()->sortByDesc('created_at')->take(3),
|
||||
'news' => \App\News::all()->where('publish','1')->sortByDesc('created_at')->take(3),
|
||||
'activities' => \App\ComplementaryActivity::all()->where('is_promoted','1'),
|
||||
'pictures' => \App\Picture::all()->sortByDesc('created_at')->take(\App\Config::getData('nb_activity_public'))
|
||||
]);
|
||||
|
||||
@@ -18,7 +18,7 @@ class CreateComplementaryActivitiesTable extends Migration
|
||||
$table->string('name');
|
||||
$table->text('public_body');
|
||||
$table->text('public_slogan');
|
||||
$table->string('public_header_picture');
|
||||
$table->text('public_header_picture');
|
||||
$table->text('admin_desc');
|
||||
$table->string('calendar_color')->default('blue');
|
||||
$table->string('calendar_icon')->default('<i class="fa fa-question-circle"></i>');
|
||||
|
||||
55
resources/views/admin/article/edit.blade.php
Normal file
55
resources/views/admin/article/edit.blade.php
Normal file
@@ -0,0 +1,55 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Ajouter une nouvelle <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="/admin/news/edit/{{$news->id}}">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label>Titre</label>
|
||||
<input class="form-control" type="text" name="title" value="{{$news->title}}">
|
||||
<small class="form-text text-muted">Titre de la nouvelle à publier</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" name="publish" value="1" @if($news->publish == 1) checked @endif>
|
||||
La nouvelle doit-elle être immédiatement publié ?
|
||||
<span class="form-check-sign"><span class="check"></span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Contenu</label>
|
||||
<textarea id="body" name="body">{!! $news->body !!}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" type="submit">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
$('#body').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
51
resources/views/admin/article/editActivity.blade.php
Normal file
51
resources/views/admin/article/editActivity.blade.php
Normal file
@@ -0,0 +1,51 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Modification de l'article {{$article->name}} <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="/admin/article/activity/edit/{{$article->id}}">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Slogan</label>
|
||||
<input class="form-control" type="text" name="public_slogan" value="{{$article->public_slogan}}">
|
||||
<small class="form-text text-muted">Slogan de l'activité</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Url de l'image d'en tête</label>
|
||||
<input class="form-control" type="text" name="public_header_picture" value="{{$article->public_header_picture}}">
|
||||
<small class="form-text text-muted">Url de l'image d'en tête</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Contenu</label>
|
||||
<textarea id="body" name="public_body">{!! $article->public_body !!}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" type="submit">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
$('#body').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
47
resources/views/admin/article/index.blade.php
Normal file
47
resources/views/admin/article/index.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Articles <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@foreach($activity as $a)
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title">{{$a->name}}</h4>
|
||||
<p class="category">{{$a->updated_at}}
|
||||
@if($a->is_promoted == 1) <span class="badge badge-success float-right">Promu sur la page d'accueil</span> @endif</p>
|
||||
</div>
|
||||
<div class="card-body news-body-small">
|
||||
{!! $a->public_body !!}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="btn-group w-100">
|
||||
<a href="/admin/article/activity/edit/{{$a->id}}" type="button" class="btn btn-secondary btn-block"><i class="fa fa-cog"></i> Modifier l'article</a>
|
||||
<a href="/admin/article/activity/picture/{{$a->id}}" type="button" class="btn btn-secondary btn-block"><i class="fa fa-picture-o"></i> Gérer les photos</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<a href="/activity/{{$a->id}}" target="_blank" type="button" class="btn btn-outline-secondary btn-block"><i class="fa fa-picture-o"></i> Voir l'article</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
|
||||
@endsection
|
||||
63
resources/views/admin/article/picture/add.blade.php
Normal file
63
resources/views/admin/article/picture/add.blade.php
Normal file
@@ -0,0 +1,63 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4>Ajouter une images</h4>
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<form action="/admin/article/activity/picture/{{$article->id}}/add" method="post">
|
||||
|
||||
@csrf
|
||||
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label>Nom de l'image</label>
|
||||
<input name="title" type="text" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label>URL de l'image</label>
|
||||
<input name="url" type="text" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<label for="desc">Description de l'image</label>
|
||||
<div class="form-group">
|
||||
<textarea name="desc" id="desc" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
$('#desc').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
function saveChange(pPerm) {
|
||||
(function($) {
|
||||
var myswitch = document.getElementById(pPerm);
|
||||
$.post('/api/config/general/save?api_token='+api_token, { value: myswitch.checked,perm: pPerm } , function(data) {
|
||||
swal({
|
||||
title: 'Modification enregistré !',
|
||||
type: 'success',
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
});
|
||||
})(jQuery);
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
84
resources/views/admin/article/pictureActivity.blade.php
Normal file
84
resources/views/admin/article/pictureActivity.blade.php
Normal file
@@ -0,0 +1,84 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4>Images de l'article {{$article->name}}</h4>
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
Toutes ces images seront disponible dans l'article
|
||||
</p>
|
||||
</div>
|
||||
@if(isset($article->pictures))
|
||||
@if($article->pictures->isEmpty())
|
||||
<h5 class="text-center w-100">Aucune photo</h5>
|
||||
@endif
|
||||
@endif
|
||||
@foreach($article->pictures as $picture)
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-img-top">
|
||||
<img class="img-responsive w-100" src="{{$picture->url}}">
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">{{$picture->title}}</h4>
|
||||
<p>{!!$picture->desc!!}</p>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-primary" href="/admin/picture/edit/{{$picture->id}}"><i class="fas fa-edit"></i></a>
|
||||
<button class="btn btn-danger" onclick="Delete({{$picture->id}})"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
<div class="col-12">
|
||||
<a class="btn btn-primary btn-block" href="/admin/article/activity/picture/{{$article->id}}/add">Ajouter une images</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
function Delete(pID) {
|
||||
swal({
|
||||
title: 'Êtes vous certain de vouloir supprimer l\'image?',
|
||||
text: "Vous ne pourrez pas annuler cette action",
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
|
||||
(function($) {
|
||||
$.post('/api/picture/delete/'+pID+'?api_token='+api_token, function(data) {
|
||||
console.log('Delete');
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
swal(
|
||||
'Supprimé!',
|
||||
"L'image a été supprimé",
|
||||
'success'
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="card-body">
|
||||
<div class="btn-group btn-block">
|
||||
<a name="add" id="add" class="btn btn-primary btn-block" href="/admin/item/add" role="button">Ajouter un item</a>
|
||||
<a name="add" id="add" class="btn btn-outline-primary btn-block" href="/admin/booking/add" role="button">Réserver un item</a>
|
||||
<button name="add" id="add" disabled class="btn btn-outline-primary btn-block" href="/admin/booking/add" role="button">Réserver un item</button>
|
||||
</div>
|
||||
<hr>
|
||||
<table id="log-data" class="table table-striped table-bordered">
|
||||
|
||||
55
resources/views/admin/news/create.blade.php
Normal file
55
resources/views/admin/news/create.blade.php
Normal file
@@ -0,0 +1,55 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Ajouter une nouvelle <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="/admin/news/add">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label>Titre</label>
|
||||
<input class="form-control" type="text" name="title">
|
||||
<small class="form-text text-muted">Titre de la nouvelle à publier</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" name="publish" value="1">
|
||||
La nouvelle doit-elle être immédiatement publié ?
|
||||
<span class="form-check-sign"><span class="check"></span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Contenu</label>
|
||||
<textarea id="body" name="body"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" type="submit">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
$('#body').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
112
resources/views/admin/news/index.blade.php
Normal file
112
resources/views/admin/news/index.blade.php
Normal file
@@ -0,0 +1,112 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Nouvelles <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="btn-group btn-block">
|
||||
<a name="add" id="add" class="btn btn-primary btn-block" href="/admin/news/add" role="button">Ajouter un nouvelle</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
@foreach($news as $n)
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title">{{$n->title}}</h4>
|
||||
<p class="category">{{$n->user->fullname()}} - {{$n->created_at}}
|
||||
@if($n->publish == 0) <span class="badge badge-warning float-right">Brouillon</span> @endif</p>
|
||||
</div>
|
||||
<div class="card-body news-body-small">
|
||||
{!! $n->body !!}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="btn-group">
|
||||
<a href="/admin/news/edit/{{$n->id}}" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i> Modifier</a>
|
||||
<a type="button" class="btn btn-danger" onclick="deleteEvent({{$n->id}});"><i class="fa fa-times-circle" style="color:white;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
<div class="breadcrumbs">
|
||||
<div class="col-sm-4">
|
||||
<div class="page-header float-left">
|
||||
<div class="page-title">
|
||||
<h1>Inventaire</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="page-header float-right">
|
||||
<div class="page-title">
|
||||
<ol class="breadcrumb text-right">
|
||||
<li class="active">Inventaire</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script src="https://cdn.datatables.net/rowgroup/1.1.0/js/dataTables.rowGroup.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
$(document).ready(function() {
|
||||
$('#log-data').DataTable({
|
||||
"order": [[ 2, "asc" ]],
|
||||
"lengthMenu": [[25, 50, -1], [25, 50, "All"]],
|
||||
"rowGroup": {
|
||||
dataSrc: 2
|
||||
}
|
||||
});
|
||||
} );
|
||||
})(jQuery);
|
||||
|
||||
function deleteEvent(pid){
|
||||
swal({
|
||||
title: 'Êtes vous certain ?',
|
||||
text: "Vous ne pourrez annuler cette action",
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Oui',
|
||||
cancelButtonText: 'Non'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
|
||||
(function($) {
|
||||
$.post('/api/news/delete?api_token='+api_token, { id: pid } , function(data) {
|
||||
console.log('Delete');
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
swal(
|
||||
'Supprimé!',
|
||||
"La nouvelle a été supprimé",
|
||||
'success'
|
||||
).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
55
resources/views/admin/news/update.blade.php
Normal file
55
resources/views/admin/news/update.blade.php
Normal file
@@ -0,0 +1,55 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong class="card-title">Ajouter une nouvelle <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
|
||||
</a></strong>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="/admin/news/edit/{{$news->id}}">
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label>Titre</label>
|
||||
<input class="form-control" type="text" name="title" value="{{$news->title}}">
|
||||
<small class="form-text text-muted">Titre de la nouvelle à publier</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" name="publish" value="1" @if($news->publish == 1) checked @endif>
|
||||
La nouvelle doit-elle être immédiatement publié ?
|
||||
<span class="form-check-sign"><span class="check"></span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Contenu</label>
|
||||
<textarea id="body" name="body">{!! $news->body !!}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" type="submit">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
$('#body').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -22,11 +22,24 @@
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">{{$picture->title}}</h4>
|
||||
<p>{!!$picture->desc!!}</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row w-100 m-0 p-0">
|
||||
<div class="col-xl-7">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-primary" href="/admin/picture/edit/{{$picture->id}}"><i class="fas fa-edit"></i></a>
|
||||
<button class="btn btn-danger" onclick="Delete({{$picture->id}})"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
@if($picture->pictureable)
|
||||
<div class="col-xl-5 m-auto text-right">
|
||||
<a href="/activity/{{$picture->pictureable->id}}" target="_blank">
|
||||
<span class="badge badge-primary">{{$picture->pictureable->name}}</span>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@@ -2,6 +2,102 @@
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3 class="card-title">3.2.1</h3>
|
||||
<p class="category">2019-09-03</p>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<span class="badge badge-pill badge-success">STABLE</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<i class="fas fa-exclamation-triangle text-white fa-2x mr-3"></i>Les réservations sont <strong>DÉSACTIVÉ</strong> le temps de moderniser la base de donnée
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p>
|
||||
Nouveauté
|
||||
<ul class="list-group list-group-flush ml-3">
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-coffee"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Modernisation de l'inventaire
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-coffee"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Modernisation de la structure de la base de donnée de l'inventaire
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-plus"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Ajout de catégorie dynamique dans l'inventaire
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-plus"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Ajout d'un système de nouvelles
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-plus"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Ajout d'un système d'article pour chaque activité complémentaire
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p>
|
||||
Bug
|
||||
<ul class="list-group list-group-flush ml-3">
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="text-success" style="font-size: 1.3rem;width: 1.5rem">
|
||||
<i class="fas fa-bug"></i>
|
||||
</div>
|
||||
<div class="col m-auto text-left">
|
||||
Correction de <a href="https://op.exvps.ca/versions/8">4 bugs</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
@@ -148,7 +244,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
|
||||
@@ -69,6 +69,42 @@
|
||||
<p> Horaire</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" data-toggle="collapse" href="#news">
|
||||
<i class="material-icons">new_releases</i>
|
||||
<p> Nouvelles
|
||||
<b class="caret"></b>
|
||||
</p>
|
||||
</a>
|
||||
<div class="collapse" id="news">
|
||||
<ul class="nav">
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="/admin/news">
|
||||
<span class="sidebar-mini"> <i class="fas fa-eye"></i> </span>
|
||||
<span class="sidebar-normal"> Voir les nouvelles </span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="/admin/news/add">
|
||||
<span class="sidebar-mini"> <i class="fas fa-plus"></i> </span>
|
||||
<span class="sidebar-normal"> Ajouter une nouvelle </span>
|
||||
</a>
|
||||
</li>
|
||||
<!--<li class="nav-item ">
|
||||
<a class="nav-link" href="/admin/inventory/booking">
|
||||
<span class="sidebar-mini"> <i class="fas fa-bookmark"></i> </span>
|
||||
<span class="sidebar-normal"> Réservation</span>
|
||||
</a>
|
||||
</li>-->
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="/admin/article">
|
||||
<i class="material-icons">description</i>
|
||||
<p> Articles</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" data-toggle="collapse" href="#inventory">
|
||||
<i class="material-icons">shopping_basket</i>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
@foreach ($activities as $activity)
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header card-header-image">
|
||||
<img class="img-fluid" src="/assets/public/images/pic01.jpg" alt="" />
|
||||
<div class="card-header card-header-image" style="height: 18rem;overflow: hidden">
|
||||
<img class="img-fluid" src="{{$activity->public_header_picture}}" alt=""/>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">{{$activity->name}}</h4>
|
||||
<p class="activity-body-small">{{$activity->public_body}}</p>
|
||||
<p class="activity-body-small">{!! $activity->public_body !!}</p>
|
||||
<a name="activity" id="activity" class="btn btn-primary" href="/activity/{{$activity->id}}" role="button">Plus d'information</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
@foreach ($news as $new)
|
||||
<div class="col-md-4">
|
||||
<h3>{{ $new->title }}</h3>
|
||||
<p class="news-body-small"> {{ $new->body }}</p>
|
||||
<div class="news-body-small"> {!! $new->body !!}</div>
|
||||
<span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{$new->created_at}}</span>
|
||||
<a name="news" id="news" class="btn btn-block btn-secondary mt-2" href="/news/{{$new->id}}" role="button">Voir plus!</a>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.public.main')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header header-filter clear-filter purple-filter" data-parallax="true" style="background-image: url({{'"'.$activity->public_header_picture.'"'}});">
|
||||
<div class="page-header header-filter clear-filter" data-parallax="true" style="background-image: url({{'"'.$activity->public_header_picture.'"'}});">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 ml-auto mr-auto">
|
||||
@@ -16,10 +16,10 @@
|
||||
<div class="main main-raised">
|
||||
<div class="container">
|
||||
<div class="section">
|
||||
{{$activity->public_body}}
|
||||
{!! $activity->public_body !!}
|
||||
</div>
|
||||
@if(!$activity->pictures->isEmpty())
|
||||
<div class="section">
|
||||
<div class="pb-5">
|
||||
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
|
||||
@@ -27,19 +27,19 @@
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
@foreach($activity->pictures as $pic)
|
||||
<div class="carousel-item active">
|
||||
<img class="d-block w-100" src="{{$pic->url}}" alt="{{$pic->title}}">
|
||||
@foreach($activity->pictures as $picture)
|
||||
<div class="carousel-item @if($loop->first) active @endif">
|
||||
<img class="d-block w-100" src="{{$picture->url}}" alt="First slide">
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Suivant</span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Précédant</span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
@foreach ($news as $new)
|
||||
<div class="col-md-4">
|
||||
<h3>{{ $new->title }}</h3>
|
||||
<p class="news-body-small">
|
||||
{{ $new->body }}
|
||||
</p>
|
||||
<div class="news-body-small">
|
||||
{!! $new->body !!}
|
||||
</div>
|
||||
<span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{ $new->created_at }}</span>
|
||||
<a name="news" id="news" class="btn btn-block btn-secondary mt-2" href="/news/{{ $new->id }}" role="button">Voir plus!</a>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
@endforeach
|
||||
</div>
|
||||
<p>
|
||||
{{ $new->body }}
|
||||
{!! $new->body !!}
|
||||
</p>
|
||||
<span class="news-small">{{ \App\User::find($new->user_id)->fullname()}}, {{ $new->created_at }}</span>
|
||||
</div>
|
||||
|
||||
@@ -36,6 +36,9 @@ Route::middleware('auth:api')->group(function () {
|
||||
/** Message Route */
|
||||
Route::post('/message/delete', 'MessageController@destroy');
|
||||
|
||||
/** News Route */
|
||||
Route::post('/news/delete','NewsController@destroy');
|
||||
|
||||
/** User Route */
|
||||
Route::post('/user/delete', 'UserController@destroy');
|
||||
Route::get('/user/list', 'UserController@apiList');
|
||||
|
||||
@@ -49,7 +49,6 @@ Route::middleware(['auth','admin'])->group(function () {
|
||||
Route::post('/admin/schedule/event/add','EventController@Store');
|
||||
Route::post('/admin/schedule/event/edit/{id}','EventController@update');
|
||||
|
||||
|
||||
/** Statistique */
|
||||
Route::get('/admin/stats/log' , 'LogController@index');
|
||||
|
||||
@@ -105,9 +104,24 @@ Route::middleware(['auth','admin'])->group(function () {
|
||||
Route::get('/admin/inventory/management/category/edit/{id}','ItemCategoryController@edit');
|
||||
Route::post('/admin/inventory/management/category/edit/{id}','ItemCategoryController@update');
|
||||
|
||||
/** News */
|
||||
Route::get('/admin/news','NewsController@indexAdmin');
|
||||
Route::get('/admin/news/add','NewsController@create');
|
||||
Route::post('/admin/news/add','NewsController@store');
|
||||
Route::get('/admin/news/edit/{id}','NewsController@edit');
|
||||
Route::post('/admin/news/edit/{id}','NewsController@update');
|
||||
|
||||
/** Articles */
|
||||
Route::get('/admin/article','ArticleController@index');
|
||||
Route::get('/admin/article/activity/edit/{id}','ArticleController@editActivity');
|
||||
Route::post('/admin/article/activity/edit/{id}','ArticleController@updateActivity');
|
||||
Route::get('/admin/article/activity/picture/{id}','ArticleController@pictureActivity');
|
||||
Route::get('/admin/article/activity/picture/{id}/add','ArticleController@pictureActivityCreate');
|
||||
Route::post('/admin/article/activity/picture/{id}/add','ArticleController@pictureActivityStore');
|
||||
|
||||
/** Booking */
|
||||
Route::get('/admin/booking','BookingController@index');
|
||||
Route::get('/admin/booking/{id}','BookingController@show');
|
||||
Route::get('/admin/booking/{type}/{id}',function() {
|
||||
return 'A faire';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user