diff options
Diffstat (limited to 'source/templates')
-rw-r--r-- | source/templates/article.html | 58 | ||||
-rw-r--r-- | source/templates/articles.html | 39 | ||||
-rw-r--r-- | source/templates/base.html | 28 | ||||
-rw-r--r-- | source/templates/confirmation.html | 4 | ||||
-rw-r--r-- | source/templates/error.html | 4 | ||||
-rw-r--r-- | source/templates/favorites.html | 30 | ||||
-rw-r--r-- | source/templates/inactives.html | 15 | ||||
-rw-r--r-- | source/templates/index.html | 104 | ||||
-rw-r--r-- | source/templates/management.html | 55 | ||||
-rw-r--r-- | source/templates/notifications.html | 14 | ||||
-rw-r--r-- | source/templates/plain_text.html | 5 | ||||
-rw-r--r-- | source/templates/search.html | 56 | ||||
-rw-r--r-- | source/templates/statistics.html | 14 |
13 files changed, 426 insertions, 0 deletions
diff --git a/source/templates/article.html b/source/templates/article.html new file mode 100644 index 00000000..bd459c4e --- /dev/null +++ b/source/templates/article.html @@ -0,0 +1,58 @@ +## article.html +<%inherit file="base.html"/> +<div> + <div style="width: 50%; overflow:hidden; text-align: justify; margin:0 auto"> + <h1><i>${article["article_title"]}</i> from <a href="/feed/${feed['feed_id']}">${feed["feed_title"]}</a></h1> + <br /> + %if article["article_like"]: + <a href="/like/0:${feed['feed_id']}:${article['article_id']}"><img src="/img/heart.png" title="I like this article!" /></a> + %else: + <a href="/like/1:${feed['feed_id']}:${article['article_id']}"><img src="/img/heart_open.png" title="Click if you like this article." /></a> + %endif + <a href="/delete_article/${feed['feed_id']}:${article['article_id']}"><img src="/img/cross.png" title="Delete this article" /></a> + <br /><br /> + + ${description} + + <div style="float:right;"><a href="/article/${feed['feed_id']}:${following['article_id']}" title="${following['article_title']}"><img src="/img/following-article.png" /></a></div> + <div style="float:left;"><a href="/article/${feed['feed_id']}:${previous['article_id']}" title="${previous['article_title']}"><img src="/img/previous-article.png" /></a></div> + </div> + + <hr /> + <a href="/plain_text/${feed['feed_id']}:${article['article_id']}">Plain text</a> + - <a href="/epub/${feed['feed_id']}:${article['article_id']}">Export to EPUB</a> + <br /> + <a href="${article['article_link']}">Complete story</a> + <br /> + + Share this article:<br /> + <a href="javascript:(function(){f='https://${diaspora}/bookmarklet?url=${article['article_link']}&title=${article['article_title']}&notes=via pyAggr3g470r&v=1&';a=function(){if(!window.open(f+'noui=1&jump=doclose','diasporav1','location=yes,links=no,scrollbars=no,toolbar=no,width=620,height=250'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"> + <img src="/img/diaspora.png" title="Share on Diaspora" /></a> + + <a href="http://identi.ca/index.php?action=newnotice&status_textarea=${article['article_title']}:${article['article_link']}" title="Share on Identi.ca" target="_blank"><img src="/img/identica.png" /></a> + + <a href="https://api.pinboard.in/v1/posts/add?url=${article['article_link']}&description=${article['article_title']}" + rel="noreferrer" target="_blank"> + <img src="/img/pinboard.png" title="Share on Pinboard" /></a> + + <a href="http://digg.com/submit?url=${article['article_link']}&title=${article['article_title']}" + rel="noreferrer" target="_blank"> + <img src="/img/digg.png" title="Share on Digg" /></a> + + <a href="http://reddit.com/submit?url=${article['article_link']}&title=${article['article_title']}" + rel="noreferrer" target="_blank"> + <img src="/img/reddit.png" title="Share on reddit" /></a> + + <a href="http://scoopeo.com/scoop/new?newurl=${article['article_link']}&title=${article['article_title']}" + rel="noreferrer" target="_blank"> + <img src="/img/scoopeo.png" title="Share on Scoopeo" /></a> + + <a href="http://blogmarks.net/my/new.php?url=${article['article_link']}&title=${article['article_title']}" + rel="noreferrer" target="_blank"> + <img src="/img/blogmarks.png" title="Share on Blogmarks" /></a> + + <g:plusone size="standard" count="true" href="${article['article_link']}"></g:plusone> + + + <br /> + <a href="/var/qrcode/${article['article_id']}.png"><img src="/var/qrcode/${article['article_id']}.png" title="Share with your smartphone" width="500" height="500" /></a>
\ No newline at end of file diff --git a/source/templates/articles.html b/source/templates/articles.html new file mode 100644 index 00000000..cbba2508 --- /dev/null +++ b/source/templates/articles.html @@ -0,0 +1,39 @@ +## articles.html +<%inherit file="base.html"/> +<% +import utils +%> +<div class="right inner"> + <a href="/mark_as_read/Feed:${feed['feed_id']}">Mark all articles from this feed as read</a> + <br /> + <form method=get action="/search/Feed${feed['feed_id']}"> + <input type="search" name="query" value="" placeholder="Search this feed" maxlength=2048 autocomplete="on"> + </form> + <hr /> +</div> + +<div class="left inner"> + <h1>Articles of the feed <i><a href="/feed/${feed['feed_id']}">${feed['feed_title']}</a></i></h1> + <br /> + %for article in articles: + <% + if article["article_readed"] == False: + not_read_begin, not_read_end = "<b>", "</b>" + else: + not_read_begin, not_read_end = "", "" + + if article["article_like"] == True: + like = """ <img src="/img/heart.png" title="I like this article!" />""" + else: + like = "" + + article_content = utils.clear_string(article["article_content"]) + if article_content: + description = " ".join(article_content[:500].split(' ')[:-1]) + else: + description = "No description." + %> + ${article["article_date"].strftime('%Y-%m-%d %H:%M')} - <a class="tooltip" href="/article/${feed['feed_id']}:${article['article_id']}" rel="noreferrer" target="_blank">${not_read_begin}${article["article_title"][:150]}${not_read_end}<span class="classic">${description}</span></a> + <br /> + %endfor + <h4><a href="/">All feeds</a></h4>
\ No newline at end of file diff --git a/source/templates/base.html b/source/templates/base.html new file mode 100644 index 00000000..c6b33a82 --- /dev/null +++ b/source/templates/base.html @@ -0,0 +1,28 @@ +## base.html +<!DOCTYPE html> +<html> +<head> + %if header_text is UNDEFINED: + <title>pyAggr3g470r</title> + %elif header_text == 0: + <title>pyAggr3g470r</title> + %else: + <title>${header_text} - pyAggr3g470r</title> + %endif + <link rel="stylesheet" type="text/css" href="/css/style.css" /> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> +</head> +<body> + <div class="right innerlogo"> + <a href="/"><img src="/img/tuxrss.png" title="What's new today?"/></a> + </div> + <a name="top"><a href="/"><h1>pyAggr3g470r</h1></a></a> + ${self.body()} + <hr /> + <p>This software is under GPLv3 license. You are welcome to copy, modify or + redistribute the source code according to the <a href="http://www.gnu.org/licenses/gpl-3.0.txt">GPLv3</a> license.<br /> + <a href="https://bitbucket.org/cedricbonhomme/pyaggr3g470r/" rel="noreferrer" target="_blank">Source code</a> of pyAggr3g470r.</p> + </div> +</body> +</html>
\ No newline at end of file diff --git a/source/templates/confirmation.html b/source/templates/confirmation.html new file mode 100644 index 00000000..7f631d3c --- /dev/null +++ b/source/templates/confirmation.html @@ -0,0 +1,4 @@ +## confirmation.html +<%inherit file="base.html"/> +<div class="left inner"> +<p>${message}</p> diff --git a/source/templates/error.html b/source/templates/error.html new file mode 100644 index 00000000..dbdf66db --- /dev/null +++ b/source/templates/error.html @@ -0,0 +1,4 @@ +## error.html +<%inherit file="base.html"/> +<div class="left inner"> +${message}
\ No newline at end of file diff --git a/source/templates/favorites.html b/source/templates/favorites.html new file mode 100644 index 00000000..5eba8a3c --- /dev/null +++ b/source/templates/favorites.html @@ -0,0 +1,30 @@ +## favorites.html +<%inherit file="base.html"/> +<% +import utils +%> +<div class="left inner"> + <h1>Your favorites articles</h1> + %for feed in feeds: + <% + new_feed_section = True + %> + %for article in articles[feed["feed_id"]]: + <% + if new_feed_section: + new_feed_section = False + title = """<h2><a name="%s"><a href="%s" rel="noreferrer"target="_blank">%s</a></a><a href="%s" rel="noreferrer" target="_blank"><img src="%s" width="28" height="28" /></a></h2>\n""" % \ + (feed["feed_id"], feed["site_link"], feed["feed_title"], feed["feed_link"], feed["feed_image"]) + else: + title = "" + article_content = utils.clear_string(article["article_content"]) + if article_content: + description = " ".join(article_content[:500].split(' ')[:-1]) + else: + description = "No description." + %> + ${title} + + ${article["article_date"].strftime('%Y-%m-%d %H:%M')} - <a class="tooltip" href="/article/${feed['feed_id']}:${article['article_id']}" rel="noreferrer" target="_blank">${article["article_title"][:150]}<span class="classic">${description}</span></a><br /> + %endfor + %endfor
\ No newline at end of file diff --git a/source/templates/inactives.html b/source/templates/inactives.html new file mode 100644 index 00000000..57482b61 --- /dev/null +++ b/source/templates/inactives.html @@ -0,0 +1,15 @@ +## inactives.html +<%inherit file="base.html"/> +<div class="left inner"> + %if inactives != []: + <form method=get action="/inactives/"> + <h1>Feeds with no recent articles since <input type="number" name="nb_days" value="${nb_days}" min="0" max="1000000" step="1" size="4" style="text-align: center" /> days:</h1> + </form> + <ul> + %for item in inactives: + <li><a href="/feed/${item[0]["feed_id"]}">${item[0]["feed_title"]}</a> (${item[1].days} days)</li> + %endfor + </ul> + %else: + <p>No inactive feeds.<p> + %endif diff --git a/source/templates/index.html b/source/templates/index.html new file mode 100644 index 00000000..fea71154 --- /dev/null +++ b/source/templates/index.html @@ -0,0 +1,104 @@ +## index.html +<%inherit file="base.html"/> +<% +import utils +%> +<div class="right inner"> + <form method=get action="/search/"> + <input type="search" name="query" value="" placeholder="Search articles" maxlength=2048 autocomplete="on"> + </form> + <hr /> + <div class="nav_container">Your feeds (${nb_feeds}):<br /> + <% + html = "" + %> + %for feed in feeds: + <% + if mongo.nb_unread_articles(feed["feed_id"]) != 0: + # not readed articles are in bold + not_read_begin, not_read_end = "<b>", "</b>" + else: + not_read_begin, not_read_end = "", "" + html += """<div><a href="/#%s">%s</a> (<a href="/unread/%s" title="Unread article(s)">%s%s%s</a> / %s)</div>\n""" % \ + (feed["feed_id"], feed["feed_title"], feed["feed_id"], not_read_begin, \ + mongo.nb_unread_articles(feed["feed_id"]), not_read_end, mongo.nb_articles(feed["feed_id"])) + %> + %endfor + ${html} + </div> +</div> + +<div class="left inner"> + <div class="menu_container"> + %if feeds: + <a href="/management/"><img src="/img/management.png" title="Management" /></a> + <a href="/history/"><img src="/img/history.png" title="History" /></a> + + <a href="/favorites/"><img src="/img/heart-32x32.png" title="Your favorites (${nb_favorites})" /></a> + <a href="/notifications/"><img src="/img/email-follow.png" title="Active e-mail notifications (${nb_mail_notifications})" /></a> + + %if nb_unread_articles != 0: + <a href="/mark_as_read/"><img src="/img/mark-as-read.png" title="Mark articles as read" /></a> + <a href="/unread/"><img src="/img/unread.png" title="Unread article(s): ${nb_unread_articles}" /></a> + %endif + %endif + <a accesskey="F" href="/fetch/"><img src="/img/check-news.png" title="Check for news" /></a> + </div><br/> + <% + html = "" + %> + <% + for feed in feeds: + html += """<a name="%s"></a>\n""" % (feed["feed_id"],) + html += """<h2><a href="%s" rel="noreferrer" target="_blank">%s</a> + <a href="%s" rel="noreferrer" + target="_blank"><img src="%s" width="28" height="28" /></a></h2>\n<br />""" % \ + (feed["site_link"], feed["feed_title"], \ + feed["feed_link"], feed["feed_image"]) + + # The main page display only 10 articles by feeds. + for article in mongo.get_articles(feed["feed_id"], limit=10): + if article["article_readed"] == False: + # not readed articles are in bold + not_read_begin, not_read_end = "<b>", "</b>" + else: + not_read_begin, not_read_end = "", "" + + # display a heart for faved articles + if article["article_like"] == True: + like = """ <img src="/img/heart.png" title="I like this article!" />""" + else: + like = "" + + # Descrition for the CSS ToolTips + article_content = utils.clear_string(article["article_content"]) + if article_content: + description = " ".join(article_content.split(' ')[:55]) + else: + description = "No description." + # Title of the article + article_title = article["article_title"] + if len(article_title) >= 80: + article_title = article_title[:80] + " ..." + + # a description line per article (date, title of the article and + # CSS description tooltips on mouse over) + html += article["article_date"].strftime('%Y-%m-%d %H:%M') + " - " + \ + """<a class="tooltip" href="/article/%s:%s" rel="noreferrer" target="_blank">%s%s%s<span class="classic">%s</span></a>""" % \ + (feed["feed_id"], article["article_id"], not_read_begin, \ + article_title, not_read_end, description) + like + "<br />\n" + html += "<br />\n" + + # some options for the current feed + html += """<a href="/articles/%s">All articles</a> """ % (feed["feed_id"],) + html += """<a href="/feed/%s">Feed summary</a> """ % (feed["feed_id"],) + if mongo.nb_unread_articles(feed["feed_id"]) != 0: + html += """ <a href="/mark_as_read/Feed_FromMainPage:%s">Mark all as read</a>""" % (feed["feed_id"],) + html += """ <a href="/unread/%s" title="Unread article(s)">Unread article(s) (%s)</a>""" % (feed["feed_id"], mongo.nb_unread_articles(feed["feed_id"])) + if feed["mail"] == "0": + html += """<br />\n<a href="/mail_notification/1:%s" title="By e-mail">Stay tuned</a>""" % (feed["feed_id"],) + else: + html += """<br />\n<a href="/mail_notification/0:%s" title="By e-mail">Stop staying tuned</a>""" % (feed["feed_id"],) + html += """<h4><a href="/#top">Top</a></h4>\n""" + %> + ${html} diff --git a/source/templates/management.html b/source/templates/management.html new file mode 100644 index 00000000..5bc38439 --- /dev/null +++ b/source/templates/management.html @@ -0,0 +1,55 @@ +## management.html +<%inherit file="base.html"/> +<div class="left inner"> + <h1>Add Feeds</h1> + <form method=get action="/add_feed/"> + <input type="url" name="url" placeholder="URL of a site" maxlength=2048 autocomplete="off"> + <input type="submit" value="OK"> + </form> + + %if feeds: + <h1>Delete Feeds</h1> + <form method=get action="/remove_feed/"> + <select name="feed_id"> + %for feed in feeds: + <option value="${feed['feed_id']}">${feed['feed_title']}</option> + %endfor + </select> + <input type="submit" value="OK"> + </form> + + <hr /> + + <h1>Facts</h1> + <ul> + <li>active e-mail notifications: <a href="/notifications/">${nb_mail_notifications}</a>;</li> + <li>you like <a href="/favorites/">${nb_favorites}</a> article(s);</li> + <li><a href="/statistics/">tag clouds</a>;</li> + <li><a href="/inactives/">inactive feeds</a>.</li> + </ul> + %endif + + <hr /> + + <h1>Database</h1> + <p>${nb_articles} article(s) are stored in the database with <a href="/unread/">${nb_unread_articles} unread article(s)</a>. + + <form method=get action="/fetch/"> + <input type="submit" value="Fetch all feeds"> + </form> + <form method=get action="/drop_base"> + <input type="submit" value="Delete all articles"> + </form> + + <hr /> + + <h1>Export articles</h1> + <form method=get action="/export/"> + <select name="export_method"> + <option value="export_html" selected='selected'>HTML (simple Webzine)</option> + <option value="export_epub">ePub</option> + <option value="export_pdf">PDF</option> + <option value="export_txt">Text</option> + </select> + <input type="submit" value="Export"> + </form> diff --git a/source/templates/notifications.html b/source/templates/notifications.html new file mode 100644 index 00000000..35aa72a6 --- /dev/null +++ b/source/templates/notifications.html @@ -0,0 +1,14 @@ +## article.html +<%inherit file="base.html"/> +<div class="left inner"> + %if feeds != []: + <h1>You are receiving e-mails for the following feeds:</h1> + <ul> + %for feed in feeds: + <li><a href="/feed/${feed['feed_id']}">${feed['feed_title']}</a> - <a href="/mail_notification/0:${feed['feed_id']}">Stop</a></li> + %endfor + </ul> + %else: + <p>No active notifications.<p> + %endif + <p>Notifications are sent to: <a href="mail:${mail_to}">${mail_to}</a></p> diff --git a/source/templates/plain_text.html b/source/templates/plain_text.html new file mode 100644 index 00000000..44b7da91 --- /dev/null +++ b/source/templates/plain_text.html @@ -0,0 +1,5 @@ +## plain_text.html +<%inherit file="base.html"/> +<div class="left inner"> + <h1><i>${article_title}</i> from <a href="/articles/%s">${feed_title}</a></h1><br /> + ${description}
\ No newline at end of file diff --git a/source/templates/search.html b/source/templates/search.html new file mode 100644 index 00000000..e4a4ac9c --- /dev/null +++ b/source/templates/search.html @@ -0,0 +1,56 @@ +## search.html +<%inherit file="base.html"/> +<% +import re +import utils +%> +<div class="left inner"> +<h1>Articles containing the string <i>${query}</i></h1> +<br /> +<% + html = "" +%> +%if feed_id is None: + %for feed in feeds: + <% + new_feed_section = True + for article in mongo.get_articles(feed["feed_id"]): + article_content = utils.clear_string(article["article_content"]) + if not article_content: + utils.clear_string(article["article_title"]) + if wordre.findall(article_content) != []: + if new_feed_section is True: + new_feed_section = False + html += """<h2><a href="/articles/%s" rel="noreferrer" target="_blank">%s</a><a href="%s" rel="noreferrer" target="_blank"><img src="%s" width="28" height="28" /></a></h2>\n""" % \ + (feed["feed_id"], feed["feed_title"], feed["feed_link"], feed["feed_image"]) + + if article["article_readed"] == False: + # not readed articles are in bold + not_read_begin, not_read_end = "<b>", "</b>" + else: + not_read_begin, not_read_end = "", "" + + # display a heart for faved articles + if article["article_like"] == True: + like = """ <img src="/img/heart.png" title="I like this article!" />""" + else: + like = "" + + # descrition for the CSS ToolTips + article_content = utils.clear_string(article["article_content"]) + if article_content: + description = " ".join(article_content[:500].split(' ')[:-1]) + else: + description = "No description." + + # a description line per article (date, title of the article and + # CSS description tooltips on mouse over) + html += article["article_date"].strftime('%Y-%m-%d %H:%M') + " - " + \ + """<a class="tooltip" href="/article/%s:%s" rel="noreferrer" target="_blank">%s%s%s<span class="classic">%s</span></a>""" % \ + (feed["feed_id"], article["article_id"], not_read_begin, \ + article["article_title"][:150], not_read_end, description) + like + "<br />\n" + %> + %endfor +%endif + ${html} +
\ No newline at end of file diff --git a/source/templates/statistics.html b/source/templates/statistics.html new file mode 100644 index 00000000..5dfcbfa8 --- /dev/null +++ b/source/templates/statistics.html @@ -0,0 +1,14 @@ +## statistics.html +<%inherit file="base.html"/> +<div class="left inner"> + %if articles: + <h1>Statistics</h1> + <h3>Tag cloud</h3> + <form method=get action="/statistics/"> + Minimum size of a word: + <input type="number" name="word_size" value="${word_size}" min="2" max="15" step="1" size="2" /> + </form> + <div style="width: 35%; overflow:hidden; text-align: justify"> + ${tag_cloud} + </div> + %endif
\ No newline at end of file |