Skip to content

Commit

Permalink
location & division: remove options and checks
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <me@sumnerevans.com>
  • Loading branch information
sumnerevans committed Sep 6, 2023
1 parent 631b7df commit 11da5d9
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 90 deletions.
20 changes: 12 additions & 8 deletions internal/teacherteams.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,18 @@ func (a *Application) HandleTeacherTeamEdit(w http.ResponseWriter, r *http.Reque
}

teamName := r.FormValue("team-name")
inPerson := r.FormValue("team-location") == "in-person"
teamDivision, err := database.ParseDivision(r.FormValue("team-division"))
if err != nil {
log.Warn().Err(err).Msg("Failed to parse team division")
w.WriteHeader(http.StatusInternalServerError)
return
}
teamDivisionExplanation := r.FormValue("team-division-explanation")
// inPerson := r.FormValue("team-location") == "in-person"
// teamDivision, err := database.ParseDivision(r.FormValue("team-division"))
// if err != nil {
// log.Warn().Err(err).Msg("Failed to parse team division")
// w.WriteHeader(http.StatusInternalServerError)
// return
// }
// teamDivisionExplanation := r.FormValue("team-division-explanation")

inPerson := true
teamDivision := database.DivisionBeginner
teamDivisionExplanation := "only one division"

teamIDStr := r.URL.Query().Get("team_id")
var teamID uuid.UUID
Expand Down
8 changes: 4 additions & 4 deletions website/templates/student.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ <h4 class="card-header">Your Information</h4>
<div class="row my-4">
<div class="col-md-12">
<div class="card">
<h4 class="card-header">In Person Participant Details</h4>
<h4 class="card-header"><!-- In Person -->Participant Details</h4>
<div class="card-body">
<div class="row">
<div class="col">
<p>
Your team has been registered for the <b>in-person</b> competition. Lunch will
be provided, and you have the option to take a campus tour after the
competition.
<!-- Your team has been registered for the <b>in-person</b> competition. -->
Lunch will be provided, and you have the option to take a campus tour after
the competition.
</p>
</div>
</div>
Expand Down
144 changes: 72 additions & 72 deletions website/templates/teamedit.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,84 +71,84 @@ <h4 class="card-header">Team Information</h4>
</div>
</div>
</div>
<div class="row">
<div class="col">
This team will compete
<div class="btn-group" role="group" aria-label="Select team location">
<input type="radio" class="btn-check" name="team-location"
value="in-person" id="in-person" autocomplete="off" required
{{ with .Data.Team }}{{ if .InPerson }}checked{{ else }}disabled{{ end }}{{ end }}>
<label class="btn btn-outline-primary" for="in-person">in person</label>
<!-- <div class="row"> -->
<!-- <div class="col"> -->
<!-- This team will compete -->
<!-- <div class="btn-group" role="group" aria-label="Select team location"> -->
<!-- <input type="radio" class="btn-check" name="team-location" -->
<!-- value="in-person" id="in-person" autocomplete="off" required -->
<!-- {{ with .Data.Team }}{{ if .InPerson }}checked{{ else }}disabled{{ end }}{{ end }}> -->
<!-- <label class="btn btn-outline-primary" for="in-person">in person</label> -->

<input type="radio" class="btn-check" name="team-location"
value="remote" id="remote" autocomplete="off" required
{{ with .Data.Team }}{{ if not .InPerson }}checked{{ else }}disabled{{ end }}{{ end }}>
<label class="btn btn-outline-primary" for="remote">remotely</label>
</div>
<div class="form-text">
In-person competitors will have the opportunity to do a campus tour after the
competition.
{{ with .Data.Team -}}
If you need to change this, please email
<a href="mailto:support@mineshspc.com">support@mineshspc.com</a>.
{{- end -}}
</div>
</div>
</div>
<!-- <input type="radio" class="btn-check" name="team-location" -->
<!-- value="remote" id="remote" autocomplete="off" required -->
<!-- {{ with .Data.Team }}{{ if not .InPerson }}checked{{ else }}disabled{{ end }}{{ end }}> -->
<!-- <label class="btn btn-outline-primary" for="remote">remotely</label> -->
<!-- </div> -->
<!-- <div class="form-text"> -->
<!-- In-person competitors will have the opportunity to do a campus tour after the -->
<!-- competition. -->
<!-- {{ with .Data.Team -}} -->
<!-- If you need to change this, please email -->
<!-- <a href="mailto:support@mineshspc.com">support@mineshspc.com</a>. -->
<!-- {{- end -}} -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
</div>
</div>
</div>
</div>
<div class="row">
<div class="col m-4 mt-0">
<div class="card">
<h4 class="card-header">Team Division</h4>
<div class="card-body">
<div class="row mb-2">
<div class="col-md-12">
<div class="btn-group" role="group" aria-label="Select team division">
<input type="radio" class="btn-check" name="team-division"
value="Beginner" id="beginner" autocomplete="off" required
{{ if not .RegistrationEnabled }}disabled{{ end }}
{{ with .Data.Team }}{{ if eq .Division "Beginner" }}checked{{ end }}{{ end }}>
<label class="btn w-100 btn-outline-primary" for="beginner">
<h4>Beginner</h4>
<p>
For students who have never competed in HSPC before and who do not have any
experience with data structures or algorithms.
</p>
</label>
<!-- <div class="row"> -->
<!-- <div class="col m-4 mt-0"> -->
<!-- <div class="card"> -->
<!-- <h4 class="card-header">Team Division</h4> -->
<!-- <div class="card-body"> -->
<!-- <div class="row mb-2"> -->
<!-- <div class="col-md-12"> -->
<!-- <div class="btn-group" role="group" aria-label="Select team division"> -->
<!-- <input type="radio" class="btn-check" name="team-division" -->
<!-- value="Beginner" id="beginner" autocomplete="off" required -->
<!-- {{ if not .RegistrationEnabled }}disabled{{ end }} -->
<!-- {{ with .Data.Team }}{{ if eq .Division "Beginner" }}checked{{ end }}{{ end }}> -->
<!-- <label class="btn w-100 btn-outline-primary" for="beginner"> -->
<!-- <h4>Beginner</h4> -->
<!-- <p> -->
<!-- For students who have never competed in HSPC before and who do not have any -->
<!-- experience with data structures or algorithms. -->
<!-- </p> -->
<!-- </label> -->

<input type="radio" class="btn-check" name="team-division"
value="Advanced" id="advanced" autocomplete="off" required
{{ if not .RegistrationEnabled }}disabled{{ end }}
{{ with .Data.Team }}{{ if eq .Division "Advanced" }}checked{{ end }}{{ end }}>
<label class="btn w-100 btn-outline-primary" for="advanced">
<h4>Advanced</h4>
<p>
For students who know anything about data structures or algorithms.
</p>
</label>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-md-12">
<label for="team-division-explanation" class="form-label">
Why do you think that the division you selected is the best fit for this team?
</label>
<textarea class="form-control" name="team-division-explanation"
id="team-division-explanation" rows="4" required>{{ with .Data.Team }}{{ .DivisionExplanation }}{{ end }}</textarea>
<div class="form-text">
We will use this information to ensure that teams are placed in the correct
division.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <input type="radio" class="btn-check" name="team-division" -->
<!-- value="Advanced" id="advanced" autocomplete="off" required -->
<!-- {{ if not .RegistrationEnabled }}disabled{{ end }} -->
<!-- {{ with .Data.Team }}{{ if eq .Division "Advanced" }}checked{{ end }}{{ end }}> -->
<!-- <label class="btn w-100 btn-outline-primary" for="advanced"> -->
<!-- <h4>Advanced</h4> -->
<!-- <p> -->
<!-- For students who know anything about data structures or algorithms. -->
<!-- </p> -->
<!-- </label> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="row mb-2"> -->
<!-- <div class="col-md-12"> -->
<!-- <label for="team-division-explanation" class="form-label"> -->
<!-- Why do you think that the division you selected is the best fit for this team? -->
<!-- </label> -->
<!-- <textarea class="form-control" name="team-division-explanation" -->
<!-- id="team-division-explanation" rows="4" required>{{ with .Data.Team }}{{ .DivisionExplanation }}{{ end }}</textarea> -->
<!-- <div class="form-text"> -->
<!-- We will use this information to ensure that teams are placed in the correct -->
<!-- division. -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
{{ with $t := .Data.Team }}
<div class="row">
<div class="col m-4 mt-0">
Expand Down
12 changes: 6 additions & 6 deletions website/templates/teams.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ <h1>Register Teams</h1>
</div>
<div class="card-body">
<div class="row">
<div class="col-sm-3">
<b>Division:</b> {{ .Division }}
</div>
<div class="col-sm-3">
<b>In Person:</b> {{ if .InPerson }}Yes{{ else }}No{{ end }}
</div>
<!-- <div class="col-sm-3"> -->
<!-- <b>Division:</b> {{ .Division }} -->
<!-- </div> -->
<!-- <div class="col-sm-3"> -->
<!-- <b>In Person:</b> {{ if .InPerson }}Yes{{ else }}No{{ end }} -->
<!-- </div> -->
{{ if gt .RegistrationTS.UnixMilli 0 }}
<div class="col-sm-6">
<b>Registration Time:</b> {{ .RegistrationTS.Format "2006-01-02 15:04 MST" }}
Expand Down

0 comments on commit 11da5d9

Please sign in to comment.