Changeset - f1262837b436
[Not reviewed]
Merge
0 4 2
Christopher Neugebauer - 3 years ago 2017-10-05 20:16:46
chrisjrn@gmail.com
Merge branch 'master' into prod
6 files changed with 61 insertions and 5 deletions:
0 comments (0 inline, 0 general)
fixtures/sitetree.json
Show inline comments
...
 
@@ -75,7 +75,7 @@
 
        "access_restricted": false,
 
        "access_perm_type": 1,
 
        "parent": 24,
 
        "sort_order": 4,
 
        "sort_order": 32,
 
        "access_permissions": []
 
    }
 
},
...
 
@@ -483,7 +483,7 @@
 
        "access_restricted": false,
 
        "access_perm_type": 1,
 
        "parent": 24,
 
        "sort_order": 32,
 
        "sort_order": 4,
 
        "access_permissions": []
 
    }
 
},
pinaxcon/templates/registrasion/invoice/details.html
Show inline comments
 
{% extends "registrasion/invoice/details_.html" %}
 

	
 
{% load nbpy_tags %}
 

	
 
{% comment %}
 
  Blocks that you can override:
 

	
...
 
@@ -32,12 +35,21 @@
 
  {% elif invoice.is_paid %}
 
    This is a confirmed registration summary for North Bay Python 2017.
 
  {% endif %}
 
{% endblock %}
 

	
 
{% block extra_line_items_after_total %}
 
  {% donation_income invoice as donation %}
 
  {% if donation %}
 
    <tr>
 
      <td colspan="3">Includes donation eligible for tax deduction in the USA:</td>
 
      <td class="text-right">${{ donation }}</td>
 
    </tr>
 
  {% endif %}
 
{% endblock %}
 

	
 
{% block contact_info %}
 
  <p>Direct inquiries to <a href="mailto:spam@northbaypython.org">spam@northbaypython.org</a></p>
 
  <p>North Bay Python is run by North Bay and Bay Area locals, as a member project of <a href="https://sfconservancy.org">Software Freedom Conservancy</a>, a 501(c)(3) public charity registered in New York.</p>
 
  <p>North Bay Python is run by North Bay and Bay Area locals, as a member project of <a href="https://sfconservancy.org">Software Freedom Conservancy</a>, a 501(c)(3) not-for-profit public charity registered in New York. Software Freedom Conservancy's federal tax-exempt EIN is 41-2203632.</p>
 

	
 
  <strong>Mailing Address</strong>
 
  <address>
pinaxcon/templates/static_pages/news.html
Show inline comments
...
 
@@ -13,7 +13,7 @@
 
<a name="3"></a>
 
<h2>Tickets now on sale for North Bay Python 2017</h2>
 

	
 
<p><span class="date">Tuesday, October 3, 2017</span>&mdash;We are excited to announce that <a href="https://2017.northbaypython.org/tickets">tickets are now on sale</a> for North Bay Python 2017. With just two months until the conference we have a few key dates coming up:</p>
 
<p><span class="date">Thursday, October 5, 2017</span>&mdash;We are excited to announce that <a href="https://2017.northbaypython.org/tickets">tickets are now on sale</a> for North Bay Python 2017. With just two months until the conference we have a few key dates coming up:</p>
 

	
 
<ul>
 
  <li><a href="https://2017.northbaypython.org/tickets">Tickets</a> are available at a discount until Friday, October 20.</li>
pinaxcon/templates/static_pages/program/call_for_proposals.md
Show inline comments
 
### The North Bay Python 2017 CFP is open!
 
### The North Bay Python 2017 CFP closed on September 29
 

	
 
We've got lots of good information and resources below that you should read, but in case you've already read it and want to dive in now:
 

	
pinaxcon/templatetags/__init__.py
Show inline comments
 
new file 100644
pinaxcon/templatetags/nbpy_tags.py
Show inline comments
 
new file 100644
 
from registrasion.models import commerce
 
from registrasion.controllers.category import CategoryController
 
from registrasion.controllers.item import ItemController
 

	
 
from decimal import Decimal
 
from django import template
 
from django.conf import settings
 
from django.db.models import Sum
 
from urllib import urlencode  # TODO: s/urllib/six.moves.urllib/
 

	
 
register = template.Library()
 

	
 

	
 
@register.simple_tag(takes_context=True)
 
def donation_income(context, invoice):
 
    ''' Calculates the donation income for a given invoice.
 

	
 
    Returns:
 
        the donation income.
 

	
 
    '''
 

	
 
    # 15% (FSA) goes to Conservancy; 85% is real goods
 

	
 
    fsa_rate = Decimal("0.85")
 
    rbi_full_ticket = Decimal("68.00")
 
    rbi_early_bird_discount = Decimal("-21.35")
 
    rbi = []
 

	
 
    for line in invoice.lineitem_set.all():
 
        if line.product.category.name == "Ticket":
 
            if line.product.name.startswith("Unaffiliated Individual"):
 
                # Includes full price & discounts
 
                rbi.append(line.total_price * fsa_rate)
 
            else:
 
                if line.total_price > 0:
 
                    rbi.append(rbi_full_ticket)
 
                elif line.total_price < 0:
 
                    rbi.append(rbi_early_bird_discount)
 
        elif line.product.category.name == "T-Shirt":
 
            rbi.append(line.total_price * fsa_rate)
 

	
 
    donation = (invoice.value - sum(rbi))
 
    return donation.quantize(Decimal('.01'))
0 comments (0 inline, 0 general)