Skip to content

Commit

Permalink
UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
setnicka committed Aug 1, 2021
1 parent d41e0cf commit b250e7a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
6 changes: 5 additions & 1 deletion static/css/shrecker.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ header {
top: 0;
background-color: #222;
border: 1px #222 solid;
z-index: 10;
z-index: 1010;
display: flex;
}
header h1 {
Expand Down Expand Up @@ -68,6 +68,10 @@ nav#main-menu a.active {
color: black;
}

input.btn:disabled {
opacity: 0.25;
}

/******************************************************************************/

#mapa {
Expand Down
2 changes: 1 addition & 1 deletion templates/org/org_index_map.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var team_paths = [];
team_markers[{{ .Config.ID }}] = L.marker({{ .Status.Point | latlon }}, {
title: "{{ .Config.Name }}",
icon: teamIcon,
}).bindPopup("Tým {{ .Config.Name }}").addTo(map).on('click', function() {
}).bindPopup("Tým {{ .Config.Name }}<br><a href='{{ $.Basedir }}/org/team/{{ .Config.ID }}'>(detail týmu)</a>").addTo(map).on('click', function() {
displayedPath = team_paths["{{ .Config.ID }}"];
displayedPath.addTo(map);
});
Expand Down
2 changes: 1 addition & 1 deletion templates/org/org_messages.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{{ if $c }}<a href="{{ $basedir }}/org/team/{{ .Team }}/cipher/{{ $c.ID }}">{{ $c.Name }}</a>{{ else }}???{{ end }}
{{ end }}</td>
<td>{{ .Text }}</td>
<td>{{ .Response }}</td>
<td>{{ .Response | safeHTML }}</td>
</tr>
{{ end }}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion templates/org/org_team.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
{{ if $c }}<a href="{{ $basedir }}/org/team/{{ $.Team.Config.ID }}/cipher/{{ $c.ID }}">{{ $c.Name }}</a>{{ else }}???{{ end }}
{{ end }}</td>
<td>{{ .Text }}</td>
<td>{{ .Response }}</td>
<td>{{ .Response | safeHTML }}</td>
</tr>
{{ end }}
</tbody>
Expand Down
16 changes: 9 additions & 7 deletions templates/org/org_team_cipher.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{{- $cipher := index $.CiphersMap $cid -}}
{{- $cipherStatus := index $.CiphersStatus $cid -}}
{{- if $first }}{{ $first = false }}{{ else }}, {{ end -}}
{{ if and $cipherStatus $cipherStatus.Solved }}✅{{ else }}❌{{ end }}
{{ if and $cipherStatus $cipherStatus.Solved }}✅{{ else if and $cipherStatus $cipherStatus.Skip }}⏩{{ else }}❌{{ end }}
<a href="{{ $basedir }}/org/team/{{ $.Team.ID }}/cipher/{{ $cid }}">{{ $cipher.Name }}</a>
{{- end }}
<br>
Expand Down Expand Up @@ -64,28 +64,30 @@
<tr><td>Vyřešená</td><td>{{ if .CipherStatus.Solved }}✅ {{ .CipherStatus.Solved | timestamp }}{{ else }}
❌ {{ if not .CipherStatus.Skip }}<form method="POST" class="float-right" onsubmit="return confirm('Opravdu označit jako vyřešenou?');">
{{ .CSRF }}
<button name="submit" value="set-solved" class="btn btn-sm btn-success">Označit jako vyřešenou</button>
<button name="submit" value="set-solved" class="btn btn-sm btn-success">Označit jako vyřešenou</button>
</form>{{ end }}
{{ end }}</td></tr>
<tr><td>Nápověda</td><td>{{ if .CipherStatus.Hint }}vydaná {{ .CipherStatus.Hint | timestamp }}{{ else }}
<tr><td>Nápověda</td><td>{{ if .CipherStatus.Hint }}💡 vydaná {{ .CipherStatus.Hint | timestamp }}{{ else }}
nevydaná {{ if not (or .CipherStatus.Skip .CipherStatus.Solved) }}<form method="POST" class="float-right" onsubmit="return confirm('Opravdu označit jako že nápověda byla vydána? Pokud šifra obsahuje textovou nápovědu, tak se zobrazí účastníkům v jejich části systému.');">
{{ .CSRF }}
<button name="submit" value="set-hint" class="btn btn-sm btn-warning">Vydat nápovědu</button>
<button name="submit" value="set-hint" class="btn btn-sm btn-warning">💡 Vydat nápovědu</button>
</form>{{ end }}
{{ end }}</td></tr>
<tr><td>Přeskočení</td><td>{{ if .CipherStatus.Skip }}přeskočeno {{ .CipherStatus.Skip | timestamp }}{{ else }}
<tr><td>Přeskočení</td><td>{{ if .CipherStatus.Skip }}přeskočeno {{ .CipherStatus.Skip | timestamp }}{{ else }}
nepřeskočeno {{ if not .CipherStatus.Solved }}<form method="POST" class="float-right" onsubmit="return confirm('Opravdu označit jako přeskočenou? Poté již nepůjde šifru vyřešit a v účastnické části systému se zobrazí text přeskočení.');">
{{ .CSRF }}
<button name="submit" value="set-skip" class="btn btn-sm btn-danger">Přeskočit šifru</button>
<button name="submit" value="set-skip" class="btn btn-sm btn-danger">Přeskočit šifru</button>
</form>{{ end }}
{{ end }}</td></tr>
{{ if not .CipherStatus.Skip }}
<tr><td>Extra body</td><td>
<form method="POST">
{{ .CSRF }}
<input type="number" value="{{ .CipherStatus.ExtraPoints }}" name="extra-points">
<button name="submit" value="set-extra-points" class="btn btn-sm btn-primary">Nastavit</button>
</form>
</td></tr>
{{ end }}
<tr><th class="hint" title="Včetně extra bodů">Získané body</th><th>{{ .CipherStatus.Points }}</th></tr>
{{ end }}
</table>
Expand All @@ -105,7 +107,7 @@
<td>{{ .Time | timestamp_hint }}</td>
<td>{{ if .SMSID }}<a href="tel:{{ .PhoneNumber }}">{{ .PhoneNumber }}</a>{{ else }}{{ .PhoneNumber }}{{ end }}</td>
<td>{{ .Text }}</td>
<td>{{ .Response }}</td>
<td>{{ .Response | safeHTML }}</td>
</tr>
{{ end }}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion templates/org/parts/org_dashboard.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<tr>
<th>
<a href="{{ $basedir }}/org/team/{{ .Config.ID }}" title="Detail týmu">{{ .Config.Name }}</a>
{{ if $game.HasMap }}<br><a href="#" onclick="showPath('{{ .Config.ID }}'); return false;">🗺</a>{{ end }}
{{ if $game.HasMap }}<br><a href="#" onclick="showPath('{{ .Config.ID }}'); return false;"><small>zobrazit na mapě</small></a>{{ end }}
{{- if eq $game.OrderMode "points" }}<br>Bodů: {{ .Points }}{{ end -}}
</th>
{{- $team := . -}}
Expand Down

0 comments on commit b250e7a

Please sign in to comment.