Browse Source

implement profile page #17

main
ghost 1 year ago
parent
commit
ae8ec4823a
  1. 2
      .env
  2. 2
      public/asset/default/css/common.css
  3. 22
      public/asset/default/css/framework.css
  4. 33
      src/Controller/DashboardController.php
  5. 20
      src/Controller/HomeController.php
  6. 5
      src/Controller/PageController.php
  7. 76
      src/Controller/ProfileController.php
  8. 161
      src/Controller/UserController.php
  9. 68
      src/Entity/User.php
  10. 41
      src/Repository/UserRepository.php
  11. 12
      src/Service/User.php
  12. 63
      src/Service/UserService.php
  13. 0
      templates/default/dashboard/index.html.twig
  14. 6
      templates/default/layout.html.twig
  15. 2
      templates/default/profile/index.html.twig
  16. 178
      templates/default/profile/module.html.twig
  17. 2
      templates/default/profile/setting.html.twig
  18. 92
      templates/default/user/info.html.twig
  19. 186
      templates/default/user/module.html.twig
  20. 105
      templates/default/user/profile.html.twig
  21. 20
      templates/redirect/index.html.twig

2
.env

@ -50,4 +50,4 @@ APP_VERSION='2.0.0'
APP_NAME=YGGtracker APP_NAME=YGGtracker
APP_LOCALE=en APP_LOCALE=en
APP_LOCALES=en|uk APP_LOCALES=en|uk

2
public/asset/default/css/common.css

@ -54,7 +54,7 @@ textarea {
color: #ccc; color: #ccc;
border: 0; border: 0;
border-radius: 3px; border-radius: 3px;
padding: 6px 8px; padding: 8px;
font-size: 13px; font-size: 13px;
} }

22
public/asset/default/css/framework.css

@ -118,6 +118,10 @@ a.label-green:hover {
position: fixed; position: fixed;
} }
.position-absolute {
position: absolute;
}
.vertical-align-middle { .vertical-align-middle {
vertical-align: middle; vertical-align: middle;
} }
@ -170,7 +174,7 @@ a.label-green:hover {
border-top: 1px #5d627d solid; border-top: 1px #5d627d solid;
} }
.border-width-2 { .border-width-2-px {
border-width: 2px; border-width: 2px;
} }
@ -299,6 +303,10 @@ a:visited.background-color-hover-night-light:hover {
padding: 16px; padding: 16px;
} }
.padding-24-px {
padding: 24px;
}
.margin-l-4-px { .margin-l-4-px {
margin-left: 4px; margin-left: 4px;
} }
@ -328,6 +336,10 @@ a:visited.background-color-hover-night-light:hover {
margin-left: 12px; margin-left: 12px;
} }
.margin-l-96-px {
margin-left: 96px;
}
.margin-l--196-px { .margin-l--196-px {
margin-left: -196px; margin-left: -196px;
} }
@ -366,6 +378,10 @@ a:visited.background-color-hover-night-light:hover {
display: block; display: block;
} }
.display-flex {
display: flex;
}
.opacity-0 { .opacity-0 {
opacity: 0; opacity: 0;
} }
@ -410,6 +426,10 @@ a:visited.background-color-hover-night-light:hover {
width: 80%; width: 80%;
} }
.width-80-px {
width: 80px;
}
.width-180-px { .width-180-px {
width: 180px; width: 180px;
} }

33
src/Controller/DashboardController.php

@ -0,0 +1,33 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
class DashboardController extends AbstractController
{
#[Route('/')]
public function indexNoLocale(): Response
{
return $this->redirectToRoute(
'dashboard_index',
[
'_locale' => 'en'
]
);
}
#[Route(
'/{_locale}',
name: 'dashboard_index'
)]
public function index(Request $request): Response
{
return $this->render(
'default/dashboard/index.html.twig'
);
}
}

20
src/Controller/HomeController.php

@ -1,20 +0,0 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
class HomeController extends AbstractController
{
#[Route(
'/{_locale}/',
name: 'home_index'
)]
public function index(Request $request): Response
{
return $this->render('default/home/index.html.twig');
}
}

5
src/Controller/PageController.php

@ -15,6 +15,11 @@ class PageController extends AbstractController
)] )]
public function submit(): Response public function submit(): Response
{ {
/*
return $this->redirectToRoute('page', [
'id' => $page->getId()
]);
*/
return $this->render('default/page/submit.html.twig', [ return $this->render('default/page/submit.html.twig', [
// @TODO // @TODO
]); ]);

76
src/Controller/ProfileController.php

@ -1,76 +0,0 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use App\Service\User;
class ProfileController extends AbstractController
{
#[Route(
'/{_locale}/profile',
name: 'profile_index'
)]
public function index(Request $request, User $user): Response
{
return $this->render(
'default/profile/index.html.twig',
[
'user' => $user->init($request->getClientIp())
]
);
}
#[Route(
'/{_locale}/profile/setting',
name: 'profile_setting'
)]
public function setting(): Response
{
// @TODO
return $this->render(
'default/profile/setting.html.twig'
);
}
public function module(string $route = ''): Response
{
return $this->render(
'default/profile/module.html.twig',
[
'route' => $route,
'stars' => 0,
'views' => 0,
'comments' => 0,
'downloads' => 0,
'editions' => 0,
'identicon' => $this->_getIdenticon(
'@TODO',
17,
[
'backgroundColor' => 'rgba(255, 255, 255, 0)',
]
)
]
);
}
private function _getIdenticon(
mixed $id,
int $size,
array $style,
string $format = 'webp') : string
{
$identicon = new \Jdenticon\Identicon();
$identicon->setValue($id);
$identicon->setSize($size);
$identicon->setStyle($style);
return $identicon->getImageDataUri($format);
}
}

161
src/Controller/UserController.php

@ -0,0 +1,161 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use App\Service\UserService;
use App\Service\TimeService;
class UserController extends AbstractController
{
#[Route(
'/{_locale}/profile',
name: 'user_profile',
defaults: [
'_locale' => '%app.locale%'
],
requirements: [
'_locale' => '%app.locales%',
],
)]
public function profile(
Request $request,
UserService $userService,
TimeService $timeService): Response
{
// Init user
$user = $userService->init(
$request->getClientIp()
);
// Process post request
if ($request->isMethod('post'))
{
// Update locale
if (in_array($request->get('locale'), explode('|', $this->getParameter('app.locales'))))
{
$user->setLocale(
$request->get('locale')
);
}
// Update locales
if ($request->get('locales'))
{
$user->setLocales(
$request->get('locales')
);
}
// Save changes to DB
$userService->save($user);
}
// Generate identicon
$identicon = new \Jdenticon\Identicon();
$identicon->setValue($user->getAddress());
$identicon->setSize(48);
$identicon->setStyle(
[
'backgroundColor' => 'rgba(255, 255, 255, 0)',
'padding' => 0
]
);
// Render template
return $this->render(
'default/user/profile.html.twig',
[
'user' => [
'id' => $user->getId(),
'address' => $request->getClientIp() == $user->getAddress() ? $user->getAddress() : false,
'moderator' => $user->isModerator(),
'approved' => $user->isApproved(),
'status' => $user->isStatus(),
'locale' => $user->getLocale(),
'locales' => $user->getLocales(),
'added' => $timeService->ago(
$user->getAdded()
),
'identicon' => $identicon->getImageDataUri('webp'),
],
'locales' => explode('|', $this->getParameter('app.locales'))
]
);
}
#[Route(
'/{_locale}/user/{id}',
name: 'user_info',
defaults: [
'_locale' => '%app.locale%'
],
requirements: [
'_locale' => '%app.locales%',
],
)]
public function info(
int $id,
Request $request,
UserService $userService,
TimeService $timeService): Response
{
// Init user
if (!$user = $userService->get($id))
{
throw $this->createNotFoundException();
}
// Generate identicon
$identicon = new \Jdenticon\Identicon();
$identicon->setValue($user->getAddress());
$identicon->setSize(48);
$identicon->setStyle(
[
'backgroundColor' => 'rgba(255, 255, 255, 0)',
'padding' => 0
]
);
// Render template
return $this->render(
'default/user/info.html.twig',
[
'user' => [
'id' => $user->getId(),
'address' => $request->getClientIp() == $user->getAddress() ? $user->getAddress() : false,
'moderator' => $user->isModerator(),
'approved' => $user->isApproved(),
'status' => $user->isStatus(),
'locale' => $user->getLocale(),
'locales' => $user->getLocales(),
'added' => $timeService->ago(
$user->getAdded()
),
'identicon' => $identicon->getImageDataUri('webp'),
]
]
);
}
public function module(string $route = ''): Response
{
return $this->render(
'default/user/module.html.twig',
[
'route' => $route,
'stars' => 0,
'views' => 0,
'comments' => 0,
'downloads' => 0,
'editions' => 0,
]
);
}
}

68
src/Entity/User.php

@ -3,6 +3,7 @@
namespace App\Entity; namespace App\Entity;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UserRepository::class)] #[ORM\Entity(repositoryClass: UserRepository::class)]
@ -19,15 +20,6 @@ class User
#[ORM\Column] #[ORM\Column]
private ?int $added = null; private ?int $added = null;
#[ORM\Column]
private ?int $updated = null;
#[ORM\Column]
private ?int $visited = null;
#[ORM\Column]
private ?bool $public = null;
#[ORM\Column] #[ORM\Column]
private ?bool $moderator = null; private ?bool $moderator = null;
@ -37,6 +29,12 @@ class User
#[ORM\Column] #[ORM\Column]
private ?bool $status = null; private ?bool $status = null;
#[ORM\Column(length: 2)]
private ?string $locale = null;
#[ORM\Column(type: Types::ARRAY)]
private array $locales = [];
public function getId(): ?int public function getId(): ?int
{ {
return $this->id; return $this->id;
@ -73,74 +71,62 @@ class User
return $this; return $this;
} }
public function getUpdated(): ?int public function isModerator(): ?bool
{
return $this->updated;
}
public function setUpdated(int $updated): static
{
$this->updated = $updated;
return $this;
}
public function getVisited(): ?int
{ {
return $this->visited; return $this->moderator;
} }
public function setVisited(int $visited): static public function setModerator(bool $moderator): static
{ {
$this->visited = $visited; $this->moderator = $moderator;
return $this; return $this;
} }
public function isPublic(): ?bool public function isApproved(): ?bool
{ {
return $this->public; return $this->approved;
} }
public function setPublic(bool $public): static public function setApproved(bool $approved): static
{ {
$this->public = $public; $this->approved = $approved;
return $this; return $this;
} }
public function isModerator(): ?bool public function isStatus(): ?bool
{ {
return $this->moderator; return $this->status;
} }
public function setModerator(bool $moderator): static public function setStatus(bool $status): static
{ {
$this->moderator = $moderator; $this->status = $status;
return $this; return $this;
} }
public function isApproved(): ?bool public function getLocale(): ?string
{ {
return $this->approved; return $this->locale;
} }
public function setApproved(bool $approved): static public function setLocale(string $locale): static
{ {
$this->approved = $approved; $this->locale = $locale;
return $this; return $this;
} }
public function isStatus(): ?bool public function getLocales(): array
{ {
return $this->status; return $this->locales;
} }
public function setStatus(bool $status): static public function setLocales(array $locales): static
{ {
$this->status = $status; $this->locales = $locales;
return $this; return $this;
} }

41
src/Repository/UserRepository.php

@ -21,28 +21,23 @@ class UserRepository extends ServiceEntityRepository
parent::__construct($registry, User::class); parent::__construct($registry, User::class);
} }
// /** public function findOneByIdField(int $id): ?User
// * @return User[] Returns an array of User objects {
// */ return $this->createQueryBuilder('u')
// public function findByExampleField($value): array ->where('u.id = :id')
// { ->setParameter('id', $id)
// return $this->createQueryBuilder('u') ->getQuery()
// ->andWhere('u.exampleField = :val') ->getOneOrNullResult()
// ->setParameter('val', $value) ;
// ->orderBy('u.id', 'ASC') }
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?User public function findOneByAddressField(string $address): ?User
// { {
// return $this->createQueryBuilder('u') return $this->createQueryBuilder('u')
// ->andWhere('u.exampleField = :val') ->where('u.address = :address')
// ->setParameter('val', $value) ->setParameter('address', $address)
// ->getQuery() ->getQuery()
// ->getOneOrNullResult() ->getOneOrNullResult()
// ; ;
// } }
} }

12
src/Service/User.php

@ -1,12 +0,0 @@
<?php
namespace App\Service;
class User
{
public function init(string $address): string
{
// @TODO
return $address;
}
}

63
src/Service/UserService.php

@ -0,0 +1,63 @@
<?php
namespace App\Service;
use App\Entity\User;
use App\Repository\UserRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
class UserService
{
private EntityManagerInterface $entityManager;
private UserRepository $userRepository;
private ParameterBagInterface $parameterBagInterface;
public function __construct(EntityManagerInterface $entityManager, ParameterBagInterface $parameterBagInterface)
{
$this->entityManager = $entityManager;
$this->userRepository = $entityManager->getRepository(User::class);
$this->parameterBagInterface = $parameterBagInterface;
}
public function init(string $address): User
{
// Return existing user
if ($result = $this->userRepository->findOneByAddressField($address))
{
return $result;
}
// Create new user
$user = new User();
$user->setAddress($address);
$user->setAdded(time());
$user->setApproved(false);
$user->setModerator(false);
$user->setStatus(true);
$user->setLocale(
$this->parameterBagInterface->get('app.locale')
);
$user->setLocales(
explode('|', $this->parameterBagInterface->get('app.locales'))
);
$this->save($user);
// Return user data
return $user;
}
public function get(int $id): ?User
{
return $this->userRepository->findOneByIdField($id);
}
public function save(User $user) : void
{
$this->entityManager->persist($user);
$this->entityManager->flush();
}
}

0
templates/default/home/index.html.twig → templates/default/dashboard/index.html.twig

6
templates/default/layout.html.twig

@ -13,7 +13,7 @@
<header> <header>
<div class="container"> <div class="container">
<div class="row margin-t-8-px text-center"> <div class="row margin-t-8-px text-center">
<a class="logo" href="{{ path('home_index') }}"> <a class="logo" href="{{ path('dashboard_index') }}">
<span>YGG</span>tracker <span>YGG</span>tracker
</a> </a>
{% block header_search %} {% block header_search %}
@ -32,11 +32,11 @@
<div class="column width-100"> <div class="column width-100">
{% block main_profile %} {% block main_profile %}
{{ render(controller( {{ render(controller(
'App\\Controller\\ProfileController::module', 'App\\Controller\\UserController::module',
{route : app.request.get('_route')} {route : app.request.get('_route')}
)) }} )) }}
{% endblock %} {% endblock %}
<div class="padding-16-px margin-y-8-px border-radius-3-px background-color-night"> <div class="padding-24-px margin-y-8-px border-radius-3-px background-color-night">
{% block main_content %}{% endblock %} {% block main_content %}{% endblock %}
</div> </div>
</div> </div>

2
templates/default/profile/index.html.twig

@ -1,2 +0,0 @@
{% extends 'default/layout.html.twig' %}
{% block title %}{{ 'Profile - Settings'|trans }} - {{ name }}{% endblock %}

178
templates/default/profile/module.html.twig

@ -1,178 +0,0 @@
<div class="margin-y-8-px position-fixed width-180-px margin-l--196-px background-color-night border-radius-3-px">
<div class="padding-x-16-px padding-y-12-px border-bottom-default">
<a href="{{ path('profile_index') }}">
<img class="border-radius-50 vertical-align-middle" src="{{ identicon }}" alt="identicon" />
anon
</a>
<a class="text-color-default float-right" href="{{ path('profile_setting') }}" title="{{ 'Setting'|trans }}">
<svg class="vertical-align-middle" xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-gear-fill" viewBox="0 0 16 16">
<path d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"/>
</svg>
</a>
</div>
<div class="padding-y-8-px">
{% if route == 'home_index' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-house-door-fill" viewBox="0 0 16 16">
<path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Home'|trans }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('home_index') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-house-door-fill" viewBox="0 0 16 16">
<path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Home'|trans }}
</span>
</a>
{% endif %}
{% if route == 'page_stars' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Stars'|trans }}
</span>
<span class="float-right">
{{ stars }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_stars') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Stars'|trans }}
</span>
<span class="float-right">
{{ stars }}
</span>
</a>
{% endif %}
{% if route == 'page_views' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-clock-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Views'|trans }}
</span>
<span class="float-right">
{{ views }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_views') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-clock-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Views'|trans }}
</span>
<span class="float-right">
{{ views }}
</span>
</a>
{% endif %}
{% if route == 'page_comments' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-chat-fill" viewBox="0 0 16 16">
<path d="M8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6-.097 1.016-.417 2.13-.771 2.966-.079.186.074.394.273.362 2.256-.37 3.597-.938 4.18-1.234A9.06 9.06 0 0 0 8 15z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Comments'|trans }}
</span>
<span class="float-right">
{{ comments }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_comments') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-chat-fill" viewBox="0 0 16 16">
<path d="M8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6-.097 1.016-.417 2.13-.771 2.966-.079.186.074.394.273.362 2.256-.37 3.597-.938 4.18-1.234A9.06 9.06 0 0 0 8 15z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Comments'|trans }}
</span>
<span class="float-right">
{{ comments }}
</span>
</a>
{% endif %}
{% if route == 'page_downloads' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-arrow-down-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Downloads'|trans }}
</span>
<span class="float-right">
{{ downloads }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_downloads') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-arrow-down-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Downloads'|trans }}
</span>
<span class="float-right">
{{ downloads }}
</span>
</a>
{% endif %}
{% if route == 'page_editions' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-file-diff-fill" viewBox="0 0 16 16">
<path d="M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM8.5 4.5V6H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V7H6a.5.5 0 0 1 0-1h1.5V4.5a.5.5 0 0 1 1 0zM6 10h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1 0-1z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Editions'|trans }}
</span>
<span class="float-right">
{{ editions }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_editions') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-file-diff-fill" viewBox="0 0 16 16">
<path d="M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM8.5 4.5V6H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V7H6a.5.5 0 0 1 0-1h1.5V4.5a.5.5 0 0 1 1 0zM6 10h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1 0-1z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Editions'|trans }}
</span>
<span class="float-right">
{{ editions }}
</span>
</a>
{% endif %}
{% if route == '/page/submit' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-plus-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v3h-3a.5.5 0 0 0 0 1h3v3a.5.5 0 0 0 1 0v-3h3a.5.5 0 0 0 0-1h-3v-3z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Submit'|trans }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_submit') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" class="bi bi-plus-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v3h-3a.5.5 0 0 0 0 1h3v3a.5.5 0 0 0 1 0v-3h3a.5.5 0 0 0 0-1h-3v-3z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Submit'|trans }}
</span>
</a>
{% endif %}
</div>
</div>

2
templates/default/profile/setting.html.twig

@ -1,2 +0,0 @@
{% extends 'default/layout.html.twig' %}
{% block title %}{{ 'Profile - Settings'|trans }} - {{ name }}{% endblock %}

92
templates/default/user/info.html.twig

@ -0,0 +1,92 @@
{% extends 'default/layout.html.twig' %}
{% block title %}{{ 'User'|trans }} #{{ user.id }} - {{ name }}{% endblock %}
{% block main_content %}
<div class="text-center">
<img class="border-radius-50 border-default border-width-2-px" src="{{ user.identicon }}" alt="identicon" />
</div>
<h2>{{ 'Profile'|trans }}</h2>
<table class="width-100">
<tbody>
<tr>
<td class="padding-b-8-px border-bottom-default text-right" colspan="2">{{ 'Common'|trans }}</td>
</tr>
{% if user.address %}
<tr>
<td class="padding-t-16-px">{{ 'Address'|trans }}</td>
<td class="padding-t-16-px">
{{ user.address }}
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M11 1a2 2 0 0 0-2 2v4a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V3a3 3 0 0 1 6 0v4a.5.5 0 0 1-1 0V3a2 2 0 0 0-2-2zM3 8a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1H3z"/>
</svg>
<span class="opacity-0 parent-hover-opacity-09" title="{{ 'Address hidden for others'|trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
</span>
</td>
</tr>
<tr>
<td>{{ 'Joined'|trans }}</td>
<td>{{ user.added }}</td>
</tr>
{% else %}
<tr>
<td class="padding-t-16-px">{{ 'Joined'|trans }}</td>
<td class="padding-t-16-px">{{ user.added }}</td>
</tr>
{% endif %}
<tr>
<td class="padding-b-8-px border-bottom-default text-right" colspan="2">{{ 'Access'|trans }}</td>
</tr>
<tr>
<td class="padding-t-16-px">{{ 'Status'|trans }}</td>
<td class="padding-t-16-px">
{% if user.status %}
{{ 'active'|trans }}
{% else %}
{{ 'disabled'|trans }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'Approved'|trans }}</td>
<td>
{% if user.approved %}
{{ 'yes'|trans }}
{% else %}
{{ 'no'|trans }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'Moderator'|trans }}</td>
<td>
{% if user.moderator %}
{{ 'yes'|trans }}
{% else %}
{{ 'no'|trans }}
{% endif %}
</td>
</tr>
<tr>
<td class="padding-b-8-px border-bottom-default text-right" colspan="2">{{ 'Settings'|trans }}</td>
</tr>
<tr>
<td class="padding-t-16-px">{{ 'Interface'|trans }}</td>
<td class="padding-t-16-px">
{{ user.locale|trans }}
</td>
</tr>
<tr>
<td>{{ 'Content filter'|trans }}</td>
<td>
{% for locale in user.locales %}
<div class="padding-y-4-px">
{{ locale|trans }}
</div>
{% endfor %}
</td>
</tr>
</tbody>
</table>
{% endblock %}

186
templates/default/user/module.html.twig

@ -0,0 +1,186 @@
<div class="margin-y-8-px position-fixed width-180-px margin-l--196-px background-color-night border-radius-3-px">
<div class="padding-y-8-px">
{% if route == 'dashboard_index' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Home'|trans }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('dashboard_index') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Home'|trans }}
</span>
</a>
{% endif %}
{% if route == 'user_profile' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Profile'|trans }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('user_profile') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Profile'|trans }}
</span>
</a>
{% endif %}
{% if route == 'page_stars' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Stars'|trans }}
</span>
<span class="float-right">
{{ stars }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_stars') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Stars'|trans }}
</span>
<span class="float-right">
{{ stars }}
</span>
</a>
{% endif %}
{% if route == 'page_views' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Views'|trans }}
</span>
<span class="float-right">
{{ views }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_views') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Views'|trans }}
</span>
<span class="float-right">
{{ views }}
</span>
</a>
{% endif %}
{% if route == 'page_comments' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6-.097 1.016-.417 2.13-.771 2.966-.079.186.074.394.273.362 2.256-.37 3.597-.938 4.18-1.234A9.06 9.06 0 0 0 8 15z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Comments'|trans }}
</span>
<span class="float-right">
{{ comments }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_comments') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6-.097 1.016-.417 2.13-.771 2.966-.079.186.074.394.273.362 2.256-.37 3.597-.938 4.18-1.234A9.06 9.06 0 0 0 8 15z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Comments'|trans }}
</span>
<span class="float-right">
{{ comments }}
</span>
</a>
{% endif %}
{% if route == 'page_downloads' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Downloads'|trans }}
</span>
<span class="float-right">
{{ downloads }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_downloads') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v5.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V4.5z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Downloads'|trans }}
</span>
<span class="float-right">
{{ downloads }}
</span>
</a>
{% endif %}
{% if route == 'page_editions' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM8.5 4.5V6H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V7H6a.5.5 0 0 1 0-1h1.5V4.5a.5.5 0 0 1 1 0zM6 10h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1 0-1z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Editions'|trans }}
</span>
<span class="float-right">
{{ editions }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_editions') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM8.5 4.5V6H10a.5.5 0 0 1 0 1H8.5v1.5a.5.5 0 0 1-1 0V7H6a.5.5 0 0 1 0-1h1.5V4.5a.5.5 0 0 1 1 0zM6 10h4a.5.5 0 0 1 0 1H6a.5.5 0 0 1 0-1z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Editions'|trans }}
</span>
<span class="float-right">
{{ editions }}
</span>
</a>
{% endif %}
{% if route == 'page_submit' %}
<span class="padding-x-16-px padding-y-8-px display-block background-color-green cursor-default text-color-white">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v3h-3a.5.5 0 0 0 0 1h3v3a.5.5 0 0 0 1 0v-3h3a.5.5 0 0 0 0-1h-3v-3z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Submit'|trans }}
</span>
</span>
{% else %}
<a class="padding-x-16-px padding-y-8-px display-block background-color-hover-night-light text-color-default" href="{{ path('page_submit') }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v3h-3a.5.5 0 0 0 0 1h3v3a.5.5 0 0 0 1 0v-3h3a.5.5 0 0 0 0-1h-3v-3z"/>
</svg>
<span class="margin-l-4-px">
{{ 'Submit'|trans }}
</span>
</a>
{% endif %}
</div>
</div>

105
templates/default/user/profile.html.twig

@ -0,0 +1,105 @@
{% extends 'default/layout.html.twig' %}
{% block title %}{{ 'Profile'|trans }} - {{ name }}{% endblock %}
{% block main_content %}
<form name="profile" action="{{ path('user_profile') }}" method="post">
<div class="text-center">
<img class="border-radius-50 border-default border-width-2-px" src="{{ user.identicon }}" alt="identicon" />
</div>
<h2>{{ 'Profile'|trans }}</h2>
<table class="width-100">
<tbody>
<tr>
<td class="padding-b-8-px border-bottom-default text-right" colspan="2">{{ 'Common'|trans }}</td>
</tr>
<tr>
<td class="padding-t-16-px">{{ 'Address'|trans }}</td>
<td class="padding-t-16-px">
{{ user.address }}
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M11 1a2 2 0 0 0-2 2v4a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V3a3 3 0 0 1 6 0v4a.5.5 0 0 1-1 0V3a2 2 0 0 0-2-2zM3 8a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1H3z"/>
</svg>
<span class="opacity-0 parent-hover-opacity-09" title="{{ 'Address hidden for others'|trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
</span>
</td>
</tr>
<tr>
<td>{{ 'Joined'|trans }}</td>
<td>{{ user.added }}</td>
</tr>
<tr>
<td class="padding-b-8-px border-bottom-default text-right" colspan="2">{{ 'Access'|trans }}</td>
</tr>
<tr>
<td class="padding-t-16-px">{{ 'Status'|trans }}</td>
<td class="padding-t-16-px">
{% if user.status %}
{{ 'active'|trans }}
{% else %}
{{ 'disabled'|trans }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'Approved'|trans }}</td>
<td>
{% if user.approved %}
{{ 'yes'|trans }}
{% else %}
{{ 'no'|trans }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'Moderator'|trans }}</td>
<td>
{% if user.moderator %}
{{ 'yes'|trans }}
{% else %}
{{ 'no'|trans }}
{% endif %}
</td>
</tr>
<tr>
<td class="padding-b-8-px border-bottom-default text-right" colspan="2">{{ 'Settings'|trans }}</td>
</tr>
<tr>
<td class="padding-t-16-px">{{ 'Interface'|trans }}</td>
<td class="padding-t-16-px">
<select name="locale">
{% for locale in locales %}
{% if locale == user.locale %}
<option value="{{ locale }}" selected="selected">{{ locale|trans }}</option>
{% else %}
<option value="{{ locale }}">{{ locale|trans }}</option>
{% endif %}
{% endfor %}
</select>
</td>
</tr>
<tr>
<td>{{ 'Content filter'|trans }}</td>
<td>
{% for locale in locales %}
<div class="padding-y-4-px">
{% if locale in user.locales %}
<input name="locales[]" id="{{ locale }}" type="checkbox" value="{{ locale }}" checked="checked" />
{% else %}
<input name="locales[]" id="{{ locale }}" type="checkbox" value="{{ locale }}" />
{% endif %}
<label for="{{ locale }}">
{{ locale|trans }}
</label>
</div>
{% endfor %}
</td>
</tr>
</tbody>
</table>
<div class="text-right">
<input class="button-green" type="submit" value="{{'Save'|trans }}" />
</div>
</form>
{% endblock %}

20
templates/redirect/index.html.twig

@ -0,0 +1,20 @@
{% extends 'base.html.twig' %}
{% block title %}Hello RedirectController!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ '/home/ibox/Sites/yggverse/YGGtracker/src/Controller/RedirectController.php'|file_link(0) }}">src/Controller/RedirectController.php</a></code></li>
<li>Your template at <code><a href="{{ '/home/ibox/Sites/yggverse/YGGtracker/templates/redirect/index.html.twig'|file_link(0) }}">templates/redirect/index.html.twig</a></code></li>
</ul>
</div>
{% endblock %}
Loading…
Cancel
Save