aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2018-10-28 13:23:42 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2018-10-28 13:23:42 +0100
commitb46dccd8d8d85fb2a1d304ff239cdfcbcdc6bcb3 (patch)
treefcd3f507fdb4f31371c7a852b6028bb17d6b267a /src
parentRemoved useless tag cloud. (diff)
downloadnewspipe-b46dccd8d8d85fb2a1d304ff239cdfcbcdc6bcb3.tar.gz
newspipe-b46dccd8d8d85fb2a1d304ff239cdfcbcdc6bcb3.tar.bz2
newspipe-b46dccd8d8d85fb2a1d304ff239cdfcbcdc6bcb3.zip
Removed tag cloud from the public feed page.
Diffstat (limited to 'src')
-rw-r--r--src/conf.py1
-rw-r--r--src/conf/conf.cfg-sample1
-rwxr-xr-xsrc/runserver.py2
-rw-r--r--src/web/templates/feed.html10
-rw-r--r--src/web/templates/feed_list_per_categories.html6
-rw-r--r--src/web/views/feed.py7
6 files changed, 10 insertions, 17 deletions
diff --git a/src/conf.py b/src/conf.py
index 6299f601..693a66ee 100644
--- a/src/conf.py
+++ b/src/conf.py
@@ -73,6 +73,7 @@ else:
WEBSERVER_HOST = config.get('webserver', 'host')
WEBSERVER_PORT = config.getint('webserver', 'port')
WEBSERVER_SECRET = config.get('webserver', 'secret_key')
+WEBSERVER_DEBUG = config.get('webserver', 'debug')
CDN_ADDRESS = config.get('cdn', 'cdn_address')
diff --git a/src/conf/conf.cfg-sample b/src/conf/conf.cfg-sample
index 40938851..2dfe7b21 100644
--- a/src/conf/conf.cfg-sample
+++ b/src/conf/conf.cfg-sample
@@ -2,6 +2,7 @@
host = 0.0.0.0
port = 5000
secret_key = a secret only you know
+debug = true
[cdn]
cdn_address = https://cdn.cedricbonhomme.org/
[misc]
diff --git a/src/runserver.py b/src/runserver.py
index ca71891d..287a52f8 100755
--- a/src/runserver.py
+++ b/src/runserver.py
@@ -63,4 +63,4 @@ with application.app_context():
if __name__ == '__main__':
application.run(host=conf.WEBSERVER_HOST,
port=conf.WEBSERVER_PORT,
- debug=False)
+ debug=conf.WEBSERVER_DEBUG)
diff --git a/src/web/templates/feed.html b/src/web/templates/feed.html
index 6b2e5e40..d914b82b 100644
--- a/src/web/templates/feed.html
+++ b/src/web/templates/feed.html
@@ -45,7 +45,7 @@
</div>
<div class="row">
- <div class="col-md-8">
+ <div class="col-md-12">
<div class="table-responsive">
<table id="table-articles" class="table table-striped">
<thead>
@@ -55,7 +55,7 @@
</tr>
</thead>
<tbody>
- {% for article in articles %}
+ {% for article in feed.articles %}
<tr>
<td><a href="{{ url_for("article.article_pub", article_id=article.id) }}">{{ article.title }}</a></td>
<td>{{ article.date | datetime }}</td>
@@ -65,12 +65,6 @@
</table>
</div>
</div>
- <div class="col-md-4">
- <p><h3>{{ _('Most recurrent words') }}</h3></p>
- {% if articles | count != 0 %}
- <div class="well">{{ tag_cloud | safe }}</div>
- {% endif %}
- </div>
</div>
</div><!-- /.container -->
diff --git a/src/web/templates/feed_list_per_categories.html b/src/web/templates/feed_list_per_categories.html
index 396139a4..34d10ddd 100644
--- a/src/web/templates/feed_list_per_categories.html
+++ b/src/web/templates/feed_list_per_categories.html
@@ -1,12 +1,12 @@
<div class="row">
- <div class="col-md-6">
+ <div class="col-md-8">
<form class="form-inline">
<div class="form-group">
<label>Filter per category</label>
- <select class="form-control" id="category-select" name="category_id">
+ <select class="form-control" id="category-select" name="category_id">
<option value="0">All</option>
{% for category in user.categories %}
- <option value="{{category.id}}" {% if category.id==selected_category_id %}selected{% endif %}>{{ category.name }}</option>
+ <option value="{{category.id}}" {% if category.id==selected_category_id %}selected{% endif %}>{{ category.name }}</option>
{% endfor %}
</select>
<button type="submit" class="btn btn-primary mb-2">OK</button>
diff --git a/src/web/views/feed.py b/src/web/views/feed.py
index 297b5521..873e1eb6 100644
--- a/src/web/views/feed.py
+++ b/src/web/views/feed.py
@@ -43,8 +43,6 @@ def feed_view(feed_id=None, user_id=None):
articles = ArticleController(user_id) \
.read(feed_id=feed_id) \
.order_by(desc("date")).all()
- top_words = misc_utils.top_words(articles, n=50, size=int(word_size))
- tag_cloud = misc_utils.tag_cloud(top_words)
today = datetime.now()
try:
@@ -61,10 +59,9 @@ def feed_view(feed_id=None, user_id=None):
return render_template('feed.html',
head_titles=[utils.clear_string(feed.title)],
- feed=feed, articles=articles,
- tag_cloud=tag_cloud,
+ feed=feed, category=category,
first_post_date=first_article,
- end_post_date=last_article, category=category,
+ end_post_date=last_article,
average=average, delta=delta, elapsed=elapsed)
bgstack15