diff options
3 files changed, 42 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 9b2954e7..fad2b51c 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php | |||
@@ -518,6 +518,24 @@ class EntryController extends Controller | |||
518 | } | 518 | } |
519 | 519 | ||
520 | /** | 520 | /** |
521 | * List the entries with the same domain as the current one. | ||
522 | * | ||
523 | * @param int $page | ||
524 | * | ||
525 | * @Route("/same-domain/{id}/{page}", requirements={"id" = ".+"}, defaults={"page" = 1}, name="same_domain") | ||
526 | * | ||
527 | * @return \Symfony\Component\HttpFoundation\Response | ||
528 | */ | ||
529 | public function getSameDomainEntries(Request $request, $page = 1) | ||
530 | { | ||
531 | if (!$this->get('craue_config')->get('share_public')) { | ||
532 | throw $this->createAccessDeniedException('Sharing an entry is disabled for this user.'); | ||
533 | } | ||
534 | |||
535 | return $this->showEntries('same-domain', $request, $page); | ||
536 | } | ||
537 | |||
538 | /** | ||
521 | * Global method to retrieve entries depending on the given type | 539 | * Global method to retrieve entries depending on the given type |
522 | * It returns the response to be send. | 540 | * It returns the response to be send. |
523 | * | 541 | * |
@@ -548,6 +566,9 @@ class EntryController extends Controller | |||
548 | case 'unread': | 566 | case 'unread': |
549 | $qb = $repository->getBuilderForUnreadByUser($this->getUser()->getId()); | 567 | $qb = $repository->getBuilderForUnreadByUser($this->getUser()->getId()); |
550 | break; | 568 | break; |
569 | case 'same-domain': | ||
570 | $qb = $repository->getBuilderForSameDomainByUser($this->getUser()->getId(), $request->get('id')); | ||
571 | break; | ||
551 | case 'all': | 572 | case 'all': |
552 | $qb = $repository->getBuilderForAllByUser($this->getUser()->getId()); | 573 | $qb = $repository->getBuilderForAllByUser($this->getUser()->getId()); |
553 | break; | 574 | break; |
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index bfd07937..f2c73bbf 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -39,6 +39,26 @@ class EntryRepository extends EntityRepository | |||
39 | return $this | 39 | return $this |
40 | ->getSortedQueryBuilderByUser($userId) | 40 | ->getSortedQueryBuilderByUser($userId) |
41 | ->andWhere('e.isArchived = false') | 41 | ->andWhere('e.isArchived = false') |
42 | ; | ||
43 | } | ||
44 | |||
45 | /** | ||
46 | * Retrieves entries with the same domain. | ||
47 | * | ||
48 | * @param int $userId | ||
49 | * @param int $entryId | ||
50 | * | ||
51 | * @return QueryBuilder | ||
52 | */ | ||
53 | public function getBuilderForSameDomainByUser($userId, $entryId) | ||
54 | { | ||
55 | dump($entryId);die; | ||
56 | |||
57 | $ | ||
58 | |||
59 | return $this | ||
60 | ->getSortedQueryBuilderByUser($userId) | ||
61 | ->andWhere('e.isArchived = false') | ||
42 | ; | 62 | ; |
43 | } | 63 | } |
44 | 64 | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig index 1102a0bd..e66cdf2c 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig | |||
@@ -7,7 +7,7 @@ | |||
7 | </a> | 7 | </a> |
8 | 8 | ||
9 | <div class="{{ subClass|default('original grey-text') }}"> | 9 | <div class="{{ subClass|default('original grey-text') }}"> |
10 | <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool grey-text">{{ entry.domainName|removeWww }}</a> | 10 | <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool grey-text">{{ entry.domainName|removeWww }}</a> <a href="{{ path('same_domain', { 'id': entry.id }) }}"><i class="material-icons">language</i></a> |
11 | {% if withMetadata is defined %} | 11 | {% if withMetadata is defined %} |
12 | {% include "@WallabagCore/themes/material/Entry/_tags.html.twig" with {'tags': entry.tags | slice(0, 3), 'entryId': entry.id, 'listClass': ' hide-on-med-and-down'} only %} | 12 | {% include "@WallabagCore/themes/material/Entry/_tags.html.twig" with {'tags': entry.tags | slice(0, 3), 'entryId': entry.id, 'listClass': ' hide-on-med-and-down'} only %} |
13 | <div class="reading-time grey-text"> | 13 | <div class="reading-time grey-text"> |