ASKBOT / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
1.56k stars 627 forks source link

Make Askbot flexible again #821

Closed martin-bts closed 5 years ago

martin-bts commented 5 years ago

OrderedDict does not have a method insert (anymore?). However, a call to it is in the code that adds an authentication provider to django_authopenid through the app's settings.py. Having applied the first patch I was able to add a local OAuth2 provider without (further) touching the code of django_authopenid.

The second patch makes Jinja2 look for templates in a skin's directory. If I understand Jinja2's internals correctly, it first searches for a template in the skin dir and then its other dirs. Skins should now be able to replace individual template files. For my test setup I chose a value for ASKBOT_EXTRA_SKINS_DIR (i.e., an absolute path) that ends with themes. The layout of my test skin mySkin then looks like this:

themes/
themes/mySkin
themes/mySkin/jinja2
themes/mySkin/jinja2/base.html
themes/mySkin/media
themes/mySkin/media/style
themes/mySkin/media/style/style.css
themes/mySkin/media/images
themes/mySkin/media/images/nophoto.png

With my webbrowser I was able to confirm that Askbot did indeed use base.html, style.css and nophoto.png from themes/mySkin.