% from "templates/macros/icons.html" import icon with context % from "templates/macros/payment-methods.html" import payment_methods_icons with context % macro tip_form(tippee, tip=None, disabled='') % set tippee_is_stub = tippee.__class__.__name__ == 'AccountElsewhere' % set tippee_p = tippee.participant if tippee_is_stub else tippee % set pledging = tippee_p.payment_providers == 0 or not tippee_p.accepts_tips % set tippee_name = tippee.friendly_name if tippee_is_stub else tippee.username % set tip = tip or user.get_tip_to(tippee_p, currency) % set tip_currency = tip.amount.currency % set new_currency, accepted_currencies = user.get_currencies_for(tippee, tip) % if request.qs.get('currency') in accepted_currencies % set new_currency = request.qs['currency'] % endif % if not tippee_is_stub % set patron_countries = tippee.recipient_settings.patron_countries % set source_country = request.source_country % if patron_countries and source_country and source_country not in patron_countries
{{ _( "It looks like you are in {country}. {username} does not accept " "donations coming from that country.", country=locale.Country(source_country), username=tippee_name, ) }}
% endif % endif % set currency_mismatch = tip_currency not in accepted_currencies % if tip.renewal_mode > 0 and not pledging % if currency_mismatch{{ _( "Your current donation to {name} is in {currency}, but they now only " "accept donations in {accepted_currency}. You can convert your donation " "to that currency, or discontinue it." , name=tippee_name , currency=Currency(tip_currency) , accepted_currency=Currency(new_currency) ) if len(accepted_currencies) == 1 else _( "Your current donation to {name} is in {currency}, but they no longer " "accept that currency. The suggested new currency is the {accepted_currency}, " "but you can choose another one." , name=tippee_name , currency=Currency(tip_currency) , accepted_currency=Currency(new_currency) ) }}
% else{{ _( "You are currently donating {money_amount} per week to {recipient_name}. " "The form below enables you to modify or stop your donation." , money_amount=tip.periodic_amount, recipient_name=tippee_name ) if tip.period == 'weekly' else _( "You are currently donating {money_amount} per month to {recipient_name}. " "The form below enables you to modify or stop your donation." , money_amount=tip.periodic_amount, recipient_name=tippee_name ) if tip.period == 'monthly' else _( "You are currently donating {money_amount} per year to {recipient_name}. " "The form below enables you to modify or stop your donation." , money_amount=tip.periodic_amount, recipient_name=tippee_name ) }}
% endif % else{{ _("Please select or input an amount:") }}
% endif % if len(accepted_currencies) > 1{{ ngettext( "The {currency_name} isn't your preferred currency? {n} other is supported:", "The {currency_name} isn't your preferred currency? {n} others are supported:", n=len(accepted_currencies) - 1, currency_name=Currency(new_currency) ) if tippee_is_stub else ngettext( "The {currency_name} isn't your preferred currency? {username} also accepts {n} other:", "The {currency_name} isn't your preferred currency? {username} also accepts {n} others:", n=len(accepted_currencies) - 1, currency_name=Currency(new_currency), username=tippee_name ) }}
% endif % endmacro % macro tip_input(new_currency, period, periodic_amount, disabled='', accepted_currencies=None)The amount value in the URL was ignored because the currency is missing.
{{ _("Please choose how this donation should be renewed:") }}
{{ payment_methods_icons(tippee_p, new_currency) }}
% elif not pledging{{ icon('info-sign') }} {{ _( "{username} hasn't configured any payment method yet, so your donation " "cannot actually be processed right now. We will notify you when payment " "becomes possible.", username=tippee_name ) }}
% endif % endmacro % macro tip_visibility_choice(tippee_name, patron_visibilities, payment_providers, tip) % set paypal_only = payment_providers == 2 % if paypal_only % if not patron_visibilities % set patron_visibilities = 2 % elif patron_visibilities.__and__(1) % set patron_visibilities = patron_visibilities.__xor__(1).__or__(2) % endif % endif % if patron_visibilities == 1{{ icon('info-sign') }} {{ _( "{username} has chosen not to see who their patrons are, so your donation will be secret.", username=tippee_name ) }}
% elif patron_visibilities == 2 or paypal_only and not patron_visibilities{{ icon('info-sign') }} {{ _( "This donation won't be secret, you will appear in {username}'s private list of patrons.", username=tippee_name ) }}
% elif patron_visibilities == 4{{ icon('info-sign') }} {{ _( "{username} discloses who their patrons are, your donation will be public.", username=tippee_name ) }}
% elif patron_visibilities{{ _("Please select a privacy level for this donation:") }}
{{ icon('info-sign') }} {{ _( "{username} hasn't yet specified whether they want to see who their patrons are, " "so your donation will be secret.", username=tippee_name ) }}
% endif % endmacro