Skip to content

Commit

Permalink
Print order categories
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterCyp committed Jul 21, 2016
1 parent 43280b3 commit e3ecfd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion t411/templates/t411/torrents.html
Expand Up @@ -23,7 +23,7 @@ <h1>Top {{ type_top}} </h1>
</div>


{% for cat , torrents in categories.items %}
{% for cat , torrents in categories %}
<div id="tab-{{ cat|stripspace|stripaccents }}">
{% if search %}
<h2><a href="{% url "t411:search" search torrents.0.category %}">{% bootstrap_icon "search" %}</a> {{ cat }} </h2>
Expand Down
4 changes: 4 additions & 0 deletions t411/views.py
Expand Up @@ -250,6 +250,10 @@ def mise_en_forme(torrents):
else: categories[torrent['categoryname']] = [torrent]

btnCat = sorted(categories.keys())

categories = categories.items()
categories = sorted(categories, key=lambda x: x[0])

return categories,btnCat

def duree_ecoulee(date_from):
Expand Down

0 comments on commit e3ecfd8

Please sign in to comment.