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.js.handlebars
Régis Hanol 59b5ba7c0f BUGFIX: IP lookup wasn't working when using HTTPS
REFACTOR: the ip locator into a ip-lookup component
2014-07-07 22:18:18 +02:00

55 lines
1.6 KiB
Handlebars

{{#if ip}}
<button class="btn" {{action lookup}}>
<span class="fa fa-globe"></span>&nbsp;{{i18n admin.user.ip_lookup}}
</button>
{{/if}}
{{#if show}}
<div class="location-box">
<h4>{{i18n ip_lookup.title}}</h4>
<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.loc}}
<a href="https://maps.google.com/maps?q={{unbound location.loc}}" target="_blank">{{location.loc}}</a><br>
{{city}}
{{else}}
{{i18n ip_lookup.location_not_found}}
{{/if}}
</dd>
{{#if location.org}}
<dt>{{i18n ip_lookup.organisation}}</dt>
<dd>{{location.org}}</dd>
{{/if}}
{{#if location.phone}}
<dt>{{i18n ip_lookup.phone}}</dt>
<dd>{{location.phone}}</dd>
{{/if}}
{{else}}
<div class="spinner">{{i18n loading}}</div>
{{/if}}
<dt>{{i18n ip_lookup.other_accounts}}</dt>
<dd>
{{#if other_accounts_loading}}
<div class="spinner">{{i18n loading}}</div>
{{else}}
{{#each other_accounts}}
{{#link-to "adminUser" this}}{{avatar this usernamePath="user.username" imageSize="small"}}{{/link-to}}
{{else}}
{{i18n ip_lookup.no_other_accounts}}
{{/each}}
{{/if}}
<dd>
</dl>
<button class="btn close" {{action hide}}>{{i18n close}}</button>
</div>
{{/if}}