diff options
-rw-r--r-- | inc/poche/pocheCore.php | 12 | ||||
-rw-r--r-- | tpl/css/style.css | 4 | ||||
-rw-r--r-- | tpl/view.twig | 65 |
3 files changed, 28 insertions, 53 deletions
diff --git a/inc/poche/pocheCore.php b/inc/poche/pocheCore.php index 9cbcc077..74b063e4 100644 --- a/inc/poche/pocheCore.php +++ b/inc/poche/pocheCore.php | |||
@@ -187,20 +187,16 @@ function display_view($view, $id = 0) | |||
187 | $entry = $store->retrieveOneById($id); | 187 | $entry = $store->retrieveOneById($id); |
188 | if ($entry != NULL) { | 188 | if ($entry != NULL) { |
189 | pocheTools::logm('view link #' . $id); | 189 | pocheTools::logm('view link #' . $id); |
190 | $tpl->assign('id', $entry['id']); | ||
191 | $tpl->assign('url', $entry['url']); | ||
192 | $tpl->assign('title', $entry['title']); | ||
193 | $content = $entry['content']; | 190 | $content = $entry['content']; |
194 | if (function_exists('tidy_parse_string')) { | 191 | if (function_exists('tidy_parse_string')) { |
195 | $tidy = tidy_parse_string($content, array('indent'=>true, 'show-body-only' => true), 'UTF8'); | 192 | $tidy = tidy_parse_string($content, array('indent'=>true, 'show-body-only' => true), 'UTF8'); |
196 | $tidy->cleanRepair(); | 193 | $tidy->cleanRepair(); |
197 | $content = $tidy->value; | 194 | $content = $tidy->value; |
198 | } | 195 | } |
199 | $tpl->assign('content', $content); | 196 | $tpl_vars = array( |
200 | $tpl->assign('is_fav', $entry['is_fav']); | 197 | 'entry' => $entry, |
201 | $tpl->assign('is_read', $entry['is_read']); | 198 | 'content' => $content, |
202 | $tpl->assign('load_all_js', 0); | 199 | ); |
203 | $tpl->draw('view'); | ||
204 | } | 200 | } |
205 | else { | 201 | else { |
206 | pocheTools::logm('error in view call : entry is NULL'); | 202 | pocheTools::logm('error in view call : entry is NULL'); |
diff --git a/tpl/css/style.css b/tpl/css/style.css index 69e37497..d856a354 100644 --- a/tpl/css/style.css +++ b/tpl/css/style.css | |||
@@ -203,8 +203,4 @@ body.article { | |||
203 | margin-left: 0; | 203 | margin-left: 0; |
204 | margin-right: 0; | 204 | margin-right: 0; |
205 | } | 205 | } |
206 | } | ||
207 | |||
208 | .messages { | ||
209 | |||
210 | } \ No newline at end of file | 206 | } \ No newline at end of file |
diff --git a/tpl/view.twig b/tpl/view.twig index e68cd1a1..d2ec2071 100644 --- a/tpl/view.twig +++ b/tpl/view.twig | |||
@@ -1,58 +1,41 @@ | |||
1 | <!DOCTYPE html> | 1 | {% extends "layout.twig" %} |
2 | <!--[if lte IE 6]> <html class="no-js ie6 ie67 ie678" lang="en"> <![endif]--> | 2 | {% block title %}{% trans "home" %}{% endblock %} |
3 | <!--[if lte IE 7]> <html class="no-js ie7 ie67 ie678" lang="en"> <![endif]--> | 3 | |
4 | <!--[if IE 8]> <html class="no-js ie8 ie678" lang="en"> <![endif]--> | 4 | {% block content %} |
5 | <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | 5 | <div class="w600p"> |
6 | <html> | ||
7 | <head> | ||
8 | <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"> | ||
9 | <meta charset="utf-8"> | ||
10 | <meta http-equiv="X-UA-Compatible" content="IE=10"> | ||
11 | <title>{$title}</title> | ||
12 | <link rel="shortcut icon" type="image/x-icon" href="./img/favicon.ico" /> | ||
13 | <link rel="apple-touch-icon-precomposed" sizes="144x144" href="./img/apple-touch-icon-144x144-precomposed.png"> | ||
14 | <link rel="apple-touch-icon-precomposed" sizes="72x72" href="./img/apple-touch-icon-72x72-precomposed.png"> | ||
15 | <link rel="apple-touch-icon-precomposed" href="./img/apple-touch-icon-precomposed.png"> | ||
16 | <link rel="stylesheet" href="./css/knacss.css" media="all"> | ||
17 | <link rel="stylesheet" href="./css/style.css" media="all"> | ||
18 | <!-- Light Theme --> | ||
19 | <link rel="stylesheet" href="./css/style-light.css" media="all" title="light-style"> | ||
20 | <!-- Dark Theme --> | ||
21 | <link rel="alternate stylesheet" href="./css/style-dark.css" media="all" title="dark-style"> | ||
22 | </head> | ||
23 | <body class="article light-style"> | ||
24 | <div id="article" class="w600p"> | ||
25 | <div class="backhome"> | 6 | <div class="backhome"> |
26 | <a href="index.php" title="back to home">←</a> | 7 | <a href="./" title="{% trans "back to home" %}">←</a> |
27 | </div> | 8 | </div> |
28 | <div class="tools"> | 9 | <div class="tools"> |
29 | <ul> | 10 | <ul> |
30 | <li><a title="toggle mark as read" class="tool archive {if="$is_read == '0'"}archive-off{/if}" onclick="toggle_archive(this, {$id})"><span></span></a></li> | 11 | <li><a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" onclick="toggle_archive(this, {{ entry.id|e }})"><span></span></a></li> |
31 | <li><a href="#" id="themeswitch">dark</a></li> | 12 | <li><a href="#" id="themeswitch">{% trans "dark" %}</a></li> |
32 | <li><a title="toggle favorite" class="tool fav {if="$is_fav == '0'"}fav-off{/if}" onclick="toggle_favorite(this, {$id})"><span></span></a></li> | 13 | <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" onclick="toggle_favorite(this, {{ entry.id|e }})"><span></span></a></li> |
33 | <li><form method="post" onsubmit="return confirm('Are you sure?')" style="display: inline;" action="index.php"><input type="hidden" name="token" id="token" value="<?php echo Session::getToken(); ?>" /><input type="hidden" id="view" name="view" value="index" /><input type="hidden" id="action" name="action" value="delete" /><input type="hidden" id="id" name="id" value="{$id}" /><input type="submit" class="delete" title="toggle delete" /></form></li> | 14 | <li><form method="post" style="display: inline;" action="index.php"><input type="hidden" name="token" id="token" value="{{ token }}" /><input type="hidden" id="view" name="view" value="index" /><input type="hidden" id="action" name="action" value="delete" /><input type="hidden" id="id" name="id" value="{{ entry.id|e }}" /><input type="submit" class="delete" title="{% trans "toggle delete" %}" /></form></li> |
34 | <li><a href="?logout" title="Logout">logout</a></li> | 15 | <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> |
35 | </ul> | 16 | </ul> |
36 | </div> | 17 | </div> |
37 | <header class="mbm"> | 18 | <header class="mbm"> |
38 | <h1><a href="{$url}">{$title}</a></h1> | 19 | <h1><a href="{{ entry.url|e }}">{{ entry.title|e }}</a></h1> |
39 | <div class="vieworiginal txtright small"><a href="{$url}" target="_blank" title="original : {$title}">view original</a></div> | 20 | <div class="vieworiginal txtright small"><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{% trans "view original" %}</a></div> |
40 | </header> | 21 | </header> |
41 | {include="messages"} | ||
42 | <article> | 22 | <article> |
43 | <div id="readityourselfcontent"> | 23 | <div id="readityourselfcontent"> |
44 | {$content} | 24 | {{ content|striptags }} |
45 | </div> | 25 | </div> |
46 | </article> | 26 | </article> |
47 | <div class="vieworiginal txtright small"><a href="{$url}" target="_blank" title="original : {$title}">view original</a></div> | 27 | <div class="vieworiginal txtright small"><a href="{$url}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{% trans "view original" %}</a></div> |
48 | <div class="backhome"> | 28 | <div class="backhome"> |
49 | <a href="index.php" title="back to home">←</a> | 29 | <a href="./" title="{% trans "back to home" %}">←</a> |
50 | <a href="#" title="back to top">↑</a> | 30 | <a href="#" title="{% trans "back to top" %}">↑</a> |
51 | </div> | 31 | </div> |
52 | <div class="support"> | 32 | <div class="support"> |
53 | this article appears wrong? <a href="https://github.com/inthepoche/poche/issues/new">create an issue</a> or <a href="mailto:support@inthepoche.com">contact us by mail</a> | 33 | {% trans "this article appears wrong?" %} <a href="https://github.com/inthepoche/poche/issues/new">{% trans "create an issue" %}</a> {% trans "or" %} <a href="mailto:support@inthepoche.com">{% trans "contact us by mail" %}</a> |
54 | </div> | 34 | </div> |
55 | 35 | </div> | |
36 | {% endblock %} | ||
56 | 37 | ||
57 | {include="js"} | 38 | {% block js %} |
58 | {include="footer"} \ No newline at end of file | 39 | <script type="text/javascript" src="./tpl/js/jquery-1.9.1.min.js"></script> |
40 | <script type="text/javascript" src="./tpl/js/poche.js"></script> | ||
41 | {% endblock %} \ No newline at end of file | ||