aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-05 22:33:36 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-05 22:33:36 +0100
commit905ae369bd0238cc24c3c4e0ac60d578d30b54bb (patch)
tree262f350c30eea94316242362b0246f92c5344987 /src/Wallabag
parentc8dee953961964aa842e516995f0c6fafd007f9b (diff)
downloadwallabag-905ae369bd0238cc24c3c4e0ac60d578d30b54bb.tar.gz
wallabag-905ae369bd0238cc24c3c4e0ac60d578d30b54bb.tar.zst
wallabag-905ae369bd0238cc24c3c4e0ac60d578d30b54bb.zip
normalize entries fields
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Controller/WallabagRestController.php4
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entries.php40
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntriesRepository.php16
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig4
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig4
5 files changed, 34 insertions, 34 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
index f14f821b..75de58f7 100644
--- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
@@ -125,7 +125,7 @@ class WallabagRestController extends Controller
125 } 125 }
126 126
127 if (!is_null($isArchived)) { 127 if (!is_null($isArchived)) {
128 $entry->setRead($isArchived); 128 $entry->setArchived($isArchived);
129 } 129 }
130 130
131 if (!is_null($isDeleted)) { 131 if (!is_null($isDeleted)) {
@@ -133,7 +133,7 @@ class WallabagRestController extends Controller
133 } 133 }
134 134
135 if (!is_null($isStarred)) { 135 if (!is_null($isStarred)) {
136 $entry->setFav($isStarred); 136 $entry->setStarred($isStarred);
137 } 137 }
138 138
139 $em = $this->getDoctrine()->getManager(); 139 $em = $this->getDoctrine()->getManager();
diff --git a/src/Wallabag/CoreBundle/Entity/Entries.php b/src/Wallabag/CoreBundle/Entity/Entries.php
index ab5b859b..f06a2940 100644
--- a/src/Wallabag/CoreBundle/Entity/Entries.php
+++ b/src/Wallabag/CoreBundle/Entity/Entries.php
@@ -42,16 +42,16 @@ class Entries
42 /** 42 /**
43 * @var boolean 43 * @var boolean
44 * 44 *
45 * @ORM\Column(name="is_read", type="boolean", nullable=true, options={"default" = false}) 45 * @ORM\Column(name="is_archived", type="boolean", nullable=true, options={"default" = false})
46 */ 46 */
47 private $isRead = false; 47 private $isArchived = false;
48 48
49 /** 49 /**
50 * @var boolean 50 * @var boolean
51 * 51 *
52 * @ORM\Column(name="is_fav", type="boolean", nullable=true, options={"default" = false}) 52 * @ORM\Column(name="is_starred", type="boolean", nullable=true, options={"default" = false})
53 */ 53 */
54 private $isFav = false; 54 private $isStarred = false;
55 55
56 /** 56 /**
57 * @var boolean 57 * @var boolean
@@ -180,61 +180,61 @@ class Entries
180 } 180 }
181 181
182 /** 182 /**
183 * Set isRead 183 * Set isArchived
184 * 184 *
185 * @param string $isRead 185 * @param string $isArchived
186 * @return Entries 186 * @return Entries
187 */ 187 */
188 public function setRead($isRead) 188 public function setArchived($isArchived)
189 { 189 {
190 $this->isRead = $isRead; 190 $this->isArchived = $isArchived;
191 191
192 return $this; 192 return $this;
193 } 193 }
194 194
195 /** 195 /**
196 * Get isRead 196 * Get isArchived
197 * 197 *
198 * @return string 198 * @return string
199 */ 199 */
200 public function isRead() 200 public function isArchived()
201 { 201 {
202 return $this->isRead; 202 return $this->isArchived;
203 } 203 }
204 204
205 public function toggleArchive() 205 public function toggleArchive()
206 { 206 {
207 $this->isRead = $this->getIsRead() ^ 1; 207 $this->isArchived = $this->isArchived() ^ 1;
208 208
209 return $this; 209 return $this;
210 } 210 }
211 211
212 /** 212 /**
213 * Set isFav 213 * Set isStarred
214 * 214 *
215 * @param string $isFav 215 * @param string $isStarred
216 * @return Entries 216 * @return Entries
217 */ 217 */
218 public function setFav($isFav) 218 public function setStarred($isStarred)
219 { 219 {
220 $this->isFav = $isFav; 220 $this->isStarred = $isStarred;
221 221
222 return $this; 222 return $this;
223 } 223 }
224 224
225 /** 225 /**
226 * Get isFav 226 * Get isStarred
227 * 227 *
228 * @return string 228 * @return string
229 */ 229 */
230 public function isFav() 230 public function isStarred()
231 { 231 {
232 return $this->isFav; 232 return $this->isStarred;
233 } 233 }
234 234
235 public function toggleStar() 235 public function toggleStar()
236 { 236 {
237 $this->isFav = $this->getIsFav() ^ 1; 237 $this->isStarred = $this->isStarred() ^ 1;
238 238
239 return $this; 239 return $this;
240 } 240 }
diff --git a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
index ae854e5a..9965317a 100644
--- a/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntriesRepository.php
@@ -23,9 +23,9 @@ class EntriesRepository extends EntityRepository
23 ->select('e') 23 ->select('e')
24 ->setFirstResult($firstResult) 24 ->setFirstResult($firstResult)
25 ->setMaxResults($maxResults) 25 ->setMaxResults($maxResults)
26 ->where('e.isRead = 0') 26 ->where('e.isArchived = false')
27 ->andWhere('e.userId =:userId')->setParameter('userId', $userId) 27 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
28 ->andWhere('e.isDeleted=0') 28 ->andWhere('e.isDeleted=false')
29 ->orderBy('e.createdAt', 'desc') 29 ->orderBy('e.createdAt', 'desc')
30 ->getQuery(); 30 ->getQuery();
31 31
@@ -48,9 +48,9 @@ class EntriesRepository extends EntityRepository
48 ->select('e') 48 ->select('e')
49 ->setFirstResult($firstResult) 49 ->setFirstResult($firstResult)
50 ->setMaxResults($maxResults) 50 ->setMaxResults($maxResults)
51 ->where('e.isRead = 1') 51 ->where('e.isArchived = true')
52 ->andWhere('e.userId =:userId')->setParameter('userId', $userId) 52 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
53 ->andWhere('e.isDeleted=0') 53 ->andWhere('e.isDeleted=false')
54 ->orderBy('e.createdAt', 'desc') 54 ->orderBy('e.createdAt', 'desc')
55 ->getQuery(); 55 ->getQuery();
56 56
@@ -73,9 +73,9 @@ class EntriesRepository extends EntityRepository
73 ->select('e') 73 ->select('e')
74 ->setFirstResult($firstResult) 74 ->setFirstResult($firstResult)
75 ->setMaxResults($maxResults) 75 ->setMaxResults($maxResults)
76 ->where('e.isFav = 1') 76 ->where('e.isStarred = true')
77 ->andWhere('e.userId =:userId')->setParameter('userId', $userId) 77 ->andWhere('e.userId =:userId')->setParameter('userId', $userId)
78 ->andWhere('e.isDeleted=0') 78 ->andWhere('e.isDeleted=false')
79 ->orderBy('e.createdAt', 'desc') 79 ->orderBy('e.createdAt', 'desc')
80 ->getQuery(); 80 ->getQuery();
81 81
@@ -91,11 +91,11 @@ class EntriesRepository extends EntityRepository
91 ->where('e.userId =:userId')->setParameter('userId', $userId); 91 ->where('e.userId =:userId')->setParameter('userId', $userId);
92 92
93 if (!is_null($isArchived)) { 93 if (!is_null($isArchived)) {
94 $qb->andWhere('e.isRead =:isArchived')->setParameter('isArchived', $isArchived); 94 $qb->andWhere('e.isArchived =:isArchived')->setParameter('isArchived', $isArchived);
95 } 95 }
96 96
97 if (!is_null($isStarred)) { 97 if (!is_null($isStarred)) {
98 $qb->andWhere('e.isFav =:isStarred')->setParameter('isStarred', $isStarred); 98 $qb->andWhere('e.isStarred =:isStarred')->setParameter('isStarred', $isStarred);
99 } 99 }
100 100
101 if (!is_null($isDeleted)) { 101 if (!is_null($isDeleted)) {
diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig
index 2f8423d7..dfce4b3c 100644
--- a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig
@@ -35,8 +35,8 @@
35 {% endif %} 35 {% endif %}
36 36
37 <ul class="tools links"> 37 <ul class="tools links">
38 <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li> 38 <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li>
39 <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li> 39 <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li>
40 <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li> 40 <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li>
41 <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.url | e | domainName }}</span></a></li> 41 <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.url | e | domainName }}</span></a></li>
42 </ul> 42 </ul>
diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig
index edb15d55..f0c00509 100644
--- a/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig
@@ -11,8 +11,8 @@
11 <ul class="links"> 11 <ul class="links">
12 <li class="topPosF"><a href="#top" title="{% trans %}Back to top{% endtrans %}" class="tool top icon icon-arrow-up-thick"><span>{% trans %}Back to top{% endtrans %}</span></a></li> 12 <li class="topPosF"><a href="#top" title="{% trans %}Back to top{% endtrans %}" class="tool top icon icon-arrow-up-thick"><span>{% trans %}Back to top{% endtrans %}</span></a></li>
13 <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.url | e | domainName }}</span></a></li> 13 <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.url | e | domainName }}</span></a></li>
14 <li><a title="{% trans %}Mark as read{% endtrans %}" class="tool icon icon-check {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li> 14 <li><a title="{% trans %}Mark as read{% endtrans %}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li>
15 <li><a title="{% trans %}Favorite{% endtrans %}" class="tool icon icon-star {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle favorite{% endtrans %}</span></a></li> 15 <li><a title="{% trans %}Favorite{% endtrans %}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle favorite{% endtrans %}</span></a></li>
16 <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}Delete{% endtrans %}</span></a></li> 16 <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}Delete{% endtrans %}</span></a></li>
17 {% if share_twitter %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}Tweet{% endtrans %}"><span>{% trans %}Tweet{% endtrans %}</span></a></li>{% endif %} 17 {% if share_twitter %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}Tweet{% endtrans %}"><span>{% trans %}Tweet{% endtrans %}</span></a></li>{% endif %}
18 {% if share_mail %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %} 18 {% if share_mail %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %}