Permalink
Browse files

Added link to PDF

  • Loading branch information...
1 parent db05701 commit 3367f41967815bcbf010282b46a6797b03480966 @rogerly committed Oct 4, 2011
Showing with 26 additions and 1 deletion.
  1. BIN apps/prelaunch/txt2wrk-description.pdf
  2. +24 −0 apps/prelaunch/views.py
  3. +1 −1 templates/about/about.html
  4. +1 −0 urls.py
Binary file not shown.
@@ -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
@@ -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
@@ -18,7 +18,7 @@
<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">
View
@@ -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'),

0 comments on commit 3367f41

Please sign in to comment.