Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show a summary of most worn tshirts on homepage
There can be an interesting difference between all-time-most-worn and recently-most-worn, so show both, where 'recently' is roughly six months.
- Loading branch information
Showing
3 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
{% extends "wearers/base.html" %} | ||
|
||
{% block content %} | ||
<h1>{{wearer}}</h1> | ||
<h2>recent</h2> | ||
<h2>most recently worn</h2> | ||
{% for wearing in wearer.wearings.all|slice:':10' %} | ||
<li> | ||
<a href='{{wearing.clothing.static_site_url}}'>{{wearing.clothing}}</a> | ||
on {{wearing.day}} | ||
</li> | ||
{% endfor %} | ||
|
||
<h2>has worn</h2> | ||
{% for clothing in wearer.has_worn.all %} | ||
<li><a href='{{clothing.static_site_url}}'>{{clothing}}</a></li> | ||
<h2>most worn in the last six months</h2> | ||
{% for worn in wearer.most_worn_recently|slice:':12' %} | ||
<li><a href='{{worn.clothing.static_site_url}}'>{{worn.clothing}}</a> worn {{worn.num_worn}} times</li> | ||
{% endfor %} | ||
|
||
<h2>most worn of all all time</h2> | ||
{% for worn in wearer.most_worn|slice:':12' %} | ||
<li><a href='{{worn.clothing.static_site_url}}'>{{worn.clothing}}</a> worn {{worn.num_worn}} times</li> | ||
{% endfor %} | ||
{% endblock %} |