Merge pull request #613 from woorst/mark_edited
Indicate edited submissions/comments.
This commit is contained in:
@@ -162,6 +162,11 @@ class Content(object):
|
|||||||
data['stickied'] = stickied
|
data['stickied'] = stickied
|
||||||
data['hidden'] = False
|
data['hidden'] = False
|
||||||
data['saved'] = comment.saved
|
data['saved'] = comment.saved
|
||||||
|
if comment.edited:
|
||||||
|
data['edited'] = '(edit {})'.format(
|
||||||
|
cls.humanize_timestamp(comment.edited))
|
||||||
|
else:
|
||||||
|
data['edited'] = ''
|
||||||
else:
|
else:
|
||||||
# Saved comments don't have a nested level and are missing a couple
|
# Saved comments don't have a nested level and are missing a couple
|
||||||
# of fields like ``submission``. As a result, we can only load a
|
# of fields like ``submission``. As a result, we can only load a
|
||||||
@@ -191,6 +196,11 @@ class Content(object):
|
|||||||
data['author'] = author
|
data['author'] = author
|
||||||
data['flair'] = flair
|
data['flair'] = flair
|
||||||
data['hidden'] = False
|
data['hidden'] = False
|
||||||
|
if comment.edited:
|
||||||
|
data['edited'] = '(edit {})'.format(
|
||||||
|
cls.humanize_timestamp(comment.edited))
|
||||||
|
else:
|
||||||
|
data['edited'] = ''
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
@@ -237,6 +247,14 @@ class Content(object):
|
|||||||
data['xpost_subreddit'] = None
|
data['xpost_subreddit'] = None
|
||||||
data['index'] = None # This is filled in later by the method caller
|
data['index'] = None # This is filled in later by the method caller
|
||||||
data['saved'] = sub.saved
|
data['saved'] = sub.saved
|
||||||
|
if sub.edited:
|
||||||
|
data['edited'] = '(edit {})'.format(
|
||||||
|
cls.humanize_timestamp(sub.edited))
|
||||||
|
data['edited_long'] = '(edit {})'.format(
|
||||||
|
cls.humanize_timestamp(sub.edited, True))
|
||||||
|
else:
|
||||||
|
data['edited'] = ''
|
||||||
|
data['edited_long'] = ''
|
||||||
|
|
||||||
if sub.url.split('/r/')[-1] == sub.permalink.split('/r/')[-1]:
|
if sub.url.split('/r/')[-1] == sub.permalink.split('/r/')[-1]:
|
||||||
data['url'] = 'self.{0}'.format(data['subreddit'])
|
data['url'] = 'self.{0}'.format(data['subreddit'])
|
||||||
|
|||||||
@@ -363,7 +363,8 @@ class SubmissionPage(Page):
|
|||||||
|
|
||||||
attr = self.term.attr('Created')
|
attr = self.term.attr('Created')
|
||||||
self.term.add_space(win)
|
self.term.add_space(win)
|
||||||
self.term.add_line(win, '{created}'.format(**data), attr=attr)
|
self.term.add_line(win, '{created}{edited}'.format(**data),
|
||||||
|
attr=attr)
|
||||||
|
|
||||||
if data['gold']:
|
if data['gold']:
|
||||||
attr = self.term.attr('Gold')
|
attr = self.term.attr('Gold')
|
||||||
@@ -434,7 +435,8 @@ class SubmissionPage(Page):
|
|||||||
|
|
||||||
attr = self.term.attr('Created')
|
attr = self.term.attr('Created')
|
||||||
self.term.add_space(win)
|
self.term.add_space(win)
|
||||||
self.term.add_line(win, '{created_long}'.format(**data), attr=attr)
|
self.term.add_line(win, '{created_long}{edited_long}'.format(**data),
|
||||||
|
attr=attr)
|
||||||
|
|
||||||
row = len(data['split_title']) + 2
|
row = len(data['split_title']) + 2
|
||||||
if data['url_full'] in self.config.history:
|
if data['url_full'] in self.config.history:
|
||||||
|
|||||||
@@ -353,7 +353,8 @@ class SubredditPage(Page):
|
|||||||
self.term.add_space(win)
|
self.term.add_space(win)
|
||||||
|
|
||||||
attr = self.term.attr('Created')
|
attr = self.term.attr('Created')
|
||||||
self.term.add_line(win, '{created}'.format(**data), attr=attr)
|
self.term.add_line(win, '{created}{edited}'.format(**data),
|
||||||
|
attr=attr)
|
||||||
|
|
||||||
if data['comments'] is not None:
|
if data['comments'] is not None:
|
||||||
attr = self.term.attr('Separator')
|
attr = self.term.attr('Separator')
|
||||||
|
|||||||
Reference in New Issue
Block a user