Changeset 5694

Show
Ignore:
Timestamp:
08/15/12 15:04:13 (7 years ago)
Author:
justinc
Message:

changes to support the Android installer. The referral changes are
complicated.

Location:
seattle/trunk/seattlegeni/website/html
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/seattlegeni/website/html/templates/common/installers.html

    r3395 r5694  
    77         
    88                        <table id="downloads"> 
     9                                <tr id="android"> 
     10                                        <td><a href="market://details?id=com.seattleonandroid&referrer=utm_source%3D{{ android_installer_link }}%252Fseattle_win.zip%26utm_medium%3Ddownload%26utm_content%3D{{ username }}%26utm_campaign%3Dseattle"><img src="{{ MEDIA_URL }}images/android.png" alt="android" /></a></td> 
     11                                        <td> 
     12                                                <a href="market://details?id=com.seattleonandroid&referrer=utm_source%3D{{ android_installer_link }}%252Fseattle_win.zip%26utm_medium%3Ddownload%26utm_content%3D{{ username }}%26utm_campaign%3Dseattle">Download installer for Android</a> 
     13                                                <p> 
     14                                                        <br /><b>Note: You will be prompted to install Python 2.6.2 if you do not have it installed.   </b> 
     15                                                        <br />If you are having problems detecting Python, please open the Python application and ensure the installation has completed. 
     16                                                </p> 
     17                                                <br/> 
     18                                                To check that Seattle is running, try running the Seattle On Android app! 
     19                                        </td> 
     20                                </tr> 
    921                                <tr id="mac"> 
    1022                                        <td><a href="{% url mac_installer username %}"><img src="{{ MEDIA_URL }}images/mac.png" alt="mac" /></a></td> 
  • seattle/trunk/seattlegeni/website/html/views.py

    r5691 r5694  
    2323import subprocess 
    2424import xmlrpclib 
     25 
     26# Needed to escape characters for the Android referrer... 
     27import urllib 
    2528 
    2629from django.http import HttpResponse 
     
    785788  except DoesNotExistError: 
    786789    validuser = False 
    787   return direct_to_template(request, 'download/installers.html', {'username' : username, 
    788                                                                  'validuser' : validuser}) 
     790 
     791  templatedict = {} 
     792  templatedict['username'] = username 
     793  templatedict['validuser'] = validuser 
     794 
     795  # I need to build a URL for android to download the installer from.   (The 
     796  # same installer is downloaded from the Google Play store for all users.)  
     797  # The URL is escaped twice (ask Akos why) and inserted in the referrer  
     798  # information in the URL.    
     799  templatedict['android_installer_link'] = urllib.quote(urllib.quote(request.build_absolute_uri(),safe=''),safe='') 
     800 
     801  return direct_to_template(request, 'download/installers.html', templatedict) 
    789802 
    790803