diff --git a/src/Controller/ActivityController.php b/src/Controller/ActivityController.php index 5bdec65..c8bb152 100644 --- a/src/Controller/ActivityController.php +++ b/src/Controller/ActivityController.php @@ -1116,6 +1116,219 @@ class ActivityController extends AbstractController break; + /// Torrent Categories + case $activity::EVENT_TORRENT_CATEGORIES_ADD: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/categories/add' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'categories' => [ + 'id' => $activity->getData()['torrentCategoriesId'], + 'exist' => $torrentService->getTorrentCategories( + $activity->getData()['torrentCategoriesId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_CATEGORIES_DELETE: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/categories/delete' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'categories' => [ + 'id' => $activity->getData()['torrentCategoriesId'], + 'exist' => $torrentService->getTorrentCategories( + $activity->getData()['torrentCategoriesId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/categories/approve/add' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'categories' => [ + 'id' => $activity->getData()['torrentCategoriesId'], + 'exist' => $torrentService->getTorrentCategories( + $activity->getData()['torrentCategoriesId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + + case $activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE: + + // Init torrent + if (!$torrent = $torrentService->getTorrent($activity->getTorrentId())) + { + throw $this->createNotFoundException(); + } + + return $this->render( + 'default/activity/event/torrent/categories/approve/delete' . $extension, + [ + 'id' => $activity->getId(), + 'added' => $activity->getAdded(), + 'user' => + [ + 'id' => $activity->getUserId(), + 'identicon' => $userService->identicon( + $userService->getUser( + $activity->getUserId() + )->getAddress() + ) + ], + 'torrent' => + [ + 'id' => $torrent->getId(), + 'sensitive' => $torrent->isSensitive(), + 'approved' => $torrent->isApproved(), + 'status' => $torrent->isStatus(), + 'name' => $torrentService->readTorrentFileByTorrentId( + $torrent->getId() + )->getName(), + 'categories' => [ + 'id' => $activity->getData()['torrentCategoriesId'], + 'exist' => $torrentService->getTorrentCategories( + $activity->getData()['torrentCategoriesId'] // could be deleted by moderator, remove links + ) + ] + ], + 'session' => + [ + 'user' => + [ + 'id' => $user->getId(), + 'sensitive' => $user->isSensitive(), + 'moderator' => $user->isModerator(), + 'owner' => $user->getId() === $torrent->getUserId(), + ] + ] + ] + ); + + break; + /// Torrent Sensitive case $activity::EVENT_TORRENT_SENSITIVE_ADD: diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 0179ebd..bf962f8 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -1704,14 +1704,12 @@ class TorrentController extends AbstractController ); // Register activity event - /* @TODO $activityService->addEventTorrentCategoriesAdd( $user->getId(), $torrent->getId(), time(), $torrentCategories->getId() ); - */ // Redirect to info page return $this->redirectToRoute( @@ -1792,7 +1790,6 @@ class TorrentController extends AbstractController } // Register activity event - /* @TODO if (!$torrentCategories->isApproved()) { $activityService->addEventTorrentCategoriesApproveAdd( @@ -1812,7 +1809,6 @@ class TorrentController extends AbstractController $torrentCategories->getId() ); } - */ // Update approved $torrentService->toggleTorrentCategoriesApproved( @@ -1881,14 +1877,12 @@ class TorrentController extends AbstractController } // Add activity event - /* @TODO $activityService->addEventTorrentCategoriesDelete( $user->getId(), $torrent->getId(), time(), $torrentCategories->getId() ); - */ // Update approved $torrentService->deleteTorrentCategories( diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index 1102a03..1be1097 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -20,52 +20,57 @@ class Activity // Event codes /// User - public const EVENT_USER_ADD = 1000; + public const EVENT_USER_ADD = 1000; - public const EVENT_USER_APPROVE_ADD = 1200; - public const EVENT_USER_APPROVE_DELETE = 1201; + public const EVENT_USER_APPROVE_ADD = 1200; + public const EVENT_USER_APPROVE_DELETE = 1201; - public const EVENT_USER_MODERATOR_ADD = 1300; - public const EVENT_USER_MODERATOR_DELETE = 1301; + public const EVENT_USER_MODERATOR_ADD = 1300; + public const EVENT_USER_MODERATOR_DELETE = 1301; - public const EVENT_USER_STATUS_ADD = 1400; - public const EVENT_USER_STATUS_DELETE = 1401; + public const EVENT_USER_STATUS_ADD = 1400; + public const EVENT_USER_STATUS_DELETE = 1401; - public const EVENT_USER_STAR_ADD = 1500; - public const EVENT_USER_STAR_DELETE = 1501; + public const EVENT_USER_STAR_ADD = 1500; + public const EVENT_USER_STAR_DELETE = 1501; /// Torrent - public const EVENT_TORRENT_ADD = 2000; + public const EVENT_TORRENT_ADD = 2000; - public const EVENT_TORRENT_APPROVE_ADD = 1100; - public const EVENT_TORRENT_APPROVE_DELETE = 1101; + public const EVENT_TORRENT_APPROVE_ADD = 1100; + public const EVENT_TORRENT_APPROVE_DELETE = 1101; - public const EVENT_TORRENT_LOCALES_ADD = 2200; - public const EVENT_TORRENT_LOCALES_DELETE = 2201; - public const EVENT_TORRENT_LOCALES_APPROVE_ADD = 2210; - public const EVENT_TORRENT_LOCALES_APPROVE_DELETE = 2211; + public const EVENT_TORRENT_LOCALES_ADD = 2200; + public const EVENT_TORRENT_LOCALES_DELETE = 2201; + public const EVENT_TORRENT_LOCALES_APPROVE_ADD = 2210; + public const EVENT_TORRENT_LOCALES_APPROVE_DELETE = 2211; - public const EVENT_TORRENT_SENSITIVE_ADD = 2300; - public const EVENT_TORRENT_SENSITIVE_DELETE = 2301; - public const EVENT_TORRENT_SENSITIVE_APPROVE_ADD = 2310; - public const EVENT_TORRENT_SENSITIVE_APPROVE_DELETE = 2311; + public const EVENT_TORRENT_SENSITIVE_ADD = 2300; + public const EVENT_TORRENT_SENSITIVE_DELETE = 2301; + public const EVENT_TORRENT_SENSITIVE_APPROVE_ADD = 2310; + public const EVENT_TORRENT_SENSITIVE_APPROVE_DELETE = 2311; - public const EVENT_TORRENT_STAR_ADD = 2400; - public const EVENT_TORRENT_STAR_DELETE = 2401; + public const EVENT_TORRENT_STAR_ADD = 2400; + public const EVENT_TORRENT_STAR_DELETE = 2401; - public const EVENT_TORRENT_DOWNLOAD_FILE_ADD = 2500; + public const EVENT_TORRENT_DOWNLOAD_FILE_ADD = 2500; - public const EVENT_TORRENT_DOWNLOAD_MAGNET_ADD = 2600; + public const EVENT_TORRENT_DOWNLOAD_MAGNET_ADD = 2600; - public const EVENT_TORRENT_WANTED_ADD = 2700; + public const EVENT_TORRENT_WANTED_ADD = 2700; - public const EVENT_TORRENT_STATUS_ADD = 1800; - public const EVENT_TORRENT_STATUS_DELETE = 1801; + public const EVENT_TORRENT_STATUS_ADD = 1800; + public const EVENT_TORRENT_STATUS_DELETE = 1801; - public const EVENT_TORRENT_POSTER_ADD = 2800; - public const EVENT_TORRENT_POSTER_DELETE = 2801; - public const EVENT_TORRENT_POSTER_APPROVE_ADD = 2810; - public const EVENT_TORRENT_POSTER_APPROVE_DELETE = 2811; + public const EVENT_TORRENT_POSTER_ADD = 2800; + public const EVENT_TORRENT_POSTER_DELETE = 2801; + public const EVENT_TORRENT_POSTER_APPROVE_ADD = 2810; + public const EVENT_TORRENT_POSTER_APPROVE_DELETE = 2811; + + public const EVENT_TORRENT_CATEGORIES_ADD = 2900; + public const EVENT_TORRENT_CATEGORIES_DELETE = 2901; + public const EVENT_TORRENT_CATEGORIES_APPROVE_ADD = 2910; + public const EVENT_TORRENT_CATEGORIES_APPROVE_DELETE = 2911; // ... diff --git a/src/Service/ActivityService.php b/src/Service/ActivityService.php index 75b37e8..dd785d1 100644 --- a/src/Service/ActivityService.php +++ b/src/Service/ActivityService.php @@ -51,6 +51,11 @@ class ActivityService Activity::EVENT_TORRENT_LOCALES_APPROVE_ADD, Activity::EVENT_TORRENT_LOCALES_APPROVE_DELETE, + Activity::EVENT_TORRENT_CATEGORIES_ADD, + Activity::EVENT_TORRENT_CATEGORIES_DELETE, + Activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD, + Activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE, + Activity::EVENT_TORRENT_SENSITIVE_ADD, Activity::EVENT_TORRENT_SENSITIVE_DELETE, Activity::EVENT_TORRENT_SENSITIVE_APPROVE_ADD, @@ -277,6 +282,55 @@ class ActivityService break; + /// Torrent categories + case Activity::EVENT_TORRENT_CATEGORIES_ADD: + + $events + [ + $this->translatorInterface->trans('Torrent categories') + ] + [ + $this->translatorInterface->trans('Added') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_CATEGORIES_DELETE: + + $events + [ + $this->translatorInterface->trans('Torrent categories') + ] + [ + $this->translatorInterface->trans('Deleted') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD: + + $events + [ + $this->translatorInterface->trans('Torrent categories') + ] + [ + $this->translatorInterface->trans('Approved') + ] = $code; + + break; + + case Activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE: + + $events + [ + $this->translatorInterface->trans('Torrent categories') + ] + [ + $this->translatorInterface->trans('Disapproved') + ] = $code; + + break; + /// Torrent sensitive case Activity::EVENT_TORRENT_SENSITIVE_ADD: @@ -1303,6 +1357,155 @@ class ActivityService return $activity; } + /// Torrent categories + public function addEventTorrentCategoriesAdd( + int $userId, + int $torrentId, + int $added, + int $torrentCategoriesId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_CATEGORIES_ADD + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentCategoriesId' => $torrentCategoriesId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentCategoriesDelete( + int $userId, + int $torrentId, + int $added, + int $torrentCategoriesId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_CATEGORIES_DELETE + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentCategoriesId' => $torrentCategoriesId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentCategoriesApproveAdd( + int $userId, + int $torrentId, + int $added, + int $torrentCategoriesId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_CATEGORIES_APPROVE_ADD + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentCategoriesId' => $torrentCategoriesId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + + public function addEventTorrentCategoriesApproveDelete( + int $userId, + int $torrentId, + int $added, + int $torrentCategoriesId, + ): ?Activity + { + $activity = new Activity(); + + $activity->setEvent( + Activity::EVENT_TORRENT_CATEGORIES_APPROVE_DELETE + ); + + $activity->setUserId( + $userId + ); + + $activity->setTorrentId( + $torrentId + ); + + $activity->setAdded( + $added + ); + + $activity->setData( + [ + 'torrentCategoriesId' => $torrentCategoriesId + ] + ); + + $this->entityManagerInterface->persist($activity); + $this->entityManagerInterface->flush(); + + return $activity; + } + /// Torrent sensitive public function addEventTorrentSensitiveAdd( int $userId, diff --git a/templates/default/activity/event/torrent/categories/add.html.twig b/templates/default/activity/event/torrent/categories/add.html.twig new file mode 100644 index 0000000..1d081c7 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/add.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have added categories edition' | trans }} + {% if torrent.categories.exist %} + + #{{ torrent.categories.id }} + + {% else %} + #{{ torrent.categories.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/add.rss.twig b/templates/default/activity/event/torrent/categories/add.rss.twig new file mode 100644 index 0000000..2262f72 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/add.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have added categories edition' | trans }} + #{{ torrent.categories.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity-{{ id }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/approve/add.html.twig b/templates/default/activity/event/torrent/categories/approve/add.html.twig new file mode 100644 index 0000000..19c4836 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/approve/add.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have approved categories edition' | trans }} + {% if torrent.categories.exist %} + + #{{ torrent.categories.id }} + + {% else %} + #{{ torrent.categories.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/approve/add.rss.twig b/templates/default/activity/event/torrent/categories/approve/add.rss.twig new file mode 100644 index 0000000..9395f46 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/approve/add.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have approved categories edition' | trans }} + #{{ torrent.categories.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity-{{ id }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/approve/delete.html.twig b/templates/default/activity/event/torrent/categories/approve/delete.html.twig new file mode 100644 index 0000000..2d9b682 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/approve/delete.html.twig @@ -0,0 +1,41 @@ +
+
+ + {{ 'identicon' | trans }} + + + {{ 'have disapproved categories edition' | trans }} + + {% if torrent.categories.exist %} + + #{{ torrent.categories.id }} + + {% else %} + #{{ torrent.categories.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/approve/delete.rss.twig b/templates/default/activity/event/torrent/categories/approve/delete.rss.twig new file mode 100644 index 0000000..a6a6970 --- /dev/null +++ b/templates/default/activity/event/torrent/categories/approve/delete.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have disapproved categories edition' | trans }} + #{{ torrent.categories.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity-{{ id }} + {{ url('torrent_categories_edit', { torrentId : torrent.id, torrentCategoriesId : torrent.categories.id }) }}#activity + \ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/delete.html.twig b/templates/default/activity/event/torrent/categories/delete.html.twig new file mode 100644 index 0000000..06b972b --- /dev/null +++ b/templates/default/activity/event/torrent/categories/delete.html.twig @@ -0,0 +1,39 @@ +
+
+ + {{ 'identicon' | trans }} + + {{ 'have deleted categories edition' | trans }} + {% if torrent.categories.exist %} + + #{{ torrent.categories.id }} + + {% else %} + #{{ torrent.categories.id }} + {% endif %} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + + {{ torrent.name }} + + {% if torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% endif %} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + + {{ torrent.name }} + + {% endif %} + {% endif %} +
+
+ {{ added | format_ago }} +
+
\ No newline at end of file diff --git a/templates/default/activity/event/torrent/categories/delete.rss.twig b/templates/default/activity/event/torrent/categories/delete.rss.twig new file mode 100644 index 0000000..063750b --- /dev/null +++ b/templates/default/activity/event/torrent/categories/delete.rss.twig @@ -0,0 +1,26 @@ + + + {{ 'User' | trans }} + #{{ user.id }} + {{ 'have deleted categories edition' | trans }} + #{{ torrent.categories.id }} + {{ 'for torrent' | trans }} + {% if session.user.moderator or session.user.owner %} + {{ torrent.name }} + {% else %} + {% if torrent.status == false %} + #{{ torrent.id }} ({{ 'disabled' | trans }}) + {% elseif torrent.approved == false %} + #{{ torrent.id }} ({{ 'waiting for approve' | trans }}) + {% elseif torrent.sensitive == true and session.user.sensitive == true %} + #{{ torrent.id }} ({{ 'sensitive' | trans }}) + {% else %} + {{ torrent.name }} + {% endif %} + {% endif %} + + #{{ user.id }} + {{ added | date('D, d M Y h:i:s O') }} + {{ url('torrent_categories_edit', { torrentId : torrent.id }) }}#activity-{{ id }} + {{ url('torrent_categories_edit', { torrentId : torrent.id }) }}#activity + \ No newline at end of file diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 49c610a..1115d0c 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 1baf706..cfbeb98 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index 3085a7b..d26ce5e 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -829,6 +829,26 @@ Category Category + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 73c15c1..a253a32 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index d759331..e24ce1d 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index f2a251f..6bc5976 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 39a42e3..9fa5a88 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index 6c16e22..b4cffab 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.ja.xlf b/translations/messages+intl-icu.ja.xlf index 0aafa20..45b196f 100644 --- a/translations/messages+intl-icu.ja.xlf +++ b/translations/messages+intl-icu.ja.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 8c5f53e..ffa30a5 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index 1bfc3af..963f4df 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.nl.xlf b/translations/messages+intl-icu.nl.xlf index 7eb6e86..b3640ec 100644 --- a/translations/messages+intl-icu.nl.xlf +++ b/translations/messages+intl-icu.nl.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index fc015e5..bd71936 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 356f38d..d8f40a7 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -797,6 +797,58 @@ Bottom Bottom + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index 6861445..e96055f 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -797,6 +797,58 @@ Bottom Низ + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition + diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index 59dc5d8..7b48cf8 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -797,6 +797,58 @@ Bottom Низ + + Categories + Categories + + + At least one category required + At least one category required + + + Content category + Content category + + + This torrent have selected categories + This torrent have selected categories + + + Edit categories + Edit categories + + + Edit categories for torrent + Edit categories for torrent + + + Locale + Locale + + + Category + Category + + + Torrent categories + Torrent categories + + + have deleted categories edition + have deleted categories edition + + + have disapproved categories edition + have disapproved categories edition + + + have approved categories edition + have approved categories edition + + + have added categories edition + have added categories edition +