diff --git a/app/app/settings.py b/app/app/settings.py index d21f8d3e859..d274312b2e6 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -816,5 +816,13 @@ def callback(request): AVATAR_ADDRESS = env('AVATAR_ADDRESS', default='0x00De4B13153673BCAE2616b67bf822500d325Fc3') AVATAR_PRIVATE_KEY = env('AVATAR_PRIVATE_KEY', default='0x00De4B13153673BCAE2616b67bf822500d325Fc3') +GRANTS_PAYOUT_ADDRESS = env('GRANTS_PAYOUT_ADDRESS', default='0x00De4B13153673BCAE2616b67bf822500d325Fc3') +GRANTS_PAYOUT_PRIVATE_KEY = env('GRANTS_PAYOUT_PRIVATE_KEY', default='0x00De4B13153673BCAE2616b67bf822500d325Fc3') +GRANTS_PAYOUT_CLR_KYC_THRESHOLD = env('GRANTS_PAYOUT_CLR_KYC_THRESHOLD', default=0) + +GRANTS_COUPON_25_OFF = env('GRANTS_COUPON_25_OFF', default='OWOCKIFOREVER') +GRANTS_COUPON_50_OFF = env('GRANTS_COUPON_50_OFF', default='OWOCKIFOREVER') +GRANTS_COUPON_100_OFF = env('GRANTS_COUPON_100_OFF', default='OWOCKIFOREVER') + ELASTIC_SEARCH_URL = env('ELASTIC_SEARCH_URL', default='') diff --git a/app/app/utils.py b/app/app/utils.py index 36020f76f34..a5db7959b1b 100644 --- a/app/app/utils.py +++ b/app/app/utils.py @@ -376,6 +376,25 @@ def handle_location_request(request): return geolocation_data, ip_address +geoIPobject = None +geoIPCountryobject = None + + +def get_geoIP_singleton(): + global geoIPobject + if not geoIPobject: + geoIPobject = GeoIP2() + return geoIPobject + + +def get_geoIP_country_singleton(): + global geoIPCountryobject + db = f'{settings.GEOIP_PATH}GeoLite2-Country.mmdb' + if not geoIPCountryobject: + geoIPCountryobject = geoip2.database.Reader(db) + return geoIPCountryobject + + def get_location_from_ip(ip_address): """Get the location associated with the provided IP address. @@ -391,7 +410,7 @@ def get_location_from_ip(ip_address): return city try: - geo = GeoIP2() + geo = get_geoIP_singleton() try: city = geo.city(ip_address) except AddressNotFoundError: @@ -401,17 +420,15 @@ def get_location_from_ip(ip_address): return city -def get_country_from_ip(ip_address, db=None): +def get_country_from_ip(ip_address): """Get the user's country information from the provided IP address.""" country = {} - if db is None: - db = f'{settings.GEOIP_PATH}GeoLite2-Country.mmdb' if not ip_address: return country try: - reader = geoip2.database.Reader(db) + reader = get_geoIP_country_singleton() country = reader.country(ip_address) except AddressNotFoundError: pass diff --git a/app/assets/v2/css/scroll-carousel.css b/app/assets/v2/css/scroll-carousel.css index 97162a894a2..d999e0d3afc 100644 --- a/app/assets/v2/css/scroll-carousel.css +++ b/app/assets/v2/css/scroll-carousel.css @@ -4,7 +4,7 @@ .scroll-carousel { display: flex; - overflow-x: scroll; + overflow-x: auto; scroll-snap-type: x mandatory; flex: 1 1 50%; flex-direction: row; diff --git a/app/assets/v2/images/avatar3d/lego.svg b/app/assets/v2/images/avatar3d/lego.svg new file mode 100644 index 00000000000..167bec03c54 --- /dev/null +++ b/app/assets/v2/images/avatar3d/lego.svg @@ -0,0 +1,1234 @@ + + + + LEGO_Carton_Gitcoin_Avatar_350x350 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/v2/js/search.js b/app/assets/v2/js/search.js index ef67cc7855f..5aa287d02f9 100644 --- a/app/assets/v2/js/search.js +++ b/app/assets/v2/js/search.js @@ -33,6 +33,11 @@ if (document.getElementById('gc-search')) { this.search(); }, methods: { + init: function() { + setTimeout(() => { + $('.has-search input').focus(); + }, 100); + }, search: async function() { let vm = this; diff --git a/app/assets/v2/js/shared.js b/app/assets/v2/js/shared.js index 5c82a0fdbf0..e89027dbed2 100644 --- a/app/assets/v2/js/shared.js +++ b/app/assets/v2/js/shared.js @@ -77,6 +77,9 @@ var loading_button = function(button) { var cb_address; var reloadCbAddress = function() { + if (typeof web3 == 'undefined') { + return; + } web3.eth.getCoinbase(function(error, result) { if (!error) { cb_address = result; diff --git a/app/assets/v2/js/user_card.js b/app/assets/v2/js/user_card.js index 732c1f297d3..b7f89b71fb0 100644 --- a/app/assets/v2/js/user_card.js +++ b/app/assets/v2/js/user_card.js @@ -30,7 +30,7 @@ const renderPopOverData = function(data) { ${_organization} `; } else if (index < 6) { - return `+${data.orgs.length - 5}`; + return `+${unique_orgs.length - 5}`; } }).join(' '); diff --git a/app/avatar/views_3d.py b/app/avatar/views_3d.py index 82165b39174..96457440323 100644 --- a/app/avatar/views_3d.py +++ b/app/avatar/views_3d.py @@ -373,6 +373,16 @@ def get_avatar_attrs(theme, key): 'tone_maps': [], 'path': 'assets/v2/images/avatar3d/orc_gitcoin.svg', }, + 'lego': { + 'preview_viewbox': { + 'background': '0 0 350 350', + }, + 'skin_tones': [], + 'hair_tones': [], + 'skin_tones': [], + 'tone_maps': [], + 'path': 'assets/v2/images/avatar3d/lego.svg', + }, 'PixelBot': { 'preview_viewbox': { 'background': '0 0 350 350', diff --git a/app/dashboard/templates/dashboard/index-vue.html b/app/dashboard/templates/dashboard/index-vue.html index bb1d1568cc4..87d401507f2 100644 --- a/app/dashboard/templates/dashboard/index-vue.html +++ b/app/dashboard/templates/dashboard/index-vue.html @@ -302,10 +302,11 @@
{% if not hackathon_not_started %} -
- +
+ + {% include 'dashboard/featured_bounties.html' %}
Loading ... @@ -325,7 +326,6 @@

Hackathon Coming Soon!

{% include 'shared/hackathon_sponsors.html' %}
- {% include 'dashboard/featured_bounties.html' %} {% else %}

Hackathon Coming Soon!

diff --git a/app/dashboard/templates/shared/search.html b/app/dashboard/templates/shared/search.html index 7fc65f9f38d..b2516c068f2 100644 --- a/app/dashboard/templates/shared/search.html +++ b/app/dashboard/templates/shared/search.html @@ -17,7 +17,7 @@ {% load i18n static humanize %}