UX: Show domains even on local links in the topic map with titles
This commit is contained in:
parent
39e7a326ab
commit
bea5df0104
|
@ -2,12 +2,13 @@ import registerUnbound from 'discourse/helpers/register-unbound';
|
|||
|
||||
registerUnbound('link-domain', function(link) {
|
||||
if (link) {
|
||||
var internal = Em.get(link, 'internal'),
|
||||
hasTitle = (!Em.isEmpty(Em.get(link, 'title')));
|
||||
if (hasTitle && !internal) {
|
||||
var domain = Em.get(link, 'domain');
|
||||
if (!Em.isEmpty(domain)) {
|
||||
var s = domain.split('.');
|
||||
const hasTitle = (!Ember.isEmpty(Em.get(link, 'title')));
|
||||
|
||||
if (hasTitle) {
|
||||
let domain = Ember.get(link, 'domain');
|
||||
console.log('domain', domain);
|
||||
if (!Ember.isEmpty(domain)) {
|
||||
const s = domain.split('.');
|
||||
domain = s[s.length-2] + "." + s[s.length-1];
|
||||
return new Handlebars.SafeString("<span class='domain'>" + domain + "</span>");
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<section class='links'>
|
||||
<h3>{{i18n 'topic_map.links_title'}}</h3>
|
||||
<table class='topic-links'>
|
||||
{{#each link in infoLinks}}
|
||||
{{#each infoLinks as |link|}}
|
||||
<tr>
|
||||
<td>
|
||||
<span class='badge badge-notification clicks' title='{{i18n 'topic_map.clicks' count=clicks}}'>{{link.clicks}}</span>
|
||||
|
|
Loading…
Reference in New Issue