added gold symbol to submissions
This commit is contained in:
@@ -108,6 +108,7 @@ class BaseContent(object):
|
|||||||
data['url_full'] = sub.url
|
data['url_full'] = sub.url
|
||||||
data['url'] = ('selfpost' if is_selfpost(sub.url) else sub.url)
|
data['url'] = ('selfpost' if is_selfpost(sub.url) else sub.url)
|
||||||
data['likes'] = sub.likes
|
data['likes'] = sub.likes
|
||||||
|
data['gold'] = sub.gilded > 0
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|||||||
@@ -220,9 +220,13 @@ class SubmissionPage(BasePage):
|
|||||||
attr = curses.A_BOLD | Color.YELLOW
|
attr = curses.A_BOLD | Color.YELLOW
|
||||||
text = clean(u' {flair}'.format(**data))
|
text = clean(u' {flair}'.format(**data))
|
||||||
win.addnstr(text, n_cols - win.getyx()[1], attr)
|
win.addnstr(text, n_cols - win.getyx()[1], attr)
|
||||||
text = clean(u' {created} {subreddit}'.format(**data))
|
text = clean(u' {created} {subreddit} '.format(**data))
|
||||||
win.addnstr(text, n_cols - win.getyx()[1])
|
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 = len(data['split_title']) + 2
|
row = len(data['split_title']) + 2
|
||||||
attr = curses.A_UNDERLINE | Color.BLUE
|
attr = curses.A_UNDERLINE | Color.BLUE
|
||||||
text = clean(u'{url}'.format(**data))
|
text = clean(u'{url}'.format(**data))
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ from .page import BasePage, Navigator, BaseController
|
|||||||
from .submission import SubmissionPage
|
from .submission import SubmissionPage
|
||||||
from .content import SubredditContent
|
from .content import SubredditContent
|
||||||
from .helpers import clean, open_browser
|
from .helpers import clean, open_browser
|
||||||
from .curses_helpers import (BULLET, UARROW, DARROW, Color, LoadScreen,
|
from .curses_helpers import (BULLET, UARROW, DARROW, GOLD, Color,
|
||||||
show_notification)
|
LoadScreen, show_notification)
|
||||||
|
|
||||||
__all__ = ['opened_links', 'SubredditController', 'SubredditPage']
|
__all__ = ['opened_links', 'SubredditController', 'SubredditPage']
|
||||||
|
|
||||||
@@ -131,9 +131,13 @@ class SubredditPage(BasePage):
|
|||||||
text, attr = DARROW, curses.A_BOLD | Color.RED
|
text, attr = DARROW, curses.A_BOLD | Color.RED
|
||||||
win.addnstr(text, n_cols - win.getyx()[1], attr)
|
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])
|
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
|
row = n_title + offset + 2
|
||||||
if row in valid_rows:
|
if row in valid_rows:
|
||||||
text = clean(u'{author}'.format(**data))
|
text = clean(u'{author}'.format(**data))
|
||||||
|
|||||||
Reference in New Issue
Block a user