aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-03 08:25:11 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-03 08:25:11 +0200
commit8cbb2a88024969f7efd90f8053f3b0805fa2f8fa (patch)
tree0bb5c7fb3adc752d9ea9a933b524bd08631ca11a /tpl
parentc67e13e04baab64bcc63fd0dca46125513250c44 (diff)
downloadwallabag-8cbb2a88024969f7efd90f8053f3b0805fa2f8fa.tar.gz
wallabag-8cbb2a88024969f7efd90f8053f3b0805fa2f8fa.tar.zst
wallabag-8cbb2a88024969f7efd90f8053f3b0805fa2f8fa.zip
twig implementation
Diffstat (limited to 'tpl')
-rw-r--r--tpl/home.twig44
-rw-r--r--tpl/layout.twig42
-rw-r--r--tpl/login.twig10
3 files changed, 47 insertions, 49 deletions
diff --git a/tpl/home.twig b/tpl/home.twig
index 8b602a25..7b5b88a2 100644
--- a/tpl/home.twig
+++ b/tpl/home.twig
@@ -1,21 +1,41 @@
1 <body class="light-style"> 1{% extends "layout.twig" %}
2 <header> 2
3 <h1><a href="index.php"><img src="./img/logo.png" alt="logo poche" /></a>poche</h1> 3{% block title %}Home{% endblock %}
4 </header>
5 <div id="main">
6{% block menu %} 4{% block menu %}
7 <ul id="links"> 5 <ul id="links">
8 <li><a href="index.php" {if="$view == 'index'"}class="current"{/if}>home</a></li> 6 <li><a href="index.php" {% if view == 'home' %}class="current"{% endif %}>home</a></li>
9 <li><a href="?view=fav" {if="$view == 'fav'"}class="current"{/if}>favorites</a></li> 7 <li><a href="?view=fav" {% if view == 'fav' %}class="current"{% endif %}>favorites</a></li>
10 <li><a href="?view=archive" {if="$view == 'archive'"}class="current"{/if}>archive</a></li> 8 <li><a href="?view=archive" {% if view == 'archive' %}class="current"{% endif %}>archive</a></li>
11 <li><a href="?view=config" {if="$view == 'config'"}class="current"{/if}>config</a></li> 9 <li><a href="?view=config" {% if view == 'config' %}class="current"{% endif %}>config</a></li>
12 <li><a href="?logout" title="Logout">logout</a></li> 10 <li><a href="?logout" title="Logout">logout</a></li>
13 </ul> 11 </ul>
14{% endblock %} 12{% endblock %}
15{% block precontent %} 13{% block precontent %}
16 <ul id="sort"> 14 <ul id="sort">
17 <li><img src="img/up.png" onclick="sort_links('{$view}', 'ia');" title="by date asc" /> by date <img src="img/down.png" onclick="sort_links('{$view}', 'id');" title="by date desc" /></li> 15 <li><img src="img/up.png" onclick="sort_links('{{ view }}', 'ia');" title="by date asc" /> by date <img src="img/down.png" onclick="sort_links('{{ view }}', 'id');" title="by date desc" /></li>
18 <li><img src="img/up.png" onclick="sort_links('{$view}', 'ta');" title="by title asc" /> by title <img src="img/down.png" onclick="sort_links('{$view}', 'td');" title="by title desc" /></li> 16 <li><img src="img/up.png" onclick="sort_links('{{ view }}', 'ta');" title="by title asc" /> by title <img src="img/down.png" onclick="sort_links('{{ view }}', 'td');" title="by title desc" /></li>
19 </ul> 17 </ul>
20{% endblock %} 18{% endblock %}
21 {include="messages"} \ No newline at end of file 19{% block content %}
20 <div id="content">
21 {% for entry in entries %}
22 <div id="entry-{{ entry.id|e }}" class="entrie mb2">
23 <span class="content">
24 <h2 class="h6-like">
25 <a href="index.php?&view=view&id={{ entry.id|e }}">{{ entry.title|e }}</a>
26 </h2>
27 <div class="tools">
28 <ul>
29 <li>
30 <a title="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 title="toggle favorite" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" onclick="toggle_favorite(this, {{ entry.id|e }})"><span></span></a></li>
32 <li><form method="post" onsubmit="return confirm('Are you sure?')" style="display: inline;"><input type="hidden" name="token" id="token" value="{{ token }}" /><input type="hidden" id="action" name="action" value="delete" /><input type="hidden" id="view" name="view" value="{{ view }}" /><input type="hidden" id="id" name="id" value="{{ entry.id|e }}" /><input type="submit" class="delete" title="toggle delete" /></form>
33 </li>
34 </ul>
35 </div>
36 <div class="url">{{ entry.url|e }}</div>
37 </span>
38 </div>
39 {% endfor %}
40 </div>
41{% endblock %} \ No newline at end of file
diff --git a/tpl/layout.twig b/tpl/layout.twig
index c5f52bbd..9dc83efe 100644
--- a/tpl/layout.twig
+++ b/tpl/layout.twig
@@ -9,50 +9,18 @@
9 <meta charset="utf-8"> 9 <meta charset="utf-8">
10 <meta http-equiv="X-UA-Compatible" content="IE=10"> 10 <meta http-equiv="X-UA-Compatible" content="IE=10">
11 <title>{% block title %}{% endblock %} - poche</title> 11 <title>{% block title %}{% endblock %} - poche</title>
12 <link rel="shortcut icon" type="image/x-icon" href="./img/favicon.ico" /> 12 {% include '_head.twig' %}
13 <link rel="apple-touch-icon-precomposed" sizes="144x144" href="./img/apple-touch-icon-144x144-precomposed.png"> 13 {% include '_bookmarklet.twig' %}
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 <script>
23 top["bookmarklet-url@inthepoche.com"] = ''
24 +'<!DOCTYPE html>'
25 +'<html>'
26 +'<head>'
27 +'<title>poche it !</title>'
28 +'<link rel="icon" href="{$poche_url}img/favicon.ico" />'
29 +'</head>'
30 +'<body>'
31 +'<script>'
32 +'window.onload=function(){'
33 +'window.setTimeout(function(){'
34 +'history.back();'
35 +'},250);'
36 +'};'
37 +'</scr'+'ipt>'
38 +'</body>'
39 +'</html>'
40 ;
41 </script>
42 </head> 14 </head>
43 <body class="light-style"> 15 <body class="light-style">
44 <header> 16 {% include '_top.twig' %}
45 <h1><a href="/"><img src="./img/logo.png" alt="logo poche" /></a>poche</h1>
46 </header>
47 <div id="main"> 17 <div id="main">
48 {% block menu %}{% endblock %} 18 {% block menu %}{% endblock %}
49 {% block precontent %}{% endblock %} 19 {% block precontent %}{% endblock %}
20 {% block messages %}{% endblock %}
50 {% block content %}{% endblock %} 21 {% block content %}{% endblock %}
51 {% block js %}{% endblock %} 22 {% block js %}{% endblock %}
52 </div> 23 </div>
53 <footer class="mr2 mt3 smaller"> 24 {% include '_footer.twig' %}
54 <p>powered by <a href="http://inthepoche.com">poche</a></p>
55 </footer>
56
57 </body> 25 </body>
58</html> \ No newline at end of file 26</html> \ No newline at end of file
diff --git a/tpl/login.twig b/tpl/login.twig
index 390718b6..c95a5f02 100644
--- a/tpl/login.twig
+++ b/tpl/login.twig
@@ -1,5 +1,15 @@
1{% extends "layout.twig" %} 1{% extends "layout.twig" %}
2
2{% block title %}Login{% endblock %} 3{% block title %}Login{% endblock %}
4{% block messages %}
5 <div class="messages">
6 <ul>
7 {% for error in errors %}
8 <li>{{ error.value|e }}</li>
9 {% endfor %}
10 </ul>
11 </div>
12{% endblock %}
3{% block content %} 13{% block content %}
4 <form method="post" action="?login" name="loginform"> 14 <form method="post" action="?login" name="loginform">
5 <fieldset class="w500p center"> 15 <fieldset class="w500p center">