diff options
-rwxr-xr-x | bin/install | 6 | ||||
-rw-r--r-- | src/WallabagBundle/Controller/EntryController.php | 92 | ||||
-rw-r--r-- | src/WallabagBundle/Controller/StaticController.php | 20 | ||||
-rw-r--r-- | src/WallabagBundle/Entity/Entries.php | 13 | ||||
-rw-r--r-- | src/WallabagBundle/Repository/EntriesRepository.php | 26 | ||||
-rw-r--r-- | src/WallabagBundle/Resources/views/Entry/entries.html.twig | 20 | ||||
-rw-r--r-- | src/WallabagBundle/Resources/views/Entry/entry.html.twig | 18 | ||||
-rwxr-xr-x | src/WallabagBundle/Resources/views/Static/about.html.twig | 84 | ||||
-rw-r--r-- | src/WallabagBundle/Resources/views/_menu.html.twig | 6 | ||||
-rwxr-xr-x | src/WallabagBundle/Resources/views/_save_form.html.twig | 10 | ||||
-rw-r--r-- | src/WallabagBundle/Resources/views/_search_form.html.twig | 9 | ||||
-rw-r--r-- | src/WallabagBundle/Resources/views/layout.html.twig | 8 |
12 files changed, 268 insertions, 44 deletions
diff --git a/bin/install b/bin/install index 5b93e46e..61ffcb65 100755 --- a/bin/install +++ b/bin/install | |||
@@ -67,8 +67,6 @@ $query = executeQuery($handle, $sql, $params); | |||
67 | 67 | ||
68 | echo 'wallabag is now installed'; | 68 | echo 'wallabag is now installed'; |
69 | echo "\r\n"; | 69 | echo "\r\n"; |
70 | echo 'Just execute the following commands for using wallabag:'; | 70 | echo 'Just execute `php app/console server:run` for using wallabag:'; |
71 | echo "\r\n"; | 71 | echo "\r\n"; |
72 | echo 'cd web'; | 72 | echo 'http://localhost:8000'; \ No newline at end of file |
73 | echo "\r\n"; | ||
74 | echo 'php -S localhost:8000'; \ No newline at end of file | ||
diff --git a/src/WallabagBundle/Controller/EntryController.php b/src/WallabagBundle/Controller/EntryController.php index 233a6c32..fbbb76aa 100644 --- a/src/WallabagBundle/Controller/EntryController.php +++ b/src/WallabagBundle/Controller/EntryController.php | |||
@@ -4,67 +4,139 @@ namespace WallabagBundle\Controller; | |||
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | 5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\Request; | ||
7 | use WallabagBundle\Repository; | 8 | use WallabagBundle\Repository; |
9 | use WallabagBundle\Entity\Entries; | ||
8 | 10 | ||
9 | class EntryController extends Controller | 11 | class EntryController extends Controller |
10 | { | 12 | { |
11 | /** | 13 | /** |
14 | * Shows unread entries for current user | ||
15 | * | ||
12 | * @Route("/unread", name="unread") | 16 | * @Route("/unread", name="unread") |
17 | * @return \Symfony\Component\HttpFoundation\Response | ||
13 | */ | 18 | */ |
14 | public function showUnreadAction() | 19 | public function showUnreadAction() |
15 | { | 20 | { |
16 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); | 21 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); |
17 | $entries = $repository->findUnreadByUser(1); | 22 | $entries = $repository->findUnreadByUser(1, 0); |
18 | 23 | ||
19 | return $this->render( | 24 | return $this->render( |
20 | 'WallabagBundle:Entry:entries.html.twig', | 25 | 'WallabagBundle:Entry:entries.html.twig', |
21 | array('entries' => $entries) | 26 | array('entries' => $entries) |
22 | ); | 27 | ); |
23 | |||
24 | } | 28 | } |
25 | 29 | ||
26 | /** | 30 | /** |
31 | * Shows read entries for current user | ||
32 | * | ||
27 | * @Route("/archive", name="archive") | 33 | * @Route("/archive", name="archive") |
34 | * @return \Symfony\Component\HttpFoundation\Response | ||
28 | */ | 35 | */ |
29 | public function showArchiveAction() | 36 | public function showArchiveAction() |
30 | { | 37 | { |
31 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); | 38 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); |
32 | $entries = $repository->findArchiveByUser(1); | 39 | $entries = $repository->findArchiveByUser(1, 0); |
33 | 40 | ||
34 | return $this->render( | 41 | return $this->render( |
35 | 'WallabagBundle:Entry:entries.html.twig', | 42 | 'WallabagBundle:Entry:entries.html.twig', |
36 | array('entries' => $entries) | 43 | array('entries' => $entries) |
37 | ); | 44 | ); |
38 | |||
39 | } | 45 | } |
40 | 46 | ||
41 | /** | 47 | /** |
48 | * Shows starred entries for current user | ||
49 | * | ||
42 | * @Route("/starred", name="starred") | 50 | * @Route("/starred", name="starred") |
51 | * @return \Symfony\Component\HttpFoundation\Response | ||
43 | */ | 52 | */ |
44 | public function showStarredAction() | 53 | public function showStarredAction() |
45 | { | 54 | { |
46 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); | 55 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); |
47 | $entries = $repository->findStarredByUser(1); | 56 | $entries = $repository->findStarredByUser(1, 0); |
48 | 57 | ||
49 | return $this->render( | 58 | return $this->render( |
50 | 'WallabagBundle:Entry:entries.html.twig', | 59 | 'WallabagBundle:Entry:entries.html.twig', |
51 | array('entries' => $entries) | 60 | array('entries' => $entries) |
52 | ); | 61 | ); |
53 | |||
54 | } | 62 | } |
55 | 63 | ||
56 | /** | 64 | /** |
65 | * Shows entry content | ||
66 | * | ||
67 | * @param Entries $entry | ||
57 | * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view") | 68 | * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view") |
69 | * @return \Symfony\Component\HttpFoundation\Response | ||
58 | */ | 70 | */ |
59 | public function viewAction($id) | 71 | public function viewAction(Entries $entry) |
60 | { | 72 | { |
61 | $repository = $this->getDoctrine()->getRepository('WallabagBundle:Entries'); | ||
62 | $entry = $repository->find($id); | ||
63 | |||
64 | return $this->render( | 73 | return $this->render( |
65 | 'WallabagBundle:Entry:entry.html.twig', | 74 | 'WallabagBundle:Entry:entry.html.twig', |
66 | array('entry' => $entry) | 75 | array('entry' => $entry) |
67 | ); | 76 | ); |
77 | } | ||
78 | |||
79 | /** | ||
80 | * Changes read status for an entry | ||
81 | * | ||
82 | * @param Request $request | ||
83 | * @param Entries $entry | ||
84 | * @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry") | ||
85 | * @return \Symfony\Component\HttpFoundation\RedirectResponse | ||
86 | */ | ||
87 | public function toggleArchiveAction(Request $request, Entries $entry) | ||
88 | { | ||
89 | $entry->toggleArchive(); | ||
90 | $this->getDoctrine()->getManager()->flush(); | ||
91 | |||
92 | $this->get('session')->getFlashBag()->add( | ||
93 | 'notice', | ||
94 | 'Entry archived' | ||
95 | ); | ||
96 | |||
97 | return $this->redirect($request->headers->get('referer')); | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * Changes favorite status for an entry | ||
102 | * | ||
103 | * @param Request $request | ||
104 | * @param Entries $entry | ||
105 | * @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry") | ||
106 | * @return \Symfony\Component\HttpFoundation\RedirectResponse | ||
107 | */ | ||
108 | public function toggleStarAction(Request $request, Entries $entry) | ||
109 | { | ||
110 | $entry->toggleStar(); | ||
111 | $this->getDoctrine()->getManager()->flush(); | ||
112 | |||
113 | $this->get('session')->getFlashBag()->add( | ||
114 | 'notice', | ||
115 | 'Entry starred' | ||
116 | ); | ||
117 | |||
118 | return $this->redirect($request->headers->get('referer')); | ||
119 | } | ||
120 | |||
121 | /** | ||
122 | * Deletes entry | ||
123 | * | ||
124 | * @param Request $request | ||
125 | * @param Entries $entry | ||
126 | * @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry") | ||
127 | * @return \Symfony\Component\HttpFoundation\RedirectResponse | ||
128 | */ | ||
129 | public function deleteEntryAction(Request $request, Entries $entry) | ||
130 | { | ||
131 | $em = $this->getDoctrine()->getEntityManager(); | ||
132 | $em->remove($entry); | ||
133 | $em->flush(); | ||
134 | |||
135 | $this->get('session')->getFlashBag()->add( | ||
136 | 'notice', | ||
137 | 'Entry deleted' | ||
138 | ); | ||
68 | 139 | ||
140 | return $this->redirect($request->headers->get('referer')); | ||
69 | } | 141 | } |
70 | } | 142 | } |
diff --git a/src/WallabagBundle/Controller/StaticController.php b/src/WallabagBundle/Controller/StaticController.php new file mode 100644 index 00000000..aee2bb7e --- /dev/null +++ b/src/WallabagBundle/Controller/StaticController.php | |||
@@ -0,0 +1,20 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace WallabagBundle\Controller; | ||
4 | |||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
7 | |||
8 | class StaticController extends Controller | ||
9 | { | ||
10 | /** | ||
11 | * @Route("/about", name="about") | ||
12 | */ | ||
13 | public function aboutAction() | ||
14 | { | ||
15 | return $this->render( | ||
16 | 'WallabagBundle:Static:about.html.twig', | ||
17 | array() | ||
18 | ); | ||
19 | } | ||
20 | } | ||
diff --git a/src/WallabagBundle/Entity/Entries.php b/src/WallabagBundle/Entity/Entries.php index 69c6be0d..b364e0c3 100644 --- a/src/WallabagBundle/Entity/Entries.php +++ b/src/WallabagBundle/Entity/Entries.php | |||
@@ -144,6 +144,12 @@ class Entries | |||
144 | return $this->isRead; | 144 | return $this->isRead; |
145 | } | 145 | } |
146 | 146 | ||
147 | public function toggleArchive() | ||
148 | { | ||
149 | $this->isRead = $this->getIsRead() ^ 1; | ||
150 | return $this; | ||
151 | } | ||
152 | |||
147 | /** | 153 | /** |
148 | * Set isFav | 154 | * Set isFav |
149 | * | 155 | * |
@@ -167,6 +173,13 @@ class Entries | |||
167 | return $this->isFav; | 173 | return $this->isFav; |
168 | } | 174 | } |
169 | 175 | ||
176 | public function toggleStar() | ||
177 | { | ||
178 | $this->isFav = $this->getIsFav() ^ 1; | ||
179 | |||
180 | return $this; | ||
181 | } | ||
182 | |||
170 | /** | 183 | /** |
171 | * Set content | 184 | * Set content |
172 | * | 185 | * |
diff --git a/src/WallabagBundle/Repository/EntriesRepository.php b/src/WallabagBundle/Repository/EntriesRepository.php index c355a012..c4428a1d 100644 --- a/src/WallabagBundle/Repository/EntriesRepository.php +++ b/src/WallabagBundle/Repository/EntriesRepository.php | |||
@@ -4,31 +4,31 @@ namespace WallabagBundle\Repository; | |||
4 | 4 | ||
5 | use Doctrine\ORM\Query; | 5 | use Doctrine\ORM\Query; |
6 | use Doctrine\ORM\EntityRepository; | 6 | use Doctrine\ORM\EntityRepository; |
7 | use Doctrine\ORM\Tools\Pagination\Paginator; | ||
7 | 8 | ||
8 | /** | ||
9 | * EntriesRepository | ||
10 | * | ||
11 | * This class was generated by the Doctrine ORM. Add your own custom | ||
12 | * repository methods below. | ||
13 | */ | ||
14 | class EntriesRepository extends EntityRepository | 9 | class EntriesRepository extends EntityRepository |
15 | { | 10 | { |
16 | public function findUnreadByUser($userId) | 11 | public function findUnreadByUser($userId, $firstResult, $maxResults = 12) |
17 | { | 12 | { |
18 | $qb = $this->createQueryBuilder('e') | 13 | $qb = $this->createQueryBuilder('e') |
19 | ->select('e') | 14 | ->select('e') |
15 | ->setFirstResult($firstResult) | ||
16 | ->setMaxResults($maxResults) | ||
20 | ->where('e.isRead = 0') | 17 | ->where('e.isRead = 0') |
21 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) | 18 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) |
22 | ->getQuery() | 19 | ->getQuery(); |
23 | ->getResult(Query::HYDRATE_ARRAY); | ||
24 | 20 | ||
25 | return $qb; | 21 | $pag = new Paginator($qb); |
22 | |||
23 | return $pag; | ||
26 | } | 24 | } |
27 | 25 | ||
28 | public function findArchiveByUser($userId) | 26 | public function findArchiveByUser($userId, $firstResult, $maxResults = 12) |
29 | { | 27 | { |
30 | $qb = $this->createQueryBuilder('e') | 28 | $qb = $this->createQueryBuilder('e') |
31 | ->select('e') | 29 | ->select('e') |
30 | ->setFirstResult($firstResult) | ||
31 | ->setMaxResults($maxResults) | ||
32 | ->where('e.isRead = 1') | 32 | ->where('e.isRead = 1') |
33 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) | 33 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) |
34 | ->getQuery() | 34 | ->getQuery() |
@@ -37,10 +37,12 @@ class EntriesRepository extends EntityRepository | |||
37 | return $qb; | 37 | return $qb; |
38 | } | 38 | } |
39 | 39 | ||
40 | public function findStarredByUser($userId) | 40 | public function findStarredByUser($userId, $firstResult, $maxResults = 12) |
41 | { | 41 | { |
42 | $qb = $this->createQueryBuilder('e') | 42 | $qb = $this->createQueryBuilder('e') |
43 | ->select('e') | 43 | ->select('e') |
44 | ->setFirstResult($firstResult) | ||
45 | ->setMaxResults($maxResults) | ||
44 | ->where('e.isFav = 1') | 46 | ->where('e.isFav = 1') |
45 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) | 47 | ->andWhere('e.userId =:userId')->setParameter('userId', $userId) |
46 | ->getQuery() | 48 | ->getQuery() |
diff --git a/src/WallabagBundle/Resources/views/Entry/entries.html.twig b/src/WallabagBundle/Resources/views/Entry/entries.html.twig index 81177298..de343aa2 100644 --- a/src/WallabagBundle/Resources/views/Entry/entries.html.twig +++ b/src/WallabagBundle/Resources/views/Entry/entries.html.twig | |||
@@ -7,6 +7,20 @@ | |||
7 | {% endblock %} | 7 | {% endblock %} |
8 | 8 | ||
9 | {% block content %} | 9 | {% block content %} |
10 | {% block pager %} | ||
11 | {% if entries is not empty %} | ||
12 | <div class="results"> | ||
13 | <div class="nb-results">{{ entries.count }} {% trans %}entries{% endtrans %}</div> | ||
14 | <div class="pagination"> | ||
15 | {% for p in range(1, entries.count) %} | ||
16 | <li> | ||
17 | <a href="{{ path(app.request.attributes.get('_route'), {'page': p}) }}">{{ p }}</a> | ||
18 | </li> | ||
19 | {% endfor %} | ||
20 | </div> | ||
21 | </div> | ||
22 | {% endif %} | ||
23 | {% endblock %} | ||
10 | 24 | ||
11 | {% if entries is empty %} | 25 | {% if entries is empty %} |
12 | <div class="messages warning"><p>{% trans %}No articles found.{% endtrans %}</p></div> | 26 | <div class="messages warning"><p>{% trans %}No articles found.{% endtrans %}</p></div> |
@@ -21,9 +35,9 @@ | |||
21 | {% endif %} | 35 | {% endif %} |
22 | 36 | ||
23 | <ul class="tools links"> | 37 | <ul class="tools links"> |
24 | <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&id={{ entry.id|e }}"><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.isRead == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li> |
25 | <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isFav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span>{% trans %}toggle favorite{% 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> |
26 | <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="./?action=delete&id={{ entry.id|e }}"><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> |
27 | <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> |
28 | </ul> | 42 | </ul> |
29 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> | 43 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> |
diff --git a/src/WallabagBundle/Resources/views/Entry/entry.html.twig b/src/WallabagBundle/Resources/views/Entry/entry.html.twig index 19d4650e..8c08b2ef 100644 --- a/src/WallabagBundle/Resources/views/Entry/entry.html.twig +++ b/src/WallabagBundle/Resources/views/Entry/entry.html.twig | |||
@@ -11,9 +11,9 @@ | |||
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="javascript: void(null);" id="markAsRead"><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.isRead == 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="javascript: void(null);" id="setFav"><span>{% trans %}Toggle favorite{% 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> |
16 | <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="./?action=delete&id={{ entry.id|e }}"><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 }}&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 }}&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 %} |
19 | {% if share_shaarli %}<li><a href="{{ shaarli_url }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %} | 19 | {% if share_shaarli %}<li><a href="{{ shaarli_url }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %} |
@@ -43,9 +43,9 @@ | |||
43 | $(document).ready(function() { | 43 | $(document).ready(function() { |
44 | 44 | ||
45 | // toggle read property of current article | 45 | // toggle read property of current article |
46 | $('#markAsRead').click(function(){ | 46 | /* $('#markAsRead').click(function(){ |
47 | $("body").css("cursor", "wait"); | 47 | $("body").css("cursor", "wait"); |
48 | $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done( | 48 | $.ajax( { url: '{{ path('archive_entry', { 'id': entry.id }) }}' }).done( |
49 | function( data ) { | 49 | function( data ) { |
50 | if ( data == '1' ) { | 50 | if ( data == '1' ) { |
51 | if ( $('#markAsRead').hasClass("archive-off") ) { | 51 | if ( $('#markAsRead').hasClass("archive-off") ) { |
@@ -62,12 +62,12 @@ | |||
62 | } | 62 | } |
63 | }); | 63 | }); |
64 | $("body").css("cursor", "auto"); | 64 | $("body").css("cursor", "auto"); |
65 | }); | 65 | });*/ |
66 | 66 | ||
67 | // toggle favorite property of current article | 67 | // toggle favorite property of current article |
68 | $('#setFav').click(function(){ | 68 | /* $('#setFav').click(function(){ |
69 | $("body").css("cursor", "wait"); | 69 | $("body").css("cursor", "wait"); |
70 | $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done( | 70 | $.ajax( { url: '{{ path('star_entry', { 'id': entry.id }) }}' }).done( |
71 | function( data ) { | 71 | function( data ) { |
72 | if ( data == '1' ) { | 72 | if ( data == '1' ) { |
73 | if ( $('#setFav').hasClass("fav-off") ) { | 73 | if ( $('#setFav').hasClass("fav-off") ) { |
@@ -84,7 +84,7 @@ | |||
84 | } | 84 | } |
85 | }); | 85 | }); |
86 | $("body").css("cursor", "auto"); | 86 | $("body").css("cursor", "auto"); |
87 | }); | 87 | });*/ |
88 | 88 | ||
89 | $(window).scroll(function(e){ | 89 | $(window).scroll(function(e){ |
90 | var scrollTop = $(window).scrollTop(); | 90 | var scrollTop = $(window).scrollTop(); |
diff --git a/src/WallabagBundle/Resources/views/Static/about.html.twig b/src/WallabagBundle/Resources/views/Static/about.html.twig new file mode 100755 index 00000000..1a3c927e --- /dev/null +++ b/src/WallabagBundle/Resources/views/Static/about.html.twig | |||
@@ -0,0 +1,84 @@ | |||
1 | {% extends "WallabagBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{% trans %}About{% endtrans %}{% endblock %} | ||
4 | {% block menu %} | ||
5 | {% include "WallabagBundle::_menu.html.twig" %} | ||
6 | {% endblock %} | ||
7 | {% block content %} | ||
8 | <h2>{% trans %}About wallabag{% endtrans %}</h2> | ||
9 | |||
10 | <dl> | ||
11 | <dt>{% trans %}Project website{% endtrans %}</dt> | ||
12 | <dd><a href="https://www.wallabag.org">https://www.wallabag.org</a></dd> | ||
13 | |||
14 | <dt>{% trans %}Main developer{% endtrans %}</dt> | ||
15 | <dd><a href="mailto:nicolas@loeuillet.org">Nicolas Lœuillet</a> — <a href="http://cdetc.fr">{% trans %}website{% endtrans %}</a></dd> | ||
16 | |||
17 | <dt>{% trans %}Contributors:{% endtrans %}</dt> | ||
18 | <dd><a href="https://github.com/wallabag/wallabag/graphs/contributors">{% trans %}on Github{% endtrans %}</a></dd> | ||
19 | |||
20 | <dt>{% trans %}Bug reports{% endtrans %}</dt> | ||
21 | <dd><a href="https://support.wallabag.org">{% trans %}On our support website{% endtrans %}</a> {% trans %}or{% endtrans %} <a href="https://github.com/wallabag/wallabag/issues">{% trans %}on Github{% endtrans %}</a></dd> | ||
22 | |||
23 | <dt>{% trans %}License{% endtrans %}</dt> | ||
24 | <dd><a href="http://en.wikipedia.org/wiki/MIT_License">MIT</a></dd> | ||
25 | |||
26 | <dt>{% trans %}Version{% endtrans %}</dt> | ||
27 | <dd></dd> | ||
28 | </dl> | ||
29 | |||
30 | <p>{% trans %}wallabag is a read-it-later application: you can save a web page by keeping only content. Elements like ads or menus are deleted.{% endtrans %}</p> | ||
31 | |||
32 | <h2>{% trans %}Getting help{% endtrans %}</h2> | ||
33 | |||
34 | <dl> | ||
35 | <dt>{% trans %}Documentation{% endtrans %}</dt> | ||
36 | <dd><a href="docs/">Offline documentation</a> and <a href="https://doc.wallabag.org/">online documentation</a> (up to date)</dd> | ||
37 | |||
38 | <dt>{% trans %}Support{% endtrans %}</dt> | ||
39 | <dd><a href="http://support.wallabag.org/">http://support.wallabag.org/</a></dd> | ||
40 | </dl> | ||
41 | |||
42 | <h2>{% trans %}Helping wallabag{% endtrans %}</h2> | ||
43 | |||
44 | <p>{% trans %}wallabag is free and opensource. You can help us:{% endtrans %}</p> | ||
45 | |||
46 | <dl> | ||
47 | <dt><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb">{% trans %}via Paypal{% endtrans %}</a></dt> | ||
48 | |||
49 | <dt><a href="https://flattr.com/thing/1265480">{% trans %}via Flattr{% endtrans %}</a></dt> | ||
50 | </dl> | ||
51 | |||
52 | <h2>{% trans %}Credits{% endtrans %}</h2> | ||
53 | <dl> | ||
54 | <dt>PHP Readability</dt> | ||
55 | <dd><a href="https://bitbucket.org/fivefilters/php-readability">https://bitbucket.org/fivefilters/php-readability</a></dd> | ||
56 | |||
57 | <dt>Full Text RSS</dt> | ||
58 | <dd><a href="http://code.fivefilters.org/full-text-rss/src">http://code.fivefilters.org/full-text-rss/src</a></dd> | ||
59 | |||
60 | <dt>logo by Maylis Agniel</dt> | ||
61 | <dd><a href="https://github.com/wallabag/logo">https://github.com/wallabag/logo</a></dd> | ||
62 | |||
63 | <dt>icons</dt> | ||
64 | <dd><a href="http://icomoon.io">http://icomoon.io</a></dd> | ||
65 | |||
66 | <dt>PHP Simple HTML DOM Parser</dt> | ||
67 | <dd><a href="http://simplehtmldom.sourceforge.net/">http://simplehtmldom.sourceforge.net/</a></dd> | ||
68 | |||
69 | <dt>Session</dt> | ||
70 | <dd><a href="https://github.com/tontof/kriss_feed/blob/master/src/class/Session.php">https://github.com/tontof/kriss_feed/blob/master/src/class/Session.php</a></dd> | ||
71 | |||
72 | <dt>Twig</dt> | ||
73 | <dd><a href="http://twig.sensiolabs.org">http://twig.sensiolabs.org</a></dd> | ||
74 | |||
75 | <dt>Flash messages</dt> | ||
76 | <dd><a href="https://github.com/plasticbrain/PHP-Flash-Messages">https://github.com/plasticbrain/PHP-Flash-Messages</a></dd> | ||
77 | |||
78 | <dt>Pagination</dt> | ||
79 | <dd><a href="https://github.com/daveismyname/pagination">https://github.com/daveismyname/pagination</a></dd> | ||
80 | |||
81 | <dt>PHPePub</dt> | ||
82 | <dd><a href="https://github.com/Grandt/PHPePub/">https://github.com/Grandt/PHPePub/</a></dd> | ||
83 | </dl> | ||
84 | {% endblock %} | ||
diff --git a/src/WallabagBundle/Resources/views/_menu.html.twig b/src/WallabagBundle/Resources/views/_menu.html.twig index b001aec5..4c6a0a1b 100644 --- a/src/WallabagBundle/Resources/views/_menu.html.twig +++ b/src/WallabagBundle/Resources/views/_menu.html.twig | |||
@@ -5,13 +5,13 @@ | |||
5 | <li><a href="{{ path('archive') }}"}>{% trans %}archive{% endtrans %}</a></li> | 5 | <li><a href="{{ path('archive') }}"}>{% trans %}archive{% endtrans %}</a></li> |
6 | <li><a href="./?view=tags">{% trans %}tags{% endtrans %}</a></li> | 6 | <li><a href="./?view=tags">{% trans %}tags{% endtrans %}</a></li> |
7 | <li style="position: relative;"><a href="javascript: void(null);" id="bagit">{% trans %}save a link{% endtrans %}</a> | 7 | <li style="position: relative;"><a href="javascript: void(null);" id="bagit">{% trans %}save a link{% endtrans %}</a> |
8 | 8 | {% include "WallabagBundle::_save_form.html.twig" %} | |
9 | </li> | 9 | </li> |
10 | <li style="position: relative;"><a href="javascript: void(null);" id="search">{% trans %}search{% endtrans %}</a> | 10 | <li style="position: relative;"><a href="javascript: void(null);" id="search">{% trans %}search{% endtrans %}</a> |
11 | 11 | {% include "WallabagBundle::_search_form.html.twig" %} | |
12 | </li> | 12 | </li> |
13 | <li><a href="./?view=config">{% trans %}config{% endtrans %}</a></li> | 13 | <li><a href="./?view=config">{% trans %}config{% endtrans %}</a></li> |
14 | <li><a href="./?view=about">{% trans %}about{% endtrans %}</a></li> | 14 | <li><a href={{ path('about') }}>{% trans %}about{% endtrans %}</a></li> |
15 | <li><a class="icon icon-power" href="./?logout" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li> | 15 | <li><a class="icon icon-power" href="./?logout" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li> |
16 | </ul> | 16 | </ul> |
17 | 17 | ||
diff --git a/src/WallabagBundle/Resources/views/_save_form.html.twig b/src/WallabagBundle/Resources/views/_save_form.html.twig new file mode 100755 index 00000000..acaa5dbc --- /dev/null +++ b/src/WallabagBundle/Resources/views/_save_form.html.twig | |||
@@ -0,0 +1,10 @@ | |||
1 | <div id="bagit-form" class="messages info popup-form"> | ||
2 | <form method="get" action="index.php" target="_blank" id="bagit-form-form"> | ||
3 | <h2>{% trans %}Save a link{% endtrans %}</h2> | ||
4 | <a href="javascript: void(null);" id="bagit-form-close" class="close-button--popup close-button">×</a> | ||
5 | <input type="hidden" name="autoclose" value="1" /> | ||
6 | <input required placeholder="example.com/article" class="addurl" id="plainurl" name="plainurl" type="url" /> | ||
7 | <span id="add-link-result"></span> | ||
8 | <input type="submit" value="{% trans %}save link!"{% endtrans %} /> | ||
9 | </form> | ||
10 | </div> | ||
diff --git a/src/WallabagBundle/Resources/views/_search_form.html.twig b/src/WallabagBundle/Resources/views/_search_form.html.twig new file mode 100644 index 00000000..7eb1b67d --- /dev/null +++ b/src/WallabagBundle/Resources/views/_search_form.html.twig | |||
@@ -0,0 +1,9 @@ | |||
1 | <div id="search-form" class="messages info popup-form"> | ||
2 | <form method="get" action="index.php"> | ||
3 | <h2>{% trans %}Search{% endtrans %}</h2> | ||
4 | <a href="javascript: void(null);" id="search-form-close" class="close-button--popup close-button">×</a> | ||
5 | <input type="hidden" name="view" value="search"></input> | ||
6 | <input required placeholder="{% trans %}Enter your search here{% endtrans %}" type="text" name="search" id="searchfield"><br> | ||
7 | <input id="submit-search" type="submit" value="{% trans %}Search{% endtrans %}"></input> | ||
8 | </form> | ||
9 | </div> | ||
diff --git a/src/WallabagBundle/Resources/views/layout.html.twig b/src/WallabagBundle/Resources/views/layout.html.twig index 4a3f0f5c..34d9b1b0 100644 --- a/src/WallabagBundle/Resources/views/layout.html.twig +++ b/src/WallabagBundle/Resources/views/layout.html.twig | |||
@@ -19,9 +19,11 @@ | |||
19 | <div id="main"> | 19 | <div id="main"> |
20 | {% block menu %}{% endblock %} | 20 | {% block menu %}{% endblock %} |
21 | {% block precontent %}{% endblock %} | 21 | {% block precontent %}{% endblock %} |
22 | {% block messages %} | 22 | {% for flashMessage in app.session.flashbag.get('notice') %} |
23 | {% include "WallabagBundle::_messages.html.twig" %} | 23 | <div class="flash-notice"> |
24 | {% endblock %} | 24 | {{ flashMessage }} |
25 | </div> | ||
26 | {% endfor %} | ||
25 | <div id="content" class="w600p center"> | 27 | <div id="content" class="w600p center"> |
26 | {% block content %}{% endblock %} | 28 | {% block content %}{% endblock %} |
27 | </div> | 29 | </div> |