Skip to content

Commit

Permalink
Display Physical connection mode in the UI as "In Person"
Browse files Browse the repository at this point in the history
  • Loading branch information
bincyber committed Sep 15, 2024
1 parent f5104d0 commit bbabe58
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion internal/bot/templates/app_home.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
]
},
{{ range .Channels }}
{{- $connectionMode := .ConnectionMode.String | capitalize }}
{{- if eq $connectionMode "Physical" }}
{{ $connectionMode = "In Person" }}
{{- end }}
{
"type": "section",
"text": {
Expand All @@ -81,7 +85,7 @@
},
{
"type": "mrkdwn",
"text": ":busts_in_silhouette: Connection Mode: *{{ .ConnectionMode.String | capitalize }}*"
"text": ":busts_in_silhouette: Connection Mode: *{{ $connectionMode }}*"
},
{
"type": "mrkdwn",
Expand Down
2 changes: 1 addition & 1 deletion internal/server/ui/templates/channel.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
class="block appearance-none w-full bg-gray-200 border border-gray-200 text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500">
<option value="virtual" {{ if eq $.Channel.ConnectionMode.String "virtual" }}selected{{ end }}>Virtual
</option>
<option value="physical" {{ if eq $.Channel.ConnectionMode.String "physical" }}selected{{ end }}>Physical
<option value="physical" {{ if eq $.Channel.ConnectionMode.String "physical" }}selected{{ end }}>In Person
</option>
<option value="hybrid" {{ if eq $.Channel.ConnectionMode.String "hybrid" }}selected{{ end }}>Hybrid
</option>
Expand Down
12 changes: 8 additions & 4 deletions internal/server/ui/templates/profile.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
<p class="font-medium text-xl">Chat Roulette Channels</p>
</div>

{{ if .Channels }}
{{ if .Channels }}
<div class="pt-2 flex flex-wrap">
{{ range .Channels }}
{{- range .Channels }}
{{- $connectionMode := .ConnectionMode | capitalize }}

{{- if eq $connectionMode "Physical" }}
{{- $connectionMode = "In Person" }}
{{- end }}
<div class="mx-1 my-1 max-w-sm rounded overflow-hidden border-solid border-2 border-inherit">
<div class="px-6 py-4">
<a href="/history/{{ .ChannelID }}">
Expand All @@ -18,8 +23,7 @@
.Participants }}
</p>
<p class="text-gray-700 text-base" id="{{ .ChannelID }}-connection-mode">
<span class="font-bold">Connection Mode: </span>{{
.ConnectionMode }}
<span class="font-bold">Connection Mode: </span>{{ $connectionMode }}
</p>
<p class="text-gray-700 text-base">
<span class="font-bold">Interval: </span>
Expand Down

0 comments on commit bbabe58

Please sign in to comment.