diff --git a/js/helpers/render.js b/js/helpers/render.js index 8a024cd37..03bb7a1b0 100644 --- a/js/helpers/render.js +++ b/js/helpers/render.js @@ -46,8 +46,10 @@ if (Handlebars) { '===': v1 === v2 ? true : false, '!=': v1 != v2 ? true : false, '!==': v1 !== v2 ? true : false, + 'gt': v1 > v2 ? true : false, '>': v1 > v2 ? true : false, '>=': v1 >= v2 ? true : false, + 'lt': v1 < v2 ? true : false, '<': v1 < v2 ? true : false, '<=': v1 <= v2 ? true : false, '||': v1 || v2 ? true : false, diff --git a/js/htmlview.js b/js/htmlview.js index 3cf1246eb..bd26dd62d 100644 --- a/js/htmlview.js +++ b/js/htmlview.js @@ -72,65 +72,7 @@ async function load_node(data, baseURL, direction) { author : metadata_get(node, "author"), copyright : metadata_get(node, "copyright"), description : metadata_get(node, "description"), - homepage : metadata_get(node, "homepage"), - errorDetails : (() => { - if (!node.error) - return null; - - return `There was a problem when fetching this subscription! -
Authentication failed. Please check the credentials and try again!
- `:''} - ${(2 == node.error)?` - ${node.httpError?` -
- ${node.httpErrorCode >= 100?`HTTP ${node.httpErrorCode}: `:''}
- ${node.httpError}
-
- There was an error when downloading the feed source: -
${node.updateError}- - `:''} - - ${node.filterError?` -
- There was an error when running the feed filter command: -
${node.filterError}- - `:''} - `:''} - ${(4 == node.error)?` -
The source does not point directly to a feed or a webpage with a link to a feed!
- `:''} - ${(8 == node.error)?` -Sorry, the feed could not be parsed!
-${node.parseError}-
You may want to contact the author/webmaster of the feed about this!
- `:''} - `; - })() + homepage : metadata_get(node, "homepage") }); contentCleanup (); diff --git a/js/node.xml.in b/js/node.xml.in index 6f738dd20..5ecf84d00 100644 --- a/js/node.xml.in +++ b/js/node.xml.in @@ -29,7 +29,67 @@ {{#if node.error}}<_span>Authentication failed. Please check the credentials and try again!
+ {{/compare}} + {{#compare node.error '==' 2}} + {{#if node.httpError}} ++ {{#compare node.httpErrorCode "gt" 99}}HTTP {{node.httpErrorCode}}{{/compare}} + {{node.httpError}} +
+ {{/if}} + {{#if node.updateError}} ++ <_span>There was an error when downloading the feed source: +
{{node.updateError}}+ + {{/if}} + {{#if node.filterError}} +
+ <_span>There was an error when running the feed filter command: +
{{node.filterError}}+ + {{/if}} + {{/compare}} + {{#compare node.error '==' 4}} +
<_span>The source does not point directly to a feed or a webpage with a link to a feed!
+ {{/compare}} + {{#compare node.error '==' 8}} +<_span>Sorry, the feed could not be parsed!
+{{node.parseError}}+
<_span>You may want to contact the author/webmaster of the feed about this!
+ {{/compare}} +