Format whois as a definition list

This commit is contained in:
Pavel Djundik 2017-12-17 16:28:30 +02:00
parent ada870e959
commit 2b7657a9e7
2 changed files with 85 additions and 79 deletions

View file

@ -1483,6 +1483,25 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
display: inline-block;
}
.whois {
display: -ms-grid; /* Edge 15- */
display: grid;
-ms-grid-template-columns: max-content auto;
grid-template-columns: max-content auto;
margin: 0;
}
.whois dt {
-ms-grid-column-start: 1;
grid-column-start: 1;
margin-right: 20px;
}
.whois dd {
-ms-grid-column-start: 2;
grid-column-start: 2;
}
#form {
background: #eee;
border-top: 1px solid #ddd;

View file

@ -1,93 +1,80 @@
<div>
{{> ../user_name nick=whois.nick}}
<i class="hostmask">({{whois.user}}@{{whois.host}})</i>
</div>
{{#if whois.actualhost}}
<div>
{{> ../user_name nick=whois.nick}}'s actual host is: <i>{{whois.actualhost}}</i> (<i>{{whois.actualip}}</i>)
</div>
{{/if}}
{{#if whois.real_name}}
<div>
{{> ../user_name nick=whois.nick}}'s real name is:
<b>{{{parse whois.real_name}}}</b>
</div>
{{/if}}
<p>{{> ../user_name nick=whois.nick}}</p>
<dl class="whois">
{{#if whois.account}}
<div>
{{> ../user_name nick=whois.nick}}
is logged in as <b>{{whois.account}}</b>
</div>
<dt>Logged in as:</dt>
<dd>{{whois.account}}</dd>
{{/if}}
<dt>Host mask:</dt>
<dd class="hostmask">{{whois.user}}@{{whois.host}}</dd>
{{#if whois.actualhost}}
<dt>Actual host:</dt>
<dd class="hostmask"><a href="https://ipinfo.io/{{whois.actualip}}" target="_blank" rel="noopener">{{whois.actualip}}</a>{{#equal whois.actualhost whois.actualip}}{{else}} ({{whois.actualhost}}){{/equal}}</dd>
{{/if}}
{{#if whois.real_name}}
<dt>Real name:</dt>
<dd>{{{parse whois.real_name}}}</dd>
{{/if}}
{{#if whois.registered_nick}}
<div>
{{> ../user_name nick=whois.nick}}
{{whois.registered_nick}}
</div>
{{/if}}
{{#if whois.modes}}
<div>
{{> ../user_name nick=whois.nick}}
{{whois.modes}}
</div>
{{/if}}
{{#if whois.special}}
<div>
{{> ../user_name nick=whois.nick}}
{{whois.special}}
</div>
{{/if}}
{{#if whois.operator}}
<div>
{{> ../user_name nick=whois.nick}}
{{whois.operator}}
</div>
{{/if}}
{{#if whois.helpop}}
<div>
{{> ../user_name nick=whois.nick}}
is available for help
</div>
{{/if}}
{{#if whois.bot}}
<div>
{{> ../user_name nick=whois.nick}}
is a bot
</div>
<dt>Registered nick:</dt>
<dd>{{whois.registered_nick}}</dd>
{{/if}}
{{#if whois.channels}}
<div>
{{> ../user_name nick=whois.nick}}
is on the following channels: {{{parse whois.channels}}}
</div>
<dt>Channels:</dt>
<dd>{{{parse whois.channels}}}</dd>
{{/if}}
{{#if whois.server}}
<div>
{{> ../user_name nick=whois.nick}}
is connected to {{whois.server}} <i>({{whois.server_info}})</i>
</div>
{{#if whois.modes}}
<dt>Modes:</dt>
<dd>{{whois.modes}}</dd>
{{/if}}
{{#if whois.secure}}
<div>
{{> ../user_name nick=whois.nick}}
is using a secure connection
</div>
{{#if whois.special}}
<dt>Special:</dt>
<dd>{{whois.special}}</dd>
{{/if}}
{{#if whois.operator}}
<dt>Operator:</dt>
<dd>{{whois.operator}}</dd>
{{/if}}
{{#if whois.helpop}}
<dt>Available for help:</dt>
<dd>Yes</dd>
{{/if}}
{{#if whois.bot}}
<dt>Is a bot:</dt>
<dd>Yes</dd>
{{/if}}
{{#if whois.away}}
<div>
{{> ../user_name nick=whois.nick}}
is away <i>({{whois.away}})</i>
</div>
<dt>Away:</dt>
<dd>{{{parse whois.away}}}</dd>
{{/if}}
{{#if whois.secure}}
<dt>Secure connection:</dt>
<dd>Yes</dd>
{{/if}}
{{#if whois.server}}
<dt>Connected to:</dt>
<dd>{{whois.server}} <i>({{whois.server_info}})</i></dd>
{{/if}}
{{#if whois.logonTime}}
<div>
{{> ../user_name nick=whois.nick}}
connected at {{localetime whois.logonTime}}
</div>
<dt>Connected at:</dt>
<dd>{{localetime whois.logonTime}}</dd>
{{/if}}
{{#if whois.idle}}
<div>
{{> ../user_name nick=whois.nick}}
has been idle since {{localetime whois.idleTime}}
</div>
<dt>Idle since:</dt>
<dd>{{localetime whois.idleTime}}</dd>
{{/if}}
</dl>