mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Citations screen
							parent
							
								
									f84e58ae0b
								
							
						
					
					
						commit
						bdc2594529
					
				|  | @ -1282,7 +1282,7 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str, | ||||||
|         '      <center>\n' + \ |         '      <center>\n' + \ | ||||||
|         '        <input type="submit" name="submitLinks" value="' + \ |         '        <input type="submit" name="submitLinks" value="' + \ | ||||||
|         translate['Submit'] + '">\n' + \ |         translate['Submit'] + '">\n' + \ | ||||||
|         '      <center>\n' |         '      </center>\n' | ||||||
|     editLinksForm += \ |     editLinksForm += \ | ||||||
|         '    </div>\n' |         '    </div>\n' | ||||||
| 
 | 
 | ||||||
|  | @ -1365,7 +1365,7 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str, | ||||||
|         '      <center>\n' + \ |         '      <center>\n' + \ | ||||||
|         '      <input type="submit" name="submitNewswire" value="' + \ |         '      <input type="submit" name="submitNewswire" value="' + \ | ||||||
|         translate['Submit'] + '">\n' + \ |         translate['Submit'] + '">\n' + \ | ||||||
|         '      <center>\n' |         '      </center>\n' | ||||||
|     editNewswireForm += \ |     editNewswireForm += \ | ||||||
|         '    </div>\n' |         '    </div>\n' | ||||||
| 
 | 
 | ||||||
|  | @ -5855,22 +5855,49 @@ def htmlNewswire(newswire: {}, nickname: str, moderator: bool, | ||||||
| 
 | 
 | ||||||
| def htmlCitations(baseDir: str, nickname: str, domain: str, | def htmlCitations(baseDir: str, nickname: str, domain: str, | ||||||
|                   httpPrefix: str, defaultTimeline: str, |                   httpPrefix: str, defaultTimeline: str, | ||||||
|                   translate: {}, newswire: {}) -> str: |                   translate: {}, newswire: {}, cssCache: {}) -> str: | ||||||
|     """Show the citations screen when creating a blog |     """Show the citations screen when creating a blog | ||||||
|     """ |     """ | ||||||
|     htmlStr = '' |     htmlStr = '' | ||||||
| 
 | 
 | ||||||
|  |     # the css filename | ||||||
|  |     cssFilename = baseDir + '/epicyon-profile.css' | ||||||
|  |     if os.path.isfile(baseDir + '/epicyon.css'): | ||||||
|  |         cssFilename = baseDir + '/epicyon.css' | ||||||
|  | 
 | ||||||
|  |     profileStyle = getCSS(baseDir, cssFilename, cssCache) | ||||||
|  |     if profileStyle: | ||||||
|  |         # replace any https within the css with whatever prefix is needed | ||||||
|  |         if httpPrefix != 'https': | ||||||
|  |             profileStyle = \ | ||||||
|  |                 profileStyle.replace('https://', httpPrefix + '://') | ||||||
|  | 
 | ||||||
|  |     # iconsDir = getIconsDir(baseDir) | ||||||
|  | 
 | ||||||
|  |     htmlStr = htmlHeader(cssFilename, profileStyle) | ||||||
|  | 
 | ||||||
|     # top banner |     # top banner | ||||||
|     bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain) |     bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain) | ||||||
|     htmlStr += \ |     htmlStr += \ | ||||||
|         '<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \ |         '<a href="/users/' + nickname + '/newblog" title="' + \ | ||||||
|         translate['Switch to timeline view'] + '" alt="' + \ |         translate['Go Back'] + '" alt="' + \ | ||||||
|         translate['Switch to timeline view'] + '">\n' |         translate['Go Back'] + '">\n' | ||||||
|     htmlStr += '<img loading="lazy" class="timeline-banner" src="' + \ |     htmlStr += '<img loading="lazy" class="timeline-banner" src="' + \ | ||||||
|         '/users/' + nickname + '/' + bannerFile + '" /></a>\n' |         '/users/' + nickname + '/' + bannerFile + '" /></a>\n' | ||||||
| 
 | 
 | ||||||
|     # TODO add submit button |     # submit button | ||||||
|  |     htmlStr += \ | ||||||
|  |         '<form enctype="multipart/form-data" method="POST" ' + \ | ||||||
|  |         'accept-charset="UTF-8" action="/users/' + nickname + \ | ||||||
|  |         '/citationsdata">\n' | ||||||
|  |     htmlStr += \ | ||||||
|  |         '  <center>\n' + \ | ||||||
|  |         '    <input type="submit" name="submitCitations" value="' + \ | ||||||
|  |         translate['Submit'] + '">\n' + \ | ||||||
|  |         '  </center>\n' | ||||||
| 
 | 
 | ||||||
|  |     # list of newswire items | ||||||
|  |     if newswire: | ||||||
|         for dateStr, item in newswire.items(): |         for dateStr, item in newswire.items(): | ||||||
|             publishedDate = \ |             publishedDate = \ | ||||||
|                 datetime.strptime(dateStr, "%Y-%m-%d %H:%M:%S%z") |                 datetime.strptime(dateStr, "%Y-%m-%d %H:%M:%S%z") | ||||||
|  | @ -5879,14 +5906,16 @@ def htmlCitations(baseDir: str, nickname: str, domain: str, | ||||||
|             title = removeLongWords(item[0], 16, []).replace('\n', '<br>') |             title = removeLongWords(item[0], 16, []).replace('\n', '<br>') | ||||||
|             link = item[1] |             link = item[1] | ||||||
| 
 | 
 | ||||||
|         # TODO add checkbox |             htmlStr += \ | ||||||
|         htmlStr += '<p class="newswireItem">' + \ |                 '<input type="checkbox" name="citations[]" ' + \ | ||||||
|             '<a href="' + link + '">' + \ |                 'value="' + dateStr + '"/>' + \ | ||||||
|             title + '</a>' |                 '<a href="' + link + '">' + title + '</a> ' | ||||||
|         htmlStr += ' <span class="newswireDate">' |             htmlStr += '<span class="newswireDate">' + \ | ||||||
|         htmlStr += dateShown + '</span></p>\n' |                 dateShown + '</span></p>' | ||||||
|  |             htmlStr += '<br/>\n' | ||||||
| 
 | 
 | ||||||
|     return htmlStr |     htmlStr += '</form>\n' | ||||||
|  |     return htmlStr + htmlFooter() | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def getRightColumnContent(baseDir: str, nickname: str, domainFull: str, | def getRightColumnContent(baseDir: str, nickname: str, domainFull: str, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue