Commit 5a0fe7d8 by Julien Jorry

UPDATE FRONT : better looking front office ;)

parent 7964b7c2
......@@ -62,7 +62,7 @@ security:
success_handler: redirect.after.login
logout:
path: fos_user_security_logout
target: fos_user_security_login
target: index
anonymous: true
guard:
authenticators:
......
......@@ -457,21 +457,21 @@ Prodigious\Sonata\MenuBundle\Entity\Menu:
alias: 'main'
Prodigious\Sonata\MenuBundle\Entity\MenuItem:
menuitem1:
menu: '@menu_main'
name: 'Adhérer'
url: '#'
position: 0
target: 0
enabled: 1
menuitem2:
menu: '@menu_main'
name: 'Adhérer à la MLC'
parent: '@menuitem1'
url: '/adherer'
position: 0
target: 0
enabled: 1
# menuitem1:
# menu: '@menu_main'
# name: 'Adhérer'
# url: '#'
# position: 0
# target: 0
# enabled: 1
# menuitem2:
# menu: '@menu_main'
# name: 'Adhérer à la MLC'
# parent: '@menuitem1'
# url: '/adherer'
# position: 0
# target: 0
# enabled: 1
# menuitem3:
# menu: '@menu_main'
# name: 'Charte'
......
......@@ -11,6 +11,7 @@ use App\Entity\User;
use App\Entity\Usergroup;
use App\Enum\MoyenEnum;
use Doctrine\ORM\Query;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use FOS\UserBundle\Model\UserManagerInterface;
use Knp\Menu\ItemInterface as MenuItemInterface;
use Sonata\AdminBundle\Admin\AbstractAdmin;
......@@ -212,6 +213,14 @@ class PrestataireAdmin extends AbstractAdmin
'label' => 'Métier responsable :',
'required' => true
))
->add('description', CKEditorType::class, array(
'label' => 'Description',
'required' => false
))
->add('horaires', TextType::class, array(
'label' => 'Horaires',
'required' => false
))
->end()
->with('Addresse', ['class' => 'col-md-5'])
->add('geoloc.adresse', TextType::class, array(
......
......@@ -7,6 +7,7 @@ use App\Entity\Page;
use App\Entity\User;
use App\Entity\Usergroup;
use App\Form\Type\AdhererFormType;
use App\Form\Type\ContactFormType;
use App\Form\Type\TransactionAdherentPrestataireFormType;
use Doctrine\ORM\EntityManagerInterface;
use Geocoder\Provider\Nominatim\Nominatim;
......@@ -55,7 +56,7 @@ class IndexController extends AbstractController
// @TODO : formulaire d'adhésion sans cotisation ? à valider après ?
// $adherent = new Adherent();
// $user = $this->um->createUser();
// $user = $this->m->createUser();
// $groupe = $this->em->getRepository(Usergroup::class)->findOneByName('Adherent');
// $user->setEnabled(true);
// $user->addGroup($groupe);
......@@ -85,7 +86,6 @@ class IndexController extends AbstractController
}
return $this->render('adherent/adherer.html.twig', array(
'user' => $this->getUser(),
'form' => $form->createView()
));
}
......@@ -141,8 +141,29 @@ class IndexController extends AbstractController
/**
* @Route("/contact", name="contact")
*/
public function contactAction()
public function contactAction(Request $request)
{
return $this->render('contact.html.twig');
$form = $this->createForm(ContactFormType::class);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$nom = $form['nom']->getData();
$emailFrom = $form['email']->getData();
$message = $form['message']->getData();
// TODO : send mail
$this->addFlash(
'success',
'Merci ! Le message a bien été envoyé !'
);
$referer = $request->headers->get('referer');
if ($referer && !$request->isXmlHttpRequest()) {
return $this->redirect($referer);
} elseif (!$request->isXmlHttpRequest()) {
return new Response('', Response::HTTP_BAD_REQUEST);
}
}
return $this->render('contact.html.twig', array(
'form' => $form->createView()
));
}
}
......@@ -4,30 +4,39 @@ namespace App\Controller;
use App\Entity\News;
use Doctrine\ORM\EntityManagerInterface;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class NewsController extends AbstractController
{
private $em;
private $paginator;
public function __construct(EntityManagerInterface $em)
public function __construct(EntityManagerInterface $em, PaginatorInterface $paginator)
{
$this->em = $em;
$this->paginator = $paginator;
}
/**
* @Route("/news", name="news")
*/
public function listeNewsAction()
public function listeNewsAction(Request $request)
{
$pagination = $this->paginator->paginate(
$this->em->getRepository(News::class)->findLatest(),
$request->query->getInt('page', 1),
5
);
return $this->render('news/liste.html.twig', array(
'news' => $this->em->getRepository(News::class)->findBy(array('enabled' => true), array('createdAt' => 'DESC'))
'news' => $pagination,
));
}
/**
* @Route("/news/{slug}", name="news_show")
* @Route("/news/{slug}", name="show_news")
*/
public function showNewsAction(News $news)
{
......
......@@ -10,7 +10,7 @@ use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Entity(repositoryClass="App\Repository\NewsRepository")
* @ORM\HasLifecycleCallbacks()
* @ORM\Table(name="news")
*/
......@@ -39,14 +39,6 @@ class News
protected $media;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="news")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*/
private $user;
/**
* @var bool
*
* @ORM\Column(type="boolean", name="visible_by_all_groups")
......@@ -54,6 +46,12 @@ class News
private $visibleByAllGroups = true;
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="news")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*/
private $user;
/**
* @return int
*/
public function getId(): int
......@@ -80,25 +78,6 @@ class News
return $this;
}
/**
* @param null|User $user
* @return $this
*/
public function setUser(?User $user)
{
$this->user = $user;
return $this;
}
/**
* @return null|User
*/
public function getUser(): ?User
{
return $this->user;
}
/**
* @return bool
*/
......@@ -129,4 +108,16 @@ class News
}
return $return;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
}
......@@ -42,6 +42,13 @@ class Prestataire
/**
* @var string|null
*
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @var string|null
*
* @Gedmo\Slug(fields={"raison"})
* @ORM\Column(length=100, unique=true)
*/
......@@ -153,7 +160,6 @@ class Prestataire
*/
private $groupeprestataires;
public function __construct()
{
$this->users = new ArrayCollection();
......@@ -198,6 +204,17 @@ class Prestataire
return $this;
}
public function setDescription(?string $description)
{
$this->description = $description;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
/**
* @return string
*/
......
......@@ -3,6 +3,7 @@
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
......@@ -95,12 +96,20 @@ class User extends BaseUser
*/
private $apiKey;
/**
* @var ArrayCollection|News[]
* @ORM\OneToMany(targetEntity="App\Entity\News", mappedBy="user", cascade={"persist"})
*/
private $news;
public function __construct()
{
parent::__construct();
$this->cotisations = new ArrayCollection();
$this->flux = new ArrayCollection();
$this->emailTokens = new ArrayCollection();
$this->faqs = new ArrayCollection();
$this->news = new ArrayCollection();
$this->createApiKey();
}
......@@ -393,4 +402,35 @@ class User extends BaseUser
}
return $this->getFullname();
}
/**
* @return Collection|News[]
*/
public function getNews(): Collection
{
return $this->news;
}
public function addNews(News $news): self
{
if (!$this->news->contains($news)) {
$this->news[] = $news;
$news->setUser($this);
}
return $this;
}
public function removeNews(News $news): self
{
if ($this->news->contains($news)) {
$this->news->removeElement($news);
// set the owning side to null (unless already changed)
if ($news->getUser() === $this) {
$news->setUser(null);
}
}
return $this;
}
}
<?php
namespace App\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
class ContactFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('nom', TextType::class, array(
'label' => 'Votre nom :',
'required' => true
))
->add('email', EmailType::class, array(
'label' => 'Votre email :',
'required' => true
))
->add('message', TextType::class, array(
'label' => 'Votre message :',
'required' => true
))
->add('save', SubmitType::class, ['label' => "Envoyer"])
;
}
public function getBlockPrefix()
{
return 'formContact';
}
}
......@@ -24,6 +24,9 @@ class CotisationFormType extends FluxFormType
return MoyenEnum::getTypeName($choice);
},
))
->add('montant', HiddenType::class, array(
'data' => $this->getParameter('api_user'),
))
->add('type', HiddenType::class, array(
'data' => 'cotisation',
'data_class' => null
......
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190304140111 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE prestataire ADD description LONGTEXT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE prestataire DROP description');
}
}
<?php
namespace App\Repository;
use App\Entity\News;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method News|null find($id, $lockMode = null, $lockVersion = null)
* @method News|null findOneBy(array $criteria, array $orderBy = null)
* @method News[] findAll()
* @method News[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class NewsRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, News::class);
}
/**
* @return News[] Returns an array of News objects
*/
public function findLatest()
{
$qb = $this->createQueryBuilder('n');
return $qb
->where('n.enabled = :enabled')
->setParameter('enabled', true)
->orderBy('n.createdAt', 'DESC')
->getQuery()
;
}
}
......@@ -32,6 +32,7 @@ class AppExtension extends AbstractExtension
new \Twig_SimpleFunction('getAllRubriques', array($this, 'getAllRubriques')),
new \Twig_SimpleFunction('getAllGroupes', array($this, 'getAllGroupes')),
new \Twig_SimpleFunction('getAllFlux', array($this, 'getAllFlux')),
new \Twig_SimpleFunction('mediaurl', array($this, 'mediaurl')),
new \Twig_SimpleFunction('parameter', function ($name) {
return $this->container->getParameter($name);
})
......@@ -84,6 +85,12 @@ class AppExtension extends AbstractExtension
return $this->container->get('doctrine')->getRepository(Groupe::class)->findBy(array('enabled' => true));
}
public function mediaurl($media, $format)
{
$provider = $this->container->get($media->getProviderName());
return $provider->generatePublicUrl($media, $format);
}
public function getTests(): array
{
return [
......
<div class="card mb-3">
<div class="card-header">Solde de mon compte : {{app.user.adherent.ecompte}}</div>
<div class="card-header">Solde de mon compte : <b>{{app.user.adherent.ecompte}}</b></div>
</div>
\ No newline at end of file
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container homepage'>
<div class='row'>
<div class='col-1'>
</div>
<div class='col-10 text-center'>
{% include 'common/login.html.twig' %}
</div>
<div class='col-1'>
</div>
</div>
</div>
{% endblock %}
<div class="card my-4 mx-4">
<div class="card-header">{{'Se connecter'|trans}}</div>
<div class="card-body">
<div class="card-text mx-auto">
{% trans_default_domain 'FOSUserBundle' %}
{% if error %}
<div>{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
<form action="{{ path("fos_user_security_check") }}" method="post">
{% if csrf_token %}
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />
{% endif %}
<div class='row'>
<div class='col-6 text-right'>
<label for="username">{{ 'security.login.username'|trans }} :</label>
</div>
<div class='col-6 text-left'>
<input type="text" id="username" name="_username" value="{{ last_username }}" required="required" autocomplete="username" />
</div>
</div>
<div class='row'>
<div class='col-6 text-right'>
<label for="password">{{ 'security.login.password'|trans }} :</label>
</div>
<div class='col-6 text-left'>
<input type="password" id="password" name="_password" required="required" autocomplete="current-password" />
</div>
</div>
<div class='row'>
<div class='col-12 text-center'>
<input type="checkbox" id="remember_me" name="_remember_me" value="on" />
<label class='ml-2' for="remember_me">{{ 'security.login.remember_me'|trans }}</label>
</div>
</div>
<div class='row'>
<div class='col-12 mx-auto text-center'>
<input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans }}" />
</div>
</div>
</form>
</div>
</div>
</div>
\ No newline at end of file
......@@ -17,6 +17,14 @@
{% set currentPath = app.request.requestUri %}
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
{% if app.user is null %}
<li class="nav-item dropdownmenu-item has-child dropdown" role="menu-item">
<a href="#" id="navbarDropdown1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link parent dropdown-toggle ">Adhérer</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown1">
<a href="/adherer" class="dropdown-item ">Adhérer à la MLC</a>
</div>
</li>
{% endif %}
{{ tree.menu(menuItems, currentPath) }}
{# MENU UTILISATEUR AYANT ACCES A L'ADMIN CONNECTE #}
{% if app.user and (is_granted('ROLE_ADMIN_SIEGE') or
......@@ -43,16 +51,28 @@
</span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownUC">
{# MENU ADHERENT CONNECTE #}
{% if is_granted('ROLE_ADHERENT') %}
<a href="{{ path('adherent_infos') }}" class="dropdown-item">{{ 'Mes infos'|trans }}</a>
<a href="{{ path('transactionAdherentPrestataire') }}" class="dropdown-item">{{ 'Transaction vers presta'|trans }}</a>
<a href="{{ path('transactionAdherentAdherent') }}" class="dropdown-item">{{ 'Transaction vers adherent'|trans }}</a>
{% endif %}
{# MENU PRESTATAIRE CONNECTE #}
{% if is_granted('ROLE_PRESTATAIRE') %}
<a href="{{ path('prestataire_infos') }}" class="dropdown-item">{{ 'Mes infos'|trans }}</a>
<a href="{{ path('transactionPrestataireAdherent') }}" class="dropdown-item">{{ 'Transaction vers adherent'|trans }}</a>
<a href="{{ path('transactionPrestatairePrestataire') }}" class="dropdown-item">{{ 'Transaction vers presta'|trans }}</a>
{% endif %}
{# MENU PRESTATAIRE CONNECTE #}
{% if is_granted('ROLE_TRESORIER') %}
<a href="{{ path('prestataire_infos') }}" class="dropdown-item">{{ 'Mes infos'|trans }}</a>
<a href="{{ path('transactionPrestataireAdherent') }}" class="dropdown-item">{{ 'Transaction vers adherent'|trans }}</a>
<a href="{{ path('transactionPrestatairePrestataire') }}" class="dropdown-item">{{ 'Transaction vers presta'|trans }}</a>
{% endif %}
{% if app.user.groups|length > 1 %}
<a href="#" class="viewChoiceGroup dropdown-item">{{ 'Choix du rôle'|trans }}</a>
{% endif %}
......
<div class="rubriques">
<div class="lastnewslist">
<h4> <i class="fa fa-newspaper"></i> Actualités</h4>
<p>
{% for news in getLastNews() %}
{% for news in getLastNews(3) %}
<div class="card mb-2">
<div class="card-header" style='cursor:pointer;' onmouseover="$(this).addClass('border-primary');" onmouseout="$(this).removeClass('border-primary');">{{news.title}}</div>
<div class="card-header" style='cursor:pointer;'>{{news.title}}</div>
<div class="card-body">
<h6 class="card-subtitle text-muted mb-3">Le {{news.createdAt|date('d/m/Y')}}</h6>
<div class="card-text">
{% if news.media %}
<img src="{% path news.media, 'reference' %}" style="max-width: 100%;"/>
{% set pathMedia = mediaurl(news.media, 'reference') %}
{% if pathMedia ends with '.jpg' or pathMedia ends with '.png' or pathMedia ends with '.bmp' or pathMedia ends with '.gif' %}
<img src="{% path news.media, 'reference' %}" style="max-width: 100%;"/>
{% else %}
<a href="{% path news.media, 'reference' %}">{{'Télécharger'|trans}}</a>
{% endif %}
{% endif %}
{{news.content|raw}}
</div>
</div>
<div class="card-footer text-muted">
{{'Crée le'|trans}} {{news.createdAt|date('d/m/Y')}}
</div>
</div>
{% endfor %}
</p>
......
<div class='onecomptoir col-12 clearfix mb-4 rounded bg-white'>
{{comptoir.name}}<br/>
{{comptoir.getFullAddresse()}}<br/>
{{comptoir.tel}}<br/>
Mail: {{ comptoir.email|safe_email|raw }}
</div>
\ No newline at end of file
<div class="rubriques">
<h4> <i class="fa fa-flag"></i> Rubriques</h4>
<h4> <i class="fa fa-flag"></i> {{'Rubriques'|trans}}</h4>
<p>
{% for rubrique in getAllRubriques() %}
<a class='rubrique' href='{{ path('show_rubrique', {'slug': rubrique.slug}) }}'>{{rubrique.name}}</a>{% if not loop.last %}{% endif %}
......
<div class="stats">
<h4> <i class="fa fa-bars"></i> À ce jour</h4>
<h4> <i class="fa fa-bars"></i> {{'À ce jour'|trans}}</h4>
<p>
<i class="fas fa-check"> </i> {{ showMlcStats('user') }} utilisateurs<br>
<i class="fas fa-check"> </i> {{ showMlcStats('user') }} {{'utilisateurs'|trans}}<br>
</p>
<p>
<i class="fa fa-check"> </i> {{ showMlcStats('prestataire') }} <a href="{{ path('liste_prestataire') }}" title="Les prestataires de la doume">prestataires</a> et {{ showMlcStats('partenaire') }} <a href="{{ path('liste_partenaire') }}" title="Les partenaires de la doume">partenaires</a>
<i class="fa fa-check"> </i> {{ showMlcStats('prestataire') }} <a href="{{ path('liste_prestataire') }}" title="{{'Les prestataires de la doume'|trans}}">{{'prestataires'|trans}}</a> {{'et'|trans}} {{ showMlcStats('partenaire') }} <a href="{{ path('liste_partenaire') }}" title="{{'Les partenaires de la doume'|trans}}">{{'partenaires'|trans}}</a>
</p>
<p>
<i class="fa fa-check"> </i> {{ showMlcStats('groupe') }} <a href="{#{ path('groupe_liste') }#}" title="Les groupes locaux de la doume">groupes locaux</a>
<i class="fa fa-check"> </i> {{ showMlcStats('groupe') }} <a href="{#{ path('groupe_liste') }#}" title="{{'Les groupes locaux de la doume'|trans}}">{{'groupes locaux'|trans}}</a>
</p>
<p>
<i class="fa fa-check"> </i> {{ showMlcStats('comptoir') }} <a href="{{ path('comptoirs_liste') }}" title="Les comptoirs de la doume">comptoirs</a>
<i class="fa fa-check"> </i> {{ showMlcStats('comptoir') }} <a href="{{ path('comptoirs_liste') }}" title="{{'Les comptoirs de la doume'|trans}}">{{'comptoirs'|trans}}</a>
</p>
{# <p>
<i class="fa fa-check"> </i> 527029 Doumes émises
......
......@@ -2,10 +2,12 @@
{% block content %}
<div class='container comptoirslist mt-5'>
<h1 class='pagetitle'>Comptoirs</h1>
<div class="my-3 p-5 bg-secondary rounded box-shadow row">
<h1 class='pagetitle'>{{'Liste des comptoirs'|trans}}</h1>
<div class="row">
{% for comptoir in comptoirs %}
{% include 'common/one_comptoir.html.twig' %}
<div class='col-6'>
{% include 'comptoir/onecomptoir.html.twig' %}
</div>
{% endfor %}
</div>
</div>
......
<div class="card mb-2">
<div class="card-header" style='cursor:pointer;'>
<h2>
<a href='{{ path('show_comptoir', {'slug': comptoir.slug}) }}'>{{comptoir.name}}</a>
</h2>
</div>
<div class="card-body">
{% if comptoir.groupe != null %}
<h4 class="card-subtitle mb-3">{{'Groupe local'|trans}} : <a href='{{ path('show_groupe', {'slug': comptoir.groupe.slug}) }}'>{{comptoir.groupe.__toString()}}</a></h4>
{% endif %}
{% if comptoir.tel != null %}
<h5 class="card-subtitle mb-3">{{'Téléphone'|trans}} : {{comptoir.tel}}</h5>
{% endif %}
{% if comptoir.email != null %}
<h6 class="card-subtitle mb-3">{{'Email'|trans}} : {{ comptoir.email|safe_email|raw }}</h6>
{% endif %}
{% if comptoir.getFullAddresse() != null %}
<h6 class="card-title text-muted mb-3">{{comptoir.getFullAddresse()}}</h6>
{% endif %}
<div class="card-text">
{{comptoir.content|raw}}
</div>
</div>
</div>
\ No newline at end of file
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container groupeshow mt-5'>
<h1>{{comptoir.name}}</h1>
<div class="my-3 p-3 bg-white rounded box-shadow">
<div class="contentgroupe p-4 mt-5">
{{comptoir.content|raw}}
</div>
<div class="contentgroupe p-4 mt-5">
<h2>Prestataires ({{ showMlcStats('prestataire') }}):</h2>
<ul>
{% for presta in comptoir.prestataires %}
<a href='{{ path('show_prestataire', {'slug': presta.slug}) }}'>{{presta.raison}}</a>
{% endfor %}
</ul>
<div class='container groupeshow mt-2'>
<div class="my-2 p-3 bg-white rounded box-shadow">
<div class="contentcomptoir p-4 mt-2">
<div class="card mb-2">
<div class="card-header"><h1>{{comptoir.name}}</h1></div>
<div class="card-body">
{% if comptoir.groupe != null %}
<h4 class="card-subtitle mb-3">{{'Groupe local'|trans}} : <a href='{{ path('show_groupe', {'slug': comptoir.groupe.slug}) }}'>{{comptoir.groupe.__toString()}}</a></h4>
{% endif %}
{% if comptoir.tel != null %}
<h5 class="card-subtitle mb-3">{{'Téléphone'|trans}} : {{comptoir.tel}}</h5>
{% endif %}
{% if comptoir.email != null %}
<h6 class="card-subtitle mb-3">{{'Email'|trans}} : {{ comptoir.email|safe_email|raw }}</h6>
{% endif %}
{% if comptoir.getFullAddresse() != null %}
<h6 class="card-title text-muted mb-3">{{comptoir.getFullAddresse()}}</h6>
{% endif %}
<div class="card-text">
{{comptoir.content|raw}}
</div>
</div>
<div class="card-header"><h2>{{ comptoir.groupe.prestataires|length }} {{'prestataires'|trans}} :</h2></div>
<ul class="list-group list-group-flush">
{% for presta in comptoir.groupe.prestataires %}
<li class="list-group-item">
<a href='{{ path('show_prestataire', {'slug': presta.slug}) }}'>{{presta.raison}}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
......
{% extends 'common/layout.html.twig' %}
{% block content %}
Contact :
<div class='container homepage'>
<div class="card mx-auto mt-5" style="max-width:600px;">
<div class="card-header">Nous contacter</div>
<div class="card-body">
<div class="card-text">
{{form_start(form)}}
{{ form_row(form.nom) }}
{{ form_row(form.email) }}
{{ form_row(form.message) }}
{{ form_row(form.save) }}
{{form_end(form)}}
</div>
</div>
</div>
</div>
{% endblock %}
......@@ -2,13 +2,13 @@
{% block content %}
<div class='container faqlist mt-5'>
<h1>Foire Aux Questions</h1>
{% for faq in faqs %}
<div class="my-3 p-3 bg-white rounded box-shadow">
<ul>
<li><a href="{{ path('show_faq', {'slug': faq.slug}) }}">{{faq.name}}</a></li>
</ul>
</div>
{% endfor %}
<h1 class='pagetitle'>{{'Foire Aux Questions'|trans}}</h1>
<div class="row">
{% for faq in faqs %}
<div class='col-12 col-md-6'>
{% include 'faq/onefaq.html.twig' %}
</div>
{% endfor %}
</div>
</div>
{% endblock %}
<div class="card mb-2">
<div class="card-header" style='cursor:pointer;'>
<h2>
<a href='{{ path('show_faq', {'slug': faq.slug}) }}'>{{faq.name}}</a>
</h2>
</div>
<div class="card-body">
{% if faq.fichier != null %}
<h6 class="card-title text-muted mb-3"><a href="{% path faq.fichier, 'reference' %}">{{'Télécharger'|trans}}</a></h6>
{% endif %}
<div class="card-text">
{% if faq.image != null %}
{% thumbnail faq.image, 'small' %}
{% endif %}
{{faq.content|raw}}
</div>
</div>
</div>
\ No newline at end of file
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container groupeshow mt-5'>
<h1>{{groupe.name}}</h1>
<div class="my-3 p-3 bg-white rounded box-shadow">
<div class="contentgroupe p-4 mt-5">
{{groupe.content|raw}}
</div>
<div class="contentgroupe p-4 mt-5">
<h2>Comptoirs :</h2>
<ul>
{% for comptoir in groupe.comptoirs %}
<a href='{{ path('show_comptoir', {'slug': comptoir.slug}) }}'>{{comptoir.name}}</a>
{% endfor %}
</ul>
<div class='container groupeshow mt-2'>
<div class="my-2 p-3 bg-white rounded box-shadow">
<div class="contentgroupe p-4 mt-2">
<div class="card mb-2">
<div class="card-header"><h1>{{groupe.name}}</h1></div>
<div class="card-body">
<div class="card-text">
{{groupe.content|raw}}
</div>
</div>
<div class="card-header"><h2>{{ groupe.comptoirs|length }} {{'comptoirs'|trans}} :</h2></div>
<ul class="list-group list-group-flush">
{% for comptoir in groupe.comptoirs %}
<li class="list-group-item">
<a href='{{ path('show_comptoir', {'slug': comptoir.slug}) }}'>{{comptoir.name}}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
{% endblock %}
......@@ -5,28 +5,37 @@
<h1 class='homepage_title'>OUTIL DE GESTION DE MONNAIE LOCALE COMPLEMENTAIRE</h1>
<div class='row'>
<div class='col-3'>
{% include 'common/stats.html.twig' %}
{% include 'common/groupes.html.twig' %}
{% include 'common/rubriques.html.twig' %}
<div class='col-12 col-md-3'>
{% block colonne_gauche %}
{% include 'common/stats.html.twig' %}
{% include 'common/groupes.html.twig' %}
{% include 'common/rubriques.html.twig' %}
{% endblock colonne_gauche %}
</div>
<div class='col-6 text-center'>
{% if is_granted('ROLE_PRESTATAIRE') %}
{% include 'presta/block/solde.html.twig' %}
{% include 'block/cotisations.html.twig' %}
{% include 'block/transactions.html.twig' %}
{% include 'presta/block/transaction_presta.html.twig' %}
{% include 'presta/block/transaction_adherent.html.twig' %}
{% elseif is_granted('ROLE_ADHERENT') %}
{% include 'adherent/block/solde.html.twig' %}
{% include 'block/cotisations.html.twig' %}
{% include 'block/transactions.html.twig' %}
{% include 'adherent/block/transaction_presta.html.twig' %}
{% include 'adherent/block/transaction_adherent.html.twig' %}
{% endif %}
<div class='col-12 col-md-6 text-center'>
{% block colonne_centre %}
{% if is_granted('ROLE_PRESTATAIRE') %}
{% include 'presta/block/solde.html.twig' %}
{% include 'block/cotisations.html.twig' %}
{% include 'block/transactions.html.twig' %}
{% include 'presta/block/transaction_presta.html.twig' %}
{% include 'presta/block/transaction_adherent.html.twig' %}
{% elseif is_granted('ROLE_ADHERENT') %}
{% include 'adherent/block/solde.html.twig' %}
{% include 'block/cotisations.html.twig' %}
{% include 'block/transactions.html.twig' %}
{% include 'adherent/block/transaction_presta.html.twig' %}
{% include 'adherent/block/transaction_adherent.html.twig' %}
{% endif %}
{% endblock colonne_centre %}
</div>
<div class='col-3'>
{% include 'common/news.html.twig' %}
<div class='col-12 col-md-3'>
{% block colonne_droite %}
{% if app.user is null %}
<a class='btn btn-secondary w-100 mb-4' title='{{'Se connecter'|trans}}' href="{{path('fos_user_security_login')}}">{{'Se connecter'|trans}}</a>
{% endif %}
{% include 'common/news.html.twig' %}
{% endblock colonne_droite %}
</div>
</div>
</div>
......
......@@ -2,14 +2,31 @@
{% block content %}
<div class='container newslist mt-5'>
<h1>Actualités</h1>
{% for new in news %}
<div class="my-3 p-3 bg-white rounded box-shadow">
<h2><a href="{{ path('news_show', {'slug': new.slug}) }}">{{new.name}}</a></h2>
<div class="contentnews p-4 mt-5">
{{new.content|raw}}
</div>
</div>
{% endfor %}
<h1><i class="fa fa-newspaper"></i> {{'Actualités'|trans}}</h1>
{% for new in news %}
<div class="card mb-4">
<div class="card-header" style='cursor:pointer;'><h2><a href='{{path('show_news', {'slug': new.slug})}}'>{{ new.title|capitalize }}</a></h2></div>
<div class="card-body">
<div class="card-text">
{% if new.media %}
{% set pathMedia = mediaurl(new.media, 'reference') %}
{% if pathMedia ends with '.jpg' or pathMedia ends with '.png' or pathMedia ends with '.bmp' or pathMedia ends with '.gif' %}
<img src="{% path new.media, 'reference' %}" style="max-width: 100%;"/>
{% else %}
<a href="{% path new.media, 'reference' %}">{{'Télécharger'|trans}}</a>
{% endif %}
{% endif %}
{{new.content|raw}}
</div>
</div>
<div class="card-footer text-muted">
{{'Crée le'|trans}} {{new.createdAt|date('d/m/Y')}}
</div>
</div>
{% endfor %}
<div class="pagination">
{{ knp_pagination_render(news) }}
</div>
</div>
{% endblock %}
{% endblock %}
\ No newline at end of file
......@@ -2,11 +2,25 @@
{% block content %}
<div class='container newslist mt-5'>
<h1>{{news.name}}</h1>
<div class="my-3 p-3 bg-white rounded box-shadow">
<div class="contentnews p-4 mt-5">
{{news.content|raw}}
<div class="card mb-2">
<div class="card-header" style='cursor:pointer;'><h1>{{news.title}}</h1></div>
<div class="card-body">
<div class="card-text">
{% if news.media %}
{% set pathMedia = mediaurl(news.media, 'reference') %}
{% if pathMedia ends with '.jpg' or pathMedia ends with '.png' or pathMedia ends with '.bmp' or pathMedia ends with '.gif' %}
<img src="{% path news.media, 'reference' %}" style="max-width: 100%;"/>
{% else %}
<a href="{% path news.media, 'reference' %}">{{'Télécharger'|trans}}</a>
{% endif %}
{% endif %}
{{news.content|raw}}
</div>
</div>
<div class="card-footer text-muted">
{{'Crée le'|trans}} {{news.createdAt|date('d/m/Y')}}
</div>
</div>
</div>
</div>
{% endblock %}
<div class="card mb-3">
<div class="card-header">Solde de mon compte : {{app.user.prestataire.compte}}</div>
<div class="card-header">Solde de mon compte : <b>{{app.user.prestataire.compte}}</b></div>
</div>
\ No newline at end of file
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container newslist mt-5'>
<div class='container prestalist mt-5'>
<h1>{{type}} :</h1>
<div class="row">
{% for presta in prestas %}
<div class="contentnews p-4 mt-5">
<span>{{presta.statut}} ({{presta.siret}})</span>
<small class='ml-5'>Responsable : {{presta.responsable}} ({{presta.metier}})</small>
{% if presta.web is not empty %}
<p><a href='{{presta.web}}'>Site web</a></p>
{% endif %}
</div>
<div class="col-12 col-md-6 mb-2">
<div class='card'>
<div class="card-header"><h2>{{presta.raison}}</h2></div>
<div class="card-body">
<h4 class="card-title">{{presta.statut}} - {{presta.siret}}</h4>
<h6 class="card-title">Responsable : {{presta.responsable}} ({{presta.metier}})</h6>
<div class="card-text">
{% if presta.media %}
<p class='mb-4'>
{% set pathMedia = mediaurl(presta.media, 'reference') %}
{% if pathMedia ends with '.jpg' or pathMedia ends with '.png' or pathMedia ends with '.bmp' or pathMedia ends with '.gif' %}
<img src="{% path presta.media, 'reference' %}" style="max-width: 100%;"/>
{% else %}
<a href="{% path presta.media, 'reference' %}">{{'Télécharger'|trans}}</a>
{% endif %}
</p>
{% endif %}
{% if presta.description != null %}
<p class='mb-4'>
{{presta.description|raw}}
</p>
{% endif %}
{% if presta.horaires != null %}
<em class='mb-4'>
{{presta.horaires|raw}}
</em>
{% endif %}
{% if presta.web != null %}
<p>
<a href='{{presta.web}}'>Site web</a>
</p>
{% endif %}
</div>
</div>
</div>
</div>
{% if loop.index%2 == 0 %}
</div>
<div class="row">
{% endif %}
{% endfor %}
</div>
</div>
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container newslist mt-5'>
<div class='container rubriquelist mt-5'>
<h1>Rubriques</h1>
{# <div class="card-columns"> #}
<div class="row">
{% for rubrique in rubriques %}
<div class="my-3 p-3 bg-white rounded box-shadow">
<h2><a href="{{ path('show_rubrique', {'slug': rubrique.slug}) }}">{{rubrique.name}}</a></h2>
<h3>{{rubrique.prestataires|length}} prestataires</h3>
<div class="contentnews p-4 mt-5">
{{rubrique.content|raw}}
<div class="col-12 col-md-6 mb-2">
<div class="card mb-2">
<div class="card-header" style='cursor:pointer;'><h2>{{rubrique.name}}</h2></div>
<div class="card-body">
<div class="card-text">
{{rubrique.content|raw}}
</div>
<div class="card-text mx-auto text-center">
<h6 class="card-text mt-3" style='cursor:pointer;' data-toggle="collapse" data-target="#collapsepresta{{rubrique.id}}" aria-expanded="false" aria-controls="collapsepresta{{rubrique.id}}">
{{rubrique.prestataires|length}} {{'prestataires'|trans}}
</h6>
</div>
</div>
{% if rubrique.prestataires|length > 0 %}
<ul class="list-group list-group-flush collapse" id="collapsepresta{{rubrique.id}}">
{% for presta in rubrique.prestataires %}
<li class="list-group-item">
<a href='{{ path('show_prestataire', {'slug': presta.slug}) }}'>{{presta.__toString()}}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endfor %}
......
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container groupeshow mt-2'>
<div class="my-2 p-3 bg-white rounded box-shadow">
<div class="contentpresta p-4 mt-2">
<div class="card mb-2">
<div class="card-header"><h1>{{presta.raison}}</h1></div>
<div class="card-body">
{% if presta.statut != null %}
<h6 class="card-title text-muted mb-3">{{presta.statut}}</h6>
{% endif %}
{% if presta.groupe != null %}
<h4 class="card-subtitle mb-3">{{'Groupe local'|trans}} : <a href='{{ path('show_groupe', {'slug': presta.groupe.slug}) }}'>{{presta.groupe.__toString()}}</a></h4>
{% endif %}
{% if presta.siret != null %}
<h5 class="card-subtitle mb-3">{{'SIRET'|trans}} : {{presta.siret}}</h5>
{% endif %}
{% if presta.horaires != null %}
<h6 class="card-subtitle text-muted mb-3">{{'Horaires'|trans}} : {{presta.horaires}}</h6>
{% endif %}
{% if presta.web != null %}
<h6 class="card-subtitle mb-3">{{'Site web'|trans}} : <a href='{{presta.web}}' target='_blank'>{{presta.web}}</a></h6>
{% endif %}
{% if presta.responsable != null and presta.metier != null %}
<h6 class="card-title my-3">Responsable : {{presta.responsable}} ({{presta.metier}})</h6>
{% endif %}
{% if presta.user != null and presta.user.email != null %}
<h6 class="card-subtitle text-muted mb-3">{{'Email'|trans}} : {{ presta.user.email|safe_email|raw }}</h6>
{% endif %}
{% if presta.user != null and presta.user.phone != null %}
<h6 class="card-subtitle text-muted mb-3">{{'Téléphone'|trans}} : {{ presta.user.phone }}</h6>
{% endif %}
<div class="card-text">
{{presta.description|raw}}
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block contenat %}
<div class='container newslist mt-5'>
<h1>{{presta.raison}}</h1>
<div class="my-3 p-3 bg-white rounded box-shadow">
<div class="contentnews p-4 mt-5">
<h2>{{presta.statut}}</h2>
<h3>Responsable : {{presta.responsable}} ({{presta.metier}})</h3>
<h4>SIRET : {{presta.siret}}</h4>
{% if presta.web is not empty %}
<h4><a href='{{presta.web}}'>Site web</a></h4>
{% endif %}
<h2>{{presta.statut}}</h2>
<h3>Responsable : {{presta.responsable}} ({{presta.metier}})</h3>
<h4>SIRET : {{presta.siret}}</h4>
{% if presta.web is not empty %}
<h4><a href='{{presta.web}}'>Site web</a></h4>
{% endif %}
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment