lupinia / awi

Full Lupinia/Awi website, built with Django
https://www.lupinia.net/
2 stars 1 forks source link

Sunset: Improve consistency of sidebar vs main body description display #122

Closed lupinia closed 1 year ago

lupinia commented 1 year ago

This has been a longstanding issue, and a messy one to solve, because it involves a bit of a collision between what makes sense for metadata management, and what makes sense for interface logic.

At a model level, every image has two text fields - a summary, which is limited to 255 characters, and a description, which is a text field of unlimited length.

On the main detail page for an image, there are basically two display modes. The primary mode puts the image title and description in a sidebar widget, and is meant for images with a short description (short enough to fit entirely in the Summary field), or none at all. The secondary mode is a more conventional layout, with the title above the image, and the description below, meant for images with a longer description. So, what's supposed to happen is that if the description is short enough to fit entirely in the summary, or if there's no description at all, it should use the title-in-sidebar mode.

At some point in the past, I started adding the description to both fields during import, because both fields are necessary at different times, even if they contain the same information, which is breaking the previous logic for selecting between these modes. Thus, it effectively defaults to the long-description display mode for everything now. So, I think the solution will be to switch the selection logic to use the title-in-sidebar mode by default, unless the Description field is present and longer than the Summary field. Additionally, to streamline the template code a bit, I want to move this logic entirely into the view.