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

Re-jig to only use ajax where required #806

Merged
merged 2 commits into from
Apr 23, 2024
Merged

Conversation

hyanwong
Copy link
Member

@hyanwong hyanwong commented Apr 16, 2024

This seems to work, and is running on beta.onezoom.org as of Tue 16th Apr 2024

@hyanwong
Copy link
Member Author

hyanwong commented Apr 16, 2024

@lentinj - I would appreciate an extra eye on this to see if it is the right sort of thing. It fixes #794 as far as I can see. I'm slightly worried that the included files need to be imported in a particular order. I assume that it's sensible to break down the files into web2py.html and web2py_ajax.html (the second requires the first to be loaded, and is only added to pages that use the Ajax functionality).

@hyanwong
Copy link
Member Author

This also sorts the double inclusion of OZui.js. As I understand, 'OZ_main.html' loads the entire tree viewer codebase (including OZui.js), whereas 'OZui.html' just includes OZui.js for when we need the leaf-drawing code and the search functionality.

However, via 'uikit_layout.html', we include 'OZ_main.html' in all the top-level site pages, e.g. https://beta.onezoom.org/about.html, even when we don;t need to draw a tree. I think we only need the tree drawing code on the front page (for the animation), so perhaps we should change `uikit_layout.html' to include only 'OZui.html', and find a way to make an exception for the front page?

@lentinj
Copy link
Collaborator

lentinj commented Apr 17, 2024

I assume that it's sensible to break down the files into web2py.html and web2py_ajax.html

I wonder if our life would be easier if we stop using the response.files mechanism entirely, removing the need for web2py.html? I think it's just getting in our way looking at the contents of this pull request, but it could well be used elsewhere.

so perhaps we should change `uikit_layout.html' to include only 'OZui.html', and find a way to make an exception for the front page?

Having 2 includes, one just for the treeviewer and one just for OZui, would make things a lot easier to understand, as well as meaning we can do things like the above. Shall I pick this up on MondayTuesday?

@hyanwong
Copy link
Member Author

I assume that it's sensible to break down the files into web2py.html and web2py_ajax.html

I wonder if our life would be easier if we stop using the response.files mechanism entirely, removing the need for web2py.html? I think it's just getting in our way looking at the contents of this pull request, but it could well be used elsewhere.

We need the Ajax stuff for sponsor-leaf, and I suspect for some of the management pages. Using response.files also means we avoid duplicate-imports, so I'm happy to keep it.

so perhaps we should change `uikit_layout.html' to include only 'OZui.html', and find a way to make an exception for the front page?

Having 2 includes, one just for the treeviewer and one just for OZui, would make things a lot easier to understand, as well as meaning we can do things like the above. Shall I pick this up on MondayTuesday?

Sure. Although I think it is actually done already (as in, we should either include 'OZ_main.html' or 'OZui.html', but not both). The first if we want the tree viewer, the second if all we need is the leaf daring and search part of the tree viewer functionality. I think that was the idea when it was set up too.

@hyanwong
Copy link
Member Author

We need the Ajax stuff for sponsor-leaf, and I suspect for some of the management pages

I just remembered - we use web2py Ajax functionality substantially in the page that allows us to verify sponsorships.

Having one include contain both entrypoints and the other only
including one is confusing. Replace OZ_main with explicit OZentry/OZui
include files.

Add support for multiple includes to partial_install, so we can add
both includes to minlife.html.
@lentinj
Copy link
Collaborator

lentinj commented Apr 23, 2024

@hyanwong I think this all looks good. In addition I've replaced OZ_main.html with OZentry.html that does the more obvious thing of including just OZentry.js. Happy to merge if you are.

@hyanwong hyanwong merged commit 845dd20 into OneZoom:main Apr 23, 2024
1 check passed
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.

None yet

2 participants