Remove separate permalink element, just link the timestamp.

master
voussoir 2021-11-04 16:37:37 -07:00
parent 58bcc27051
commit e8107d9678
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 16 additions and 17 deletions

View File

@ -14,18 +14,20 @@ HTML_HEADER = '''
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style> <style>
.comment .submission, .comment
{{ {{
padding-left: 20px; padding-left: 20px;
padding-right: 4px;
}}
.comment
{{
margin-top: 4px; margin-top: 4px;
margin-right: 4px;
margin-bottom: 4px; margin-bottom: 4px;
border: 2px #000 solid; border: 1px solid black;
}} }}
.submission .submission
{{ {{
border: 4px #00f solid; border: 2px solid blue;
padding-left: 20px;
}} }}
.hidden .hidden
{{ {{
@ -68,14 +70,13 @@ HTML_COMMENT = '''
onclick="toggle_collapse(this.parentElement.parentElement)">[-] onclick="toggle_collapse(this.parentElement.parentElement)">[-]
</a> </a>
{usernamelink} {usernamelink}
<span class="score"> | {score} points</span> |
<span class="timestamp"> | {human}</span> <span class="score">{score} points</span>
|
<a class="timestamp" href="{permalink}">{human}</a>
</p> </p>
<div class="collapsible"> <div class="collapsible">
{body} {body}
<p class="toolbar">
{permalink}
</p>
{{children}} {{children}}
</div> </div>
</div> </div>
@ -85,14 +86,13 @@ HTML_SUBMISSION = '''
<div class="submission" id="{id}"> <div class="submission" id="{id}">
<p class="userinfo"> <p class="userinfo">
{usernamelink} {usernamelink}
<span class="score"> | {score} points</span> |
<span class="timestamp"> | {human}</span> <span class="score">{score} points</span>
|
<a class="timestamp" href="{permalink}">{human}</a>
</p> </p>
<strong>{title}</strong> <strong>{title}</strong>
<p>{url_or_text}</p> <p>{url_or_text}</p>
<p class="toolbar">
{permalink}
</p>
</div> </div>
{{children}} {{children}}
'''.strip() '''.strip()
@ -247,14 +247,13 @@ def html_from_tree(tree, sort=None):
def html_helper_permalink(item): def html_helper_permalink(item):
''' '''
Given a submission or a comment, return an <a> tag for its permalink. Given a submission or a comment, return the URL for its permalink.
''' '''
link = 'https://www.reddit.com/r/%s/comments/' % item.subreddit link = 'https://www.reddit.com/r/%s/comments/' % item.subreddit
if item.object_type == 'submission': if item.object_type == 'submission':
link += item.idstr[3:] link += item.idstr[3:]
elif item.object_type == 'comment': elif item.object_type == 'comment':
link += '%s/_/%s' % (item.submission[3:], item.idstr[3:]) link += '%s/_/%s' % (item.submission[3:], item.idstr[3:])
link = '<a href="%s">permalink</a>' % link
return link return link
def html_helper_urlortext(submission): def html_helper_urlortext(submission):