-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Template paths and redirects #298
Conversation
2f44571
to
9081f37
Compare
Not sure what is wrong with this: https://anvil.works/build#clone:KFF6KEV4NDMJJK5U=JI5EORBERTEDFD7AG4O5WTGW When I run it under the regular development version of anvil_extras, it shows the public home page when run. When run under the clone version it does not show the home page. I've commented out the redirect and login template for now. |
oh sugar - that should be fixed now - trying to prevent an infinite loop caused the first loop to not execute! Fixed - if you're git savy you can clone the anvil-extras-dev locally |
Uncommented out the redirect and login router. The login router intercepts correctly when trying to go to any of its routes. The first run I got an error about self.current not existing in login_click, but after that one run it worked fine. Not sure what that was about. The redirect decorator works great, non-admins are getting redirected to As far as I can tell from the setup I have, it all seems to be working fine. This technique reduces the number of template conditions needed by quite a bit. I only have conditions on my login router and my no admin redirect. By the time it gets to the user or admin routers, I already know the user is logged in and is an admin if they're trying to go to the admin pages. |
So we're calling this branch a win. I'll give it another once over later today side note - i see you're using/experimenting with Tabulator. and my bad for using |
Yeah, I wrote another sample app that included some pages and sidebar links, and everything worked as expected. Definitely a win. |
@jshaffstall this is now on the development branch |
@jshaffstall
attempt number 2.
Maybe you could have a play with it by cloning this version of anvil-extras:
https://anvil.works/build#clone:6ATPRINDTZUXBKSQ=R3XKGGOVQZK6MZVHG36HCTLU
Then changing the dependency to the local copy while we still work out the kinks.
I changed a bunch of logging statements as I was working on it to make it easier to see what was going on.
The api is the one we came up with on the other branch: