Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Tournament Website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Levatax
Tournament Website
Commits
2ed33079
Commit
2ed33079
authored
3 years ago
by
Ophestra
Browse files
Options
Downloads
Patches
Plain Diff
ugly hack to format in team sizes
parent
cefb7ffa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/templates/form.tmpl
+46
-17
46 additions, 17 deletions
assets/templates/form.tmpl
routes.go
+29
-0
29 additions, 0 deletions
routes.go
with
75 additions
and
17 deletions
assets/templates/form.tmpl
+
46
−
17
View file @
2ed33079
...
...
@@ -14,28 +14,57 @@
<div class="contact-form">
<form action="#">
<div class="row">
{{/* {{if .Team}}*/}}
{{/* <div class="col-md-12">*/}}
{{/* <input name="teamName" type="text" placeholder="Takım Adınız">*/}}
{{/* </div>*/}}
{{/* <div class="col-md-6">*/}}
{{/* <input type="text" placeholder="Takım Kaptanınız">*/}}
{{/* </div>*/}}
{{/* {{end}}*/}}
{{if .team_size.A}}
<div class="col-md-12">
<label>
<input name="teamName" type="text" placeholder="Takım Adınız">
</label>
</div>
<div class="col-md-6">
<label>
<input type="text" placeholder="Takım Kaptanınız">
</label>
</div>
{{end}}
<div class="col-md-6">
<input type="text" placeholder="Adınız">
<label>
<input type="text" placeholder="Adınız">
</label>
</div>
<div class="col-md-6">
<input type="text" placeholder="Soyadınız">
<label>
<input type="text" placeholder="Soyadınız">
</label>
</div>
{{/* {{range $i := loop 1 .TeamSize}}*/}}
{{/* <div class="col-md-6">*/}}
{{/* <input type="text" placeholder="Player {{ $i }} Name + UID">*/}}
{{/* </div>*/}}
{{/* {{ end }}*/}}
{{if .team_size.A}}
<div class="col-md-6">
<label>
<input type="text" placeholder="Player 1 Name + UID">
</label>
</div>
{{ end }}
{{if .team_size.B}}
<div class="col-md-6">
<label>
<input type="text" placeholder="Player 2 Name + UID">
</label>
</div>
{{ end }}
{{if .team_size.C}}
<div class="col-md-6">
<label>
<input type="text" placeholder="Player 3 Name + UID">
</label>
</div>
{{ end }}
{{if .team_size.D}}
<div class="col-md-6">
<label>
<input type="text" placeholder="Player 4 Name + UID">
</label>
</div>
{{ end }}
</div>
<button>Gönder</button>
</form>
...
...
This diff is collapsed.
Click to expand it.
routes.go
+
29
−
0
View file @
2ed33079
...
...
@@ -8,6 +8,7 @@ import (
"github.com/google/uuid"
"log"
"net/http"
"strconv"
)
func
registerRoutes
()
{
...
...
@@ -44,6 +45,33 @@ func registerRoutes() {
authText
,
authRef
:=
getAuthButton
(
user
)
var
tsn
int
if
n
,
err
:=
strconv
.
Atoi
(
t
.
Attributes
[
"size"
]);
err
!=
nil
{
log
.
Printf
(
"error parsing team size of team %s: %s"
,
t
.
ID
.
String
(),
err
)
context
.
String
(
http
.
StatusInternalServerError
,
"Internal Server Error"
)
return
}
else
{
tsn
=
n
}
ts
:=
struct
{
A
bool
B
bool
C
bool
D
bool
}{}
if
tsn
>
0
{
ts
.
A
=
true
}
if
tsn
>
1
{
ts
.
B
=
true
}
if
tsn
>
2
{
ts
.
C
=
true
}
if
tsn
>
3
{
ts
.
D
=
true
}
sy
,
sm
,
sd
:=
t
.
StartTime
.
Date
()
dy
,
dm
,
dd
:=
t
.
Deadline
.
Date
()
context
.
HTML
(
http
.
StatusOK
,
"form.tmpl"
,
gin
.
H
{
...
...
@@ -56,6 +84,7 @@ func registerRoutes() {
TeamSizeString
:
t
.
Attributes
[
"size"
],
Prize
:
t
.
Attributes
[
"prize"
],
},
"team_size"
:
ts
,
})
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment