forked from gitcoinco/web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gitcoinco#6819 from gitcoinco/grants-round-6-integ…
…ration Grants round 6 integration branch
- Loading branch information
Showing
98 changed files
with
28,677 additions
and
2,945 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import random | ||
|
||
from django.conf import settings | ||
|
||
from app.settings import account_sid, auth_token | ||
from redis import Redis | ||
from twilio.rest import Client | ||
|
||
|
||
class RedisService: | ||
__redis = None | ||
|
||
def __new__(cls): | ||
if not hasattr(cls, 'instance'): | ||
cls.instance = super().__new__(cls) | ||
return cls.instance | ||
|
||
def __init__(self): | ||
if not RedisService.__redis: | ||
redis_url = settings.CELERY_BROKER_URL | ||
RedisService.__redis = Redis.from_url(redis_url) | ||
|
||
@property | ||
def redis(self): | ||
return RedisService.__redis | ||
|
||
|
||
class TwilioService: | ||
_client = None | ||
_service = None | ||
|
||
def __new__(cls): | ||
if not hasattr(cls, 'instance'): | ||
cls.instance = super().__new__(cls) | ||
return cls.instance | ||
|
||
def __create_connection(self): | ||
redis = RedisService().redis | ||
|
||
if not TwilioService._client: | ||
TwilioService._client = Client(account_sid, auth_token) | ||
friendly_names = settings.TWILIO_FRIENDLY_NAMES | ||
friendly_name = random.choice(friendly_names) | ||
TwilioService._service = TwilioService._client.verify.services.create(friendly_name=friendly_name) | ||
redis.set(f"validation:twilio:sid", TwilioService._service.sid) | ||
|
||
def __init__(self): | ||
self.__create_connection() | ||
|
||
@property | ||
def lookups(self): | ||
return TwilioService._client.lookups | ||
|
||
@property | ||
def verify(self): | ||
redis = RedisService().redis | ||
sid = redis.get(f"validation:twilio:sid") | ||
return TwilioService._client.verify.services(sid.decode('utf-8')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
.container { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
justify-content: center; | ||
max-width: 800px; | ||
} | ||
|
||
.separator { | ||
border-top-color: var(--text-light); | ||
border-top-style: solid; | ||
border-top-width: 1px; | ||
display: block; | ||
margin: 1rem 0 2rem; | ||
} | ||
|
||
.flex-container { | ||
width: 100%; | ||
display: -webkit-flex; | ||
display: flex; | ||
justify-content: space-between; | ||
-webkit-justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
.flex-container-left { | ||
width: 100%; | ||
display: -webkit-flex; | ||
display: flex; | ||
justify-content: start; | ||
-webkit-justify-content: start; | ||
align-items: left; | ||
} | ||
|
||
.grant-header-row { | ||
padding: 1rem 0rem; | ||
width: 100%; | ||
} | ||
|
||
.grant-row { | ||
width: 100%; | ||
} | ||
|
||
.grant-row-style { | ||
background-color: var(--gc-grey); | ||
border-color: var(--text-light); | ||
border-radius: 5px; | ||
border-style: solid; | ||
border-width: 1px; | ||
margin-bottom: 1rem; | ||
padding: 1rem; | ||
} | ||
|
||
.cart-section { | ||
padding: 0rem 1rem; | ||
} | ||
|
||
.grant-name { | ||
font-weight: bold; | ||
/* margin-left: 0.5rem; */ | ||
} | ||
|
||
.clr-match-box { | ||
background-color: rgba(15, 206, 124, 0.1); | ||
border: 1px rgba(15, 206, 124, 0.1) solid; | ||
border-radius: 5px; | ||
padding: 0.5rem 1rem; | ||
} | ||
|
||
.black { | ||
color: black; | ||
} | ||
|
||
.medium-dark-gray { | ||
color: var(--gc-medium-dark-gray); | ||
} | ||
|
||
.darker-grey { | ||
color: var(--gc-darker-grey); | ||
} | ||
|
||
.hyperlink { | ||
color: var(--link-color); | ||
cursor: pointer; | ||
} | ||
|
||
.modal-backdrop { | ||
background-color: rgba(0, 0, 0, 0.8); | ||
} | ||
|
||
.vti__dropdown-item { | ||
height: 50px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.vti__dropdown { | ||
height: 50px; | ||
outline: none; | ||
} | ||
|
||
.vue-tel-input input { | ||
height: 50px; | ||
} | ||
|
||
.vti__dropdown-list.below { | ||
top: 50px !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.