Refreshing, adjust column widths

This commit is contained in:
mochi
2020-08-10 09:31:17 +02:00
parent 7efaaa68ee
commit 9db7f63082
2 changed files with 19 additions and 12 deletions
+6
View File
@@ -1350,6 +1350,12 @@
M.client.prefs.real_name = random_name
M.client.prefs.save_character(M.client)
else if(href_list["asays"])
if(!check_rights(R_ADMIN))
return
usr.client.view_asays()
else if(href_list["tdome1"])
if(!check_rights(R_SERVER|R_EVENT)) return
+13 -12
View File
@@ -20,8 +20,8 @@ GLOBAL_LIST_EMPTY(asays)
if(!check_rights(R_ADMIN))
return
var/output = {"
<style>
var/list/output = list({"
<style>
td, th
{
border: 1px solid #425c6e;
@@ -35,28 +35,29 @@ GLOBAL_LIST_EMPTY(asays)
table-layout: fixed;
}
</style>
<table style='width: 100%; border-collapse: collapse; table-layout: auto;'>
"}
<a href='byond://?src=[holder.UID()];asays=1'>Refresh</a>
<table style='width: 100%; border-collapse: collapse; table-layout: auto; margin-top: 3px;'>
"})
// Header & body start
output += {"
<thead>
<tr>
<th>Time</th>
<th>Ckey</th>
<th>Message</th>
<th width="5%">Time</th>
<th width="10%">Ckey</th>
<th width="85%">Message</th>
</tr>
</thead>
<tbody>
"}
for (var/datum/asays/A in GLOB.asays)
for(var/datum/asays/A in GLOB.asays)
var/timestr = time2text(A.time, "hh:mm:ss")
output += {"
<tr>
<td>[timestr]</td>
<td><b>[A.ckey] ([A.rank])</b></td>
<td>[A.message]</td>
<td width="5%">[timestr]</td>
<td width="10%"><b>[A.ckey] ([A.rank])</b></td>
<td width="85%">[A.message]</td>
</tr>
"}
@@ -65,5 +66,5 @@ GLOBAL_LIST_EMPTY(asays)
</table>"}
var/datum/browser/popup = new(src, "asays", "<div align='center'>Current Round Asays</div>", 1200, 825)
popup.set_content(output)
popup.set_content(output.Join())
popup.open(0)