def index(): page_url = BASE_URL + request.path page_url = page_url.strip('/') page_title = 'Traces: What Reminds You?' slugs, links = get_slugs(title=False) x, next_trace = get_submission(title=False) slugs, links = get_slugs(title=False) submission = {'slug': 'landing'} next_social, unused = get_social(title=next_trace['slug']) next_trace['social'] = { 'title': next_social['facebooktitle'], 'subtitle': next_social['facebooksubtitle'], 'img': next_social['facebookimage'], 'description': next_social['facebookdescription'], 'twitter_text': next_social['twittertext'], 'twitter_hashtag': "VT,VtTraces" } return render_template('index.html', submission=submission, next_trace=next_trace, slugs=slugs, links=links, page_title=page_title, social=social, page_url=page_url)
def chapter_page(Name): for chapter in chapters: if 'slug' in chapter and Name == chapter['slug']: chapters.remove(chapter) chapters.insert(0, chapter) page_url = BASE_URL + request.path page_title = "VPR Classical Timeline: " + chapters[0]['Name'] slugs, links = get_slugs(Name) social = { 'title': page_title, 'subtitle': "", 'img': "http://mediad.publicbroadcasting.net/p/vpr/files/Timeline-shareable-image-20160829.png", 'description': chapters[0]['Name'], 'twitter_text': "", 'twitter_hashtag': "" } return render_template('content.html', page_title=page_title, social=social, slugs=slugs, links=links, chapters=chapters, page_url=page_url)
def index(): page_title = 'VPR Classical Timeline' page_url = BASE_URL + request.path landing = True slugs, links = get_slugs(Name=False) social = project_social return render_template('content.html', page_title=page_title, social=social, slugs=slugs, links=links, landing=landing, project_social=project_social, chapters=chapters, page_url=page_url)
def share(): page_url = BASE_URL + request.path navbar_h1 = True page_title = 'TRACES: Share Your Story' x, next_trace = get_submission(title=False) submission = {'slug': 'share'} slugs, links = get_slugs(title=False) next_social, unused = get_social(title=next_trace['slug']) share_social = { 'title': "VPR's Traces Project: Share Your Story", 'subtitle': "", 'img': "http://www.vpr.net/apps/traces/static/img/vpr-traces-social-image.jpg", 'description': "Traces is an attempt to catalog how drug addiction affects us, and how we think about it: loss, anger, confusion -- and sometimes hope. What's your story?", 'twitter_text': "Drug addiction affects many in the Vermont community. What's your story?", 'twitter_hashtag': "VT, VtTraces" } next_trace['social'] = { 'title': next_social['facebooktitle'], 'subtitle': next_social['facebooksubtitle'], 'img': next_social['facebookimage'], 'description': next_social['facebookdescription'], 'twitter_text': next_social['twittertext'], 'twitter_hashtag': "VT,VtTraces" } return render_template('index.html', submission=submission, next_trace=next_trace, slugs=slugs, links=links, page_title=page_title, share_social=share_social, social=social, navbar_h1=navbar_h1, page_url=page_url)
def post(title): page_url = BASE_URL navbar_h1 = True page_title = 'TRACES: What Reminds You?' submission, next_trace = get_submission(title) slugs, links = get_slugs(title) this_social, next_social = get_social(title=submission['slug']) submission['social'] = { 'title': this_social['facebooktitle'], 'subtitle': this_social['facebooksubtitle'], 'img': this_social['facebookimage'], 'description': this_social['facebookdescription'], 'twitter_text': this_social['twittertext'], 'twitter_hashtag': "VT,VtTraces" } if next_trace: next_trace['social'] = { 'title': next_social['facebooktitle'], 'subtitle': next_social['facebooksubtitle'], 'img': next_social['facebookimage'], 'description': next_social['facebookdescription'], 'twitter_text': next_social['twittertext'], 'twitter_hashtag': "VT,VtTraces" } return render_template('submission.html', page_title=page_title, navbar_h1=navbar_h1, submission=submission, social=social, slugs=slugs, links=links, next_trace=next_trace, page_url=page_url)
def post(): slugs, links = get_slugs(title=False) for i in slugs: yield {'title': i}