Skip to content

Commit eefc849

Browse files
authored
feat(UI): Improve mobile view (bans list + comms list) - #9
1 parent ce80842 commit eefc849

File tree

5 files changed

+141
-7
lines changed

5 files changed

+141
-7
lines changed

sourcebans-web-theme-fluent/core/header.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<meta name="viewport" content="width=device-width, initial-scale=1" />
1515
<title>{$title}</title>
1616
<link rel="Shortcut Icon" href="themes/{$theme}/images/favicon.ico" />
17-
<link rel="stylesheet" type="text/css" href="themes/{$theme}/style/global.css?v05212021" />
18-
<link rel="stylesheet" type="text/css" href="themes/{$theme}/style/global.css.map?v05212021" />
17+
<link rel="stylesheet" type="text/css" href="themes/{$theme}/style/global.css" />
18+
<link rel="stylesheet" type="text/css" href="themes/{$theme}/style/global.css.map" />
1919
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.5.2/css/all.css">
2020
<meta name="description" content="Sourcebans for website" />
2121
<script type="text/javascript" src="themes/{$theme}/scripts/sourcebans.js"></script>

sourcebans-web-theme-fluent/page_bans.tpl

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
<div class="collapse_content">
118118
<div class="padding flex flex-jc:start" style="overflow: auto;">
119119
<ul class="ban_action responsive_show:desktop">
120-
<li class="button button-light">{$ban.demo_link}</li>
120+
<li class="button button-light">{$ban.demo_link}</li>
121121
{if !$login}
122122
<li>
123123
<a class="button button-success" href='index.php?p=login'>Admin ? Sign In</a>
@@ -148,6 +148,32 @@
148148
{/if}
149149
</ul>
150150
<ul class="ban_list_detal">
151+
<ul class="ban_action responsive_hide:desktop lists-mobile">
152+
{if $view_bans}
153+
{if ($ban.view_edit && !$ban.unbanned)}
154+
<li class="button button-primary lists-mobile">{$ban.edit_link}</li>
155+
{/if}
156+
<li class="button button-success lists-mobile">{$ban.addcomment}</li>
157+
<li class="button button-infos lists-mobile">{$ban.blockcomm_link}</li>
158+
{if ($ban.unbanned == false && $ban.view_unban)}
159+
<li class="button button-important lists-mobile">{$ban.unban_link}</li>
160+
{/if}
161+
{if $ban.unbanned && $ban.reban_link != false}
162+
<li class="button button-important lists-mobile">{$ban.reban_link}</li>
163+
{/if}
164+
{if $ban.type == 0}
165+
{if $groupban}
166+
<li class="button button-important lists-mobile">{$ban.groups_link}</li>
167+
{/if}
168+
{if $friendsban}
169+
<li class="button button-important lists-mobile">{$ban.friend_ban_link}</li>
170+
{/if}
171+
{/if}
172+
{if $ban.view_delete}
173+
<li class="button button-important lists-mobile">{$ban.delete_link}</li>
174+
{/if}
175+
{/if}
176+
</ul>
151177
<li>
152178
<span><i class="fas fa-user"></i> Player</span>
153179
{if empty($ban.player)}
@@ -309,6 +335,43 @@
309335
</ul>
310336
{/if}
311337
</div>
338+
{if $view_comments}
339+
{if $ban.commentdata != "None"}
340+
<ul class="ban_list_comments responsive_hide:desktop" style="display: contents;">
341+
<div class="layout_box_title">
342+
<h2><i class="fa-solid fa-comments"></i> Comments <i style="font-weight: normal;font-size: smaller;">(from the most recent to the oldest)</i></h2>
343+
</div>
344+
<ul>
345+
{foreach from=$ban.commentdata item="commenta"}
346+
<li>
347+
<div class="layout_box-child padding">
348+
<div class="ban_list_comments_header">
349+
{if !empty($commenta.comname)}
350+
<span class="text:bold">{$commenta.comname|escape:'html'}</span>
351+
{else}
352+
<span class="text:italic">Admin deleted</span>
353+
{/if}
354+
<span>{$commenta.added}</span>
355+
{if $commenta.editcomlink != ""}
356+
{$commenta.editcomlink} {$commenta.delcomlink}
357+
{/if}
358+
</div>
359+
<div class="margin-top flex flex-fd:column">
360+
{$commenta.commenttxt}
361+
{if !empty($commenta.edittime)}
362+
<span class="margin-top:half text:italic">
363+
<i class="fas fa-pencil-alt"></i> Last edit
364+
{$commenta.edittime} by {if !empty($commenta.editname)}{$commenta.editname}{else}<i>Admin deleted</i>{/if}
365+
</span>
366+
{/if}
367+
</div>
368+
</div>
369+
</li>
370+
{/foreach}
371+
</ul>
372+
{/if}
373+
</ul>
374+
{/if}
312375
</div>
313376
</td>
314377
</tr>

sourcebans-web-theme-fluent/page_comms.tpl

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,25 @@
139139
{/if}
140140
</ul>
141141
<ul class="ban_list_detal">
142+
<ul class="ban_action responsive_hide:desktop lists-mobile">
143+
{if $view_bans}
144+
{if ($ban.view_edit && (!isset($ban.unbanned) || !$ban.unbanned))}
145+
<li class="button button-primary lists-mobile">{$ban.edit_link}</li>
146+
{/if}
147+
{if $view_comments}
148+
<li class="button button-success lists-mobile">{$ban.addcomment}</li>
149+
{/if}
150+
{if ($ban.unbanned == false && $ban.view_unban)}
151+
<li class="button button-important lists-mobile">{$ban.unban_link}</li>
152+
{/if}
153+
{if isset($ban.unbanned) && $ban.reban_link != false}
154+
<li class="button button-important lists-mobile">{$ban.reban_link}</li>
155+
{/if}
156+
{if $ban.view_delete}
157+
<li class="button button-important lists-mobile">{$ban.delete_link}</li>
158+
{/if}
159+
{/if}
160+
</ul>
142161
<li>
143162
<span><i class="fas fa-user"></i> Player</span>
144163

@@ -253,7 +272,7 @@
253272
</ul>
254273

255274
{if $view_comments}
256-
<div class="ban_list_comments margin-left">
275+
<div class="ban_list_comments margin-left responsive_show:desktop">
257276
<div class="layout_box_title">
258277
<h2>Comments</h2>
259278
</div>
@@ -296,6 +315,43 @@
296315
</div>
297316
{/if}
298317
</div>
318+
{if $view_comments}
319+
{if $ban.commentdata != "None"}
320+
<ul class="ban_list_comments responsive_hide:desktop" style="display: contents;">
321+
<div class="layout_box_title">
322+
<h2><i class="fa-solid fa-comments"></i> Comments <i style="font-weight: normal;font-size: smaller;">(from the most recent to the oldest)</i></h2>
323+
</div>
324+
<ul>
325+
{foreach from=$ban.commentdata item="commenta"}
326+
<li>
327+
<div class="layout_box-child padding">
328+
<div class="ban_list_comments_header">
329+
{if !empty($commenta.comname)}
330+
<span class="text:bold">{$commenta.comname|escape:'html'}</span>
331+
{else}
332+
<span class="text:italic">Admin deleted</span>
333+
{/if}
334+
<span>{$commenta.added}</span>
335+
{if $commenta.editcomlink != ""}
336+
{$commenta.editcomlink} {$commenta.delcomlink}
337+
{/if}
338+
</div>
339+
<div class="margin-top flex flex-fd:column">
340+
{$commenta.commenttxt}
341+
{if !empty($commenta.edittime)}
342+
<span class="margin-top:half text:italic">
343+
<i class="fas fa-pencil-alt"></i> Last edit
344+
{$commenta.edittime} by {if !empty($commenta.editname)}{$commenta.editname}{else}<i>Admin deleted</i>{/if}
345+
</span>
346+
{/if}
347+
</div>
348+
</div>
349+
</li>
350+
{/foreach}
351+
</ul>
352+
{/if}
353+
</ul>
354+
{/if}
299355
</div>
300356
</td>
301357
</tr>

sourcebans-web-theme-fluent/style/global.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,6 +2370,14 @@ hr {
23702370
-ms-flex-direction: column;
23712371
flex-direction: column;
23722372
}
2373+
.lists-mobile {
2374+
display: inline-flex !important;
2375+
justify-content: center !important;
2376+
}
2377+
.ban_action.responsive_hide\:desktop.lists-mobile {
2378+
padding: 5px 10px;
2379+
width: max-content;
2380+
}
23732381
}
23742382

23752383
/* ================ Main ================ */
@@ -2463,8 +2471,15 @@ hr {
24632471
flex: 0 0 200px;
24642472
}
24652473

2466-
.ban_action li:not(:last-child) {
2474+
.ban_action li {
24672475
margin-bottom: 10px;
2476+
margin-right: 10px;
2477+
}
2478+
2479+
@media screen and (min-width: 980px) {
2480+
.ban_action li:not(:last-child) {
2481+
margin-bottom: 10px;
2482+
}
24682483
}
24692484

24702485
.ban_list_detal {
@@ -2726,4 +2741,4 @@ html[dir="rtl"] .cMessage_code {
27262741
/** ========== Fix Icons.. ========== **/
27272742
.fa-facebook:before {
27282743
margin-left: 1px;
2729-
}
2744+
}

sourcebans-web-theme-fluent/theme.conf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
define('theme_author', "aXenDev + .Rushaway + Hackmastr");
77

88
// Set the version of the theme here
9-
define('theme_version', "1.8.0 Git 180");
9+
define('theme_version', "1.8.0 Git 182");
1010

1111
// Set the link of the theme here
1212
define('theme_link', "https://github.com/Rushaway/sourcebans-web-theme-fluent/");

0 commit comments

Comments
 (0)