Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactored competition. Added more error checking, fixed so it works …

…with the participant model, urlified.
  • Loading branch information...
commit e076e550c4e16276044a24fb61e6638ed412134d 1 parent 560a9b6
@melwil melwil authored
View
3  studlan/competition/admin.py
@@ -1,7 +1,8 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.contrib import admin
-from competition.models import Activity, Competition
+from competition.models import Activity, Competition, Participant
admin.site.register(Activity)
admin.site.register(Competition)
+admin.site.register(Participant)
View
48 studlan/competition/models.py
@@ -16,6 +16,10 @@ class Activity(models.Model):
def __unicode__(self):
return self.title
+ @models.permalink
+ def get_absolute_url(self):
+ return ('activity_details', (), {'activity_id': self.id})
+
class Meta:
ordering = ['title']
verbose_name = 'activity'
@@ -53,7 +57,7 @@ class Competition(models.Model):
'blockquote>')
def __unicode__(self):
- return self.activity.title + " " + self.title
+ return self.title
def get_teams(self):
if self.use_teams:
@@ -61,6 +65,29 @@ def get_teams(self):
else:
return None
+ def get_users(self):
+ return map(lambda x: getattr(x, 'user'), Participant.objects.filter(competition=self))
+
+ def get_participants(self):
+ participants = Participant.objects.filter(competition=self)
+ teams = []
+ users = []
+ for participant in participants:
+ if participant.is_team():
+ teams.append(participant.team)
+ else:
+ users.append(participant.user)
+
+ return teams, users
+
+ def has_participant(self, user):
+ if user in self.get_users():
+ return True
+ if self.use_teams:
+ for team in self.get_teams():
+ if user == team.leader or user in team.members.all():
+ return True
+
def status_text(self):
return self.STATUS_OPTIONS[self.status - 1][1]
@@ -70,6 +97,10 @@ def status_text_verbose(self):
def status_label(self):
return self.statuses[self.status][1]
+ @models.permalink
+ def get_absolute_url(self):
+ return ('competition_details', (), {'competition_id': self.id})
+
class Meta:
ordering = ['status', 'title']
@@ -79,19 +110,20 @@ class Participant(models.Model):
competition = models.ForeignKey(Competition)
def __unicode__(self):
- if user:
- return user.get_full_name()
+ if self.user:
+ return self.user.get_full_name()
else:
- return team.title
+ return str(self.team)
- def get_participant(self):
- if user:
- return user
+ def is_team(self):
+ if self.user:
+ return False
else:
- return team
+ return True
class Meta:
unique_together = (
('user', 'competition',),
('team', 'competition',),
)
+ ordering = ['user', 'team']
View
3  studlan/competition/templatetags/competitions.py → studlan/competition/templatetags/competition_tags.py
@@ -10,6 +10,9 @@
#--- For competition ---
+@register.inclusion_tag('competition/competition_tabs.html')
+def competition_tabs(activities, active):
+ return {'activities': activities, 'active': active}
#--- For sidebar ---
View
22 studlan/competition/urls.py
@@ -3,14 +3,16 @@
from django.conf.urls.defaults import patterns, url
-urlpatterns = patterns(
- 'studlan.competition.views',
+urlpatterns = patterns('studlan.competition.views',
+ # Main comp oversight
url(r'^$', 'main', name='competitions'),
- url(r'^(?P<competition_id>\d+)/$', 'single', name='competition'),
- url(r'^(?P<competition_id>\d+)/join.html', 'join'),
- url(r'^(?P<competition_id>\d+)/leave.html', 'leave'),
- url(r'^(?P<competition_id>\d+)/forfeit.html', 'forfeit'),
- url(r'^(?P<competition_id>\d+)/join_team.html', 'join_team'),
- url(r'^(?P<competition_id>\d+)/leave_team.html', 'leave_team'),
- url(r'^(?P<competition_id>\d+)/forfeit_team.html', 'forfeit_team'),
- )
+
+ # Competition related
+ url(r'^(?P<competition_id>\d+)/$', 'competition_details', name='competition_details'),
+ url(r'^(?P<competition_id>\d+)/join/', 'join', name='join_comp'),
+ url(r'^(?P<competition_id>\d+)/leave/', 'leave', name='leave_comp'),
+ url(r'^(?P<competition_id>\d+)/forfeit/', 'forfeit', name='forfeit_comp'),
+
+ # Activiy related
+ url(r'^activity/(?P<activity_id>\d+)/$', 'activity_details', name='activity_details'),
+)
View
204 studlan/competition/views.py
@@ -4,123 +4,155 @@
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
+from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import render_to_response, render, redirect, get_object_or_404
from django.template.context import RequestContext
-from studlan.competition.models import Activity, Competition
+from studlan.competition.models import Activity, Competition, Participant
+from studlan.team.models import Team
def main(request):
+ context = {}
competitions = Competition.objects.all()
- activities = Activity.objects.all()
+ competitions = shorten_descriptions(competitions, 200)
- for c in competitions:
- if len(c.desc) >= 200:
- c.desc = c.desc[:197] + '...'
+ context['activities'] = Activity.objects.all()
+ context['competitions'] = competitions
+ context['active'] = 'all'
- tab = request.GET.get('tab')
- if tab is None or tab == '':
- tab = 'all'
+ breadcrumbs = (
+ ('studLAN', '/'),
+ ('Competitions', ''),
+ )
+ context['breadcrumbs'] = breadcrumbs
- return render_to_response('competitions.html',
- {'competitions': competitions,
- 'activities': activities,
- 'current_tab': tab},
- context_instance=RequestContext(request))
+ return render(request, 'competition/competitions.html', context)
+def activity_details(request, activity_id):
+ activity = get_object_or_404(Activity, pk=activity_id)
+
+ context = {}
+ competitions = Competition.objects.filter(activity=activity)
+ competitions = shorten_descriptions(competitions, 200)
-def single(request, competition_id):
- competition = get_object_or_404(Competition, pk=competition_id)
+ context['active'] = activity.id
+ context['activities'] = Activity.objects.all()
+ context['competitions'] = competitions
- if not 'http' in competition.activity.image_url:
- competition.activity.image_url = 'http://placehold.it/150x150'
+ breadcrumbs = (
+ ('studLAN', '/'),
+ ('Competitions', reverse('competitions')),
+ (activity, ''),
+ )
+ context['breadcrumbs'] = breadcrumbs
- if request.user.is_authenticated():
- leader_of_teams = Team.objects.filter(leader=request.user)
+ return render(request, 'competition/competitions.html', context)
- teams_in_competition = []
- teams_not_in_competition = []
+def shorten_descriptions(competitions, length):
+ for c in competitions:
+ if len(c.desc) > length:
+ c.desc = c.desc[:length-3] + '...'
+ return competitions
- for x in leader_of_teams:
- if x in competition.teams.all():
- teams_in_competition.append(x)
- else:
- teams_not_in_competition.append(x)
-
- has_teams_in_competition = len(teams_in_competition) > 0
- has_teams_not_in_competition = len(teams_not_in_competition) \
- > 0 and not has_teams_in_competition
- is_leader = len(leader_of_teams) > 0
-
- return render_to_response('competition.html', {
- 'competition': competition,
- 'is_leader': is_leader,
- 'has_teams_in_competition': has_teams_in_competition,
- 'has_teams_not_in_competition': has_teams_not_in_competition,
- 'teams_in_competition': teams_in_competition,
- 'teams_not_in_competition': teams_not_in_competition,
- }, context_instance=RequestContext(request))
- else:
+def competition_details(request, competition_id):
+ context = {}
- return render_to_response('competition.html',
- {'competition': competition},
- context_instance=RequestContext(request))
+ competition = get_object_or_404(Competition, pk=competition_id)
+ breadcrumbs = (
+ ('studLAN', '/'),
+ ('Competitions', reverse('competitions')),
+ (competition.activity, reverse('activity_details', kwargs={'activity_id': competition.activity.id})),
+ (competition, ''),
+ )
+
+ context['competition'] = competition
+ context['breadcrumbs'] = breadcrumbs
+ teams, users = competition.get_participants()
-def join(request, competition_id):
- competition = get_object_or_404(Competition, pk=request.POST['id'])
- competition.participants.add(request.user)
- messages.add_message(request, messages.WARNING,
- 'You\'re now participating in %s.'
- % competition.title)
- return redirect('competition', competition_id=competition_id)
+ context['teams'] = teams
+ context['users'] = users
+ context['participating'] = competition.has_participant(request.user)
+ # Insert placeholder image if the image_url is empty
+ if not competition.activity.image_url:
+ competition.activity.image_url = 'http://placehold.it/150x150'
-def leave(request, competition_id):
- competition = get_object_or_404(Competition, pk=request.POST['id'])
- competition.participants.remove(request.user)
- messages.add_message(request, messages.WARNING,
- 'You\'re no longer participating in %s.'
- % competition.title)
- return redirect('competition', competition_id=competition_id)
+ if request.user.is_authenticated():
+ owned_teams = Team.objects.filter(leader=request.user)
+ context['owned_teams'] = owned_teams
-def forfeit(request, competition_id):
- competition = get_object_or_404(Competition, pk=competition_id)
- messages.add_message(request, messages.ERROR,
- 'Forfeit not yet implemented!')
- return redirect('competition', competition_id=competition_id)
-
+ return render(request, 'competition/competition.html', context)
+
+ else:
+ return render(request, 'competition/competition.html', context)
-def join_team(request, competition_id):
+@login_required
+def join(request, competition_id):
competition = get_object_or_404(Competition, pk=competition_id)
- num = request.POST['team']
- team = Team.objects.filter(id=int(num))
- competition.teams.add(int(num))
- messages.add_message(request, messages.SUCCESS,
- "You're now participating in %s with the team."
- % competition.title)
- return redirect('competition', competition_id=competition_id)
-
+ teams, users = competition.get_participants()
+
+ # Checks if the user is already in the competition
+ if request.user in users:
+ messages.error(request, "You are already in this competition as a solo player.")
+ return redirect(competition)
+ for team in teams:
+ if request.user == team.leader or request.user in team.members.all():
+ messages.error(request, "You are already in this competition with %s." % team)
+ return redirect(competition)
+
+ # Checks that a form was posted, and if it contains a team id.
+ if request.method == 'POST':
+ team_id = request.POST.get('team')
+ if team_id:
+ team = get_object_or_404(Team, pk=team_id)
+ participant = Participant(team=team, competition=competition)
+ participant.save()
+ else:
+ participant = Participant(user=request.user, competition=competition)
+ participant.save()
+
+ messages.success(request, "You have entered %s for this competition." % participant)
+ return redirect(competition)
-def leave_team(request, competition_id):
+@login_required
+def leave(request, competition_id):
competition = get_object_or_404(Competition, pk=competition_id)
- num = request.POST['team']
- competition.teams.remove(int(num))
- messages.add_message(request, messages.WARNING,
- "You're no longer participating in %s with "
- "the team." % competition.title)
- return redirect('competition', competition_id=competition_id)
-
-def forfeit_team(request, competition_id):
+ # If not participating, do nothing
+ if not competition.has_participant(request.user):
+ messages.error(request, "You are not participating in this competition.")
+ else:
+ if request.method == 'POST':
+ if request.user in competition.get_users():
+ participant = Participant.objects.get(user=request.user, competition=competition)
+ participant.delete()
+ messages.success(request, "You are no longer participating in %s." % competition)
+ else:
+ was_leader = False
+ for team in competition.get_teams():
+ if request.user == team.leader:
+ was_leader = True
+ participant = Participant.objects.get(team=team, competition=competition)
+ participant.delete()
+ messages.success(request, "You are have removed %s from %s." % (team, competition))
+ if not was_leader:
+ messages.error(request, "You cannot remove %s from %S, you are not the team leader." % (team, competition))
+
+ return redirect(competition)
+
+@login_required
+def forfeit(request, competition_id):
competition = get_object_or_404(Competition, pk=competition_id)
- messages.add_message(request, messages.ERROR,
- 'Forfeit not yet implemented!')
- return redirect('competition', competition_id=competition_id)
-
+ messages.error(request, 'Forfeit not yet implemented!')
+ return redirect(competition)
+# TODO
+# Mode these view out of competition and into auth,
+# and make some kind of fallback on the plain forms
def log_in(request):
username = password = ''
if request.POST:
View
145 studlan/themes/standard/templates/competition.html
@@ -1,145 +0,0 @@
-{% extends "base.html" %}
-{% load markup %}
-
-{% block title %}
-studLAN - Competition - {{ competition.title }}
-{% endblock title %}
-
-{% block navigation %}
- <ul class="nav">
- <li><a href="{% url root %}">News</a></li>
- {% if request.user.is_authenticated %}
- <li><a href="{% url myprofile %}">Profile</a></li>
- {% endif %}
- <li class="active"><a href="{% url competitions %}">Competitions</a></li>
- <li><a href="{% url teams %}">Teams</a></li>
- </ul>
-{% endblock navigation %}
-
-{% block content %}
- <div class="content">
- <h2>{{ competition.title }}</h2>
-
- <ul class="breadcrumb">
- <li><a href="{% url root %}">studLAN</a> <span class="divider">/</span></li>
- <li><a href="{% url competitions %}">Competitions</a> <span class="divider">/</span></li>
- <li><a href="{% url competitions %}?tab={{ competition.activity.title }}">{{ competition.activity.title }}</a> <span class="divider">/</span></li>
- <li class="active">{{ competition.title }}</li>
- </ul>
- {% if not user.is_authenticated %}
- <div class="alert-message fade in {{ message.tags }}" data-alert>
- <a class="close" href="#">x</a>
- <p>Please log in to register for the competition.</p>
- </div>
- {% endif %}
- <p>
- <span class="label {{ competition.status_label }}">{{ competition.status_text_verbose }}</span>
- <a href="#" class="label info" rel="popover" data-placement="below" data-html="true" data-content="{{ competition.activity.desc|markdown }}" data-original-title="{{ competition.activity.title }}">{{ competition.activity.title }}</a>
- </p>
- <div class="activity_image" style="background: url('{{ competition.activity.image_url }}');"></div>
- <br />
-
- {% if competition.use_teams %}
- <h3>Participating teams</h3>
- <table class="zebra-striped">
- <thead><th>Team</th><th>Leader</th></thead>
- <tbody>
- {% for team in competition.get_teams %}
- <tr>
- <td>[{{ team.tag }}] {{ team.title }}</td>
- <td>{{ team.leader }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% else %}
- <h3>Participants</h3>
- <ul>
- {% for participant in competition.participants.all %}
- <li>{{ participant.username }}</li>
- {% endfor %}
- </ul>
- {% endif %}
-
- {% if user.is_authenticated and not competition.use_teams %}
- <p>
- {% if competition.status == 1 %}
- {% if user not in competition.participants.all %}
- <form action="/competitions/{{ competition.id }}/join.html" method="POST">
- {% csrf_token %}
- <input type="hidden" name="id" value="{{ competition.id }}" />
- <input type="submit" class="btn large success" value="Join competition" />
- </form>
- {% else %}
- <form action="/competitions/{{ competition.id }}/leave.html" method="POST">
- {% csrf_token %}
- <input type="hidden" name="id" value="{{ competition.id }}" />
- <input type="submit" class="btn large danger" value="Leave competition" />
- </form>
- {% endif %}
- {% endif %}
- {% if competition.status == 3 %}
- <!-- not implemented...
- <a class="btn large danger" href="/competitions/{{ competition.id }}/forfeit.html">Forfeit competition</a>
- -->
- {% endif %}
- </p>
- {% endif %}
- {% if user.is_authenticated and competition.use_teams and is_leader %}
- <br/>
- <p>
- {% if competition.status == 1 %}
-
- {% if has_teams_not_in_competition %}
- <form action="/competitions/{{ competition.id }}/join_team.html" method="POST">
- {% csrf_token %}
- <select name="team" id="team">
- {% for team in teams_not_in_competition %}
- <option value="{{ team.id }}">[{{ team.tag }}]{{ team.title }}</option>
- {% endfor %}
- </select>
- <input class="btn success" type="submit" value="Join competition"/>
- </form>
- {% endif %}
-
- {% if has_teams_in_competition %}
- <form action="/competitions/{{ competition.id }}/leave_team.html" method="POST">
- {% csrf_token %}
- <select name="team" id="team">
- {% for team in teams_in_competition %}
- <option value="{{ team.id }}">[{{ team.tag }}]{{ team.title }}</option>
- {% endfor %}
- </select>
- <input class="btn danger" type="submit" value="Leave competition"/>
- </form>
- {% endif %}
-
- {% endif %}
- {% if competition.status == 3 %}
-
- {% if has_teams_in_competition %}
- <form action="/competitions/{{ competition.id }}/forfeit_team.html" method="POST">
- {% csrf_token %}
- <select name="team" id="team">
- {% for team in teams_in_competition %}
- <option value="{{ team.id }}">[{{ team.tag }}]{{ team.title }}</option>
- {% endfor %}
- </select>
- <input class="btn danger" type="submit" value="Forfeit competition"/>
- </form>
- {% endif %}
-
- {% endif %}
- </p>
- {% endif %}
- <h3>Description</h3>
- <p>{{ competition.desc|markdown }}</p>
- <ul class="breadcrumb">
- <li><a href="{% url root %}">studLAN</a> <span class="divider">/</span></li>
- <li><a href="{% url competitions %}">Competitions</a> <span class="divider">/</span></li>
- <li><a href="{% url competitions %}?tab={{ competition.activity.title }}">{{ competition.activity.title }}</a> <span class="divider">/</span></li>
- <li class="active">{{ competition.title }}</li>
- </ul>
-
- </div>
-{% endblock content %}
View
92 studlan/themes/standard/templates/competition/competition.html
@@ -0,0 +1,92 @@
+{% extends "competition/competition_base.html" %}
+{% load markup %}
+
+{% block title %}
+studLAN - Competition - {{ competition.title }}
+{% endblock title %}
+
+{% block content %}
+ <div class="content">
+ {% if not user.is_authenticated %}
+ <div class="alert-message fade in {{ message.tags }}" data-alert>
+ <a class="close" href="#">x</a>
+ <p>Please log in to register for the competition.</p>
+ </div>
+ {% endif %}
+
+ <h2>{{ competition }}</h2>
+
+ <p>
+ <span class="label {{ competition.status_label }}">{{ competition.status_text_verbose }}</span>
+ <a href="#" class="label info" rel="popover" data-placement="below" data-html="true" data-content="{{ competition.activity.desc|markdown }}" data-original-title="{{ competition.activity.title }}">{{ competition.activity.title }}</a>
+ </p>
+ <div class="activity_image" style="background: url('{{ competition.activity.image_url }}');"></div>
+ <br />
+
+ {% comment %}
+ Show participating teams
+ {% endcomment %}
+ {% if teams|length > 0 %}
+ <h3>Participating teams</h3>
+ <table class="zebra-striped">
+ <thead><th>Team</th><th>Leader</th></thead>
+ <tbody>
+ {% for team in teams %}
+ <tr>
+ <td>{{ team }}</td>
+ <td>{{ team.leader }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endif %}
+ {% if users %}
+ <h3>Participants{% if teams %} without a team{% endif %}</h3>
+ <ul>
+ {% for user in users %}
+ <li><a href="{% url profile user %}">{{ user }}</a></li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+
+ {% comment %}
+ Participation form
+ {% endcomment %}
+ <hr />
+ {% if user.is_authenticated %}
+ {% if competition.status == 1 %}
+ <p>
+ {% if not participating %}
+ {% if competition.use_teams and owned_teams|length > 0 %}
+ <form action="{% url join_comp competition.id %}" method="POST">
+ {% csrf_token %}
+ <select name="team" id="team">
+ {% for team in owned_teams %}
+ <option value="{{ team.id }}">{{ team }}</option>
+ {% endfor %}
+ </select>
+ <input class="btn success" type="submit" value="Join competition (team)"/>
+ </form>
+ {% endif %}
+ <form action="{% url join_comp competition.id %}" method="POST">{% csrf_token %}
+ <input type="submit" class="btn success" value="Join competition (solo)" />
+ </form>
+ {% else %}
+ <form action="{% url leave_comp competition.id %}" method="POST">
+ {% csrf_token %}
+ <input type="submit" class="btn danger" value="Leave competition" />
+ </form>
+ {% endif %}
+ </p>
+ {% endif %}
+ {% if competition.status == 3 %}
+ <!-- not implemented...
+ <a class="btn large danger" href="/competition/{{ competition.id }}/forfeit.html">Forfeit competition</a>
+ -->
+ {% endif %}
+ {% endif %}
+ <h3>Description</h3>
+ <p>{{ competition.desc|markdown }}</p>
+
+ </div>
+{% endblock content %}
View
16 studlan/themes/standard/templates/competition/competition_base.html
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+
+{% block title %}
+studLAN - Competitions
+{% endblock title %}
+
+{% block navigation %}
+ <ul class="nav">
+ <li><a href="{% url root %}">News</a></li>
+ {% if request.user.is_authenticated %}
+ <li><a href="{% url myprofile %}">Profile</a></li>
+ {% endif %}
+ <li class="active"><a href="{% url competitions %}">Competitions</a></li>
+ <li><a href="{% url teams %}">Teams</a></li>
+ </ul>
+{% endblock navigation %}
View
10 studlan/themes/standard/templates/competition/competition_tabs.html
@@ -0,0 +1,10 @@
+<ul class="tabs">
+ <li{% if active == 'all' %} class="active"{% endif %}><a href="{% url competitions %}">All</a></li>
+ {% for activity in activities %}
+ {% if active == activity.id %}
+ <li class="active"><a href="{{ activity.get_absolute_url }}">{{ activity }}</a></li>
+ {% else %}
+ <li><a href="{{ activity.get_absolute_url }}">{{ activity.title }}</a></li>
+ {% endif %}
+ {% endfor %}
+</ul>
View
28 studlan/themes/standard/templates/competition/competitions.html
@@ -0,0 +1,28 @@
+{% extends "competition/competition_base.html" %}
+{% load markup %}
+{% load competition_tags %}
+
+{% block content %}
+ <div class="content">
+ <h1>Competitions</h1>
+
+ {% competition_tabs activities active %}
+
+ <table class="zebra-striped">
+ <thead><th>Status</th><th>Title</th></thead>
+ <tbody>
+ {% for c in competitions %}
+ <tr>
+ <td>{{ c.status_text }}</td>
+ <td>
+ <a href="{% url competition_details c.id %}">{{ c }}</a>
+ {% if c.use_teams %}
+ - Team competition
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+{% endblock content %}
View
57 studlan/themes/standard/templates/competitions.html
@@ -1,57 +0,0 @@
-{% extends "base.html" %}
-{% load markup %}
-
-{% block title %}
-studLAN - Competitions
-{% endblock title %}
-
-{% block navigation %}
- <ul class="nav">
- <li><a href="{% url root %}">News</a></li>
- {% if request.user.is_authenticated %}
- <li><a href="{% url myprofile %}">Profile</a></li>
- {% endif %}
- <li class="active"><a href="{% url competitions %}">Competitions</a></li>
- <li><a href="{% url teams %}">Teams</a></li>
- </ul>
-{% endblock navigation %}
-
-{% block content %}
- <div class="content">
- <h1>Competitions</h1>
-
- <ul class="tabs">
- {% if current_tab == 'all' %}
- <li class="active"><a href="{% url competitions %}">All</a></li>
- {% else %}
- <li><a href="{% url competitions %}">All</a></li>
- {% endif %}
- {% for a in activities %}
- {% if current_tab == a.title %}
- <li class="active"><a href="?tab={{ a.title }}">{{ a.title }}</a></li>
- {% else %}
- <li><a href="?tab={{ a.title }}">{{ a.title }}</a></li>
- {% endif %}
- {% endfor %}
- </ul>
-
- <table class="zebra-striped">
- <thead><th>Status</th><th>Title</th></thead>
- <tbody>
- {% for c in competitions %}
- {% if current_tab == 'all' or current_tab == c.activity.title %}
- <tr>
- <td>{{ c.status_text }}</td>
- <td>
- <a href="{% url competition c.id %}">{{ c }}</a>
- {% if c.use_teams %}
- - Team competition
- {% endif %}
- </td>
- </tr>
- {% endif %}
- {% endfor %}
- </tbody>
- </table>
- </div>
-{% endblock content %}
View
2  studlan/urls.py
@@ -18,7 +18,7 @@
# app urls
url(r'^auth/', include('studlan.authentication.urls')),
- url(r'^competitions/', include('studlan.competition.urls')),
+ url(r'^competition/', include('studlan.competition.urls')),
url(r'^news/', include('studlan.news.urls')),
url(r'^profile/', include('studlan.userprofile.urls')),
url(r'^team/', include('studlan.team.urls')),
Please sign in to comment.
Something went wrong with that request. Please try again.