(search) Revamp browse results with new look.

This commit is contained in:
Viktor Lofgren 2023-11-27 17:14:58 +01:00
parent 9bc65ff0ca
commit 97d43a6fa2
5 changed files with 23 additions and 5 deletions

View File

@ -11,4 +11,20 @@ public record BrowseResult (EdgeUrl url, int domainId, double relatedness) {
}
return domain.toString();
}
public String displayDomain() {
String ret;
var domain = url.domain;
if ("www".equals(domain.subDomain)) {
ret = domain.domain;
}
else {
ret = domain.toString();
}
if (ret.length() > 25) {
ret = ret.substring(0, 22) + "...";
}
return ret;
}
}

View File

@ -224,6 +224,7 @@ section.cards {
h2 {
@extend .heading;
word-break: break-word;
}
h2 a {
@ -548,3 +549,5 @@ footer {
}
}
}
.w3m-helper { display: none; }

View File

@ -1,5 +1,5 @@
<section class="card">
<h2>{{url.domain}}</h2>
<section class="card browse-result">
<h2 title="{{url.domain}}">{{displayDomain}}</h2>
<a href="{{url.proto}}://{{url.domain}}/">
<img src="/screenshot/{{domainId}}" title="{{description}}" loading="lazy"/>

View File

@ -15,8 +15,6 @@
{{>search/parts/search-header}}
{{>search/parts/search-form}}
<section class="cards">
<div class="infobox">
{{#if focusDomain}}
Showing domains similar to <tt>{{focusDomain}}</tt>.
@ -28,8 +26,8 @@ take the helm.
{{/unless}}
</div>
<section class="cards">
{{#each results}}{{>search/browse-result}}{{/each}}
</section>
{{>search/parts/search-footer}}

View File

@ -16,3 +16,4 @@
</div>
</div>
</section>
<hr class="w3m-helper" />