Changeset 5494

Show
Ignore:
Timestamp:
06/05/12 19:47:37 (7 years ago)
Author:
gpress
Message:

Ticket #1053 Added text display for max acquirable vessels and number of donations to the myvessels page. A help icon with tooltip about credit calculation was also added. Typo fixed in views.py file

Location:
seattle/trunk/seattlegeni/website
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/seattlegeni/website/control/interface.py

    r5493 r5494  
    144144  return geniuser 
    145145   
    146  
    147146 
    148147 
     
    10451044 
    10461045 
    1047  
     1046def get_free_vessel_credits_amount(geniuser): 
     1047  """ 
     1048  <Purpose> 
     1049    Determine the total number of free vessel credits the user is given. 
     1050  <Arguments> 
     1051    geniuser 
     1052      The GeniUser whose free vessel credits is wanted 
     1053  <Exceptions> 
     1054    None 
     1055  <Side Effects> 
     1056    None 
     1057  <Returns> 
     1058    The total number of vessels the user is given for free. 
     1059  """ 
     1060  assert_geniuser(geniuser) 
     1061 
     1062  return maindb.get_user_free_vessel_credits(geniuser) 
    10481063 
    10491064 
  • seattle/trunk/seattlegeni/website/html/templates/control/myvessels.html

    r5493 r5494  
    2323                <div id="middle"> 
    2424                        <div id="getresources"> 
    25                           {% ifnotequal get_form None %} 
     25                         
     26                        <span style="position:relative;left:-129px;"> Total vessels available : {{ total_vessel_credits }}</span> 
     27                        <span style="position:relative;left:-129px;" title="Each user is gifted {{ free_vessel_credits }} vessels. In addition to these, each donation on your behalf grants 10 vessels. 
     28                        {{free_vessel_credits}} + ({{my_donations  }} * 10) ={{ total_vessel_credits }}">  <img src="{{ MEDIA_URL }}images/help-icon.png" ></img> </span> 
     29                        <span style="position:relative;left:11px;"> Total<a href="{% url getdonations %}"> donations </a>: {{my_donations}}</span>  
     30                        <br> 
     31                                {% ifnotequal get_form None %} 
    2632                                <form method="POST" action="{% url get_resources %}"> 
    2733                                  <span id="caption">Get more resources</span> 
  • seattle/trunk/seattlegeni/website/html/views.py

    r5493 r5494  
    360360  my_vessels = interface.get_vessel_infodict_list(my_vessels_raw) 
    361361   
     362  # this user's number of donations, max vessels, total vessels and free credits 
     363  my_donations = interface.get_donations(user) 
     364  my_max_vessels = interface.get_available_vessel_credits(user)  
     365  my_free_vessel_credits = interface.get_free_vessel_credits_amount(user) 
     366  my_total_vessel_credits = interface.get_total_vessel_credits(user) 
     367 
    362368  for vessel in my_vessels: 
    363369    if vessel["expires_in_seconds"] <= 0: 
     
    365371      vessel["expires_in"] = "Expired" 
    366372    else: 
    367       #is_active = vessel["is_active"] 
    368373      days = vessel["expires_in_seconds"] / (3600 * 24) 
    369374      hours = vessel["expires_in_seconds"] / 3600 % 24 
     
    380385                             'action_summary' : action_summary, 
    381386                             'action_detail' : action_detail, 
     387                             'my_donations' : len(my_donations), 
     388                             'my_max_vessels' : my_max_vessels,  
     389                             'free_vessel_credits' : my_free_vessel_credits, 
     390                             'total_vessel_credits' : my_total_vessel_credits, 
    382391                             'remove_summary' : remove_summary}) 
    383392