diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2015-01-29 16:56:58 +0100 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2015-01-29 16:56:58 +0100 |
commit | f8bf8952541b51481a7463c6efc0b2bc9c1edff1 (patch) | |
tree | cb632798f4c6f763ba7c827dcaa885eec4255094 /src | |
parent | 589dce52c63219d917498d2fdf18e5d7ebe5bf92 (diff) | |
download | wallabag-f8bf8952541b51481a7463c6efc0b2bc9c1edff1.tar.gz wallabag-f8bf8952541b51481a7463c6efc0b2bc9c1edff1.tar.zst wallabag-f8bf8952541b51481a7463c6efc0b2bc9c1edff1.zip |
routing for API, trying to respect #414
Diffstat (limited to 'src')
14 files changed, 161 insertions, 463 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryController.php b/src/Wallabag/ApiBundle/Controller/EntryController.php deleted file mode 100644 index 9bf84501..00000000 --- a/src/Wallabag/ApiBundle/Controller/EntryController.php +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ApiBundle\Controller; | ||
4 | |||
5 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
7 | use Wallabag\CoreBundle\Entity\Entries; | ||
8 | use FOS\RestBundle\Controller\Annotations\Get; | ||
9 | use FOS\RestBundle\Controller\Annotations\Delete; | ||
10 | use FOS\RestBundle\Controller\Annotations\Patch; | ||
11 | use Wallabag\CoreBundle\Entity\Users; | ||
12 | |||
13 | class EntryController extends Controller | ||
14 | { | ||
15 | /** | ||
16 | * Fetches an entry for a given user | ||
17 | * | ||
18 | * @Get("/u/{user}/entry/{entry}") | ||
19 | * @ApiDoc( | ||
20 | * requirements={ | ||
21 | * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"}, | ||
22 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
23 | * } | ||
24 | * ) | ||
25 | * @return Entries | ||
26 | */ | ||
27 | public function getAction(Users $user, Entries $entry) | ||
28 | { | ||
29 | return $entry; | ||
30 | } | ||
31 | |||
32 | /** | ||
33 | * Deletes an entry for a given user | ||
34 | * | ||
35 | * @Delete("/u/{user}/entry/{entry}") | ||
36 | * @ApiDoc( | ||
37 | * requirements={ | ||
38 | * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"}, | ||
39 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
40 | * } | ||
41 | * ) | ||
42 | */ | ||
43 | public function deleteAction(Users $user, Entries $entry) | ||
44 | { | ||
45 | |||
46 | } | ||
47 | |||
48 | /** | ||
49 | * Changes several properties of an entry. I.E tags, archived, starred and deleted status | ||
50 | * | ||
51 | * @Patch("/u/{user}/entry/{entry}") | ||
52 | * @ApiDoc( | ||
53 | * requirements={ | ||
54 | * {"name"="user", "dataType"="string", "requirement"="\w+", "description"="The user ID"}, | ||
55 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
56 | * } | ||
57 | * ) | ||
58 | */ | ||
59 | public function patchAction(Users $user, Entries $entry) | ||
60 | { | ||
61 | |||
62 | } | ||
63 | } | ||
diff --git a/src/Wallabag/ApiBundle/WallabagApiBundle.php b/src/Wallabag/ApiBundle/WallabagApiBundle.php deleted file mode 100644 index 19d887ab..00000000 --- a/src/Wallabag/ApiBundle/WallabagApiBundle.php +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ApiBundle; | ||
4 | |||
5 | use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
6 | |||
7 | class WallabagApiBundle extends Bundle | ||
8 | { | ||
9 | } | ||
diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php index 07931f58..0fd19d65 100644 --- a/src/Wallabag/CoreBundle/Controller/StaticController.php +++ b/src/Wallabag/CoreBundle/Controller/StaticController.php | |||
@@ -17,12 +17,4 @@ class StaticController extends Controller | |||
17 | array() | 17 | array() |
18 | ); | 18 | ); |
19 | } | 19 | } |
20 | |||
21 | /** | ||
22 | * @Route("/", name="homepage") | ||
23 | */ | ||
24 | public function apiAction() | ||
25 | { | ||
26 | return $this->redirect($this->generateUrl('nelmio_api_doc_index')); | ||
27 | } | ||
28 | } | 20 | } |
diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php new file mode 100644 index 00000000..a2a9af38 --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php | |||
@@ -0,0 +1,157 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Controller; | ||
4 | |||
5 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; | ||
6 | use FOS\RestBundle\Controller\Annotations\View; | ||
7 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
8 | use Symfony\Component\Security\Core\Exception\AccessDeniedException; | ||
9 | use Wallabag\CoreBundle\Entity\Entries; | ||
10 | use Wallabag\CoreBundle\Entity\Tags; | ||
11 | use Wallabag\CoreBundle\Entity\Users; | ||
12 | |||
13 | class WallabagRestController | ||
14 | { | ||
15 | |||
16 | /** | ||
17 | * Fetches all entries | ||
18 | * | ||
19 | * @ApiDoc( | ||
20 | * ) | ||
21 | * @return Entries | ||
22 | */ | ||
23 | public function getEntriesAction() | ||
24 | { | ||
25 | |||
26 | } | ||
27 | |||
28 | /** | ||
29 | * Fetches an entry | ||
30 | * | ||
31 | * @ApiDoc( | ||
32 | * requirements={ | ||
33 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
34 | * } | ||
35 | * ) | ||
36 | * @return Entries | ||
37 | */ | ||
38 | public function getEntryAction(Entries $entry) | ||
39 | { | ||
40 | return $entry; | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * Deletes an entry | ||
45 | * | ||
46 | * @ApiDoc( | ||
47 | * requirements={ | ||
48 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
49 | * } | ||
50 | * ) | ||
51 | */ | ||
52 | public function deleteEntriesAction(Entries $entry) | ||
53 | { | ||
54 | |||
55 | } | ||
56 | |||
57 | /** | ||
58 | * Changes several properties of an entry. I.E tags, archived, starred and deleted status | ||
59 | * | ||
60 | * @ApiDoc( | ||
61 | * requirements={ | ||
62 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
63 | * } | ||
64 | * ) | ||
65 | */ | ||
66 | public function patchEntriesAction(Entries $entry) | ||
67 | { | ||
68 | |||
69 | } | ||
70 | |||
71 | /** | ||
72 | * Saves a new entry | ||
73 | * | ||
74 | * @ApiDoc( | ||
75 | * ) | ||
76 | */ | ||
77 | public function postEntriesAction() | ||
78 | { | ||
79 | |||
80 | } | ||
81 | |||
82 | /** | ||
83 | * Gets tags for an entry | ||
84 | * | ||
85 | * @ApiDoc( | ||
86 | * requirements={ | ||
87 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
88 | * } | ||
89 | * ) | ||
90 | */ | ||
91 | public function getEntriesTagsAction(Entries $entry) { | ||
92 | |||
93 | } | ||
94 | |||
95 | /** | ||
96 | * Saves new tag for an entry | ||
97 | * | ||
98 | * @ApiDoc( | ||
99 | * requirements={ | ||
100 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
101 | * } | ||
102 | * ) | ||
103 | */ | ||
104 | public function postEntriesTagsAction(Entries $entry) { | ||
105 | |||
106 | } | ||
107 | |||
108 | /** | ||
109 | * Remove tag for an entry | ||
110 | * | ||
111 | * @ApiDoc( | ||
112 | * requirements={ | ||
113 | * {"name"="tag", "dataType"="string", "requirement"="\w+", "description"="The tag"}, | ||
114 | * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} | ||
115 | * } | ||
116 | * ) | ||
117 | */ | ||
118 | public function deleteEntriesTagsAction(Entries $entry, Tags $tag) | ||
119 | { | ||
120 | |||
121 | } | ||
122 | |||
123 | /** | ||
124 | * Gets tags for a user | ||
125 | * | ||
126 | * @ApiDoc( | ||
127 | * ) | ||
128 | */ | ||
129 | public function getTagsAction() { | ||
130 | |||
131 | } | ||
132 | |||
133 | /** | ||
134 | * Gets one tag | ||
135 | * | ||
136 | * @ApiDoc( | ||
137 | * {"name"="tag", "dataType"="string", "requirement"="\w+", "description"="The tag"} | ||
138 | * ) | ||
139 | */ | ||
140 | public function getTagAction(Tags $tag) { | ||
141 | |||
142 | } | ||
143 | |||
144 | /** | ||
145 | * Delete tag | ||
146 | * | ||
147 | * @ApiDoc( | ||
148 | * requirements={ | ||
149 | * {"name"="tag", "dataType"="string", "requirement"="\w+", "description"="The tag"} | ||
150 | * } | ||
151 | * ) | ||
152 | */ | ||
153 | public function deleteTagAction(Tags $tag) | ||
154 | { | ||
155 | |||
156 | } | ||
157 | } \ No newline at end of file | ||
diff --git a/src/Wallabag/CoreBundle/Resources/config/routing_rest.yml b/src/Wallabag/CoreBundle/Resources/config/routing_rest.yml new file mode 100644 index 00000000..c876adfb --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/config/routing_rest.yml | |||
@@ -0,0 +1,4 @@ | |||
1 | entries: | ||
2 | type: rest | ||
3 | resource: "WallabagCoreBundle:WallabagRest" | ||
4 | name_prefix: api_ \ No newline at end of file | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/_head.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/_head.twig deleted file mode 100755 index a88d4186..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/baggy/_head.twig +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | <link rel="apple-touch-icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-152.png" sizes="152x152"> | ||
2 | <link rel="icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-152.png" sizes="152x152"> | ||
3 | |||
4 | <link rel="apple-touch-icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-144.png" sizes="144x144"> | ||
5 | <link rel="icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-144.png" sizes="144x144"> | ||
6 | |||
7 | <link rel="apple-touch-icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-120.png" sizes="120x120"> | ||
8 | <link rel="icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-120.png" sizes="120x120"> | ||
9 | |||
10 | <link rel="apple-touch-icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-114.png" sizes="114x114"> | ||
11 | <link rel="icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-114.png" sizes="114x114"> | ||
12 | |||
13 | <link rel="apple-touch-icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-76.png" sizes="76x76"> | ||
14 | <link rel="icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-76.png" sizes="76x76"> | ||
15 | |||
16 | <link rel="apple-touch-icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-72.png" sizes="72x72"> | ||
17 | <link rel="icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-72.png" sizes="72x72"> | ||
18 | |||
19 | <link rel="apple-touch-icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-57.png" sizes="57x57"> | ||
20 | <link rel="icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon-57.png" sizes="57x57"> | ||
21 | |||
22 | <link rel="apple-touch-icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon.png"> | ||
23 | <link rel="icon" type="image/png" href="{{ poche_url }}themes/_global/img/appicon/apple-touch-icon.png"> | ||
24 | |||
25 | <link rel="shortcut icon" type="image/x-icon" href="{{ poche_url }}themes/_global/img/appicon/favicon.ico" sizes="16x16"> | ||
26 | |||
27 | <link rel="stylesheet" href="{{ poche_url }}themes/{{theme}}/css/ratatouille.css" media="all"> | ||
28 | <link rel="stylesheet" href="{{ poche_url }}themes/{{theme}}/css/font.css" media="all"> | ||
29 | <link rel="stylesheet" href="{{ poche_url }}themes/{{theme}}/css/main.css" media="all"> | ||
30 | <link rel="stylesheet" href="{{ poche_url }}themes/{{theme}}/css/messages.css" media="all"> | ||
31 | <link rel="stylesheet" href="{{ poche_url }}themes/{{theme}}/css/print.css" media="print"> | ||
32 | |||
33 | <script src="{{ poche_url }}themes/_global/js/jquery-2.0.3.min.js"></script> | ||
34 | <script src="{{ poche_url }}themes/_global/js/autoClose.js"></script> | ||
35 | <script src="{{ poche_url }}themes/{{theme}}/js/jquery.cookie.js"></script> | ||
36 | <script src="{{ poche_url }}themes/{{theme}}/js/init.js"></script> | ||
37 | <script src="{{ poche_url }}themes/_global/js/saveLink.js"></script> | ||
38 | <script src="{{ poche_url }}themes/_global/js/popupForm.js"></script> | ||
39 | <script src="{{ poche_url }}themes/{{theme}}/js/closeMessage.js"></script> | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/_menu.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/_menu.twig deleted file mode 100644 index 8b80f65d..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/baggy/_menu.twig +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | <button id="menu" class="icon icon-menu desktopHide"><span>Menu</span></button> | ||
2 | <ul id="links" class="links"> | ||
3 | <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "unread" %}</a></li> | ||
4 | <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li> | ||
5 | <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li> | ||
6 | <li><a href="./?view=tags" {% if view == 'tags' %}class="current"{% endif %}>{% trans "tags" %}</a></li> | ||
7 | <li style="position: relative;"><a href="javascript: void(null);" id="bagit">{% trans "save a link" %}</a> | ||
8 | {% include '_pocheit-form.twig' %} | ||
9 | </li> | ||
10 | <li style="position: relative;"><a href="javascript: void(null);" id="search">{% trans "search" %}</a> | ||
11 | {% include '_search-form.twig' %} | ||
12 | </li> | ||
13 | <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> | ||
14 | <li><a href="./?view=about" {% if view == 'about' %}class="current"{% endif %}>{% trans "about" %}</a></li> | ||
15 | <li><a class="icon icon-power" href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> | ||
16 | </ul> | ||
17 | |||
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/_pocheit-form.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/_pocheit-form.twig deleted file mode 100755 index bf2ae903..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/baggy/_pocheit-form.twig +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
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" %}</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!" %}" /> | ||
9 | </form> | ||
10 | </div> | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/_search-form.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/_search-form.twig deleted file mode 100644 index 73f7951f..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/baggy/_search-form.twig +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | <div id="search-form" class="messages info popup-form"> | ||
2 | <form method="get" action="index.php"> | ||
3 | <h2>{%trans "Search" %}</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" %}" type="text" name="search" id="searchfield"><br> | ||
7 | <input id="submit-search" type="submit" value="{% trans "Search" %}"></input> | ||
8 | </form> | ||
9 | </div> | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/_top.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/_top.twig deleted file mode 100755 index a31c0925..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/baggy/_top.twig +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | <header class="w600p center mbm"> | ||
2 | <h1 class="logo"> | ||
3 | {% if view == 'home' %}{% block logo %}<img width="100" height="100" src="{{ poche_url }}themes/{{theme}}/img/logo-w.png" alt="wallabag logo" />{% endblock %} | ||
4 | {% else %}<a href="./" title="{% trans "return home" %}" >{{ block('logo') }}</a> | ||
5 | {% endif %} | ||
6 | </h1> | ||
7 | </header> | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/about.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/about.twig deleted file mode 100755 index d18fe156..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/baggy/about.twig +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | {% extends "layout.twig" %} | ||
2 | |||
3 | {% block title %}{% trans "About" %}{% endblock %} | ||
4 | {% block menu %} | ||
5 | {% include '_menu.twig' %} | ||
6 | {% endblock %} | ||
7 | {% block content %} | ||
8 | <h2>{% trans "About wallabag" %}</h2> | ||
9 | |||
10 | <dl> | ||
11 | <dt>{% trans "Project website" %}</dt> | ||
12 | <dd><a href="https://www.wallabag.org">https://www.wallabag.org</a></dd> | ||
13 | |||
14 | <dt>{% trans "Main developer" %}</dt> | ||
15 | <dd><a href="mailto:nicolas@loeuillet.org">Nicolas Lœuillet</a> — <a href="http://cdetc.fr">{% trans "website" %}</a></dd> | ||
16 | |||
17 | <dt>{% trans "Contributors:" %}</dt> | ||
18 | <dd><a href="https://github.com/wallabag/wallabag/graphs/contributors">{% trans "on Github" %}</a></dd> | ||
19 | |||
20 | <dt>{% trans "Bug reports" %}</dt> | ||
21 | <dd><a href="https://support.wallabag.org">{% trans "On our support website" %}</a> {% trans "or" %} <a href="https://github.com/wallabag/wallabag/issues">{% trans "on Github" %}</a></dd> | ||
22 | |||
23 | <dt>{% trans "License" %}</dt> | ||
24 | <dd><a href="http://en.wikipedia.org/wiki/MIT_License">MIT</a></dd> | ||
25 | |||
26 | <dt>{% trans "Version" %}</dt> | ||
27 | <dd>{{ constant('WALLABAG') }}</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." %}</p> | ||
31 | |||
32 | <h2>{% trans "Getting help" %}</h2> | ||
33 | |||
34 | <dl> | ||
35 | <dt>{% trans "Documentation" %}</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" %}</dt> | ||
39 | <dd><a href="http://support.wallabag.org/">http://support.wallabag.org/</a></dd> | ||
40 | </dl> | ||
41 | |||
42 | <h2>{% trans "Helping wallabag" %}</h2> | ||
43 | |||
44 | <p>{% trans "wallabag is free and opensource. You can help us:" %}</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" %}</a></dt> | ||
48 | |||
49 | <dt><a href="https://flattr.com/thing/1265480">{% trans "via Flattr" %}</a></dt> | ||
50 | </dl> | ||
51 | |||
52 | <h2>{% trans "Credits" %}</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/Wallabag/CoreBundle/Resources/views/baggy/home.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/home.twig deleted file mode 100755 index 93515080..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/baggy/home.twig +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | {% extends "layout.twig" %} | ||
2 | {% block title %} | ||
3 | {% if view == 'fav' %} | ||
4 | {% trans "favorites" %} | ||
5 | {% elseif view == 'archive' %} | ||
6 | {% trans "archive" %} | ||
7 | {% else %} | ||
8 | {% trans "unread" %} | ||
9 | {% endif %} | ||
10 | {% endblock %} | ||
11 | {% block menu %} | ||
12 | {% include '_menu.twig' %} | ||
13 | {% endblock %} | ||
14 | {% block content %} | ||
15 | {% if tag %} | ||
16 | <h3>{% trans "Tag" %}: <b>{{ tag.value }}</b></h3> | ||
17 | {% endif %} | ||
18 | {% if entries is empty %} | ||
19 | <div class="messages warning"><p>{% trans "No articles found." %}</p></div> | ||
20 | {% else %} | ||
21 | <div> | ||
22 | {% include '_display-mode.twig' %} | ||
23 | {% include '_sorting.twig' %} | ||
24 | </div> | ||
25 | {% block pager %} | ||
26 | {% if nb_results > 1 %} | ||
27 | <div class="results"> | ||
28 | <div class="nb-results">{{ nb_results }} {% trans "results" %}{% if search_term is defined %} {% trans %}found for « {{ search_term }} »{% endtrans %}{% endif %}</div> | ||
29 | {{ page_links | raw }} | ||
30 | </div> | ||
31 | {% elseif nb_results == 1 %} | ||
32 | {% if search_term is defined %} | ||
33 | <div class="results"> | ||
34 | <div class="nb-results">{% trans "Only one result found for " %} « {{ search_term }} »</div> | ||
35 | </div> | ||
36 | {% endif %} | ||
37 | {% endif %} | ||
38 | {% endblock %} | ||
39 | <div id="list-entries" class="list-entries"> | ||
40 | {% for entry in entries %} | ||
41 | <div id="entry-{{ entry.id|e }}" class="entrie"> | ||
42 | <h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2> | ||
43 | {% if entry.content| getReadingTime > 0 %} | ||
44 | <div class="estimatedTime"><span class="tool reading-time">{% trans "estimated reading time :" %} {{ entry.content| getReadingTime }} min</span></div> | ||
45 | {% else %} | ||
46 | <div class="estimatedTime"><span class="tool reading-time">{% trans "estimated reading time :" %} <small class="inferieur"><</small> 1 min</span></div> | ||
47 | {% endif %} | ||
48 | <ul class="tools links"> | ||
49 | <li><a title="{% trans "Toggle mark as read" %}" class="tool icon-check icon {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&id={{ entry.id|e }}"><span>{% trans "Toggle mark as read" %}</span></a></li> | ||
50 | <li><a title="{% trans "toggle favorite" %}" class="tool icon-star icon {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span>{% trans "toggle favorite" %}</span></a></li> | ||
51 | <li><a title="{% trans "delete" %}" class="tool delete icon-trash icon" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li> | ||
52 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.url | e | getDomain }}</span></a></li> | ||
53 | </ul> | ||
54 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> | ||
55 | </div> | ||
56 | |||
57 | {% endfor %} | ||
58 | </div> | ||
59 | {{ block('pager') }} | ||
60 | {% if view == 'home' %}{% if nb_results > 1 %}<p><a title="{% trans "Mark all the entries as read" %}" href="./?action=archive_all">{% trans "Mark all the entries as read" %}</a></p>{% endif %}{% endif %} | ||
61 | {% if searchterm is defined %}<a title="{% trans "Tag these results as" %} {{ searchterm }}" href="./?action=add_tag&search={{ searchterm }}">{% trans "Tag these results as" %} {{ searchterm }}</a>{% endif %}<br /> | ||
62 | |||
63 | {% if searchterm is defined %}<a title="{% trans "Delete results matching" %} {{ searchterm }}" href="./?action=delete&search={{ searchterm }}">{% trans "Delete results matching" %} {{ searchterm }}</a>{% endif %}<br /> | ||
64 | |||
65 | {% if tag %}<a title="{% trans "Mark all articles from this tag as read" %}" href="./?action=toggle_archive&tag_id={{ tag.id }}">{% trans "Mark all articles from this tag as read" %}</a><br />{% endif %} | ||
66 | |||
67 | {% if tag %} | ||
68 | {% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this tag in an epub file" %}" href="./?epub&method=tag&value={{ tag.value }}">{% trans "Download as ePub3" %}</a>{% endif %} | ||
69 | {% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this tag in a mobi file" %}" href="./?mobi&method=tag&value={{ tag.value }}">{% trans "Download as Mobi" %}</a>{% endif %} | ||
70 | {% if constant('PDF') == 1 %}<a title="{% trans "Download the articles from this tag in a pdf file" %}" href="./?pdf&method=tag&value={{ tag.value }}">{% trans "Download as PDF" %}</a>{% endif %} | ||
71 | {% elseif searchterm is defined %} | ||
72 | {% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&method=search&value={{ searchterm }}">{% trans "Download as ePub3" %}</a>{% endif %} | ||
73 | {% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this search in a mobi file" %}" href="./?mobi&method=search&value={{ searchterm }}">{% trans "Download as Mobi" %}</a>{% endif %} | ||
74 | {% if constant('PDF') == 1 %}<a title="{% trans "Download the articles from this search in a pdf file" %}" href="./?pdf&method=search&value={{ searchterm }}">{% trans "Download as PDF" %}</a>{% endif %} | ||
75 | {% else %} | ||
76 | {% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this category in an epub" %}" href="./?epub&method=category&value={{ view }}">{% trans "Download as ePub3" %}</a>{% endif %} | ||
77 | {% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this category in a mobi file" %}" href="./?mobi&method=category&value={{ view }}">{% trans "Download as Mobi" %}</a>{% endif %} | ||
78 | {% if constant('PDF') == 1 %}<a title="{% trans "Download the articles from this category in a pdf file" %}" href="./?pdf&method=category&value={{ view }}">{% trans "Download as PDF" %}</a>{% endif %} | ||
79 | {% endif %} | ||
80 | {% endif %} | ||
81 | {% endblock %} | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/layout.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/layout.twig deleted file mode 100755 index 8de12749..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/baggy/layout.twig +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!--[if lte IE 6]><html class="no-js ie6 ie67 ie678" lang="{{ lang }}"><![endif]--> | ||
3 | <!--[if lte IE 7]><html class="no-js ie7 ie67 ie678" lang="{{ lang }}"><![endif]--> | ||
4 | <!--[if IE 8]><html class="no-js ie8 ie678" lang="{{ lang }}"><![endif]--> | ||
5 | <!--[if gt IE 8]><html class="no-js" lang="{{ lang }}"><![endif]--> | ||
6 | <html lang="{{ lang }}"> | ||
7 | <head> | ||
8 | <meta name="viewport" content="initial-scale=1.0"> | ||
9 | <meta charset="utf-8"> | ||
10 | <!--[if IE]> | ||
11 | <meta http-equiv="X-UA-Compatible" content="IE=10"> | ||
12 | <![endif]--> | ||
13 | <title>{% block title %}{% endblock %} - wallabag</title> | ||
14 | {% include '_head.twig' %} | ||
15 | {% include '_bookmarklet.twig' %} | ||
16 | </head> | ||
17 | <body> | ||
18 | {% include '_top.twig' %} | ||
19 | <div id="main"> | ||
20 | {% block menu %}{% endblock %} | ||
21 | {% block precontent %}{% endblock %} | ||
22 | {% block messages %} | ||
23 | {% include '_messages.twig' %} | ||
24 | {% if includeImport %} | ||
25 | {% include '_import.twig' %} | ||
26 | {% endif %} | ||
27 | {% endblock %} | ||
28 | <div id="content" class="w600p center"> | ||
29 | {% block content %}{% endblock %} | ||
30 | </div> | ||
31 | </div> | ||
32 | {% include '_footer.twig' %} | ||
33 | </body> | ||
34 | </html> \ No newline at end of file | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/baggy/view.twig b/src/Wallabag/CoreBundle/Resources/views/baggy/view.twig deleted file mode 100755 index 1afd9df6..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/baggy/view.twig +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | {% extends "layout.twig" %} | ||
2 | {% block menu %} | ||
3 | {% include '_menu.twig' %} | ||
4 | {% endblock %} | ||
5 | {% block title %}{{ entry.title|raw }} ({{ entry.url | e | getDomain }}){% endblock %} | ||
6 | {% block content %} | ||
7 | {% include '_highlight.twig' %} | ||
8 | <div id="article_toolbar"> | ||
9 | <ul class="links"> | ||
10 | <li class="topPosF"><a href="#top" title="{% trans "Back to top" %}" class="tool top icon icon-arrow-up-thick"><span>{% trans "Back to top" %}</span></a></li> | ||
11 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.url | e | getDomain }}</span></a></li> | ||
12 | <li><a title="{% trans "Mark as read" %}" class="tool icon icon-check {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="javascript: void(null);" id="markAsRead"><span>{% trans "Toggle mark as read" %}</span></a></li> | ||
13 | <li><a title="{% trans "Favorite" %}" class="tool icon icon-star {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="javascript: void(null);" id="setFav"><span>{% trans "Toggle favorite" %}</span></a></li> | ||
14 | <li><a title="{% trans "Delete" %}" class="tool delete icon icon-trash" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li> | ||
15 | {% if constant('SHARE_TWITTER') == 1 %}<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" %}"><span>{% trans "Tweet" %}</span></a></li>{% endif %} | ||
16 | {% if constant('SHARE_MAIL') == 1 %}<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" %}"><span>{% trans "Email" %}</span></a></li>{% endif %} | ||
17 | {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} | ||
18 | {% if constant('SHARE_DIASPORA') == 1 %}<li><a href="{{ constant('DIASPORA_URL') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}¬es=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans "diaspora" %}"><span>{% trans "diaspora" %}</span></a></li>{% endif %} | ||
19 | {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span> ({{ flattr.numFlattrs }})</a></li>{% endif %}{% endif %} | ||
20 | {% if constant('CARROT') == 1 %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans "carrot" %}"><span>Carrot</span></a></li>{% endif %} | ||
21 | {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %} | ||
22 | {% if constant('EPUB') == 1 %}<li><a href="./?epub&method=id&value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %} | ||
23 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} | ||
24 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} | ||
25 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display icon icon-delete"><span>{% trans "Does this article appear wrong?" %}</span></a></li> | ||
26 | </ul> | ||
27 | </div> | ||
28 | <div id="article"> | ||
29 | <header class="mbm"> | ||
30 | <h1>{{ entry.title|raw }}</h1> | ||
31 | </header> | ||
32 | <aside class="tags"> | ||
33 | tags: {% for tag in tags %}<a href="./?view=tag&id={{ tag.id }}">{{ tag.value }}</a> {% endfor %}<a href="./?view=edit-tags&id={{ entry.id|e }}" title="{% trans "Edit tags" %}">✎</a> | ||
34 | </aside> | ||
35 | <article> | ||
36 | {{ content | raw }} | ||
37 | </article> | ||
38 | </div> | ||
39 | <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script> | ||
40 | <script type="text/javascript"> | ||
41 | $(document).ready(function() { | ||
42 | |||
43 | // toggle read property of current article | ||
44 | $('#markAsRead').click(function(){ | ||
45 | $("body").css("cursor", "wait"); | ||
46 | $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done( | ||
47 | function( data ) { | ||
48 | if ( data == '1' ) { | ||
49 | if ( $('#markAsRead').hasClass("archive-off") ) { | ||
50 | $('#markAsRead').removeClass("archive-off"); | ||
51 | $('#markAsRead').addClass("archive"); | ||
52 | } | ||
53 | else { | ||
54 | $('#markAsRead').removeClass("archive"); | ||
55 | $('#markAsRead').addClass("archive-off"); | ||
56 | } | ||
57 | } | ||
58 | else { | ||
59 | alert('Error! Pls check if you are logged in.'); | ||
60 | } | ||
61 | }); | ||
62 | $("body").css("cursor", "auto"); | ||
63 | }); | ||
64 | |||
65 | // toggle favorite property of current article | ||
66 | $('#setFav').click(function(){ | ||
67 | $("body").css("cursor", "wait"); | ||
68 | $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done( | ||
69 | function( data ) { | ||
70 | if ( data == '1' ) { | ||
71 | if ( $('#setFav').hasClass("fav-off") ) { | ||
72 | $('#setFav').removeClass("fav-off"); | ||
73 | $('#setFav').addClass("fav"); | ||
74 | } | ||
75 | else { | ||
76 | $('#setFav').removeClass("fav"); | ||
77 | $('#setFav').addClass("fav-off"); | ||
78 | } | ||
79 | } | ||
80 | else { | ||
81 | alert('Error! Pls check if you are logged in.'); | ||
82 | } | ||
83 | }); | ||
84 | $("body").css("cursor", "auto"); | ||
85 | }); | ||
86 | |||
87 | $(window).scroll(function(e){ | ||
88 | var scrollTop = $(window).scrollTop(); | ||
89 | var docHeight = $(document).height(); | ||
90 | var scrollPercent = (scrollTop) / (docHeight); | ||
91 | var scrollPercentRounded = Math.round(scrollPercent*100)/100; | ||
92 | savePercent({{ entry.id|e }}, scrollPercentRounded); | ||
93 | }); | ||
94 | |||
95 | retrievePercent({{ entry.id|e }}); | ||
96 | |||
97 | $(window).resize(function(){ | ||
98 | retrievePercent({{ entry.id|e }}); | ||
99 | }); | ||
100 | }); | ||
101 | </script> | ||
102 | {% endblock %} | ||