aboutsummaryrefslogtreecommitdiff
path: root/src/web/templates
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-02-02 23:15:37 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-02-02 23:15:37 +0100
commit082bf39a7dd7296d4f51b6b124d185135dc00989 (patch)
tree6e12cf2b67b016aff38874c389b5bf8b5242749a /src/web/templates
parentfixing logging (diff)
parentreload and fold all button (diff)
downloadnewspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.tar.gz
newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.tar.bz2
newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.zip
Merge branch 'feature/categories'
close #22 close #23
Diffstat (limited to 'src/web/templates')
-rw-r--r--src/web/templates/admin/dashboard.html18
-rw-r--r--src/web/templates/article.html2
-rw-r--r--src/web/templates/categories.html36
-rw-r--r--src/web/templates/duplicates.html4
-rw-r--r--src/web/templates/edit_category.html23
-rw-r--r--src/web/templates/edit_feed.html8
-rw-r--r--src/web/templates/emails/new_account.txt4
-rw-r--r--src/web/templates/feed.html5
-rw-r--r--src/web/templates/feed_list.html4
-rw-r--r--src/web/templates/feeds.html2
-rw-r--r--src/web/templates/history.html8
-rw-r--r--src/web/templates/home.html153
-rw-r--r--src/web/templates/inactives.html2
-rw-r--r--src/web/templates/layout.html73
-rw-r--r--src/web/templates/management.html2
-rw-r--r--src/web/templates/opml.xml4
16 files changed, 141 insertions, 207 deletions
diff --git a/src/web/templates/admin/dashboard.html b/src/web/templates/admin/dashboard.html
index 25bd3883..2436c955 100644
--- a/src/web/templates/admin/dashboard.html
+++ b/src/web/templates/admin/dashboard.html
@@ -20,29 +20,31 @@
<tr {% if user.activation_key != "" %}class="warning"{% endif %}>
<td>{{ loop.index }}</td>
{% if user.id == current_user.id %}
- <td><a href="/management">{{ user.nickname }}</a> (It's you!)</td>
+ <td><a href="{{ url_for("user.management") }}">{{ user.nickname }}</a> (It's you!)</td>
{% else %}
- <td><a href="/admin/user/{{ user.id }}">{{ user.nickname }}</a></td>
+ <td><a href="{{ url_for("admin.user", user_id=user.id) }}">{{ user.nickname }}</a></td>
{% endif %}
<td><a href="mailto:{{ user.email }}">{{ user.email }}</a></td>
<td class="date">{{ user.last_seen }}</td>
<td>
- <a href="/admin/user/{{ user.id }}"><i class="glyphicon glyphicon-user" title="{{ _('View this user') }}"></i></a>
- <a href="/admin/edit_user/{{ user.id }}"><i class="glyphicon glyphicon-edit" title="{{ _('Edit this user') }}"></i></a>
+ <a href="{{ url_for("admin.user", user_id=user.id) }}"><i class="glyphicon glyphicon-user" title="{{ _('View this user') }}"></i></a>
+ <a href="{{ url_for("admin.user_form", user_id=user.id) }}"><i class="glyphicon glyphicon-edit" title="{{ _('Edit this user') }}"></i></a>
{% if user.id != current_user.id %}
+ <a href="{{ url_for("admin.toggle_user", user_id=user.id) }}">
{% if user.activation_key == "" %}
- <a href="/admin/disable_user/{{ user.id }}"><i class="glyphicon glyphicon-ban-circle" title="Disable this account"></i></a>
+ <i class="glyphicon glyphicon-ban-circle" title="{{ _("Disable this account") }}"></i>
{% else %}
- <a href="/admin/enable_user/{{ user.id }}"><i class="glyphicon glyphicon-ok-circle" title="Enable this account"></i></a>
+ <i class="glyphicon glyphicon-ok-circle" title="{{ _("Enable this account") }}"></i>
{% endif %}
- <a href="/admin/delete_user/{{ user.id }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this user') }}" onclick="return confirm('{{ _('You are going to delete this account.') }}');"></i></a>
+ </a>
+ <a href="{{ url_for("admin.delete_user", user_id=user.id) }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this user') }}" onclick="return confirm('{{ _('You are going to delete this account.') }}');"></i></a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
-<a href="/admin/create_user" class="btn btn-default">{{ _('Add a new user') }}</a>
+<a href="{{ url_for("admin.user_form") }}" class="btn btn-default">{{ _('Add a new user') }}</a>
<h1>{{ _('Send notification messages') }}</h1>
<form action="" method="post">
{{ form.hidden_tag() }}
diff --git a/src/web/templates/article.html b/src/web/templates/article.html
index b1f950b4..6ab9d0bb 100644
--- a/src/web/templates/article.html
+++ b/src/web/templates/article.html
@@ -4,7 +4,7 @@
<div class="well">
<h2><a href="{{ article.link }}" target="_blank">{{ article.title|safe }}</a></h2>
<h3>{{ _('from') }} <a href="/feed/{{ article.source.id }}">{{ article.source.title }}</a></h3>
- <a href="/delete/{{ article.id }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this article') }}"></i></a>
+ <a href="{{ url_for("article.delete", article_id=article.id) }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this article') }}"></i></a>
{% if article.like %}
<a href="#"><i class="glyphicon glyphicon-star like" title="{{ _('One of your favorites') }}"></i></a>
{% else %}
diff --git a/src/web/templates/categories.html b/src/web/templates/categories.html
new file mode 100644
index 00000000..a61cc4b2
--- /dev/null
+++ b/src/web/templates/categories.html
@@ -0,0 +1,36 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <h1>{{ _("You have %(categories)d categories &middot; Add a %(start_link)scategory%(end_link)s", categories=categories|count, start_link=("<a href='%s'>" % url_for("category.form"))|safe, end_link="</a>"|safe) }}</h1>
+ {% if categories|count == 0 %}
+ <h1>{{_("No category")}}</h1>
+ {% else %}
+ <div class="table-responsive">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>{{ _('Name') }}</th>
+ <th>{{ _('Feeds') }}</th>
+ <th>{{ _('Articles') }}</th>
+ <th>{{ _('Actions') }}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for category in categories|sort(attribute="name") %}
+ <tr>
+ <td>{{ loop.index }}</td>
+ <td>{{ category.name }}</td>
+ <td>{{ feeds_count.get(category.id, 0) }}</td>
+ <td>( {{ unread_article_count.get(category.id, 0) }} ) {{ article_count.get(category.id, 0) }}</td>
+ <td>
+ <a href="{{ url_for("category.form", category_id=category.id) }}"><i class="glyphicon glyphicon-edit" title='{{ _("Edit this category") }}'></i></a>
+ <a href="{{ url_for("category.delete", category_id=category.id) }}"><i class="glyphicon glyphicon-remove" title='{{ _("Delete this category") }}' onclick="return confirm('{{ _('You are going to delete this category.') }}');"></i></a>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% endif %}
+{% endblock %}
diff --git a/src/web/templates/duplicates.html b/src/web/templates/duplicates.html
index 32fbdf9a..d944a1a5 100644
--- a/src/web/templates/duplicates.html
+++ b/src/web/templates/duplicates.html
@@ -19,8 +19,8 @@
{% for pair in duplicates %}
<tr>
<td>{{ loop.index }}</td>
- <td id="{{ pair[0].id }}"><a href="/delete/{{ pair[0].id }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this article') }}"></i></a>&nbsp;<a href="/article/{{ pair[0].id }}">{{ pair[0].title }}</a> ({{ pair[0].retrieved_date }})</td>
- <td id="{{ pair[1].id }}"><a href="/delete/{{ pair[1].id }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this article') }}"></i></a>&nbsp;<a href="/article/{{ pair[1].id }}">{{ pair[1].title }}</a> ({{ pair[1].retrieved_date }})</td>
+ <td id="{{ pair[0].id }}"><a href="{{ url_for("article.delete", article_id=pair[0].id) }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this article') }}"></i></a>&nbsp;<a href="/article/{{ pair[0].id }}">{{ pair[0].title }}</a> ({{ pair[0].retrieved_date }})</td>
+ <td id="{{ pair[1].id }}"><a href="{{ url_for("article.delete", article_id=pair[1].id) }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this article') }}"></i></a>&nbsp;<a href="/article/{{ pair[1].id }}">{{ pair[1].title }}</a> ({{ pair[1].retrieved_date }})</td>
</tr>
{% endfor %}
</tobdy>
diff --git a/src/web/templates/edit_category.html b/src/web/templates/edit_category.html
new file mode 100644
index 00000000..93c952d6
--- /dev/null
+++ b/src/web/templates/edit_category.html
@@ -0,0 +1,23 @@
+{% extends "layout.html" %}
+{% block content %}
+<div class="container">
+ <div class="well">
+ <h3>{{ action }}</h3>
+ <form action="" method="post" name="save" class="form-horizontal">
+ {{ form.hidden_tag() }}
+ <div class="form-group">
+ <label for="{{ form.name.id }}" class="col-sm-3 control-label">{{ form.name.label }}</label>
+ <div class="col-sm-9">
+ {{ form.name(class_="form-control", size="100%") }}
+ </div>
+ {% for error in form.name.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
+ </div>
+ <div class="form-group">
+ <div class="col-sm-offset-3 col-sm-9">
+ {{ form.submit(class_="btn btn-default") }}
+ </div>
+ </div>
+ </form>
+ </div>
+</div><!-- /.container -->
+{% endblock %}
diff --git a/src/web/templates/edit_feed.html b/src/web/templates/edit_feed.html
index 68da0d48..ab624f15 100644
--- a/src/web/templates/edit_feed.html
+++ b/src/web/templates/edit_feed.html
@@ -30,6 +30,14 @@
</div>
<div class="form-group">
+ <label for="{{ form.category_id.id }}" class="col-sm-3 control-label">{{ form.category_id.label }}</label>
+ <div class="col-sm-9">
+ {{ form.category_id(class_="form-control", placeholder=_('Optional')) }}
+ </div>
+ {% for error in form.category_id.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
+ </div>
+
+ <div class="form-group">
<label for="{{ form.enabled.id }}" class="col-sm-3 control-label">{{ form.enabled.label }}</label>
<div class="col-sm-9">
<div class="checkbox">
diff --git a/src/web/templates/emails/new_account.txt b/src/web/templates/emails/new_account.txt
index 6397f502..6335a34e 100644
--- a/src/web/templates/emails/new_account.txt
+++ b/src/web/templates/emails/new_account.txt
@@ -1,11 +1,11 @@
Hello {{ user.firstname }} {{ user.lastname }},
An account has been created for you.
-You can now access the pyAggr3g470r platform ({{ platform_url }}).
+You can now access the JARR platform ({{ platform_url }}).
Your login is your e-mail address and your password is:
---
{{ password }}
---
-Regards, \ No newline at end of file
+Regards,
diff --git a/src/web/templates/feed.html b/src/web/templates/feed.html
index 6705015a..096ee794 100644
--- a/src/web/templates/feed.html
+++ b/src/web/templates/feed.html
@@ -10,6 +10,9 @@
<div class="well">
<p>
{{ _('This feed contains') }} {{ feed.articles.all()|count }} <a href= "{{ url_for("home", feed_id=feed.id, filter_="all") }}">{{ _('articles') }}</a>.<br />
+ {% if category %}
+ {{ _('This feed is part of category %(category_name)s', category_name=category.name) }}<br />
+ {% endif %}
{{ _('Address of the feed') }}: <a href="{{ feed.link }}" target="_blank">{{ feed.link }}</a><br />
{% if feed.site_link != "" %}
{{ _('Address of the site') }}: <a href="{{ feed.site_link }}" target="_blank">{{ feed.site_link }}</a><br />
@@ -34,7 +37,7 @@
{% if feed.articles.all()|count != 0 %}
{{ _('The last article was posted') }} {{ elapsed.days }} {{ _('day(s) ago.') }}<br />
- {{ _('Daily average') }}: {{ average }}, {{ _('between the') }} <i>{{ first_post_date | datetime }}</i> {{ _('and the') }} <i>{{ end_post_date | datetime }}</i>.
+ {{ _('Daily average') }}: {{ average }}, {{ _('between the') }} {{ first_post_date | datetime }} {{ _('and the') }} {{ end_post_date | datetime }}.
{% endif %}
</p>
</div>
diff --git a/src/web/templates/feed_list.html b/src/web/templates/feed_list.html
index c5cadab0..114ae960 100644
--- a/src/web/templates/feed_list.html
+++ b/src/web/templates/feed_list.html
@@ -1,4 +1,4 @@
-{% if feeds.all()| count == 0 %}
+{% if feeds.count() == 0 %}
<h1>{{_("No feed")}}</h1>
{% else %}
<div class="table-responsive">
@@ -36,7 +36,7 @@
<td>
<a href="{{ url_for("home", feed_id=feed.id, filter_="all") }}"><i class="glyphicon glyphicon-th-list" title="{{ _('Articles') }}"></i></a>
<a href="{{ url_for("feed.form", feed_id=feed.id) }}"><i class="glyphicon glyphicon-edit" title="{{ _('Edit this feed') }}"></i></a>
- <a href="/duplicates/{{ feed.id }}"><i class="glyphicon glyphicon-book" title="{{ _('Duplicate articles') }}"></i></a>
+ <a href="{{ url_for("feed.duplicates", feed_id=feed.id) }}"><i class="glyphicon glyphicon-book" title="{{ _('Duplicate articles') }}"></i></a>
<a href="{{ url_for("feed.delete", feed_id=feed.id) }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this feed') }}" onclick="return confirm('{{ _('You are going to delete this feed.') }}');"></i></a>
</td>
</tr>
diff --git a/src/web/templates/feeds.html b/src/web/templates/feeds.html
index 9ba16359..9523d43f 100644
--- a/src/web/templates/feeds.html
+++ b/src/web/templates/feeds.html
@@ -1,7 +1,7 @@
{% extends "layout.html" %}
{% block content %}
<div class="container">
- <h1>{{ _('You are subscribed to') }} {{ feeds.count() }} {{ _('feeds') }} &middot; {{ _('Add a') }} <a href="{{ url_for("feed.form") }}">{{ _('feed') }}</a></h1>
+ <h1>{{ _('You are subscribed to %(feed_count)d feeds.', feed_count=feeds.count()) }} &middot; {{ _('Add a') }} <a href="{{ url_for("feed.form") }}">{{ _('feed') }}</a></h1>
{% include "feed_list.html" %}
</div><!-- /.container -->
{% endblock %}
diff --git a/src/web/templates/history.html b/src/web/templates/history.html
index 499fe50b..caa0b057 100644
--- a/src/web/templates/history.html
+++ b/src/web/templates/history.html
@@ -3,18 +3,18 @@
<div class="container">
<h1>{{ _('History') }}</h1>
{% if month != None %}
- <h2><a href="/history/{{ year }}"><span class="glyphicon glyphicon-chevron-left"></span> {{ year }}</a></h2>
+ <h2><a href="{{ url_for("articles.history", year=year) }}"><span class="glyphicon glyphicon-chevron-left"></span> {{ year }}</a></h2>
<h3>{{ month | month_name }}</h3>
{% elif year != None %}
- <h2><a href="/history"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp{{ _('all years') }}</a></h2>
+ <h2><a href="{{ url_for("articles.history") }}"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp{{ _('all years') }}</a></h2>
<h3>{{ year }}</h3>
{% endif %}
<ul class="list-group">
{% for article in articles_counter | sort(reverse = True) %}
{% if year == None %}
- <li class="list-group-item"><a href="/history/{{ article }}">{{ article }}</a> : {{ articles_counter[article] }} articles</li>
+ <li class="list-group-item"><a href="{{ url_for("articles.history", year=article) }}">{{ article }}</a> : {{ articles_counter[article] }} articles</li>
{% elif month == None %}
- <li class="list-group-item"><a href="/history/{{ year }}/{{ article }}">{{ article | month_name }}</a> : {{ articles_counter[article] }} articles</li>
+ <li class="list-group-item"><a href="{{ url_for("articles.history", year=year, month=article) }}">{{ article | month_name }}</a> : {{ articles_counter[article] }} articles</li>
{% else %}
{% for article in articles | sort(attribute="date", reverse = True) %}
<li class="list-group-item">{{ article.date | datetime }} - <a href="/article/{{ article.id }}">{{ article.title | safe }}</a></li>
diff --git a/src/web/templates/home.html b/src/web/templates/home.html
index 86d96e94..c2966be7 100644
--- a/src/web/templates/home.html
+++ b/src/web/templates/home.html
@@ -1,131 +1,22 @@
-{% extends "layout.html" %}
-{% block content %}
-{% if feeds|count == 0 %}
- <div class="col-md-4 col-md-offset-4">
- <h1>{{ _("You don't have any feeds.") }}</h1>
- <h1><a href="{{ url_for("feed.form") }}">{{ _('Add some') }}</a>, {{ _('or') }} <a href="/management">{{ _('upload an OPML file.') }}</a></h1>
- </div>
-{% else %}
-<div class="container-fluid">
- <div class="row row-offcanvas row-offcanvas-left">
- <div class="col-md-2 sidebar sidebar-offcanvas pre-scrollable affix hidden-sm hidden-xs" id="sidebar" role="navigation" data-spy="affix" style="max-height: 100%;">
- <ul class="nav nav-sidebar" data-offset-top="0" data-offset-bottom="0">
- <li><a href="{{ gen_url(feed_id=0) }}">
- {% if not feed_id %}<b>{% endif %}
- {{ _('All feeds') }} <span id="total-unread" class="badge pull-right">{{ articles.__len__() }}</span>
- {% if not feed_id %}</b>{% endif %}
- </a></li>
- {% for fid, nbunread in unread|dictsort(by='value')|reverse %}
- <li class="feed-menu"><a href="{{ gen_url(feed_id=fid) }}">
- {% if feed_id == fid %}<b>{% endif %}
- {% if in_error.get(fid, 0) > 0 %}
- <span style="background-color: {{ "red" if in_error[fid] > conf.DEFAULT_MAX_ERROR -1 else "orange" }} ;" class="badge pull-right" title="Some errors occured while trying to retrieve that feed.">{{ in_error[fid] }} {{ _("error") }}{% if in_error[fid] > 1 %}s{% endif %}</span>
- {% endif %}
- <span id="unread-{{ fid }}" class="badge pull-right">{{ nbunread }}</span>
- {{ feeds[fid]|safe }}
- {% if feed_id == fid %}</b>{% endif %}
- </a></li>
- <li class="feed-commands"><span>
- <a href="/feed/{{ fid }}"><i class="glyphicon glyphicon-info-sign" title="{{ _('Details') }}"></i></a>
- <a href="{{ url_for("feed.form", feed_id=fid) }}"><i class="glyphicon glyphicon-edit" title="{{ _('Edit this feed') }}"></i></a>
- <a href="{{ url_for("feed.delete", feed_id=fid) }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this feed') }}" onclick="return confirm('{{ _('You are going to delete this feed.') }}');"></i></a>
- <a href="{{ url_for("feed.update", feed_id=fid, action="read") }}"><i class="glyphicon glyphicon-check" title="{{ _('Mark this feed as read') }}"></i></a>
- <a href="{{ url_for("feed.update", feed_id=fid, action="unread") }}"><i class="glyphicon glyphicon-unchecked" title="{{ _('Mark this feed as unread') }}"></i></a>
- </span></li>
- {% endfor %}
- {% for fid, ftitle in feeds|dictsort(case_sensitive=False, by='value') if not fid in unread %}
- <li class="feed-menu"><a href="{{ gen_url(feed_id=fid) }}">
- {% if in_error.get(fid, 0) > 0 %}
- <span style="background-color: {{ "red" if in_error[fid] > conf.DEFAULT_MAX_ERROR - 1 else "orange" }} ;" class="badge pull-right" title="Some errors occured while trying to retrieve that feed.">{{ in_error[fid] }} {{ _("error") }}{% if in_error[fid] > 1 %}s{% endif %}</span>
- {% endif %}
- {% if feed_id == fid %}<b>{% endif %}
- {{ ftitle|safe }}
- {% if feed_id == fid %}</b>{% endif %}
- </a></li>
- <li class="feed-commands"><span>
- <a href="{{ url_for("feed.feed", feed_id=fid) }}"><i class="glyphicon glyphicon-info-sign" title="{{ _('Details') }}"></i></a>
- <a href="{{ url_for("feed.form", feed_id=fid) }}"><i class="glyphicon glyphicon-edit" title="{{ _('Edit this feed') }}"></i></a>
- <a href="{{ url_for("feed.delete", feed_id=fid) }}"><i class="glyphicon glyphicon-remove" title="{{ _('Delete this feed') }}" onclick="return confirm('{{ _('You are going to delete this feed.') }}');"></i></a>
- <a href="{{ url_for("feed.update", feed_id=fid, action="read") }}"><i class="glyphicon glyphicon-check" title="{{ _('Mark this feed as read') }}"></i></a>
- <a href="{{ url_for("feed.update", feed_id=fid, action="unread") }}"><i class="glyphicon glyphicon-unchecked" title="{{ _('Mark this feed as unread') }}"></i></a>
- </span></li>
- {% endfor %}
- </ul>
- </div><!-- row -->
-
- {% with messages = get_flashed_messages(with_categories=true) %}
- {% if messages %}
- <div class="col-md-offset-2 col-md-10 main">
- {% block messages %}
- {{ super() }}
- {% endblock %}
- </div>
- {% endif %}
- {% endwith %}
- <div class="col-md-offset-2 col-md-10 main">
- <div id="filters" data-filter="{{ filter_ }}">
- <ul id="myTab" class="nav nav-tabs" role="tablist">
- <li id="tab-all"><a href="{{ gen_url(filter_='all') }}">{{ _('All') }}</a></li>
- <li id="tab-read"><a href="{{ gen_url(filter_='read') }}">{{ _('Read') }}</a></li>
- <li id="tab-unread"><a href="{{ gen_url(filter_='unread') }}">{{ _('Unread') }}</a></li>
- <li id="tab-nbdisplay" class="pull-right">
- <div id="nbdisplay">
- <a href="{{ gen_url(limit=10) }}" class="label {% if limit == 10 %}label-primary{% else %}label-info{% endif %}">{{ _(10) }}</a>
- <a href="{{ gen_url(limit=100) }}" class="label {% if limit == 100 %}label-primary{% else %}label-info{% endif %}">{{ _(100) }}</a>
- <a href="{{ gen_url(limit=1000) }}" class="label {% if limit == 1000 %}label-primary{% else %}label-info{% endif %}">{{ _(1000) }}</a>
- <a href="{{ gen_url(limit='all') }}" class="label {% if limit == 'all' %}label-primary{% else %}label-info{% endif %}">{{ _('All') }}</a>
- </div>
- </li>
- </div>
- {% if articles | count != 0%}
- <div class="table-responsive">
- <table class="table table-striped strict-table">
- <thead>
- <tr>
- <th></th>
- <th><a href="{{ gen_url(sort_='-feed' if sort_ == 'feed' else 'feed') }}">{{ _('Feed') }}</a></th>
- <th><a href="{{ gen_url(sort_='-article' if sort_ == 'article' else 'article') }}">{{ _('Article') }}</a></th>
- <th><a href="{{ gen_url(sort_='-date' if sort_ == 'date' else 'date') }}">{{ _('Date') }}</a></th>
- </tr>
- </thead>
- <tbody>
- {% for article in articles %}
- <tr data-article="{{ article.id }}" data-feed="{{ article.feed_id }}">
- <td>
- <a><i class="glyphicon glyphicon-remove delete" title="{{ _('Delete this article') }}"></i></a>
- {% if article.like %}
- <a><i class="glyphicon glyphicon-star like" title="{{ _('One of your favorites') }}"></i></a>
- {% else %}
- <a><i class="glyphicon glyphicon-star-empty like" title="{{ _('Click if you like this article') }}"></i></a>
- {% endif %}
- {% if article.readed %}
- <a><i class="glyphicon glyphicon-unchecked readed" title="{{ _('Mark this article as unread') }}"></i></a>
- {% else %}
- <a><i class="glyphicon glyphicon-check readed" title="{{ _('Mark this article as read') }}"></i></a>
- {% if filter_ == 'all' %}</b>{% endif %}
- {% endif %}
- </td>
- <td>
- <a class="open-article" href="{{ url_for("article.redirect_to_article", article_id=article.id)}}" target="_blank" title="{{article.link}}" alt="{{article.link}}">
- {% if article.source.icon_url %}
- <img src="{{ url_for('icon.icon', url=article.source.icon_url) }}" width="16px" />
- {% else %}
- <span class="glyphicon glyphicon-ban-circle" title='{{_("No icon found for this feed")}}' alt='{{_("No icon found for this feed")}}'></span>
- {% endif %}
- <span class="hidden-xs">{{ article.source.title|safe }}</span></a></td>
- <td {%if filter_ == 'all' and article.readed == False %}style='font-weight:bold'{% endif %}>
- <a href="{{ url_for("article.article", article_id=article.id) }}">{{ article.title|safe }}</a>
- </td>
- <td class="date">{{ article.date|datetime }}</a></td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% endif %}
- </div><!-- row -->
- </div><!-- main -->
-</div><!-- container-fluid -->
-<style>.not-at-home {display: none};</style>
-{% endif %}
-{% endblock %}
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ {% block head %}
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="description" content="JARR is a web-based news aggregator." />
+ <meta name="author" content="" />
+ <title>JARR{% if head_titles %} - {{ ' - '.join(head_titles) }}{% endif %}</title>
+ <link rel="shortcut icon" href="{{ url_for("static", filename="img/favicon.png") }}" />
+ <!-- Add custom CSS here -->
+ <link href="{{ url_for("static", filename="css/customized-bootstrap.css") }}" rel="stylesheet" media="screen" />
+ <link href="{{ url_for("static", filename="css/one-page-app.css") }}" rel="stylesheet" media="screen" />
+ <!-- Bootstrap core CSS -->
+ <link href="{{ url_for("static", filename="css/bootstrap.min.css") }}" rel="stylesheet" media="screen" />
+ {% endblock %}
+ </head>
+ <body>
+ <section id="jarrapp" />
+ </body>
+ <script type="text/javascript" src="{{ url_for('static', filename = 'js/bundle.min.js') }}"></script>
+</html>
diff --git a/src/web/templates/inactives.html b/src/web/templates/inactives.html
index eb546eca..e89a5fe1 100644
--- a/src/web/templates/inactives.html
+++ b/src/web/templates/inactives.html
@@ -2,7 +2,7 @@
{% block content %}
<div class="container">
<div class="well">
- <form method=get action="/inactives">
+ <form method=get action="{{ url_for("feeds.inactives") }}">
<p>{{ _('Days of inactivity') }}:</p>
<input type="number" name="nb_days" class="form-control" value="{{ nb_days }}" min="0" max="1000000" step="1" size="4" style="text-align: center" />
</form>
diff --git a/src/web/templates/layout.html b/src/web/templates/layout.html
index 15cf3e97..feb370e3 100644
--- a/src/web/templates/layout.html
+++ b/src/web/templates/layout.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
{% block head %}
<meta charset="utf-8">
@@ -7,16 +7,15 @@
<meta name="description" content="JARR is a web-based news aggregator." />
<meta name="author" content="" />
<title>JARR{% if head_titles %} - {{ ' - '.join(head_titles) }}{% endif %}</title>
- <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" />
+ <link rel="shortcut icon" href="{{ url_for("static", filename="img/favicon.png") }}" />
<!-- Bootstrap core CSS -->
- <link href="{{ url_for('static', filename='css/bootstrap.css') }}" rel="stylesheet" media="screen" />
+ <link href="{{ url_for("static", filename="css/bootstrap.min.css") }}" rel="stylesheet" media="screen" />
<!-- Add custom CSS here -->
- <link href="{{ url_for('static', filename='css/customized-bootstrap.css') }}" rel="stylesheet" media="screen" />
- <link href="{{ url_for('static', filename='css/side-nav.css') }}" rel="stylesheet" media="screen" />
+ <link href="{{ url_for("static", filename="css/customized-bootstrap.css") }}" rel="stylesheet" media="screen" />
{% endblock %}
</head>
<body>
- <nav class="navbar navbar-inverse navbar-fixed-top navbar-custom" role="navigation">
+ <nav id="jarrnav" class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
@@ -55,11 +54,6 @@
</li>
</ul>
</li>
- {% if page_to_render == "favorites" %}
- <li><a href="{{ url_for("home") }}"><span class="glyphicon glyphicon-home"></span> {{ _('Home') }}</a></li>
- {% else %}
- <li><a href="{{ url_for("favorites") }}"><span class="glyphicon glyphicon-star"></span> {{ _('Favorites') }}</a></li>
- {% endif %}
{% if conf.CRAWLING_METHOD == "classic" and (not conf.ON_HEROKU or g.user.is_admin()) %}
<li><a href="/fetch"><span class="glyphicon glyphicon-import"></span> {{ _('Fetch') }}</a></li>
{% endif %}
@@ -71,8 +65,8 @@
<li><a href="{{ url_for("feeds.update", action="read", nb_days="5") }}">{{ gettext('Mark all as read older than %(days)s days', days=5) }}</a></li>
<li><a href="{{ url_for("feeds.update", action="read", nb_days="10") }}">{{ gettext('Mark all as read older than %(days)s days', days=10) }}</a></li>
<li role="presentation" class="divider"></li>
- <li><a href="{{ url_for("inactives") }}">{{ _('Inactive') }}</a></li>
- <li><a href="{{ url_for("history") }}">{{ _('History') }}</a></li>
+ <li><a href="{{ url_for("feeds.inactives") }}">{{ _('Inactive') }}</a></li>
+ <li><a href="{{ url_for("articles.history") }}">{{ _('History') }}</a></li>
<li><a href="{{ url_for("feeds.feeds") }}">{{ _('All') }}</a></li>
</ul>
</li>
@@ -81,40 +75,17 @@
<div><span class="glyphicon glyphicon-user"></span>&nbsp;<b class="caret"></b></div>
</a>
<ul class="dropdown-menu">
- <li><a href="{{ url_for("profile") }}"><span class="glyphicon glyphicon-user"></span> {{ _('Profile') }}</a></li>
- <li><a href="{{ url_for("management") }}"><span class="glyphicon glyphicon-cog"></span> {{ _('Your data') }}</a></li>
+ <li><a href="{{ url_for("user.profile") }}"><span class="glyphicon glyphicon-user"></span> {{ _('Profile') }}</a></li>
+ <li><a href="{{ url_for("user.management") }}"><span class="glyphicon glyphicon-cog"></span> {{ _('Your data') }}</a></li>
<li><a href="{{ url_for("about") }}"><span class="glyphicon glyphicon-question-sign"></span> {{ _('About') }}</a></li>
{% if g.user.is_admin() %}
<li role="presentation" class="divider"></li>
- <li><a href="{{ url_for("dashboard") }}"><span class="glyphicon glyphicon-dashboard"></span> {{ _('Dashboard') }}</a></li>
+ <li><a href="{{ url_for("admin.dashboard") }}"><span class="glyphicon glyphicon-dashboard"></span> {{ _('Dashboard') }}</a></li>
<li role="presentation" class="divider"></li>
{% endif %}
<li><a href="{{ url_for("logout") }}"><span class="glyphicon glyphicon-log-out"></span> {{ _('Logout') }}</a></li>
</ul>
</li>
-
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <div><span class="glyphicon glyphicon-search"></span>&nbsp;<b class="caret"></b></div>
- </a>
- <ul class="dropdown-menu">
- <li>
- <form class="navbar-form" method=get action="{{ url_for("search") }}" role="search">
- <div class="input-group">
- {% if filter_ %}<input type="hidden" name="filter_" value="{{ filter_ }}" />{% endif %}
- {% if limit %}<input type="hidden" name="limit" value="{{ limit }}" />{% endif %}
- {% if feed_id %}<input type="hidden" name="feed_id" value="{{ feed_id }}" />{% endif %}
- <label for="search_title">{{ _("Title") }}</label>
- <input type="checkbox" name="search_title" {% if search_title == 'on' or not (search_title == 'on' or search_content == 'on') %}checked{%endif%}/>
- <br />
- <label for="search_content">{{ _("Content") }}</label>
- <input type="checkbox" name="search_content" {% if search_content == 'on' %}checked{%endif%}/>
- <input type="text" class="form-control" name="query" placeholder="{{ _("Search") }}" {% if search_query %} value="{{ search_query }}"{% endif %} />
- </div>
- </form>
- </li>
- </ul>
- </li>
{% else %}
<li><a href="{{ url_for("about") }}"><span class="glyphicon glyphicon-question-sign"></span>&nbsp;{{ _('About') }}</a></li>
{% endif %}
@@ -125,18 +96,18 @@
<br />
<div class="container not-at-home">
- {% block messages %}
- {% with messages = get_flashed_messages(with_categories=true) %}
- {% if messages %}
- {% for category, message in messages %}
- <div class="alert alert-{{category}}">
- <button type="button" class="close" data-dismiss="alert">&times;</button>
- {{ message }}
- </div>
- {% endfor %}
- {% endif %}
- {% endwith %}
- {% endblock %}
+ {% block messages %}
+ {% with messages = get_flashed_messages(with_categories=true) %}
+ {% if messages %}
+ {% for category, message in messages %}
+ <div class="alert alert-{{category}}">
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
+ {{ message }}
+ </div>
+ {% endfor %}
+ {% endif %}
+ {% endwith %}
+ {% endblock %}
</div>
{% block content %}{% endblock %}
diff --git a/src/web/templates/management.html b/src/web/templates/management.html
index ac4f3a4a..01179b5e 100644
--- a/src/web/templates/management.html
+++ b/src/web/templates/management.html
@@ -5,7 +5,7 @@
<h1>{{ _('Your subscriptions') }}</h1>
<p>{{ _('You are subscribed to') }} {{ nb_feeds }} <a href="/feeds">{{ _('feeds') }}</a>. <a href="{{ url_for("feed.form") }}">{{ _('Add') }}</a> {{ _('a feed') }}.</p>
<p>{{ nb_articles }} {{ _('articles are stored in the database with') }} {{ nb_unread_articles }} {{ _('unread articles') }}.</p>
- <a href="/expire_articles?weeks=10" class="btn btn-default" onclick="return confirm('{{ _('You are going to delete old articles.') }}');">{{ _('Delete articles older than 10 weeks') }}</a>
+ <a href="{{ url_for("articles.expire", weeks=10) }}" class="btn btn-default" onclick="return confirm('{{ _('You are going to delete old articles.') }}');">{{ _('Delete articles older than 10 weeks') }}</a>
</div>
<div class="well">
<h1 id="import">{{ _('OPML import/export') }}</h1>
diff --git a/src/web/templates/opml.xml b/src/web/templates/opml.xml
index 96fe66f5..051d3af6 100644
--- a/src/web/templates/opml.xml
+++ b/src/web/templates/opml.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
-<!-- OPML generated by pyAggr3g470r on {{ now | datetime }} -->
+<!-- OPML generated by JARR on {{ now | datetime }} -->
<opml version="1.1">
<head>
<title>Feeds of {{ user.nickname }}</title>
@@ -11,4 +11,4 @@
<body>
{% for feed in user.feeds %} <outline title="{{ feed.title|escape }}" text="{{ feed.title|escape }}" description="{{ feed.description|escape }}" xmlUrl="{{ feed.link|escape }}" htmlUrl="{{ feed.site_link|escape }}" />
{% endfor %}</body>
-</opml> \ No newline at end of file
+</opml>
bgstack15