-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
highlight current page #25
Conversation
Nice work again, I left a comment on the other PR. I think once you fixed it on the other PR you could try to apply the same patch to this one 👌 |
@@ -31,7 +31,18 @@ | |||
<li class="page-item"><a href="{{@root.fullUrl}}&page={{.}}" class="page-link">{{ . }}</a></li> | |||
{{/if}} | |||
{{else}} | |||
<li class="page-item"><a href="{{@root.fullUrl}}?page={{.}}" class="page-link">{{ . }}</a></li> | |||
{{#if (portContains @root.fullUrl "3000") }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work in production, as the fullUrl will be something different and probably won't use a port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the implementation and it does not seem to work, if we change the port. Could you test locally and let me know ?
src/views/partials/pagination.hbs
Outdated
@@ -17,17 +17,32 @@ | |||
<li class="disabled page-item"><a class="page-link">...</a></li> | |||
{{/if}} | |||
{{#each (displayPagesNumber interval current pages)}} | |||
{{#if (ifEqual . current 0)}} | |||
{{#if (ifEqual . current 1 0)}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{#if (ifEqual . current 1 0)}} | |
{{#if (ifEqual . current 1)}} |
src/helpers/handlebars.ts
Outdated
} | ||
|
||
export const not = (a: string): boolean=> { | ||
return (!(a)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (!(a)); | |
return !a; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @elhmn. i will make the changes right away!!!
src/helpers/handlebars.ts
Outdated
} | ||
|
||
|
||
export const portContains = (a: string, b:string): boolean => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const portContains = (a: string, b:string): boolean => { | |
export const portContains = (a: string, b: string): boolean => { |
<li class="active page-item"><a class="page-link">{{ . }}</a></li> | ||
{{else}} | ||
{{#if @root.hasParams}} | ||
{{#if (contains @root.fullUrl "page")}} | ||
<li class="page-item"><a href="{{{constructUrl @root.fullUrl .}}}" class="page-link">{{ . }}</a></li> | ||
{{#if (ifContains @root.fullUrl .)}} | ||
<li class="page-item active"> <a href="{{{constructUrl @root.fullUrl .}}}" class="page-link">{{ . }}</a></li> | ||
{{else}} | ||
<li class="page-item"><a href="{{{constructUrl @root.fullUrl .}}}" class="page-link">{{ . }}</a></li> | ||
{{/if}} | ||
{{else}} | ||
<li class="page-item"><a href="{{@root.fullUrl}}&page={{.}}" class="page-link">{{ . }}</a></li> | ||
{{/if}} | ||
{{else}} | ||
<li class="page-item"><a href="{{@root.fullUrl}}?page={{.}}" class="page-link">{{ . }}</a></li> | ||
{{#if (portContains @root.fullUrl "3000") }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little complicated and very difficult to follow, is it possible to simplify this entire logic ?
No description provided.