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

Add ability to change base html template #21

Closed
wants to merge 1 commit into from

Conversation

kasun
Copy link
Contributor

@kasun kasun commented Jun 18, 2023

It is not ideal that Neapolitan expects the base html template of the CRUD pages should to named base.html. This PR adds support to change the base html that Neapolitan looks for through settings.

  • Add base html template name to context data.
  • Change all template files to extend the base html template using variable passed in context data.
  • Add ability to read Neapolitan settings from settings file. It expects settings to be in following format.
NEAPOLITAN = {
    "SETTING_NAME": "setting_value",
}
  • Document the way to override the base template name.

I think this is what meant in step 2 of #6. In any case imo this is a must have functionality going forward.

@carltongibson
Copy link
Owner

Hi @kasun — thanks for this. Yes, it's Ref #6.

There's too much going on too quickly here. If we're going to add settings, we'll do that slowly, and not likely via a utils module.

First pass would be to add a class level attribute, that can be overridden (or provided via in initkwarg to as_view()) -- That might not be the final resting place, but it's a vital waypoint: Folks will want to change this per-view.

That will need a test case showing that it can be overridden. (As well as docs in the CRUDView reference.)

Are you up for trimming this back to that as a first step?

Thanks. 🎁

@kasun
Copy link
Contributor Author

kasun commented Jun 19, 2023

Yes sounds good. Can you let me know how to run the tests?

@kasun
Copy link
Contributor Author

kasun commented Jun 20, 2023

I think i got it.

django-admin test --settings=tests.settings --pythonpath=.

@kasun kasun mentioned this pull request Jun 20, 2023
@kasun
Copy link
Contributor Author

kasun commented Jun 20, 2023

Closing this in favor of #24

@kasun kasun closed this Jun 20, 2023
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