From c6907b7fd361f1f37b18a00acd4a05faf5c380b9 Mon Sep 17 00:00:00 2001 From: Mankavelda Date: Fri, 29 Apr 2022 19:58:29 +0100 Subject: [PATCH 1/3] highlight current page --- src/helpers/handlebars.ts | 4 ++++ src/views/partials/pagination.hbs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/helpers/handlebars.ts b/src/helpers/handlebars.ts index 3059c35..ca234b5 100644 --- a/src/helpers/handlebars.ts +++ b/src/helpers/handlebars.ts @@ -44,3 +44,7 @@ export const repoName = (v1: string): string => { const part: Array = v1.split('/'); return `${part[3]}/${part[4]}`; } + +export const ifContains = (a: string, b: string): boolean => { + return a.slice(-1).includes(b); +} \ No newline at end of file diff --git a/src/views/partials/pagination.hbs b/src/views/partials/pagination.hbs index 41be4de..91797c3 100644 --- a/src/views/partials/pagination.hbs +++ b/src/views/partials/pagination.hbs @@ -22,7 +22,11 @@ {{else}} {{#if @root.hasParams}} {{#if (contains @root.fullUrl "page")}} -
  • {{ . }}
  • + {{#if (ifContains @root.fullUrl .)}} +
  • {{ . }}
  • + {{else}} +
  • {{ . }}
  • + {{/if}} {{else}}
  • {{ . }}
  • {{/if}} From f2d1c7a38ac37864f6029029cf15a90012bffd30 Mon Sep 17 00:00:00 2001 From: Mankavelda Date: Wed, 11 May 2022 03:17:26 +0100 Subject: [PATCH 2/3] updates on page highlight --- src/helpers/handlebars.ts | 9 +++++++++ src/views/partials/pagination.hbs | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/helpers/handlebars.ts b/src/helpers/handlebars.ts index ca234b5..b9fa113 100644 --- a/src/helpers/handlebars.ts +++ b/src/helpers/handlebars.ts @@ -47,4 +47,13 @@ export const repoName = (v1: string): string => { export const ifContains = (a: string, b: string): boolean => { return a.slice(-1).includes(b); +} + + +export const portContains = (a: string, b:string): boolean => { + return a.includes(b); +} + +export const not = (a: string): boolean=> { + return (!(a)); } \ No newline at end of file diff --git a/src/views/partials/pagination.hbs b/src/views/partials/pagination.hbs index 91797c3..5216897 100644 --- a/src/views/partials/pagination.hbs +++ b/src/views/partials/pagination.hbs @@ -17,7 +17,7 @@
  • ...
  • {{/if}} {{#each (displayPagesNumber interval current pages)}} - {{#if (ifEqual . current 0)}} + {{#if (ifEqual . current 1 0)}}
  • {{ . }}
  • {{else}} {{#if @root.hasParams}} @@ -31,7 +31,18 @@
  • {{ . }}
  • {{/if}} {{else}} -
  • {{ . }}
  • + {{#if (portContains @root.fullUrl "3000") }} + {{#if (not (contains @root.fullUrl "page"))}} + {{#if (contains @root.fullUrl 0 ) }} + {{#if (ifEqual . 1 0)}} +
  • {{ . }}
  • + {{else}}
  • {{ . }}
  • + {{/if}} + {{/if}} + {{/if}} + {{else}} +
  • s{{ . }}
  • + {{/if}} {{/if}} {{/if}} {{#if (ifEqual . current 4)}} From e6ca7c2de1e55d046d0ec911fae423868a3ab969 Mon Sep 17 00:00:00 2001 From: Mankavelda Date: Tue, 17 May 2022 05:01:27 +0100 Subject: [PATCH 3/3] new updates --- src/helpers/handlebars.ts | 4 ++-- src/views/partials/pagination.hbs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers/handlebars.ts b/src/helpers/handlebars.ts index b9fa113..a15c7ea 100644 --- a/src/helpers/handlebars.ts +++ b/src/helpers/handlebars.ts @@ -50,10 +50,10 @@ export const ifContains = (a: string, b: string): boolean => { } -export const portContains = (a: string, b:string): boolean => { +export const portContains = (a: string, b: string): boolean => { return a.includes(b); } export const not = (a: string): boolean=> { - return (!(a)); + return !a; } \ No newline at end of file diff --git a/src/views/partials/pagination.hbs b/src/views/partials/pagination.hbs index 5216897..1896fd9 100644 --- a/src/views/partials/pagination.hbs +++ b/src/views/partials/pagination.hbs @@ -17,7 +17,7 @@
  • ...
  • {{/if}} {{#each (displayPagesNumber interval current pages)}} - {{#if (ifEqual . current 1 0)}} + {{#if (ifEqual . current 1)}}
  • {{ . }}
  • {{else}} {{#if @root.hasParams}}