Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Jun 15, 2020
2 parents 377195d + 684a580 commit cc56cb2
Show file tree
Hide file tree
Showing 98 changed files with 28,381 additions and 1,777 deletions.
1 change: 1 addition & 0 deletions app/app/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def preprocess(request):
'is_alpha_tester': profile.is_alpha_tester if profile else False,
'persona_is_funder': profile.persona_is_funder if profile else False,
'persona_is_hunter': profile.persona_is_hunter if profile else False,
'pref_do_not_track': profile.pref_do_not_track if profile else False,
'profile_url': profile.url if profile else False,
'quests_live': settings.QUESTS_LIVE,
}
Expand Down
24,333 changes: 24,332 additions & 1 deletion app/app/fixtures/economy.json

Large diffs are not rendered by default.

520 changes: 257 additions & 263 deletions app/app/fixtures/grants.json

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions app/app/redis_service.py

This file was deleted.

58 changes: 58 additions & 0 deletions app/app/services.py
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'))
11 changes: 11 additions & 0 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['*'])
CSRF_TRUSTED_ORIGINS = env.list('CSRF_TRUSTED_ORIGINS', default=['localhost'])

TWILIO_FRIENDLY_NAMES = env.list('TWILIO_FRIENDLY_NAMES', default=['VERIFY'])


# Notifications - Global on / off switch
ENABLE_NOTIFICATIONS_ON_NETWORK = env('ENABLE_NOTIFICATIONS_ON_NETWORK', default='mainnet')

Expand Down Expand Up @@ -830,3 +833,11 @@ def callback(request):


ELASTIC_SEARCH_URL = env('ELASTIC_SEARCH_URL', default='')

account_sid = env('TWILIO_ACCOUNT_SID', default='')
auth_token = env('TWILIO_AUTH_TOKEN', default='')

SMS_MAX_VERIFICATION_ATTEMPTS = env('SMS_MAX_VERIFICATION_ATTEMPTS', default=4)
SMS_COOLDOWN_IN_MINUTES = env('SMS_COOLDOWN_IN_MINUTES', default=1)
EMAIL_ACCOUNT_VALIDATION = env.bool('EMAIL_ACCOUNT_VALIDATION', default=False)
PHONE_SALT = env('PHONE_SALT', default='THIS_IS_INSECURE_CHANGE_THIS_PLEASE')
4 changes: 4 additions & 0 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@
dashboard.views.funder_dashboard_bounty_info,
name='funder_dashboard_bounty_info'
),
re_path(r'^sms/request/?$', dashboard.views.send_verification, name='request_verification'),
re_path(r'^sms/validate/?$', dashboard.views.validate_verification, name='request_verification'),

# quests
re_path(r'^quests/?$', quests.views.index, name='quests_index'),
Expand Down Expand Up @@ -537,6 +539,7 @@
path('_administration/email/mention', retail.emails.mention, name='mention_email'),
path('_administration/email/wallpost', retail.emails.wallpost, name='wallpost_email'),
path('_administration/email/grant_update', retail.emails.grant_update, name='grant_update_email'),
path('_administration/email/grant_recontribute', retail.emails.grant_recontribute, name='grant_recontribute_email'),
path(
'_administration/email/new_bounty_acceptance',
retail.emails.new_bounty_acceptance,
Expand Down Expand Up @@ -677,6 +680,7 @@
# gitcoinbot
url(settings.GITHUB_EVENT_HOOK_URL, gitcoinbot.views.payload, name='payload'),
url(r'^impersonate/', include('impersonate.urls')),
url(r'^api/v0.1/hackathon_project/set_winner/', dashboard.views.set_project_winner, name='project_winner'),

url(r'^api/v0.1/hackathon_project/set_winner/', dashboard.views.set_project_winner, name='project_winner'),

Expand Down
25 changes: 25 additions & 0 deletions app/assets/v2/css/gitcoin.css
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,31 @@ textarea.status-textarea {
cursor: pointer;
}

.info-box {
background: rgba(62, 0, 255, 0.05);
border: 1px solid rgba(62, 0, 255, 0.5);
box-sizing: border-box;
border-radius: 4px;
line-height: 16px;
}

.info-box.large {
width: 95%;
}

.cart-btn {
border-radius: 4px !important;
}

.cart-btn.large {
width: 100%;
padding: 10px 0;
}

input[type="search"]::-webkit-search-cancel-button {
z-index: 100;
}

.svg-animated-logo {
height: 42px;
max-width: 100%;
Expand Down
1 change: 1 addition & 0 deletions app/assets/v2/css/grants/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
border-radius: 5px;
display: flex;
flex-direction: column;
border: 1px solid #D3D3D3;
}

.grant-item__content {
Expand Down
108 changes: 108 additions & 0 deletions app/assets/v2/css/grants/cart.css
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;
}
16 changes: 11 additions & 5 deletions app/assets/v2/css/grants/detail.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
border-color: transparent;
}

@media (min-width: 1200px) {
.grant-detail .container {
max-width: 85vw
}
.grant-detail .container {
max-width: 85vw;
display: block;
}

@media (min-width: 1200px) {
#editor.ql-bubble .ql-editor[contenteditable='false'] {
padding: 0;
}
Expand Down Expand Up @@ -214,6 +215,11 @@ textarea.editable {
max-height: 22rem;
}

.grant-side-cart {
background-color: white;
border-left: lightgray 2px solid;
}

.wallet-address {
font-size: 0.85rem;
}
Expand Down Expand Up @@ -322,4 +328,4 @@ textarea.editable {
.logo {
display: none;
}
}
}
19 changes: 0 additions & 19 deletions app/assets/v2/css/grants/fund.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,25 +152,6 @@
bottom: -1.2rem;
}

.nav {
text-align: center;
}

.nav-link {
border-right: 1px solid black;
border-top: 1px solid black;
border-left: 1px solid black;
margin-right: 10px;
}

.nav-link:visited {
color: black;
}

.nav-item.active {
text-decoration: underline;
}

.clr_estimate {
background-color: white;
border-radius: 5px;
Expand Down
Loading

0 comments on commit cc56cb2

Please sign in to comment.