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

Make Menu.get_template neutral to template engine #190

Merged
merged 5 commits into from
Nov 15, 2017

Conversation

hongquan
Copy link
Contributor

@hongquan hongquan commented Nov 9, 2017

This is to make wagtailmenus work with Jinja2 template engine (#89).

The PR makes change in one internal API: The Menu.get_template() now return instance of Template class in django.template.backends, not django.template.base.Template class.

There is change in internal API: The `Menu.get_template()` now return the
instance of Template class in `django.template.backends`, not
`django.template.base.Template` class.
@hongquan hongquan mentioned this pull request Nov 9, 2017
@ababic
Copy link
Collaborator

ababic commented Nov 9, 2017

Hi @hongquan,

Thank you for this. It looks as though the Travis CI integration hasn't worked for this PR (I'm unsure why). Would you possibly be able to make a very minimal commit, and we'll see if Travis CI will do it's thing?

@hongquan
Copy link
Contributor Author

hongquan commented Nov 9, 2017

I've just added 1 commit.

@ababic
Copy link
Collaborator

ababic commented Nov 9, 2017

Hi @hongquan,

Travis CI is failing to build with a 'Abuse detected' message for some reason. I've just opened a ticket with their support team to see why this is happening.

@ababic
Copy link
Collaborator

ababic commented Nov 10, 2017

Hi @hongquan,

I have the following feedback from the Travis team:

If a user- or the organization the pull request is coming from- hasn't ever used Travis before, our system will automatically flag the pull request. It looks like no user with push access to the AgriConnect org has used Travis- at least, not since that org was created. The solution here would be for the user who created the pull request to log into travis-ci.org and sync their account- after that, they should be good go, and if that doesn't work, they'll be in our system so we can manually flag it as not abusive.

Are you okay to try signing up for an account on travis-ci.org using you github account? It sounds like that might solve the problem.

Thanks :)

@hongquan
Copy link
Contributor Author

I have just grant Travis CI access to AgriConnect. Hope it will help.
screenshot from 2017-11-12 19-10-16

@ababic
Copy link
Collaborator

ababic commented Nov 12, 2017

Thanks @hongquan. If you could just make another small commit, we'll see if it worked :) maybe just change your name in contributors, then commit a fix for it after?

@hongquan
Copy link
Contributor Author

I have to do this in Travis CI to make it able to build:

screenshot from 2017-11-13 11-01-51

@codecov
Copy link

codecov bot commented Nov 13, 2017

Codecov Report

Merging #190 into master will decrease coverage by 0.07%.
The diff coverage is 86.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #190      +/-   ##
==========================================
- Coverage   97.08%   97.01%   -0.08%     
==========================================
  Files          73       73              
  Lines        2644     2644              
==========================================
- Hits         2567     2565       -2     
- Misses         77       79       +2
Impacted Files Coverage Δ
wagtailmenus/models/mixins.py 100% <100%> (ø) ⬆️
wagtailmenus/models/menus.py 97.3% <80%> (-0.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bacdd86...f0aed87. Read the comment docs.

@ababic
Copy link
Collaborator

ababic commented Nov 14, 2017

Hi @hongquan,

Thank you for your time in putting this together. I'm happy enough with the code changes here, but I'm not quite sure about making these additions to the documentation just yet - I think I would rather those be added separately as another pull, along with some other things, such as:

  1. Adding a complete Jinja extension to wagtailmenus (making all tags available, not just flat_menu and sub_menu) so that users don't need to create their own.
  2. Updating the test suite settings to support Jinja templates and make use of the extension.
  3. Adding Jinja page/menu templates to the test app and testing the HTML output of all tags to ensure the output is as expected.

The instructions can then be simplified, and we'll have a working settings configuration that we can point developers to in case they'd rather look at / copy from a working implementation.

Does this sound okay to you?

@hongquan
Copy link
Contributor Author

It is OK to me. Do I need to revert the commit of updating documentation?

@ababic
Copy link
Collaborator

ababic commented Nov 14, 2017

@hongquan Yes, if you wouldn't mind :)

@@ -7,3 +7,4 @@ Rendering menus

template_tag_reference
custom_templates
use_with_jinja2
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove this for now - We'll work on Jinja-specific stuff as a separate piece of work :)

{{ main_menu() }}
</div>


Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove this file for now - We'll work on Jinja-specific stuff as a separate piece of work :)

@hongquan
Copy link
Contributor Author

I removed the docs.

@ababic ababic merged commit b2ca4cd into jazzband:master Nov 15, 2017
@ababic
Copy link
Collaborator

ababic commented Nov 15, 2017

Big thanks @hongquan :) This has now been merged

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