-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#A15. As Admin, I would like to be able to view the participants of a…
… hackathon (#153)
- Loading branch information
1 parent
0f89acb
commit d10177a
Showing
8 changed files
with
166 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 3.1.3 on 2021-02-24 15:21 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('hackathon', '0037_hackathon_teamsize'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='hackathon', | ||
name='judges', | ||
field=models.ManyToManyField(blank=True, related_name='judged_hackathons', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AlterField( | ||
model_name='hackathon', | ||
name='participants', | ||
field=models.ManyToManyField(blank=True, related_name='participated_hackathons', to=settings.AUTH_USER_MODEL), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% block content %} | ||
|
||
<div class="row"> | ||
<div class="col"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<div class="card-title">Hackathon Stats</div> | ||
<div class="card-text"> | ||
|
||
<div class="row"> | ||
<div class="col-md-12 col-lg-6"> | ||
<label for="hackathonFilter"> | ||
<select id="hackathonFilter" class="form-control"> | ||
<option value="0">All Hackthons</option> | ||
{% for hackathon in hackathons %} | ||
<option value="{{hackathon.id}}">{{hackathon.display_name}}</option> | ||
{% endfor %} | ||
</select> | ||
</label> | ||
</div> | ||
<div class="col-md-12 col-lg-2"> | ||
User Count: <span id="userCount">{{ users|length }}</span> | ||
</div> | ||
<div class="col-md-12 col-lg-4"> | ||
<button class="btn btn-primary btn-sm float-right" id="downloadUsers">Export Users</button> | ||
</div> | ||
</div> | ||
|
||
|
||
<table class="table table-sm mt-5" id="usersTable"> | ||
<thead> | ||
<tr> | ||
<th scope="col">Slack Display Name</th> | ||
<th scope="col">Email</th> | ||
<th scope="col">Current LMS Module</th> | ||
<th scope="col">Privileges</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for user in users %} | ||
<tr data-hackathons="{% for hackathon in user.participated_hackathons.all %}{{hackathon.id}},{% endfor %}"> | ||
<td> | ||
{{ user.slack_display_name }} | ||
</td> | ||
<td> | ||
{{ user.email }} | ||
</td> | ||
<td> | ||
{{ user.current_lms_module }} | ||
</td> | ||
<td> | ||
{% if user.is_staff and user.is_superuser %} | ||
Superuser | ||
{% elif user.is_staff %} | ||
Staff | ||
{% else %} | ||
Participant | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters