obshtestvo / signali

Signali.bg
https://signali.obshtestvo.bg
Other
0 stars 0 forks source link

Consider using template tags for data-dependent elements #5

Closed antitoxic closed 9 years ago

antitoxic commented 9 years ago

The main theme for signali uses web-component-like frontend.

Web-components themselves are quite encapsulated. Some of them depend on server-data.

Consider extracting the html in templatetag. Example: https://github.com/obshtestvo/obshtestvo.bg/blob/user_invitation/web/templatetags/dev.py#L19

An argument against is that the html in that templatetag is fixed and can't be changed from the template of the loading page. Parameters can be passed to be used with conditional blocks, but this doesn't feel flexible.

antitoxic commented 9 years ago

Even more:

Don't use context_processors because they are not very pythonic, they are not explicit template dependencies.

Use tags even just simple tag that just return settings.SOME_SETTING

antitoxic commented 9 years ago

It's currenly how it's developed and so far there's no hiccups.

antitoxic commented 9 years ago

Already the norm. The template tags were moved to the theme directory as they are theme-specific.