Software /
code /
prosody
Comparison
plugins/mod_admin_shell.lua @ 12869:70ee82579076
mod_admin_shell: Make Role and Affiliation columns the same width for aesthetics
The length of the title "Affiliation" made them both close enough that
it looked off.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 29 Jan 2023 18:57:28 +0100 |
parent | 12868:d5cb86b84d12 |
child | 12870:56397f3b58c1 |
comparison
equal
deleted
inserted
replaced
12868:d5cb86b84d12 | 12869:70ee82579076 |
---|---|
1400 return room_obj, err; | 1400 return room_obj, err; |
1401 end | 1401 end |
1402 | 1402 |
1403 local print = self.session.print; | 1403 local print = self.session.print; |
1404 local row = format_table({ | 1404 local row = format_table({ |
1405 { title = "Role"; width = #"participant"; key = "role" }; -- longest role name | 1405 { title = "Role"; width = 12; key = "role" }; -- longest role name |
1406 { title = "JID"; width = "75%"; key = "bare_jid" }; | 1406 { title = "JID"; width = "75%"; key = "bare_jid" }; |
1407 { title = "Nickname"; width = "25%"; key = "nick"; mapper = jid_resource }; | 1407 { title = "Nickname"; width = "25%"; key = "nick"; mapper = jid_resource }; |
1408 }, self.session.width); | 1408 }, self.session.width); |
1409 local total, displayed = 0, 0; | 1409 local total, displayed = 0, 0; |
1410 for nick_jid, occupant in room_obj:each_occupant() do | 1410 for nick_jid, occupant in room_obj:each_occupant() do |
1432 return room_obj, err; | 1432 return room_obj, err; |
1433 end | 1433 end |
1434 | 1434 |
1435 local print = self.session.print; | 1435 local print = self.session.print; |
1436 local row = format_table({ | 1436 local row = format_table({ |
1437 { title = "Affiliation"; width = #"outcast" }; -- longest affiliation name | 1437 { title = "Affiliation"; width = 12 }; -- longest affiliation name |
1438 { title = "JID"; width = "75%" }; | 1438 { title = "JID"; width = "75%" }; |
1439 { title = "Nickname"; width = "25%"; key = "reserved_nickname" }; | 1439 { title = "Nickname"; width = "25%"; key = "reserved_nickname" }; |
1440 }, self.session.width); | 1440 }, self.session.width); |
1441 local total, displayed = 0, 0; | 1441 local total, displayed = 0, 0; |
1442 for affiliated_jid, affiliation, affiliation_data in room_obj:each_affiliation() do | 1442 for affiliated_jid, affiliation, affiliation_data in room_obj:each_affiliation() do |