.*.un~
*~
+*.deadcode
+*.orig
//Set the context
$this->context = [
- 'head' => [
- 'alternates' => $alternates,
- 'canonical' => $canonical,
- 'icon' => $this->config['icon'],
- 'keywords' => null,
- 'locale' => str_replace('_', '-', $this->locale),
- 'logo' => [
- 'png' => $this->config['logo']['png'],
- 'svg' => $this->config['logo']['svg'],
- 'alt' => $this->translator->trans($this->config['logo']['alt'])
- ],
- 'root' => $this->config['root'],
- 'site' => $this->translator->trans($this->config['title']),
- 'title' => null,
- 'facebook' => [
- 'og:type' => 'article',
- 'og:site_name' => $this->translator->trans($this->config['title']),
- 'og:url' => $canonical,
- //TODO: review this value
- 'fb:app_id' => $this->config['facebook']['apps']
- ],
- 'fbimage' => [
- 'texts' => [
- $this->translator->trans($this->config['title']) => [
- 'font' => 'irishgrover',
- 'size' => 110
- ]
- ]
- ]
- ],
+ 'alternates' => $alternates,
+ 'canonical' => $canonical,
'contact' => [
'address' => $this->config['contact']['address'],
'name' => $this->translator->trans($this->config['contact']['name'])
'short' => $this->translator->trans($this->config['copy']['short']),
'title' => $this->config['copy']['title']
],
- 'forms' => [],
'description' => null,
- 'section' => null,
- 'title' => null
+ 'donate' => $this->config['donate'],
+ 'facebook' => [
+ 'og:type' => 'article',
+ 'og:site_name' => $title = $this->translator->trans($this->config['title']),
+ 'og:url' => $canonical,
+ #'fb:admins' => $this->config['facebook']['admins'],
+ 'fb:app_id' => $this->config['facebook']['apps']
+ ],
+ //XXX: TODO: only generate it when fb robot request the url ???
+ 'fbimage' => [
+ 'texts' => [
+ $title => [
+ //'font' => 'irishgrover',
+ //'size' => 110
+ ]
+ ]
+ ],
+ 'forms' => [],
+ 'icon' => $this->config['icon'],
+ 'keywords' => null,
+ 'locale' => str_replace('_', '-', $this->locale),
+ #'logo' => [
+ # 'png' => $this->config['logo']['png'],
+ # 'svg' => $this->config['logo']['svg'],
+ # 'alt' => $this->translator->trans($this->config['logo']['alt'])
+ #],
+ 'logo' => $this->config['logo'],
+ 'next' => null,
+ 'prev' => null,
+ 'root' => $this->config['root'],
+ 'title' => [
+ 'page' => null,
+ 'section' => null,
+ 'site' => $title
+ ]
];
}
$response ??= new Response();
//Without alternates
- if (empty($parameters['head']['alternates'])) {
+ if (count($parameters['alternates']) <= 1) {
//Iterate on locales excluding current one
foreach($this->config['locales'] as $locale) {
//Set routeParams
}
//Set locale locales context
- $parameters['head']['alternates'][str_replace('_', '-', $locale)] = [
+ $parameters['alternates'][str_replace('_', '-', $locale)] = [
'absolute' => $this->router->generate($this->route, $routeParams, UrlGeneratorInterface::ABSOLUTE_URL),
'relative' => $this->router->generate($this->route, $routeParams),
'title' => implode('/', $titles),
];
//Add shorter locale
- if (empty($parameters['head']['alternates'][$shortCurrent = substr($locale, 0, 2)])) {
+ if (empty($parameters['alternates'][$shortCurrent = substr($locale, 0, 2)])) {
//Set locale locales context
- $parameters['head']['alternates'][$shortCurrent] = $parameters['head']['alternates'][str_replace('_', '-', $locale)];
+ $parameters['alternates'][$shortCurrent] = $parameters['alternates'][str_replace('_', '-', $locale)];
}
//Add shorter locale
- } elseif (empty($parameters['head']['alternates'][$shortCurrent = substr($locale, 0, 2)])) {
+ } elseif (empty($parameters['alternates'][$shortCurrent = substr($locale, 0, 2)])) {
//Set titles
$titles = [];
}
//Set locale locales context
- $parameters['head']['alternates'][$shortCurrent] = [
+ $parameters['alternates'][$shortCurrent] = [
'absolute' => $this->router->generate($this->route, $routeParams, UrlGeneratorInterface::ABSOLUTE_URL),
'relative' => $this->router->generate($this->route, $routeParams),
'title' => implode('/', $titles),
}
}
- //With empty head title and section
- if (empty($parameters['head']['title']) && !empty($parameters['section'])) {
- //Set head title
- $parameters['head']['title'] = implode(' - ', [$parameters['title'], $parameters['section'], $parameters['head']['site']]);
- //With empty head title
- } elseif (empty($parameters['head']['title'])) {
- //Set head title
- $parameters['head']['title'] = implode(' - ', [$parameters['title'], $parameters['head']['site']]);
- }
-
- //With empty head description and description
- if (empty($parameters['head']['description']) && !empty($parameters['description'])) {
- //Set head description
- $parameters['head']['description'] = $parameters['description'];
+ //With canonical
+ if (!empty($parameters['canonical'])) {
+ //Set facebook url
+ $parameters['facebook']['og:url'] = $parameters['canonical'];
}
//With empty facebook title and title
- if (empty($parameters['head']['facebook']['og:title']) && !empty($parameters['title'])) {
+ if (empty($parameters['facebook']['og:title']) && !empty($parameters['title']['page'])) {
//Set facebook title
- $parameters['head']['facebook']['og:title'] = $parameters['title'];
+ $parameters['facebook']['og:title'] = $parameters['title']['page'];
}
//With empty facebook description and description
- if (empty($parameters['head']['facebook']['og:description']) && !empty($parameters['description'])) {
+ if (empty($parameters['facebook']['og:description']) && !empty($parameters['description'])) {
//Set facebook description
- $parameters['head']['facebook']['og:description'] = $parameters['description'];
+ $parameters['facebook']['og:description'] = $parameters['description'];
}
//With locale
if (!empty($this->locale)) {
//Set facebook locale
- $parameters['head']['facebook']['og:locale'] = $this->locale;
+ $parameters['facebook']['og:locale'] = $this->locale;
//With alternates
//XXX: locale change when fb_locale=xx_xx is provided is done in FacebookSubscriber
//XXX: see https://stackoverflow.com/questions/20827882/in-open-graph-markup-whats-the-use-of-oglocalealternate-without-the-locati
- if (!empty($parameters['head']['alternates'])) {
+ if (!empty($parameters['alternates'])) {
//Iterate on alternates
- foreach($parameters['head']['alternates'] as $lang => $alternate) {
+ foreach($parameters['alternates'] as $lang => $alternate) {
if (strlen($lang) == 5) {
//Set facebook locale alternate
- $parameters['head']['facebook']['og:locale:alternate'] = str_replace('-', '_', $lang);
+ $parameters['facebook']['og:locale:alternate'] = str_replace('-', '_', $lang);
}
}
}
}
+ //Without facebook image defined and texts
+ if (empty($parameters['facebook']['og:image']) && !empty($this->request) && !empty($parameters['fbimage']['texts']) && !empty($this->modified)) {
+ //Get facebook image
+ //XXX: decode getPathInfo (see https://github.com/symfony/symfony/issues/2579)
+ $parameters['facebook'] += $this->image->getFacebook(urldecode($this->request->getPathInfo()), $parameters['fbimage']['texts'], $this->modified->getTimestamp());
+ }
+
//With count
if (!empty($this->count)) {
//With prev link
if ($this->page > 0) {
//Set head prev
- $parameters['head']['prev'] = $this->generateUrl($this->request->get('_route'), ['page' => $this->page - 1]+$this->request->get('_route_params'));
+ $parameters['prev'] = $this->generateUrl($this->request->get('_route'), ['page' => $this->page - 1]+$this->request->get('_route_params'));
}
//With next link
if ($this->count > ($this->page + 1) * $this->limit) {
//Set head next
- $parameters['head']['next'] = $this->generateUrl($this->request->get('_route'), ['page' => $this->page + 1]+$this->request->get('_route_params'));
+ $parameters['next'] = $this->generateUrl($this->request->get('_route'), ['page' => $this->page + 1]+$this->request->get('_route_params'));
}
}
- //Without facebook image defined and texts
- if (empty($parameters['head']['facebook']['og:image']) && !empty($this->request) && !empty($parameters['head']['fbimage']['texts']) && !empty($this->modified)) {
- //Get facebook image
- $parameters['head']['facebook'] += $this->facebook->getImage($this->request->getPathInfo(), $parameters['head']['fbimage']['texts'], $this->modified->getTimestamp());
- }
-
//Call twig render method
$content = $this->twig->render($view, $parameters);
);
//Set title
- $this->context['title'] = $this->translator->trans('Articles list');
+ $this->context['title']['page'] = $this->translator->trans('Articles list');
//Set description
$this->context['description'] = $this->translator->trans('Welcome to raphaël\'s developer diary article listing');
//With invalid slug
if ($slug !== $this->context['article']['slug']) {
//Redirect on correctly spelled article
- return $this->redirectToRoute('rapsys_blog_article_view', ['id' => $this->context['article']['id'], 'slug' => $this->context['article']['slug']], Response::HTTP_MOVED_PERMANENTLY);
+ return $this->redirectToRoute('rapsysblog_article_view', ['id' => $this->context['article']['id'], 'slug' => $this->context['article']['slug']], Response::HTTP_MOVED_PERMANENTLY);
}
//Set modified
);
//Set title
- $this->context['title'] = $this->context['article']['title'];
+ $this->context['title']['page'] = $this->context['article']['title'];
//Set description
$this->context['description'] = $this->context['article']['description'];
*/
public function about(Request $request): Response {
//Set page
- $this->context['title'] = $this->translator->trans('About');
+ $this->context['title']['page'] = $this->translator->trans('About');
//Set description
$this->context['description'] = $this->translator->trans('Welcome to raphaël\'s developer diary about page');
*/
public function contact(Request $request): Response {
//Set title
- $this->context['title'] = $this->translator->trans('Contact');
+ $this->context['title']['page'] = $this->translator->trans('Contact');
//Set description
$this->context['description'] = $this->translator->trans('Welcome to raphaël\'s developer diary contact page');
//Create the form according to the FormType created previously.
//And give the proper parameters
- $form = $this->createForm('Rapsys\BlogBundle\Form\ContactType', $data, [
- 'action' => $this->generateUrl('rapsys_blog_contact'),
+ $form = $this->createForm('Rapsys\PackBundle\Form\ContactType', $data, [
+ 'action' => $this->generateUrl('rapsysblog_contact'),
'method' => 'POST'
]);
//Send message
$this->mailer->send($message);
+ //Add verification notice
+ $this->addFlash('notice', $this->translator->trans('Your message has been sent'));
+
//Redirect on the same route with sent=1 to cleanup form
- return $this->redirectToRoute($request->get('_route'), ['sent' => 1]+$request->get('_route_params'));
+ return $this->redirectToRoute($request->get('_route'), $request->get('_route_params'));
//Catch obvious transport exception
} catch(TransportExceptionInterface $e) {
//Add error message mail unreachable
}
//Render template
- return $this->render('@RapsysBlog/form/contact.html.twig', ['contact' => $form->createView(), 'sent' => $request->query->get('sent', 0)]+$this->context, $response);
+ return $this->render('@RapsysBlog/form/contact.html.twig', ['contact' => $form->createView()]+$this->context, $response);
}
/**
);
//Set title
- $this->context['title'] = $this->translator->trans('Home');
+ $this->context['title']['page'] = $this->translator->trans('Home');
//Set description
$this->context['description'] = $this->translator->trans('Welcome to raphaël\'s developer diary');
);
//Set title
- $this->context['title'] = $this->translator->trans('Keywords list');
+ $this->context['title']['page'] = $this->translator->trans('Keywords list');
//Set description
$this->context['description'] = $this->translator->trans('Welcome to raphaël\'s developer diary keyword listing');
//With invalid slug
if ($slug !== $this->context['keyword']['slug']) {
//Redirect on correctly spelled keyword
- return $this->redirectToRoute('rapsys_blog_keyword_view', ['id' => $this->context['keyword']['id'], 'slug' => $this->context['keyword']['slug']], Response::HTTP_MOVED_PERMANENTLY);
+ return $this->redirectToRoute('rapsysblog_keyword_view', ['id' => $this->context['keyword']['id'], 'slug' => $this->context['keyword']['slug']], Response::HTTP_MOVED_PERMANENTLY);
}
//Set modified
);
//Set title
- $this->context['title'] = $this->context['keyword']['title'];
+ $this->context['title']['page'] = $this->context['keyword']['title'];
//Set description
$this->context['description'] = $this->context['keyword']['description'];
);
//Set title
- $this->context['title'] = $this->translator->trans('Users list');
+ $this->context['title']['page'] = $this->translator->trans('Users list');
//Set description
$this->context['description'] = $this->translator->trans('Welcome to raphaël\'s developer diary user listing');
//With invalid slug
if ($slug !== $this->context['user']['slug']) {
//Redirect on correctly spelled user
- return $this->redirectToRoute('rapsys_blog_user_view', ['id' => $this->context['user']['id'], 'slug' => $this->context['user']['slug']], Response::HTTP_MOVED_PERMANENTLY);
+ return $this->redirectToRoute('rapsysblog_user_view', ['id' => $this->context['user']['id'], 'slug' => $this->context['user']['slug']], Response::HTTP_MOVED_PERMANENTLY);
}
//Set modified
);
//Set title
- $this->context['title'] = $this->context['user']['pseudonym'];
+ $this->context['title']['page'] = $this->context['user']['pseudonym'];
//Set description
//TODO: Add user creation ? Add a description field ?
//TODO: copy to '%kernel.translator.fallbacks%'
'locales' => [ 'en_gb' ],
'logo' => [
+ 'alt' => 'John Doe\'s blog logo',
'png' => '@RapsysBlog/png/logo.png',
- 'svg' => '@RapsysBlog/svg/logo.svg',
- 'alt' => 'John Doe\'s blog logo'
+ 'svg' => '@RapsysBlog/svg/logo.svg'
],
'path' => is_link(($prefix = is_dir('public') ? './public/' : './').($link = 'bundles/'.str_replace('_', '', $alias))) && is_dir(realpath($prefix.$link)) || is_dir($prefix.$link) ? $link : dirname(__DIR__).'/Resources/public',
- 'root' => 'rapsys_blog',
+ 'root' => 'rapsysblog',
'title' => 'John Doe\'s blog',
];
->arrayNode('logo')
->addDefaultsIfNotSet()
->children()
+ ->scalarNode('alt')->defaultValue($defaults['logo']['alt'])->end()
->scalarNode('png')->defaultValue($defaults['logo']['png'])->end()
->scalarNode('svg')->defaultValue($defaults['logo']['svg'])->end()
- ->scalarNode('alt')->defaultValue($defaults['logo']['alt'])->end()
->end()
->end()
->scalarNode('path')->defaultValue($defaults['path'])->end()
*/
public function prepend(ContainerBuilder $container): void {
//Process the configuration
- $configs = $container->getExtensionConfig($this->getAlias());
+ $configs = $container->getExtensionConfig($alias = $this->getAlias());
//Load configuration
$configuration = $this->getConfiguration($configs, $container);
//Detect when no user configuration is provided
if ($configs === [[]]) {
//Prepend default config
- $container->prependExtensionConfig($this->getAlias(), $config);
+ $container->prependExtensionConfig($alias, $config);
}
//Save configuration in parameters
- $container->setParameter($this->getAlias(), $config);
+ $container->setParameter($alias, $config);
//Store flattened array in parameters
- //XXX: don't flatten rapsys_blog.icon.png key which is required to be an array
- foreach($this->flatten($config, $this->getAlias(), 10, '.', ['rapsys_blog.contact', 'rapsys_blog.copy', 'rapsys_blog.icon', 'rapsys_blog.icon.png', 'rapsys_blog.logo', 'rapsys_blog.facebook.apps', 'rapsys_blog.locales', 'rapsys_blog.languages']) as $k => $v) {
+ //XXX: don't flatten rapsysblog.icon.png key which is required to be an array
+ foreach($this->flatten($config, $alias, 10, '.', ['rapsysblog.contact', 'rapsysblog.copy', 'rapsysblog.icon', 'rapsysblog.icon.png', 'rapsysblog.logo', 'rapsysblog.facebook.apps', 'rapsysblog.locales', 'rapsysblog.languages']) as $k => $v) {
$container->setParameter($k, $v);
}
+
+ //Set rapsysair.alias key
+ $container->setParameter($alias.'.alias', $alias);
+
+ //Set rapsysair.version key
+ $container->setParameter($alias.'.version', RapsysBlogBundle::getVersion());
}
/**
/**
* {@inheritDoc}
*/
- public function load(ObjectManager $manager) {
+ public function load(ObjectManager $manager): void {
//Civility tree
$civilityTree = [
'Mister',
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
-class ArticleType extends AbstractType
-{
- /**
- * {@inheritdoc}
- */
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder->add('created')->add('updated')->add('site')->add('author')->add('keywords');
- }
-
- /**
- * {@inheritdoc}
- */
- public function configureOptions(OptionsResolver $resolver)
- {
- $resolver->setDefaults(array(
- 'data_class' => 'Rapsys\BlogBundle\Entity\Article'
- ));
- }
+class ArticleType extends AbstractType {
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options): void {
+ $builder->add('created')->add('updated')->add('site')->add('author')->add('keywords');
+ }
- /**
- * {@inheritdoc}
- */
- public function getBlockPrefix()
- {
- return 'rapsys_blogbundle_article';
- }
+ /**
+ * {@inheritdoc}
+ */
+ public function configureOptions(OptionsResolver $resolver): void {
+ $resolver->setDefaults(['data_class' => 'Rapsys\BlogBundle\Entity\Article']);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getName(): string {
+ return 'rapsysblog_article';
+ }
}
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
-class AuthorType extends AbstractType
-{
- /**
- * {@inheritdoc}
- */
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder->add('name')->add('slug')->add('created')->add('updated');
- }
-
- /**
- * {@inheritdoc}
- */
- public function configureOptions(OptionsResolver $resolver)
- {
- $resolver->setDefaults(array(
- 'data_class' => 'Rapsys\BlogBundle\Entity\Author'
- ));
- }
+class AuthorType extends AbstractType {
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options): void {
+ $builder->add('name')->add('slug')->add('created')->add('updated');
+ }
- /**
- * {@inheritdoc}
- */
- public function getBlockPrefix()
- {
- return 'rapsys_blogbundle_author';
- }
+ /**
+ * {@inheritdoc}
+ */
+ public function configureOptions(OptionsResolver $resolver): void {
+ $resolver->setDefaults(['data_class' => 'Rapsys\BlogBundle\Entity\Author']);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getName(): string {
+ return 'rapsysblog_author';
+ }
}
+++ /dev/null
-<?php declare(strict_types=1);
-
-/*
- * This file is part of the Rapsys BlogBundle package.
- *
- * (c) Raphaël Gertz <symfony@rapsys.eu>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Rapsys\BlogBundle\Form;
-
-use Symfony\Component\Form\FormBuilderInterface;
-use Symfony\Component\OptionsResolver\OptionsResolver;
-use Symfony\Component\Form\Extension\Core\Type\TextType;
-use Symfony\Component\Form\Extension\Core\Type\TextareaType;
-use Symfony\Component\Form\Extension\Core\Type\EmailType;
-use Symfony\Component\Form\Extension\Core\Type\SubmitType;
-use Symfony\Component\Validator\Constraints\Email;
-use Symfony\Component\Validator\Constraints\NotBlank;
-
-use Rapsys\PackBundle\Form\CaptchaType;
-
-class ContactType extends CaptchaType {
- /**
- * {@inheritdoc}
- */
- public function buildForm(FormBuilderInterface $builder, array $options): void {
- //Add fields
- $builder
- ->add('name', TextType::class, ['attr' => ['placeholder' => 'Your name'], 'constraints' => [new NotBlank(['message' => 'Please provide your name'])]])
- ->add('subject', TextType::class, ['attr' => ['placeholder' => 'Subject'], 'constraints' => [new NotBlank(['message' => 'Please provide your subject'])]])
- ->add('mail', EmailType::class, ['attr' => ['placeholder' => 'Your mail'], 'constraints' => [new NotBlank(['message' => 'Please provide a valid mail']), new Email(['message' => 'Your mail doesn\'t seems to be valid'])]])
- ->add('message', TextareaType::class, ['attr' => ['placeholder' => 'Your message', 'cols' => 50, 'rows' => 15], 'constraints' => [new NotBlank(['message' => 'Please provide your message'])]])
- ->add('submit', SubmitType::class, ['label' => 'Send', 'attr' => ['class' => 'submit']]);
-
- //Call parent
- parent::buildForm($builder, $options);
- }
-
- /**
- * {@inheritdoc}
- */
- public function configureOptions(OptionsResolver $resolver): void {
- //Set defaults
- $resolver->setDefaults(['error_bubbling' => true]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getName() {
- return 'contact_form';
- }
-}
/**
* {@inheritdoc}
*/
- public function buildForm(FormBuilderInterface $builder, array $options): FormBuilderInterface {
+ public function buildForm(FormBuilderInterface $builder, array $options): void {
//Call parent build form
- $form = parent::buildForm($builder, $options);
+ parent::buildForm($builder, $options);
//Add extra pseudonym field
if (!empty($options['pseudonym'])) {
- $form->add('pseudonym', TextType::class, ['attr' => ['placeholder' => 'Your pseudonym'], 'required' => false]);
+ $builder->add('pseudonym', TextType::class, ['attr' => ['placeholder' => 'Your pseudonym'], 'required' => false]);
}
//Add extra slug field
if (!empty($options['slug'])) {
- $form->add('slug', TextType::class, ['attr' => ['placeholder' => 'Your slug'], 'required' => false]);
+ $builder->add('slug', TextType::class, ['attr' => ['placeholder' => 'Your slug'], 'required' => false]);
}
-
- //Return form
- return $form;
}
/**
* {@inheritdoc}
*/
public function getName(): string {
- return 'rapsys_blog_edit';
+ return 'rapsysuser_edit';
}
}
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
-class KeywordType extends AbstractType
-{
- /**
- * {@inheritdoc}
- */
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder->add('created')->add('updated')->add('articles');
- }
-
- /**
- * {@inheritdoc}
- */
- public function configureOptions(OptionsResolver $resolver)
- {
- $resolver->setDefaults(array(
- 'data_class' => 'Rapsys\BlogBundle\Entity\Keyword'
- ));
- }
+class KeywordType extends AbstractType {
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options): void {
+ $builder->add('created')->add('updated')->add('articles');
+ }
- /**
- * {@inheritdoc}
- */
- public function getBlockPrefix()
- {
- return 'rapsys_blogbundle_keyword';
- }
+ /**
+ * {@inheritdoc}
+ */
+ public function configureOptions(OptionsResolver $resolver): void {
+ $resolver->setDefaults(['data_class' => 'Rapsys\BlogBundle\Entity\Keyword']);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getBlockPrefix() {
+ return 'rapsysblog_keyword';
+ }
}
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
-class LanguageType extends AbstractType
-{
- /**
- * {@inheritdoc}
- */
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder->add('iso6391')->add('iso6393')->add('created')->add('updated');
- }
-
- /**
- * {@inheritdoc}
- */
- public function configureOptions(OptionsResolver $resolver)
- {
- $resolver->setDefaults(array(
- 'data_class' => 'Rapsys\BlogBundle\Entity\Language'
- ));
- }
+class LanguageType extends AbstractType {
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options): void {
+ $builder->add('iso6391')->add('iso6393')->add('created')->add('updated');
+ }
- /**
- * {@inheritdoc}
- */
- public function getBlockPrefix()
- {
- return 'rapsys_blogbundle_language';
- }
+ /**
+ * {@inheritdoc}
+ */
+ public function configureOptions(OptionsResolver $resolver): void {
+ $resolver->setDefaults(['data_class' => 'Rapsys\BlogBundle\Entity\Language']);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getBlockPrefix() {
+ return 'rapsysblog_language';
+ }
}
/**
* {@inheritdoc}
*/
- public function buildForm(FormBuilderInterface $builder, array $options): FormBuilderInterface {
+ public function buildForm(FormBuilderInterface $builder, array $options): void {
//Call parent build form
- $form = parent::buildForm($builder, $options);
+ parent::buildForm($builder, $options);
//Add extra pseudonym field
if (!empty($options['pseudonym'])) {
- $form->add('pseudonym', TextType::class, ['attr' => ['placeholder' => 'Your pseudonym'], 'required' => false]);
+ $builder->add('pseudonym', TextType::class, ['attr' => ['placeholder' => 'Your pseudonym'], 'required' => false]);
}
//Add extra slug field
if (!empty($options['slug'])) {
- $form->add('slug', TextType::class, ['attr' => ['placeholder' => 'Your slug'], 'required' => false]);
+ $builder->add('slug', TextType::class, ['attr' => ['placeholder' => 'Your slug'], 'required' => false]);
}
-
- //Return form
- return $form;
}
/**
* {@inheritdoc}
*/
public function getName(): string {
- return 'rapsys_blog_register';
+ return 'rapsysuser_register';
}
}
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
-class SiteType extends AbstractType
-{
- /**
- * {@inheritdoc}
- */
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder->add('domain')->add('created')->add('updated');
- }
-
- /**
- * {@inheritdoc}
- */
- public function configureOptions(OptionsResolver $resolver)
- {
- $resolver->setDefaults(array(
- 'data_class' => 'Rapsys\BlogBundle\Entity\Site'
- ));
- }
+class SiteType extends AbstractType {
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options): void {
+ $builder->add('domain')->add('created')->add('updated');
+ }
- /**
- * {@inheritdoc}
- */
- public function getBlockPrefix()
- {
- return 'rapsys_blogbundle_site';
- }
+ /**
+ * {@inheritdoc}
+ */
+ public function configureOptions(OptionsResolver $resolver): void {
+ $resolver->setDefaults(['data_class' => 'Rapsys\BlogBundle\Entity\Site']);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getName(): string {
+ return 'rapsysblog_site';
+ }
}
namespace Rapsys\BlogBundle;
-use Symfony\Component\DependencyInjection\Container;
+use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class RapsysBlogBundle extends Bundle {
+ /**
+ * {@inheritdoc}
+ */
+ public function getContainerExtension(): ?ExtensionInterface {
+ //Return created container extension
+ return $this->createContainerExtension();
+ }
+
/**
* Return bundle alias
*
* @return string The bundle alias
*/
- public static function getAlias(): string {
+ public static function getAlias(): string {
//With namespace
if ($npos = strrpos(static::class, '\\')) {
//Set name pos
$bpos = strlen(static::class) - $npos;
}
- //Return underscored lowercase bundle alias
- return Container::underscore(substr(static::class, $npos, $bpos));
- }
+ //Return lowercase bundle alias
+ return strtolower(substr(static::class, $npos, $bpos));
+ }
+
+ /**
+ * Return bundle version
+ *
+ * @return string The bundle version
+ */
+ public static function getVersion(): string {
+ //Return version
+ return '0.0.1';
+ }
}
'created' => $data['created'],
'updated' => $data['updated'],
'modified' => $data['modified'],
- 'link' => $this->router->generate('rapsys_blog_article_view', ['id' => $id, 'slug' => $slug]),
+ 'link' => $this->router->generate('rapsysblog_article_view', ['id' => $id, 'slug' => $slug]),
'keywords' => []
];
'id' => $id,
'slug' => $slug = $data['k_slugs'][$k],
'title' => $data['k_titles'][$k],
- 'link' => $this->router->generate('rapsys_blog_keyword_view', ['id' => $id, 'slug' => $slug]),
+ 'link' => $this->router->generate('rapsysblog_keyword_view', ['id' => $id, 'slug' => $slug]),
];
}
}
'created' => $data['created'],
'updated' => $data['updated'],
'modified' => $data['modified'],
- 'link' => $this->router->generate('rapsys_blog_article_view', ['id' => $id, 'slug' => $slug]),
+ 'link' => $this->router->generate('rapsysblog_article_view', ['id' => $id, 'slug' => $slug]),
'alternates' => [],
'keywords' => []
];
'id' => $kid,
'slug' => $slug = $data['k_slugs'][$k],
'title' => $data['k_titles'][$k],
- 'link' => $this->router->generate('rapsys_blog_keyword_view', ['id' => $kid, 'slug' => $slug]),
+ 'link' => $this->router->generate('rapsysblog_keyword_view', ['id' => $kid, 'slug' => $slug]),
];
}
'locale' => $locale,
'slug' => $slug = $data['kat_slugs'][$k],
'title' => $data['kat_titles'][$k],
- 'link' => $this->router->generate('rapsys_blog_article_view', ['_locale' => $locale, 'id' => $id, 'slug' => $slug]),
+ 'link' => $this->router->generate('rapsysblog_article_view', ['_locale' => $locale, 'id' => $id, 'slug' => $slug]),
];
}
'created' => $data['created'],
'updated' => $data['updated'],
'modified' => $data['modified'],
- 'link' => $this->router->generate('rapsys_blog_keyword_view', ['id' => $id, 'slug' => $slug])
+ 'link' => $this->router->generate('rapsysblog_keyword_view', ['id' => $id, 'slug' => $slug])
];
}
'created' => $data['created'],
'updated' => $data['updated'],
'modified' => $data['modified'],
- 'link' => $this->router->generate('rapsys_blog_keyword_view', ['id' => $id, 'slug' => $slug]),
+ 'link' => $this->router->generate('rapsysblog_keyword_view', ['id' => $id, 'slug' => $slug]),
'alternates' => [],
'articles' => []
];
'description' => $data['a_descriptions'][$k],
'slug' => $slug = $data['a_slugs'][$k],
'title' => $data['a_titles'][$k],
- 'link' => $this->router->generate('rapsys_blog_article_view', ['id' => $aid, 'slug' => $slug]),
+ 'link' => $this->router->generate('rapsysblog_article_view', ['id' => $aid, 'slug' => $slug]),
'keywords' => []
];
}
'id' => $data['ak_kids'][$k],
'slug' => $slug = $data['ak_slugs'][$k],
'title' => $data['ak_titles'][$k],
- 'link' => $this->router->generate('rapsys_blog_keyword_view', ['id' => $data['ak_kids'][$k], 'slug' => $slug]),
+ 'link' => $this->router->generate('rapsysblog_keyword_view', ['id' => $data['ak_kids'][$k], 'slug' => $slug]),
];
}
'locale' => $locale,
'slug' => $slug = $data['ckt_slugs'][$k],
'title' => $data['ckt_titles'][$k],
- 'link' => $this->router->generate('rapsys_blog_keyword_view', ['_locale' => $locale, 'id' => $id, 'slug' => $slug]),
+ 'link' => $this->router->generate('rapsysblog_keyword_view', ['_locale' => $locale, 'id' => $id, 'slug' => $slug]),
];
}
'modified' => $data['modified'],
'civility' => $data['civility'],
#'slug' => $data['slug'],
- 'link' => $this->router->generate('rapsys_blog_user_view', ['id' => $data['id'], 'slug' => $data['slug']]),
- 'edit' => $this->router->generate('rapsys_user_edit', ['mail' => $short = $this->slugger->short($data['mail']), 'hash' => $this->slugger->hash($short)]),
+ 'link' => $this->router->generate('rapsysblog_user_view', ['id' => $data['id'], 'slug' => $data['slug']]),
+ 'edit' => $this->router->generate('rapsysuser_edit', ['mail' => $short = $this->slugger->short($data['mail']), 'hash' => $this->slugger->hash($short)]),
'articles' => [],
'groups' => []
];
$ret[$data['id']]['groups'][$id] = [
'title' => /*$group = */$this->translator->trans($titles[$k]),
#'slug' => $this->slugger->slug($group)
- #'link' => $this->router->generate('rapsys_user_group_view', ['id' => $id, 'slug' => $this->slugger->short($group)])
+ #'link' => $this->router->generate('rapsysuser_group_view', ['id' => $id, 'slug' => $this->slugger->short($group)])
];
}
}
'description' => $descriptions[$k],
#'slug' => $slugs[$k],
'title' => $titles[$k],
- 'link' => $this->router->generate('rapsys_blog_article_view', ['id' => $id, 'slug' => $slugs[$k]]),
+ 'link' => $this->router->generate('rapsysblog_article_view', ['id' => $id, 'slug' => $slugs[$k]]),
//TODO: replace with keywords !!!
'keywords' => []
];
$ret[$data['id']]['articles'][$id]['keywords'][$kid] = [
#'slug' => $slugs[$k],
'title' => $titles[$k],
- 'link' => $this->router->generate('rapsys_blog_keyword_view', ['id' => $kid, 'slug' => $slugs[$k]]),
+ 'link' => $this->router->generate('rapsysblog_keyword_view', ['id' => $kid, 'slug' => $slugs[$k]]),
];
}
}
* Find user by id as array
*
* @param integer $id The user id
- * @return array The article array
+ * @return ?array The article array
*/
- public function findByIdAsArray(int $id): array {
+ public function findByIdAsArray(int $id): ?array {
//Set the request
$req = <<<SQL
SELECT
->addScalarResult('kt_titles', 'kt_titles', 'string');
//Get data
- $data = $this->_em
+ if (($data = $this->_em
->createNativeQuery($req, $rsm)
->setParameter('id', $id)
- ->getOneOrNullResult();
+ ->getOneOrNullResult()) === null) {
+ //Return null
+ return $data;
+ }
//Set return
$return = [
'modified' => $data['modified'],
'civility' => $data['civility'],
'slug' => $data['slug'],
- 'link' => $this->router->generate('rapsys_blog_user_view', ['id' => $data['id'], 'slug' => $data['slug']]),
- 'edit' => $this->router->generate('rapsys_user_edit', ['mail' => $short = $this->slugger->short($data['mail']), 'hash' => $this->slugger->hash($short)]),
+ 'link' => $this->router->generate('rapsysblog_user_view', ['id' => $data['id'], 'slug' => $data['slug']]),
+ 'edit' => $this->router->generate('rapsysuser_edit', ['mail' => $short = $this->slugger->short($data['mail']), 'hash' => $this->slugger->hash($short)]),
'articles' => [],
'groups' => []
];
$return['groups'][$id] = [
'title' => /*$group = */$this->translator->trans($titles[$k]),
#'slug' => $this->slugger->slug($group)
- #'link' => $this->router->generate('rapsys_user_group_view', ['id' => $id, 'slug' => $this->slugger->short($group)])
+ #'link' => $this->router->generate('rapsysuser_group_view', ['id' => $id, 'slug' => $this->slugger->short($group)])
];
}
}
'description' => $descriptions[$k],
#'slug' => $slugs[$k],
'title' => $titles[$k],
- 'link' => $this->router->generate('rapsys_blog_article_view', ['id' => $id, 'slug' => $slugs[$k]]),
+ 'link' => $this->router->generate('rapsysblog_article_view', ['id' => $id, 'slug' => $slugs[$k]]),
//TODO: replace with keywords !!!
'keywords' => []
];
$return['articles'][$id]['keywords'][$kid] = [
#'slug' => $slugs[$k],
'title' => $titles[$k],
- 'link' => $this->router->generate('rapsys_blog_keyword_view', ['id' => $kid, 'slug' => $slugs[$k]]),
+ 'link' => $this->router->generate('rapsysblog_keyword_view', ['id' => $kid, 'slug' => $slugs[$k]]),
];
}
}
+++ /dev/null
-# This file is a "template" of what your parameters.yml file should look like
-# Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production.
-# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
-parameters:
- database_host: localhost
- database_port: null
- database_name: blog
- database_user: blog
- database_password: ~
-
- mailer_transport: smtp
- mailer_host: 127.0.0.1
- mailer_user: ~
- mailer_password: ~
-
- # A secret key that's used to generate certain security-related tokens
- secret: ThisTokenIsNotSoSecretChangeIt
-
- # Blog config
- blog.locales: [ en, fr ]
- blog.logo: 'bundles/rapsysblog/png/favicon.png'
- blog.title: 'Dev log'
- blog.welcome: 'Welcome to %blog.title%'
- blog.contact_mail: 'blog@rapsys.eu'
- blog.contact_name: 'Raphaël Gertz'
-
-# Add json dql function
-doctrine:
- orm:
- dql:
- string_functions:
- Json:
- Rapsys\BlogBundle\DQL\JsonFunction
-
-# Sension config
-sensio_framework_extra:
- router:
- annotations: false
- request:
- converters: false
- auto_convert: false
- view:
- annotations: false
- cache:
- annotations: false
- security:
- annotations: false
- psr_message:
- enabled: false
-
-# Set fallback locale
-framework:
- translator:
- fallbacks:
- - '%locale%'
-
-# Set twig global
-twig:
- globals:
- blog_locales: '%blog.locales%'
+++ /dev/null
-root:
- path: /
- defaults: { _controller: RapsysBlogBundle:Default:root }
-
-homepage:
- path: /{_locale}
- defaults: { _controller: RapsysBlogBundle:Page:index }
- requirements:
- _locale: '%blog.locales%'
-
-about:
- path: /{_locale}/about
- defaults: { _controller: RapsysBlogBundle:Page:about }
- requirements:
- _locale: '%blog.locales%'
-
-contact:
- path: /{_locale}/contact
- defaults: { _controller: RapsysBlogBundle:Page:contact }
- requirements:
- _locale: '%blog.locales%'
-
-articles:
- path: /{_locale}/articles
- defaults: { _controller: RapsysBlogBundle:Page:articleIndex }
- requirements:
- _locale: '%blog.locales%'
-
-articles_article:
- path: /{_locale}/articles/{_article}
- defaults: { _controller: RapsysBlogBundle:Page:articleRead }
- requirements:
- _locale: '%blog.locales%'
- #_article: '\d+'
- _article: '[a-z0-9-]+'
-
-keywords:
- path: /{_locale}/keywords
- defaults: { _controller: RapsysBlogBundle:Page:keywordIndex }
- requirements:
- _locale: '%blog.locales%'
-
-keywords_keyword:
- path: /{_locale}/keywords/{_keyword}
- defaults: { _controller: RapsysBlogBundle:Page:keywordRead }
- requirements:
- _locale: '%blog.locales%'
- _keyword: '[a-z0-9-]+'
+++ /dev/null
-services:
- twig.extension.intl:
- class: Twig_Extensions_Extension_Intl
- tags: [ twig.extension ]
- rapsys_blog.twig.base64:
- class: Rapsys\BlogBundle\Twig\Base64Extension
- tags: [ twig.extension ]
+++ /dev/null
-<!DOCTYPE html>
-<html{% if head.locale is defined and head.locale %} lang="{{ head.locale }}"{% endif %}>
- <head{% if head.facebook is defined and head.facebook is not empty %} prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"{% endif %}>
- {% block head %}
- <meta charset="UTF-8" />
- <title>{{ head.title }}</title>
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- {% if head.description is defined and head.description %}
- <meta name="description" content="{{ head.description }}" />
- {% endif %}
- {% if head.keywords is defined and head.keywords %}
- <meta name="keywords" content="{{ head.keywords }}" />
- {% endif %}
- {% if head.facebook is defined and head.facebook %}
- {% for property, contents in head.facebook %}
- {% if contents is iterable %}
- {% for content in contents %}
- <meta property="{{ property }}" content="{{ content }}" />
- {% endfor %}
- {% else %}
- <meta property="{{ property }}" content="{{ contents }}" />
- {% endif %}
- {% endfor %}
- {% endif %}
- {% block link %}
- {% if head.icon.ico is defined and head.icon.ico is not empty %}
- <link rel="shortcut icon" type="image/x-icon" href="{{ asset(head.icon.ico) }}" />
- {% endif %}
- {% if head.icon.png is defined and head.icon.png is not empty %}
- {% for size, icon in head.icon.png %}
- {# Apple #}
- {% if size in [120, 152, 167, 180] %}
- {% if size == 180 %}
- <link rel="apple-touch-icon" href="{{ asset(icon) }}" />
- {% endif %}
- <link rel="apple-touch-icon" sizes="{{ size }}x{{ size }}" href="{{ asset(icon) }}" />
- {# Windows #}
- {% elseif size in [70, 150, 310] %}
- <meta name="msapplication-square{{ size }}x{{ size }}logo" content="{{ asset(icon) }}" />
- {# Others #}
- {% else %}
- <link rel="icon" type="image/png" sizes="{{ size }}x{{ size }}" href="{{ asset(icon) }}" />
- {% endif %}
- {% endfor %}
- {% endif %}
- {% if head.icon.svg is defined and head.icon.svg is not empty %}
- <link rel="icon" type="image/svg+xml" href="{{ asset(head.icon.svg) }}" />
- {% endif %}
- {# stylesheet '//fonts.googleapis.com/css?family=Irish+Grover' '//fonts.googleapis.com/css?family=La+Belle+Aurore' '@RapsysBlogBundle/Resources/public/css/{reset,screen}.css' #}
- {% stylesheet '@RapsysBlog/css/{reset,droidsans,lemon,notoemoji,screen}.css' %}
- <link rel="stylesheet" type="text/css" href="{{ asset_url }}?{{ 'now'|date('U') }}" />
- {% endstylesheet %}
- {% stopwatch 'stylesheet' %}
- {% endstopwatch %}
- {% if head.canonical is defined and head.canonical %}
- <link rel="canonical" href="{{ head.canonical }}"{% if head.locale is defined and head.locale %} hreflang="{{ head.locale }}"{% endif %} />
- {% endif %}
- {% if head.alternates is defined and head.alternates %}
- {% for lang, alternate in head.alternates %}
- <link rel="alternate" href="{{ alternate.absolute }}" hreflang="{{ lang }}" />
- {% endfor %}
- {% endif %}
- {% if head.prev is defined and head.prev %}
- <link rel="prev" href="{{ head.prev }}" hreflang="{{ head.locale }}" />
- {% endif %}
- {% if head.next is defined and head.next %}
- <link rel="next" href="{{ head.next }}" hreflang="{{ head.locale }}" />
- {% endif %}
- {% endblock %}
- {% endblock %}
- </head>
- <body>
- {% block body %}
- {% block header %}
- <header id="header">
- <a id="logo" href="{{ path(head.root) }}" title="{{ head.site }}">
- <img src="{{ asset(head.logo.svg) }}?20221024100144" srcset="{{ asset(head.logo.png) }}?20221024100144 200w, {{ asset(head.logo.svg) }}?20221024100144 400w" sizes="(min-width:400px) 400px, 200px" alt="{{ head.logo.alt }}" width="100" height="60" />
- <strong>{{ head.site }}</strong>
- </a>
- <nav id="nav">
- <a href="{{ path('rapsys_blog') }}" rel="home">{% trans %}Home{% endtrans %}</a>
- <a href="{{ path('rapsys_blog_contact') }}" rel="contact">{% trans %}Contact{% endtrans %}</a>
- {#<a href="{{ path('rapsys_blog_frequently_asked_questions') }}">{% trans %}Frequently asked questions{% endtrans %}</a>#}
- {#{% if is_granted('ROLE_ADMIN') %}#}
- <a href="{{ path('rapsys_blog_user') }}">{% trans %}Users{% endtrans %}</a>
- {#{% endif %}#}
- {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
- <a href="{{ path('rapsys_user_edit', {mail: app.user.mail|short, hash: app.user.mail|short|hash}) }}">{% trans %}My account{% endtrans %}</a>
- <a href="{{ path('rapsys_user_logout') }}">{% trans %}Logout{% endtrans %}</a>
- {% else %}
- <a href="{{ path('rapsys_user_login') }}">{% trans %}Login{% endtrans %}</a>
- <a href="{{ path('rapsys_user_register') }}">{% trans %}Register{% endtrans %}</a>
- {% endif %}
- </nav>
- {#{% block site_subtitle %}{% endblock %}
- {% block site_tagline %}
- {% if tags is defined and tags %}
- <ul>
- {% for id, tag in tags %}
- <li><h2><a href="#{{id}}">{{tag}}</a></h2></li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endblock %}#}
- </header>
- {% endblock %}
- {% block message %}
- {# pass an array argument to get the messages of those types (['warning', 'error']) #}
- {% for label, messages in app.flashes %}
- {% if messages %}
- <section class="message {{label}}">
- <ul>
- {% for message in messages %}
- <li>{{ message }}</li>
- {% endfor %}
- </ul>
- </section>
- {% endif %}
- {% endfor %}
- {% endblock %}
- {% endblock %}
- {#{% block sidebar %}<aside id="sidebar"></aside>{% endblock %}#}
- {% block content %}
- <article>
- <header>
- {% block title %}<h1 id="title"><a href="{{ head.canonical }}">{{ title }}</a></h1>{% endblock %}>
- <p>{{ description }}</p>
- </header>
- </article>
- {% endblock %}
- {% block footer %}
- <footer id="footer">
- <a href="{{ path('rapsys_blog_about') }}">{% trans %}About{% endtrans %}</a>
- {% if copy is defined and copy %}
- <details><summary>{{ copy.long }}</summary><span>{{ copy.short }} <a href="{{ copy.link }}" title="{{ copy.title }}" rel="author">{{ copy.by }}</a></span></details>
- {% endif %}
- {#<a href="{{ path('rapsys_blog_terms_of_service') }}">{% trans %}Terms of service{% endtrans %}</a>#}
- {% if head.alternates is defined and head.alternates %}
- {% set langs = head.alternates|keys|filter(v => v|length == 5) %}
- {% if langs|length > 1 %}
- <ul>
- {% for lang in langs %}
- <li><a href="{{ head.alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ head.alternates[lang].title }}">{{ head.alternates[lang].translated }}</a></li>
- {% endfor %}
- </ul>
- {% else %}
- {% set lang = langs|first %}
- <a href="{{ head.alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ head.alternates[lang].title }}">{{ head.alternates[lang].translated }}</a>
- {% endif %}
- {% else %}
- <span> </span>
- {% endif %}
- </footer>
- {% endblock %}
- {% block javascripts %}
- {% stopwatch 'javascript' %}
- {#{% javascript '@RapsysBlog/js/*.js' %}
- <script type="text/javascript" src="{{ asset_url }}"></script>
- {% endjavascript %}#}
- {% endstopwatch %}
- {% endblock %}
- </body>
-</html>
+++ /dev/null
-{% extends '@RapsysBlog/_base.html.twig' %}
-{% block content %}
- <section id="content">
- <header>
- <h1><a href="{{ path('rapsys_blog_article') }}">{{ title }}</a></h1>
- <p>{{ description }}</p>
- </header>
- <section>
- {% for article in articles %}
- <article>
- <header>
- <h2><a href="{{ path('rapsys_blog_article_view', {'id': article.id, 'slug': article.slug}) }}">{{ article.title }}</a></h2>
- </header>
- <section>
- <p>{{ article.description }}</p>
- {% if article.keywords is defined and article.keywords %}
- <nav>
- {% for keyword in article.keywords %}
- <a href="{{ path('rapsys_blog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
- {% endfor %}
- </nav>
- {% endif %}
- </section>
- <footer>
- <nav>
- <a href="{{ path('rapsys_blog_article_view', {'id': article.id, 'slug': article.slug}) }}">{% trans %}Read more{% endtrans %}...</a>
- </nav>
- </footer>
- </article>
- {% endfor %}
- </section>
- {% if head.prev is defined or head.next is defined %}
- <footer>
- <nav class="pager">
- {% if head.prev is defined %}
- <a href="{{ head.prev }}" rel="prev">< {% trans %}Previous articles{% endtrans %}</a>
- {% endif %}
- {% if head.next is defined %}
- <a href="{{ head.next }}" rel="next">{% trans %}Next articles{% endtrans %} ></a>
- {% endif %}
- </nav>
- </footer>
- {% endif %}
- </section>
-{% endblock %}
+++ /dev/null
-{% extends '@RapsysBlog/_base.html.twig' %}
-{% block content %}
- <section class="form">
- <header>
- <h1><a href="{{ head.canonical }}">{{ title }}</a></h1>
- <p>{{ description }}</p>
- </header>
- <section>
- {% if sent is defined and sent %}
- <p>{% trans %}Your message has been sent{% endtrans %}</p>
- {% else %}
- {{ form_start(contact) }}
- {{ form_row(contact.subject) }}
-
- {{ form_row(contact.name) }}
-
- {{ form_row(contact.mail) }}
-
- {{ form_row(contact.message) }}
-
- {{ form_row(contact.captcha) }}
-
- {{ form_row(contact.submit) }}
-
- {# Render CSRF token etc .#}
- <div style="display:none">{{ form_rest(contact) }}</div>
- {{ form_end(contact) }}
- {% endif %}
- </section>
- </section>
-{% endblock %}
+++ /dev/null
-{% extends '@RapsysBlog/_base.html.twig' %}
-{% block content %}
- <section class="form">
- <header>
- <h2><a href="{{ path('rapsys_user_recover') }}">{{ title }}</a></h2>
- </header>
- <section>
- {% if sent %}
- <p class="message notice">{% trans %}Your account recovery message has been sent{% endtrans %}</p>
- {% else %}
- {{ form_start(recover) }}
- {% if recover.mail is defined %}
- {{ form_row(recover.mail) }}
- {% endif %}
-
- {% if recover.password is defined %}
- {{ form_row(recover.password) }}
- {% endif %}
-
- {{ form_row(recover.submit) }}
-
- {# Render CSRF token etc .#}
- <footer style="display:none">{{ form_rest(recover) }}</footer>
- {{ form_end(recover) }}
- {% endif %}
- </section>
- </section>
-{% endblock %}
+++ /dev/null
-{% extends '@RapsysBlog/_base.html.twig' %}
-{% block content %}
- <section id="content">
- <header>
- <h1 id="title"><a href="{{ head.canonical }}">{{ title }}</a></h1>
- <p>{{ description }}</p>
- </header>
- <section>
- {% for article in articles %}
- <article>
- <header>
- <h2><a href="{{ path('rapsys_blog_article_view', {'id': article.id, 'slug': article.slug}) }}">{{ article.title }}</a></h2>
- </header>
- <section>
- <p>{{ article.description }}</p>
- {% if article.keywords is defined and article.keywords %}
- <nav>
- {% for keyword in article.keywords %}
- <a href="{{ path('rapsys_blog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
- {% endfor %}
- </nav>
- {% endif %}
- </section>
- <footer>
- <nav>
- <a href="{{ path('rapsys_blog_article_view', {'id': article.id, 'slug': article.slug}) }}">{% trans %}Read more{% endtrans %}...</a>
- </nav>
- </footer>
- </article>
- {% endfor %}
- </section>
- {% if head.prev is defined or head.next is defined %}
- <footer>
- <nav class="pager">
- {% if head.prev is defined %}
- <a href="{{ head.prev }}" rel="prev">< {% trans %}Previous articles{% endtrans %}</a>
- {% endif %}
- {% if head.next is defined %}
- <a href="{{ head.next }}" rel="next">{% trans %}Next articles{% endtrans %} ></a>
- {% endif %}
- </nav>
- </footer>
- {% endif %}
- </section>
-{% endblock %}
+++ /dev/null
-{% extends '@RapsysBlog/_base.html.twig' %}
-{% block content %}
- <section id="content">
- <header>
- <h1><a href="{{ path('rapsys_blog_keyword') }}">{{ title }}</a></h1>
- <p>{{ description }}</p>
- </header>
- <section>
- {% for keyword in keywords %}
- <article>
- <header>
- <h2><a href="{{ path('rapsys_blog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a></h2>
- </header>
- <section>
- <p>{{ keyword.description }}</p>
- {#{% if article.keywords is defined and article.keywords %}
- <nav>
- {% for keyword in article.keywords %}
- <a href="{{ path('rapsys_blog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
- {% endfor %}
- </nav>
- {% endif %}#}
- </section>
- <footer>
- <nav>
- <a href="{{ path('rapsys_blog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{% trans %}Read more{% endtrans %}...</a>
- </nav>
- </footer>
- </article>
- {% endfor %}
- </section>
- {% if head.prev is defined or head.next is defined %}
- <footer>
- <nav class="pager">
- {% if head.prev is defined %}
- <a href="{{ head.prev }}" rel="prev">< {% trans %}Previous keywords{% endtrans %}</a>
- {% endif %}
- {% if head.next is defined %}
- <a href="{{ head.next }}" rel="next">{% trans %}Next keywords{% endtrans %} ></a>
- {% endif %}
- </nav>
- </footer>
- {% endif %}
- </section>
-{% endblock %}
+++ /dev/null
-{% extends '@RapsysBlog/_base.html.twig' %}
-{% block head %}
- <meta charset="UTF-8" />
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- {% if head.locale is defined and head.locale %}<meta http-equiv="Content-Language" content="{{ head.locale }}" />{% endif %}
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>{{ subject }}</title>
- <style type="text/css">
- body {background:white;color:#222}
- a {text-decoration:none;color:#15c}
- a:hover {text-decoration:underline}
- a.link {word-break:break-all;font-size:1.5rem}
- h1 {margin: .5rem;font-size: 2rem}
- table {width: 100%;border-radius: .5rem}
- thead {border-top:.5rem solid #09c;background:#cff}
- thead th {text-align:center}
- tbody {border-top:.5rem solid #09c;background:#cff}
- tbody td {margin:.5rem 0;padding:0 .5rem}
- tfoot {border-top:.5rem solid #09c;background:#cff}
- tfoot td {text-align:center}
- tfoot summary:after {display:none}
- tfoot summary::-webkit-details-marker {display:none}
- </style>
-{% endblock %}
-{% block header %}
- <table>
- <thead>
- <tr>
- {#<th><a href="{{ url(head.root) }}" title="{{ head.site }}"><img src="{{ source(head.logo.png)|data_uri }}" alt="{{ head.logo.alt }}" width="100" height="60" /></a></th>#}
- <th><a href="{{ url(head.root) }}" title="{{ head.site }}"><img src="{{ email.image(head.logo.png) }}" alt="{{ head.logo.alt }}" width="100" height="60" /></a></th>
- <th><h1><a href="{{ url(head.root) }}">{{ head.site }}</a></h1></th>
- </tr>
- </thead>
-{% endblock %}
-{% block message %}{% endblock %}
-{% block footer %}
- <tfoot>
- <tr>
- <td colspan="2">{{ copy.long }} - {{ copy.short }}</td>
- </tr>
- </tfoot>
- </table>
-{% endblock %}
# Dev log configuration
#TODO: set mail, calendar and facebook app id as env variables ???
-rapsys_blog:
+rapsysblog:
contact:
address: 'blog@rapsys.eu'
name: 'Raphaël Gertz'
alt: 'Rapsys'' dev log logo'
png: '@RapsysBlog/png/logo.png'
svg: '@RapsysBlog/svg/logo.svg'
- root: 'rapsys_blog'
+ root: 'rapsysblog'
title: 'Rapsys'' dev log'
#RapsysUser configuration
-rapsys_user:
+rapsysuser:
#Class replacement
class:
group: 'Rapsys\BlogBundle\Entity\Group'
admin: 'ROLE_ADMIN'
civility: 'Mister'
group: [ 'User' ]
+ languages: '%rapsysblog.languages%'
#Route replacement
route:
- index:
- name: 'rapsys_blog'
register:
- name: 'rapsys_user_register'
+ name: 'rapsysuser_register'
#Translate replacement
- translate: [ 'title', 'password', 'copy.by', 'copy.long', 'copy.short', 'copy.title', 'head.logo.alt', 'head.site' ]
- #Languages replacement
- languages: '%rapsys_blog.languages%'
+ translate: [ 'title.page', 'title.section', 'title.site', 'password', 'copy.by', 'copy.long', 'copy.short', 'copy.title', 'logo.alt' ]
#Contact replacement
- contact: '%rapsys_blog.contact%'
+ contact: '%rapsysblog.contact%'
#Context replacement
context:
- copy: '%rapsys_blog.copy%'
- head:
- icon: '%rapsys_blog.icon%'
- logo: '%rapsys_blog.logo%'
- root: '%rapsys_blog.root%'
- site: '%rapsys_blog.title%'
+ copy: '%rapsysblog.copy%'
+ icon: '%rapsysblog.icon%'
+ logo: '%rapsysblog.logo%'
+ root: '%rapsysblog.root%'
+ title:
+ section: 'User'
+ site: '%rapsysblog.title%'
#Edit replacement
edit:
admin:
mail: true
slug: true
- route:
- index: 'root'
view:
edit: 'Rapsys\BlogBundle\Form\EditType'
name: '@RapsysBlog/form/edit.html.twig'
context:
- title: 'Modify account'
+ title:
+ page: 'Modify account'
password: 'Modify password'
+ root: '%rapsysblog.root%'
#Index replacement
index:
- route:
- index: 'root'
view:
name: '@RapsysBlog/user/index.html.twig'
context:
- title: 'User list'
+ title:
+ page: 'User list'
+ root: '%rapsysblog.root%'
#Login replacement
login:
- route:
- index: 'root'
view:
name: '@RapsysBlog/form/login.html.twig'
context:
- title: 'Login'
+ title:
+ page: 'Login'
+ root: '%rapsysblog.root%'
#Recover replacement
recover:
route:
- index: 'root'
recover: 'recover_url'
view:
name: '@RapsysBlog/form/recover.html.twig'
context:
- title: 'Recover'
+ title:
+ page: 'Recover'
+ root: '%rapsysblog.root%'
mail:
- subject: 'Welcome back %%recipient_name%% to %%head.site%%'
+ subject: 'Welcome back %%recipient_name%% to %%title.site%%'
html: '@RapsysBlog/mail/recover.html.twig'
text: '@RapsysBlog/mail/recover.text.twig'
context:
pseudonym: false
slug: false
route:
- index: 'root'
confirm: 'confirm_url'
view:
form: 'Rapsys\BlogBundle\Form\RegisterType'
name: '@RapsysBlog/form/register.html.twig'
context:
- title: 'Register'
+ title:
+ page: 'Register'
+ root: '%rapsysblog.root%'
mail:
- subject: 'Welcome %%recipient_name%% to %%head.site%%'
+ subject: 'Welcome %%recipient_name%% to %%title.site%%'
html: '@RapsysBlog/mail/register.html.twig'
text: '@RapsysBlog/mail/register.text.twig'
context:
collate: 'utf8mb4_unicode_ci'
# Orm configuration
orm:
+ # Controler resolver
+ controller_resolver:
+ auto_mapping: false
# Replace repository factory
repository_factory: 'Rapsys\BlogBundle\Factory\RepositoryFactory'
# Framework configuration
framework:
- default_locale: '%rapsys_blog.locale%'
+ default_locale: '%rapsysblog.locale%'
disallow_search_engine_index: false
#error_controller: 'Rapsys\BlogBundle\Controller\ErrorController::show'
mailer:
cookie_secure: 'auto'
cookie_samesite: 'lax'
translator:
- fallbacks: '%rapsys_blog.locales%'
+ fallbacks: '%rapsysblog.locales%'
# Security configuration
security:
providers:
database:
entity:
- class: Rapsys\BlogBundle\Entity\User
- property: mail
+ class: 'Rapsys\BlogBundle\Entity\User'
+ property: 'mail'
# Set firewall
firewalls:
# Disables authentication for assets and the profiler, adapt it according to your needs
dev:
- pattern: ^/(_(profiler|wdt)|css|images|js)/
+ pattern: '^/(_(profiler|wdt)|css|images|js)/'
security: false
main:
# Redirect to referer if different from login route
use_referer: true
# Login path
- login_path: rapsys_user_login
+ login_path: 'rapsysuser_login'
# Check path
- check_path: rapsys_user_login
+ check_path: 'rapsysuser_login'
# Username parameter
username_parameter: 'login[mail]'
# Password parameter
# Set logout route
logout:
# Logout route
- path: rapsys_user_logout
+ path: 'rapsysuser_logout'
# Logout default target
- target: rapsys_blog
+ target: 'rapsysblog'
# Set custom access denied handler
#access_denied_handler: Rapsys\BlogBundle\Handler\AccessDeniedHandler
services:
#Register abstract controller
Rapsys\BlogBundle\Controller\AbstractController:
- arguments: [ '@security.authorization_checker', '@service_container', '@rapsys_user.access_decision_manager', '@doctrine', '@rapsys_pack.facebook_util', '@form.factory', '@rapsys_pack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsys_pack.path_package', '@router', '@rapsys_pack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
+ arguments: [ '@security.authorization_checker', '@service_container', '@rapsysuser.access_decision_manager', '@doctrine', '@rapsysblog.facebook_util', '@form.factory', '@rapsyspack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsyspack.path_package', '@router', '@rapsyspack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
tags: [ 'controller.service_arguments' ]
#Register article controller
Rapsys\BlogBundle\Controller\ArticleController:
- arguments: [ '@security.authorization_checker', '@service_container', '@rapsys_user.access_decision_manager', '@doctrine', '@rapsys_pack.facebook_util', '@form.factory', '@rapsys_pack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsys_pack.path_package', '@router', '@rapsys_pack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
+ arguments: [ '@security.authorization_checker', '@service_container', '@rapsysuser.access_decision_manager', '@doctrine', '@rapsysblog.facebook_util', '@form.factory', '@rapsyspack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsyspack.path_package', '@router', '@rapsyspack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
tags: [ 'controller.service_arguments' ]
#Register default controller
Rapsys\BlogBundle\Controller\DefaultController:
- arguments: [ '@security.authorization_checker', '@service_container', '@rapsys_user.access_decision_manager', '@doctrine', '@rapsys_pack.facebook_util', '@form.factory', '@rapsys_pack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsys_pack.path_package', '@router', '@rapsys_pack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
+ arguments: [ '@security.authorization_checker', '@service_container', '@rapsysuser.access_decision_manager', '@doctrine', '@rapsysblog.facebook_util', '@form.factory', '@rapsyspack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsyspack.path_package', '@router', '@rapsyspack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
tags: [ 'controller.service_arguments' ]
#Register keyword controller
Rapsys\BlogBundle\Controller\KeywordController:
- arguments: [ '@security.authorization_checker', '@service_container', '@rapsys_user.access_decision_manager', '@doctrine', '@rapsys_pack.facebook_util', '@form.factory', '@rapsys_pack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsys_pack.path_package', '@router', '@rapsys_pack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
+ arguments: [ '@security.authorization_checker', '@service_container', '@rapsysuser.access_decision_manager', '@doctrine', '@rapsysblog.facebook_util', '@form.factory', '@rapsyspack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsyspack.path_package', '@router', '@rapsyspack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
tags: [ 'controller.service_arguments' ]
#Register user controller
Rapsys\BlogBundle\Controller\UserController:
- arguments: [ '@security.authorization_checker', '@service_container', '@rapsys_user.access_decision_manager', '@doctrine', '@rapsys_pack.facebook_util', '@form.factory', '@rapsys_pack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsys_pack.path_package', '@router', '@rapsys_pack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
+ arguments: [ '@security.authorization_checker', '@service_container', '@rapsysuser.access_decision_manager', '@doctrine', '@rapsysblog.facebook_util', '@form.factory', '@rapsyspack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsyspack.path_package', '@router', '@rapsyspack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
tags: [ 'controller.service_arguments' ]
Rapsys\BlogBundle\Factory\RepositoryFactory:
- arguments: [ '@request_stack', '@router', '@rapsys_pack.slugger_util', '@translator', '%rapsys_blog.languages%', '%rapsys_blog.locale%' ]
+ arguments: [ '@request_stack', '@router', '@rapsyspack.slugger_util', '@translator', '%rapsysblog.languages%', '%rapsysblog.locale%' ]
#Register blog fixture
Rapsys\BlogBundle\Fixture\BlogFixture:
- arguments: [ '@rapsys_pack.slugger_util' ]
+ arguments: [ '@rapsyspack.slugger_util' ]
tags: [ 'doctrine.fixture.orm' ]
#Register form factory as public
form.factory:
public: true
#Register facebook event subscriber
Rapsys\PackBundle\Subscriber\FacebookSubscriber:
- arguments: [ '@router', '%rapsys_blog.locales%' ]
+ arguments: [ '@router', '%rapsysblog.locales%' ]
tags: [ 'kernel.event_subscriber' ]
#Register facebook util service
- rapsys_blog.facebook_util:
+ rapsysblog.facebook_util:
class: 'Rapsys\PackBundle\Util\FacebookUtil'
#TODO: create the facebook.png file and add the fonts
#TODO: add a default font
- arguments: [ '@router', '%kernel.project_dir%/var/cache', '%rapsys_pack.path%', 'facebook', '%rapsys_blog.path%/png/facebook.png', { irishgrover: '%rapsys_blog.path%/ttf/irishgrover.v10.ttf', labelleaurore: '%rapsys_blog.path%/ttf/labelleaurore.v10.ttf', dejavusans: '%rapsys_blog.path%/ttf/dejavusans.2.37.ttf', droidsans: '%rapsys_blog.path%/ttf/droidsans.regular.ttf' } ]
+ arguments: [ '@service_container', '@router', '@rapsyspack.slugger_util' ]
+ #arguments: [ '@service_container', '@router', '%kernel.project_dir%/var/cache', '%rapsyspack.path%', 'facebook', '%rapsysblog.path%/png/facebook.png', { irishgrover: '%rapsysblog.path%/ttf/irishgrover.v10.ttf', labelleaurore: '%rapsysblog.path%/ttf/labelleaurore.v10.ttf', dejavusans: '%rapsysblog.path%/ttf/dejavusans.2.37.ttf', droidsans: '%rapsysblog.path%/ttf/droidsans.regular.ttf' } ]
public: true
#Register contact form type
- Rapsys\BlogBundle\Form\ContactType:
- arguments: [ '@rapsys_pack.image_util', '@rapsys_pack.slugger_util', '@translator' ]
+ Rapsys\PackBundle\Form\ContactType:
+ arguments: [ '@rapsyspack.image_util', '@rapsyspack.slugger_util', '@translator', true ]
tags: [ 'form.type' ]
# Twig configuration
#XXX: enable forced regeneration of css and js at each page load
cache: false
#Fix form layout for css
- #XXX: @RapsysBlog is a shortcut to vendor/rapsys/blogbundle/Resources/views directory here
+ #XXX: @RapsysBlog is a shortcut to vendor/rapsys/blogbundle/templates directory here
form_theme: [ '@RapsysBlog/form/form_div_layout.html.twig' ]
#Set twig paths
paths:
#Required by email.image(site_logo) directive
- #XXX: Allow twig to resolve @RapsysBlog/png/logo.png in vendor/rapsys/blogbundle/Resources/public/png/logo.png
- '%kernel.project_dir%/vendor/rapsys/blogbundle/Resources/public': 'RapsysBlog'
+ #XXX: Allow twig to resolve @RapsysBlog/png/logo.png in vendor/rapsys/blogbundle/public/png/logo.png
+ '%kernel.project_dir%/vendor/rapsys/blogbundle/public': 'RapsysBlog'
#SCRUD: index, add, edit, delete, view
#TODO: rename view in show ???
-rapsys_blog:
+rapsysblog:
path:
en_gb: '/en'
fr_fr: '/'
controller: Rapsys\BlogBundle\Controller\DefaultController::index
methods: GET
-rapsys_blog_about:
+rapsysblog_about:
path:
en_gb: '/en/about'
fr_fr: '/a-propos'
controller: Rapsys\BlogBundle\Controller\DefaultController::about
methods: GET
-rapsys_blog_contact:
+rapsysblog_contact:
path:
en_gb: '/en/contact/{id<\d*>?}/{user<[\w-]*>?}'
fr_fr: '/contacter/{id<\d*>?}/{user<[\w-]*>?}'
controller: Rapsys\BlogBundle\Controller\DefaultController::contact
methods: GET|POST
-rapsys_blog_article:
+rapsysblog_article:
path:
en_gb: '/en/article'
fr_fr: '/article'
controller: Rapsys\BlogBundle\Controller\ArticleController::index
methods: GET|POST
-rapsys_blog_article_view:
+rapsysblog_article_view:
path:
en_gb: '/en/article/{id<\d*>?}/{slug<[\w-]*>?}'
fr_fr: '/article/{id<\d*>?}/{slug<[\w-]*>?}'
controller: Rapsys\BlogBundle\Controller\ArticleController::view
methods: GET|POST
-rapsys_blog_keyword:
+rapsysblog_keyword:
path:
en_gb: '/en/keyword'
fr_fr: '/mot-cle'
controller: Rapsys\BlogBundle\Controller\KeywordController::index
methods: GET|POST
-rapsys_blog_keyword_view:
+rapsysblog_keyword_view:
path:
en_gb: '/en/keyword/{id<\d*>?}/{slug<[\w-]*>?}'
fr_fr: '/mot-cle/{id<\d*>?}/{slug<[\w-]*>?}'
controller: Rapsys\BlogBundle\Controller\KeywordController::view
methods: GET|POST
-rapsys_blog_frequently_asked_questions:
+rapsysblog_frequently_asked_questions:
path:
en_gb: '/en/frequently-asked-questions'
fr_fr: '/foire-aux-questions'
controller: Rapsys\BlogBundle\Controller\DefaultController::frequentlyAskedQuestions
methods: GET
-rapsys_blog_terms_of_service:
+rapsysblog_terms_of_service:
path:
en_gb: '/en/terms-of-service'
fr_fr: '/conditions-generales-d-utilisation'
controller: Rapsys\BlogBundle\Controller\DefaultController::termsOfService
methods: GET
-rapsys_blog_user:
+rapsysblog_user:
path:
en_gb: '/en/user'
fr_fr: '/utilisateur'
controller: Rapsys\BlogBundle\Controller\UserController::index
methods: GET
-rapsys_blog_user_view:
+rapsysblog_user_view:
path:
en_gb: '/en/user/{id<\d+>}/{slug<[\w-]+>?}'
fr_fr: '/utilisateur/{id<\d+>}/{slug<[\w-]+>?}'
controller: Rapsys\BlogBundle\Controller\UserController::view
methods: GET|POST
-rapsys_user_confirm:
+rapsysuser_confirm:
path:
en_gb: '/en/confirm/{hash}/{mail}'
fr_fr: '/confirmer/{hash}/{mail}'
hash: '[a-zA-Z0-9=_-]+'
methods: GET|POST
-rapsys_user_edit:
+rapsysuser_edit:
path:
en_gb: '/en/user/{hash}/{mail}'
fr_fr: '/utilisateur/{hash}/{mail}'
hash: '[a-zA-Z0-9=_-]+'
methods: GET|POST
-rapsys_user_login:
+rapsysuser_login:
path:
en_gb: '/en/login/{hash}/{mail}'
fr_fr: '/connecter/{hash}/{mail}'
hash: '[a-zA-Z0-9=_-]+'
methods: GET|POST
-rapsys_user_logout:
+rapsysuser_logout:
path:
en_gb: '/en/logout'
fr_fr: '/deconnecter'
methods: GET
-rapsys_user_recover:
+rapsysuser_recover:
path:
en_gb: '/en/recover/{hash}/{pass}/{mail}'
fr_fr: '/recuperer/{hash}/{pass}/{mail}'
hash: '[a-zA-Z0-9=_-]+'
methods: GET|POST
-rapsys_user_register:
+rapsysuser_register:
path:
en_gb: '/en/register'
fr_fr: '/enregistrer'
text-align: justify;
}
+article header p {
+ margin-bottom: 0;
+}
+
article section,
section section {
padding: 0 .5rem;
--- /dev/null
+<!DOCTYPE html>
+<html{% if locale is defined and locale %} lang="{{ locale }}"{% endif %}>
+ <head{% if facebook is defined and facebook %} prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"{% endif %}>
+ {% block meta %}<meta charset="UTF-8">{% endblock %}
+ <title>{% block title %}{{ [title.page, title.section, title.site]|filter(v => v)|join(' - ') }}{% endblock %}</title>
+ {% block stylesheet %}
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ {% if description is defined and description %}
+ <meta name="description" content="{{ description }}" />
+ {% endif %}
+ {% if keywords is defined and keywords %}
+ <meta name="keywords" content="{{ keywords|join(', ') }}" />
+ {% endif %}
+ {% if icon is defined and icon %}
+ <link rel="shortcut icon" type="image/x-icon" href="{{ asset(icon.ico) }}" />
+ <link rel="icon" type="image/svg+xml" href="{{ asset(icon.svg) }}" />
+ {% for size, icon in icon.png %}
+ {# Apple #}
+ {% if size in [120, 152, 167, 180] %}
+ {% if size == 180 %}
+ <link rel="apple-touch-icon" href="{{ asset(icon) }}" />
+ {% endif %}
+ <link rel="apple-touch-icon" sizes="{{ size }}x{{ size }}" href="{{ asset(icon) }}" />
+ {# Windows #}
+ {% elseif size in [70, 150, 310] %}
+ <meta name="msapplication-square{{ size }}x{{ size }}logo" content="{{ asset(icon) }}" />
+ {# Others #}
+ {% else %}
+ <link rel="icon" type="image/png" sizes="{{ size }}x{{ size }}" href="{{ asset(icon) }}" />
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+ {% stopwatch 'stylesheet' %}
+ {# stylesheet '//fonts.googleapis.com/css?family=Irish+Grover' '//fonts.googleapis.com/css?family=La+Belle+Aurore' '@RapsysBlogBundle/css/{reset,screen}.css' #}
+ {% stylesheet '@RapsysBlog/css/{reset,droidsans,lemon,notoemoji,screen}.css' %}
+ <link rel="stylesheet" type="text/css" href="{{ asset }}?{{ 'now'|date('U') }}" />
+ {% endstylesheet %}
+ {% endstopwatch %}
+ {% if canonical is defined and canonical %}
+ <link rel="canonical" href="{{ canonical }}"{% if locale is defined and locale %} hreflang="{{ locale }}"{% endif %} />
+ {% endif %}
+ {% if alternates is defined and alternates %}
+ {% for lang, alternate in alternates %}
+ <link rel="alternate" href="{{ alternate.absolute }}" hreflang="{{ lang }}" />
+ {% endfor %}
+ {% endif %}
+ {% if prev is defined and prev %}
+ <link rel="prev" href="{{ prev }}" hreflang="{{ locale }}" />
+ {% endif %}
+ {% if next is defined and next %}
+ <link rel="next" href="{{ next }}" hreflang="{{ locale }}" />
+ {% endif %}
+ {% if facebook is defined and facebook %}
+ {% for property, contents in facebook %}
+ {% if contents is iterable %}
+ {% for content in contents %}
+ <meta property="{{ property }}" content="{{ content }}" />
+ {% endfor %}
+ {% else %}
+ <meta property="{{ property }}" content="{{ contents }}" />
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+ {% endblock %}
+ </head>
+ <body>
+ {% block body %}
+ {% block header %}
+ <header id="header">
+ {% if logo is defined and logo %}
+ {% block header_title %}
+ <a id="logo" href="{{ path(root) }}" title="{{ title.site }}">
+ <img src="{{ asset(logo.svg) }}?{{ 'now'|date('U') }}" srcset="{{ asset(logo.png) }}?{{ 'now'|date('U') }} 200w, {{ asset(logo.svg) }}?{{ 'now'|date('U') }} 400w" sizes="(min-width:400px) 400px, 200px" alt="{{ title.site }}" width="100" height="45" />
+ <strong>{{ title.site }}</strong>
+ </a>
+ {% endblock %}
+ {% endif %}
+ {% block header_nav %}
+ <nav id="nav">
+ <a href="{{ path('rapsysblog') }}" rel="home">{% trans %}Home{% endtrans %}</a>
+ <a href="{{ path('rapsysblog_contact') }}" rel="contact">{% trans %}Contact{% endtrans %}</a>
+ {#<a href="{{ path('rapsysblog_frequently_asked_questions') }}">{% trans %}Frequently asked questions{% endtrans %}</a>#}
+ {#{% if is_granted('ROLE_ADMIN') %}#}
+ <a href="{{ path('rapsysblog_user') }}">{% trans %}Users{% endtrans %}</a>
+ {#{% endif %}#}
+ {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
+ <a href="{{ path('rapsysuser_edit', {mail: app.user.mail|short, hash: app.user.mail|short|hash}) }}">{% trans %}My account{% endtrans %}</a>
+ <a href="{{ path('rapsysuser_logout') }}">{% trans %}Logout{% endtrans %}</a>
+ {% else %}
+ <a href="{{ path('rapsysuser_login') }}">{% trans %}Login{% endtrans %}</a>
+ <a href="{{ path('rapsysuser_register') }}">{% trans %}Register{% endtrans %}</a>
+ {% endif %}
+ </nav>
+ {% endblock %}
+ {#
+ {% block header_subtitle %}{% endblock %}
+ {% block header_tagline %}
+ {% if tags is defined and tags %}
+ <ul>
+ {% for id, tag in tags %}
+ <li><h2><a href="#{{id}}">{{tag}}</a></h2></li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ {% endblock %}
+ #}
+ </header>
+ {% endblock %}
+ {% block message %}
+ {# pass an array argument to get the messages of those types (['warning', 'error']) #}
+ {% for label, messages in app.flashes %}
+ {% if messages %}
+ <section class="message {{label}}">
+ <ul>
+ {% for message in messages %}
+ <li>{{ message }}</li>
+ {% endfor %}
+ </ul>
+ </section>
+ {% endif %}
+ {% endfor %}
+ {% endblock %}
+ {#{% block sidebar %}<aside id="sidebar"></aside>{% endblock %}#}
+ {% block content %}
+ <article>
+ <header>
+ {% block content_title %}<h1 id="title"><a href="{{ canonical }}">{{ title.page }}</a></h1>{% endblock %}>
+ <p>{{ description }}</p>
+ </header>
+ </article>
+ {% endblock %}
+ {% block footer %}
+ <footer id="footer">
+ <a href="{{ path('rapsysblog_about') }}">{% trans %}About{% endtrans %}</a>
+ {% if copy is defined and copy %}
+ <details><summary>{{ copy.long }}</summary><span>{{ copy.short }} <a href="{{ copy.link }}" title="{{ copy.title }}" rel="author">{{ copy.by }}</a></span></details>
+ {% endif %}
+ {#<a href="{{ path('rapsysblog_terms_of_service') }}">{% trans %}Terms of service{% endtrans %}</a>#}
+ {% if alternates is defined and alternates %}
+ {% set langs = alternates|keys|filter(v => v|length == 5) %}
+ {% if langs|length > 1 %}
+ <ul>
+ {% for lang in langs %}
+ <li><a href="{{ alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ alternates[lang].title }}">{{ alternates[lang].translated }}</a></li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ {% set lang = langs|first %}
+ <a href="{{ alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ alternates[lang].title }}">{{ alternates[lang].translated }}</a>
+ {% endif %}
+ {% else %}
+ <span> </span>
+ {% endif %}
+ </footer>
+ {% endblock %}
+ {% endblock %}
+ {% block javascript %}
+ {% stopwatch 'javascript' %}
+ {#{% javascript '@RapsysBlog/js/*.js' %}
+ <script type="text/javascript" src="{{ asset_url }}"></script>
+ {% endjavascript %}#}
+ {% endstopwatch %}
+ {% endblock %}
+ </body>
+</html>
{% block content %}
<article id="content">
<header>
- <h1><a href="{{ head.canonical }}">{{ title }}</a></h1>
+ <h1><a href="{{ canonical }}">{{ title.page }}</a></h1>
<p>{{ description }}</p>
</header>
<section>
--- /dev/null
+{% extends '@RapsysBlog/_base.html.twig' %}
+{% block content %}
+ <section id="content">
+ <header>
+ <h1><a href="{{ path('rapsysblog_article') }}">{{ title.page }}</a></h1>
+ <p>{{ description }}</p>
+ </header>
+ <section>
+ {% for article in articles %}
+ <article>
+ <header>
+ <h2><a href="{{ path('rapsysblog_article_view', {'id': article.id, 'slug': article.slug}) }}">{{ article.title }}</a></h2>
+ </header>
+ <section>
+ <p>{{ article.description }}</p>
+ {% if article.keywords is defined and article.keywords %}
+ <nav>
+ {% for keyword in article.keywords %}
+ <a href="{{ path('rapsysblog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
+ {% endfor %}
+ </nav>
+ {% endif %}
+ </section>
+ <footer>
+ <nav>
+ <a href="{{ path('rapsysblog_article_view', {'id': article.id, 'slug': article.slug}) }}">{% trans %}Read more{% endtrans %}...</a>
+ </nav>
+ </footer>
+ </article>
+ {% endfor %}
+ </section>
+ {% if ( prev is defined and prev ) or ( next is defined and next ) %}
+ <footer>
+ <nav class="pager">
+ {% if prev is defined and prev %}
+ <a href="{{ prev }}" rel="prev">< {% trans %}Previous articles{% endtrans %}</a>
+ {% endif %}
+ {% if next is defined and next %}
+ <a href="{{ next }}" rel="next">{% trans %}Next articles{% endtrans %} ></a>
+ {% endif %}
+ </nav>
+ </footer>
+ {% endif %}
+ </section>
+{% endblock %}
{% extends '@RapsysBlog/_base.html.twig' %}
-{% block title %}{% endblock %}
{% block content %}
<article id="content">
<header>
- <h1 id="title"><a href="{{ head.canonical }}">{{ title }}</a></h1>
+ <h1 id="title"><a href="{{ canonical }}">{{ title.page }}</a></h1>
<p>{% trans with {'%date%': article.created|format_datetime('full', 'short')} %}Published the %date%{% endtrans %}{% if article.created != article.updated %}{% trans with {'%date%': article.updated|format_datetime('short', 'short')} %}, edited the %date%{% endtrans %}{% endif %}</p>
</header>
<section>
{% if article.keywords is defined and article.keywords %}
<nav>
{% for keyword in article.keywords %}
- <a href="{{ path('rapsys_blog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
+ <a href="{{ path('rapsysblog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
{% endfor %}
</nav>
{% endif %}
--- /dev/null
+{% extends '@RapsysBlog/_base.html.twig' %}
+{% block content %}
+ <section class="form">
+ <header>
+ <h1><a href="{{ canonical }}">{{ title.page }}</a></h1>
+ <p>{{ description }}</p>
+ </header>
+ <section>
+ {{ form_start(contact) }}
+ {{ form_row(contact.subject) }}
+
+ {{ form_row(contact.name) }}
+
+ {{ form_row(contact.mail) }}
+
+ {{ form_row(contact.message) }}
+
+ {{ form_row(contact.captcha) }}
+
+ {{ form_row(contact.submit) }}
+
+ {# Render CSRF token etc .#}
+ <div style="display:none">{{ form_rest(contact) }}</div>
+ {{ form_end(contact) }}
+ </section>
+ </section>
+{% endblock %}
{% block content %}
<section class="form">
<header>
- <h2><a href="{{ head.canonical }}">{{ title }}</a></h2>
+ <h2><a href="{{ canonical }}">{{ title.page }}</a></h2>
</header>
<section>
{% if disabled is defined and disabled %}
<p class="message notice">{% trans %}Your verification mail has been sent, to activate your account follow the confirmation link inside{% endtrans %}</p>
<p class="message warning">{% trans %}If you did not receive a verification mail, check your Spam or Junk mail folder{% endtrans %}</p>
{% else %}
- {{ form_start(edit) }}
- {% if edit.mail is defined %}
- {{ form_row(edit.mail) }}
+ {{ form_start(register) }}
+ {% if register.mail is defined %}
+ {{ form_row(register.mail) }}
{% endif %}
- {% if edit.password is defined %}
- {{ form_row(edit.password) }}
+ {% if register.password is defined %}
+ {{ form_row(register.password) }}
{% endif %}
- {% if edit.civility is defined %}
- {{ form_row(edit.civility) }}
+ {% if register.civility is defined %}
+ {{ form_row(register.civility) }}
{% endif %}
- {% if edit.forename is defined %}
- {{ form_row(edit.forename) }}
+ {% if register.forename is defined %}
+ {{ form_row(register.forename) }}
{% endif %}
- {% if edit.surname is defined %}
- {{ form_row(edit.surname) }}
+ {% if register.surname is defined %}
+ {{ form_row(register.surname) }}
{% endif %}
- {% if edit.pseudonym is defined %}
- {{ form_row(edit.pseudonym) }}
+ {% if register.pseudonym is defined %}
+ {{ form_row(register.pseudonym) }}
{% endif %}
- {% if edit.slug is defined %}
- {{ form_row(edit.slug) }}
+ {% if register.slug is defined %}
+ {{ form_row(register.slug) }}
{% endif %}
- {% if edit.active is defined %}
- {{ form_row(edit.active) }}
+ {% if register.active is defined %}
+ {{ form_row(register.active) }}
{% endif %}
- {% if edit.enable is defined %}
- {{ form_row(edit.enable) }}
+ {% if register.enable is defined %}
+ {{ form_row(register.enable) }}
{% endif %}
- {{ form_row(edit.submit) }}
+ {{ form_row(register.submit) }}
{# Render CSRF token etc .#}
- <footer style="display:none">{{ form_rest(edit) }}</footer>
- {{ form_end(edit) }}
+ <footer style="display:none">{{ form_rest(register) }}</footer>
+ {{ form_end(register) }}
{% endif %}
</section>
</section>
{% if reset is defined %}
<section class="form">
<header>
- <h2><a href="{{ head.canonical }}">{{ password }}</a></h2>
+ <h2><a href="{{ canonical }}">{{ password }}</a></h2>
</header>
<section>
{{ form_start(reset) }}
{% block content %}
<section class="form">
<header>
- <h2><a href="{{ path('rapsys_user_login') }}">{{ title }}</a></h2>
+ <h2><a href="{{ path('rapsysuser_login') }}">{{ title.page }}</a></h2>
</header>
<section>
{{ form_start(login) }}
{% if recover is defined %}
<section class="form">
<header>
- <h2><a href="{{ path('rapsys_user_recover') }}">{% trans %}Recover{% endtrans %}</a></h2>
+ <h2><a href="{{ path('rapsysuser_recover') }}">{% trans %}Recover{% endtrans %}</a></h2>
</header>
<section>
{{ form_start(recover) }}
--- /dev/null
+{% extends '@RapsysBlog/_base.html.twig' %}
+{% block content %}
+ <section class="form">
+ <header>
+ <h2><a href="{{ path('rapsysuser_recover') }}">{{ title.page }}</a></h2>
+ </header>
+ <section>
+ {{ form_start(recover) }}
+ {% if recover.mail is defined %}
+ {{ form_row(recover.mail) }}
+ {% endif %}
+
+ {% if recover.password is defined %}
+ {{ form_row(recover.password) }}
+ {% endif %}
+
+ {{ form_row(recover.submit) }}
+
+ {# Render CSRF token etc .#}
+ <footer style="display:none">{{ form_rest(recover) }}</footer>
+ {{ form_end(recover) }}
+ </section>
+ </section>
+{% endblock %}
{% block content %}
<section class="form">
<header>
- <h2><a href="{{ path('rapsys_user_register') }}">{{ title }}</a></h2>
+ <h2><a href="{{ path('rapsysuser_register') }}">{{ title.page }}</a></h2>
</header>
<section>
{% if disabled is defined and disabled %}
--- /dev/null
+{% extends '@RapsysBlog/_base.html.twig' %}
+{% block content %}
+ <section id="content">
+ <header>
+ <h1 id="title"><a href="{{ canonical }}">{{ title.page }}</a></h1>
+ <p>{{ description }}</p>
+ </header>
+ <section>
+ {% for article in articles %}
+ <article>
+ <header>
+ <h2><a href="{{ path('rapsysblog_article_view', {'id': article.id, 'slug': article.slug}) }}">{{ article.title }}</a></h2>
+ </header>
+ <section>
+ <p>{{ article.description }}</p>
+ {% if article.keywords is defined and article.keywords %}
+ <nav>
+ {% for keyword in article.keywords %}
+ <a href="{{ path('rapsysblog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
+ {% endfor %}
+ </nav>
+ {% endif %}
+ </section>
+ <footer>
+ <nav>
+ <a href="{{ path('rapsysblog_article_view', {'id': article.id, 'slug': article.slug}) }}">{% trans %}Read more{% endtrans %}...</a>
+ </nav>
+ </footer>
+ </article>
+ {% endfor %}
+ </section>
+ {% if ( prev is defined and prev ) or ( next is defined and next ) %}
+ <footer>
+ <nav class="pager">
+ {% if prev is defined and prev %}
+ <a href="{{ prev }}" rel="prev">< {% trans %}Previous articles{% endtrans %}</a>
+ {% endif %}
+ {% if next is defined and next %}
+ <a href="{{ next }}" rel="next">{% trans %}Next articles{% endtrans %} ></a>
+ {% endif %}
+ </nav>
+ </footer>
+ {% endif %}
+ </section>
+{% endblock %}
--- /dev/null
+{% extends '@RapsysBlog/_base.html.twig' %}
+{% block content %}
+ <section id="content">
+ <header>
+ <h1><a href="{{ path('rapsysblog_keyword') }}">{{ title.page }}</a></h1>
+ <p>{{ description }}</p>
+ </header>
+ <section>
+ {% for keyword in keywords %}
+ <article>
+ <header>
+ <h2><a href="{{ path('rapsysblog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a></h2>
+ </header>
+ <section>
+ <p>{{ keyword.description }}</p>
+ {#{% if article.keywords is defined and article.keywords %}
+ <nav>
+ {% for keyword in article.keywords %}
+ <a href="{{ path('rapsysblog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
+ {% endfor %}
+ </nav>
+ {% endif %}#}
+ </section>
+ <footer>
+ <nav>
+ <a href="{{ path('rapsysblog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{% trans %}Read more{% endtrans %}...</a>
+ </nav>
+ </footer>
+ </article>
+ {% endfor %}
+ </section>
+ {% if ( prev is defined and prev ) or ( next is defined and next ) %}
+ <footer>
+ <nav class="pager">
+ {% if prev is defined and prev %}
+ <a href="{{ prev }}" rel="prev">< {% trans %}Previous keywords{% endtrans %}</a>
+ {% endif %}
+ {% if next is defined and next %}
+ <a href="{{ next }}" rel="next">{% trans %}Next keywords{% endtrans %} ></a>
+ {% endif %}
+ </nav>
+ </footer>
+ {% endif %}
+ </section>
+{% endblock %}
{% extends '@RapsysBlog/_base.html.twig' %}
-{% block title %}{% endblock %}
{% block content %}
<article id="content">
<header>
- <h1 id="title"><a href="{{ head.canonical }}">{{ title }}</a></h1>
+ <h1 id="title"><a href="{{ canonical }}">{{ title.page }}</a></h1>
<p>{% trans with {'%date%': keyword.created|format_datetime('full', 'short')} %}Published the %date%{% endtrans %}{% if keyword.created != keyword.updated %}{% trans with {'%date%': keyword.updated|format_datetime('short', 'short')} %}, edited the %date%{% endtrans %}{% endif %}</p>
<p>{{ keyword.description }}</p>
</header>
{% for article in keyword.articles %}
<article>
<header>
- <h2><a href="{{ path('rapsys_blog_article_view', {'id': article.id, 'slug': article.slug}) }}">{{ article.title }}</a></h2>
+ <h2><a href="{{ path('rapsysblog_article_view', {'id': article.id, 'slug': article.slug}) }}">{{ article.title }}</a></h2>
</header>
<section>
<p>{{ article.description }}</p>
{% if article.keywords is defined and article.keywords %}
<nav>
{% for keyword in article.keywords %}
- <a href="{{ path('rapsys_blog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
+ <a href="{{ path('rapsysblog_keyword_view', {'id': keyword.id, 'slug': keyword.slug}) }}">{{ keyword.title }}</a>
{% endfor %}
</nav>
{% endif %}
</section>
<footer>
<nav>
- <a href="{{ path('rapsys_blog_article_view', {'id': article.id, 'slug': article.slug}) }}">{% trans %}Read more{% endtrans %}...</a>
+ <a href="{{ path('rapsysblog_article_view', {'id': article.id, 'slug': article.slug}) }}">{% trans %}Read more{% endtrans %}...</a>
</nav>
</footer>
</article>
--- /dev/null
+{% extends '@RapsysBlog/_base.html.twig' %}
+{% block head %}
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ {% if locale is defined and locale %}<meta http-equiv="Content-Language" content="{{ locale }}" />{% endif %}
+{% endblock %}
+{% block stylesheet %}
+ <style type="text/css">
+ body {background:white;color:#222}
+ a {text-decoration:none;color:#15c}
+ a:hover {text-decoration:underline}
+ a.link {word-break:break-all;font-size:1.5rem}
+ h1 {margin: .5rem;font-size: 2rem}
+ table {width: 100%;border-radius: .5rem}
+ table.header {border:.1rem solid #09c;text-align:center}
+ table.content {background:white;border:.1rem solid #09c;margin:.5rem 0}
+ table.footer {border:.1rem solid #09c;text-align:center;font-weight:bold}
+ table.footer summary:after {display:none}
+ table.footer summary::-webkit-details-marker {display:none}
+ </style>
+{% endblock %}
+{% block body %}
+ <table class="header">
+ <tr>
+ {% if logo is defined and logo %}<td><a href="{{ url(root)|escape('html_attr') }}"><img src="{{ email.image(logo.png) }}" alt="{{ logo.alt|escape('html_attr') }}" /></a></td>{% endif %}
+ <td><h1><a href="{{ url(root)|escape('html_attr') }}">{{ title.site }}</a></h1></td>
+ </tr>
+ </table>
+ {% block content %}{% endblock %}
+ {% if copy is defined and copy %}
+ <table class="footer">
+ <tr>
+ <td colspan="2">{{ copy.long }} - {{ copy.short }}</td>
+ </tr>
+ </table>
+ {% endif %}
+{% endblock %}
<tbody>
<tr>
<td colspan="2">
- <h2 title="{% trans %}Subject{% endtrans %}">{{ 'Welcome back to %head.site%'|trans({'%head.site%': head.site}) }}</h2>
+ <h2 title="{% trans %}Subject{% endtrans %}">{{ 'Welcome back to %title.site%'|trans({'%title.site%': title.site}) }}</h2>
<h3>{% if recipient_name %}{{ 'Hi %recipient_name%,'|trans({'%recipient_name%': recipient_name}) }}{% else %}{% trans %}Hi,{% endtrans %}{% endif %}</h3>
- <p>{{ 'Thanks so much for rejoining %head.site%, the blog program.'|trans({'%head.site%': head.site}) }}</p>
+ <p>{{ 'Thanks so much for rejoining %title.site%, the blog program.'|trans({'%title.site%': title.site}) }}</p>
<p>{% trans %}To recover your account follow this link:{% endtrans %}</p>
<p><a href="{{ recover_url|escape('html_attr') }}" class="link">{{ recover_url }}</a></p>
</td>
{% for i in range(1, subject|length) %}={% endfor %}
-*{{ 'Thanks so much for rejoining %head.site%, the blog program.'|trans({'%head.site%': head.site}) }}*
+*{{ 'Thanks so much for rejoining %title.site%, the blog program.'|trans({'%title.site%': title.site}) }}*
{% trans %}To recover your account follow this link:{% endtrans %}
{{ recover_url }}
<tbody>
<tr>
<td colspan="2">
- <h2 title="{% trans %}Subject{% endtrans %}">{{ 'Welcome to %head.site%'|trans({'%head.site%': head.site}) }}</h2>
+ <h2 title="{% trans %}Subject{% endtrans %}">{{ 'Welcome to %title.site%'|trans({'%title.site%': title.site}) }}</h2>
<h3>{% if recipient_name %}{{ 'Hi %recipient_name%,'|trans({'%recipient_name%': recipient_name}) }}{% else %}{% trans %}Hi,{% endtrans %}{% endif %}</h3>
- <p>{{ 'Thanks so much for joining %head.site%, the blog program.'|trans({'%head.site%': head.site}) }}</p>
+ <p>{{ 'Thanks so much for joining %title.site%, the blog program.'|trans({'%title.site%': title.site}) }}</p>
<p>{% trans %}To finalize your account follow this link:{% endtrans %}</p>
<p><a href="{{ confirm_url|escape('html_attr') }}">{{ confirm_url }}</a></p>
</td>
{% for i in range(1, subject|length) %}={% endfor %}
-*{{ 'Thanks so much for joining %head.site%, the blog program.'|trans({'%head.site%': head.site}) }}*
+*{{ 'Thanks so much for joining %title.site%, the blog program.'|trans({'%title.site%': title.site}) }}*
{% trans %}To finalize your account follow this link:{% endtrans %}
{{ confirm_url }}
{% block content %}
<section id="content">
<header>
- <h1><a href="{{ path('rapsys_blog_user') }}">{{ title }}</a></h1>
+ <h1><a href="{{ path('rapsysblog_user') }}">{{ title.page }}</a></h1>
</header>
<section>
{% for user in users %}
</article>
{% endfor %}
</section>
- {% if head.prev is defined or head.next is defined %}
+ {% if ( prev is defined and prev ) or ( next is defined and next ) %}
<footer>
<nav class="pager">
- {% if head.prev is defined %}
- <a href="{{ head.prev }}" rel="prev">< {% trans %}Previous users{% endtrans %}</a>
+ {% if prev is defined and prev %}
+ <a href="{{ prev }}" rel="prev">< {% trans %}Previous users{% endtrans %}</a>
{% endif %}
- {% if head.next is defined %}
- <a href="{{ head.next }}" rel="next">{% trans %}Next users{% endtrans %} ></a>
+ {% if next is defined and next %}
+ <a href="{{ next }}" rel="next">{% trans %}Next users{% endtrans %} ></a>
{% endif %}
</nav>
</footer>
contact: contact
Captcha is empty: Captcha is empty
Subject: Subject
-Name: Name
-Your name: Your name
-Mail: Mail
-Your mail: Your mail
-Message: Message
-Your message: Your message
-Send: Send
Your message has been sent: Your message has been sent
, edited the %date%: , edited the %date%
-Thanks so much for joining %head.site%, the blog program.: Thanks so much for joining %head.site%, the blog program.
+Thanks so much for joining %title.site%, the blog program.: Thanks so much for joining %title.site%, the blog program.
'To finalize your account follow this link:': 'To finalize your account follow this link:'
-Thanks so much for rejoining %head.site%, the blog program.: Thanks so much for rejoining %head.site%, the blog program.
+Thanks so much for rejoining %title.site%, the blog program.: Thanks so much for rejoining %title.site%, the blog program.
'To recover your account follow this link': 'To recover your account follow this link:'
-Welcome back to %head.site%: Welcome back to %head.site%
+Welcome back to %title.site%: Welcome back to %title.site%
Hi %recipient_name%,: Hi %recipient_name%,
Hi,: Hi,
-Welcome to %head.site%: Welcome to %head.site%
+Welcome to %title.site%: Welcome to %title.site%
Dev log: Dev log
Recover: Recover
Your account has been disabled: Your account has been disabled
Your forename: Your forename
Surname: Surname
Your surname: Your surname
+Pseudonym: Pseudonym
+Your pseudonym: Your pseudonym
+Slug: Slug
+Your slug: Your slug
contact: contacter
Captcha is empty: Le captcha est vide
Subject: Sujet
-Name: Nom
-Your name: Votre nom
-Mail: Courriel
-Your mail: Votre courriel
-Message: Message
-Your message: Votre message
-Send: Envoyer
Your message has been sent: Votre message a été envoyé
, edited the %date%: , edité le %date%
-Thanks so much for joining %head.site%, the blog program.: Merci d'avoir rejoint %head.site%, le programme de blog.
+Thanks so much for joining %title.site%, the blog program.: Merci d'avoir rejoint %title.site%, le programme de blog.
'To finalize your account follow this link:': 'Pour finaliser votre compte suivez ce lien:'
-Thanks so much for rejoining %head.site%, the blog program.: Merci d'avoir rejoint de nouveau %head.site%, le programme de blog.
+Thanks so much for rejoining %title.site%, the blog program.: Merci d'avoir rejoint de nouveau %title.site%, le programme de blog.
'To recover your account follow this link': 'Pour récupérer votre compte suivez ce lien:'
-Welcome back to %head.site%: Bienvenue à nouveau sur %head.site%
+Welcome back to %title.site%: Bienvenue à nouveau sur %title.site%
Hi %recipient_name%,: Salut %recipient_name%,
Hi,: Salut,
-Welcome to %head.site%: Bienvenue sur %head.site%
+Welcome to %title.site%: Bienvenue sur %title.site%
Dev log: Journal de développement
Recover: Récupérer
Your account has been disabled: Votre compte a été désactivé
Your forename: Votre prénom
Surname: Nom de famille
Your surname: Votre nom de famille
+Pseudonym: Pseudonyme
+Your pseudonym: Votre pseudonyme
+Slug: Identificateur
+Your slug: Votre identificateur
--- /dev/null
+Subject: Subject
+Name: Name
+Your name: Your name
+Mail: Mail
+Your mail: Your mail
+Message: Message
+Your message: Your message
+Send: Send
--- /dev/null
+Subject: Sujet
+Name: Nom
+Your name: Votre nom
+Mail: Courriel
+Your mail: Votre courriel
+Message: Message
+Your message: Votre message
+Send: Envoyer
+Your message has been sent: Votre message a été envoyé