Move nickname rendering to a single template

Closes #1241
This commit is contained in:
Niko Bews 2017-06-22 13:27:11 +03:00 committed by Pavel Djundik
parent 8dcc63fd6a
commit eb4a4c7dfe
16 changed files with 25 additions and 23 deletions

View File

@ -1,2 +1,2 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span> {{> ../user_name nick=from}}
<span class="action-text">{{{parse text}}}</span> <span class="action-text">{{{parse text}}}</span>

View File

@ -1,2 +1,2 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{from}}</span> {{> ../user_name nick=from}}
<b>{{ctcpType}}</b> {{{parse ctcpMessage}}} <b>{{ctcpType}}</b> {{{parse ctcpMessage}}}

View File

@ -1,9 +1,9 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{from}}</span> {{> ../user_name nick=from}}
invited invited
{{#if invitedYou}} {{#if invitedYou}}
you you
{{else}} {{else}}
<span role="button" class="user {{colorClass invited}}" data-name="{{invited}}">{{invited}}</span> {{> ../user_name nick=invited}}
{{/if}} {{/if}}
to to
{{{parse channel}}} {{{parse channel}}}

View File

@ -1,3 +1,3 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span> {{> ../user_name nick=from}}
<i class="hostmask">({{hostmask}})</i> <i class="hostmask">({{hostmask}})</i>
has joined the channel has joined the channel

View File

@ -1,6 +1,6 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span> {{> ../user_name nick=from}}
has kicked has kicked
<span role="button" class="user {{colorClass target}}" data-name="{{target}}">{{target}}</span> {{> ../user_name nick=target}}
{{#if text}} {{#if text}}
<i class="part-reason">({{{parse text}}})</i> <i class="part-reason">({{{parse text}}})</i>
{{/if}} {{/if}}

View File

@ -1,3 +1,3 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span> {{> ../user_name nick=from}}
sets mode sets mode
{{{parse text}}} {{{parse text}}}

View File

@ -1,3 +1,3 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span> {{> ../user_name nick=from}}
is now known as is now known as
<span role="button" class="user {{colorClass new_nick}}" data-name="{{new_nick}}">{{mode}}{{new_nick}}</span> {{> ../user_name nick=new_nick}}

View File

@ -1,4 +1,4 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span> {{> ../user_name nick=from}}
<i class="hostmask">({{hostmask}})</i> <i class="hostmask">({{hostmask}})</i>
has left the channel has left the channel
{{#if text}} {{#if text}}

View File

@ -1,4 +1,4 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span> {{> ../user_name nick=from}}
<i class="hostmask">({{hostmask}})</i> <i class="hostmask">({{hostmask}})</i>
has quit has quit
{{#if text}} {{#if text}}

View File

@ -1,5 +1,5 @@
{{#if from}} {{#if from}}
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span> {{> ../user_name nick=from}}
has changed the topic to: has changed the topic to:
{{else}} {{else}}
The topic is: The topic is:

View File

@ -1,3 +1,3 @@
Topic set by Topic set by
<span role="button" class="user {{colorClass nick}}" data-name="{{nick}}">{{mode}}{{nick}}</span> {{> ../user_name}}
on {{localetime when}} on {{localetime when}}

View File

@ -1,41 +1,41 @@
<div> <div>
<span role="button" class="user {{colorClass whois.nick}}" data-name="{{whois.nick}}">{{whois.nick}}</span> {{> ../user_name nick=whois.nick}}
<i class="hostmask">({{whois.user}}@{{whois.host}})</i>: <i class="hostmask">({{whois.user}}@{{whois.host}})</i>:
<b>{{whois.real_name}}</b> <b>{{whois.real_name}}</b>
</div> </div>
{{#if whois.account}} {{#if whois.account}}
<div> <div>
<span role="button" class="user {{colorClass whois.nick}}" data-name="{{whois.nick}}">{{whois.nick}}</span> {{> ../user_name nick=whois.nick}}
is logged in as <b>{{whois.account}}</b> is logged in as <b>{{whois.account}}</b>
</div> </div>
{{/if}} {{/if}}
{{#if whois.channels}} {{#if whois.channels}}
<div> <div>
<span role="button" class="user {{colorClass whois.nick}}" data-name="{{whois.nick}}">{{whois.nick}}</span> {{> ../user_name nick=whois.nick}}
is on the following channels: {{{parse whois.channels}}} is on the following channels: {{{parse whois.channels}}}
</div> </div>
{{/if}} {{/if}}
{{#if whois.server}} {{#if whois.server}}
<div> <div>
<span role="button" class="user {{colorClass whois.nick}}" data-name="{{whois.nick}}">{{whois.nick}}</span> {{> ../user_name nick=whois.nick}}
is connected to {{whois.server}} <i>({{whois.server_info}})</i> is connected to {{whois.server}} <i>({{whois.server_info}})</i>
</div> </div>
{{/if}} {{/if}}
{{#if whois.secure}} {{#if whois.secure}}
<div> <div>
<span role="button" class="user {{colorClass whois.nick}}" data-name="{{whois.nick}}">{{whois.nick}}</span> {{> ../user_name nick=whois.nick}}
is using a secure connection is using a secure connection
</div> </div>
{{/if}} {{/if}}
{{#if whois.away}} {{#if whois.away}}
<div> <div>
<span role="button" class="user {{colorClass whois.nick}}" data-name="{{whois.nick}}">{{whois.nick}}</span> {{> ../user_name nick=whois.nick}}
is away <i>({{whois.away}})</i> is away <i>({{whois.away}})</i>
</div> </div>
{{/if}} {{/if}}
{{#if whois.idle}} {{#if whois.idle}}
<div> <div>
<span role="button" class="user {{colorClass whois.nick}}" data-name="{{whois.nick}}">{{whois.nick}}</span> {{> ../user_name nick=whois.nick}}
has been idle since {{localetime whois.idleTime}}. has been idle since {{localetime whois.idleTime}}.
</div> </div>
{{/if}} {{/if}}

View File

@ -31,4 +31,5 @@ module.exports = {
unread_marker: require("./unread_marker.tpl"), unread_marker: require("./unread_marker.tpl"),
user: require("./user.tpl"), user: require("./user.tpl"),
user_filtered: require("./user_filtered.tpl"), user_filtered: require("./user_filtered.tpl"),
user_name: require("./user_name.tpl"),
}; };

View File

@ -4,7 +4,7 @@
</span> </span>
<span class="from"> <span class="from">
{{#if from}} {{#if from}}
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{mode}}{{from}}</span> {{> user_name nick=from}}
{{/if}} {{/if}}
</span> </span>
{{#equal type "toggle"}} {{#equal type "toggle"}}

View File

@ -6,6 +6,6 @@
{{/unless}} {{/unless}}
<div class="user-mode {{modes mode}}"> <div class="user-mode {{modes mode}}">
{{/diff}} {{/diff}}
<span role="button" class="user {{colorClass nick}}" data-name="{{nick}}">{{mode}}{{nick}}</span> {{> user_name}}
{{/each}} {{/each}}
</div> </div>

View File

@ -0,0 +1 @@
<span role="button" class="user {{colorClass nick}}" data-name="{{nick}}">{{mode}}{{nick}}</span>