Skip to content
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

Inconsistent capitalization in exercises. #232

Closed
ghost opened this issue Nov 7, 2015 · 4 comments
Closed

Inconsistent capitalization in exercises. #232

ghost opened this issue Nov 7, 2015 · 4 comments
Milestone

Comments

@ghost
Copy link

ghost commented Nov 7, 2015

In the exercise list there are all manner of capitalization schemes (or lack thereof). Looks kinda sloppy. I'd suggest doing some formatting when they are submitted.

@rolandgeider
Copy link
Member

I've tried this on the template (but if we do it it would be necessary to actually save the new name in the database). While the English names look much better, there are a couple of ones in German that look ugly as they have some abbreviations in the name, e.g. "something KH" (Kurzhantel, dumbbell) becomes "Something Kh". I'd need to check if actually writing the whole name out would change any layouts for the worse.

@purplebird do you want to implement this? It would be best to do this using signals, then we make sure that the name is always capitalized

bildschirmfoto am 2015-11-07 um 10 44 06

bildschirmfoto am 2015-11-07 um 10 42 42

@ghost
Copy link
Author

ghost commented Nov 7, 2015

@rolandgeider Wouldn't even know where to start...!

@rolandgeider
Copy link
Member

Adding the bitesize tag because this should be relatively simple to implement. My suggestions:

  • For backwards compatibility, add a new field in the exercise model, name_original or similar
  • Add a new migration that copies the current content of name to it, so we always can get back to the original in case something goes wrong.
  • When an exercise is created or saved, a signal takes care of updating the name field (when creating, the user's input is copied to name_original). For something similar see e.g. this blog post

As for how to implement a capitalizer, I'd first start with a naive and simple approach (django's is too smart), the python-built-in capitalize() might be enough.

Also note that the exercise overview is cached, you can clear the cache with python manage.py clear-cache --clear-all (you might also have to restart the server)

@rolandgeider
Copy link
Member

Fixed, will update the website one of these days

@rolandgeider rolandgeider added this to the 1.8 milestone Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant