Skip to content

Tag bootstrap_javascript use settings include_jquery for now #71

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

Merged
merged 6 commits into from
Aug 24, 2018

Conversation

metajiji
Copy link
Contributor

Tag bootstrap_javascript has no way to configure jquery parameter via settings.
Also include_jquery does nothing.
This PR fixes this both issues.

Tag `bootstrap_javascript` has no way to configure `jquery` parameter via settings.
Update docs about `include_jquery` variable
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 86.468% when pulling 7be2b35 on METAJIJI:patch-1 into 4ed4008 on zostera:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 86.468% when pulling 7be2b35 on METAJIJI:patch-1 into 4ed4008 on zostera:master.

@coveralls
Copy link

coveralls commented Mar 11, 2018

Coverage Status

Coverage increased (+0.6%) to 87.064% when pulling 011707a on METAJIJI:patch-1 into 4ed4008 on zostera:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 86.468% when pulling 7be2b35 on METAJIJI:patch-1 into 4ed4008 on zostera:master.

@@ -315,7 +315,7 @@ def bootstrap_javascript(jquery='falsy'):
javascript_tags = []

# Set jquery value from setting or leave default.
jquery = get_bootstrap_setting('include_jquery', jquery)
jquery = get_bootstrap_setting('include_jquery') or jquery
Copy link

@comargo comargo May 16, 2018

Choose a reason for hiding this comment

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

By my opinion it should be better to use next statement:
jquery = jquery or get_bootstrap_setting('include_jquery', 'falsy')
And have jquery = None as default value for function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah right, tnx!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But this not work, because function https://github.com/METAJIJI/django-bootstrap4/blob/patch-1/bootstrap4/bootstrap.py#L61 return False if can't get option!
For example get_bootstrap_setting('include_jquery', 'default_value') - return False :) lol
because BOOTSTRAP4_DEFAULTS['include_jquery'] is False https://github.com/METAJIJI/django-bootstrap4/blob/patch-1/bootstrap4/bootstrap.py#L39

Copy link
Contributor Author

@metajiji metajiji left a comment

Choose a reason for hiding this comment

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

Fixed now.

@@ -315,7 +315,7 @@ def bootstrap_javascript(jquery='falsy'):
javascript_tags = []

# Set jquery value from setting or leave default.
jquery = get_bootstrap_setting('include_jquery', jquery)
jquery = get_bootstrap_setting('include_jquery') or jquery
Copy link
Contributor Author

Choose a reason for hiding this comment

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

But this not work, because function https://github.com/METAJIJI/django-bootstrap4/blob/patch-1/bootstrap4/bootstrap.py#L61 return False if can't get option!
For example get_bootstrap_setting('include_jquery', 'default_value') - return False :) lol
because BOOTSTRAP4_DEFAULTS['include_jquery'] is False https://github.com/METAJIJI/django-bootstrap4/blob/patch-1/bootstrap4/bootstrap.py#L39

@dyve
Copy link
Member

dyve commented Aug 24, 2018

I'm pulling this in and I'll change (and document) falsy.

@dyve dyve merged commit a31dff1 into zostera:master Aug 24, 2018
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

4 participants