mirror of
https://github.com/twisterarmy/swizzler.git
synced 2025-03-12 05:21:26 +00:00
s/sponsored/promoted/ including major Haiku fix :)
I just noticed that in the standard client they were called "promoted posts" and it *does* sound less tacky because promoted sounds less like a business and more like a cause. Anyway, I think the new Haiku-tooltip has a better flow ;)
This commit is contained in:
parent
bed270aaa4
commit
10a1d2bdd1
18
swizzler.py
18
swizzler.py
@ -84,7 +84,7 @@ class SwizzlerApp(object):
|
||||
@cherrypy.expose
|
||||
def user(self,username='nobody'):
|
||||
if username=='nobody':
|
||||
raise cherrypy.HTTPRedirect('/') # sponsored posts are nobody's profile
|
||||
raise cherrypy.HTTPRedirect('/') # promoted posts are nobody's profile
|
||||
conf = cherrypy.request.app.config['swizzler']
|
||||
twister = Twister(conf['rpc_url'],format_twist)
|
||||
user = twister.get_user_info(username)
|
||||
@ -117,7 +117,7 @@ class SwizzlerApp(object):
|
||||
tag = tag.strip().split(' ')[0]
|
||||
if tag.startswith('#'): tag = tag[1:]
|
||||
if not tag:
|
||||
raise cherrypy.HTTPRedirect('/') # go home to sponsored posts
|
||||
raise cherrypy.HTTPRedirect('/') # go home to promoted posts
|
||||
conf = cherrypy.request.app.config['swizzler']
|
||||
twister = Twister(conf['rpc_url'],format_twist)
|
||||
messages = twister.get_tag_posts(tag)
|
||||
@ -135,7 +135,7 @@ class SwizzlerApp(object):
|
||||
@cherrypy.expose
|
||||
def home(self,localusername='nobody',mode='feed'):
|
||||
if localusername=='nobody':
|
||||
raise cherrypy.HTTPRedirect('/') # sponsored posts are nobody's home
|
||||
raise cherrypy.HTTPRedirect('/') # promoted posts are nobody's home
|
||||
conf = cherrypy.request.app.config['swizzler']
|
||||
twister = Twister(conf['rpc_url'],format_twist)
|
||||
menu = twister.local_user_menu(localusername)
|
||||
@ -181,21 +181,21 @@ class SwizzlerApp(object):
|
||||
def index(self):
|
||||
conf = cherrypy.request.app.config['swizzler']
|
||||
twister = Twister(conf['rpc_url'],format_twist)
|
||||
messages = twister.get_sponsored_posts(conf['num_messages'])
|
||||
messages = twister.get_promoted_posts(conf['num_messages'])
|
||||
result = {
|
||||
'is_user':True, # i.e. we want to display "bio" and not mentions/DMs/profile buttons
|
||||
'is_sponsored':True, # message template needs to know not to show "permalink"
|
||||
'is_promoted':True, # message template needs to know not to show "permalink"
|
||||
'title':"Welcome to Swizzler",
|
||||
'local_users':twister.local_user_menu('')['users'], # '' means: "Nobody" is active
|
||||
'info':twister.get_info(),
|
||||
'subject':{ # pseudo-user describing sponsored posts
|
||||
'fullname':'Sponsored posts',
|
||||
'subject':{ # pseudo-user describing promoted posts
|
||||
'fullname':'Promoted posts',
|
||||
'bio':format_twist("""
|
||||
Mining the twister blockchain protects the #twister-verse from attacks like http://twister.net.co/?p=236
|
||||
but unlike doge, we don't have shiny coins to offer "our protectors".
|
||||
Instead, they enjoy occasional minutes of fame in the form of the sponsored posts you see here.
|
||||
Instead, they enjoy occasional minutes of fame in the form of the promoted posts you see here.
|
||||
We #Respect their hard earned crypto-graffiti by appreciating them on coffee/spliff/soy-milk/etc. breaks, because that's how we roll yo.
|
||||
Start mining today, and all this (AND moral satisfaction) can be yours.""")
|
||||
Start mining today, and this (𝐚𝐧𝐝 moral satisfaction) can be yours.""")
|
||||
},
|
||||
'messages':messages,
|
||||
'any_messages':not not messages,
|
||||
|
@ -8,8 +8,8 @@
|
||||
<h5 class="media-heading">
|
||||
{{^is_messages}}
|
||||
<span class="pull-right small">
|
||||
{{^is_sponsored}}<a title="View twist details" href="{{site_root}}/twist/{{.}}/{{k}}">{{/is_sponsored}}{{time}}{{^is_sponsored}}</a>{{/is_sponsored}}
|
||||
{{#is_sponsored}}<span class="pull-right small">{{time}}</span>{{/is_sponsored}}
|
||||
{{^is_promoted}}<a title="View twist details" href="{{site_root}}/twist/{{.}}/{{k}}">{{/is_promoted}}{{time}}{{^is_promoted}}</a>{{/is_promoted}}
|
||||
{{#is_promoted}}<span class="pull-right small">{{time}}</span>{{/is_promoted}}
|
||||
</span>
|
||||
{{/is_messages}}
|
||||
{{#is_messages}}<span class="pull-right small">{{time}}</span>{{/is_messages}}
|
||||
|
@ -25,7 +25,7 @@
|
||||
<a class="label label-info" href="{{site_root}}/user/{{.}}" title="@{{.}}'s profile"><span class="glyphicon glyphicon-user"></span></a>
|
||||
{{/username}}
|
||||
{{^username}}
|
||||
(view sponsored posts)
|
||||
(view promoted posts)
|
||||
{{/username}}
|
||||
</div>
|
||||
</li>
|
||||
@ -40,7 +40,7 @@
|
||||
<abbr style="color:#fbe0a5"
|
||||
title="Browse to a #hashtag's page:
|
||||
Main area will show twists mentioning it.
|
||||
[An empty field will show sponsored posts]">
|
||||
[An empty field will show promoted posts]">
|
||||
<span class="glyphicon glyphicon-arrow-left"></span>
|
||||
</abbr>
|
||||
Tag <span class="glyphicon glyphicon-tag"></span>
|
||||
@ -59,7 +59,7 @@ Main area will show twists mentioning it.
|
||||
title='Search for "users starting with ..."
|
||||
𝘄𝗶𝘁𝗵𝗼𝘂𝘁 leaving the current page.
|
||||
Results will appear below.
|
||||
[Empty field to show trending tags again]'>
|
||||
[Empty field to switch back to trending tags]'>
|
||||
<span class="glyphicon glyphicon-arrow-down"></span>
|
||||
</abbr>
|
||||
Userna... <span class="glyphicon glyphicon-user"></span>
|
||||
|
@ -60,16 +60,16 @@
|
||||
{{#is_user}}
|
||||
<h2 class="media-heading">
|
||||
{{#location}}<span class="pull-right small">{{.}}</span>{{/location}}
|
||||
{{#is_sponsored}}
|
||||
{{#is_promoted}}
|
||||
<abbr class="btn btn-info" href="#"
|
||||
title="❝Let us make a toast
|
||||
to the ones who mined the blocks
|
||||
and their sponsored twists❞
|
||||
to the ones who mine the blocks.
|
||||
Read promoted posts!❞
|
||||
— @𝗯𝗹𝗼𝗰𝗸𝗵𝗮𝘀𝗵's bio, Haiku edition">
|
||||
<span class="glyphicon glyphicon-glass"></span>
|
||||
</abbr>
|
||||
{{/is_sponsored}}
|
||||
{{^is_sponsored}}<span class="glyphicon glyphicon-user"></span>{{/is_sponsored}}
|
||||
{{/is_promoted}}
|
||||
{{^is_promoted}}<span class="glyphicon glyphicon-user"></span>{{/is_promoted}}
|
||||
{{fullname}}
|
||||
{{#url}}<small><a target="_blank" href="{{.}}">{{.}}</a></small>{{/url}}</h2>
|
||||
{{{bio}}}
|
||||
|
@ -102,7 +102,7 @@ class Twister:
|
||||
def get_following(self,localusername):
|
||||
return [{"username":u} for u in self.twister.getfollowing(localusername)]
|
||||
@functioncache(60*5,ignore_instance=True)
|
||||
def get_sponsored_posts(self,num=8):
|
||||
def get_promoted_posts(self,num=8):
|
||||
return reversed([self._format_post_info(p) for p in self.twister.getspamposts(num)]) # Don't ask me why reversed :)
|
||||
@functioncache(60,ignore_instance=True)
|
||||
def get_tag_posts(self,tag):
|
||||
|
Loading…
x
Reference in New Issue
Block a user