You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was triggered by #2337 and exists only as a brainstorming place. It might be closed without any resolution (What we have currently is working).
Two things which are feeling itchy
The tight coupling in between the views and the templates for navigation
The number of views necessary for content which are basically doing nothing except doing the same thing. :) returning the templates.
There might be solution for both of them separately. And ways to thing about it.
for example, we can imagine that we have a dictionary with all the contents. OR a JSON.
The dictionary can be dynamically built from static files when we start the project. Or anything.
The dictionary will have the notion of
hierarchy the content is part of
the prose reference or the prose itself.
titles, etc.
anything…
Just prototyping something. We need to find better ways.
contents= {
'reproduce-bug': {'part_of': 'contributors', 'prose': 'reproduce.html'},
'report-bug': {'part_of': 'contributors', 'prose': 'report.html'},
# etc
}
# in views.py we can have the content passed to the template and its position in the hierarchy.# This would reduce greatly the number of files in templates.defcontributors('/contributors/<content_id>'):
"""Handles all routes for contributors section."""ifcontent_idincontents['content_id']:
page=contents['content_id']
# the upper section it is part ofpart_of=page['part_of']
# The text of this page, so not part anymore of the templatesprose=get_content_file(page['prose'])
# etc.returnrender_template('contributors', part_of=part_of, prose=prose)
abort(404)
The text was updated successfully, but these errors were encountered:
I think the general direction in your first comment is interesting, and worth experimenting with. views.py gets to be filled with what seems like boilerplate for those mostly static pages, which seems like the right time to simplify.
This issue was triggered by #2337 and exists only as a brainstorming place. It might be closed without any resolution (What we have currently is working).
Two things which are feeling itchy
There might be solution for both of them separately. And ways to thing about it.
for example, we can imagine that we have a dictionary with all the contents. OR a JSON.
The dictionary can be dynamically built from static files when we start the project. Or anything.
The dictionary will have the notion of
Just prototyping something. We need to find better ways.
The text was updated successfully, but these errors were encountered: