Merge remote-tracking branch 'origin/master' into issue589_private_comments

This commit is contained in:
2022-05-27 15:47:25 +02:00
276 changed files with 4245 additions and 1708 deletions

View File

@@ -76,7 +76,8 @@ final class AddressReferenceAPIController extends ApiController
protected function customizeQuery(string $action, Request $request, $qb): void
{
if ($request->query->has('postal_code')) {
$qb->where('e.postcode = :postal_code')
$qb->where($qb->expr()->isNull('e.deletedAt'))
->andWhere('e.postcode = :postal_code')
->setParameter('postal_code', $request->query->get('postal_code'));
}
}

View File

@@ -24,13 +24,27 @@ class AdminController extends AbstractController
return $this->render('@ChillMain/Admin/index.html.twig');
}
public function indexLocationsAction()
/**
* @Route("/{_locale}/admin/language", name="chill_main_language_admin")
*/
public function indexLanguageAction()
{
return $this->render('@ChillMain/Admin/layout_location.html.twig');
return $this->render('@ChillMain/Admin/indexLanguage.html.twig');
}
public function indexPermissionsAction()
/**
* @Route("/{_locale}/admin/location", name="chill_main_location_admin")
*/
public function indexLocationAction()
{
return $this->render('@ChillMain/Admin/layout_permissions.html.twig');
return $this->render('@ChillMain/Admin/indexLocation.html.twig');
}
/**
* @Route("/{_locale}/admin/user", name="chill_main_user_admin")
*/
public function indexUserAction()
{
return $this->render('@ChillMain/Admin/indexUser.html.twig');
}
}

View File

@@ -1,18 +0,0 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
class AdminCountryCRUDController extends CRUDController
{
}

View File

@@ -36,7 +36,7 @@ class CenterController extends AbstractController
$em->persist($center);
$em->flush();
return $this->redirect($this->generateUrl('admin_center_show', ['id' => $center->getId()]));
return $this->redirect($this->generateUrl('admin_center'));
}
return $this->render('@ChillMain/Center/new.html.twig', [

View File

@@ -0,0 +1,26 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\HttpFoundation\Request;
class CivilityController extends CRUDController
{
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$query->addOrderBy('e.order', 'ASC');
return parent::orderQuery($action, $query, $request, $paginator);
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\HttpFoundation\Request;
class CountryController extends CRUDController
{
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$query->addOrderBy('e.countryCode', 'ASC');
return parent::orderQuery($action, $query, $request, $paginator);
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\HttpFoundation\Request;
class LanguageController extends CRUDController
{
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$query->addOrderBy('e.id', 'ASC');
return parent::orderQuery($action, $query, $request, $paginator);
}
}

View File

@@ -36,7 +36,7 @@ class ScopeController extends AbstractController
$em->persist($scope);
$em->flush();
return $this->redirect($this->generateUrl('admin_scope_show', ['id' => $scope->getId()]));
return $this->redirect($this->generateUrl('admin_scope'));
}
return $this->render('@ChillMain/Scope/new.html.twig', [

View File

@@ -19,6 +19,8 @@ use Chill\MainBundle\Form\UserCurrentLocationType;
use Chill\MainBundle\Form\UserPasswordType;
use Chill\MainBundle\Form\UserType;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Chill\MainBundle\Repository\UserRepository;
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
use Psr\Log\LoggerInterface;
use RuntimeException;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
@@ -39,14 +41,18 @@ class UserController extends CRUDController
private UserPasswordEncoderInterface $passwordEncoder;
private UserRepository $userRepository;
private ValidatorInterface $validator;
public function __construct(
LoggerInterface $chillLogger,
ValidatorInterface $validator,
UserPasswordEncoderInterface $passwordEncoder
UserPasswordEncoderInterface $passwordEncoder,
UserRepository $userRepository
) {
$this->logger = $chillLogger;
$this->userRepository = $userRepository;
$this->validator = $validator;
$this->passwordEncoder = $passwordEncoder;
}
@@ -215,6 +221,27 @@ class UserController extends CRUDController
]);
}
protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper
{
return $this->getFilterOrderHelperFactory()
->create(self::class)
->addSearchBox(['label'])
->build();
}
protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int
{
if (!$filterOrder instanceof FilterOrderHelper) {
return parent::countEntities($action, $request, $filterOrder);
}
if (null === $filterOrder->getQueryString()) {
return parent::countEntities($action, $request, $filterOrder);
}
return $this->userRepository->countByUsernameOrEmail($filterOrder->getQueryString());
}
protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface
{
// for "new", add special config
@@ -250,6 +277,33 @@ class UserController extends CRUDController
return parent::generateTemplateParameter($action, $entity, $request, $defaultTemplateParameters);
}
protected function getQueryResult(
string $action,
Request $request,
int $totalItems,
PaginatorInterface $paginator,
?FilterOrderHelper $filterOrder = null
) {
if (0 === $totalItems) {
return [];
}
if (!$filterOrder instanceof FilterOrderHelper) {
return parent::getQueryResult($action, $request, $totalItems, $paginator, $filterOrder);
}
if (null === $filterOrder->getQueryString()) {
return parent::getQueryResult($action, $request, $totalItems, $paginator, $filterOrder);
}
return $this->userRepository->findByUsernameOrEmail(
$filterOrder->getQueryString(),
['usernameCanonical' => 'ASC'],
$paginator->getItemsPerPage(),
$paginator->getCurrentPageFirstItemNumber()
);
}
protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request)
{
// for "new", encode the password
@@ -264,7 +318,8 @@ class UserController extends CRUDController
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$query->addOrderBy('e.usernameCanonical', 'ASC');
$query
->addOrderBy('e.usernameCanonical', 'ASC');
return parent::orderQuery($action, $query, $request, $paginator);
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\HttpFoundation\Request;
class UserJobController extends CRUDController
{
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$query->addOrderBy('e.id', 'ASC');
return parent::orderQuery($action, $query, $request, $paginator);
}
}

View File

@@ -13,9 +13,13 @@ namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\Controller\AddressApiController;
use Chill\MainBundle\Controller\CivilityApiController;
use Chill\MainBundle\Controller\CivilityController;
use Chill\MainBundle\Controller\CountryController;
use Chill\MainBundle\Controller\LanguageController;
use Chill\MainBundle\Controller\LocationController;
use Chill\MainBundle\Controller\LocationTypeController;
use Chill\MainBundle\Controller\UserController;
use Chill\MainBundle\Controller\UserJobController;
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
use Chill\MainBundle\Doctrine\DQL\GetJsonFieldByKey;
use Chill\MainBundle\Doctrine\DQL\JsonAggregate;
@@ -30,10 +34,16 @@ use Chill\MainBundle\Doctrine\DQL\Unaccent;
use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator;
use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType;
use Chill\MainBundle\Doctrine\Type\PointType;
use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Entity\Country;
use Chill\MainBundle\Entity\Language;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\LocationType;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Form\CivilityType;
use Chill\MainBundle\Form\CountryType;
use Chill\MainBundle\Form\LanguageType;
use Chill\MainBundle\Form\LocationFormType;
use Chill\MainBundle\Form\LocationTypeType;
use Chill\MainBundle\Form\UserJobType;
@@ -299,6 +309,7 @@ class ChillMainExtension extends Extension implements
'cruds' => [
[
'class' => UserJob::class,
'controller' => UserJobController::class,
'name' => 'admin_user_job',
'base_path' => '/admin/main/user-job',
'base_role' => 'ROLE_ADMIN',
@@ -310,9 +321,11 @@ class ChillMainExtension extends Extension implements
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/UserJob/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/UserJob/edit.html.twig',
],
],
],
@@ -382,6 +395,72 @@ class ChillMainExtension extends Extension implements
],
],
],
[
'class' => Country::class,
'name' => 'main_country',
'base_path' => '/admin/main/country',
'base_role' => 'ROLE_ADMIN',
'form_class' => CountryType::class,
'controller' => CountryController::class,
'actions' => [
'index' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Country/index.html.twig',
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Country/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Country/edit.html.twig',
],
],
],
[
'class' => Civility::class,
'name' => 'main_civility',
'base_path' => '/admin/main/civility',
'base_role' => 'ROLE_ADMIN',
'form_class' => CivilityType::class,
'controller' => CivilityController::class,
'actions' => [
'index' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Civility/index.html.twig',
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Civility/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Civility/edit.html.twig',
],
],
],
[
'class' => Language::class,
'name' => 'main_language',
'base_path' => '/admin/main/language',
'base_role' => 'ROLE_ADMIN',
'form_class' => LanguageType::class,
'controller' => LanguageController::class,
'actions' => [
'index' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Language/index.html.twig',
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Language/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Language/edit.html.twig',
],
],
],
],
'apis' => [
[

View File

@@ -12,13 +12,14 @@ declare(strict_types=1);
namespace Chill\MainBundle\Entity;
use Chill\MainBundle\Doctrine\Model\Point;
use DateTimeImmutable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity
* @ORM\Table(name="chill_main_address_reference", indexes={
* @ORM\Index(name="address_refid", columns={"refId"}, options={"where": "refid != ''"})
* @ORM\Index(name="address_refid", columns={"refId"})
* })
* @ORM\HasLifecycleCallbacks
*/
@@ -33,6 +34,18 @@ class AddressReference
*/
private string $addressCanonical = '';
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
* @groups({"read"})
*/
private ?DateTimeImmutable $createdAt = null;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
* @groups({"read"})
*/
private ?DateTimeImmutable $deletedAt = null;
/**
* @ORM\Id
* @ORM\GeneratedValue
@@ -89,6 +102,22 @@ class AddressReference
*/
private $streetNumber;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
* @groups({"read"})
*/
private ?DateTimeImmutable $updatedAt = null;
public function getCreatedAt(): ?DateTimeImmutable
{
return $this->createdAt;
}
public function getDeletedAt(): ?DateTimeImmutable
{
return $this->deletedAt;
}
public function getId(): ?int
{
return $this->id;
@@ -134,6 +163,25 @@ class AddressReference
return $this->streetNumber;
}
public function getUpdatedAt(): ?DateTimeImmutable
{
return $this->updatedAt;
}
public function setCreatedAt(?DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function setDeletedAt(?DateTimeImmutable $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public function setMunicipalityCode(?string $municipalityCode): self
{
$this->municipalityCode = $municipalityCode;
@@ -189,4 +237,11 @@ class AddressReference
return $this;
}
public function setUpdatedAt(?DateTimeImmutable $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
}

View File

@@ -21,10 +21,11 @@ use Symfony\Component\Serializer\Annotation\Groups;
* @ORM\Entity
* @ORM\Table(
* name="chill_main_postal_code",
* indexes={@ORM\Index(
* name="search_name_code",
* columns={"code", "label"}
* )})
* indexes={
* @ORM\Index(name="search_name_code", columns={"code", "label"}),
* @ORM\Index(name="search_by_reference_code", columns={"code", "refpostalcodeid"})
* })
*
* @ORM\HasLifecycleCallbacks
*/
class PostalCode

View File

@@ -45,7 +45,7 @@ class User implements AdvancedUserInterface
*
* @ORM\Column(type="json", nullable=true)
*/
private array $attributes;
private array $attributes = [];
/**
* @ORM\ManyToOne(targetEntity=Location::class)

View File

@@ -0,0 +1,45 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class CivilityType extends \Symfony\Component\Form\AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TranslatableStringFormType::class, [
'required' => true,
])
->add('abbreviation', TranslatableStringFormType::class)
->add('active', ChoiceType::class, [
'choices' => [
'Active' => true,
'Inactive' => false,
],
])
->add('order', IntegerType::class);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Civility::class,
]);
}
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\Country;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class CountryType extends \Symfony\Component\Form\AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TranslatableStringFormType::class, [
'label' => 'Name',
'required' => true,
])
->add('countryCode', TextType::class, [
'label' => 'Country code',
'required' => true,
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Country::class,
]);
}
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\Language;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class LanguageType extends \Symfony\Component\Form\AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('id', TextType::class, [
'label' => 'Id',
'required' => true,
])
->add('name', TranslatableStringFormType::class, [
'label' => 'Name',
'required' => true,
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Language::class,
]);
}
}

View File

@@ -130,12 +130,13 @@ final class AddressReferenceRepository implements ObjectRepository
$query
->setFromClause('chill_main_address_reference cma')
->andWhereClause('postcode_id = ?', [$postalCode->getId()]);
->andWhereClause('postcode_id = ?', [$postalCode->getId()])
->andWhereClause('deletedAt IS NULL', []);
$pertinenceClause = ['STRICT_WORD_SIMILARITY(addresscanonical, UNACCENT(?))'];
$pertinenceArgs = [$pattern];
$orWhere = ['addresscanonical %>> UNACCENT(?)'];
$orWhereArgs = [$pattern];
$andWhere = [];
$andWhereArgs = [];
foreach (explode(' ', $pattern) as $part) {
$part = trim($part);
@@ -144,8 +145,8 @@ final class AddressReferenceRepository implements ObjectRepository
continue;
}
$orWhere[] = "addresscanonical LIKE '%' || UNACCENT(LOWER(?)) || '%'";
$orWhereArgs[] = $part;
$andWhere[] = "(addresscanonical LIKE '%' || UNACCENT(LOWER(?)) || '%')";
$andWhereArgs[] = $part;
$pertinenceClause[] =
"(EXISTS (SELECT 1 FROM unnest(string_to_array(addresscanonical, ' ')) AS t WHERE starts_with(t, UNACCENT(LOWER(?)))))::int";
$pertinenceClause[] =
@@ -154,7 +155,7 @@ final class AddressReferenceRepository implements ObjectRepository
}
$query
->setSelectPertinence(implode(' + ', $pertinenceClause), $pertinenceArgs)
->andWhereClause(implode(' OR ', $orWhere), $orWhereArgs);
->andWhereClause(implode(' AND ', $andWhere), $andWhereArgs);
return $query;
}

View File

@@ -83,10 +83,24 @@ final class UserRepository implements ObjectRepository
return $this->findBy(['enabled' => true], $orderBy, $limit, $offset);
}
public function findByUsernameOrEmail(string $pattern)
public function findByUsernameOrEmail(string $pattern, ?array $orderBy = [], ?int $limit = null, ?int $offset = null): array
{
$qb = $this->queryByUsernameOrEmail($pattern);
$qb->select('u');
if (null !== $limit) {
$qb->setMaxResults($limit);
}
if (null !== $offset) {
$qb->setFirstResult($offset);
}
foreach ($orderBy as $field => $order) {
$qb->addOrderBy('u.' . $field, $order);
}
return $qb->getQuery()->getResult();
}
@@ -164,13 +178,13 @@ final class UserRepository implements ObjectRepository
private function queryByUsernameOrEmail(string $pattern): QueryBuilder
{
$qb = $this->entityManager->createQueryBuilder('u');
$qb = $this->entityManager->createQueryBuilder()->from(User::class, 'u');
$searchByPattern = $qb->expr()->orX();
$searchByPattern
->add($qb->expr()->eq('u.usernameCanonical', 'LOWER(UNACCENT(:pattern))'))
->add($qb->expr()->eq('u.emailCanonical', 'LOWER(UNACCENT(:pattern))'));
->add($qb->expr()->like('u.usernameCanonical', 'CONCAT(\'%\', LOWER(UNACCENT(:pattern)), \'%\')'))
->add($qb->expr()->like('u.emailCanonical', 'CONCAT(\'%\', LOWER(UNACCENT(:pattern)), \'%\')'));
$qb
->where($searchByPattern)

View File

@@ -187,6 +187,10 @@ div.vertical-menu {
background-color: tint-color($chill-yellow, 20%)
}
}
a.list-group-item-header {
text-transform: uppercase;
font-weight: bold;
}
}
footer.footer {
@@ -210,6 +214,20 @@ footer.footer {
}
}
/*
* ADMIN STYLES
*/
div.admin {
flex-direction: row-reverse;
div.vertical-menu {
font-size: 0.9em;
.list-group-item {
padding: 0.3rem 0.7rem;
}
}
}
/*
* GENERIC MAIN STYLES
* miscellaneous
@@ -217,7 +235,7 @@ footer.footer {
/// titles
h1, h2,
.h1, .h2 {
.h1, .h2 {
font-weight: $headings-font-weight + 100;
}

View File

@@ -1,7 +1,7 @@
<template>
<h4 class="h3">{{ $t('fill_an_address') }}</h4>
<div class="row my-3">
<div class="col-lg-6">
<div class="col-lg-6" v-if="!isNoAddress">
<div class="form-floating my-1">
<input class="form-control"
type="text"
@@ -35,8 +35,8 @@
<label for="flat">{{ $t('flat') }}</label>
</div>
</div>
<div class="col-lg-6">
<div class="form-floating my-1">
<div :class="isNoAddress ? 'col-lg-12' : 'col-lg-6'">
<div class="form-floating my-1" v-if="!isNoAddress">
<input class="form-control"
type="text"
name="buildingName"
@@ -54,7 +54,7 @@
v-model="extra"/>
<label for="extra">{{ $t('extra') }}</label>
</div>
<div class="form-floating my-1">
<div class="form-floating my-1" v-if="!isNoAddress">
<input class="form-control"
type="text"
name="distribution"
@@ -70,7 +70,7 @@
<script>
export default {
name: "AddressMore",
props: ['entity'],
props: ['entity', 'isNoAddress'],
computed: {
floor: {
set(value) {

View File

@@ -75,8 +75,9 @@
</div>
</div>
<address-more v-if="!isNoAddress"
v-bind:entity="entity">
<address-more
v-bind:entity="entity"
v-bind:isNoAddress="isNoAddress">
</address-more>
<action-buttons v-if="insideModal === false"

View File

@@ -210,10 +210,10 @@ export default {
let
type = this.type,
data = {} ;
switch (type) {
case 'person':
data = this.$refs.castPerson.$data.person;
console.log('person data are', data);
break;
case 'thirdparty':
@@ -238,7 +238,7 @@ export default {
if (typeof data.civility !== 'undefined' && null !== data.civility) {
data.civility = data.civility !== null ? {type: 'chill_main_civility', id: data.civility.id} : null;
}
if (typeof data.civility !== 'undefined' && null !== data.profession) {
if (typeof data.profession !== 'undefined' && null !== data.profession) {
data.profession = data.profession !== null ? {type: 'third_party_profession', id: data.profession.id} : null;
}
// console.log('onthefly data', data);

View File

@@ -1,8 +0,0 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% block title %}{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}{% endblock %}
{% block content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% endembed %}
{% endblock content %}

View File

@@ -1,15 +1,8 @@
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %}
{% endblock %}
{% block admin_content %}
<h1>{{ 'Administration interface'|trans }}</h1>
<p>{{ 'Welcome to the admin section !'|trans }}</p>
{{ chill_menu('admin_index', {
'layout': '@ChillMain/Admin/menu_admin_index.html.twig'
}) }}
{% endblock %}

View File

@@ -0,0 +1,13 @@
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_language', {
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}<!-- block content empty -->
<h1>{{ 'Language configuration' |trans }}</h1>
{% endblock %}
{% endblock %}

View File

@@ -0,0 +1,13 @@
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_location', {
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}<!-- block content empty -->
<h1>{{ 'Location configuration' |trans }}</h1>
{% endblock %}
{% endblock %}

View File

@@ -0,0 +1,13 @@
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_user', {
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}<!-- block content empty -->
<h1>{{ 'User configuration' |trans }}</h1>
{% endblock %}
{% endblock %}

View File

@@ -1,12 +1,5 @@
{% extends "@ChillMain/layout.html.twig" %}
{% block navigation_search_bar %}{% endblock %}
{% block navigation_section_menu %}
{{ chill_menu('admin_section', {
'layout': '@ChillMain/Menu/admin.html.twig',
}) }}
{% endblock %}
{% block content %}
{% block admin_content %}<!-- block content empty -->
<div class="container-fluid">

View File

@@ -1,14 +1,44 @@
{% extends "@ChillMain/layoutWithVerticalMenu.html.twig" %}
{% extends "@ChillMain/layout.html.twig" %}
{% block navigation_search_bar %}{% endblock %}
{% block navigation_section_menu %}
{{ chill_menu('admin_section', {
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% block sublayout_content %}
<div class="row admin">
<div class="col-md-9 my-5">
{# Flash messages ! #}
{% if app.session.flashbag.keys()|length > 0 %}
<div class="row justify-content-center mb-5">
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="col-8 alert alert-success flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="col-8 alert alert-danger flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="col-8 alert alert-warning flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
</div>
{% endif %}
{% block admin_content %}
<!-- block admin content empty -->
{% endblock %}
</div>
<div class="col-md-3">
{% block vertical_menu_content %}
{{ chill_menu('admin_section', {
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% endblock %}
</div>
</div>
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}
<!-- block admin content emty -->
{% endblock %}
{% endblock %}

View File

@@ -1,33 +0,0 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_location', {
'layout': '@ChillMain/Admin/menu_admin_location.html.twig',
}) }}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}
<h1>{{ 'Management of location' |trans }}</h1>
{% endblock %}
{% endblock %}

View File

@@ -1,31 +0,0 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_permissions', {
'layout': '@ChillMain/Admin/menu_admin_permissions.html.twig',
}) }}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}<!-- block content empty -->
<h1>{{ 'Permissions management of your chill installation' |trans }}</h1>
{% endblock %}
{% endblock %}

View File

@@ -1,18 +0,0 @@
<div class="{{ 'menu-' ~ menus.name }}">
<ul>
{% for menu in menus %}
<li>
<a class=""
href="{{ menu.uri }}">
<h3>{{ menu.label|trans }}</h3>
{% if menu.extras.explain is defined %}
<div class="" >
{{ menu.extras.explain|trans }}
</div>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>

View File

@@ -1,20 +0,0 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
{% block v_menu_title %}{{ 'Location Menu'|trans }}{% endblock %}

View File

@@ -1,20 +0,0 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
{% block v_menu_title %}{{ 'Permissions Menu'|trans }}{% endblock %}

View File

@@ -1,41 +1,14 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
<li class="nav-link2">
<div class="li-content">
<a href="{{ path('chill_main_admin_central') }}" class="more">Admin Sections</a>
</div>
<ul class="submenu width-15-em" style="padding-left: 0; padding-right: 0; background-color:transparent;">
{% for menu in menus %}
<li style="display:block; background-color: #333333; padding-left:1.5em; border-bottom:1px; border-bottom: 1px solid #FFF;padding-top:0; padding-bottom:0;">
<div style="margin-bottom:2px;">
<div style="font-family: 'Open Sans'; font-weight:300; font-size: 0.75em; text-align:left; height: 46px; display:inline-block; width: calc(100% - 5em - 1px); vertical-align:top;">
<a href="{{ menu.uri }}">{{ menu.label|trans }}</a>
</div>
<div style="background-color: #333333; text-align:center;width: 2em; margin-left:-0.15em; font-size:1.5em; color:#FFF; height: 46px; display:inline-block; vertical-align:top;float:right">{% apply spaceless %}
{% if menu.extras.icons is defined %}
{% for icon in menu.extras.icons %}
<i class="fa fa-{{ icon }}"></i>
{% endfor %}
{% endif %}
{% endapply %}</div>
</div>
</li>
{% endfor %}
</ul>
</li>
<div class="list-group vertical-menu">
{% for menu in menus %}
<a href="{{ menu.uri }}" class="list-group-item list-group-item-action {% if 'class' in menu.attributes|keys %}{{ menu.attributes['class'] }}{% endif %}">
{{ menu.label|trans }}
{% apply spaceless %}
{% if menu.extras.icons is defined %}
{% for icon in menu.extras.icons %}
<span><i class="fa fa-{{ icon }}"></i></span>
{% endfor %}
{% endif %}
{% endapply %}
</a>
{% endfor %}
</div>

View File

@@ -1,8 +1,13 @@
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}{% endblock %}
{% block content %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %}
{% endblock content %}
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Center edit'|trans }}{% endblock %}
@@ -10,11 +10,11 @@
{{ form_row(edit_form.submit, { 'attr' : { 'class' : 'btn btn-chill-green' } } ) }}
{{ form_end(edit_form) }}
<ul class="record_actions">
<li>
<a href="{{ path('admin_center') }}">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('admin_center') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Center list'|trans }}{% endblock %}
@@ -15,27 +15,25 @@
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('admin_center_show', { 'id': entity.id }) }}">{{ entity.name }}</a></td>
<td>{{ entity.name }}</td>
<td>
<ul>
<li>
<a href="{{ path('admin_center_show', { 'id': entity.id }) }}">{{ 'show'|trans }}</a>
</li>
<li>
<a href="{{ path('admin_center_edit', { 'id': entity.id }) }}">{{ 'edit'|trans }}</a>
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('admin_center_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'edit'|trans }}</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul>
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
<li>
<a href="{{ path('admin_center_new') }}">
{{ 'Create a new center'|trans }}
</a>
<a href="{{ path('admin_center_new') }}" class="btn btn-create">{{ 'Create a new center'|trans }}</a>
</li>
</ul>
{% endblock %}
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Center creation'|trans }}{% endblock %}
@@ -10,11 +10,11 @@
{{ form_row(form.submit, { 'attr' : { 'class' : 'btn btn-chill-green' } } ) }}
{{ form_end(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('admin_center') }}">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('admin_center') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -1,29 +0,0 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% block title %}{{ 'Centre %name%'|trans({ '%name%': entity.name }) }}{% endblock %}
{% block admin_content -%}
<h1>{{ 'Centre %name%'|trans({ '%name%': entity.name }) }}</h1>
<table class="record_properties">
<tbody>
<tr>
<th>{{ 'Name'|trans }}</th>
<td>{{ entity.name }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('admin_center') }}">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
<a href="{{ path('admin_center_edit', { 'id': entity.id }) }}">
{{ 'Edit'|trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -0,0 +1,44 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
<th>id</th>
<th>{{ 'name'|trans }}</th>
<th>{{ 'abbreviation'|trans }}</th>
<th>{{ 'active'|trans }}</th>
<th>{{ 'ordering'|trans }}</th>
<th></th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.name|localize_translatable_string }}</td>
<td>{{ entity.abbreviation|localize_translatable_string }}</td>
<td style="text-align:center;">
{%- if entity.active -%}
<i class="fa fa-check-square-o"></i>
{%- else -%}
<i class="fa fa-square-o"></i>
{%- endif -%}
</td>
<td>{{ entity.order }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_main_civility_edit', { 'id': entity.id}) }}" class="btn btn-sm btn-edit btn-mini"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -0,0 +1,36 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
<th>id</th>
<th>{{ 'name'|trans }}</th>
<th>{{ 'Country code'|trans }}</th>
<th></th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.name|localize_translatable_string }}</td>
<td>{{ entity.countrycode }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_main_country_edit', { 'id': entity.id}) }}" class="btn btn-sm btn-edit btn-mini"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -29,6 +29,11 @@
</p>
<p class="country">{{ address.postCode.country.name|localize_translatable_string }}</p>
{% endif %}
{% if address.extra is not empty %}
<span>
{{ address.extra }}
</span>
{% endif %}
<span class="noaddress">
{{ 'address.consider homeless'|trans }}
</span>
@@ -89,6 +94,11 @@
<p class="country">{{ address.postCode.country.name|localize_translatable_string }}</p>
</div>
{% endif %}
{% if address.extra is not empty %}
<div>
{{ address.extra }}
</div>
{% endif %}
<div class="noaddress">
{{ 'address.consider homeless'|trans }}
</div>

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -0,0 +1,34 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
<th>id</th>
<th>{{ 'Name'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.name|localize_translatable_string }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_main_language_edit', { 'id': entity.id}) }}" class="btn btn-sm btn-edit btn-mini"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -1,33 +1,33 @@
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block crud_content_form_rows %}
{{ form_row(form.locationType) }}
{% block crud_content_form_rows %}
<div class="location-form-address">
{{ form_row(form.address) }}
</div>
{{ form_row(form.locationType) }}
{{ form_row(form.name) }}
<div class="location-form-address">
{{ form_row(form.address) }}
</div>
<div class="location-form-contact">
{{ form_row(form.phonenumber1) }}
{{ form_row(form.phonenumber2) }}
{{ form_row(form.email) }}
</div>
{{ form_row(form.name) }}
{% endblock crud_content_form_rows %}
<div class="location-form-contact">
{{ form_row(form.phonenumber1) }}
{{ form_row(form.phonenumber2) }}
{{ form_row(form.email) }}
</div>
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}
{% endblock crud_content_form_rows %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}
{% block js %}
{{ encore_entry_script_tags('mod_input_address') }}

View File

@@ -1,20 +1,16 @@
{% extends "@ChillMain/Admin/layout_location.html.twig" %}
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %}
<h1>{{ 'Location list'|trans }}</h1>
<table class="records_list table table-bordered border-dark">
<thead>
<tr>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Phonenumber1'|trans }}</th>
<th>{{ 'Phonenumber2'|trans }}</th>
<th>{{ 'Email'|trans }}</th>
<th>{{ 'Address'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
</tr>
</thead>
<tbody>
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Phonenumber1'|trans }}</th>
<th>{{ 'Phonenumber2'|trans }}</th>
<th>{{ 'Email'|trans }}</th>
<th>{{ 'Address'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.name }}</td>
@@ -44,17 +40,12 @@
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
{{ chill_pagination(paginator) }}
<ul class="record_actions">
<li>
<a href="{{ path('chill_crud_main_location_new') }}" class="btn btn-create">
{{ 'Create a new location'|trans }}
</a>
</li>
</ul>
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -1,33 +1,33 @@
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block crud_content_form_rows %}
{{ form_row(form.locationType) }}
{% block crud_content_form_rows %}
<div class="location-form-address">
{{ form_row(form.address) }}
</div>
{{ form_row(form.locationType) }}
{{ form_row(form.name) }}
<div class="location-form-address">
{{ form_row(form.address) }}
</div>
<div class="location-form-contact">
{{ form_row(form.phonenumber1) }}
{{ form_row(form.phonenumber2) }}
{{ form_row(form.email) }}
</div>
{{ form_row(form.name) }}
{% endblock crud_content_form_rows %}
<div class="location-form-contact">
{{ form_row(form.phonenumber1) }}
{{ form_row(form.phonenumber2) }}
{{ form_row(form.email) }}
</div>
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}
{% endblock crud_content_form_rows %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}
{% block js %}
{{ encore_entry_script_tags('mod_input_address') }}

View File

@@ -1,14 +1,11 @@
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{# {% as we are in the admin layout, we override the admin content with the CRUD content %} #}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{# we do not have "view" page. We empty the corresponding block #}
{% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -1,21 +1,17 @@
{% extends "@ChillMain/Admin/layout_location.html.twig" %}
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %}
<h1>{{ 'Location type list'|trans }}</h1>
<table class="records_list table table-bordered border-dark">
<thead>
<tr>
<th>{{ 'Title'|trans }}</th>
<th>{{ 'Available for users'|trans }}</th>
<th>{{ 'Editable by users'|trans }}</th>
<th>{{ 'Address required'|trans }}</th>
<th>{{ 'Contact data'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
<th>{{ 'Default for'|trans }}</th>
</tr>
</thead>
<tbody>
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
<th>{{ 'Title'|trans }}</th>
<th>{{ 'Available for users'|trans }}</th>
<th>{{ 'Editable by users'|trans }}</th>
<th>{{ 'Address required'|trans }}</th>
<th>{{ 'Contact data'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
<th>{{ 'Default for'|trans }}</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.title | localize_translatable_string }}</td>
@@ -52,14 +48,12 @@
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
<ul class="record_actions">
<li>
<a href="{{ path('chill_crud_main_location_type_new') }}" class="btn btn-create">
{{ 'Create a new location type'|trans }}
</a>
</li>
</ul>
{% endblock %}
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -1,11 +1,11 @@
{% extends '@ChillMain/Admin/layout.html.twig' %}
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -1,12 +1,12 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}{% endblock %}
{% block admin_content -%}
<h1>{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}</h1>
<h2>{{ 'Details'|trans }}</h2>
{{ form_start(edit_form) }}
{{ form_row(edit_form.name) }}
{% if edit_form.flags is defined %}
@@ -14,28 +14,28 @@
{% endif %}
{{ form_row(edit_form.submit, { 'attr': { 'class': 'btn btn-chill-green' } } ) }}
{{ form_end(edit_form) }}
<h2>{{ 'Grant those permissions'|trans }} :</h2>
{%- if entity.getRoleScopes|length > 0 -%}
{% for title, role_scopes in role_scopes_sorted %}
<h3>{{ title|default("Unclassified")|trans }}</h3>
<table class="striped rounded">
<thead>
<tr>
<th>{{ 'Role'|trans }}</th>
<th>{{ 'Circle'|trans }}</th>
<th>{{ 'Actions'|trans }}</th>
</tr>
</tr>
</thead>
<tbody>
{% for role_scope in role_scopes %}
<tr>
<td>
<span class="role_scope role">{{ role_scope.role|trans }}</span>
<span class="role_scope role">{{ role_scope.role|trans }}</span>
{% if expanded_roles[role_scope.role]|length > 1 %}
<br/>
<small>{{ 'Which implies'|trans }}&nbsp;: {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %}</small>
@@ -56,40 +56,40 @@
{{ form_end(delete_role_scopes_form[role_scope.id]) }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
{%- else -%}
<p>{{ 'This group does not provide any permission'|trans }}</p>
{%- endif -%}
<h2>{{ 'Grant new permissions'|trans }}</h2>
{{ form_start(add_role_scopes_form) }}
{{ form_errors(add_role_scopes_form) }}
{{ form_row(add_role_scopes_form.composed_role_scope.role) }}
{{ form_row(add_role_scopes_form.composed_role_scope.scope) }}
<ul class="record_actions">
<li>
{{ form_row(add_role_scopes_form.submit, { 'attr' : { 'class': 'btn btn-create' } } ) }}
</li>
<li>
<a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}" class="btn btn-see">{{ 'Cancel'|trans }}</a>
</li>
<li>
<a href="{{ path('admin_permissionsgroup') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{{ form_end(add_role_scopes_form) }}
<div class="mt-5">
<h2>{{ 'Grant new permissions'|trans }}</h2>
{{ form_start(add_role_scopes_form) }}
{{ form_errors(add_role_scopes_form) }}
{{ form_row(add_role_scopes_form.composed_role_scope.role) }}
{{ form_row(add_role_scopes_form.composed_role_scope.scope) }}
<ul class="record_actions sticky-form-buttons">
<li>
{{ form_row(add_role_scopes_form.submit, { 'attr' : { 'class': 'btn btn-create' } } ) }}
</li>
<li>
<a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}" class="btn btn-cancel">{{ 'Cancel'|trans }}</a>
</li>
<li>
<a href="{{ path('admin_permissionsgroup') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{{ form_end(add_role_scopes_form) }}
</div>
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Permissions group list'|trans }}{% endblock %}
@@ -15,27 +15,30 @@
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}">{{ entity.name }}</a></td>
<td>{{ entity.name }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}" class="btn btn-see">{{ 'See'|trans }}</a>
</li>
<li>
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a>
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}" class="btn btn-show">{{ 'Show'|trans }}</a>
</li>
<li>
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
<li>
<a href="{{ path('admin_permissionsgroup_new') }}" class="btn btn-create">
{{ 'Create a new permissions group'| trans }}
</a>
</li>
</ul>
{% endblock %}
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'New permission group'|trans }}{% endblock %}
@@ -13,11 +13,11 @@
{{ form_row(form.submit, { 'attr': { 'class': 'btn btn-chill-green' } } ) }}
{{ form_end(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('admin_permissionsgroup') }}">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('admin_permissionsgroup') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}{% endblock %}
@@ -13,9 +13,9 @@
</tr>
</tbody>
</table>
{% if role_scopes_sorted|length > 0 %}
{% if role_scopes_sorted|length > 0 %}
<h2>{{ 'Grant those permissions'|trans }}&nbsp;:</h2>
{% for title, role_scopes in role_scopes_sorted %}
<h3>{{ title|default('Unclassified')|trans }}</h3>
<table class="striped rounded">
@@ -23,14 +23,14 @@
<tr>
<th>{{ 'Role'|trans }}</th>
<th>{{ 'Circle'|trans }}</th>
</tr>
</tr>
</thead>
<tbody>
{% for role_scope in role_scopes %}
<tr>
<td>
{{ role_scope.role|trans }}
{{ role_scope.role|trans }}
{% if expanded_roles[role_scope.role]|length > 1 %}
<br/>
<small>{{ 'Which implies'|trans }}&nbsp;: {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %}</small>
@@ -47,16 +47,17 @@
</tbody>
</table>
{% endfor %}
{% else %}
<p>{{ 'This group does not provide any permission'|trans }}.
<p>{{ 'This group does not provide any permission'|trans }}.
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}">
{{ 'add permissions'|trans|capitalize }}</a></p>
{{ 'add permissions'|trans|capitalize }}
</a>
</p>
{% endif %}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li>
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}" class="btn btn-edit">
{{ 'Edit'|trans }}

View File

@@ -1,20 +1,20 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Circle edit'|trans }}{% endblock %}
{% block admin_content -%}
{% block admin_content %}
<h1>{{ 'Circle edit'|trans }}</h1>
{{ form_start(edit_form) }}
{{ form_row(edit_form.name) }}
{{ form_row(edit_form.submit, { 'attr' : { 'class' : 'btn btn-chill-green' } } ) }}
{{ form_end(edit_form) }}
<ul class="record_actions">
<li>
<a href="{{ path('admin_scope') }}">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('admin_scope') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'List circles'|trans }}{% endblock %}
@@ -15,27 +15,25 @@
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('admin_scope_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
<td>{{ entity.name|localize_translatable_string }}</td>
<td>
<ul>
<li>
<a href="{{ path('admin_scope_show', { 'id': entity.id }) }}">{{ 'show'|trans }}</a>
</li>
<li>
<a href="{{ path('admin_scope_edit', { 'id': entity.id }) }}">{{ 'edit'|trans }}</a>
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('admin_scope_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'edit'|trans }}</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul>
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
<li>
<a href="{{ path('admin_scope_new') }}">
{{ 'Create a new circle'|trans }}
</a>
<a href="{{ path('admin_scope_new') }}" class="btn btn-create">{{ 'Create a new circle'|trans }}</a>
</li>
</ul>
{% endblock %}
{% endblock %}

View File

@@ -1,8 +1,8 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Circle creation'|trans }}{% endblock %}
{% block admin_content -%}
{% block admin_content %}
<h1>{{ 'Circle creation'|trans }}</h1>
{{ form_start(form) }}
@@ -10,11 +10,11 @@
{{ form_row(form.submit, { 'attr' : { 'class' : 'btn btn-chill-green' } } ) }}
{{ form_end(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('admin_scope') }}">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('admin_scope') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -1,29 +0,0 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% block title %}{{ 'Circle'|trans }}{% endblock %}
{% block admin_content -%}
<h1>{{ 'Circle'|trans }}</h1>
<table class="record_properties">
<tbody>
<tr>
<th>{{ 'Name'|trans }}</th>
<td>{{ entity.name|localize_translatable_string }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('admin_scope') }}">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
<a href="{{ path('admin_scope_edit', { 'id': entity.id }) }}">
{{ 'Edit'| trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content -%}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}

View File

@@ -1,4 +1,4 @@
{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Edit password for %username%'|trans( { '%username%': entity.username } ) }}{% endblock %}

View File

@@ -1,8 +1,11 @@
{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content -%}
{% block admin_content %}
<h1>{{"Users"|trans}}</h1>
{{ filter_order|chill_render_filter_order_helper }}
{% for entity in entities %}
<div class="flex-table">
<div class="item-bloc">
@@ -60,6 +63,9 @@
{{ chill_pagination(paginator) }}
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
<li>
<a href="{{ path('chill_crud_admin_user_new') }}" class="btn btn-create">{{ 'Create'|trans }}</a>
</li>

View File

@@ -1,6 +1,6 @@
{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content -%}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}

View File

@@ -1,8 +1,8 @@
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'User %username%'|trans({ '%username%': entity.username }) }}{% endblock %}
{% block admin_content -%}
{% block admin_content %}
<h1>{{ 'User %username%'|trans({ '%username%': entity.username }) }}</h1>
<table class="record_properties">
@@ -23,9 +23,9 @@
</tr>
</tbody>
</table>
<h2>{{ 'Permissions granted'|trans }}</h2>
{% if entity.groupcenters|length > 0 %}
<table>
<thead>
@@ -52,7 +52,7 @@
{% endfor %}
</tbody>
</table>
{% else %}
<p>{{ 'Any permissions granted to this user'|trans }}.
<a href="{{ path('admin_user_edit', { 'id': entity.id }) }}">

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -1,10 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block content %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
<th>id</th>
<th>label</th>
<th>{{ 'label'|trans }}</th>
<th>{{ 'active'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
@@ -12,6 +13,13 @@
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.label|localize_translatable_string }}</td>
<td style="text-align:center;">
{%- if entity.active -%}
<i class="fa fa-check-square-o"></i>
{%- else -%}
<i class="fa fa-square-o"></i>
{%- endif -%}
</td>
<td>
<ul class="record_actions">
<li>
@@ -20,7 +28,13 @@
</ul>
</td>
</tr>
{% endfor %}
{% endfor %}
{% endblock %}
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %}
{% endblock content %}
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -36,33 +36,35 @@
{# Flash messages ! #}
{% if app.session.flashbag.keys()|length > 0 %}
<div class="col-8 mb-5 flash_message">
<div class="row justify-content-center">
<div class="col-10 mb-5 flash_message">
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="alert alert-danger flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="alert alert-warning flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="alert alert-danger flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('notice') %}
<div class="alert alert-warning flash_message">
<span>{{ flashMessage|raw }}</span>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% block content %}
<div class="col-8 main_search">
<h2>{{ 'Search'|trans }}</h2>
<form action="{{ path('chill_main_search') }}" method="get">
<input class="form-control form-control-lg" name="q" type="search" placeholder="{{ 'Search persons, ...'|trans }}" />
<center>
@@ -75,11 +77,11 @@
</center>
</form>
</div>
{# DISABLED {{ chill_widget('homepage', {} ) }} #}
{% include '@ChillMain/Homepage/index.html.twig' %}
{% endblock %}
</div>

View File

@@ -0,0 +1,58 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Routing\MenuBuilder;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
class AdminLanguageMenuBuilder implements LocalMenuBuilderInterface
{
/**
* @var AuthorizationCheckerInterface
*/
protected $authorizationChecker;
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
{
$this->authorizationChecker = $authorizationChecker;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
// all the entries below must have ROLE_ADMIN permissions
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
return;
}
$menu->addChild('Languages and countries', [
'route' => 'chill_main_language_admin',
])
->setAttribute('class', 'list-group-item-header')
->setExtras([
'order' => 1200,
'icons' => ['globe-w'],
]);
$menu->addChild('Language list', [
'route' => 'chill_crud_main_language_index',
])->setExtras(['order' => 1210]);
$menu->addChild('Country list', [
'route' => 'chill_crud_main_country_index',
])->setExtras(['order' => 1220]);
}
public static function getMenuIds(): array
{
return ['admin_section', 'admin_language'];
}
}

View File

@@ -15,7 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
class AdminSectionMenuBuilder implements LocalMenuBuilderInterface
class AdminLocationMenuBuilder implements LocalMenuBuilderInterface
{
/**
* @var AuthorizationCheckerInterface
@@ -34,27 +34,26 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface
return;
}
$menu->addChild('Users and permissions', [
'route' => 'chill_main_admin_permissions',
$menu->addChild('Location and location type', [
'route' => 'chill_main_location_admin',
])
->setAttribute('class', 'list-group-item-header')
->setExtras([
'icons' => ['key'],
'order' => 200,
'explain' => 'Configure permissions for users',
'order' => 1300,
'icons' => ['map-marker'],
]);
$menu->addChild('Location and location type', [
'route' => 'chill_main_admin_locations',
])
->setExtras([
'icons' => ['key'],
'order' => 205,
'explain' => 'Configure location and location type',
]);
$menu->addChild('Location type list', [
'route' => 'chill_crud_main_location_type_index',
])->setExtras(['order' => 1310]);
$menu->addChild('Location list', [
'route' => 'chill_crud_main_location_index',
])->setExtras(['order' => 1320]);
}
public static function getMenuIds(): array
{
return ['admin_section', 'admin_index'];
return ['admin_section', 'admin_location'];
}
}

View File

@@ -0,0 +1,71 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Routing\MenuBuilder;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
class AdminUserMenuBuilder implements LocalMenuBuilderInterface
{
/**
* @var AuthorizationCheckerInterface
*/
protected $authorizationChecker;
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
{
$this->authorizationChecker = $authorizationChecker;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
// all the entries below must have ROLE_ADMIN permissions
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
return;
}
$menu->addChild('Users and permissions', [
'route' => 'chill_main_user_admin',
])
->setAttribute('class', 'list-group-item-header')
->setExtras([
'order' => 1000,
'icons' => ['key'],
]);
$menu->addChild('Center list', [
'route' => 'admin_center',
])->setExtras(['order' => 1010]);
$menu->addChild('List circles', [
'route' => 'admin_scope',
])->setExtras(['order' => 1020]);
$menu->addChild('Permissions group list', [
'route' => 'admin_permissionsgroup',
])->setExtras(['order' => 1030]);
$menu->addChild('crud.admin_user.index.title', [
'route' => 'chill_crud_admin_user_index',
])->setExtras(['order' => 1040]);
$menu->addChild('User jobs', [
'route' => 'chill_crud_admin_user_job_index',
])->setExtras(['order' => 1050]);
}
public static function getMenuIds(): array
{
return ['admin_section', 'admin_user'];
}
}

View File

@@ -1,33 +0,0 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Routing\MenuBuilder;
use Knp\Menu\MenuItem;
class LocationMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
{
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
$menu->addChild('Location type list', [
'route' => 'chill_crud_main_location_type_index',
])->setExtras(['order' => 205]);
$menu->addChild('Location list', [
'route' => 'chill_crud_main_location_index',
])->setExtras(['order' => 206]);
}
public static function getMenuIds(): array
{
return ['admin_location'];
}
}

View File

@@ -1,47 +0,0 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Routing\MenuBuilder;
use Knp\Menu\MenuItem;
class PermissionMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
{
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
$menu->addChild('Permissions group list', [
'route' => 'admin_permissionsgroup',
])->setExtras([
'order' => 300,
]);
$menu->addChild('crud.admin_user.index.title', [
'route' => 'chill_crud_admin_user_index',
])->setExtras(['order' => 400]);
$menu->addChild('List circles', [
'route' => 'admin_scope',
])->setExtras(['order' => 200]);
$menu->addChild('Center list', [
'route' => 'admin_center',
])->setExtras(['order' => 100]);
$menu->addChild('User jobs', [
'route' => 'chill_crud_admin_user_job_index',
])->setExtras(['order' => 150]);
}
public static function getMenuIds(): array
{
return ['admin_permissions'];
}
}

View File

@@ -53,7 +53,7 @@ final class CenterControllerTest extends WebTestCase
);
// Edit the entity
$crawler = $client->click($crawler->selectLink('Modifier')->link());
$crawler = $client->click($crawler->selectLink('modifier')->link());
$form = $crawler->selectButton('Mettre à jour')->form([
'chill_mainbundle_center[name]' => 'Foo',

View File

@@ -61,7 +61,7 @@ final class ScopeControllerTest extends WebTestCase
);
// Edit the entity
$crawler = $client->click($crawler->selectLink('Modifier')->link());
$crawler = $client->click($crawler->selectLink('modifier')->link());
$form = $crawler->selectButton('Mettre à jour')->form([
'chill_mainbundle_scope[name][fr]' => 'Foo',

View File

@@ -62,13 +62,6 @@ chill_main_homepage:
# order: 0
# label: Main admin menu
#
chill_main_admin_permissions:
path: /{_locale}/admin/permissions
controller: Chill\MainBundle\Controller\AdminController::indexPermissionsAction
chill_main_admin_locations:
path: /{_locale}/admin/locations
controller: Chill\MainBundle\Controller\AdminController::indexLocationsAction
chill_main_search:
path: /{_locale}/search.{_format}

View File

@@ -2,10 +2,6 @@ admin_center:
path: /
controller: Chill\MainBundle\Controller\CenterController::indexAction
admin_center_show:
path: /{id}/show
controller: Chill\MainBundle\Controller\CenterController::showAction
admin_center_new:
path: /new
controller: Chill\MainBundle\Controller\CenterController::newAction

View File

@@ -2,10 +2,6 @@ admin_scope:
path: /
controller: Chill\MainBundle\Controller\ScopeController::indexAction
admin_scope_show:
path: /{id}/show
controller: Chill\MainBundle\Controller\ScopeController::showAction
admin_scope_new:
path: /new
controller: Chill\MainBundle\Controller\ScopeController::newAction

View File

@@ -17,9 +17,3 @@ services:
autoconfigure: true
tags:
- { name: 'chill.menu_builder' }
Chill\MainBundle\Routing\MenuBuilder\AdminSectionMenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
tags:
- { name: 'chill.menu_builder' }

View File

@@ -0,0 +1,49 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Add 3 fields on AddressReference.
*/
final class Version20220325134944 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_main_address_reference DROP createdAt');
$this->addSql('ALTER TABLE chill_main_address_reference DROP deletedAt');
$this->addSql('ALTER TABLE chill_main_address_reference DROP updatedAt');
$this->addSql('DROP INDEX address_refid');
$this->addSql('create index address_refid
on chill_main_address_reference (refid)
where ((refid)::text <> \'\'::text)');
}
public function getDescription(): string
{
return 'Add 3 fields on AddressReference';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_main_address_reference ADD createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE chill_main_address_reference ADD deletedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE chill_main_address_reference ADD updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN chill_main_address_reference.createdAt IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_main_address_reference.deletedAt IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_main_address_reference.updatedAt IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('DROP INDEX address_refid');
$this->addSql('CREATE INDEX address_refid ON chill_main_address_reference (refId)');
}
}

View File

@@ -0,0 +1,37 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220506131307 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX chill_internal_address_reference_canonicalized');
$this->addSql('create index chill_internal_address_reference_canonicalized
on chill_main_address_reference using gist (postcode_id, addresscanonical gist_trgm_ops);');
}
public function getDescription(): string
{
return 'Adapt search index on address reference canonicalized';
}
public function up(Schema $schema): void
{
$this->addSql('DROP INDEX chill_internal_address_reference_canonicalized');
$this->addSql('create index chill_internal_address_reference_canonicalized
on chill_main_address_reference using gist (postcode_id, addresscanonical gist_trgm_ops) WHERE deletedat IS NULL;');
}
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220506145935 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX search_by_reference_code');
}
public function getDescription(): string
{
return 'Add index to search postal code by references';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE INDEX search_by_reference_code ON chill_main_postal_code (code, refpostalcodeid)');
}
}

View File

@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220513151853 extends AbstractMigration
{
public function getDescription(): string
{
return 'set default on attributes';
}
public function up(Schema $schema): void
{
$this->addSql('update users set attributes = \'[]\'::json where attributes IS NULL');
}
public function down(Schema $schema): void
{
}
}

View File

@@ -1,4 +0,0 @@
welcome_message_raw: |
<p>Dans l'interface d'administration, vous pouvez configurer votre instance selon vos besoins.</p>

View File

@@ -121,6 +121,10 @@ Main admin menu: Menu d'administration principal
Actions: Actions
Users and permissions: Utilisateurs et permissions
Location and location type: Localisations et types de localisation
Back to the admin: Menu d'administration
"Administration interface": Interface d'administration
Welcome to the admin section !: >
Bienvenue dans l'interface d'administration !
#permissions
Permissions Menu: Gestion des droits
@@ -130,11 +134,6 @@ Permissions management of your chill installation: Gestion des permissions de vo
Location Menu: Localisations et types de localisation
Management of location: Gestion des localisations et types de localisation
#admin section
"Administration interface": Interface d'administration
Welcome to the admin section !: >
Bienvenue dans l'interface d'administration !
#admin section for center's administration
Create a new center: Créer un nouveau centre
Center list: Liste des centres
@@ -150,7 +149,7 @@ Permission group "%name%": Groupe de permissions "%name%"
Grant those permissions: Attribue ces permissions
Which implies: Ce qui implique
Permission group: Groupe de permissions
Permissionsgroup: Group de permissions
Permissionsgroup: Groupe de permissions
New permission group: Nouveau groupe de permissions
PermissionsGroup "%name%" edit: Modification du groupe de permission '%name%'
Role: Rôle
@@ -159,8 +158,10 @@ Add permission: Ajouter les permissions
This group does not provide any permission: Ce groupe n'attribue aucune permission
The role '%role%' has been removed: Le rôle "%role%" a été enlevé de ce groupe de permission
The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission
Unclassified: Non classifié
#admin section for users
User configuration: Gestion des utilisateurs
User edit: Modification d'un utilisateur
User'status: Statut de l'utilisateur
Disabled, the user is not allowed to login: Désactivé, l'utilisateur n'est pas autorisé à se connecter
@@ -182,6 +183,14 @@ Change password: Changer le mot de passe
Back to the user edition: Retour au formulaire d'édition
Password successfully updated!: Mot de passe mis à jour
Flags: Drapeaux
Main location: Localisation principale
Main scope: Cercle
Main center: Centre
user job: Métier de l'utilisateur
Choose a main center: Choisir un centre
Choose a main scope: Choisir un cercle
choose a job: Choisir un métier
choose a location: Choisir une localisation
# admin section for users jobs
User jobs: Métiers
@@ -218,12 +227,24 @@ Location list: Liste des localisations
Location type: Type de localisation
Phonenumber1: Numéro de téléphone
Phonenumber2: Autre numéro de téléphone
Configure location and location type: Configuration des localisations
Location configuration: Configuration des localisations
Default for: Type de localisation par défaut pour
none: aucun
person: usager
thirdparty: tiers
#admin section for civility
abbreviation: abbréviation
#admin section for language and country
Language and countries menu: Menu Langues & Pays
Languages and countries: Langues & Pays
Management of languages and countries: Gestion des langues & pays
Language configuration: Configuration des langues & pays
Language list: Liste des langues
Country list: Liste des pays
Country code: Code du pays
# circles / scopes
Choose the circle: Choisir le cercle
Scopes: Services
@@ -333,6 +354,8 @@ crud:
index:
title: Utilisateurs
add_new: Créer
title_edit: Modifier un utilisateur
title_new: Créer un utilisateur
admin_user_job:
index:
title: Métiers
@@ -340,11 +363,35 @@ crud:
title_new: Nouveau métier
title_edit: Modifier un métier
main_location_type:
index:
title: Liste des types de localisations
add_new: Ajouter un type de localisation
title_new: Nouveau type de localisation
title_edit: Modifier un type de localisation
main_location:
index:
title: Liste des localisations
add_new: Ajouter une localisation
title_new: Nouvelle localisation
title_edit: Modifier une localisation
main_language:
index:
title: Liste des langues
add_new: Ajouter une langue
title_new: Nouvelle langue
title_edit: Modifier une langue
main_country:
index:
title: Liste des pays
add_new: Ajouter un pays
title_new: Nouveau pays
title_edit: Modifier un pays
main_civility:
index:
title: Liste des civilités
add_new: Ajouter une civilité
title_new: Nouvelle civilité
title_edit: Modifier une civilité
No entities: Aucun élément