Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added blocks for more flexibility with JS #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added blocks for more flexibility with JS #137

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 25, 2017

Added blocks for more flexibility. Specially the ability to create scripts in templates after loading jQuery.
This will allow to include extra js libraries that are large and not needed in every single page. Like openlayers for example.
And also include extra js for single templates.

Added blocks for more flexibility. Specially the ability to create scripts in templates after loading jQuery.
@jtauber
Copy link
Member

jtauber commented Oct 25, 2017

Welcome @jucajuca !

These seem reasonable (although we've oscillated about extra_scripts versus overriding scripts and using super).

One thing that would be really handy (in general, doesn't have to be done in this PR) is documentation on the blocks in PTB. I frequently find myself having to go to base.html to see what they are and this just added to that challenge.

@ghost
Copy link
Author

ghost commented Oct 25, 2017

I see % scripts % more for site wide scripts.
% extra_scripts % would for template specific scripts.
Block.super seems to be also a good solution, but this adds more flexibility. I don't know visiting base.html is almost a must for the development. I ended up overriding it to include these new blocks.

@ghost
Copy link
Author

ghost commented Feb 22, 2018

actually I think that base.html should be copied to the templates of the project. There is no point in hiding it under project/venv/lib/pythonx.x/site-packages/.../.../......
would make things much easier and deliver the same result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants