diff --git a/hackathon/fixtures/hackathons.json b/hackathon/fixtures/hackathons.json index dc54de62..b061679c 100644 --- a/hackathon/fixtures/hackathons.json +++ b/hackathon/fixtures/hackathons.json @@ -687,7 +687,7 @@ "created": "2021-01-28T17:46:37.870Z", "updated": "2021-01-28T17:46:37.870Z", "created_by": 1, - "display_name": "team_1", + "display_name": "team_x1", "header_image": "", "hackathon": 12, "project": null, @@ -704,7 +704,7 @@ "created": "2021-01-28T17:46:37.876Z", "updated": "2021-01-28T17:46:37.876Z", "created_by": 1, - "display_name": "team_2", + "display_name": "team_x2", "header_image": "", "hackathon": 12, "project": null, @@ -722,7 +722,7 @@ "created": "2021-01-28T17:46:37.880Z", "updated": "2021-01-28T17:46:37.880Z", "created_by": 1, - "display_name": "team_3", + "display_name": "team_x3", "header_image": "", "hackathon": 12, "project": null, @@ -740,7 +740,7 @@ "created": "2021-01-28T17:46:37.882Z", "updated": "2021-01-28T17:46:37.882Z", "created_by": 1, - "display_name": "team_4", + "display_name": "team_x4", "header_image": "", "hackathon": 12, "project": null, diff --git a/hackathon/templates/hackathon/create-event.html b/hackathon/templates/hackathon/create-event.html index 316c71e5..fd807b00 100644 --- a/hackathon/templates/hackathon/create-event.html +++ b/hackathon/templates/hackathon/create-event.html @@ -40,10 +40,7 @@

Create Hackathon

{{ form.status|as_crispy_field }}
-
- {{ form.judging_status|as_crispy_field }} -
-
+
{{ form.start_date|as_crispy_field }}
diff --git a/hackathon/templates/hackathon/hackathon_view.html b/hackathon/templates/hackathon/hackathon_view.html index 015291f4..1493cf8c 100644 --- a/hackathon/templates/hackathon/hackathon_view.html +++ b/hackathon/templates/hackathon/hackathon_view.html @@ -84,10 +84,10 @@

Teams:

@@ -99,10 +99,14 @@

{% endfor %}

- {% if user in team.participants.get_queryset %} + {% if user in hackathon.participants.all %} + {% if user in team.participants.get_queryset %}
+ {% if hackathon.status == 'hack_in_progress' %} Edit Project + {% endif %}
+ {% endif %} {% elif user in hackathon.judges.all %} {% if hackathon.status == 'hack_in_progress' or hackathon.status == 'judging' %}
diff --git a/hackathon/templates/hackathon/includes/enrollpart.html b/hackathon/templates/hackathon/includes/enrollpart.html index 44b300b8..740de027 100644 --- a/hackathon/templates/hackathon/includes/enrollpart.html +++ b/hackathon/templates/hackathon/includes/enrollpart.html @@ -16,6 +16,15 @@ {% else %}
+ {% if request.user in hackathon.participants.all %} + {% if hackathon.status == 'hack_in_progress' or hackathon.status == 'judging' %} + You are participanting in this hackathon. + {% elif hackathon.status == 'finished' %} + You are participated in this hackathon. + {% endif %} + {% else %} Registrations for this hackathon are currently not open. + {% endif %}
+ {% endif %} diff --git a/hackathon/templates/hackathon/includes/hackathon_card.html b/hackathon/templates/hackathon/includes/hackathon_card.html index 8890da6c..8d108984 100644 --- a/hackathon/templates/hackathon/includes/hackathon_card.html +++ b/hackathon/templates/hackathon/includes/hackathon_card.html @@ -15,7 +15,7 @@
-
{{ hackathon.display_name }} +
{{ hackathon.display_name }} {% if user.is_staff %}{{hackathon.status}}{% endif %}

{{ hackathon.start_date }} - {{ hackathon.end_date }}

diff --git a/hackathon/views.py b/hackathon/views.py index eb8bcb1f..c92a9198 100644 --- a/hackathon/views.py +++ b/hackathon/views.py @@ -70,10 +70,11 @@ def judging(request, hack_id, team_id): project=get_object_or_404(HackTeam, pk=team_id).project, hack_project_score_category=score_category, ) + + score_cat_id = f"score_{score_category.id}" if team_score: team_score.update(score=request.POST.get(score_cat_id)) else: - score_cat_id = f"score_{score_category.id}" team_score = HackProjectScore( created_by=request.user, judge=request.user, diff --git a/left_to_do.txt b/left_to_do.txt index 6387c4ec..a081f9b3 100644 --- a/left_to_do.txt +++ b/left_to_do.txt @@ -1 +1,3 @@ - Add notification to notify participants of winners +- Check if teams can submit projects still if status is judging, finished, deleted +- Allow judges to enroll as participant, but remove staff privileges for that hackathon \ No newline at end of file diff --git a/showcase/templates/showcase.html b/showcase/templates/showcase.html index f486a2c9..d3010b5b 100644 --- a/showcase/templates/showcase.html +++ b/showcase/templates/showcase.html @@ -65,7 +65,9 @@

All Showcased Projects

- +

diff --git a/static/css/style.css b/static/css/style.css index 481285c3..e8cc95a6 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -79,6 +79,11 @@ main { color: var(--s-grey); } +a.ci-link { + font-size: inherit !important; + color: var(--p-orange); +} + .disabled-link { pointer-events: none; opacity: .5; diff --git a/teams/helpers.py b/teams/helpers.py index 2cce9b0e..86134184 100644 --- a/teams/helpers.py +++ b/teams/helpers.py @@ -206,5 +206,6 @@ def update_team_participants(created_by_user, teams, hackathon_id): if hack_team: hack_team.first().participants.set(get_users_from_ids(team_members)) else: + hackathon = Hackathon.objects.get(id=hackathon_id) create_new_team_and_add_participants(created_by_user, team_name, team_members, hackathon) diff --git a/teams/templates/change_teams.html b/teams/templates/change_teams.html index 75d66a96..262bd4dc 100644 --- a/teams/templates/change_teams.html +++ b/teams/templates/change_teams.html @@ -29,21 +29,21 @@

{{ team_name|format_team_name }}
Leftover Participants
    + {% if leftover_participants %} {% for participant in leftover_participants %}
  1. {{ participant.name }} (level: {{ participant.level }})
  2. {% endfor %} + {% endif %}
- {% endif %} {% include 'includes/menu.html' %} diff --git a/teams/templates/includes/empty_project.html b/teams/templates/includes/empty_project.html index 2df060ed..57d17131 100644 --- a/teams/templates/includes/empty_project.html +++ b/teams/templates/includes/empty_project.html @@ -11,11 +11,13 @@

Project: {{ team.project.display_name}}

No Project submitted yet. + {% if team.hackathon.status == 'hack_in_progress' %} {% if request.user in team.participants.all %} Add project details now!

Project details can always be edited until the judging starts. {% endif %} + {% endif %}

diff --git a/teams/templates/includes/member.html b/teams/templates/includes/member.html index f8ed8d56..496105a4 100644 --- a/teams/templates/includes/member.html +++ b/teams/templates/includes/member.html @@ -2,7 +2,7 @@
-
{{member.slack_display_name}}
+
{{member.slack_display_name}}
{% if member.profile_image %} Profile Image diff --git a/teams/templates/includes/project.html b/teams/templates/includes/project.html index 6e5c6ae3..ccd8c796 100644 --- a/teams/templates/includes/project.html +++ b/teams/templates/includes/project.html @@ -23,7 +23,13 @@

Project: {{ team.project.display_name}}

{% endif %}
{% if request.user in team.participants.all and not showcase %} + {% if team.hackathon.status == 'hack_in_progress' %} Edit Project + {% elif team.hackathon.status == 'judging' %} +
+ Judging in progress, you cannot edit your project anymore. +
+ {% endif%} {% if team.get_showcase %}Edit{% else %}Add{% endif %} Showcase @@ -65,12 +71,12 @@

Code / Deployement

{% if team.project.technologies_used %}

- GitHub Repo: GitHub Repo: {{team.project.github_url}}

- Deployed at: Deployed at: {{team.project.deployed_url}}

diff --git a/teams/templates/includes/showcase_member.html b/teams/templates/includes/showcase_member.html index 95ec21d4..84b43f92 100644 --- a/teams/templates/includes/showcase_member.html +++ b/teams/templates/includes/showcase_member.html @@ -2,7 +2,7 @@
{% if member.website_url %} -
{{member.full_name}}
+
{{member.full_name}}
{% else %}
{% if not member.full_name %}{{member.slack_display_name}}{% else %}{{member.full_name}}{% endif %}
{% endif %} diff --git a/teams/templates/team.html b/teams/templates/team.html index 01cde140..8d49b3a6 100644 --- a/teams/templates/team.html +++ b/teams/templates/team.html @@ -64,10 +64,14 @@

About the team

{% if team.project %} - {% if team.project.share_permission or request.user.is_staff or request.user in team.participants.all %} - {% include 'includes/project.html' %} + {% if request.user.is_staff or team.project.share_permission or request.user in team.participants.all %} + {% if request.user in team.hackathon.participants.all and request.user not in team.participants.all and request.user.is_staff %} + {% include 'includes/project_not_visible.html' %} + {% else %} + {% include 'includes/project.html' %} + {% endif %} {% else %} - {% include 'includes/project_not_visible.html' %} + {% include 'includes/project.html' %} {% endif %} {% else %} {% include 'includes/empty_project.html' %} diff --git a/teams/views.py b/teams/views.py index 16f0aafc..f941052a 100644 --- a/teams/views.py +++ b/teams/views.py @@ -133,6 +133,10 @@ def create_project(request, team_id): hack_team = get_object_or_404(HackTeam, id=team_id) hack_project = HackProject.objects.filter(hackteam=hack_team) + if hack_team.hackathon.status != 'hack_in_progress': + messages.error(request, "You currently cannot edit this project.") + return redirect(reverse('view_team', kwargs={'team_id': team_id})) + if request.method == 'POST': if hack_project: form = HackProjectForm(request.POST, instance=hack_project.get())