From 9a6fe2bf696c4c364518159735f4f5d12c666681 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 15 Mar 2013 08:20:00 +0100 Subject: Reaorganization of folders for the CSS, templates and pictures. --- source/templates/article.html | 58 --------------- source/templates/articles.html | 39 ---------- source/templates/base.html | 28 -------- source/templates/confirmation.html | 5 -- source/templates/error.html | 5 -- source/templates/favorites.html | 30 -------- source/templates/feed.html | 138 ------------------------------------ source/templates/history.html | 80 --------------------- source/templates/inactives.html | 15 ---- source/templates/index.html | 107 ---------------------------- source/templates/languages.html | 25 ------- source/templates/management.html | 80 --------------------- source/templates/notifications.html | 18 ----- source/templates/plain_text.html | 5 -- source/templates/search.html | 53 -------------- source/templates/statistics.html | 14 ---- source/templates/unread.html | 76 -------------------- 17 files changed, 776 deletions(-) delete mode 100644 source/templates/article.html delete mode 100644 source/templates/articles.html delete mode 100644 source/templates/base.html delete mode 100644 source/templates/confirmation.html delete mode 100644 source/templates/error.html delete mode 100644 source/templates/favorites.html delete mode 100644 source/templates/feed.html delete mode 100644 source/templates/history.html delete mode 100644 source/templates/inactives.html delete mode 100644 source/templates/index.html delete mode 100644 source/templates/languages.html delete mode 100644 source/templates/management.html delete mode 100644 source/templates/notifications.html delete mode 100644 source/templates/plain_text.html delete mode 100644 source/templates/search.html delete mode 100644 source/templates/statistics.html delete mode 100644 source/templates/unread.html (limited to 'source/templates') diff --git a/source/templates/article.html b/source/templates/article.html deleted file mode 100644 index bd459c4e..00000000 --- a/source/templates/article.html +++ /dev/null @@ -1,58 +0,0 @@ -## article.html -<%inherit file="base.html"/> -
-
-

${article["article_title"]} from ${feed["feed_title"]}

-
- %if article["article_like"]: - - %else: - - %endif -    -

- - ${description} - -
-
-
- -
- Plain text - - Export to EPUB -
- Complete story -
- - Share this article:
- - - - - - - - - - - - - - - - - - - - - - - -
- \ No newline at end of file diff --git a/source/templates/articles.html b/source/templates/articles.html deleted file mode 100644 index cbba2508..00000000 --- a/source/templates/articles.html +++ /dev/null @@ -1,39 +0,0 @@ -## articles.html -<%inherit file="base.html"/> -<% -import utils -%> - - -
-

Articles of the feed ${feed['feed_title']}

-
- %for article in articles: - <% - if article["article_readed"] == False: - not_read_begin, not_read_end = "", "" - else: - not_read_begin, not_read_end = "", "" - - if article["article_like"] == True: - like = """ """ - 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')} - ${not_read_begin}${article["article_title"][:150]}${not_read_end}${description} -
- %endfor -

All feeds

\ No newline at end of file diff --git a/source/templates/base.html b/source/templates/base.html deleted file mode 100644 index aa375470..00000000 --- a/source/templates/base.html +++ /dev/null @@ -1,28 +0,0 @@ -## base.html - - - - - %if header_text is UNDEFINED: - pyAggr3g470r - %elif header_text == 0: - pyAggr3g470r - %else: - ${header_text} - pyAggr3g470r - %endif - - - - - -

pyAggr3g470r

- ${self.body()} -
-

This software is under GPLv3 license. You are welcome to copy, modify or - redistribute the source code according to the GPLv3 license.
- Source code of pyAggr3g470r.

-
- - \ No newline at end of file diff --git a/source/templates/confirmation.html b/source/templates/confirmation.html deleted file mode 100644 index ae206838..00000000 --- a/source/templates/confirmation.html +++ /dev/null @@ -1,5 +0,0 @@ -## confirmation.html -<%inherit file="base.html"/> -
-

Your request processed successfully:

-

${message}

diff --git a/source/templates/error.html b/source/templates/error.html deleted file mode 100644 index 3790d3e9..00000000 --- a/source/templates/error.html +++ /dev/null @@ -1,5 +0,0 @@ -## error.html -<%inherit file="base.html"/> -
-

An error occured:

- ${message} \ No newline at end of file diff --git a/source/templates/favorites.html b/source/templates/favorites.html deleted file mode 100644 index 4dd17b6b..00000000 --- a/source/templates/favorites.html +++ /dev/null @@ -1,30 +0,0 @@ -## favorites.html -<%inherit file="base.html"/> -<% -import utils -%> -
-

Your favorites articles (${sum([elem.count() for elem in articles.values()])})

- %for feed in feeds: - <% - new_feed_section = True - %> - %for article in articles[feed["feed_id"]]: - <% - if new_feed_section: - new_feed_section = False - title = """

%s

\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')} - ${article["article_title"][:150]}${description}
- %endfor - %endfor diff --git a/source/templates/feed.html b/source/templates/feed.html deleted file mode 100644 index f4a35e77..00000000 --- a/source/templates/feed.html +++ /dev/null @@ -1,138 +0,0 @@ -## feed.html -<%inherit file="base.html"/> -<% -import utils -%> -
-

The feed ${feed['feed_title']} contains ${format(nb_articles_feed, ',d')} articles. - Representing ${round((nb_articles_feed / nb_articles_total) * 100, 4)} percent of the total (${format(nb_articles_total, ',d')} articles). -
- Address of the feed: ${feed['feed_link']}. -
- Address of the site: ${feed['site_link']}.

- - %if articles: -

${(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]}.

- %endif - - %if feed["mail"] == True: -

- You are receiving articles from this feed to the address: ${mail_to}. - Stop receiving articles from this feed. - %if not mail_notification_enabled: -
However e-mail notification is disabled in the configuration file. - %endif -

- %endif - - %if articles != []: -

The last article was posted ${elapsed.days} day(s) ago.
- Daily average: ${average}, between the ${first_post_date.strftime('%Y-%m-%d')} and the ${end_post_date.strftime('%Y-%m-%d')}.

- -
-

Recent articles

- <% - html = "" - %> - %for article in articles: - <% - if article["article_readed"] == False: - # not readed articles are in bold - not_read_begin, not_read_end = "", "" - else: - not_read_begin, not_read_end = "", "" - - # display a heart for faved articles - if article["article_like"] == True: - like = """ """ - 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') + " - " + \ - """%s%s%s%s""" % \ - (feed["feed_id"], article["article_id"], not_read_begin, \ - article_title, not_read_end, description) + like + "
\n" - %> - %endfor - ${html} - - All articles    -
- - %if nb_favorites != 0: -

-

Your favorites articles for this feed

- <% - 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') + " - " + \ - """%s%s
\n""" % \ - (feed["feed_id"], article["article_id"], article["article_title"][:150], description) - %> - %endfor - ${html} - %endif - %else: -

No articles yet.

- %endif - - - -
-

Edit this feed

-
- - -
- -
- - - -
- -
- - - -
- -
- - -
- - - %if articles != []: -
-

Tag cloud

-
- Minimum size of a word: - -
-
${tag_cloud}
- %endif diff --git a/source/templates/history.html b/source/templates/history.html deleted file mode 100644 index e6826032..00000000 --- a/source/templates/history.html +++ /dev/null @@ -1,80 +0,0 @@ -## history.html -<%inherit file="base.html"/> -<% -import utils -import calendar -from collections import Counter -%> -
- <% - html = "" - # Get the date from the tag cloud - # Format: /history/?query=year:2011-month:06 to get the - # list of articles of June, 2011. - if query == "all": - html += "

Search with tags cloud

\n" - html += "

Choose a year

\n" - if "year" in query: - the_year = query.split('-')[0].split(':')[1] - if "month" not in query: - html += "

Choose a month for " + the_year + "

\n" - if "month" in query: - the_month = query.split('-')[1].split(':')[1] - html += "

Articles of "+ calendar.month_name[int(the_month)] + ", "+ the_year +".

\n" - - timeline = Counter() - for feed in feeds: - new_feed_section = True - for article in mongo.get_articles(feed["feed_id"]): - - if query == "all": - timeline[article["article_date"].strftime('%Y')] += 1 - - elif query[:4] == "year": - - if article["article_date"].strftime('%Y') == the_year: - timeline[article["article_date"].strftime('%m')] += 1 - - if "month" in query: - if article["article_date"].strftime('%m') == the_month: - if article["article_readed"] == False: - # not readed articles are in bold - not_read_begin, not_read_end = "", "" - else: - not_read_begin, not_read_end = "", "" - - if article["article_like"] == True: - like = """ """ - 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] + " ..." - - if new_feed_section is True: - new_feed_section = False - html += """

%s

\n""" % \ - (feed["feed_id"], feed["site_link"], feed["feed_title"], feed["feed_link"], feed["feed_image"]) - - html += article["article_date"].strftime("%a %d (%H:%M:%S) ") + " - " + \ - """%s%s%s%s""" % \ - (feed["feed_id"], article["article_id"], not_read_begin, \ - article_title, not_read_end, description) + like + "
\n" - if query == "all": - query_string = "year" - elif "year" in query: - query_string = "year:" + the_year + "-month" - if "month" not in query: - html += '
' + \ - utils.tag_cloud([(elem, timeline[elem]) for elem in timeline.keys()], query_string) + '
' - %> - ${html} \ No newline at end of file diff --git a/source/templates/inactives.html b/source/templates/inactives.html deleted file mode 100644 index 57482b61..00000000 --- a/source/templates/inactives.html +++ /dev/null @@ -1,15 +0,0 @@ -## inactives.html -<%inherit file="base.html"/> -
- %if inactives != []: -
-

Feeds with no recent articles since days:

-
- - %else: -

No inactive feeds.

- %endif diff --git a/source/templates/index.html b/source/templates/index.html deleted file mode 100644 index 43269f0a..00000000 --- a/source/templates/index.html +++ /dev/null @@ -1,107 +0,0 @@ -## index.html -<%inherit file="base.html"/> -<% -import utils -%> -

-
- -
-
- -
- -
-
- <% - html = "" - %> - <% - for feed in feeds: - html += """\n

%s - - - -

\n
""" % \ - (feed["feed_id"], 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 = "", "" - else: - not_read_begin, not_read_end = "", "" - - # display a heart for faved articles - if article["article_like"] == True: - like = """ """ - 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') + " - " + \ - """%s%s%s%s""" % \ - (feed["feed_id"], article["article_id"], not_read_begin, \ - article_title, not_read_end, description) + like + "
\n" - html += "
\n" - - # some options for the current feed - html += """All articles   """ % (feed["feed_id"],) - html += """Feed summary   """ % (feed["feed_id"],) - html += """

\n""" % (feed["feed_id"],) - if mongo.nb_unread_articles(feed["feed_id"]) != 0: - html += """  Mark all as read""" % (feed["feed_id"],) - html += """     Unread article(s) (%s)""" % (feed["feed_id"], mongo.nb_unread_articles(feed["feed_id"])) - if feed["mail"] == False: - html += """
\nStay tuned""" % (feed["feed_id"],) - else: - html += """
\nStop staying tuned""" % (feed["feed_id"],) - html += """

Top

\n""" - %> - ${html} diff --git a/source/templates/languages.html b/source/templates/languages.html deleted file mode 100644 index d186677d..00000000 --- a/source/templates/languages.html +++ /dev/null @@ -1,25 +0,0 @@ -## languages.html -<%inherit file="base.html"/> -
-

Summary

-
    - %for language in articles_sorted_by_languages.keys(): -
  • ${language}: ${sum(map(len, articles_sorted_by_languages[language].values()))} articles
  • - %endfor -
- %for language in articles_sorted_by_languages.keys(): -
-

${language}

- %for feed_id in articles_sorted_by_languages[language]: - <% - feed = mongo.get_feed(feed_id) - %> -

${feed["feed_title"]}

- %for article in articles_sorted_by_languages[language][feed_id][:10]: - ${article["article_date"].strftime('%Y-%m-%d %H:%M')} - ${article["article_title"]} -
- %endfor -
- %endfor -
- %endfor \ No newline at end of file diff --git a/source/templates/management.html b/source/templates/management.html deleted file mode 100644 index a2bce1dc..00000000 --- a/source/templates/management.html +++ /dev/null @@ -1,80 +0,0 @@ -## management.html -<%inherit file="base.html"/> -
-

Subscriptions

-
-

- Add a feed: - - -

-
- - %if feeds: -
- Delete the feed: - - -
- %endif - - %if not mail_notification_enabled: -

E-mail notification is disabled in the configuration file.

- %endif - - %if feeds: -
-

Facts

- - %endif - -
- -

Account

-

-

- -
-
-
- -
-

- -
- - -

Database

-

${nb_articles} article(s) are stored in the database with ${nb_unread_articles} unread article(s). - -

- -
-
- -
- -
- -

Export articles

-

-

- - -
-

diff --git a/source/templates/notifications.html b/source/templates/notifications.html deleted file mode 100644 index 88558b05..00000000 --- a/source/templates/notifications.html +++ /dev/null @@ -1,18 +0,0 @@ -## article.html -<%inherit file="base.html"/> -
- %if feeds != []: -

You are receiving e-mails for the following feeds:

- - %else: -

No active notifications.

- %endif -

Notifications are sent to: ${mail_to}. - %if not mail_notification_enabled: - However e-mail notification is disabled in the configuration file. - %endif -

diff --git a/source/templates/plain_text.html b/source/templates/plain_text.html deleted file mode 100644 index 44b7da91..00000000 --- a/source/templates/plain_text.html +++ /dev/null @@ -1,5 +0,0 @@ -## plain_text.html -<%inherit file="base.html"/> -
-

${article_title} from ${feed_title}


- ${description} \ No newline at end of file diff --git a/source/templates/search.html b/source/templates/search.html deleted file mode 100644 index da766ee9..00000000 --- a/source/templates/search.html +++ /dev/null @@ -1,53 +0,0 @@ -## search.html -<%inherit file="base.html"/> -<% -import utils -%> -
-%if len(search_result) != 0: -

Articles containing the string ${query} (${sum([articles.count() for articles in search_result.values()])} results)

-%else: -

String ${query} not found.

-%endif -<% - html = "" - feed_id = None -%> - -%for feed_id in search_result.keys(): - <% - new_feed_section = True - feed = mongo.get_feed(feed_id) - print(search_result[feed["feed_id"]].count()) - for article in search_result[feed["feed_id"]]: - if new_feed_section is True: - new_feed_section = False - html += """

%s

\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 = "", "" - else: - not_read_begin, not_read_end = "", "" - - # display a heart for faved articles - if article["article_like"] == True: - like = """ """ - else: - like = "" - - # descrition for the CSS ToolTips - article_content = utils.clear_string(article["article_content"]) - description = " ".join(article_content[:500].split(' ')[:-1]) - - # 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') + " - " + \ - """%s%s%s%s""" % \ - (feed["feed_id"], article["article_id"], not_read_begin, \ - article["article_title"][:150], not_read_end, description) + like + "
\n" - %> -%endfor - -${html} \ No newline at end of file diff --git a/source/templates/statistics.html b/source/templates/statistics.html deleted file mode 100644 index 5dfcbfa8..00000000 --- a/source/templates/statistics.html +++ /dev/null @@ -1,14 +0,0 @@ -## statistics.html -<%inherit file="base.html"/> -
- %if articles: -

Statistics

-

Tag cloud

-
- Minimum size of a word: - -
-
- ${tag_cloud} -
- %endif \ No newline at end of file diff --git a/source/templates/unread.html b/source/templates/unread.html deleted file mode 100644 index d37d3034..00000000 --- a/source/templates/unread.html +++ /dev/null @@ -1,76 +0,0 @@ -## unread.html -<%inherit file="base.html"/> -<% -import utils -%> -
- <% - html = "" - if mongo.nb_unread_articles() != 0: - - # List unread articles of all the database - if feed_id == "": - html += "

Unread article(s)

" - html += """\n
\nMark articles as read\n
\n""" - for feed in feeds: - new_feed_section = True - nb_unread = 0 - - # For all unread article of the current feed. - for article in mongo.get_articles(feed["feed_id"], condition=("article_readed", False)): - nb_unread += 1 - if new_feed_section is True: - new_feed_section = False - html += """

%s

\n""" % \ - (feed["feed_id"], feed["site_link"], feed["feed_title"], feed["feed_link"], feed["feed_image"]) - - # 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') + " - " + \ - """%s%s
\n""" % \ - (feed["feed_id"], article["article_id"], article["article_title"][:150], description) - - if nb_unread == mongo.nb_unread_articles(feed["feed_id"]): - html += """
\nMark all articles from this feed as read\n""" % \ - (feed["feed_id"],) - html += """
\nMark articles as read\n""" - - - # List unread articles of a feed - else: - try: - feed = mongo.get_feed(feed_id) - except: - return "

This feed do not exists.

" - html += """

Unread article(s) of the feed %s

-
""" % (feed_id, feed["feed_title"]) - - # For all unread article of the feed. - for article in mongo.get_articles(feed_id, condition=("article_readed", False)): - # 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') + " - " + \ - """%s%s
\n""" % \ - (feed_id, article["article_id"], article["article_title"][:150], description) - - html += """
\nMark all as read""" % (feed_id,) - # No unread article - else: - html += '

No unread article(s)

\n
\nWhy not check for news?' - html += """\n

All feeds

""" - %> - ${html} \ No newline at end of file -- cgit