Add permanent button to the header for creating a new event. Direct users to crete a new team if they don't have one yet

This commit is contained in:
Michael Hall 2018-05-17 21:57:00 -04:00
parent 0690d85f92
commit 50e90788f9
2 changed files with 5 additions and 0 deletions

View file

@ -60,6 +60,9 @@
{% endcomment %}
</ul>
<ul class="navbar-nav">
<li class="nav-item active">
<a class="btn btn-primary" href="{% url 'create-event-team-select' %}"><i class="fa fa fa-calendar-plus-o"></i> Host a Get Together</a>
</li>
{% if request.user.is_authenticated %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarUserMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">

View file

@ -97,6 +97,8 @@ def show_series(request, series_id, series_slug):
@login_required
def create_event_team_select(request):
teams = request.user.profile.moderating
if len(teams) == 0:
return redirect('create-team')
if len(teams) == 1:
return redirect('create-event', team_id=teams[0].id)