diff options
Diffstat (limited to 'src/Wallabag/CoreBundle')
16 files changed, 75 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 9a7dd4e7..a0503c39 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -685,6 +685,21 @@ class Entry | |||
685 | } | 685 | } |
686 | 686 | ||
687 | /** | 687 | /** |
688 | * Used in the entries filter so it's more explicit for the end user than the uid. | ||
689 | * Also used in the API. | ||
690 | * | ||
691 | * @VirtualProperty | ||
692 | * @SerializedName("is_public") | ||
693 | * @Groups({"entries_for_user"}) | ||
694 | * | ||
695 | * @return bool | ||
696 | */ | ||
697 | public function isPublic() | ||
698 | { | ||
699 | return null !== $this->uid; | ||
700 | } | ||
701 | |||
702 | /** | ||
688 | * @return string | 703 | * @return string |
689 | */ | 704 | */ |
690 | public function getHttpStatus() | 705 | public function getHttpStatus() |
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 556578d1..6a4c485f 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php | |||
@@ -150,6 +150,20 @@ class EntryFilterType extends AbstractType | |||
150 | }, | 150 | }, |
151 | 'label' => 'entry.filters.preview_picture_label', | 151 | 'label' => 'entry.filters.preview_picture_label', |
152 | ]) | 152 | ]) |
153 | ->add('isPublic', CheckboxFilterType::class, [ | ||
154 | 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { | ||
155 | if (false === $values['value']) { | ||
156 | return; | ||
157 | } | ||
158 | |||
159 | // is_public isn't a real field | ||
160 | // we should use the "uid" field to determine if the entry has been made public | ||
161 | $expression = $filterQuery->getExpr()->isNotNull($values['alias'].'.uid'); | ||
162 | |||
163 | return $filterQuery->createCondition($expression); | ||
164 | }, | ||
165 | 'label' => 'entry.filters.is_public_label', | ||
166 | ]) | ||
153 | ->add('language', ChoiceFilterType::class, [ | 167 | ->add('language', ChoiceFilterType::class, [ |
154 | 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())), | 168 | 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())), |
155 | 'label' => 'entry.filters.language_label', | 169 | 'label' => 'entry.filters.language_label', |
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 6972e974..9bda4e15 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -135,6 +135,7 @@ class EntryRepository extends EntityRepository | |||
135 | * @param int $userId | 135 | * @param int $userId |
136 | * @param bool $isArchived | 136 | * @param bool $isArchived |
137 | * @param bool $isStarred | 137 | * @param bool $isStarred |
138 | * @param bool $isPublic | ||
138 | * @param string $sort | 139 | * @param string $sort |
139 | * @param string $order | 140 | * @param string $order |
140 | * @param int $since | 141 | * @param int $since |
@@ -142,18 +143,22 @@ class EntryRepository extends EntityRepository | |||
142 | * | 143 | * |
143 | * @return array | 144 | * @return array |
144 | */ | 145 | */ |
145 | public function findEntries($userId, $isArchived = null, $isStarred = null, $sort = 'created', $order = 'ASC', $since = 0, $tags = '') | 146 | public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'ASC', $since = 0, $tags = '') |
146 | { | 147 | { |
147 | $qb = $this->createQueryBuilder('e') | 148 | $qb = $this->createQueryBuilder('e') |
148 | ->leftJoin('e.tags', 't') | 149 | ->leftJoin('e.tags', 't') |
149 | ->where('e.user =:userId')->setParameter('userId', $userId); | 150 | ->where('e.user =:userId')->setParameter('userId', $userId); |
150 | 151 | ||
151 | if (null !== $isArchived) { | 152 | if (null !== $isArchived) { |
152 | $qb->andWhere('e.isArchived =:isArchived')->setParameter('isArchived', (bool) $isArchived); | 153 | $qb->andWhere('e.isArchived = :isArchived')->setParameter('isArchived', (bool) $isArchived); |
153 | } | 154 | } |
154 | 155 | ||
155 | if (null !== $isStarred) { | 156 | if (null !== $isStarred) { |
156 | $qb->andWhere('e.isStarred =:isStarred')->setParameter('isStarred', (bool) $isStarred); | 157 | $qb->andWhere('e.isStarred = :isStarred')->setParameter('isStarred', (bool) $isStarred); |
158 | } | ||
159 | |||
160 | if (null !== $isPublic) { | ||
161 | $qb->andWhere('e.uid IS '.(true === $isPublic ? 'NOT' : '').' NULL'); | ||
157 | } | 162 | } |
158 | 163 | ||
159 | if ($since > 0) { | 164 | if ($since > 0) { |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 5e7afe27..02dd04f2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | |||
@@ -186,6 +186,8 @@ entry: | |||
186 | unread_label: 'Ulæst' | 186 | unread_label: 'Ulæst' |
187 | preview_picture_label: 'Har et vist billede' | 187 | preview_picture_label: 'Har et vist billede' |
188 | preview_picture_help: 'Forhåndsvis billede' | 188 | preview_picture_help: 'Forhåndsvis billede' |
189 | # is_public_label: 'Has a public link' | ||
190 | # is_public_help: 'Public link' | ||
189 | language_label: 'Sprog' | 191 | language_label: 'Sprog' |
190 | # http_status_label: 'HTTP status' | 192 | # http_status_label: 'HTTP status' |
191 | reading_time: | 193 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 00468575..f6ccdae0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | unread_label: 'Ungelesene' | 187 | unread_label: 'Ungelesene' |
188 | preview_picture_label: 'Vorschaubild vorhanden' | 188 | preview_picture_label: 'Vorschaubild vorhanden' |
189 | preview_picture_help: 'Vorschaubild' | 189 | preview_picture_help: 'Vorschaubild' |
190 | # is_public_label: 'Has a public link' | ||
191 | # is_public_help: 'Public link' | ||
190 | language_label: 'Sprache' | 192 | language_label: 'Sprache' |
191 | http_status_label: 'HTTP-Status' | 193 | http_status_label: 'HTTP-Status' |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 572084c1..902c3046 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | unread_label: 'Unread' | 187 | unread_label: 'Unread' |
188 | preview_picture_label: 'Has a preview picture' | 188 | preview_picture_label: 'Has a preview picture' |
189 | preview_picture_help: 'Preview picture' | 189 | preview_picture_help: 'Preview picture' |
190 | is_public_label: 'Has a public link' | ||
191 | is_public_help: 'Public link' | ||
190 | language_label: 'Language' | 192 | language_label: 'Language' |
191 | http_status_label: 'HTTP status' | 193 | http_status_label: 'HTTP status' |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 0f2a4a7b..afd6a7b1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | unread_label: 'Sin leer' | 187 | unread_label: 'Sin leer' |
188 | preview_picture_label: 'Tiene imagen de previsualización' | 188 | preview_picture_label: 'Tiene imagen de previsualización' |
189 | preview_picture_help: 'Imagen de previsualización' | 189 | preview_picture_help: 'Imagen de previsualización' |
190 | # is_public_label: 'Has a public link' | ||
191 | # is_public_help: 'Public link' | ||
190 | language_label: 'Idioma' | 192 | language_label: 'Idioma' |
191 | http_status_label: 'Código de estado HTTP' | 193 | http_status_label: 'Código de estado HTTP' |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index a8900489..545514b3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | unread_label: 'خواندهنشده' | 187 | unread_label: 'خواندهنشده' |
188 | preview_picture_label: 'دارای عکس پیشنمایش' | 188 | preview_picture_label: 'دارای عکس پیشنمایش' |
189 | preview_picture_help: 'پیشنمایش عکس' | 189 | preview_picture_help: 'پیشنمایش عکس' |
190 | # is_public_label: 'Has a public link' | ||
191 | # is_public_help: 'Public link' | ||
190 | language_label: 'زبان' | 192 | language_label: 'زبان' |
191 | # http_status_label: 'HTTP status' | 193 | # http_status_label: 'HTTP status' |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 6969b67b..e9e79c67 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | unread_label: "Non lus" | 187 | unread_label: "Non lus" |
188 | preview_picture_label: "A une photo" | 188 | preview_picture_label: "A une photo" |
189 | preview_picture_help: "Photo" | 189 | preview_picture_help: "Photo" |
190 | is_public_label: 'A un lien public' | ||
191 | is_public_help: 'Lien public' | ||
190 | language_label: "Langue" | 192 | language_label: "Langue" |
191 | http_status_label: "Statut HTTP" | 193 | http_status_label: "Statut HTTP" |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index c2007057..0597d3e3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | # unread_label: 'Unread' | 187 | # unread_label: 'Unread' |
188 | preview_picture_label: "Ha un'immagine di anteprima" | 188 | preview_picture_label: "Ha un'immagine di anteprima" |
189 | preview_picture_help: 'Immagine di anteprima' | 189 | preview_picture_help: 'Immagine di anteprima' |
190 | # is_public_label: 'Has a public link' | ||
191 | # is_public_help: 'Public link' | ||
190 | language_label: 'Lingua' | 192 | language_label: 'Lingua' |
191 | # http_status_label: 'HTTP status' | 193 | # http_status_label: 'HTTP status' |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 3ac472d0..c172a0f6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | unread_label: 'Pas legits' | 187 | unread_label: 'Pas legits' |
188 | preview_picture_label: 'A un imatge' | 188 | preview_picture_label: 'A un imatge' |
189 | preview_picture_help: 'Imatge' | 189 | preview_picture_help: 'Imatge' |
190 | # is_public_label: 'Has a public link' | ||
191 | # is_public_help: 'Public link' | ||
190 | language_label: 'Lenga' | 192 | language_label: 'Lenga' |
191 | http_status_label: 'Estatut HTTP' | 193 | http_status_label: 'Estatut HTTP' |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index fa672387..82d16767 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | unread_label: 'Nieprzeczytane' | 187 | unread_label: 'Nieprzeczytane' |
188 | preview_picture_label: 'Posiada podgląd obrazu' | 188 | preview_picture_label: 'Posiada podgląd obrazu' |
189 | preview_picture_help: 'Podgląd obrazu' | 189 | preview_picture_help: 'Podgląd obrazu' |
190 | # is_public_label: 'Has a public link' | ||
191 | # is_public_help: 'Public link' | ||
190 | language_label: 'Język' | 192 | language_label: 'Język' |
191 | http_status_label: 'Status HTTP' | 193 | http_status_label: 'Status HTTP' |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 896ccb04..b75567d6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | unread_label: 'Não Lido' | 187 | unread_label: 'Não Lido' |
188 | preview_picture_label: 'Possui uma imagem de preview' | 188 | preview_picture_label: 'Possui uma imagem de preview' |
189 | preview_picture_help: 'Imagem de preview' | 189 | preview_picture_help: 'Imagem de preview' |
190 | # is_public_label: 'Has a public link' | ||
191 | # is_public_help: 'Public link' | ||
190 | language_label: 'Idioma' | 192 | language_label: 'Idioma' |
191 | # http_status_label: 'HTTP status' | 193 | # http_status_label: 'HTTP status' |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index c447dc9b..95df573d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | |||
@@ -187,6 +187,8 @@ entry: | |||
187 | unread_label: 'Necitite' | 187 | unread_label: 'Necitite' |
188 | preview_picture_label: 'Are o imagine de previzualizare' | 188 | preview_picture_label: 'Are o imagine de previzualizare' |
189 | preview_picture_help: 'Previzualizare imagine' | 189 | preview_picture_help: 'Previzualizare imagine' |
190 | # is_public_label: 'Has a public link' | ||
191 | # is_public_help: 'Public link' | ||
190 | language_label: 'Limbă' | 192 | language_label: 'Limbă' |
191 | # http_status_label: 'HTTP status' | 193 | # http_status_label: 'HTTP status' |
192 | reading_time: | 194 | reading_time: |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig index 0ba6f4f4..6c26d5bf 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig | |||
@@ -127,6 +127,11 @@ | |||
127 | {{ form_widget(form.previewPicture) }} | 127 | {{ form_widget(form.previewPicture) }} |
128 | {{ form_label(form.previewPicture) }} | 128 | {{ form_label(form.previewPicture) }} |
129 | </div> | 129 | </div> |
130 | |||
131 | <div class="input-field"> | ||
132 | {{ form_widget(form.isPublic) }} | ||
133 | {{ form_label(form.isPublic) }} | ||
134 | </div> | ||
130 | </div> | 135 | </div> |
131 | 136 | ||
132 | <div id="filter-language" class="filter-group"> | 137 | <div id="filter-language" class="filter-group"> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index 6f657b18..5ba42057 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig | |||
@@ -103,6 +103,15 @@ | |||
103 | </div> | 103 | </div> |
104 | 104 | ||
105 | <div class="col s12"> | 105 | <div class="col s12"> |
106 | <label>{{ 'entry.filters.is_public_help'|trans }}</label> | ||
107 | </div> | ||
108 | |||
109 | <div class="input-field col s12 with-checkbox"> | ||
110 | {{ form_widget(form.isPublic) }} | ||
111 | {{ form_label(form.isPublic) }} | ||
112 | </div> | ||
113 | |||
114 | <div class="col s12"> | ||
106 | {{ form_label(form.language) }} | 115 | {{ form_label(form.language) }} |
107 | </div> | 116 | </div> |
108 | 117 | ||
@@ -121,10 +130,12 @@ | |||
121 | <div class="col s12"> | 130 | <div class="col s12"> |
122 | {{ form_label(form.readingTime) }} | 131 | {{ form_label(form.readingTime) }} |
123 | </div> | 132 | </div> |
133 | |||
124 | <div class="input-field col s6"> | 134 | <div class="input-field col s6"> |
125 | {{ form_widget(form.readingTime.left_number, {'type': 'number'}) }} | 135 | {{ form_widget(form.readingTime.left_number, {'type': 'number'}) }} |
126 | <label for="entry_filter_readingTime_left_number">{{ 'entry.filters.reading_time.from'|trans }}</label> | 136 | <label for="entry_filter_readingTime_left_number">{{ 'entry.filters.reading_time.from'|trans }}</label> |
127 | </div> | 137 | </div> |
138 | |||
128 | <div class="input-field col s6"> | 139 | <div class="input-field col s6"> |
129 | {{ form_widget(form.readingTime.right_number, {'type': 'number'}) }} | 140 | {{ form_widget(form.readingTime.right_number, {'type': 'number'}) }} |
130 | <label for="entry_filter_readingTime_right_number">{{ 'entry.filters.reading_time.to'|trans }}</label> | 141 | <label for="entry_filter_readingTime_right_number">{{ 'entry.filters.reading_time.to'|trans }}</label> |