Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ server/templates/includes/base_icons.html
.mypy_cache/
.vscode/
cov.html

.idea
3 changes: 2 additions & 1 deletion server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,8 @@ def daf():
@app.route("/donor-wall")
def donor_wall():
bundles = get_bundles("donate")
return render_template("donor-wall.html", bundles=bundles)
sorted_donors = Account.list_by_giving()
return render_template("donor-wall.html", bundles=bundles, sortedDonors=sorted_donors)

@app.route("/error")
def error():
Expand Down
13 changes: 8 additions & 5 deletions server/npsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def list(
WHERE Stripe_Customer_ID__c = '{stripe_customer_id}'
AND StageName = '{stage_name}'
"""

order_by = f"""ORDER BY Expected_Giving_Date__c ASC""" if asc_order else ""

query = f"""
Expand Down Expand Up @@ -614,7 +614,7 @@ def __init__(self, id=None, contact=None, account=None, date=None, sf_connection
date = datetime.now(tz=ZONE)
else:
date = datetime.fromtimestamp(date)

date_formatted = date.strftime("%Y-%m-%d")

if contact is not None:
Expand Down Expand Up @@ -990,6 +990,7 @@ def get(

return account

@classmethod
def list_by_giving(
cls, sf_connection=None
):
Expand All @@ -1003,20 +1004,22 @@ def list_by_giving(
query = """
SELECT
Name,
CreatedDate,
Text_For_Donor_Wall__c,
Total_Donor_Wall_This_Year__c
FROM Account
WHERE RecordTypeId = '01216000001IhHL'
AND CreatedDate = LAST_N_DAYS:365
AND Total_Donor_Wall_This_Year__c > 0
"""

donors = sf.query(query)
results = defaultdict(list)
less_than_10 = []
for record in donors:
attribution = record['Text_For_Donor_Wall__c']
attributions = {'sort_by': record['Name'],
'attribution': attribution}
'attribution': attribution, 'CreatedDate': record['CreatedDate']}
amount = Decimal(record['Total_Donor_Wall_This_Year__c'])
amount = amount.quantize(Decimal('1'), rounding=ROUND_HALF_UP)
if amount < 10:
Expand All @@ -1030,7 +1033,7 @@ def list_by_giving(
for k, v in sorted(results.items(), key=lambda x: x, reverse=True):
items = sorted(v, key=lambda x: x['sort_by'])
sorted_results['${:0,.0f}'.format(k)] = [
{'attribution': x['attribution']}
{'attribution': x['attribution'], 'created': x['CreatedDate']}
for x in items]

# hacky, but tack this on the end so it'll show last:
Expand Down
64 changes: 38 additions & 26 deletions server/static/sass/4-elements/_all.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// ELEMENTS - Raw tag styles
@import 'font-families';

// Set font root sizes for desktop, tablet, mobile
html {
@include font-setting('primary');
font-size: $font-root;
@include mq($until: bp-s) {
font-size: $font-root-mobile;
}
}

// Strip margin and padding from all headers a paragraphs
body {
@include font-setting('primary');
color: $color-black-off;
}

// We made some tag decisions here based on repeated overriding of browser defaults
html,
body,
dd,
Expand All @@ -23,43 +26,52 @@ h3,
h4,
h5,
h6,
p {
p,
figure,
blockquote {
margin: 0;
padding: 0;
}

// Set base typography proportions for headers, paragraphs, etc.
// sizing variables in settings/_breakpoints.scss
h1 {
font-size: $size-xxl;
line-height: 1.2;
a {
color: inherit;
text-decoration: none;
}

h2 {
font-size: $size-xl;
// We want all of our cite elements to not be italicized
cite {
font-style: normal;
}

h3 {
font-size: $size-l;
button {
background: none;
border: none;
cursor: pointer;
padding: 0;
}

h4 {
font-size: $size-m;
// No bullets by default
ul {
list-style: none;
}

h5 {
font-size: $size-s;
hr {
border: 1px solid $color-gray-light;
}

p {
font-size: $size-b;
// By default we add leading to paragraphs, lists, and captions
p,
ul,
figcaption {
line-height: $font-line-height-b;
}

a {
text-decoration: none;
}

// We want all of our cite elements to not be italicized
cite {
font-style: normal;
// hide details/summary arrow (webkit)
details summary::-webkit-details-marker {
display: none;
}
// hide details/summary arrow (chrome/ff)
details summary::marker {
content: '';
}
72 changes: 72 additions & 0 deletions server/static/sass/4-elements/_font-families.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@font-face {
font-display: swap;
font-family: 'PT Serif';
src: url('https://cdn.texastribune.org/fonts/ptserif-regular.woff2') format('woff2'),
url('https://cdn.texastribune.org/fonts/ptserif-regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}

@font-face {
font-display: swap;
font-family: 'PT Serif';
src: url('https://cdn.texastribune.org/fonts/ptserif-bold.woff2') format('woff2'),
url('https://cdn.texastribune.org/fonts/ptserif-bold.woff') format('woff');
font-weight: 700;
font-style: normal;
}

@font-face {
font-display: swap;
font-family: 'PT Serif';
src: url('https://cdn.texastribune.org/fonts/ptserif-italic.woff2') format('woff2'),
url('https://cdn.texastribune.org/fonts/ptserif-italic.woff') format('woff');
font-weight: 400;
font-style: italic;
}

@font-face {
font-display: swap;
font-family: 'PT Serif';
src: url('https://cdn.texastribune.org/fonts/ptserif-bolditalic.woff2') format('woff2'),
url('https://cdn.texastribune.org/fonts/ptserif-bolditalic.woff') format('woff');
font-weight: 700;
font-style: italic;
}

@font-face {
font-display: swap;
font-family: 'Open Sans';
src: url('https://cdn.texastribune.org/fonts/opensans-regular.woff2') format('woff2'),
url('https://cdn.texastribune.org/fonts/opensans-regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}

@font-face {
font-display: swap;
font-family: 'Open Sans';
src: url('https://cdn.texastribune.org/fonts/opensans-bold.woff2') format('woff2'),
url('https://cdn.texastribune.org/fonts/opensans-bold.woff') format('woff');
font-weight: 700;
font-style: normal;
}

@font-face {
font-display: swap;
font-family: 'Open Sans';
src: url('https://cdn.texastribune.org/fonts/opensans-italic.woff2') format('woff2'),
url('https://cdn.texastribune.org/fonts/opensans-italic.woff') format('woff');
font-weight: 400;
font-style: italic;
}


@font-face {
font-display: swap;
font-family: 'Open Sans';
src: url('https://cdn.texastribune.org/fonts/opensans-bolditalic.woff2') format('woff2'),
url('https://cdn.texastribune.org/fonts/opensans-bolditalic.woff') format('woff');
font-weight: 700;
font-style: italic;
}
Loading