Add toggle to change view type on Books view #521

Closed
opened 2026-02-04 20:43:11 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @ssddanbrown on GitHub (Dec 10, 2017).

Instead of having a user setting in the profile view, Show buttons at the top of the page to switch between list and grid view.

If these are pressed by a logged in user the selected view would then be saved in the same way as the current profile setting.

Originally created by @ssddanbrown on GitHub (Dec 10, 2017). Instead of having a user setting in the profile view, Show buttons at the top of the page to switch between list and grid view. If these are pressed by a logged in user the selected view would then be saved in the same way as the current profile setting.
OVERLORD added the 🛠️ Enhancement label 2026-02-04 20:43:11 +03:00
Author
Owner

@Abijeet commented on GitHub (Dec 17, 2017):

@ssddanbrown - I'll take this up.

Are we looking at updating the template via an AJAX call or is it OK if the page refreshes when the user does this?

@Abijeet commented on GitHub (Dec 17, 2017): @ssddanbrown - I'll take this up. Are we looking at updating the template via an AJAX call or is it OK if the page refreshes when the user does this?
Author
Owner

@Abijeet commented on GitHub (Dec 18, 2017):

Also, is this the location where we are planning to add it?

bitsnbytes bookstack

That way we can add it for the chapters view later if we want.

@Abijeet commented on GitHub (Dec 18, 2017): Also, is this the location where we are planning to add it? ![bitsnbytes bookstack](https://user-images.githubusercontent.com/1685517/34120624-54de781c-e44c-11e7-9576-cd7a386b028a.png) That way we can add it for the chapters view later if we want.
Author
Owner

@ssddanbrown commented on GitHub (Dec 20, 2017):

@Abijeet Great, Thanks. I'd say a refresh is okay for this action. Yeah, that location is fine. We can always move it in the future if it's better suited to somewhere else.

@ssddanbrown commented on GitHub (Dec 20, 2017): @Abijeet Great, Thanks. I'd say a refresh is okay for this action. Yeah, that location is fine. We can always move it in the future if it's better suited to somewhere else.
Author
Owner

@Abijeet commented on GitHub (Dec 22, 2017):

@ssddanbrown - I've spent a little more time on this,

  1. Place an anchor at the location shown above. Text - Toggle Book View.
  2. On click of the switch trigger a POST form submit via JavaScript. It has to be a POST because the user is updating a value.
  3. Update the user's preferred layout for book viewing.
  4. Page renders in the new layout.

I'll add the needed test cases as well.

For point 3, would you prefer that I use the BookController and update the user preferred setting using the userRepo OR would you prefer that I use the UserController to update the preferred user setting?

Note that after this I'll have to redirect to books/index hence both seem a little awkward.

@Abijeet commented on GitHub (Dec 22, 2017): @ssddanbrown - I've spent a little more time on this, 1. Place an anchor at the location shown above. Text - Toggle Book View. 2. On click of the switch trigger a POST form submit via JavaScript. It has to be a POST because the user is updating a value. 3. Update the user's preferred layout for book viewing. 4. Page renders in the new layout. I'll add the needed test cases as well. For point 3, would you prefer that I use the `BookController` and update the user preferred setting using the `userRepo` OR would you prefer that I use the `UserController` to update the preferred user setting? Note that after this I'll have to redirect to `books/index` hence both seem a little awkward.
Author
Owner

@Abijeet commented on GitHub (Dec 25, 2017):

@ssddanbrown - Merry Christmas. Any thoughts on the above?

@Abijeet commented on GitHub (Dec 25, 2017): @ssddanbrown - Merry Christmas. Any thoughts on the above?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#521