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

Wash list of theme names #226

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Wash list of theme names #226

wants to merge 6 commits into from

Conversation

hmpf
Copy link
Collaborator

@hmpf hmpf commented Nov 6, 2024

Ensure that the themes shown in the theme-selector are actually installed.

@hmpf hmpf added the bug Something isn't working label Nov 6, 2024
@hmpf hmpf self-assigned this Nov 6, 2024
src/argus_htmx/themes/utils.py Outdated Show resolved Hide resolved
src/argus_htmx/themes/utils.py Outdated Show resolved Hide resolved
src/argus_htmx/settings.py Outdated Show resolved Hide resolved
src/argus_htmx/themes/utils.py Outdated Show resolved Hide resolved
@hmpf hmpf requested a review from elfjes November 13, 2024 08:42
DATA_THEME_RE = f"\[data-theme={THEME_NAME_RE}\]"

static_url = Path(settings.STATIC_URL).relative_to("/")
stylesheet_path = static_url / default_htmx_settings.STYLESHEET_PATH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to look at the django.conf.settings since it might be overridden in another settings file (we do this)

def get_theme_default():
return getattr(settings, "THEME_DEFAULT", argus_htmx_settings.THEME_DEFAULT)
return getattr(settings, "THEME_DEFAULT", default_htmx_settings.THEME_DEFAULT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also look at django.conf.settings

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It already does. default_htmx_settings.THEME_DEFAULT is the fallback.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have renamed "default_htmx_settings" to "fallbacks".

@hmpf hmpf requested a review from elfjes November 13, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Changes requested
Development

Successfully merging this pull request may close these issues.

2 participants