Merge pull request #1252 from thelounge/bews/username-template

Move nickname rendering to a single template
This commit is contained in:
Jérémie Astori 2017-06-26 01:49:50 -04:00 committed by GitHub
commit aee518365d
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>

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}}}

View File

@ -1,9 +1,9 @@
<span role="button" class="user {{colorClass from}}" data-name="{{from}}">{{from}}</span>
{{> ../user_name nick=from}}
invited
{{#if invitedYou}}
you
{{else}}
<span role="button" class="user {{colorClass invited}}" data-name="{{invited}}">{{invited}}</span>
{{> ../user_name nick=invited}}
{{/if}}
to
{{{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>
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
<span role="button" class="user {{colorClass target}}" data-name="{{target}}">{{target}}</span>
{{> ../user_name nick=target}}
{{#if text}}
<i class="part-reason">({{{parse text}}})</i>
{{/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
{{{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
<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>
has left the channel
{{#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>
has quit
{{#if text}}

View File

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

View File

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

View File

@ -1,41 +1,41 @@
<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>:
<b>{{whois.real_name}}</b>
</div>
{{#if whois.account}}
<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>
</div>
{{/if}}
{{#if whois.channels}}
<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}}}
</div>
{{/if}}
{{#if whois.server}}
<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>
</div>
{{/if}}
{{#if whois.secure}}
<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
</div>
{{/if}}
{{#if whois.away}}
<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>
</div>
{{/if}}
{{#if whois.idle}}
<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}}.
</div>
{{/if}}

View File

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

View File

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

View File

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

View File

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