This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/components/ip-lookup.hbs
2019-01-22 15:09:04 +01:00

96 lines
3.1 KiB
Handlebars

{{#if ip}}
<button class="btn btn-default" {{action "lookup"}}>
{{d-icon "globe"}}
{{i18n "admin.user.ip_lookup"}}
</button>
{{/if}}
{{#if show}}
<div class="location-box">
<a class="close pull-right" {{action "hide"}}>{{d-icon "times"}}</a>
{{#if copied}}
<a class="btn btn-default btn-hover pull-right">
{{d-icon "copy"}}
{{i18n "ip_lookup.copied"}}
</a>
{{else}}
<a class="btn btn-default pull-right no-text" {{action "copy"}}>
{{d-icon "copy"}}
</a>
{{/if}}
<h4>{{i18n "ip_lookup.title"}}</h4>
<p class='powered-by'>{{{i18n "ip_lookup.powered_by"}}}</p>
<dl>
{{#if location}}
{{#if location.hostname}}
<dt>{{i18n "ip_lookup.hostname"}}</dt>
<dd>{{location.hostname}}</dd>
{{/if}}
<dt>{{i18n "ip_lookup.location"}}</dt>
<dd>
{{#if location.location}}
<a href="https://maps.google.com/maps?q={{unbound location.latitude}},{{unbound location.longitude}}" target="_blank">
{{location.location}}
</a>
{{else}}
{{i18n "ip_lookup.location_not_found"}}
{{/if}}
</dd>
{{#if location.organization}}
<dt>{{i18n "ip_lookup.organisation"}}</dt>
<dd>{{location.organization}}</dd>
{{/if}}
{{else}}
{{loading-spinner size="small"}}
{{/if}}
<dt>
{{i18n "ip_lookup.other_accounts"}}
<strong>{{totalOthersWithSameIP}}</strong>
{{#if other_accounts.length}}
<button class="btn btn-danger pull-right" {{action "deleteOtherAccounts"}}>
{{d-icon "warning"}}
{{i18n "ip_lookup.delete_other_accounts" count=otherAccountsToDelete}}
</button>
{{/if}}
</dt>
{{#conditional-loading-spinner size="small" condition=otherAccountsLoading}}
{{#if other_accounts.length}}
<dd class="other-accounts">
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>{{i18n "ip_lookup.username"}}</th>
<th>{{i18n "ip_lookup.trust_level"}}</th>
<th>{{i18n "ip_lookup.read_time"}}</th>
<th>{{i18n "ip_lookup.topics_entered"}}</th>
<th>{{i18n "ip_lookup.post_count"}}</th>
</tr>
</thead>
<tbody>
{{#each other_accounts as |a|}}
<tr>
<td>
{{#link-to "adminUser" a}}
{{avatar a usernamePath="user.username" imageSize="small"}}
&nbsp;
<span>{{a.username}}</span>
{{/link-to}}
</td>
<td>{{a.trustLevel.id}}</td>
<td>{{a.time_read}}</td>
<td>{{a.topics_entered}}</td>
<td>{{a.post_count}}</td>
</tr>
{{/each}}
</tbody>
</table>
</dd>
{{/if}}
{{/conditional-loading-spinner}}
</dl>
</div>
{{/if}}