-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added compatibility for flarum-tag-password extension #49
Conversation
…ussion stats from users without permission.
…other themes. Recreate all styling to topNav, and keep sideNav for non-full screen mode. Fixed compact mobile view mode, where larger screen show sub tags on the right side.
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.
Hey, thank you so much for these fixes and contributions, really sorry it took so long to get to. Left a few minor comments but otherwise looks good!
js/src/forum/index.js
Outdated
@@ -9,10 +9,19 @@ import LastDiscussionWidget from './components/LastDiscussionWidget'; | |||
import StatWidget from './components/StatWidget'; | |||
|
|||
function pruneIndexNav(items, func) { | |||
if (app.current.matches(CategoriesPage) && app.forum.attribute('categories.fullPageDesktop')) { | |||
const isTagsVisible = !app.forum.attribute('categories.keep-tags-nav'); |
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.
Why is this negated?
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.
Removing the tag navigation should not be checked if fullPageDesktop is true, hence why it's removed. This caused the Tag navigation to be shown for the user.
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.
Ah, I agree about the fullPageDesktop change. But you have isTagsVisible
being set to the opposite of whether the user wants to keep tags. Shouldn't it be:
isTagsVisible = app.forum.attribute(... keep-tags-nav)
?
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.
It seems I've used the wrong attributes, the latest commit is 'categories.keepTagsNav' and fixed the logic
@@ -17,11 +17,18 @@ interface Attrs { | |||
parent: any; | |||
} | |||
|
|||
interface TagLocked { |
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'm not completely opposed to including features for the tag lock extension here, but would it be possible to add a comment here explaining which extension is adding this?
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.
Added comment for reference of Flarum Tag Passwords
js/src/forum/index.js
Outdated
@@ -9,10 +9,19 @@ import LastDiscussionWidget from './components/LastDiscussionWidget'; | |||
import StatWidget from './components/StatWidget'; | |||
|
|||
function pruneIndexNav(items, func) { | |||
if (app.current.matches(CategoriesPage) && app.forum.attribute('categories.fullPageDesktop')) { | |||
const isTagsVisible = !app.forum.attribute('categories.keep-tags-nav'); |
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.
Ah, I agree about the fullPageDesktop change. But you have isTagsVisible
being set to the opposite of whether the user wants to keep tags. Shouldn't it be:
isTagsVisible = app.forum.attribute(... keep-tags-nav)
?
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 again for putting this together!
Add support for flarum-tag-passwords, where Admin can lock specific tag with Password and Group Permission, the template would need to prevent loading the stats and last discussion.
Here is an example of it turned on:
![image](https://private-user-images.githubusercontent.com/6518915/312213978-823b7919-6411-4d4e-ad09-622b6ebd08ea.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwNzgxOTgsIm5iZiI6MTcyNjA3Nzg5OCwicGF0aCI6Ii82NTE4OTE1LzMxMjIxMzk3OC04MjNiNzkxOS02NDExLTRkNGUtYWQwOS02MjJiNmViZDA4ZWEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MTFUMTgwNDU4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjQ3YWM3MTdmMjUyN2VmNmZjYjRlZDI4ODJlMDMzNmEwZWFjMDRiNTQwZTQ0NDE3ZDZhOTNmNTVjYzhhMjg1MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.EAbyhTtwRbJUZt4SbRTi6cDBEeN1jj5KpisG5Js8UhE)