mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-13 00:18:05 +00:00
implement event settings
This commit is contained in:
parent
d4fbb4b592
commit
7aa2c03abc
2
.env
2
.env
@ -56,6 +56,8 @@ APP_THEME=default
|
||||
APP_THEMES=default
|
||||
|
||||
APP_SENSITIVE=0
|
||||
APP_APPROVED=0
|
||||
APP_YGGDRASIL=1
|
||||
|
||||
APP_TRACKERS=http://[201:23b4:991a:634d:8359:4521:5576:15b7]:2023/announce|http://[200:1e2f:e608:eb3a:2bf:1e62:87ba:e2f7]/announce|http://[316:c51a:62a3:8b9::5]/announce
|
||||
|
||||
|
@ -6,12 +6,14 @@
|
||||
parameters:
|
||||
app.version: '%env(APP_VERSION)%'
|
||||
app.name: '%env(APP_NAME)%'
|
||||
app.locale: '%env(APP_LOCALE)%'
|
||||
app.locales: '%env(APP_LOCALES)%'
|
||||
app.theme: '%env(APP_THEME)%'
|
||||
app.themes: '%env(APP_THEMES)%'
|
||||
app.sensitive: '%env(APP_SENSITIVE)%'
|
||||
app.trackers: '%env(APP_TRACKERS)%'
|
||||
app.locales: '%env(APP_LOCALES)%'
|
||||
app.themes: '%env(APP_THEMES)%'
|
||||
app.locale: '%env(APP_LOCALE)%'
|
||||
app.theme: '%env(APP_THEME)%'
|
||||
app.sensitive: '%env(APP_SENSITIVE)%'
|
||||
app.approved: '%env(APP_APPROVED)%'
|
||||
app.yggdrasil: '%env(APP_YGGDRASIL)%'
|
||||
app.article.title.length.min: '%env(APP_ARTICLE_TITLE_LENGTH_MIN)%'
|
||||
app.article.title.length.max: '%env(APP_ARTICLE_TITLE_LENGTH_MAX)%'
|
||||
app.article.description.length.min: '%env(APP_ARTICLE_DESCRIPTION_LENGTH_MIN)%'
|
||||
|
@ -111,6 +111,7 @@ textarea:hover {
|
||||
|
||||
td {
|
||||
padding: 2px 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
header a.logo {
|
||||
|
@ -367,6 +367,10 @@ a:visited.background-color-hover-night-light:hover {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.margin-b-4-px {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.margin-r-4-px {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ class ArticleController extends AbstractController
|
||||
)]
|
||||
public function info(
|
||||
Request $request,
|
||||
TranslatorInterface $translator,
|
||||
UserService $userService,
|
||||
ActivityService $activityService
|
||||
): Response
|
||||
@ -263,7 +262,11 @@ class ArticleController extends AbstractController
|
||||
time(),
|
||||
$this->getParameter('app.locale'),
|
||||
explode('|', $this->getParameter('app.locales')),
|
||||
$this->getParameter('app.theme')
|
||||
$activityService->getEventCodes(),
|
||||
$this->getParameter('app.theme'),
|
||||
$this->getParameter('app.sensitive'),
|
||||
$this->getParameter('app.yggdrasil'),
|
||||
$this->getParameter('app.approved')
|
||||
);
|
||||
|
||||
// Add user join event
|
||||
|
@ -164,7 +164,11 @@ class SearchController extends AbstractController
|
||||
time(),
|
||||
$this->getParameter('app.locale'),
|
||||
explode('|', $this->getParameter('app.locales')),
|
||||
$this->getParameter('app.theme')
|
||||
$activityService->getEventCodes(),
|
||||
$this->getParameter('app.theme'),
|
||||
$this->getParameter('app.sensitive'),
|
||||
$this->getParameter('app.yggdrasil'),
|
||||
$this->getParameter('app.approved')
|
||||
);
|
||||
|
||||
// Add user join event
|
||||
|
@ -1155,11 +1155,14 @@ class TorrentController extends AbstractController
|
||||
);
|
||||
|
||||
// Filter trackers
|
||||
$file->setAnnounceList(
|
||||
[
|
||||
explode('|', $this->getParameter('app.trackers'))
|
||||
]
|
||||
);
|
||||
if ($user->isYggdrasil())
|
||||
{
|
||||
$file->setAnnounceList(
|
||||
[
|
||||
explode('|', $this->getParameter('app.trackers'))
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$data = $file->dumpToString();
|
||||
|
||||
@ -1260,11 +1263,14 @@ class TorrentController extends AbstractController
|
||||
);
|
||||
|
||||
// Filter trackers
|
||||
$file->setAnnounceList(
|
||||
[
|
||||
explode('|', $this->getParameter('app.trackers'))
|
||||
]
|
||||
);
|
||||
if ($user->isYggdrasil())
|
||||
{
|
||||
$file->setAnnounceList(
|
||||
[
|
||||
explode('|', $this->getParameter('app.trackers'))
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// Return magnet link
|
||||
return $this->redirect(
|
||||
@ -1308,7 +1314,11 @@ class TorrentController extends AbstractController
|
||||
time(),
|
||||
$this->getParameter('app.locale'),
|
||||
explode('|', $this->getParameter('app.locales')),
|
||||
$this->getParameter('app.theme')
|
||||
$activityService->getEventCodes(),
|
||||
$this->getParameter('app.theme'),
|
||||
$this->getParameter('app.sensitive'),
|
||||
$this->getParameter('app.yggdrasil'),
|
||||
$this->getParameter('app.approved')
|
||||
);
|
||||
|
||||
// Add user join event
|
||||
|
@ -63,8 +63,8 @@ class UserController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route(
|
||||
'/{_locale}/profile',
|
||||
name: 'user_profile',
|
||||
'/{_locale}/settings',
|
||||
name: 'user_settings',
|
||||
defaults: [
|
||||
'_locale' => '%app.locale%'
|
||||
],
|
||||
@ -72,7 +72,7 @@ class UserController extends AbstractController
|
||||
'_locale' => '%app.locales%',
|
||||
],
|
||||
)]
|
||||
public function profile(
|
||||
public function settings(
|
||||
Request $request,
|
||||
UserService $userService,
|
||||
ActivityService $activityService
|
||||
@ -121,17 +121,36 @@ class UserController extends AbstractController
|
||||
);
|
||||
}
|
||||
|
||||
// Update events
|
||||
$events = [];
|
||||
foreach ((array) $request->get('events') as $event)
|
||||
{
|
||||
if (in_array($event, $activityService->getEventCodes()))
|
||||
{
|
||||
$events[] = $event;
|
||||
}
|
||||
}
|
||||
|
||||
$user->setEvents(
|
||||
$events
|
||||
);
|
||||
|
||||
// Update sensitive
|
||||
$user->setSensitive(
|
||||
$request->get('sensitive') === 'true'
|
||||
);
|
||||
|
||||
// Update yggdrasil
|
||||
$user->setYggdrasil(
|
||||
$request->get('yggdrasil') === 'true'
|
||||
);
|
||||
|
||||
// Save changes to DB
|
||||
$userService->save($user);
|
||||
|
||||
// Redirect user to new locale
|
||||
return $this->redirectToRoute(
|
||||
'user_profile',
|
||||
'user_settings',
|
||||
[
|
||||
'_locale' => $user->getLocale()
|
||||
]
|
||||
@ -140,38 +159,35 @@ class UserController extends AbstractController
|
||||
|
||||
// Render template
|
||||
return $this->render(
|
||||
'default/user/profile.html.twig',
|
||||
'default/user/settings.html.twig',
|
||||
[
|
||||
'user' => [
|
||||
'id' => $user->getId(),
|
||||
'address' => $request->getClientIp() == $user->getAddress() ? $user->getAddress() : false,
|
||||
'moderator' => $user->isModerator(),
|
||||
'approved' => $user->isApproved(),
|
||||
'status' => $user->isStatus(),
|
||||
'sensitive' => $user->isSensitive(),
|
||||
'yggdrasil' => $user->isYggdrasil(),
|
||||
'locale' => $user->getLocale(),
|
||||
'locales' => $user->getLocales(),
|
||||
'events' => $user->getEvents(),
|
||||
'theme' => $user->getTheme(),
|
||||
'added' => $user->getAdded(),
|
||||
'identicon' => $userService->identicon(
|
||||
$user->getAddress(),
|
||||
48
|
||||
),
|
||||
'added' => $user->getAdded()
|
||||
],
|
||||
'locales' => explode('|', $this->getParameter('app.locales')),
|
||||
'themes' => explode('|', $this->getParameter('app.themes'))
|
||||
'themes' => explode('|', $this->getParameter('app.themes')),
|
||||
'events' => $activityService->getEventsTree()
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[Route(
|
||||
'/{_locale}/user/{userId}',
|
||||
'/{_locale}/profile/{userId}',
|
||||
name: 'user_info',
|
||||
defaults: [
|
||||
'_locale' => '%app.locale%'
|
||||
'_locale' => '%app.locale%',
|
||||
'userId' => null
|
||||
],
|
||||
requirements: [
|
||||
'_locale' => '%app.locales%',
|
||||
'userId' => '\d+',
|
||||
],
|
||||
)]
|
||||
public function info(
|
||||
@ -197,7 +213,9 @@ class UserController extends AbstractController
|
||||
}
|
||||
|
||||
// Init target user
|
||||
if (!$userTarget = $userService->getUser($request->get('userId')))
|
||||
if (!$userTarget = $userService->getUser(
|
||||
$request->get('userId') ? $request->get('userId') : $user->getId()
|
||||
))
|
||||
{
|
||||
throw $this->createNotFoundException();
|
||||
}
|
||||
@ -208,13 +226,15 @@ class UserController extends AbstractController
|
||||
[
|
||||
'user' => [
|
||||
'id' => $userTarget->getId(),
|
||||
'address' => $request->getClientIp() == $userTarget->getAddress() ? $userTarget->getAddress() : false,
|
||||
'address' => $userTarget->getId() === $user->getId() ? $userTarget->getAddress() : false,
|
||||
'moderator' => $userTarget->isModerator(),
|
||||
'approved' => $userTarget->isApproved(),
|
||||
'status' => $userTarget->isStatus(),
|
||||
'sensitive' => $userTarget->isSensitive(),
|
||||
'yggdrasil' => $userTarget->isYggdrasil(),
|
||||
'locale' => $userTarget->getLocale(),
|
||||
'locales' => $userTarget->getLocales(),
|
||||
'events' => $userTarget->getEvents(),
|
||||
'theme' => $userTarget->getTheme(),
|
||||
'added' => $userTarget->getAdded(),
|
||||
'identicon' => $userService->identicon(
|
||||
@ -232,7 +252,8 @@ class UserController extends AbstractController
|
||||
$userTarget->getId()
|
||||
)
|
||||
],
|
||||
]
|
||||
],
|
||||
'events' => $activityService->getEventsTree()
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -587,7 +608,11 @@ class UserController extends AbstractController
|
||||
time(),
|
||||
$this->getParameter('app.locale'),
|
||||
explode('|', $this->getParameter('app.locales')),
|
||||
$this->getParameter('app.theme')
|
||||
$activityService->getEventCodes(),
|
||||
$this->getParameter('app.theme'),
|
||||
$this->getParameter('app.sensitive'),
|
||||
$this->getParameter('app.yggdrasil'),
|
||||
$this->getParameter('app.approved')
|
||||
);
|
||||
|
||||
// Add user join event
|
||||
|
@ -35,12 +35,18 @@ class User
|
||||
#[ORM\Column(type: Types::ARRAY)]
|
||||
private array $locales = [];
|
||||
|
||||
#[ORM\Column(type: Types::ARRAY)]
|
||||
private array $events = [];
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $theme = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?bool $sensitive = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?bool $yggdrasil = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@ -137,6 +143,18 @@ class User
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEvents(): array
|
||||
{
|
||||
return $this->events;
|
||||
}
|
||||
|
||||
public function setEvents(array $events): static
|
||||
{
|
||||
$this->events = $events;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTheme(): ?string
|
||||
{
|
||||
return $this->theme;
|
||||
@ -160,4 +178,16 @@ class User
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isYggdrasil(): ?bool
|
||||
{
|
||||
return $this->yggdrasil;
|
||||
}
|
||||
|
||||
public function setYggdrasil(bool $yggdrasil): static
|
||||
{
|
||||
$this->yggdrasil = $yggdrasil;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@ -5,16 +5,359 @@ namespace App\Service;
|
||||
use App\Entity\Activity;
|
||||
use App\Repository\ActivityRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ActivityService
|
||||
{
|
||||
private EntityManagerInterface $entityManagerInterface;
|
||||
private TranslatorInterface $translatorInterface;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $entityManagerInterface
|
||||
EntityManagerInterface $entityManagerInterface,
|
||||
TranslatorInterface $translatorInterface
|
||||
)
|
||||
{
|
||||
$this->entityManagerInterface = $entityManagerInterface;
|
||||
$this->translatorInterface = $translatorInterface;
|
||||
}
|
||||
|
||||
public function getEventCodes(): array
|
||||
{
|
||||
return
|
||||
[
|
||||
// User
|
||||
Activity::EVENT_USER_ADD,
|
||||
|
||||
Activity::EVENT_USER_APPROVE_ADD,
|
||||
Activity::EVENT_USER_APPROVE_DELETE,
|
||||
|
||||
Activity::EVENT_USER_MODERATOR_ADD,
|
||||
Activity::EVENT_USER_MODERATOR_DELETE,
|
||||
|
||||
Activity::EVENT_USER_STATUS_ADD,
|
||||
Activity::EVENT_USER_STATUS_DELETE,
|
||||
|
||||
Activity::EVENT_USER_STAR_ADD,
|
||||
Activity::EVENT_USER_STAR_DELETE,
|
||||
|
||||
// Torrents
|
||||
Activity::EVENT_TORRENT_ADD,
|
||||
|
||||
Activity::EVENT_TORRENT_LOCALES_ADD,
|
||||
Activity::EVENT_TORRENT_LOCALES_DELETE,
|
||||
Activity::EVENT_TORRENT_LOCALES_APPROVE_ADD,
|
||||
Activity::EVENT_TORRENT_LOCALES_APPROVE_DELETE,
|
||||
|
||||
Activity::EVENT_TORRENT_SENSITIVE_ADD,
|
||||
Activity::EVENT_TORRENT_SENSITIVE_DELETE,
|
||||
Activity::EVENT_TORRENT_SENSITIVE_APPROVE_ADD,
|
||||
Activity::EVENT_TORRENT_SENSITIVE_APPROVE_DELETE,
|
||||
|
||||
Activity::EVENT_TORRENT_STAR_ADD,
|
||||
Activity::EVENT_TORRENT_STAR_DELETE,
|
||||
|
||||
Activity::EVENT_TORRENT_DOWNLOAD_FILE_ADD,
|
||||
Activity::EVENT_TORRENT_DOWNLOAD_MAGNET_ADD,
|
||||
|
||||
// Articles
|
||||
Activity::EVENT_ARTICLE_ADD,
|
||||
];
|
||||
}
|
||||
|
||||
public function getEventsTree(): array
|
||||
{
|
||||
$events = [];
|
||||
|
||||
foreach ($this->getEventCodes() as $code)
|
||||
{
|
||||
switch ($code)
|
||||
{
|
||||
// User
|
||||
case Activity::EVENT_USER_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Users')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Joined')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
/// User approve
|
||||
case Activity::EVENT_USER_APPROVE_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Users')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Approved')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_USER_APPROVE_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Users')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Disapproved')
|
||||
] = $code;
|
||||
break;
|
||||
|
||||
/// User status
|
||||
case Activity::EVENT_USER_STATUS_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('User statuses')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Enabled')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_USER_STATUS_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('User statuses')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Disabled')
|
||||
] = $code;
|
||||
break;
|
||||
|
||||
/// User moderator
|
||||
case Activity::EVENT_USER_MODERATOR_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('User moderators')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Added')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_USER_MODERATOR_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('User moderators')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Removed')
|
||||
] = $code;
|
||||
break;
|
||||
|
||||
/// User star
|
||||
case Activity::EVENT_USER_STAR_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('User stars')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Added')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_USER_STAR_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('User stars')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Removed')
|
||||
] = $code;
|
||||
break;
|
||||
|
||||
// Torrent
|
||||
case Activity::EVENT_TORRENT_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrents')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Added')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
/// Torrent locales
|
||||
case Activity::EVENT_TORRENT_LOCALES_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent locales')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Added')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_LOCALES_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent locales')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Deleted')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_LOCALES_APPROVE_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent locales')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Approved')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_LOCALES_APPROVE_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent locales')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Disapproved')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
/// Torrent sensitive
|
||||
case Activity::EVENT_TORRENT_SENSITIVE_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent sensitive')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Added')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_SENSITIVE_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent sensitive')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Deleted')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_SENSITIVE_APPROVE_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent sensitive')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Approved')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_SENSITIVE_APPROVE_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent sensitive')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Disapproved')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
/// Torrent stars
|
||||
case Activity::EVENT_TORRENT_STAR_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent stars')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Added')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_STAR_DELETE:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent stars')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Removed')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
/// Torrent downloads
|
||||
case Activity::EVENT_TORRENT_DOWNLOAD_FILE_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent downloads')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Files')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_DOWNLOAD_MAGNET_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrent downloads')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Magnet links')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
// Article
|
||||
case Activity::EVENT_TORRENT_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Articles')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Added')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $events;
|
||||
}
|
||||
|
||||
public function findLastActivities(): array
|
||||
|
@ -28,8 +28,10 @@ class UserService
|
||||
string $added,
|
||||
string $locale,
|
||||
array $locales,
|
||||
array $events,
|
||||
string $theme,
|
||||
bool $sensitive = true,
|
||||
bool $yggdrasil = true,
|
||||
bool $approved = false,
|
||||
bool $moderator = false,
|
||||
bool $status = true
|
||||
@ -70,10 +72,18 @@ class UserService
|
||||
$theme
|
||||
);
|
||||
|
||||
$user->setEvents(
|
||||
$events
|
||||
);
|
||||
|
||||
$user->setSensitive(
|
||||
$sensitive
|
||||
);
|
||||
|
||||
$user->setYggdrasil(
|
||||
$yggdrasil
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($user);
|
||||
$this->entityManagerInterface->flush();
|
||||
|
||||
|
@ -33,12 +33,33 @@
|
||||
<tr>
|
||||
<td class="padding-y-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 | format_ago }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="padding-t-16-px">{{ 'Joined' | trans }}</td>
|
||||
<td class="padding-t-16-px">{{ user.added | format_ago }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="padding-t-16-px">{{ 'Joined'|trans }}</td>
|
||||
<td class="padding-t-16-px">{{ user.added | format_ago }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">{{ 'Access'|trans }}</td>
|
||||
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">{{ 'Access' | trans }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-t-16-px">
|
||||
@ -121,7 +142,7 @@
|
||||
<tr>
|
||||
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
|
||||
{% if user.owner %}
|
||||
<a class="margin-r-4-px{#opacity-0 parent-hover-opacity-09#}" href="{{ path('user_profile', { userId : user.id }) }}" title="{{'Edit'|trans }}">
|
||||
<a class="margin-r-4-px{#opacity-0 parent-hover-opacity-09#}" href="{{ path('user_settings', { userId : user.id }) }}" title="{{'Edit'|trans }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
|
||||
<path d="M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"/>
|
||||
</svg>
|
||||
@ -132,37 +153,66 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-t-16-px">
|
||||
{{ 'Interface' | trans }}
|
||||
{{ 'Theme' | trans }}
|
||||
</td>
|
||||
<td class="padding-t-16-px">
|
||||
{{ user.theme | u.title }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ 'Interface' | trans }}
|
||||
</td>
|
||||
<td>
|
||||
{{ user.locale | locale_name(user.locale) | u.title }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="width-20">{{ 'Content'|trans }}</td>
|
||||
<td class="width-20">
|
||||
{{ 'Languages' | trans }}
|
||||
</td>
|
||||
<td class="width-80 line-height-20-px">
|
||||
{% for i, locale in user.locales %}{% if i > 0 %},{% endif %} {{ locale|locale_name(locale)|u.title }}{% endfor %}
|
||||
{#
|
||||
{% for locale in user.locales %}
|
||||
<div class="padding-y-4-px">
|
||||
{{ locale|locale_name(locale)|u.title }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
#}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'Theme'|trans }}</td>
|
||||
<td>{{ user.theme | u.title }}</td>
|
||||
<td>
|
||||
{{ 'Sensitive' | trans }}
|
||||
</td>
|
||||
<td>
|
||||
{% if user.sensitive %}
|
||||
{{ 'Yes' | trans }}
|
||||
{% else %}
|
||||
{{ 'No' | trans }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'Sensitive'|trans }}</td>
|
||||
<td>
|
||||
{% if user.sensitive %}
|
||||
{{ 'Yes'|trans }}
|
||||
{% else %}
|
||||
{{ 'No'|trans }}
|
||||
{% endif %}
|
||||
{{ 'Events subscribed' | trans }}
|
||||
</td>
|
||||
<td>
|
||||
{% for group, event in events %}
|
||||
<div class="margin-b-4-px">
|
||||
<span class="text-color-night">
|
||||
{{ group }}:
|
||||
</span>
|
||||
{% set i = 0 %}
|
||||
{% for key, value in event %}{% if value in user.events %}{% if i > 0 %}, {% endif %}{{ key | lower }}{% set i = i + 1 %}{% endif %}{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ 'Yggdrasil filter' | trans }}
|
||||
</td>
|
||||
<td>
|
||||
{% if user.yggdrasil %}
|
||||
{{ 'Yes'|trans }}
|
||||
{% else %}
|
||||
{{ 'No'|trans }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -6,25 +6,38 @@
|
||||
</svg>
|
||||
</span>
|
||||
{% else %}
|
||||
<a class="padding-8-px display-block text-color-night" href="{{ path('user_dashboard') }}" title="{{ 'Home' | trans }}">
|
||||
<a rel="nofollow" class="padding-8-px display-block text-color-night" href="{{ path('user_dashboard') }}" title="{{ 'Home' | trans }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if route == 'user_profile' %}
|
||||
{% if route == 'user_info' %}
|
||||
<span class="padding-8-px display-block cursor-default" title="{{ 'Profile' | trans }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
|
||||
{% else %}
|
||||
<a class="padding-8-px display-block text-color-night" href="{{ path('user_profile') }}" title="{{ 'Profile' | trans }}">
|
||||
<a rel="nofollow" class="padding-8-px display-block text-color-night" href="{{ path('user_info') }}" title="{{ 'Profile' | trans }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if route == 'user_settings' %}
|
||||
<span class="padding-8-px display-block cursor-default" title="{{ 'Settings' | trans }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
|
||||
</span>
|
||||
{% else %}
|
||||
<a rel="nofollow" class="padding-8-px display-block text-color-night" href="{{ path('user_settings') }}" title="{{ 'Settings' | trans }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
|
||||
{% endif %}
|
||||
{% if route == 'article_submit' or route == 'torrent_submit' %}
|
||||
<span class="padding-8-px display-block cursor-default" title="{{ 'Submit' | trans }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" viewBox="0 0 16 16">
|
||||
@ -32,7 +45,7 @@
|
||||
</svg>
|
||||
</span>
|
||||
{% else %}
|
||||
<a class="padding-8-px display-block text-color-night" href="{{ path('article_submit') }}" title="{{ 'Submit' | trans }}">
|
||||
<a rel="nofollow" class="padding-8-px display-block text-color-night" href="{{ path('article_submit') }}" title="{{ 'Submit' | trans }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
|
||||
|
@ -1,110 +1,14 @@
|
||||
{% extends 'default/layout.html.twig' %}
|
||||
{% block title %}{{ 'Profile'|trans }} - {{ name }}{% endblock %}
|
||||
{% block title %}{{ 'Settings' | trans }} - {{ name }}{% endblock %}
|
||||
{% block main_content %}
|
||||
<div class="padding-24-px margin-y-8-px border-radius-3-px background-color-night">
|
||||
<form name="profile" action="{{ path('user_profile') }}" method="post">
|
||||
<div class="text-center">
|
||||
<a href="{{ path('user_info', { userId : user.id }) }}">
|
||||
<img class="border-radius-50 border-color-default border-width-2-px" src="{{ user.identicon }}" alt="{{ 'identicon'|trans }}" />
|
||||
</a>
|
||||
</div>
|
||||
<h2>{{ 'Profile'|trans }}</h2>
|
||||
<form name="profile" action="{{ path('user_settings') }}" method="post">
|
||||
<h1>{{ 'Settings' | trans }} </h1>
|
||||
<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 | format_ago }}</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 %}
|
||||
{{ 'Aactive' | 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|locale_name(locale)|u.title }}
|
||||
</option>
|
||||
{% else %}
|
||||
<option value="{{ locale }}">
|
||||
{{ locale|locale_name(locale)|u.title }}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{ 'Content language' | 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|locale_name(locale)|u.title }}
|
||||
</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{{ 'Interface' | trans }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -128,11 +32,53 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-y-8-px">
|
||||
{{ 'Sensitive filter'|trans }}
|
||||
<td class="padding-t-16-px">{{ 'Language' | 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|locale_name(locale)|u.title }}
|
||||
</option>
|
||||
{% else %}
|
||||
<option value="{{ locale }}">
|
||||
{{ locale|locale_name(locale)|u.title }}
|
||||
</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-b-8-px border-bottom-default text-right" colspan="2">
|
||||
{{ 'Search' | trans }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-t-16-px">
|
||||
{{ 'Languages' | trans }}
|
||||
</td>
|
||||
<td class="padding-t-16-px">
|
||||
{% 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|locale_name(locale)|u.title }}
|
||||
</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-t-8-px">
|
||||
{{ 'Sensitive' | trans }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="padding-y-8-px">
|
||||
<div class="padding-t-8-px">
|
||||
{% if user.sensitive %}
|
||||
<input name="sensitive" type="checkbox" value="true" checked="checked" />
|
||||
{% else %}
|
||||
@ -141,6 +87,49 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-b-8-px border-bottom-default text-right" colspan="2">
|
||||
{{ 'Events' | trans }}
|
||||
</td>
|
||||
</tr>
|
||||
{% for group, event in events %}
|
||||
<tr>
|
||||
<td class="padding-t-16-px">
|
||||
{{ group }}
|
||||
</td>
|
||||
<td class="padding-t-16-px">
|
||||
{% for key, value in event %}
|
||||
<span class="margin-r-8-px">
|
||||
{% if value in user.events %}
|
||||
<input name="events[]" id="event-{{ value }}" type="checkbox" value="{{ value }}" checked="checked" />
|
||||
{% else %}
|
||||
<input name="events[]" id="event-{{ value }}" type="checkbox" value="{{ value }}" />
|
||||
{% endif %}
|
||||
<label for="event-{{ value }}">
|
||||
{{ key }}
|
||||
</label>
|
||||
</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td class="padding-b-8-px border-bottom-default text-right" colspan="2">
|
||||
{{ 'Downloads' | trans }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-y-16-px">
|
||||
{{ 'Yggdrasil filter' | trans }}
|
||||
</td>
|
||||
<td class="padding-y-16-px">
|
||||
{% if user.yggdrasil %}
|
||||
<input name="yggdrasil" type="checkbox" value="true" checked="checked" />
|
||||
{% else %}
|
||||
<input name="yggdrasil" type="checkbox" value="true" />
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="text-right">
|
Loading…
Reference in New Issue
Block a user