Donation section on profile

main2
Bob Mottram 2019-11-07 10:11:32 +00:00
parent 728c9bfcb6
commit 52ee766989
1 changed files with 9 additions and 7 deletions

View File

@ -1334,13 +1334,15 @@ def htmlProfile(translate: {},projectVersion: str, \
editProfileStr='' editProfileStr=''
actor=profileJson['id'] actor=profileJson['id']
donateLink='' donateSection=''
donateUrl=getDonationUrl(profileJson) donateUrl=getDonationUrl(profileJson)
if donateUrl: if donateUrl:
if authorized: donateSection= \
donateLink+='<br><a href="'+donateUrl+'" class="donateLink">'+translate['Donate']+'</a>' '<div class="container">\n' \
else: ' <center>\n' \
donateLink='<br><a href="'+donateUrl+'"><button class="loginLink">'+translate['Donate']+'</button></a>' ' <a href="'+donateUrl+'"><button class="loginLink">'+translate['Donate']+'</button></a>\n' \
' </center>\n' \
'</div>\n'
if not authorized: if not authorized:
loginButton='<br><a href="/login"><button class="loginButton">'+translate['Login']+'</button></a>' loginButton='<br><a href="/login"><button class="loginButton">'+translate['Login']+'</button></a>'
@ -1402,11 +1404,11 @@ def htmlProfile(translate: {},projectVersion: str, \
' <h1>'+displayName+'</h1>' \ ' <h1>'+displayName+'</h1>' \
' <p><b>@'+nickname+'@'+domainFull+'</b></p>' \ ' <p><b>@'+nickname+'@'+domainFull+'</b></p>' \
' <p>'+profileDescriptionShort+'</p>'+ \ ' <p>'+profileDescriptionShort+'</p>'+ \
loginButton+donateLink+ \ loginButton+ \
' </div>' \ ' </div>' \
'</div>' '</div>'
profileStr= \ profileStr= \
linkToTimelineStart + profileHeaderStr + linkToTimelineEnd + \ linkToTimelineStart + profileHeaderStr + linkToTimelineEnd + donateSection + \
'<div class="container">\n' \ '<div class="container">\n' \
' <center>' \ ' <center>' \
' <a href="'+actor+'"><button class="'+postsButton+'"><span>'+translate['Posts']+' </span></button></a>' \ ' <a href="'+actor+'"><button class="'+postsButton+'"><span>'+translate['Posts']+' </span></button></a>' \