DDMAL / CantusDB

A new site for Cantus Database running under Django.
https://cantusdatabase.org
MIT License
5 stars 6 forks source link

Content Overview template could use inline documentation #1328

Open jacobdgm opened 8 months ago

jacobdgm commented 8 months ago

It would be helpful to have some comments added to our content_overview.html template. Starting around here, https://github.com/DDMAL/CantusDB/blob/ec21c33c45a4a2c21b8e0017b06914d2b2472df6/django/cantusdb_project/main_app/templates/content_overview.html#L37

we check:

https://github.com/DDMAL/CantusDB/blob/ec21c33c45a4a2c21b8e0017b06914d2b2472df6/django/cantusdb_project/main_app/templates/content_overview.html#L39 (guessing this matches Sequences? Probably Sources too?)

https://github.com/DDMAL/CantusDB/blob/ec21c33c45a4a2c21b8e0017b06914d2b2472df6/django/cantusdb_project/main_app/templates/content_overview.html#L43 (guessing this matches Chants? But I think it will start matching Sequences too, once #1318 get merged?)

https://github.com/DDMAL/CantusDB/blob/ec21c33c45a4a2c21b8e0017b06914d2b2472df6/django/cantusdb_project/main_app/templates/content_overview.html#L47 (this seems to match Notations, Segments, and RISM Sigla, and probably other things like Genres/Offices/Centuries/etc.?)

https://github.com/DDMAL/CantusDB/blob/ec21c33c45a4a2c21b8e0017b06914d2b2472df6/django/cantusdb_project/main_app/templates/content_overview.html#L55 (this seems to match most (but not all) Users?)

https://github.com/DDMAL/CantusDB/blob/ec21c33c45a4a2c21b8e0017b06914d2b2472df6/django/cantusdb_project/main_app/templates/content_overview.html#L59 (if nothing above matches, we just display <class> Object)

It could be helpful to have comments added to this template outlining what we expect each if/elif to match.

jacobdgm commented 8 months ago

assigning @lucasmarchd01, since you did a bunch of work on this template/view somewhat recently.

jacobdgm commented 8 months ago

A possible refactoring that could happen here is {% if object|classname == "Sequence" %} etc., and handle each case explicitly, rather than handling it based them on some fields that the object may or may not have. If Debra asks for Offices to be displayed in a different way, we don't want a tweak to change how Provenances, say, are displayed.