This commit is contained in:
afornerot 2024-10-30 22:06:14 +01:00
parent fefc4036fa
commit 86c4296061
16 changed files with 392 additions and 166 deletions

View File

@ -158,20 +158,24 @@ app_group_info:
defaults: { _controller: App\Controller\GroupController:info }
#== Category ======================================================================================================
app_category:
path: /admin/category
app_admin_category:
path: /admin/category/{by}/{userid}
defaults: { _controller: App\Controller\CategoryController:list }
app_user_category:
path: /user/category
defaults: { _controller: App\Controller\CategoryController:listuser }
app_category_submit:
path: /admin/category/submit
path: /admin/category/submit/{by}/{userid}
defaults: { _controller: App\Controller\CategoryController:submit }
app_category_update:
path: /admin/category/update/{id}
path: /admin/category/update/{id}/{by}
defaults: { _controller: App\Controller\CategoryController:update }
app_category_delete:
path: /admin/category/delete/{id}
path: /admin/category/delete/{id}/{by}
defaults: { _controller: App\Controller\CategoryController:delete }
#== Illustration ==================================================================================================

View File

@ -399,7 +399,7 @@ th.dt-center, td.dt-center { text-align: center; }
}
.foliomenu .logo { float:left; height:40px; margin-top:7px; border-radius: 100%; }
.foliomenu .avatar { height: 20px; margin: 3px 3px 0px 0px; width: 20px; }
.foliomenu .avatar { height: 20px; margin: 0px 3px 0px 0px; width: 20px; }
.foliomenu div { padding: 10px; line-height:35px; float:left;}
.foliomenu a {
color: var(--colorftbodydark);
@ -434,7 +434,7 @@ th.dt-center, td.dt-center { text-align: center; }
.herofloatmenu {
padding: 5px;
background: #cdcdcd;
background: var(--colorbgbodydarkdarker);
border-radius: 0px 0px 6px 6px
}
@ -458,7 +458,7 @@ th.dt-center, td.dt-center { text-align: center; }
.foliomenu .float-right img {
height:35px;
width:35px;
margin-top:0px;
margin-top:-10px;
}
.foliomenu .float-right .fa, .foliomenu .float-right .fas {
font-size:30px!important;

View File

@ -13,23 +13,47 @@ use App\Form\CategoryType as Form;
class CategoryController extends AbstractController
{
private $data = "category";
private $route = "app_category";
private $route = "app_admin_category";
private $render = "Category/";
private $entity = "App:Category";
public function list(Request $request)
public function list($by,$userid)
{
$em = $this->getDoctrine()->getManager();
$datas = $em->getRepository($this->entity)->findAll();
if($by=="admin") {
$datas = $em->getRepository($this->entity)->findAll();
return $this->render($this->render.'list.html.twig',[
$this->data."s" => $datas,
"useheader" => true,
"usesidebar" => true,
]);
return $this->render($this->render.'list.html.twig',[
$this->data."s" => $datas,
"useheader" => true,
"usesidebar" => true,
]);
}
else {
$datas = $em->getRepository($this->entity)->findBy(["user"=>$em->getRepository("App:User")->find($userid)]);
return $this->render($this->render.'listrender.html.twig',[
$this->data."s" => $datas,
"by" => $by,
"userid" => $userid,
]);
}
}
public function submit(Request $request)
public function listuser()
{
$em = $this->getDoctrine()->getManager();
$datas = $em->getRepository($this->entity)->findByUser($this->getUser());
return $this->render($this->render.'listrender.html.twig',[
$this->data."s" => $datas,
"by" => "profil",
"userid" => $this->getUser()->getId(),
]);
}
public function submit($by, $userid, Request $request)
{
// Initialisation de l'enregistrement
$em = $this->getDoctrine()->getManager();
@ -43,9 +67,17 @@ class CategoryController extends AbstractController
$data->setAppthumbfilteropacity(100);
$data->setAppthumbfiltersepia(0);
if(!$this->getUser()->hasRole("ROLE_ADMIN")&&($by=="admin"||$by=="update")) {
return $this->redirectToRoute("app_home");
}
// Création du formulaire
$form = $this->createForm(Form::class,$data,array("mode"=>"submit"));
if($by=="admin"||$by=="update") {
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","by"=>$by,"user"=>$em->getRepository("App:User")->find($userid)));
} else {
$userid=$this->getUser()->getId();
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","by"=>$by,"user"=>$this->getUser()));
}
// Récupération des data du formulaire
$form->handleRequest($request);
@ -60,7 +92,13 @@ class CategoryController extends AbstractController
$em->flush();
// Retour à la liste
return $this->redirectToRoute($this->route);
if($by=="admin")
return $this->redirectToRoute($this->route,["by"=>$by,"userid"=>-1]);
elseif($by=="update")
return $this->redirectToRoute("app_user_update",["id"=>$data->getUser()->getId()]);
elseif($by=="profil")
return $this->redirectToRoute("app_user_profil");
}
// Affichage du formulaire
@ -69,18 +107,30 @@ class CategoryController extends AbstractController
'usesidebar' => true,
$this->data => $data,
'mode' => 'submit',
'form' => $form->createView()
'form' => $form->createView(),
'by' => $by,
'userid' => $userid,
]);
}
public function update($id,Request $request)
public function update($id,$by,Request $request)
{
// Initialisation de l'enregistrement
$em = $this->getDoctrine()->getManager();
$data=$em->getRepository($this->entity)->find($id);
if(!$data) return $this->redirectToRoute("app_home");
// Permission
if(!$this->getUser()->hasRole("ROLE_ADMIN")&&($by=="admin"||$by=="update")) {
return $this->redirectToRoute("app_home");
}
if($by!="admin"&&$by!="update") {
if($this->getUser()!=$data->getUser()&&!$this->getUser()->hasRole("ROLE_ADMIN"))
return $this->redirectToRoute("app_home");
}
// Création du formulaire
$form = $this->createForm(Form::class,$data,array("mode"=>"update"));
$form = $this->createForm(Form::class,$data,array("mode"=>"update","by"=>$by,"user"=>$this->getUser()));
// Récupération des data du formulaire
$form->handleRequest($request);
@ -95,7 +145,13 @@ class CategoryController extends AbstractController
$em->flush();
// Retour à la liste
return $this->redirectToRoute($this->route);
if($by=="admin")
return $this->redirectToRoute($this->route,["by"=>$by,"userid"=>-1]);
elseif($by=="update")
return $this->redirectToRoute("app_user_update",["id"=>$data->getUser()->getId()]);
elseif($by=="profil")
return $this->redirectToRoute("app_user_profil");
}
// Affichage du formulaire
@ -104,15 +160,27 @@ class CategoryController extends AbstractController
'usesidebar' => true,
$this->data => $data,
'mode' => 'update',
'form' => $form->createView()
'form' => $form->createView(),
'by' => $by,
'userid' => $data->getUser()->getId(),
]);
}
public function delete($id,Request $request)
public function delete($id,$by,Request $request)
{
// Initialisation de l'enregistrement
$em = $this->getDoctrine()->getManager();
$data=$em->getRepository($this->entity)->find($id);
if(!$data) return $this->redirectToRoute("app_home");
// Permission
if(!$this->getUser()->hasRole("ROLE_ADMIN")&&($by=="admin"||$by=="update")) {
return $this->redirectToRoute("app_home");
}
if($by!="admin"&&$by!="update") {
if($this->getUser()!=$data->getCategory()->getUser()&&!$this->getUser()->hasRole("ROLE_ADMIN"))
return $this->redirectToRoute("app_home");
}
// Controle avant suppression
$error=false;
@ -125,7 +193,12 @@ class CategoryController extends AbstractController
$em->flush();
// Retour à la liste
return $this->redirectToRoute($this->route);
if($by=="admin")
return $this->redirectToRoute($this->route,["by"=>$by,"userid"=>-1]);
elseif($by=="update")
return $this->redirectToRoute("app_user_update",["id"=>$data->getUser()->getId()]);
elseif($by=="profil")
return $this->redirectToRoute("app_user_profil");
}
}

View File

@ -57,7 +57,12 @@ class IllustrationController extends AbstractController
// Initialisation de l'enregistrement
$em = $this->getDoctrine()->getManager();
$data = new Entity();
// Permission
if(!$this->getUser()->hasRole("ROLE_ADMIN")&&($by=="admin"||$by=="update")) {
return $this->redirectToRoute("app_home");
}
// Création du formulaire
if($by=="admin"||$by=="update") {
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","by"=>$by,"user"=>$em->getRepository("App:User")->find($userid)));
@ -107,7 +112,12 @@ class IllustrationController extends AbstractController
// Initialisation de l'enregistrement
$em = $this->getDoctrine()->getManager();
$data=$em->getRepository($this->entity)->find($id);
if(!$data) return $this->redirectToRoute("app_home");
// Permission
if(!$this->getUser()->hasRole("ROLE_ADMIN")&&($by=="admin"||$by=="update")) {
return $this->redirectToRoute("app_home");
}
if($by!="admin"&&$by!="update") {
if($this->getUser()!=$data->getCategory()->getUser()&&!$this->getUser()->hasRole("ROLE_ADMIN"))
return $this->redirectToRoute("app_home");
@ -128,7 +138,6 @@ class IllustrationController extends AbstractController
$em->persist($data);
$em->flush();
// Retour à l'illustration
// Retour à la liste
if($by=="admin")
return $this->redirectToRoute($this->route,["by"=>$by,"userid"=>-1]);
@ -157,13 +166,17 @@ class IllustrationController extends AbstractController
// Initialisation de l'enregistrement
$em = $this->getDoctrine()->getManager();
$data=$em->getRepository($this->entity)->find($id);
if(!$data) return $this->redirectToRoute("app_home");
// Permission
if(!$this->getUser()->hasRole("ROLE_ADMIN")&&($by=="admin"||$by=="update")) {
return $this->redirectToRoute("app_home");
}
if($by!="admin"&&$by!="update") {
if($this->getUser()!=$data->getCategory()->getUser()&&!$this->getUser()->hasRole("ROLE_ADMIN"))
return $this->redirectToRoute("app_home");
}
// Controle avant suppression
$error=false;
if($id<0) $error=true;
@ -196,8 +209,8 @@ class IllustrationController extends AbstractController
$em = $this->getDoctrine()->getManager();
$data=$em->getRepository($this->entity)->find($id);
$datanext=$this->getDataAllNext($idcat,$id);
$dataprev=$this->getDataAllPrev($idcat,$id);
$datanext=$this->getDataAllNext($idcat,$data->getSubmittime(),$by);
$dataprev=$this->getDataAllPrev($idcat,$data->getSubmittime(),$by);
$pathinfo=pathinfo($data->getIllustration());
@ -214,61 +227,55 @@ class IllustrationController extends AbstractController
}
protected function getDataAllNext($idcat,$id)
protected function getDataAllNext($idcat,$submittime,$by)
{
$em = $this->getDoctrine()->getManager();
$data = $em->createQueryBuilder()
->select('e')
->from($this->entity, 'e')
->where('e.id>:id')
->andWhere('e.category=:idcat')
->getQuery()
->setParameter("id", $id)
->setParameter("idcat", $idcat)
->setMaxResults(1)
->getResult();
$qb = $em->createQueryBuilder()
->select('e')
->from($this->entity, 'e')
->where('e.submittime>:submittime')
->setParameter("submittime", $submittime);
if($by!="home") {
$qb=$qb->andWhere('e.category=:idcat')->setParameter("idcat", $idcat);
}
$data = $qb->orderBy('e.submittime', 'ASC')->getQuery()->setMaxResults(1)->getResult();
// Si pas de suivant on recherche le premier
if(!$data) {
$data = $em->createQueryBuilder()
->select('e')
->from($this->entity, 'e')
->Where('e.category=:idcat')
->getQuery()
->setParameter("idcat", $idcat)
->setMaxResults(1)
->getResult();
$qb = $em->createQueryBuilder()
->select('e')
->from($this->entity, 'e');
if($by!="home") {
$qb=$qb->andWhere('e.category=:idcat')->setParameter("idcat", $idcat);
}
$data = $qb->orderBy('e.submittime', 'ASC')->getQuery()->setMaxResults(1)->getResult();
}
return $data;
}
protected function getDataAllPrev($idcat,$id)
protected function getDataAllPrev($idcat,$submittime,$by)
{
$em = $this->getDoctrine()->getManager();
$data = $em->createQueryBuilder()
->select('e')
->from($this->entity, 'e')
->where('e.id<:id')
->andWhere('e.category=:idcat')
->orderBy('e.id','DESC')
->getQuery()
->setParameter("id", $id)
->setParameter("idcat", $idcat)
->setMaxResults(1)
->getResult();
$qb = $em->createQueryBuilder()
->select('e')
->from($this->entity, 'e')
->where('e.submittime<:submittime')
->setParameter("submittime", $submittime);
if($by!="home") {
$qb=$qb->andWhere('e.category=:idcat')->setParameter("idcat", $idcat);
}
$data = $qb->orderBy('e.submittime', 'DESC')->getQuery()->setMaxResults(1)->getResult();
// Si pas de précedent on recherche le dernier
if(!$data) {
$data = $em->createQueryBuilder()
->select('e')
->from($this->entity, 'e')
->Where('e.category=:idcat')
->orderBy('e.id','DESC')
->getQuery()
->setParameter("idcat", $idcat)
->setMaxResults(1)
->getResult();
$qb = $em->createQueryBuilder()
->select('e')
->from($this->entity, 'e');
if($by!="home") {
$qb=$qb->Where('e.category=:idcat')->setParameter("idcat", $idcat);
}
$data = $qb->orderBy('e.submittime', 'DESC')->getQuery()->setMaxResults(1)->getResult();
}
return $data;

View File

@ -9,6 +9,10 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
class CategoryType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
@ -36,6 +40,28 @@ class CategoryType extends AbstractType
]
);
if($options["by"]=="admin") {
$builder->add('user',
EntityType::class, [
"class" => "App:User",
"label" => "Utilisateur",
"choice_label"=> "username",
]
);
}
else {
$builder->add('user',
EntityType::class, [
"class" => "App:User",
"label" => "Utilisateur",
"choice_label"=> "username",
'query_builder' => function (EntityRepository $er) use ($options): QueryBuilder {
return $er->createQueryBuilder('u')->where('u.id=:user')->setParameter('user',$options['user']->getId());
},
]
);
}
$builder->add('usecategoryconfig',
ChoiceType::class, [
"label" =>"Utiliser une configuration de style spécifique",
@ -91,6 +117,8 @@ class CategoryType extends AbstractType
$resolver->setDefaults(array(
'data_class' => 'App\Entity\Category',
'mode' => 'string',
'by' => 'string',
'user' => 'App\Entity\User'
));
}
}

View File

@ -7,9 +7,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;

View File

@ -12,10 +12,16 @@
{{ form_widget(form.submit) }}
<a class="btn btn-secondary" href={{ path('app_category') }}>Annuler</a>
{% if by=="admin" %}
<a class="btn btn-secondary" href={{ path('app_admin_category',{'by':by,'userid':-1}) }}>Annuler</a>
{% elseif by=="update" %}
<a class="btn btn-secondary" href={{ path('app_user_update',{id:userid}) }}>Annuler</a>
{% elseif by=="profil" %}
<a class="btn btn-secondary" href={{ path('app_user_profil') }}>Annuler</a>
{% endif %}
{% if mode=="update" and category.id >= 0 %}
<a href="{{ path('app_category_delete',{'id':category.id}) }}"
<a href="{{ path('app_category_delete',{'id':category.id,'by':by}) }}"
class="btn btn-danger float-right"
data-method="delete"
data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?">
@ -49,6 +55,7 @@
</div>
<div class="card-body">
{{ form_row(form.user) }}
{{ form_row(form.order) }}
{{ form_row(form.name) }}

View File

@ -5,7 +5,7 @@
CATEGORIES
</h1>
<p><a class="btn btn-success" href={{ path('app_category_submit') }}>Ajouter</a></p>
<p><a class="btn btn-success" href={{ path('app_category_submit',{by:"admin",userid:-1}) }}>Ajouter</a></p>
<div class="card">
<div class="card-header">
@ -18,6 +18,7 @@ CATEGORIES
<thead>
<tr>
<th width="70px" class="no-sort">Action</th>
<th width="70px">Utilisateur</th>
<th width="70px">Ordre</th>
<th>Nom</th>
</tr>
@ -26,11 +27,12 @@ CATEGORIES
{% for category in categorys %}
<tr>
<td>
<a href="{{path("app_category_update",{id:category.id})}}"><i class="fa fa-file"></i></a>
<a href="{{path("app_category_update",{id:category.id,by:'admin'})}}"><i class="fa fa-file"></i></a>
{% if category.id >=0 %}
<a href="{{path("app_category_delete",{id:category.id})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
<a href="{{path("app_category_delete",{id:category.id,by:'admin'})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
{% endif %}
</td>
<td>{{category.user.username}}</td>
<td>{{category.order}}</td>
<td>{{category.name}}</td>
</tr>

View File

@ -0,0 +1,38 @@
<p><a class="btn btn-success" href={{ path('app_category_submit',{by:by,userid:userid}) }}>Ajouter</a></p>
<div class="dataTable_wrapper" style="zoom:80%" >
<table class="table table-striped table-bordered table-hover" id="categorys" style="width:100%">
<thead>
<tr>
<th width="70px" class="no-sort">Action</th>
<th width="70px">Ordre</th>
<th>Nom</th>
</tr>
</thead>
<tbody>
{% for category in categorys %}
<tr>
<td>
<a href="{{path("app_category_update",{id:category.id,by:by})}}"><i class="fa fa-file"></i></a>
{% if category.id >=0 %}
<a href="{{path("app_category_delete",{id:category.id,by:by})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
{% endif %}
</td>
<td>{{category.order}}</td>
<td>{{category.name}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script>
$(document).ready(function() {
$('#categorys').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 10,
order: [[ 1, "asc" ]]
});
});
</script>

View File

@ -60,13 +60,15 @@
<a href={{ path("app_admin") }} class="btn btn-link" title="Configuration">
<i class="fa fa-cog fa-fw"></i>
</a>
<a href={{ path("app_illustration_submit",{"by":"user","userid":app.user.id}) }} class="btn btn-link" title="Créer une Illustration">
<i class="fa fa-paint-brush fa-fw"></i>
</a>
{% endif %}
<a href={{ path("app_logout") }} class="btn btn-link" title="Déconnexion">
<i class="fa fa-sign-out-alt fa-fw"></i>
</a>
<a href="" data-toggle="modal" data-target="#addmodal">
<i class="fa fa-plus fa-fw"></i>
</a>
<a href={{ path("app_logout") }} class="btn btn-link" title="Déconnexion">
<i class="fa fa-sign-out-alt fa-fw"></i>
</a>
{% else %}
<a href={{ path("app_login") }} class="btn btn-link" title="Connexion">
<i class="fa fa-sign-in-alt fa-fw"></i>
@ -112,13 +114,16 @@
<a href={{ path("app_admin") }} class="btn btn-link" title="Configuration">
<i class="fa fa-cog fa-fw"></i>
</a>
<a href={{ path("app_illustration_submit",{"by":"user","userid":app.user.id}) }} class="btn btn-link" title="Créer une Illustration">
<i class="fa fa-paint-brush fa-fw"></i>
</a>
{% endif %}
<a href={{ path("app_logout") }} class="btn btn-link" title="Déconnexion">
<i class="fa fa-sign-out-alt fa-fw"></i>
</a>
<a href="" data-toggle="modal" class="btn btn-link" data-target="#addmodal">
<i class="fa fa-plus fa-fw"></i>
</a>
<a href={{ path("app_logout") }} class="btn btn-link" title="Déconnexion">
<i class="fa fa-sign-out-alt fa-fw"></i>
</a>
{% else %}
<a href={{ path("app_login") }} class="btn btn-link" title="Connexion">
<i class="fa fa-sign-in-alt fa-fw"></i>
@ -352,7 +357,26 @@
<!-- BOTTOM ------------------------------------------------------------------------------------------------------------------------------------------------------!-->
<div id="bottom" class="grid-item grid-item-full" style="height:300px">
</div>
<!-- ADDMODAL ------------------------------------------------------------------------------------------------------------------------------------------------------!-->
<div id="addmodal" class="modal" tabindex="-1" role="dialog" style="z-index:100000">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Ajouter</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<a href={{ path("app_illustration_submit",{"by":"user","userid":app.user.id}) }} class="btn btn-link" title="Créer une Illustration">
Ajouter une illustration
</a>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -77,13 +77,15 @@
<a href={{ path("app_admin") }} class="btn btn-link" title="Configuration">
<i class="fa fa-cog fa-fw"></i>
</a>
<a href={{ path("app_illustration_submit",{"by":"user","userid":app.user.id}) }} class="btn btn-link" title="Créer une Illustration">
<i class="fa fa-paint-brush fa-fw"></i>
</a>
{% endif %}
<a href={{ path("app_logout") }} class="btn btn-link" title="Déconnexion">
<i class="fa fa-sign-out-alt fa-fw"></i>
</a>
<a href="" data-toggle="modal" class="btn btn-link" title="Ajouter" data-target="#addmodal">
<i class="fa fa-plus fa-fw"></i>
</a>
<a href={{ path("app_logout") }} class="btn btn-link" title="Déconnexion">
<i class="fa fa-sign-out-alt fa-fw"></i>
</a>
{% else %}
<a href={{ path("app_login") }} class="btn btn-link" title="Connexion">
<i class="fa fa-sign-in-alt fa-fw"></i>
@ -129,13 +131,15 @@
<a href={{ path("app_admin") }} class="btn btn-link" title="Configuration">
<i class="fa fa-cog fa-fw"></i>
</a>
<a href={{ path("app_illustration_submit",{"by":"user","userid":app.user.id}) }} class="btn btn-link" title="Créer une Illustration">
<i class="fa fa-paint-brush fa-fw"></i>
</a>
{% endif %}
<a href={{ path("app_logout") }} class="btn btn-link" title="Déconnexion">
<i class="fa fa-sign-out-alt fa-fw"></i>
</a>
<a href="" data-toggle="modal" class="btn btn-link" title="Ajouter" data-target="#addmodal">
<i class="fa fa-plus fa-fw"></i>
</a>
<a href={{ path("app_logout") }} class="btn btn-link" title="Déconnexion">
<i class="fa fa-sign-out-alt fa-fw"></i>
</a>
{% else %}
<a href={{ path("app_login") }} class="btn btn-link" title="Connexion">
<i class="fa fa-sign-in-alt fa-fw"></i>
@ -350,7 +354,25 @@
</div>
</div>
<!-- ADDMODAL ------------------------------------------------------------------------------------------------------------------------------------------------------!-->
<div id="addmodal" class="modal" tabindex="-1" role="dialog" style="z-index:100000">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Ajouter</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<a href={{ path("app_illustration_submit",{"by":"user","userid":app.user.id}) }} class="btn btn-link" title="Créer une Illustration">
Ajouter une illustration
</a>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -1,7 +1,7 @@
<p><a class="btn btn-success" href={{ path('app_illustration_submit',{by:by,userid:userid}) }}>Ajouter</a></p>
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="illustrations" style="width:100%; zoom:80%;">
<div class="dataTable_wrapper" style="zoom:80%">
<table class="table table-striped table-bordered table-hover" id="illustrations" style="width:100%;">
<thead>
<tr>
<th width="70px" class="no-sort">Action</th>

View File

@ -62,10 +62,15 @@
<div class="container mb-5">
<div class="text-center menuview" style="font-size:25px">
<a id="up" href="{{ path("app_home")}}#illustration{{illustration.id}}"><i class="fa fa-home" aria-hidden="true"></i></a>
{% if by=="home" %}
<a id="up" href="{{ path("app_home")}}#illustration{{illustration.id}}"><i class="fa fa-home" aria-hidden="true"></i></a>
{% else %}
<a id="up" href="{{ path("app_home_user",{userpseudo:illustration.category.user.slug})}}#illustration{{illustration.id}}"><i class="fa fa-home" aria-hidden="true"></i></a>
{% endif %}
<a download="{{ illustration.name }}.{{ pathinfo.extension }}" href="/{{ appAlias }}/uploads/illustration/{{illustration.illustration}}"><i class="fa fa-download" aria-hidden="true"></i></a>
{% if is_granted("ROLE_ADMIN") %}
{% if is_granted("ROLE_ADMIN") or (is_granted("ROLE_USER") and illustration.category.user.id==app.user.id) %}
<a id="update" href="{{ path("app_illustration_update",{"by":"illustration","id":illustration.id})}}"><i class="fa fa-file" aria-hidden="true"></i></a>
<a id="delete" href="{{ path("app_illustration_delete",{"by":"illustration","id":illustration.id})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet entregistrement ?"><i class="fa fa-trash" aria-hidden="true"></i></a>
<a id="recadre" style="cursor:pointer" onClick="ModalLoad('extraLargeModal','Illustration','{{ path('app_illustration_crop',{"type":"illustration","reportinput":"none"}) }}?file={{illustration.illustration}}');"><i class="fa fa-arrows-alt" aria-hidden="true"></i></a>

View File

@ -23,14 +23,14 @@
</li>
<li>
<a href="{{path("app_admin_illustration",{"by":"admin","userid":-1})}}">
<i class="fas fa-image fa-fw"></i> Illustrations
<a href="{{path("app_admin_category",{"by":"admin","userid":-1})}}">
<i class="fa fa-folder fa-fw"></i> Catégories Illustrations
</a>
</li>
<li>
<a href="{{path("app_category")}}">
<i class="fa fa-folder fa-fw"></i> Catégories Illustrations
<a href="{{path("app_admin_illustration",{"by":"admin","userid":-1})}}">
<i class="fas fa-image fa-fw"></i> Illustrations
</a>
</li>

View File

@ -45,6 +45,10 @@ body .nav a{
color: var(--colorfttitledark);
}
body .page-item.active .page-link {
background-color: var(--colorbgbodydark);
border-color: var(--colorbgbodydark);
}
/* COLOR BODY HOME */
@ -82,6 +86,13 @@ body.monocolor .nav a{
color: var(--colorfttitledark);
}
body.monocolor .modal-content {
background-color: var(--colorbgbodydark);
}
body.monocolor .modal-header .close {
color: var(--colorftbodydark);
}
a.btn {
color: white !important;
}

View File

@ -61,7 +61,7 @@
<div class="row justify-content-md-center">
<div class="col-md-4">
<div class="card mb-3">
<div class="card mb-3" style="zoom:80%">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Informations
</div>
@ -77,28 +77,26 @@
{{ form_row(form.email) }}
</div>
</div>
</div>
<div class="col-md-4">
{% if form.roles is defined %}
<div class="card mb-2">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Organisation
</div>
<div class="card-body">
<div class="card-body" style="zoom:80%">
{{ form_row(form.groups) }}
{{ form_row(form.roles) }}
</div>
</div>
{%endif%}
{%endif%}
{%if mode!="submit" %}
<div class="card mb-3">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Ma Page
</div>
<div class="card-body">
<div class="card-body" style="zoom:80%">
{% if mode=="profil" %}
{{ render(path("app_user_config_render",{by:mode,category:"site"})) }}
{% else %}
@ -111,7 +109,7 @@
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Social
</div>
<div class="card-body">
<div class="card-body" style="zoom:80%">
{% if mode=="profil" %}
{{ render(path("app_user_config_render",{by:mode,category:"social"})) }}
{% else %}
@ -119,57 +117,64 @@
{% endif %}
</div>
</div>
<div class="card mb-3">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Hero
</div>
<div class="card-body" style="zoom:80%">
{% if mode=="profil" %}
{{ render(path("app_user_config_render",{by:mode,category:"hero"})) }}
{% else %}
{{ render(path("app_admin_config_render",{by:mode,category:"hero",userid:user.id})) }}
{% endif %}
</div>
</div>
<div class="card mb-3">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Images
</div>
<div class="card-body" style="zoom:80%">
{% if mode=="profil" %}
{{ render(path("app_user_config_render",{by:mode,category:"image"})) }}
{% else %}
{{ render(path("app_admin_config_render",{by:mode,category:"image",userid:user.id})) }}
{% endif %}
</div>
</div>
{% endif %}
</div>
<div class="col-md-4">
<div class="card mb-3">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Hero
</div>
<div class="card-body">
{% if mode=="profil" %}
{{ render(path("app_user_config_render",{by:mode,category:"hero"})) }}
{% else %}
{{ render(path("app_admin_config_render",{by:mode,category:"hero",userid:user.id})) }}
{% endif %}
</div>
{%if mode!="submit" %}
<div class="col-md-8">
<div class="card mb-3">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Catégories d'Illustrations
</div>
<div class="card-body">
{% if mode=="profil" %}
{{ render(path("app_user_category")) }}
{% else %}
{{ render(path("app_admin_category",{by:mode,userid:user.id})) }}
{% endif %}
</div>
</div>
<div class="card mb-3">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Illustrations
</div>
<div class="card-body">
{% if mode=="profil" %}
{{ render(path("app_user_illustration")) }}
{% else %}
{{ render(path("app_admin_illustration",{by:mode,userid:user.id})) }}
{% endif %}
</div>
</div>
</div>
<div class="card mb-3">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Images
</div>
<div class="card-body">
{% if mode=="profil" %}
{{ render(path("app_user_config_render",{by:mode,category:"image"})) }}
{% else %}
{{ render(path("app_admin_config_render",{by:mode,category:"image",userid:user.id})) }}
{% endif %}
</div>
</div>
</div>
</div>
<div class="row justify-content-md-center">
<div class="col-md-4">
</div>
<div class="col-md-8">
<div class="card mb-3">
<div class="card-header">
<i class="fa fa-pencil-alt fa-fw"></i> Illustrations
</div>
<div class="card-body">
{% if mode=="profil" %}
{{ render(path("app_user_illustration")) }}
{% else %}
{{ render(path("app_admin_illustration",{by:mode,userid:user.id})) }}
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>
{{ form_end(form) }}