~sircmpwn/hub.sr.ht

060b91237b71d582ba9b7f35410317e03062d74c — Drew DeVault a month ago c34944b 0.13.17
Remove popular tags
2 files changed, 1 insertions(+), 22 deletions(-)

M hubsrht/blueprints/public.py
M hubsrht/templates/project-index.html
M hubsrht/blueprints/public.py => hubsrht/blueprints/public.py +1 -11
@@ 73,19 73,9 @@ def project_index():
            .order_by(Feature.created.desc())
            .limit(5)).all()

    tags = db.engine.execute("""
        SELECT count(*) count, unnest(tags) tag
        FROM project
        GROUP BY tag
        ORDER BY count DESC
        LIMIT 12;
    """)
    tags = [(row[0], row[1]) for row in tags]

    return render_template("project-index.html", projects=projects,
            search=search, features=features, sort=sort, **pagination,
            search_keys=["sort"], search_error=search_error,
            tags=tags)
            search_keys=["sort"], search_error=search_error)

@public.route("/projects/featured")
def featured_projects():

M hubsrht/templates/project-index.html => hubsrht/templates/project-index.html +0 -11
@@ 111,17 111,6 @@
          class="btn btn-default btn-block"
        >More featured projects {{icon('caret-right')}}</a>
      </div>
      <h3>Popular tags</h3>
      <div class="row">
        {% for tag in tags %}
        <div class="col-md-4">
          <a
            href="{{url_for("public.project_index", search="#"+tag[1])}}"
           >#{{tag[1]}}</a>:
          {{tag[0]}} project{% if tag[0] > 1 %}s{% endif %}
        </div>
        {% endfor %}
      </div>
    </div>
  </div>
</div>