aristippe / pathagar

Pathagar is a simple bookserver serving OPDS feeds
GNU General Public License v2.0
1 stars 1 forks source link

Add django messages code to base template #19

Closed sinergatis closed 8 years ago

sinergatis commented 8 years ago

Some views (probably just edit/delete book) use the django messages framework for displaying transient messages to the user ("The book was deleted.", etc). We should add something similar to the standard template for the messaging framework in order to "consume" then to the base template (somewhere under the header?), as otherwise those messages keep piling up and show somewhere else (such as in the admin site). Pretty harmless and small change!

sinergatis commented 8 years ago

Closing this as it seems the generic class based view do not seem to issue messages on the latest version of Django, and we are not really using the messaging framework anywhere else (yet?) so no modifications really needed!

sinergatis commented 8 years ago

Reopening as it seems django-userena likes using the messaging framework by default, which makes sense and I personally find a nice touch, but for consistency we should either:

aristippe commented 8 years ago

I agree handing the messages some way would be nice. Only recently have I started to look at admin and add a few touches like search for various models or showing book count in authors. More templates for admin like functions in the site (for 'admins' that aren't superusers and can access the admin site could be a good idea. Such related things might crop up and become more of an issue for deployed sites that have many users, though I wasn't really planning such things. It's mainly for my own use, though others could find things useful. I'm always open to suggestions, and could try them whenever I think it's a good time and my django skills are at the point where such things are not too much effort to add. :)

sinergatis commented 8 years ago

Cool! Adding the message-handling code to the template would probably be trivial: just a matter of finding the right place on base.html (under the top navbar, I guess?), and placing the lines there (I think django-bootstrap3 probably has a template tag just for that, otherwise the lines linked at https://github.com/aristippe/pathagar/issues/19#issue-132198458 should work).

As for having some custom admin commands or functionality, sounds like something useful, even if they are tiny bits! Feel free to just add them directly or if you feel they will be many, maybe open an issue to keep track of them and so I can lend a hand with organizing them or anything else!

aristippe commented 8 years ago

I haven't touched messaging much but if it is indeed as simple as the link above, I'll give it a try.

As for custom admin functions or forms, I had tried a few like using autocomplete-light in admin for authors -> books and books -> authors. Such things aren't entirely essential and can either wait or we can say sure it might be useful but not too important at the moment, if it can already be done elsewhere. I was trying to balance what is really really helpful, what would be nice to have but not significant, and other things where we might say sure the app doesn't have everything as we could imagine but it's good enough. :) As you might also wish to spend more time on some other app to manage your collection, I'm also thinking I might want to devote some time to a desktop app. Some aspects of browsing a collection in Pathagar are already nicer than calibre and I was thinking a desktop app sure could be useful.

sinergatis commented 8 years ago

Cool, I'm assigning it to you then :trollface:. Please do check django-bootstrap documentation for a template tag that might save you some typing and styling - if it's not there, feel free to just copy-paste the bit from the Django docs instead.

sinergatis commented 8 years ago

Closed again, as it has been included on the base template at 92d242525bb47f020bdad50f6e6838e92fde0a61! :fireworks:

aristippe commented 8 years ago

With that last commit, I had done a bit of testing and was wondering when the messages would show up. :) Deleting, changing, or adding various things including users didn't do anything. But something else I did recently (forgot what it was) and the messages did indeed show up.

sinergatis commented 8 years ago

I think loggin in and logging out should throw messages, and deleting/modifying did at some point. Now that the UI handles the messages, we can do an extra-UI-fanciness pass at some point and add it to views that do meaningful things (adding, editing, deleting) whenever needed!