How can I do this cleanly in a Django template? Basically if A, or (B and C) , I want to show some HTML.
I basically have this:
{% if user.is_admin or something.enable_thing and user.can_do_the_thing %}
Now, thats a bit ambigious. I tried doing
{% if user.is_admin or (something.enable_thing and user.can_do_thething) %}
But you arent allowed Parentheses. The docs say to use nested ifs (or elifs in this case, i guess, as its an OR) , but I dont want to repeat the same HTML inside 2 if blocks, which sounds horrible.
ifblock, hence clearly framework does not support what you are asking for get over with it and move your complex logic to template tags or views.