~cedric/newspipe

b46dccd8d8d85fb2a1d304ff239cdfcbcdc6bcb3 — Cédric Bonhomme 2 years ago 436232d
Removed tag cloud from the public feed page.
M src/conf.py => src/conf.py +1 -0
@@ 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')


M src/conf/conf.cfg-sample => src/conf/conf.cfg-sample +1 -0
@@ 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]

M src/runserver.py => src/runserver.py +1 -1
@@ 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)

M src/web/templates/feed.html => src/web/templates/feed.html +2 -8
@@ 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 -->

M src/web/templates/feed_list_per_categories.html => src/web/templates/feed_list_per_categories.html +3 -3
@@ 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>

M src/web/views/feed.py => src/web/views/feed.py +2 -5
@@ 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)