diff --git a/admin/README.md b/admin/README.md index 38440f85..4ac13101 100644 --- a/admin/README.md +++ b/admin/README.md @@ -1,6 +1,6 @@ -# Grant.io Admin UI +# ZF Grants Admin UI -This is the admin component of [Grant.io](http://grant.io). +This is the admin component of [grants.zfnd.org](http://grants.zfnd.org). ## Development diff --git a/admin/src/components/Emails/Example.tsx b/admin/src/components/Emails/Example.tsx index da024319..cae81ed1 100644 --- a/admin/src/components/Emails/Example.tsx +++ b/admin/src/components/Emails/Example.tsx @@ -21,7 +21,7 @@ export default class Example extends React.Component {
-
Grant.io
+
ZF Grants
{email.info.subject} diff --git a/admin/src/components/Template/index.tsx b/admin/src/components/Template/index.tsx index a1e38ca4..2057e5b8 100644 --- a/admin/src/components/Template/index.tsx +++ b/admin/src/components/Template/index.tsx @@ -30,7 +30,7 @@ class Template extends React.Component {
)} -
grant.io
+
ZF Grants
diff --git a/admin/src/static/index.html b/admin/src/static/index.html index 047a120d..541c6350 100644 --- a/admin/src/static/index.html +++ b/admin/src/static/index.html @@ -4,7 +4,7 @@ - Admin - Grant.io + Admin - ZF Grants diff --git a/backend/.env.example b/backend/.env.example index 48578233..dff41cff 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,7 +1,7 @@ # Environment variable overrides for local development FLASK_APP=app.py FLASK_ENV=development -SITE_URL="https://grant.io" # No trailing slash +SITE_URL="https://zfnd.org" # No trailing slash DATABASE_URL="sqlite:////tmp/dev.db" REDISTOGO_URL="redis://localhost:6379" SECRET_KEY="not-so-secret" diff --git a/backend/README.md b/backend/README.md index 0ff5dac2..11e64027 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,6 +1,6 @@ -# Grant.io Backend +# ZF Grants Backend -This is the backend component of [Grant.io](http://grant.io). +This is the backend component of [grants.zfnd.org](http://grants.zfnd.org). ## Environment Setup @@ -89,16 +89,6 @@ To create a proposal, run flask create_proposal "FUNDING_REQUIRED" 1 123 "My Awesome Proposal" "### Hi! I have a great proposal" -## External Services - -To decode EIP-712 signed messages, a Grant.io deployed service was created `https://eip-712.herokuapp.com`. - -To adjust this endpoint, simply export `AUTH_URL` with a new endpoint value: - - export AUTH_URL=http://new-endpoint.com - -To learn more about this auth service, you can visit the repo [here](https://github.com/grant-project/eip-712-server). - ## S3 Storage Setup 1. create bucket, keep the `bucket name` and `region` handy @@ -158,7 +148,7 @@ These instructions are for `development`, for `production` simply replace all ho 1. Create Twitter oauth app https://developer.twitter.com/en/apply/user 1. click **Create an App** - 1. set **Website URL** to a valid URL, such as `http://demo.grant.io` + 1. set **Website URL** to a valid URL, such as `http://grants.zfnd.org` 1. check the **Enable Sign in with Twitter** option 1. set **Callback URLs** to `http://127.0.0.1:3000/callback/twitter` 1. fill out other required fields diff --git a/backend/grant/email/send.py b/backend/grant/email/send.py index 6cca8001..49806bde 100644 --- a/backend/grant/email/send.py +++ b/backend/grant/email/send.py @@ -1,24 +1,25 @@ import sendgrid from flask import render_template, Markup, current_app -from grant.settings import SENDGRID_API_KEY, SENDGRID_DEFAULT_FROM +from grant.settings import SENDGRID_API_KEY, SENDGRID_DEFAULT_FROM, UI +from grant.utils.misc import make_url from python_http_client import HTTPError from sendgrid.helpers.mail import Email, Mail, Content from .subscription_settings import EmailSubscription, is_subscribed default_template_args = { - 'home_url': 'https://grant.io', - 'account_url': 'https://grant.io/user', - 'email_settings_url': 'https://grant.io/user/settings', - 'unsubscribe_url': 'https://grant.io/unsubscribe', + 'home_url': make_url('/'), + 'account_url': make_url('/user'), + 'email_settings_url': make_url('/settings'), + 'unsubscribe_url': make_url('/unsubscribe'), } def signup_info(email_args): return { - 'subject': 'Confirm your email on Grant.io', - 'title': 'Welcome to Grant.io!', - 'preview': 'Welcome to Grant.io, we just need to confirm your email address.', + 'subject': 'Confirm your email on {}'.format(UI['NAME']), + 'title': 'Welcome to {}!'.format(UI['NAME']), + 'preview': 'Welcome to {}, we just need to confirm your email address.'.format(UI['NAME']), } @@ -32,8 +33,8 @@ def team_invite_info(email_args): def recover_info(email_args): return { - 'subject': 'Grant.io account recovery', - 'title': 'Grant.io account recovery', + 'subject': '{} account recovery'.format(UI['NAME']), + 'title': '{} account recovery'.format(UI['NAME']), 'preview': 'Use the link to recover your account.' } @@ -50,7 +51,7 @@ def change_email_old_info(email_args): return { 'subject': 'Your email has been changed', 'title': 'Email changed', - 'preview': 'Your email address has been updated on ZF Grants' + 'preview': 'Your email address has been updated on {}'.format(UI['NAME']), } @@ -157,19 +158,35 @@ get_info_lookup = { def generate_email(type, email_args): info = get_info_lookup[type](email_args) - body_text = render_template('emails/%s.txt' % (type), args=email_args) - body_html = render_template('emails/%s.html' % (type), args=email_args) + body_text = render_template( + 'emails/%s.txt' % (type), + args=email_args, + UI=UI, + ) + body_html = render_template( + 'emails/%s.html' % (type), + args=email_args, + UI=UI, + ) - html = render_template('emails/template.html', args={ - **default_template_args, - **info, - 'body': Markup(body_html), - }) - text = render_template('emails/template.txt', args={ - **default_template_args, - **info, - 'body': body_text, - }) + html = render_template( + 'emails/template.html', + args={ + **default_template_args, + **info, + 'body': Markup(body_html), + }, + UI=UI, + ) + text = render_template( + 'emails/template.txt', + args={ + **default_template_args, + **info, + 'body': body_text, + }, + UI=UI, + ) return { 'info': info, diff --git a/backend/grant/settings.py b/backend/grant/settings.py index b2244de6..0447646a 100644 --- a/backend/grant/settings.py +++ b/backend/grant/settings.py @@ -13,7 +13,7 @@ env.read_env() ENV = env.str("FLASK_ENV", default="production") DEBUG = ENV == "development" -SITE_URL = env.str('SITE_URL', default='https://grant.io') +SITE_URL = env.str('SITE_URL', default='https://zfnd.org') SQLALCHEMY_DATABASE_URI = env.str("DATABASE_URL") QUEUES = ["default"] SECRET_KEY = env.str("SECRET_KEY") @@ -24,7 +24,7 @@ CACHE_TYPE = "simple" # Can be "memcached", "redis", etc. SQLALCHEMY_TRACK_MODIFICATIONS = False SENDGRID_API_KEY = env.str("SENDGRID_API_KEY", default="") -SENDGRID_DEFAULT_FROM = "noreply@grant.io" +SENDGRID_DEFAULT_FROM = "noreply@zfnd.org" SENTRY_DSN = env.str("SENTRY_DSN", default=None) SENTRY_RELEASE = env.str("SENTRY_RELEASE", default=None) @@ -51,3 +51,9 @@ BLOCKCHAIN_REST_API_URL = env.str("BLOCKCHAIN_REST_API_URL") BLOCKCHAIN_API_SECRET = env.str("BLOCKCHAIN_API_SECRET") ADMIN_PASS_HASH = env.str("ADMIN_PASS_HASH") + +UI = { + 'NAME': 'ZF Grants', + 'PRIMARY': '#CF8A00', + 'SECONDARY': '#2D2A26', +} diff --git a/backend/grant/templates/emails/comment_reply.html b/backend/grant/templates/emails/comment_reply.html index 8f5439fd..8079fb9e 100644 --- a/backend/grant/templates/emails/comment_reply.html +++ b/backend/grant/templates/emails/comment_reply.html @@ -13,9 +13,9 @@ - diff --git a/backend/grant/templates/emails/contribution_update.html b/backend/grant/templates/emails/contribution_update.html index 736106b0..dbd778bd 100644 --- a/backend/grant/templates/emails/contribution_update.html +++ b/backend/grant/templates/emails/contribution_update.html @@ -15,11 +15,11 @@
+ + style="font-size: 20px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; color: #ffffff; text-decoration: none; padding: 20px 50px; border-radius: 4px; border: 1px solid {{ UI.PRIMARY }}; display: inline-block;"> View their comment -
+ View the full update diff --git a/backend/grant/templates/emails/proposal_approved.html b/backend/grant/templates/emails/proposal_approved.html index 172e592d..df35f3f8 100644 --- a/backend/grant/templates/emails/proposal_approved.html +++ b/backend/grant/templates/emails/proposal_approved.html @@ -18,11 +18,11 @@ -
+ Publish your proposal diff --git a/backend/grant/templates/emails/proposal_comment.html b/backend/grant/templates/emails/proposal_comment.html index 37a8e102..54f3257d 100644 --- a/backend/grant/templates/emails/proposal_comment.html +++ b/backend/grant/templates/emails/proposal_comment.html @@ -12,9 +12,9 @@ - diff --git a/backend/grant/templates/emails/proposal_contribution.html b/backend/grant/templates/emails/proposal_contribution.html index 76e5264e..f2f1cfde 100644 --- a/backend/grant/templates/emails/proposal_contribution.html +++ b/backend/grant/templates/emails/proposal_contribution.html @@ -11,9 +11,9 @@
+ + style="font-size: 20px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; color: #ffffff; text-decoration: none; padding: 20px 50px; border-radius: 4px; border: 1px solid {{ UI.PRIMARY }}; display: inline-block;"> View their comment - diff --git a/backend/grant/templates/emails/recover.html b/backend/grant/templates/emails/recover.html index cbe336d1..9fcb4ad3 100644 --- a/backend/grant/templates/emails/recover.html +++ b/backend/grant/templates/emails/recover.html @@ -8,11 +8,11 @@
+ + style="font-size: 20px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; color: #ffffff; text-decoration: none; padding: 20px 50px; border-radius: 4px; border: 1px solid {{ UI.PRIMARY }}; display: inline-block;"> View your Proposal -
+ Reset Password @@ -28,7 +28,7 @@

- {{ + {{ args.recover_url }}

diff --git a/backend/grant/templates/emails/signup.html b/backend/grant/templates/emails/signup.html index 021b857a..b42c5e35 100644 --- a/backend/grant/templates/emails/signup.html +++ b/backend/grant/templates/emails/signup.html @@ -7,9 +7,9 @@
- @@ -24,7 +24,9 @@

- {{ args.confirm_url }} + + {{ args.confirm_url }} +

diff --git a/backend/grant/templates/emails/team_invite.html b/backend/grant/templates/emails/team_invite.html index 6f922858..ae361aef 100644 --- a/backend/grant/templates/emails/team_invite.html +++ b/backend/grant/templates/emails/team_invite.html @@ -2,13 +2,13 @@ You’ve been invited by {{ args.inviter.display_name }} to join the team for {{ args.proposal.title or 'Untitled Project'|safe }}, a project on Grant.io! If you want to accept the invitation, continue to + >, a project on {{ UI.NAME }}! If you want to accept the invitation, continue to the site below.

{% if not args.user %}

- It looks like you don't yet have a Grant.io account, so you'll need to sign up + It looks like you don't yet have a {{ UI.NAME }} account, so you'll need to sign up first before you can join the team.

{% endif %} @@ -18,11 +18,11 @@
+ + style="font-size: 20px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; color: #ffffff; text-decoration: none; padding: 20px 50px; border-radius: 4px; border: 1px solid {{ UI.PRIMARY }}; display: inline-block;"> Confirm Email -
+ {% if args.user %} See invitation {% else %} Get started {% endif %} diff --git a/backend/grant/templates/emails/team_invite.txt b/backend/grant/templates/emails/team_invite.txt index aa8e46d4..e87e96ef 100644 --- a/backend/grant/templates/emails/team_invite.txt +++ b/backend/grant/templates/emails/team_invite.txt @@ -1,10 +1,10 @@ You’ve been invited by {{ args.inviter.display_name }} to join the team for -{{ args.proposal.title or 'Untitled Project' }}, a project on Grant.io! If +{{ args.proposal.title or 'Untitled Project' }}, a project on {{ UI.NAME }}! If you want to accept the invitation, continue to the URL below. {{ args.invite_url }} {% if not args.user %} -It looks like you don't yet have a Grant.io account, so you'll need to sign +It looks like you don't yet have a {{ UI.NAME }} account, so you'll need to sign up first before you can join the team. {% endif %} \ No newline at end of file diff --git a/backend/grant/templates/emails/template.html b/backend/grant/templates/emails/template.html index 4e473350..bcc04745 100644 --- a/backend/grant/templates/emails/template.html +++ b/backend/grant/templates/emails/template.html @@ -81,7 +81,7 @@ - -
+
+