aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-06-24 13:32:05 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-06-24 13:32:05 +0200
commit76d7b6deecd58609af2504570ac9fe4e07677fec (patch)
treecd4a2a3abaedef6deb929bc920e94eaa69d051ff
parentUpdated README. (diff)
downloadnewspipe-76d7b6deecd58609af2504570ac9fe4e07677fec.tar.gz
newspipe-76d7b6deecd58609af2504570ac9fe4e07677fec.tar.bz2
newspipe-76d7b6deecd58609af2504570ac9fe4e07677fec.zip
Removed trailing slashes from the routes.
-rw-r--r--pyaggr3g470r/templates/about.html2
-rw-r--r--pyaggr3g470r/templates/admin/dashboard.html16
-rw-r--r--pyaggr3g470r/templates/admin/user.html2
-rw-r--r--pyaggr3g470r/templates/home.html2
-rw-r--r--pyaggr3g470r/templates/layout.html24
-rw-r--r--pyaggr3g470r/templates/login.html2
-rw-r--r--pyaggr3g470r/templates/management.html12
-rw-r--r--pyaggr3g470r/views.py70
8 files changed, 65 insertions, 65 deletions
diff --git a/pyaggr3g470r/templates/about.html b/pyaggr3g470r/templates/about.html
index d164d4bb..3c4304e5 100644
--- a/pyaggr3g470r/templates/about.html
+++ b/pyaggr3g470r/templates/about.html
@@ -4,7 +4,7 @@
<div class="jumbotron">
<p>{{ _('pyAggr3g470r is a simple news aggregator you can use everywhere.') }}</p>
<p>{{ _('This software is under AGPLv3 license. You are welcome to copy, modify or
- redistribute the <a href="https://bitbucket.org/cedricbonhomme/pyaggr3g470r/">source code</a>
+ redistribute the <a href="https://bitbucket.org/cedricbonhomme/pyaggr3g470r">source code</a>
according to the <a href="https://www.gnu.org/licenses/agpl-3.0.html">Affero GPL</a> license.') }}</p>
<p>{{ _('Found a bug? Report it <a href="https://bitbucket.org/cedricbonhomme/pyaggr3g470r/issues">here</a>.') }}</p>
</div>
diff --git a/pyaggr3g470r/templates/admin/dashboard.html b/pyaggr3g470r/templates/admin/dashboard.html
index 3e5b019e..6253ca62 100644
--- a/pyaggr3g470r/templates/admin/dashboard.html
+++ b/pyaggr3g470r/templates/admin/dashboard.html
@@ -20,29 +20,29 @@
<tr>
<td>{{ loop.index }}</td>
{% if user.id == current_user.id %}
- <td><a href="/management/">{{ user.nickname }}</a> (It's you!)</td>
+ <td><a href="/management">{{ user.nickname }}</a> (It's you!)</td>
{% else %}
- <td><a href="/admin/user/{{ user.id }}/">{{ user.nickname }}</a></td>
+ <td><a href="/admin/user/{{ user.id }}">{{ user.nickname }}</a></td>
{% endif %}
<td><a href="mailto:{{ user.email }}">{{ user.email }}</a></td>
<td>{{ 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="/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>
{% if user.id != current_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>
+ <a href="/admin/disable_user/{{ user.id }}"><i class="glyphicon glyphicon-ban-circle" title="Disable this account"></i></a>
{% else %}
- <a href="/admin/enable_user/{{ user.id }}/"><i class="glyphicon glyphicon-ok-circle" title="Enable this account"></i></a>
+ <a href="/admin/enable_user/{{ user.id }}"><i class="glyphicon glyphicon-ok-circle" title="Enable this account"></i></a>
{% 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 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>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
-<a href="/admin/create_user/" class="btn btn-default">{{ _('Add a new user') }}</a>
+<a href="/admin/create_user" class="btn btn-default">{{ _('Add a new user') }}</a>
<h1>{{ _('Send notification messages') }}</h1>
<form action="" method="post">
{{ form.hidden_tag() }}
diff --git a/pyaggr3g470r/templates/admin/user.html b/pyaggr3g470r/templates/admin/user.html
index d896e85f..8f911b92 100644
--- a/pyaggr3g470r/templates/admin/user.html
+++ b/pyaggr3g470r/templates/admin/user.html
@@ -5,7 +5,7 @@
{% block content %}
<div class="container">
<div class="jumbotron">
- <a href="/admin/edit_user/{{ user.id }}/" class="btn btn-default">{{ _('Edit this user') }}</a>
+ <a href="/admin/edit_user/{{ user.id }}" class="btn btn-default">{{ _('Edit this user') }}</a>
<h2>{{ _('Membership') }}</h2>
<div class="row">
<div class="col-md-6">
diff --git a/pyaggr3g470r/templates/home.html b/pyaggr3g470r/templates/home.html
index a68b71a4..81aeea9c 100644
--- a/pyaggr3g470r/templates/home.html
+++ b/pyaggr3g470r/templates/home.html
@@ -8,7 +8,7 @@
{% if feeds|count == 0 %}
<div class="col-md-4 col-md-offset-4">
<h1>{{ _("You don't have any feeds.") }}</h1>
- <h1><a href="/create_feed/">{{ _('Add some') }}</a>, {{ _('or') }} <a href="/management/#import">{{ _('upload an OPML file.') }}</a></h1>
+ <h1><a href="/create_feed">{{ _('Add some') }}</a>, {{ _('or') }} <a href="/management/#import">{{ _('upload an OPML file.') }}</a></h1>
</div>
{% else %}
<div id="affix-nav" class="col-md-3 sidebar hidden-xs hidden-sm">
diff --git a/pyaggr3g470r/templates/layout.html b/pyaggr3g470r/templates/layout.html
index 8fc88d74..e97128f7 100644
--- a/pyaggr3g470r/templates/layout.html
+++ b/pyaggr3g470r/templates/layout.html
@@ -101,27 +101,27 @@ deployed on Heroku or on a traditional server." />
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ _('Articles') }} <b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><a accesskey="r" href="/fetch/">{{ _('Fetch') }}</a></li>
- <li><a href="/mark_as/read/">{{ _('Mark all as read') }}</a></li>
+ <li><a accesskey="r" href="/fetch">{{ _('Fetch') }}</a></li>
+ <li><a href="/mark_as/read">{{ _('Mark all as read') }}</a></li>
<li role="presentation" class="divider"></li>
- <li><a href="/create_feed/">{{ _('Add a feed') }}</a></li>
+ <li><a href="/create_feed">{{ _('Add a feed') }}</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ _('Filter') }} <b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><a accesskey="u" href="/unread/">{{ _('Unread') }}</a></li>
- <li><a accesskey="f" href="/favorites/">{{ _('Favorites') }}</a></li>
- <li><a accesskey="i" href="/inactives/">{{ _('Inactive feeds') }}</a></li>
- <li><a href="/feeds/">{{ _('All feeds') }}</a></li>
- <li><a href="/history/">{{ _('History') }}</a></li>
+ <li><a accesskey="u" href="/unread">{{ _('Unread') }}</a></li>
+ <li><a accesskey="f" href="/favorites">{{ _('Favorites') }}</a></li>
+ <li><a accesskey="i" href="/inactives">{{ _('Inactive feeds') }}</a></li>
+ <li><a href="/feeds">{{ _('All feeds') }}</a></li>
+ <li><a href="/history">{{ _('History') }}</a></li>
</ul>
</li>
- <li><a accesskey="m" href="/management/">{{ _('Management') }}</a></li>
+ <li><a accesskey="m" href="/management">{{ _('Management') }}</a></li>
{% if g.user.is_admin() %}
<li><a href="{{ url_for('dashboard') }}"><span class="glyphicon glyphicon-dashboard"></span> {{ _('Dashboard') }}</a></li>
{% endif %}
- <li><a href="/about/">{{ _('About') }}</a></li>
+ <li><a href="/about">{{ _('About') }}</a></li>
<li><a href="{{ url_for('logout') }}">{{ _('Logout') }}</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
@@ -129,7 +129,7 @@ deployed on Heroku or on a traditional server." />
</a>
<ul class="dropdown-menu">
<li>
- <form class="navbar-form" method=get action="/search/" role="search">
+ <form class="navbar-form" method=get action="/search" role="search">
<div class="input-group">
<input type="text" class="form-control" name="query" placeholder="Search">
</div>
@@ -138,7 +138,7 @@ deployed on Heroku or on a traditional server." />
</ul>
</li>
{% else %}
- <li><a href="/about/">{{ _('About') }}</a></li>
+ <li><a href="/about">{{ _('About') }}</a></li>
{% endif %}
</ul>
</div><!-- /.navbar-collapse -->
diff --git a/pyaggr3g470r/templates/login.html b/pyaggr3g470r/templates/login.html
index e58b5d83..8bfbffa5 100644
--- a/pyaggr3g470r/templates/login.html
+++ b/pyaggr3g470r/templates/login.html
@@ -26,7 +26,7 @@
{{ form.submit(class_="btn") }}
</form>
</div>
- <a href="/signup/" class="btn btn-default">{{ _('Sign up') }}</a>
+ <a href="/signup" class="btn btn-default">{{ _('Sign up') }}</a>
&nbsp;
<a href="/recover" class="btn btn-default">{{ _('Forgot password') }}</a>
</div><!-- /.container -->
diff --git a/pyaggr3g470r/templates/management.html b/pyaggr3g470r/templates/management.html
index 6264f307..6755281d 100644
--- a/pyaggr3g470r/templates/management.html
+++ b/pyaggr3g470r/templates/management.html
@@ -3,17 +3,17 @@
<div class="container">
<div class="jumbotron">
<h1>{{ _('Your subscriptions') }}</h1>
- <p>{{ _('You are subscribed to') }} {{ nb_feeds }} <a href="/feeds">{{ _('feeds') }}</a>. {{ _('Add a') }} <a href="/create_feed/">{{ _('feed') }}</a>.</p>
- <p>{{ nb_articles }} {{ _('articles are stored in the database with') }} {{ nb_unread_articles }} <a href="/unread/">{{ _('unread articles') }}</a>.</p>
+ <p>{{ _('You are subscribed to') }} {{ nb_feeds }} <a href="/feeds">{{ _('feeds') }}</a>. {{ _('Add a') }} <a href="/create_feed">{{ _('feed') }}</a>.</p>
+ <p>{{ nb_articles }} {{ _('articles are stored in the database with') }} {{ nb_unread_articles }} <a href="/unread">{{ _('unread articles') }}</a>.</p>
{% if not_on_heroku %}
- <a href="/index_database/" class="btn btn-default">{{ _('Index database') }}</a>
+ <a href="/index_database" class="btn btn-default">{{ _('Index database') }}</a>
{% endif %}
</div>
<div class="jumbotron">
<h1>{{ _('Your Profile') }}</h1>
<div class="row">
<div class="col-md-6">
- <p>{{ _('Update your') }} <a href="/profile/">{{ _('profile') }}</a>.</p>
+ <p>{{ _('Update your') }} <a href="/profile">{{ _('profile') }}</a>.</p>
<p>{{ _('Member since') }} {{ user.date_created | datetime }}.</p>
<p>{{ _('Last seen:') }} {{ user.last_seen | datetime }}.</p>
</div>
@@ -23,7 +23,7 @@
</div>
<div class="row">
<div class="col-md-12">
- <a href="/delete_account/" class="btn btn-default" onclick="return confirm('{{ _('You are going to delete your account.') }}');">{{ _('Delete your account') }}</a>
+ <a href="/delete_account" class="btn btn-default" onclick="return confirm('{{ _('You are going to delete your account.') }}');">{{ _('Delete your account') }}</a>
</div>
</div>
</div>
@@ -34,7 +34,7 @@
<button class="btn btn-default" type="submit">OK</button>
</form>
<br />
- <a href="/export_opml/" class="btn btn-default">{{ _('Export feeds to OPML') }}</a>
+ <a href="/export_opml" class="btn btn-default">{{ _('Export feeds to OPML') }}</a>
<h1>{{ _('Data liberation') }}</h1>
<form action="" method="post" id="formImportJSON" enctype="multipart/form-data">
<span class="btn btn-default btn-file">{{ _('Import account') }} (<span class="text-info">*.json</span>)<input type="file" name="jsonfile" /></span>
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 1ff8952a..9525ac9b 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -136,7 +136,7 @@ def get_timezone():
#
# Views.
#
-@app.route('/login/', methods=['GET', 'POST'])
+@app.route('/login', methods=['GET', 'POST'])
def login():
"""
Log in view.
@@ -178,7 +178,7 @@ def logout():
flash(gettext("Logged out successfully."), 'success')
return redirect(url_for('login'))
-@app.route('/signup/', methods=['GET', 'POST'])
+@app.route('/signup', methods=['GET', 'POST'])
def signup():
"""
Signup page.
@@ -244,7 +244,7 @@ def home():
unread=dict(unread), articles=articles.all())
-@app.route('/article/redirect/<int:article_id>/', methods=['GET'])
+@app.route('/article/redirect/<int:article_id>', methods=['GET'])
@login_required
def redirect_to_article(article_id):
article = Article.query.filter(Article.id == article_id,
@@ -256,8 +256,8 @@ def redirect_to_article(article_id):
return redirect(article.link)
-@app.route('/fetch/', methods=['GET'])
-@app.route('/fetch/<int:feed_id>/', methods=['GET'])
+@app.route('/fetch', methods=['GET'])
+@app.route('/fetch/<int:feed_id>', methods=['GET'])
@login_required
def fetch(feed_id=None):
"""
@@ -268,14 +268,14 @@ def fetch(feed_id=None):
flash(gettext("Downloading articles..."), 'success')
return redirect(redirect_url())
-@app.route('/about/', methods=['GET'])
+@app.route('/about', methods=['GET'])
def about():
"""
'About' page.
"""
return render_template('about.html')
-@app.route('/feeds/', methods=['GET'])
+@app.route('/feeds', methods=['GET'])
@login_required
def feeds():
"""
@@ -315,7 +315,7 @@ def feed(feed_id=None):
first_post_date=first_article, end_post_date=last_article , nb_articles=nb_articles, \
average=average, delta=delta, elapsed=elapsed)
-@app.route('/article/<int:article_id>/', methods=['GET'])
+@app.route('/article/<int:article_id>', methods=['GET'])
@login_required
def article(article_id=None):
"""
@@ -341,9 +341,9 @@ def article(article_id=None):
return redirect(redirect_url())
-@app.route('/mark_as/<string:new_value>/', methods=['GET'])
-@app.route('/mark_as/<string:new_value>/feed/<int:feed_id>/', methods=['GET'])
-@app.route('/mark_as/<string:new_value>/article/<int:article_id>/', methods=['GET'])
+@app.route('/mark_as/<string:new_value>', methods=['GET'])
+@app.route('/mark_as/<string:new_value>/feed/<int:feed_id>', methods=['GET'])
+@app.route('/mark_as/<string:new_value>/article/<int:article_id>', methods=['GET'])
@login_required
@feed_access_required
def mark_as(new_value='read', feed_id=None, article_id=None):
@@ -367,7 +367,7 @@ def mark_as(new_value='read', feed_id=None, article_id=None):
return redirect(redirect_url())
return redirect(url_for('home'))
-@app.route('/like/<int:article_id>/', methods=['GET'])
+@app.route('/like/<int:article_id>', methods=['GET'])
@login_required
def like(article_id=None):
"""
@@ -380,7 +380,7 @@ def like(article_id=None):
db.session.commit()
return redirect(redirect_url())
-@app.route('/delete/<int:article_id>/', methods=['GET'])
+@app.route('/delete/<int:article_id>', methods=['GET'])
@login_required
def delete(article_id=None):
"""
@@ -400,7 +400,7 @@ def delete(article_id=None):
flash(gettext('This article do not exist.'), 'danger')
return redirect(url_for('home'))
-@app.route('/articles/<feed_id>/', methods=['GET'])
+@app.route('/articles/<feed_id>', methods=['GET'])
@app.route('/articles/<feed_id>/<int:nb_articles>', methods=['GET'])
@login_required
@feed_access_required
@@ -422,7 +422,7 @@ def articles(feed_id=None, nb_articles=-1):
Article.feed_id == feed.id).order_by(desc("Article.date")).limit(nb_articles)
return render_template('articles.html', feed=new_feed, nb_articles=nb_articles)
-@app.route('/favorites/', methods=['GET'])
+@app.route('/favorites', methods=['GET'])
@login_required
def favorites():
"""
@@ -441,8 +441,8 @@ def favorites():
nb_favorites += length
return render_template('favorites.html', feeds=result, nb_favorites=nb_favorites)
-@app.route('/unread/<int:feed_id>/', methods=['GET'])
-@app.route('/unread/', methods=['GET'])
+@app.route('/unread/<int:feed_id>', methods=['GET'])
+@app.route('/unread', methods=['GET'])
@login_required
def unread(feed_id=None):
"""
@@ -464,7 +464,7 @@ def unread(feed_id=None):
nb_unread += length
return render_template('unread.html', feeds=result, nb_unread=nb_unread)
-@app.route('/inactives/', methods=['GET'])
+@app.route('/inactives', methods=['GET'])
@login_required
def inactives():
"""
@@ -484,7 +484,7 @@ def inactives():
inactives.append((feed, elapsed))
return render_template('inactives.html', inactives=inactives, nb_days=nb_days)
-@app.route('/index_database/', methods=['GET'])
+@app.route('/index_database', methods=['GET'])
@login_required
def index_database():
"""
@@ -502,7 +502,7 @@ def index_database():
flash(gettext('Option not available on Heroku.'), 'success')
return redirect(url_for('home'))
-@app.route('/export/', methods=['GET'])
+@app.route('/export', methods=['GET'])
@login_required
def export_articles():
"""
@@ -534,7 +534,7 @@ def export_articles():
return redirect(redirect_url())
return response
-@app.route('/export_opml/', methods=['GET'])
+@app.route('/export_opml', methods=['GET'])
@login_required
def export_opml():
"""
@@ -546,7 +546,7 @@ def export_opml():
response.headers['Content-Disposition'] = 'attachment; filename=feeds.opml'
return response
-@app.route('/search/', methods=['GET'])
+@app.route('/search', methods=['GET'])
@login_required
def search():
"""
@@ -581,7 +581,7 @@ def search():
break
return render_template('search.html', feeds=result, nb_articles=nb_articles, query=query)
-@app.route('/management/', methods=['GET', 'POST'])
+@app.route('/management', methods=['GET', 'POST'])
@login_required
def management():
"""
@@ -623,13 +623,13 @@ def management():
nb_feeds=nb_feeds, nb_articles=nb_articles, nb_unread_articles=nb_unread_articles, \
not_on_heroku = not conf.ON_HEROKU)
-@app.route('/history/', methods=['GET'])
+@app.route('/history', methods=['GET'])
@login_required
def history():
user = User.query.filter(User.id == g.user.id).first()
return render_template('history.html')
-@app.route('/create_feed/', methods=['GET', 'POST'])
+@app.route('/create_feed', methods=['GET', 'POST'])
@app.route('/edit_feed/<int:feed_id>', methods=['GET', 'POST'])
@login_required
@feed_access_required
@@ -692,7 +692,7 @@ def delete_feed(feed_id=None):
flash(gettext('Feed') + ' ' + feed.title + ' ' + gettext('successfully deleted.'), 'success')
return redirect(redirect_url())
-@app.route('/profile/', methods=['GET', 'POST'])
+@app.route('/profile', methods=['GET', 'POST'])
@login_required
def profile():
"""
@@ -716,7 +716,7 @@ def profile():
form = ProfileForm(obj=user)
return render_template('profile.html', user=user, form=form)
-@app.route('/delete_account/', methods=['GET'])
+@app.route('/delete_account', methods=['GET'])
@login_required
def delete_account():
"""
@@ -780,7 +780,7 @@ def recover():
#
# Views dedicated to administration tasks.
#
-@app.route('/admin/dashboard/', methods=['GET', 'POST'])
+@app.route('/admin/dashboard', methods=['GET', 'POST'])
@login_required
@admin_permission.require(http_exception=403)
def dashboard():
@@ -799,8 +799,8 @@ def dashboard():
users = User.query.all()
return render_template('admin/dashboard.html', users=users, current_user=g.user, form=form)
-@app.route('/admin/create_user/', methods=['GET', 'POST'])
-@app.route('/admin/edit_user/<int:user_id>/', methods=['GET', 'POST'])
+@app.route('/admin/create_user', methods=['GET', 'POST'])
+@app.route('/admin/edit_user/<int:user_id>', methods=['GET', 'POST'])
@login_required
@admin_permission.require(http_exception=403)
def create_user(user_id=None):
@@ -830,7 +830,7 @@ def create_user(user_id=None):
db.session.add(user)
db.session.commit()
flash(gettext('User') + ' ' + user.nickname + ' ' + gettext('successfully created.'), 'success')
- return redirect("/admin/edit_user/"+str(user.id)+"/")
+ return redirect("/admin/edit_user/"+str(user.id))
else:
return redirect(url_for('create_user'))
@@ -844,7 +844,7 @@ def create_user(user_id=None):
message = gettext('Add a new user')
return render_template('/admin/create_user.html', form=form, message=message)
-@app.route('/admin/user/<int:user_id>/', methods=['GET'])
+@app.route('/admin/user/<int:user_id>', methods=['GET'])
@login_required
@admin_permission.require(http_exception=403)
def user(user_id=None):
@@ -858,7 +858,7 @@ def user(user_id=None):
flash(gettext('This user does not exist.'), 'danger')
return redirect(redirect_url())
-@app.route('/admin/delete_user/<int:user_id>/', methods=['GET'])
+@app.route('/admin/delete_user/<int:user_id>', methods=['GET'])
@login_required
@admin_permission.require(http_exception=403)
def delete_user(user_id=None):
@@ -874,8 +874,8 @@ def delete_user(user_id=None):
flash(gettext('This user does not exist.'), 'danger')
return redirect(redirect_url())
-@app.route('/admin/enable_user/<int:user_id>/', methods=['GET'])
-@app.route('/admin/disable_user/<int:user_id>/', methods=['GET'])
+@app.route('/admin/enable_user/<int:user_id>', methods=['GET'])
+@app.route('/admin/disable_user/<int:user_id>', methods=['GET'])
@login_required
@admin_permission.require()
def disable_user(user_id=None):
bgstack15