{{ # This is the main sponsorship page. It should be provided with default image data # (if a default image exists). If default_image.src >= src_flags["onezoom_via_eol"] # (i.e. this is not a bespoke image, see definitions in _OZglobals.py), then we do not # necessarily have a really nice image, so as well as the default image, we also # present some others for the sponsor to pick, by querying the EoL API. # Up to 9 images (including the default) are shown. The image is only added to the database # on validation of the sponsorship, to avoid bad images. # # We always set "user_preferred_image_src" & "user_preferred_image_src_id" to the image # selected by the sponsor, so we have a record of what they expected. The # "user_nondefault_image" column tells us whether they changed the selection from the # first image (either the default or the first image from the EoL API) to something else # from the EoL selection, in which case we specify the image src as # `src_flags["onezoom_via_eol"]` instead, and will usually explictly download it during # validation, unless it is of rubbish quality. If the user chooses the first image, # the "user_nondefault_image" column should be NULL or 0. }} {{ response.title=base_title + ': ' + T('Sponsor a leaf on the tree') response.files.append(URL('static', 'OZSponsor/sponsor_leaf.css')) response.files.append(URL('static', 'OZSponsor/EOLqueries.js')) response.files.append(URL('static','css/content_pages.css')) }} {{include 'web2py_ajax.html' # I'm not actually sure we need ajax on the leaf page: perhaps this could be removed?}} {{import img}} {{if is_testing: response.meta.viewfile, response.meta.date_accessed = response.view, request.now}}{{pass}} {{extend ('popup.html' if 'popup' in request.vars else 'uikit_layout.html')}} {{block masthead}} {{if 'popup' not in request.vars:}}

{{=T('Leaf sponsorship')}}

{{pass}} {{end block}}

{{=T('You can sponsor this leaf for yourself or as a unique gift for someone you know.')}}

{{if partner_data:}}

{{=XML(T('We will acknowledge your donation to the %s and %s by displaying your chosen sponsor’s name on %s') % (A(T('OneZoom charity'),_href='//www.onezoom.org/static/images/RegistrationCertificate.jpg', _target="_blank"), A(T(partner_data.get('name','')), _href=partner_data.get('url',''), _target="_blank"), the_long_name))}}. {{=XML(T('%s%% of the donation we receive will help OneZoom to provide easy access to scientific knowledge about biodiversity and evolution, and raise awareness about the variety of life on earth together with the need to conserve it. The remaining %d%% will go to %s. %s.') % ( int(round(100-partner_data.get('percentage',0))), int(round(partner_data.get('percentage',0))), T(partner_data.get('name') or ''), T(partner_data.get('details') or ''), )) }}

{{else:}}

{{=XML(T('We will acknowledge your donation to the %s by displaying your chosen sponsor’s name on %s. Your donations will help us in our aim to provide easy access to scientific knowledge about biodiversity and evolution, and raise awareness about the variety of life on earth together with the need to conserve it.') % (A(T('OneZoom charity'),_href='//www.onezoom.org/static/images/RegistrationCertificate.jpg', _target="_blank"), the_long_name))}}

{{pass}}

{{=T('There can be only one sponsor for each leaf, so get your favourite creature before someone else does!')}} {{=T('Sponsorship is for a fixed period of %s years; after that, if you wish to renew your sponsorship, you will have the first refusal.') % (4,)}}

{{# Load in the view without AJAX so that it works without javascript vars = {'form_reservation_code': form_reservation_code} vars.update(request.vars) =LOAD('default', 'sponsor_leaf', extension="load", vars=vars, ajax=False, target="sponsor_form_div")}}