Closed jagtalon closed 10 years ago
@jagtalon I think this is actually the other way around; there are blacklists but they're not being rendered from the template
@mintsoft Oh thanks for that
@jagtalon @moollaza This is properly strange; I think there might be a problem with the handlebarsy thing: if I switch the template to this:
<div>
{{#each famlist from="0" to="1"}}
<h1 class='text--primary iplookup_domain_name zci__header--detail'><a href='http://{{this}}'>{{this}}</a></h1>
{{/each}}
<div class='text--primary iplookup_owner'>Owner: {{shortwho}}</div>
<div class='text--secondary iplookup_location'>{{shortloc}}</div>
{{#if blacklists}}
<div class='text--secondary iplookup_blacklist'>Blacklists:
{{#each blacklists}}
<span>{{this}}</span>
{{/each}}
</div>
{{/if}}
</div>
then it outputs;
The moment I use a div
or switch the <span>{{this}}</span>
to <li>
it totally breaks the template
@mintsoft I assume you added in the opening/closing ul
tags too?
@moollaza yeah; it was valid markup (see : https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/share/spice/iplookup/content.handlebars#L9 )
@jagtalon @moollaza the plot thickens here, with this:
<div>
{{#each famlist from="0" to="1"}}
<h1 class='text--primary iplookup_domain_name zci__header--detail'><a href='http://{{this}}'>{{this}}</a></h1>
{{/each}}
<div class='text--primary iplookup_owner'>Owner: {{shortwho}}</div>
<div class='text--secondary iplookup_location'>{{shortloc}}</div>
{{#if blacklists}}
<div class='text--secondary iplookup_blacklist'>
{{#each blacklists}}
<p>{{this}}</p>
{{/each}}
</div>
{{/if}}
</div>
it only outputs the <h1><a>
; no owner or anything. If you change the <p>{{this}}</p>
to <span>{{this}}</span>
the owner and location comes back o.0
Totally confused! I have no idea how to debug this further
@mintsoft Took a look at this tonight with @nathanntg; it seems that there's an ellipses function in the front end that is cutting off the extra lines without displaying the ellipses correctly. The handlebar functions seem to be working correctly, but the current HTML layout doesn't show any of the results because the first result begins on a new line. I tried to create a demo to show what's happening (https://github.com/tommytommytommy/zeroclickinfo-spice/blob/master/share/spice/iplookup/content.handlebars); in this version, one blacklist text is shown in full, and one blacklist text is partially displayed with appropriate ellipses:
I don't think that we can fix this from the back-end open source files?
@tommytommytommy Thanks for the input! That sort of tallies with what I've found, if it outputs on its own line then it just gets sort of ignored. @jagtalon @moollaza does that help at all?
@jagtalon @moollaza what are your thoughts about the best way to fix this? There are situations in-which there are many blacklists; it seems a bit odd that it only works properly if there's only one:
@mintsoft Here are two screenshots with 9 blacklists (not knowing any IPs on multiple blacklists, I just inserted the same entries into the JSON object) using the pull request at #1139. The ellipses appear correctly; it seems that the display problem has to do with results that are just a little, but not too, long?
@tommytommytommy Personally I would prefer a list over the long line, I'm sure we can fix whatever's up with it somehow
@mintsoft @tommytommytommy Oh, that's not good! So this looks like a bug. For the mean time, I think we should merge in https://github.com/duckduckgo/zeroclickinfo-spice/pull/1139 and we'll deal with the weird ellipsis function behavior internally.
Thanks!
@jagtalon do you want to raise an issue for the bug?
@mintsoft Made an internal issue for the bug since the info template isn't open source. Thanks, though!
Fixed by @tommytommytommy in #1142