Skip to content
Open
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
5 changes: 3 additions & 2 deletions server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,11 @@ def daf():
bundles=bundles,
)

@app.route("/donor-wall")
@app.route("/members")
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
15 changes: 9 additions & 6 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,13 +1033,13 @@ 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:
less_than_10 = sorted(less_than_10, key=lambda x: x['sort_by'])
less_than_10 = [
{'attribution': x['attribution']}
{'attribution': x['attribution'], 'created': x['CreatedDate']}
for x in less_than_10]

sorted_results['Less Than $10'] = less_than_10
Expand Down
61 changes: 43 additions & 18 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,13 +26,13 @@ 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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure these rules are being covered elsewhere but wanted to make sure you checked to see if these updates effected any of the other donor app pages.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some mild regressions on the /donate page, specifically around the h1 size. I'll address shortly.

font-size: $size-xxl;
line-height: 1.2;
Expand All @@ -43,23 +46,45 @@ h3 {
font-size: $size-l;
}

h4 {
font-size: $size-m;
a {
color: inherit;
text-decoration: none;
}

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

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

a {
text-decoration: none;
// No bullets by default
ul {
list-style: none;
}

// We want all of our cite elements to not be italicized
cite {
font-style: normal;
hr {
border: 1px solid $color-gray-light;
}

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


// 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