diff --git a/rtv/content.py b/rtv/content.py index 69a0ea4..06c535a 100644 --- a/rtv/content.py +++ b/rtv/content.py @@ -108,6 +108,7 @@ class BaseContent(object): data['url_full'] = sub.url data['url'] = ('selfpost' if is_selfpost(sub.url) else sub.url) data['likes'] = sub.likes + data['gold'] = sub.gilded > 0 return data diff --git a/rtv/submission.py b/rtv/submission.py index 185003d..35089fc 100644 --- a/rtv/submission.py +++ b/rtv/submission.py @@ -241,7 +241,11 @@ class SubmissionPage(BasePage): win.addnstr(row, 1, text, n_cols) row = len(data['split_title']) + len(split_text) + 3 - text = clean(u'{score} {comments}'.format(**data)) + text = clean(u'{score} {comments} '.format(**data)) win.addnstr(row, 1, text, n_cols, curses.A_BOLD) + if data['gold']: + text, attr = GOLD, (curses.A_BOLD | Color.YELLOW) + win.addnstr(text, n_cols - win.getyx()[1], attr) + win.border() diff --git a/rtv/subreddit.py b/rtv/subreddit.py index 3d8c277..90307a5 100644 --- a/rtv/subreddit.py +++ b/rtv/subreddit.py @@ -9,8 +9,8 @@ from .submission import SubmissionPage from .content import SubredditContent from .helpers import clean, open_browser, open_editor from .docs import SUBMISSION_FILE -from .curses_helpers import (BULLET, UARROW, DARROW, Color, LoadScreen, - show_notification) +from .curses_helpers import (BULLET, UARROW, DARROW, GOLD, Color, + LoadScreen, show_notification) __all__ = ['opened_links', 'SubredditController', 'SubredditPage'] @@ -171,9 +171,13 @@ class SubredditPage(BasePage): text, attr = DARROW, curses.A_BOLD | Color.RED win.addnstr(text, n_cols - win.getyx()[1], attr) - text = clean(u' {created} {comments}'.format(**data)) + text = clean(u' {created} {comments} '.format(**data)) win.addnstr(text, n_cols - win.getyx()[1]) + if data['gold']: + text, attr = GOLD, (curses.A_BOLD | Color.YELLOW) + win.addnstr(text, n_cols - win.getyx()[1], attr) + row = n_title + offset + 2 if row in valid_rows: text = clean(u'{author}'.format(**data))