Commit e8a874605fc9afa95214ee14701c6e694a6e0b87

Authored by Luan
1 parent 2110d487

Adding verification to only display badges block if one exists

Showing 1 changed file with 14 additions and 12 deletions   Show diff stats
src/accounts/templates/accounts/user_detail.html
@@ -99,20 +99,22 @@ @@ -99,20 +99,22 @@
99 </div> 99 </div>
100 100
101 101
102 - <div class="col-lg-8 col-md-12 col-sm-7">  
103 - <div class="panel panel-default">  
104 - <div class="panel-heading">  
105 - <h3 class="panel-title">{% trans "Badges" %}</h3>  
106 - </div>  
107 - <div class="panel-body">  
108 - <div>  
109 - {% for badge in user_.badge_set.all %}  
110 - <img src="{{ badge.get_badge_url }}" title="{{ badge.description }}" />  
111 - {% endfor %} 102 + {% if user_.badge_set.exists %}
  103 + <div class="col-lg-8 col-md-12 col-sm-7">
  104 + <div class="panel panel-default">
  105 + <div class="panel-heading">
  106 + <h3 class="panel-title">{% trans "Badges" %}</h3>
  107 + </div>
  108 + <div class="panel-body">
  109 + <div>
  110 + {% for badge in user_.badge_set.all %}
  111 + <img src="{{ badge.get_badge_url }}" title="{{ badge.description }}" />
  112 + {% endfor %}
  113 + </div>
112 </div> 114 </div>
113 - </div> 115 + </div>
114 </div> 116 </div>
115 - </div> 117 + {% endif %}
116 118
117 </div> <!-- End of user-profile row --> 119 </div> <!-- End of user-profile row -->
118 120