diff options
Diffstat (limited to 'source/templates/feed.html')
-rw-r--r-- | source/templates/feed.html | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/source/templates/feed.html b/source/templates/feed.html new file mode 100644 index 00000000..2dadb8b4 --- /dev/null +++ b/source/templates/feed.html @@ -0,0 +1,148 @@ +## feed.html +<%inherit file="base.html"/> +<% +import utils +%> +<div class="left inner"> + %if articles != []: + <p>The feed <b>${feed['feed_title']}</b> contains <b>${format(nb_articles_feed, ',d')}</b> articles. + Representing ${round((nb_articles_feed / nb_articles_total) * 100, 4)} percent of the total (${format(nb_articles_total, ',d')} articles). + <br /> + Address of the feed: <a href="${feed['feed_link']}">${feed['feed_link']}</a>. + <br /> + Address of the site: <a href="${feed['site_link']}">${feed['site_link']}</a>. + <br /> + Logo: <img src="${feed['feed_image']}" width="28px" height="28px" /></p> + + <p>${(nb_unread_articles_feed == 0 and ["All articles are read"] or ['<a href="/unread/'+feed["feed_id"] + ' ">'+str(nb_unread_articles_feed)+'</a>' + ' unread article' + (nb_unread_articles_feed == 1 and [""] or ["s"])[0]])[0]}.</p> + %else: + <p>No articles for the feed <b>${feed['feed_title']}</b>. + <br /> + Address of the feed: <a href="${feed['feed_link']}">${feed['feed_link']}</a>. + <br /> + Address of the site: <a href="${feed['site_link']}">${feed['site_link']}</a>.</p> + %endif + + %if feed["mail"] == True: + <p> + You are receiving articles from this feed to the address: <a href="mail:${mail_to}">${mail_to}</a>. + <a href="/mail_notification/0:${feed['feed_id']}">Stop</a> receiving articles from this feed. + %if not mail_notification_enabled: + <br />However e-mail notification is disabled in the configuration file. + %endif + </p> + %endif + + %if articles != []: + <p>The last article was posted ${elapsed.days} day(s) ago.<br /> + Daily average: ${average}, between the ${first_post_date.strftime('%Y-%m-%d')} and the ${end_post_date.strftime('%Y-%m-%d')}.</p> + + <br /> + <h1>Recent articles</h1> + <% + html = "" + %> + %for article in articles: + <% + 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="/static/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." + # 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" + %> + %endfor + ${html} + + <a href="/articles/${feed['feed_id']}">All articles</a> + <br /> + + %if nb_favorites != 0: + <br /></br /> + <h1>Your favorites articles for this feed</h1> + <% + html = "" + %> + %for article in favorites: + <% + #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<span class="classic">%s</span></a><br />\n""" % \ + (feed["feed_id"], article["article_id"], article["article_title"][:150], description) + %> + %endfor + ${html} + %endif + %endif + + + + <br /> + <h1>Edit this feed</h1> + <form method=post action="/change_feed_name/"> + <input type="text" name="new_feed_name" value="" placeholder="Enter a new name (then press Enter)." maxlength=2048 autocomplete="on" size="50" /> + <input type="hidden" name="feed_id" value="${feed['feed_id']}" /> + </form> + + <form method=post action="/change_site_url/"> + <input type="url" name="new_site_url" value="" placeholder="Enter a new URL for this site (then press Enter)." maxlength=2048 autocomplete="on" size="50" /> + <input type="hidden" name="feed_id" value="${feed['feed_id']}" /> + <input type="hidden" name="old_site_url" value="${feed['site_link']}" /> + </form> + + <form method=post action="/change_feed_url/"> + <input type="url" name="new_feed_url" value="" placeholder="Enter a new URL in order to retrieve articles (then press Enter)." maxlength=2048 autocomplete="on" size="50" /> + <input type="hidden" name="feed_id" value="${feed['feed_id']}" /> + <input type="hidden" name="old_feed_url" value="${feed['feed_link']}" /> + </form> + + <form method=post action="/change_feed_logo/"> + <input type="text" name="new_feed_logo" value="" placeholder="Enter the URL of the logo (then press Enter)." maxlength=2048 autocomplete="on" size="50" /> + <input type="hidden" name="feed_id" value="${feed['feed_id']}" /> + </form> + + <form method=get action="/remove_feed/${feed['feed_id']}"> + <p><input type="submit" value="Unsubscribe" /> + (deletes corresponding articles)</p> + </form> + + %if articles != []: + </br /> + <h1>Tag cloud</h1> + <form method=get action="/feed/${feed['feed_id']}"> + 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 |