Changeset 6045

Show
Ignore:
Timestamp:
12/10/12 22:46:40 (6 years ago)
Author:
gpress
Message:

addresses ticket #1094, the android installer should now properly credit donations.

Location:
seattle/trunk/seattlegeni/website/html
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/seattlegeni/website/html/downloadurls.py

    r3059 r6045  
    1010                       # show the main download page for downloading installers 
    1111                       (r'^(?P<username>\w{3,32})/$', 'download', {}, 'installers'), 
     12                       # build and download the android installer 
     13                       (r'^(?P<username>\w{3,32})/seattle_android.zip$', 'build_android_installer', {}, 'android_installer'), 
    1214                       # build and download the windows installer 
    1315                       (r'^(?P<username>\w{3,32})/seattle_win.zip$', 'build_win_installer', {}, 'win_installer'), 
  • seattle/trunk/seattlegeni/website/html/templates/common/installers.html

    r5694 r6045  
    88                        <table id="downloads"> 
    99                                <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> 
     10                                        <td><a href="market://details?id=com.seattleonandroid&referrer=utm_source%3D{{domain}}{% url android_installer username %}%26utm_medium%3Ddownload%26utm_content%3D{{ username }}%26utm_campaign%3Dseattle"><img src="{{ MEDIA_URL }}images/android.png" alt="android" /></a></td> 
    1111                                        <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> 
     12                                                <a href="market://details?id=com.seattleonandroid&referrer=utm_source%3D{{domain}}{% url android_installer username %}%26utm_medium%3Ddownload%26utm_content%3D{{ username }}%26utm_campaign%3Dseattle">Download installer for Android</a> 
    1313                                                <p> 
    1414                                                        <br /><b>Note: You will be prompted to install Python 2.6.2 if you do not have it installed.   </b> 
  • seattle/trunk/seattlegeni/website/html/views.py

    r5978 r6045  
    901901  templatedict['username'] = username 
    902902  templatedict['validuser'] = validuser 
    903   templatedict['domain'] = "http://" + request.get_host() 
     903  templatedict['domain'] = "https://" + request.get_host() 
    904904  # I need to build a URL for android to download the installer from.   (The 
    905905  # same installer is downloaded from the Google Play store for all users.)  
     
    909909 
    910910  return direct_to_template(request, 'download/installers.html', templatedict) 
     911 
     912 
     913 
     914 
     915 
     916def build_android_installer(request, username): 
     917  """ 
     918  <Purpose> 
     919    Allows the user to download a Android distribution of Seattle that will 
     920    donate resources to user with 'username'. 
     921   
     922  <Arguments> 
     923    request: 
     924      Django HttpRequest object 
     925        
     926    username: 
     927      A string representing the GENI user to which the installer will donate 
     928      resources. 
     929   
     930  <Exceptions> 
     931    None 
     932   
     933  <Side Effects> 
     934    None 
     935   
     936  <Returns> 
     937    On failure, returns an HTTP response with a description of the error. On 
     938    success, redirects the user to download the installer. 
     939  """ 
     940   
     941  success, return_value = _build_installer(username, "android") 
     942   
     943  if not success: 
     944    error_response = return_value 
     945    return error_response 
     946   
     947  installer_url = return_value 
     948  return HttpResponseRedirect(installer_url) 
    911949 
    912950