aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2012-12-13 23:16:44 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2012-12-13 23:16:44 +0100
commitb75b7d6a95af3f8c2ed541f131398976b97ea70a (patch)
tree9b605eac431dce17451cda31c079f5df91a275dd /source
parentfloat() now useless with Python3 (diff)
downloadnewspipe-b75b7d6a95af3f8c2ed541f131398976b97ea70a.tar.gz
newspipe-b75b7d6a95af3f8c2ed541f131398976b97ea70a.tar.bz2
newspipe-b75b7d6a95af3f8c2ed541f131398976b97ea70a.zip
Indentation of the HTML template file for the /feed page
Diffstat (limited to 'source')
-rw-r--r--source/templates/feed.html183
1 files changed, 92 insertions, 91 deletions
diff --git a/source/templates/feed.html b/source/templates/feed.html
index a558a54b..8d0871c1 100644
--- a/source/templates/feed.html
+++ b/source/templates/feed.html
@@ -4,122 +4,123 @@
import utils
%>
<div class="left inner">
-<p>The feed <b>${feed['feed_title']}</b> contains <b>${nb_articles_feed}</b> articles.
-Representing ${(round(nb_articles_feed / nb_articles_total, 4)) * 100} percent of the total (${nb_articles_total}).</p>
-
-%if articles:
- <p>${(nb_unread_articles_feed == 0 and ["All articles are read"] or [str(nb_unread_articles_feed) + " unread article" + (nb_unread_articles_feed == 1 and [""] or ["s"])[0]])[0]}.</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.</p>
-%endif
-
-%if articles != []:
- <p>The last article was posted ${delta_today.days} day(s) ago.</p>
- %if delta_today.days > 0:
- <p>Daily average: ${average}, between the ${first_post_date} and the ${end_post_date}.</p>
+ <p>The feed <b>${feed['feed_title']}</b> contains <b>${nb_articles_feed}</b> articles.
+ Representing ${(round(nb_articles_feed / nb_articles_total, 4)) * 100} percent of the total (${nb_articles_total}).</p>
+
+ %if articles:
+ <p>${(nb_unread_articles_feed == 0 and ["All articles are read"] or [str(nb_unread_articles_feed) + " unread article" + (nb_unread_articles_feed == 1 and [""] or ["s"])[0]])[0]}.</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.</p>
+ %endif
- <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="/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}
+ %if articles != []:
+ <p>The last article was posted ${delta_today.days} day(s) ago.</p>
+ %if delta_today.days > 0:
+ <p>Daily average: ${average}, between the ${first_post_date} and the ${end_post_date}.</p>
+ %endif
- <a href="/articles/${feed['feed_id']}">All articles</a>&nbsp;&nbsp;&nbsp;
- <br />
- %if nb_favorites != 0:
- <br /></br />
- <h1>Your favorites articles for this feed</h1>
+ <br />
+ <h1>Recent articles</h1>
<%
- html = ""
+ html = ""
%>
- %for article in favorites:
+ %for article in articles:
<%
- #descrition for the CSS ToolTips
+ 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."
+ # 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<span class="classic">%s</span></a><br />\n""" % \
- (feed["feed_id"], article["article_id"], article["article_title"][:150], description)
+ """<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}
- %endif
-%else:
- <p>No articles yet.</p>
-%endif
+ <a href="/articles/${feed['feed_id']}">All articles</a>&nbsp;&nbsp;&nbsp;
+ <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
+ %else:
+ <p>No articles yet.</p>
+ %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_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>
+ <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_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>
-%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 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>
- <div style="width: 35%; overflow:hidden; text-align: justify">${tag_cloud}</div>
-%endif \ No newline at end of file
+
+
+ %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 \ No newline at end of file
bgstack15