Re: [mezzanine-users] Re: Proposal: can_move permission (was: page_move signals)
On Sun, Jun 8, 2014 at 8:18 AM, Ahmad Khayyat akhay...@gmail.com wrote: There is one issue with the current approach. The exception message is shown using Django messages, which displays the message at the top of the page. If the page tree is scrolled down, the user will see that the illegal move move was reverted, but will not see the message, which is unsettling! Perhaps we should scroll to the top when the message is displayed? Any better solutions? or is it not big of an issue? Unless I'm missing something from when I tested it, this isn't an issue - since you call location.reload() on error the user should always be put back to the top of the screen, where they'll see the message. -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Stephen McDonald http://jupo.org -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Re: Proposal: can_move permission (was: page_move signals)
Pull request implementing can_move during page moves only: https://bitbucket.org/stephenmcd/mezzanine/pull-request/64/ - Interface: can_move(request, new_parent) . Raises a PageMoveException if permission is denied. Does not return anything. - Docs included. - Not called during page creation, as explained in the included docs. - Uses Django messages to display a message in case the move is denied. Message defaults to Illegal page move, but can be overridden as shown in an example in the included docs. -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Re: Proposal: can_move permission (was: page_move signals)
Looks great Ahmad, thanks a lot for putting up with all my feedback. I'll try and merge this in before the next release which I hope to get out over the next day or so. On Sun, Jun 8, 2014 at 12:35 AM, Ahmad Khayyat akhay...@gmail.com wrote: Pull request implementing can_move during page moves only: https://bitbucket.org/stephenmcd/mezzanine/pull-request/64/ - Interface: can_move(request, new_parent) . Raises a PageMoveException if permission is denied. Does not return anything. - Docs included. - Not called during page creation, as explained in the included docs. - Uses Django messages to display a message in case the move is denied. Message defaults to Illegal page move, but can be overridden as shown in an example in the included docs. -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Stephen McDonald http://jupo.org -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Re: Proposal: can_move permission (was: page_move signals)
There is one issue with the current approach. The exception message is shown using Django messages, which displays the message at the top of the page. If the page tree is scrolled down, the user will see that the illegal move move was reverted, but will not see the message, which is unsettling! Perhaps we should scroll to the top when the message is displayed? Any better solutions? or is it not big of an issue? -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Re: Proposal: can_move permission (was: page_move signals)
I'm for it given a few outstanding things: - If this only occurs in the move view now, I don't think we need the three-tuple return from can_move. Let's just have the api be raising a PageMoveException that can include the error message in it. - Need to document this (there's already a Page permissions section). - Need to include some tests. On Fri, Jun 6, 2014 at 9:05 PM, Ahmad Khayyat akhay...@gmail.com wrote: Is there no interest in this feature? I kinda need it right now. Can we decide one way or the other? The code is already there. Calling can_move() during page creation is separated into its own commit. Pull request: https://bitbucket.org/stephenmcd/mezzanine/pull-request/63/ -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Stephen McDonald http://jupo.org -- You received this message because you are subscribed to the Google Groups Mezzanine Users group. To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.