-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the way that game descriptions are displayed #258
Comments
One way we could shorten the description is with the built in Django |
Created branch |
I think I found a fix for the special XML characters that show up in descriptions. It requires manipulating the XML output from the BGG API call before we save them into the fixtures or use them for autofill. It will look something like this: import xml.etree.ElementTree as ET
import xml.sax.saxutils
game_url = f"https://www.boardgamegeek.com/xmlapi2/thing?id={id}&stats=1"
game_response = requests.get(game_url)
text = xml.sax.saxutils.unescape(game_response.text)
game = ET.fromstring(text) I've opened a new issue #283 to address this. |
FYI it is better for readability and accessibility to not add a hyperlink to one work. Since there are folks who for whatever reason might not be able to distinguish the link color from the background / other characters. As well as the link being quite small (since here is only 4 letters). Best practice for maximizing readability and making it easier to click and interact with is to add "here: https://docs.djangoproject.com/en/4.2/ref/templates/builtins/?from=olddocs#truncatechars " I've had issues in my own job at CSIL where my boss has not been able to read someone documentation because they kept using these markdown hyperlinks. Happy to explain more if you'd like! |
Closing comments: This issue started with the observations that descriptions from BGG are far longer than our UI is built to support, and they have special XML characters. I opened issue #283 to address the XML characters. The outcome of this issue was to truncate descriptions on cards to 20 words and decrease the size of the descriptions on game detail pages. I've suggested adding a "short description" field from BGG that can fill the place of where the old description used to be. |
Issue Score: Excellent Comments: Thank you for you work! |
As of right now, game descriptions make the cards on the game browse page way too long. We need to display a shortened version of the description. There are also several XML special characters like
that we need to interpret correctly.The text was updated successfully, but these errors were encountered: