Making the user page titles a little fancier

This commit is contained in:
Michael Lazar
2018-10-02 00:51:10 -04:00
parent 510f3538da
commit 81e90fccfb
11 changed files with 4886 additions and 5447 deletions

View File

@@ -395,11 +395,20 @@ class Page(object):
pass
elif '/m/' in sub_name:
_, _, user, _, multi = parts
sub_name = '{} curated by {}'.format(multi, user)
sub_name = '{} Curated by {}'.format(multi, user)
elif parts[1] == 'u':
noun = 'My' if parts[2] == 'me' else parts[2] + "'s"
user_room = {3: 'overview', 4: parts[-1]}[len(parts)].capitalize()
sub_name = "{} {}".format(noun, user_room)
user_room = parts[3] if len(parts) == 4 else 'overview'
title_lookup = {
'overview': 'Overview',
'submitted': 'Submissions',
'comments': 'Comments',
'saved': 'Saved Content',
'hidden': 'Hidden Content',
'upvoted': 'Upvoted Content',
'downvoted': 'Downvoted Content'
}
sub_name = "{} {}".format(noun, title_lookup[user_room])
query = self.content.query
if query: