Minor upgrades

clubs
Laurent 2 years ago
parent 88ca6f4bc4
commit 5b953494cf
  1. 5
      tournaments/static/tournaments/css/style.css
  2. 2
      tournaments/templates/tournaments/match_cell.html
  3. 4
      tournaments/templates/tournaments/summon_row.html
  4. 2
      tournaments/templates/tournaments/tournament_row.html
  5. 50
      tournaments/views.py

@ -153,6 +153,9 @@ tr {
font-size: 18px;
/* color: #707070; */
}
.semibold {
font-weight: 600;
}
.info {
font-family: "Montserrat-SemiBold";
@ -431,7 +434,7 @@ tr {
.table-row-5-colums {
display: grid;
grid-template-columns: 60px auto 60px 60px 130px;
grid-template-columns: 60px auto 50px 70px 130px;
align-items: center; /* Vertically center the content within each column */
padding: 5px 0px;
}

@ -21,7 +21,7 @@
<div class="table-cell table-cell-large horizontal-padding">
{% for name in team.names %}
<div class="{% if team.is_winner %}winner{% endif %}">
<div class="semibold {% if team.is_winner %}winner{% endif %}">
{{ name }}
</div>
{% endfor %}

@ -5,13 +5,13 @@
<img class="team_image horizontal-margin" src="{% static 'tournaments/images/pc_icon_round_200.png' %}" />
</div>
<!-- <img src="{% static 'tournaments/images/{{ team_call.image }}' %}" class="team_image horizontal-margin"> -->
<div class="table-cell table-cell-large tight">
<div class="table-cell table-cell-large semibold">
{% for name in summon.names %}
<div>{{ name }}</div>
{% endfor %}
</div>
<div class="table-cell">{{ summon.weight }}</div>
<div class="table-cell large">{{ summon.date|date:'H:i' }}</div>
<div class="table-cell large center">{{ summon.date|date:'H:i' }}</div>
<div class="table-cell"><div class="mybox center">{{ summon.stage }}</div></div>
</div>

@ -5,7 +5,7 @@
<div class="large">{{ tournament.level }}</div>
<div class="small">{{ tournament.category }}</div>
</div>
<div class="table-cell table-cell-large horizontal-padding">{{ tournament.event.club.name }}</div>
<div class="table-cell table-cell-large horizontal-padding semibold">{{ tournament.event.club.name }}</div>
<div class="table-cell"><div class="mybox">{{ tournament.formatted_start_date }}</div></div>
</div>
</a>

@ -20,13 +20,6 @@ def index(request):
future_tournaments = Tournament.objects.filter(end_date__isnull=True, start_date__gt=today).order_by('start_date')
live_tournaments = Tournament.objects.filter(end_date__isnull=True, start_date__lte=today).order_by('start_date')
ended_tournaments = Tournament.objects.filter(end_date__isnull=False).order_by('start_date')
# template = loader.get_template('tournaments/tournaments.html')
# context = {
# 'future': future_tournaments,
# 'live': live_tournaments,
# 'ended': ended_tournaments,
# }
# return HttpResponse(template.render(context, request))
return render(
request,
"tournaments/tournaments.html",
@ -34,8 +27,7 @@ def index(request):
'future': future_tournaments,
'live': live_tournaments,
'ended': ended_tournaments,
},
content_type="text/html",
}
)
def tournament(request, tournament_id):
@ -43,39 +35,18 @@ def tournament(request, tournament_id):
tournament = get_object_or_404(Tournament, pk=tournament_id)
live_matches = list(tournament.live_matches())
template = loader.get_template('tournaments/matches.html')
context = {
return render(request, 'tournaments/matches.html', {
'matches': live_matches,
}
return HttpResponse(template.render(context, request))
# def tournament(request, tournament_id):
# tournament = get_object_or_404(Tournament, pk=tournament_id)
# today = date.today()
# future_matches = Match.objects.filter(end_date__isnull=True, start_date__gt=today).order_by('start_date')
# live_matches = Match.objects.filter(end_date__isnull=True, start_date__lte=today).order_by('start_date')
# ended_matches = Match.objects.filter(end_date__isnull=False).order_by('start_date')
# template = loader.get_template('tournaments/tournament.html')
# context = {
# 'future': future_matches,
# 'live': live_matches,
# 'ended': ended_matches,
# }
# return HttpResponse(template.render(context, request))
})
def tournament_summons(request, tournament_id):
tournament = get_object_or_404(Tournament, pk=tournament_id)
team_summons = tournament.team_summons()
template = loader.get_template('tournaments/summons.html')
context = {
return render(request, 'tournaments/summons.html', {
'team_summons': team_summons,
}
return HttpResponse(template.render(context, request))
})
def tournament_json(request, tournament_id):
tournament = get_object_or_404(Tournament, pk=tournament_id)
@ -83,17 +54,6 @@ def tournament_json(request, tournament_id):
data = json.dumps(live_matches, default=vars)
return HttpResponse(data, content_type='application/json')
# def index(request):
# club = Club.objects.first()
# live_matches = Match.objects.filter(enddate__isnull=True).order_by('court')
# ended_matches = Match.objects.filter(enddate__isnull=False).order_by('court')
# template = loader.get_template('scores/index.html')
# context = {
# 'club': club,
# 'live_matches': live_matches,
# 'ended_matches': ended_matches,
# }
# return HttpResponse(template.render(context, request))
@api_view(['GET'])
def user_by_token(request):

Loading…
Cancel
Save