Skip to content

Commit

Permalink
Added link to PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerly committed Oct 4, 2011
1 parent db05701 commit 3367f41
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
Binary file added apps/prelaunch/txt2wrk-description.pdf
Binary file not shown.
24 changes: 24 additions & 0 deletions apps/prelaunch/views.py
Expand Up @@ -173,8 +173,11 @@
@author: Jon
'''

import os

from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render_to_response, redirect
from django.views.decorators.csrf import csrf_exempt
from registration.views import register
Expand Down Expand Up @@ -236,3 +239,24 @@ def about(request, template=None):
ctxt['form'] = DemoApplicantRegistrationForm()
ctxt['settings'] = settings
return render_to_response(template, ctxt, context_instance = RequestContext(request))

txt2wrk_details_pdf = None
def txt2wrk_details(request):
# Global variable so we don't have to read the file from
# disk each time.
global txt2wrk_details_pdf

if txt2wrk_details_pdf is None:
# Build filename to 1x1 white pixel file
# (same directory as this)
base = os.path.split(os.path.abspath(__file__))[0]
filename = os.path.join(base, 'txt2wrk-description.pdf')

# Grab the contents to serve
f = open(filename)
txt2wrk_details_pdf = f.read()
f.close()

# Create response to give
response = HttpResponse(txt2wrk_details_pdf, mimetype="application/pdf")
return response
2 changes: 1 addition & 1 deletion templates/about/about.html
Expand Up @@ -18,7 +18,7 @@ <h3>About txt2wrk!</h3>
<section>
<p>Txt2wrk helps parolees, homeless, and other job seekers compete on a more level playing field by providing text-to-speech delivery of job postings on any mobile phone. Job seekers receive text message alerts of new job postings, listen to job descriptions, and submit job applications, 24-hours a day, all without a connection to the internet.</p>
<p>Txt2wrk is compatible with any mobile phone, ensuring job seekers with low literacy and limited access to broadband have equal access to public and private job resources offered by local workforce development and social service agencies.</p>
<p>For more details about txt2wrk, download a PDF: <a href=""><img src="{{ STATIC_URL }}images/logged_out/icon-pdf.png" /> txt2wrk.pdf</a></p>
<p>For more details about txt2wrk, download a PDF: <a href="{% url description %}" target="_blank"><img src="{{ STATIC_URL }}images/logged_out/icon-pdf.png" /> txt2wrk.pdf</a></p>
</section>
<section id="demo">
<div class="instructions">
Expand Down
1 change: 1 addition & 0 deletions urls.py
Expand Up @@ -15,6 +15,7 @@
url(r'^$', 'prelaunch.views.splash', { 'template': 'about/splash.html', }, name='splash'),
url(r'^contact/$', 'prelaunch.views.contact', { 'template': 'about/contact.html', }, name='contact'),
url(r'^about/$', 'prelaunch.views.about', { 'template': 'about/about.html', }, name='about'),
url(r'^description/$', 'prelaunch.views.txt2wrk_details', {}, name='description'),

url(r'^unsubscribe/$', 'account.views.unsubscribe', { 'template': 'about/unsubscribe.html'}, name='unsubscribe'),

Expand Down

0 comments on commit 3367f41

Please sign in to comment.