#654 - fix the showing of static pages with underscore#676
#654 - fix the showing of static pages with underscore#676miroslavt wants to merge 1 commit intoliqd:developfrom
Conversation
|
Thanks for the PR! However the However you're completly right - the edit and update URLs are poorly designed, they shouldn't rely on the underscore to determine the chosen language. I'd rather suggest to use query parameters for that and change urls to Another small note: When fixing multiple things in one PR, I'd favor to use multiple commits (e.g. |
|
I was thinking about asking you about edit() and update() but from what I saw in the code it seemed to me that they are not used. So I did the quick and dirty fix. I have just activated the static page administration and I see that it is working quite well. I will go and make a real fix this time. How about making the changes in this way. /static/{key}{.format} is reserved for serve() only. It stays last in the routing list. Then we devise a new URL format /static/{key}/edit/{lang}. GET and HEAD are for edit() and POST is for update(). This way the language is passed in the REST style and {.format} goes away from editing - there is no meaning in showing the editing form via overlay. |
Great!
Yep, I'm fine with this. |
Everything will be better once #676 is done.
The main fix is in routing.py. I moved '/static/{key}{.format}' up in the list so that the two rules with "_" do not mess it. The actions "edit" and "update" should not rely on underscores to match their URLs. Some other matching should be devised. This should be part of their implementation.
StaticController.serve() is a fix - "http://host/static/about" causes an error without it.
The other changes in StaticController are just for consistency. These methods are not used anyway.