From b048d894b7d81b90594eeb6056021bdd62f6869f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Oct 2019 15:27:43 +0100 Subject: [PATCH] Shorten profile description --- webinterface.py | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/webinterface.py b/webinterface.py index 97103985..0c8b7b3b 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1251,18 +1251,26 @@ def htmlProfile(translate: {},projectVersion: str, \ followApprovalsSection+='' followApprovalsSection+='' - profileStr= \ - linkToTimelineStart+ \ - '
' \ + profileDescriptionShort=profileDescription + if '\n' in profileDescription: + if len(profileDescription.split('\n'))>2: + profileDescriptionShort='' + else: + if '
' in profileDescription: + if len(profileDescription.split('
'))>2: + profileDescriptionShort='' + profileHeaderStr= \ + '
' \ '
'+ \ - ' '+nickname+'@'+domainFull+'' \ + ' '+profileDescription+'' \ '

'+displayName+'

' \ '

@'+nickname+'@'+domainFull+'

' \ - '

'+profileDescription+'

'+ \ + '

'+profileDescriptionShort+'

'+ \ loginButton+ \ '
' \ - '
'+ \ - linkToTimelineEnd+ \ + '
' + profileStr= \ + linkToTimelineStart + profileHeaderStr + linkToTimelineEnd + \ '
\n' \ '
' \ ' ' \ @@ -3213,13 +3221,21 @@ def htmlProfileAfterSearch(translate: {}, \ if not backUrl.endswith('/inbox'): backUrl+='/inbox' + profileDescriptionShort=profileDescription + if '\n' in profileDescription: + if len(profileDescription.split('\n'))>2: + profileDescriptionShort='' + else: + if '
' in profileDescription: + if len(profileDescription.split('
'))>2: + profileDescriptionShort='' profileStr= \ '
' \ '
' \ - ' '+searchNickname+'@'+searchDomainFull+'' \ + ' '+profileDescription+'' \ '

'+displayName+'

' \ '

@'+searchNickname+'@'+searchDomainFull+'

' \ - '

'+profileDescription+'

'+ \ + '

'+profileDescriptionShort+'

'+ \ '
' \ '
'+ \ '
\n' \