fixed teams box to only show when content is available to show
This commit is contained in:
		
							parent
							
								
									a9aff9d637
								
							
						
					
					
						commit
						b6d97c9118
					
				
					 1 changed files with 49 additions and 48 deletions
				
			
		|  | @ -122,53 +122,54 @@ | ||||||
|             </p> |             </p> | ||||||
|         </div> |         </div> | ||||||
|     </div> |     </div> | ||||||
| 
 |      | ||||||
|     <div class="dashboard-panel"> |     {% available_teams as available_teams %} | ||||||
|         <div class="dashboard-panel-header"> |     {% if user.memberships.exists or available_teams %} | ||||||
|             <i class="icon-group"></i> |         <div class="dashboard-panel"> | ||||||
|             <h3>{% trans "Teams" %}</h3> |             <div class="dashboard-panel-header"> | ||||||
|  |                 <i class="icon-group"></i> | ||||||
|  |                 <h3>{% trans "Teams" %}</h3> | ||||||
|  |             </div> | ||||||
|  |              | ||||||
|  |             <div class="dashboard-panel-content"> | ||||||
|  |                 {% if user.memberships.exists %} | ||||||
|  |                     <h4>Your Teams</h4> | ||||||
|  |                     <table class="table table-striped"> | ||||||
|  |                         {% for membership in user.memberships.all %} | ||||||
|  |                             <tr> | ||||||
|  |                                 <td> | ||||||
|  |                                     <a href="{% url team_detail membership.team.slug %}">{{ membership.team.name }}</a> | ||||||
|  |                                     {% if membership.team.description %}<br>{{ membership.team.description }}{% endif %} | ||||||
|  |                                 </td> | ||||||
|  |                                 <td> | ||||||
|  |                                     <span class="label{% if membership.state == 'invited' %} label-info{% endif %}">{{ membership.get_state_display }}</span> | ||||||
|  |                                 </td> | ||||||
|  |                                 <td> | ||||||
|  |                                     {% if membership.state == "manager" or user.is_staff %} | ||||||
|  |                                         {% if membership.team.applicants %}{{ membership.team.applicants.count }} applicant{{ membership.team.applicants.count|pluralize }}{% endif %} | ||||||
|  |                                     {% endif %} | ||||||
|  |                                 </td> | ||||||
|  |                             </tr> | ||||||
|  |                         {% endfor %} | ||||||
|  |                     </table> | ||||||
|  |                 {% endif %} | ||||||
|  |                 {% if available_teams %} | ||||||
|  |                     <h4>Available Teams</h4> | ||||||
|  |                     <table class="table table-striped"> | ||||||
|  |                         {% for team in available_teams %} | ||||||
|  |                             <tr> | ||||||
|  |                                 <td> | ||||||
|  |                                     <a href="{% url team_detail team.slug %}">{{ team }}</a> | ||||||
|  |                                     {% if team.description %}<br>{{ team.description }}{% endif %} | ||||||
|  |                                 </td> | ||||||
|  |                                 <td> | ||||||
|  |                                     <span class="label">{{ team.get_access_display }}</span> | ||||||
|  |                                 </td> | ||||||
|  |                             </tr> | ||||||
|  |                         {% endfor %} | ||||||
|  |                     </table> | ||||||
|  |                 {% endif %} | ||||||
|  |             </div> | ||||||
|         </div> |         </div> | ||||||
|          |     {% endif %} | ||||||
|         <div class="dashboard-panel-content"> |  | ||||||
|             {% if user.memberships.exists %} |  | ||||||
|                 <h4>Your Teams</h4> |  | ||||||
|                 <table class="table table-striped"> |  | ||||||
|                     {% for membership in user.memberships.all %} |  | ||||||
|                         <tr> |  | ||||||
|                             <td> |  | ||||||
|                                 <a href="{% url team_detail membership.team.slug %}">{{ membership.team.name }}</a> |  | ||||||
|                                 {% if membership.team.description %}<br>{{ membership.team.description }}{% endif %} |  | ||||||
|                             </td> |  | ||||||
|                             <td> |  | ||||||
|                                 <span class="label{% if membership.state == 'invited' %} label-info{% endif %}">{{ membership.get_state_display }}</span> |  | ||||||
|                             </td> |  | ||||||
|                             <td> |  | ||||||
|                                 {% if membership.state == "manager" or user.is_staff %} |  | ||||||
|                                     {% if membership.team.applicants %}{{ membership.team.applicants.count }} applicant{{ membership.team.applicants.count|pluralize }}{% endif %} |  | ||||||
|                                 {% endif %} |  | ||||||
|                             </td> |  | ||||||
|                         </tr> |  | ||||||
|                     {% endfor %} |  | ||||||
|                 </table> |  | ||||||
|             {% endif %} |  | ||||||
|             {% available_teams as available_teams %} |  | ||||||
|             {% if available_teams %} |  | ||||||
|                 <h4>Available Teams</h4> |  | ||||||
|                 <table class="table table-striped"> |  | ||||||
|                     {% for team in available_teams %} |  | ||||||
|                         <tr> |  | ||||||
|                             <td> |  | ||||||
|                                 <a href="{% url team_detail team.slug %}">{{ team }}</a> |  | ||||||
|                                 {% if team.description %}<br>{{ team.description }}{% endif %} |  | ||||||
|                             </td> |  | ||||||
|                             <td> |  | ||||||
|                                 <span class="label">{{ team.get_access_display }}</span> |  | ||||||
|                             </td> |  | ||||||
|                         </tr> |  | ||||||
| 
 |  | ||||||
|                     {% endfor %} |  | ||||||
|                 </table> |  | ||||||
|             {% endif %} |  | ||||||
|         </div> |  | ||||||
|     </div> |  | ||||||
| {% endblock %} | {% endblock %} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Brian Rosner
						Brian Rosner