Skip to content

Commit

Permalink
UI improvements to clan settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jun 24, 2024
1 parent f8a0598 commit bfd5bae
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 37 deletions.
74 changes: 39 additions & 35 deletions web/templates/settings/clansettings.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{/* prettier-ignore-start */}}
{{/*###
Handler=/settings/clansettings
BannerContent=settings2.jpg
TitleBar=Clan Settings
BannerType=1
Include=menu.html
*/}}
{{/* prettier-ignore-end */}}
Expand All @@ -11,17 +13,17 @@
{{ template "settingsSidebar" . }}
<div class="twelve wide column">
<div class="ui segment">
{{ $d := (qb "SELECT * FROM clans WHERE owner = ? LIMIT 1;" .Context.User.ID) }}
{{ if $d }}
{{ $clan := (qb "SELECT * FROM clans WHERE owner = ? LIMIT 1;" .Context.User.ID) }}
{{ if $clan }}
<font size="6">Clan Settings</font>
<br />
<br />
<div class="ui center aligned segment">
{{ $tag := or $d.tag.String "" }}
{{ $desc := or $d.description.String "" }}
{{ $icon := or $d.icon.String "" }}
{{ $bg := or $d.background.String "" }}
{{ $status := or $d.status.Int 0 }}
{{ $tag := or $clan.tag.String "" }}
{{ $desc := or $clan.description.String "" }}
{{ $icon := or $clan.icon.String "" }}
{{ $bg := or $clan.background.String "" }}
{{ $status := or $clan.status.Int 0 }}
<form id="register-form" class="ui form">
<div class="field">
<label class="left aligned">
Expand All @@ -35,7 +37,7 @@
/>
</div>
<div class="field">
<label class="left aligned">Description (optional)</label>
<label class="left aligned">Description</label>
<input
tabindex="2"
type="text"
Expand All @@ -46,7 +48,7 @@
</div>
<div class="field">
<label class="left aligned">
{{ "Icon [URL] (optional)" }}
{{ "Icon Url" }}
</label>
<input
tabindex="3"
Expand All @@ -57,7 +59,7 @@
/>
</div>
<div class="field">
<label class="left aligned">Clan Status</label>
<label class="left aligned">Invite Policy</label>
<select
class="ui dropdown"
tabindex="4"
Expand Down Expand Up @@ -107,7 +109,7 @@
<br />
<center>
<div class="ui one item menu">
{{ $inv := or $d.invite.String "No Invite" }}
{{ $inv := or $clan.invite.String "No Invite" }}
<input
id="invin"
class="item"
Expand All @@ -123,33 +125,35 @@
<br />
<br />
<br />
{{ $members := (qb "SELECT COUNT(id)-1 AS c FROM users WHERE clan_id = ? LIMIT 1" $d.id.Int) }}
<font size="6">Members: {{ $members.c }}</font>
<br />
{{ $ := . }}
{{ range (.Get "clans/members?id=%d" $d.id.Int).clan.members }}
{{ if ne (int .id) (int $.Context.User.ID) }}
<form id="kick-form" class="ui form">
<div class="column">
<div class="ui left aligned fluid card">
<div class="content">
<a href="/u/{{ .id }}">
<a class="header" href="/u/{{ .id }}">
{{ country .country false }}{{ .username }}
{{ $members := (qb "SELECT COUNT(id)-1 AS c FROM users WHERE clan_id = ? LIMIT 1" $clan.id.Int) }}
{{ if ne (int $members.c) 0 }}
<font size="6">Members: {{ $members.c }}</font>
<br />
{{ $ := . }}
{{ range (.Get "clans/members?id=%d" $clan.id.Int).clan.members }}
{{ if ne (int .id) (int $.Context.User.ID) }}
<form id="kick-form" class="ui form">
<div class="column">
<div class="ui left aligned fluid card">
<div class="content">
<a href="/u/{{ .id }}">
<a class="header" href="/u/{{ .id }}">
{{ country .country false }}{{ .username }}
</a>
<button
name="member"
value="{{ .id }}"
class="ui right green button"
style="float:right; display:block; margin-right:0px; clear:left; width: 40%;"
>
Kick
</button>
</a>
<button
name="member"
value="{{ .id }}"
class="ui right green button"
style="float:right; display:block; margin-right:0px; clear:left; width: 40%;"
>
Kick
</button>
</a>
</div>
</div>
</div>
</div>
</form>
</form>
{{ end }}
{{ end }}
{{ end }}
<script>
Expand Down
2 changes: 0 additions & 2 deletions web/templates/settings/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

{{ if $is_clan_owner }}
{{ navbarItem .Path (.T "Clan settings") "/settings/clansettings" }}
{{ else }}
{{ navbarItem .Path (.T "<p title='Only the leader of the clan can access the settings page.' style='color:#C0C0C0;'>Clan Settings</p>") "" | html }}
{{ end }}

{{ if has .Context.User.Privileges 4 }}
Expand Down

0 comments on commit bfd5bae

Please sign in to comment.