kartik-v / yii2-tree-manager

An advanced tree management module using nested sets for Yii 2.
http://demos.krajee.com/tree-manager
Other
150 stars 107 forks source link

User Mode Node Display #260

Open BillHeaton opened 4 years ago

BillHeaton commented 4 years ago

Prerequisites

Enhancement

Currently isAdmin only controls the checkboxes on the node management form. It can be argued that the rest of the fields are still Management information.

I want to use the control to navigate a node tree and display node information of my choosing when isadmin is false.

I suggest:

1) isAdmin controls the showing of the entire node management form. 2) When isAdmin is false then a user form would be displayed 3) When isAdmin is true then add a button to flip between user form and management form.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/81953327-user-mode-node-display?utm_campaign=plugin&utm_content=tracker%2F10339775&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F10339775&utm_medium=issues&utm_source=github).
BillHeaton commented 4 years ago

@kartik-v I've made good progress on this one. I'm down in the kv-tree.js guts and have this urge to document the code. Would that cause you heart burn?

kartik-v commented 4 years ago

@BillHeaton - thanks for the effort ... it would be good if you can share a PULL REQUEST --

BillHeaton commented 4 years ago

@kartik-v will do, working on the last little bit now.

kartik-v commented 4 years ago

Thanks. Just one note though - the extension currently as well allows user to always configure and choose his/her own CUSTOM FORM if needed. Just check in your enhancement if the user can have both options - use the default form (for simple internal admin forms) - OR/AND use the custom form for advanced needs.

BillHeaton commented 4 years ago

The problem I'm solving is that I have many users, and only the admins will be allowed to modify the tree. The plan is to use the widget as a navigation aid using a custom detail that contains the information to display to the user.

That's mostly working and I've created a user detail that a read-only version of the isAdmin detail.

Working on implementing a button that when in isAdmin mode flips it to a "user view." The user detail view (if isAdmin is set) in turn has a button to flip back to the "admin view."

Planning on putting a pull request out because "it's almost" working but has problems with the flipping. I need other eyes to look at it. Currently using a session variable however may need to be moved to parameters.