diff --git a/backend/grant/admin/example_emails.py b/backend/grant/admin/example_emails.py index 076d034a..67f2c706 100644 --- a/backend/grant/admin/example_emails.py +++ b/backend/grant/admin/example_emails.py @@ -37,6 +37,7 @@ class FakeUpdate(object): user = FakeUser() proposal = FakeProposal() +milestone = FakeMilestone() contribution = FakeContribution() update = FakeUpdate() @@ -160,6 +161,7 @@ example_email_args = { }, 'milestone_paid': { 'proposal': proposal, + 'milestone': milestone, 'amount': '33', 'tx_explorer_url': 'http://someblockexplorer.com/tx/271857129857192579125', 'proposal_milestones_url': 'http://zfnd.org/proposals/999-my-proposal?tab=milestones', diff --git a/backend/grant/admin/views.py b/backend/grant/admin/views.py index a3397c72..7dfd0797 100644 --- a/backend/grant/admin/views.py +++ b/backend/grant/admin/views.py @@ -432,6 +432,7 @@ def paid_milestone_payout_request(id, mid, tx_id): for member in proposal.team: send_email(member.email_address, 'milestone_paid', { 'proposal': proposal, + 'milestone': ms, 'amount': amount, 'tx_explorer_url': f'{EXPLORER_URL}transactions/{tx_id}', 'proposal_milestones_url': make_url(f'/proposals/{proposal.id}?tab=milestones'), @@ -568,7 +569,7 @@ def get_contributions(page, filters, search, sort): @body({ "proposalId": fields.Int(required=True), "userId": fields.Int(required=True), - "status": fields.Str(required=True, validate=validate.OneOf(choices=RFPStatus.list())), + "status": fields.Str(required=True, validate=validate.OneOf(choices=ContributionStatus.list())), "amount": fields.Str(required=True), "txId": fields.Str(required=False, missing=None) }) @@ -607,7 +608,7 @@ def get_contribution(contribution_id): @body({ "proposalId": fields.Int(required=False, missing=None), "userId": fields.Int(required=False, missing=None), - "status": fields.Str(required=True, validate=validate.OneOf(choices=RFPStatus.list())), + "status": fields.Str(required=True, validate=validate.OneOf(choices=ContributionStatus.list())), "amount": fields.Str(required=False, missing=None), "txId": fields.Str(required=False, missing=None), "refundTxId": fields.Str(required=False, allow_none=True, missing=None), diff --git a/backend/grant/email/send.py b/backend/grant/email/send.py index 1c09b359..8121e567 100644 --- a/backend/grant/email/send.py +++ b/backend/grant/email/send.py @@ -269,7 +269,7 @@ def milestone_accept(email_args): def milestone_paid(email_args): p = email_args['proposal'] a = email_args['amount'] - ms = p.current_milestone + ms = email_args['milestone'] return { 'subject': f'{p.title} - {ms.title} has been paid!', 'title': f'Milestone paid', diff --git a/backend/grant/templates/emails/milestone_paid.html b/backend/grant/templates/emails/milestone_paid.html index 94084e60..572aee3c 100644 --- a/backend/grant/templates/emails/milestone_paid.html +++ b/backend/grant/templates/emails/milestone_paid.html @@ -1,7 +1,7 @@

Hooray! {{ args.amount }} ZEC has been paid out for - {{ args.proposal.title }} - {{ args.proposal.current_milestone.title }}! You can view the transaction below:

diff --git a/backend/grant/templates/emails/milestone_paid.txt b/backend/grant/templates/emails/milestone_paid.txt index d2177a85..2fc1044b 100644 --- a/backend/grant/templates/emails/milestone_paid.txt +++ b/backend/grant/templates/emails/milestone_paid.txt @@ -1,4 +1,4 @@ -Hooray! {{args.amount}} ZEC has been paid out for "{{ args.proposal.title }} - {{args.proposal.current_milestone.title }}"! +Hooray! {{args.amount}} ZEC has been paid out for "{{ args.proposal.title }} - {{args.milestone.title }}"! You can view the transaction below: {{ args.tx_explorer_url }} diff --git a/frontend/client/components/Placeholder/index.tsx b/frontend/client/components/Placeholder/index.tsx index 618fb556..e6626cc6 100644 --- a/frontend/client/components/Placeholder/index.tsx +++ b/frontend/client/components/Placeholder/index.tsx @@ -10,7 +10,7 @@ interface Props { } const Placeholder: React.SFC = ({ style = {}, title, subtitle, loading }) => ( -
+
{(loading && ) || ( <> {title &&

{title}

} diff --git a/frontend/client/components/Proposal/Contributors/index.less b/frontend/client/components/Proposal/Contributors/index.less index b0eef11c..a27ce9cf 100644 --- a/frontend/client/components/Proposal/Contributors/index.less +++ b/frontend/client/components/Proposal/Contributors/index.less @@ -2,23 +2,27 @@ .ProposalContributors { display: flex; + max-width: 880px; @media @mobile-query { flex-direction: column; } + .Placeholder { + flex-grow: 1; + } + &-block { flex: 1; padding: 1.5rem; margin: 1rem; - background: #FFF; + background: #fff; border-radius: 4px; border: 1px solid #ddd; - box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1), - 0 1px 1px rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.1); &:first-child { - margin-left: 0; + margin-left: 0; } &:last-child { margin-right: 0; diff --git a/frontend/client/components/Proposal/Contributors/index.tsx b/frontend/client/components/Proposal/Contributors/index.tsx index ea9ae88e..d1d37989 100644 --- a/frontend/client/components/Proposal/Contributors/index.tsx +++ b/frontend/client/components/Proposal/Contributors/index.tsx @@ -3,7 +3,6 @@ import { connect } from 'react-redux'; import UserRow from 'components/UserRow'; import Placeholder from 'components/Placeholder'; import UnitDisplay from 'components/UnitDisplay'; -import Loader from 'components/Loader'; import { toZat } from 'utils/units'; import { fetchProposalContributions } from 'modules/proposals/actions'; import { @@ -54,20 +53,26 @@ class ProposalContributors extends React.Component {
+} + extra={ + <> + + + + } />
- ) - content = <> -
-

Latest contributors

- {contributions.latest.map(makeContributionRow)} -
-
-

Top contributors

- {contributions.top.map(makeContributionRow)} -
- ; + ); + content = ( + <> +
+

Latest contributors

+ {contributions.latest.map(makeContributionRow)} +
+
+

Top contributors

+ {contributions.top.map(makeContributionRow)} +
+ + ); } else { content = ( { ); } } else if (fetchContributionsError) { - content = ; + content = ( + + ); } else { - content = ; + content = ; } - return ( -
- {content} -
- ); + return
{content}
; } -}; +} export default connect( (state: AppState, ownProps: OwnProps) => ({ diff --git a/frontend/client/components/Proposal/Updates/index.tsx b/frontend/client/components/Proposal/Updates/index.tsx index a1ea6411..8f0b2361 100644 --- a/frontend/client/components/Proposal/Updates/index.tsx +++ b/frontend/client/components/Proposal/Updates/index.tsx @@ -1,6 +1,5 @@ import React from 'react'; import { connect } from 'react-redux'; -import Loader from 'components/Loader'; import Markdown from 'components/Markdown'; import moment from 'moment'; import Placeholder from 'components/Placeholder'; @@ -58,7 +57,7 @@ class ProposalUpdates extends React.Component { let content = null; if (isFetchingUpdates) { - content = ; + content = ; } else if (updatesError) { content = ; } else if (updates) {