Remove popular tags

This commit is contained in:
Drew DeVault 2021-11-28 11:26:59 +01:00
parent c34944b943
commit 060b91237b
2 changed files with 1 additions and 22 deletions

View File

@ -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():

View File

@ -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>