Skip to content

Commit

Permalink
Kudos v1 (#2492)
Browse files Browse the repository at this point in the history
* Don't show unclonable Kudos in marketplace

* Add new kudos

* Don't restrict kudos minting at all

* Updates to handle the latest Kudos contract changes

See gitcoinco/gitcoin-erc721#162

* Fix IPFS CORs problem again

* Update how rarity gets set

* kudos.yaml now has tags as an array of strings

* Add new kudos images

* update rinkeby address for abi.js

* new rinkeby contract address

* update crontab

* Fix Kudos name not showing up on receive page

* fix js bug in kudos_send

* prompts

* kudos levitation demo

* refactor

* kudos goodies

* Add kudos email preview

* change logo

* change detail kudos styles

* change var kudos

* Partials are fun

* no more levitate

* Kudos asset updates from badges repo

* Add new kudos fields, artist and platform

* Update Rinkeby address

* Add kudos_mainnet.yaml for soft launch

* add profile about

* Add mainnet address

* Support reading private keys from .env

* Update kudos clone utils and mgmt functions

* Be able to pass mint_to address into command

* Making clone kudos util command work

* Add kudos private key vars to settings.py

* Add update_kudos_metadata script (not tested yet)

* Kudos minted on mainnet will point to kudosdemo for now

* Update external_url per network

* Add debug and value to gas estimate

* add author

* change kudos send feedbacks

* add styles

* add styles

* add kudos nav

* add kudos nav

* change logos

* change send kudos

* fixes the javascript on kudos details page

* add topbar on all pages

* add grants nav

* Fixes

* change menu

* add title to landing

* add gif logo

* adds kudos to results page

* make fix

* comments

* make fix

* fixes font awesome icongs

* fix mobile menu

* add not found profiles

* Add burn util and management function

* Go away psycopg2 warnings

* Fix fresh_start script

* update kudos abi

* add inactive and change claim kudos

* a fix for kudos - levitate being off basee

* Add automatic local syncing via docker-command.bash

* fix kudos navbar

* fix svg font

* Remove mnemonic from docker-compose, use ENV var

* Update fresh_start script for web repo

* Fix typo for mnemonic

* Fix TEST_MNEMONIC quoting issue

* Upgrade to web3py 4.7.2

* Inject poa middleware for rinkeby network

* Clean up extraneous python imports

* Remove deprecated kudos fixtures

* Ignore the trouble making JS files

* Run isort on kudos files

* Run isort on dashboard

* isort mails, emails, urls

* Minor formatting changes to make linter happy

* Updates to kudos_send to appease eslint

* Replace totalSupply with getLatestId to get latest kudos id

Fixes gitcoinco/gitcoin-erc721#193

* fix lint js

* fix lint in range

* fix send kudos

* Quiet down the noise travis build

* Compress images

* You win Stickler

* Remove TODO from urls.py

* Remove from __future__

* Docstring formatting

* Remove extraneous migration file

* Revert "Quiet down the noise travis build"

This reverts commit b56ee35.

* Small formatting cleanup

* Remove trailing whitespace

* fix tabs.js broking wallets js

* Temporarily disable kudos crontab entries

* Clean up migration files

* fix css lint

* Revert "Clean up migration files"

This reverts commit 6910cdf.

* One more time

* Minify tweenlite.js

* Clean up exceptions for receive_url_for_recipient

* lipstick

- removing old code comments
- formatting stuff

* Don't need kudos apps.py

* Add gettext to label

* fix diffs

* Move Kudos contract addresses to settings.py

* Fix related_kudos filter

* More formatting and dead code cleanup

* hide grants menu link

* Moar docstrings

* add faq

* Updates to account for multiple Kudos contracts

* comment out local_filter_middleware until its released

* fix rain bg

* add error msg

* clean

* fix gitcoinco/gitcoin-erc721#173

* Revert "Upgrade to web3py 4.7.2"

This reverts commit 7f26652.

* network and contract_address should be required fields

* Update link for "Start Over" in Kudos Send page

* Fix migration file bug

* Don't put # in background_color

* FIx logging output to be token_id instead of row id

* Update sync_kudos log file name

* Add new kudos assets

* Revert "Minify tweenlite.js"

This reverts commit 1e9a629.

* Change to web3 4.6.0

* Fix network name

* small updates

* Revert "Change to web3 4.6.0"

This reverts commit 37e3a67.

* Add smaller kudos_test.yaml for testing

* Compress new kudos images

* Display github picture if avatar doesn't exist

* Update sync method for multiple kudos contract

* remove bad localhost network detection

* Fix compressed animations

* add disqus

* add dot notification

* fix sizes in select

* change kudos text

* fix img size

* make fix, also: adds support for png images of each kudos

* Break out kudos.Contract into its own model

This is to better support having multiple deployed kudos contracts.

* Add new URL route to do lookups by contract and token_id

* Stub out some basic tests for Kudos

* Update external_url to be the correct token_id for all networks

* Add helper to resolve a kudos token

* More updates to handle multiple token_ids across contracts

* Update KUDOS_NETWORK env var

* Update abi with latest contract code

* Update --catchup flag for new schema

* Fix template typo

* Make mint url consistent with others

* Fix get_token resolution logic

* Fix ability to load /send page without an id

* Extra space

* How about some tests

* change about page

* change svgo command

* add correct svg

* iSort fixes

* Re-compress images using --disable=removeViewBox

* Revert "Compress images"

This reverts commit 5fcc26a.

* Re-compress kudos images from scratch

Ssing --disable=removeViewBox

* Update rinkeby contract address

* Don't add middleware twice (added downstream already)

* 404 if the kudos id doesn't exist

* Fix confusing debug message

* Add gas_estimate debug msg

* Add decorator to log out contract args

* Update rinkeby contract address

* Update rinkeby contract

* update rinkeby contract address for abi.js

* fix static subdomain for staging

* Update rinkeby address

* iSort fixx

* Fixes

* Remove dead code

* Only show settings.KUDOS_NETWORK in marketplace

* Update kudos crontab

* change gif logo

* rewrites marketplace search

* Add search test for marketplace

* Encode image names to handle bad chars

Fix c++_scientist

* FIx tags splitting incorrectly

* fix usersearch console error

* fix inline send

* add style for none clones

* fix inline send

* fix profile pictures

* fix lint

* update text

* Change rarity labels

* add generation

* Add new kudos assets

* New deployment to rinkeby

* Update method id's for block listener

Syncing this way still sucks though

* Handle case where start_id might not be valid

* FIx blue box overlap values

* Sync Gen0 token when cloned

* Fix kudos detail numbers

* Fix Kudos Indirect Send

The issue was that is was using the incorrect tokenId.  It was using kudos_token.id (pk) instead of the kudos_token.token_id (contract token id).

* add gold line

* fix sent cards data

* clean

* fix pagination and change method

* remove white space

* Update for latest Rinkeby Contract

* FIx typo

* Update mainnet contract address

* Add additional gas_price_gwei option

*  Make gas price optional

* Fix sent kudos on profile, adjust some logic and DRY it up a bit

* Adjust profile kudos queries to use both pref payout addy and profile relations

* Update kudos detail route to use kudos_id

* hide kudos stuff until its been QAed... revert this when kudos has been QAed and looks good

* Squash kudos migrations
  • Loading branch information
jasonrhaas authored and Mark Beacom committed Oct 27, 2018
1 parent ef4b6ad commit bb911ee
Show file tree
Hide file tree
Showing 398 changed files with 15,425 additions and 188 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ app/assets/v2/js/jquery*.js
app/assets/v2/js/jsrender.js
app/assets/v2/js/showdown.js
app/assets/v2/js/tooltip.js
app/assets/v2/js/tweenlite.js
app/assets/v2/js/abi.js

app/assets/onepager/js/confetti.js

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ node_modules/
gcoin/
.cache/
webpack-stats.json
.sass-cache

# Sensitive environment files
.env
Expand Down
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
app/assets/v2/css/jquery.select2.min.css
app/assets/v2/css/bootstrap.min.css
app/assets/v2/js/tweenlite.js
app/assets/v2/js/abi.js
6 changes: 6 additions & 0 deletions app/app/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from django.utils import timezone

from dashboard.models import Tip
from kudos.models import KudosTransfer


def insert_settings(request):
Expand Down Expand Up @@ -75,7 +76,12 @@ def insert_settings(request):
username__iexact=context['github_handle'],
web3_type='v3',
).exclude(txid='')
context['unclaimed_kudos'] = KudosTransfer.objects.filter(
receive_txid='', username__iexact="@" + context['github_handle'], web3_type='v3',
).exclude(txid='')

if not settings.DEBUG:
context['unclaimed_tips'] = context['unclaimed_tips'].filter(network='mainnet')
context['unclaimed_kudos'] = context['unclaimed_kudos'].filter(network='mainnet')

return context
19 changes: 18 additions & 1 deletion app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import raven
from easy_thumbnails.conf import Settings as easy_thumbnails_defaults

import warnings
warnings.filterwarnings("ignore", category=UserWarning, module='psycopg2')

root = environ.Path(__file__) - 2 # Set the base directory to two levels.
env = environ.Env(DEBUG=(bool, False), ) # set default values and casting
env.read_env(str(root.path('app/.env'))) # reading .env file
Expand Down Expand Up @@ -101,6 +104,8 @@
'external_bounties',
'dataviz',
'impersonate',
'kudos',
'django.contrib.postgres',
'bounty_requests'
]

Expand Down Expand Up @@ -130,7 +135,7 @@

TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['retail/templates/', 'external_bounties/templates/', 'dataviz/templates', ],
'DIRS': ['retail/templates/', 'external_bounties/templates/', 'dataviz/templates', 'kudos/templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand Down Expand Up @@ -489,6 +494,18 @@
SLACK_TOKEN = env('SLACK_TOKEN', default='') # TODO
SLACK_WELCOMEBOT_TOKEN = env('SLACK_WELCOMEBOT_TOKEN', default='') # TODO

# OpenSea API
OPENSEA_API_KEY = env('OPENSEA_API_KEY', default='')

# Kudos
KUDOS_OWNER_ACCOUNT = env('KUDOS_OWNER_ACCOUNT', default='0xD386793F1DB5F21609571C0164841E5eA2D33aD8')
KUDOS_PRIVATE_KEY = env('KUDOS_PRIVATE_KEY', default='')
KUDOS_CONTRACT_MAINNET = env('KUDOS_CONTRACT_MAINNET', default='0x2aea4add166ebf38b63d09a75de1a7b94aa24163')
KUDOS_CONTRACT_RINKEBY = env('KUDOS_CONTRACT_RINKEBY', default='0x4077ae95eec529d924571d00e81ecde104601ae8')
KUDOS_CONTRACT_ROPSTEN = env('KUDOS_CONTRACT_ROPSTEN', default='0xcd520707fc68d153283d518b29ada466f9091ea8')
KUDOS_CONTRACT_TESTRPC = env('KUDOS_CONTRACT_TESTRPC', default='0xe7bed272ee374e8116049d0a49737bdda86325b6')
KUDOS_NETWORK = env('KUDOS_NETWORK', default='localhost')

# Reporting Integrations
MIXPANEL_TOKEN = env('MIXPANEL_TOKEN', default='')

Expand Down
30 changes: 28 additions & 2 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import faucet.views
import gitcoinbot.views
import healthcheck.views
import kudos.views
import linkshortener.views
import marketing.views
import marketing.webhookviews
Expand All @@ -48,21 +49,43 @@
import tdi.views
from dashboard.router import router as dbrouter
from external_bounties.router import router as ebrouter
from kudos.router import router as kdrouter

from .sitemaps import sitemaps

urlpatterns = [
path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),

# kudos
path('kudos/', kudos.views.about, name='kudos_main'),
path('kudos/about/', kudos.views.about, name='kudos_about'),
path('kudos/marketplace/', kudos.views.marketplace, name='kudos_marketplace'),
path('kudos/mint/', kudos.views.mint, name='kudos_mint'),
path('kudos/send/', kudos.views.send_2, name='kudos_send'),
path('kudos/send/3/', kudos.views.send_3, name='kudos_send_3'),
path('kudos/send/4/', kudos.views.send_4, name='kudos_send_4'),
re_path(r'^lazy_load_kudos/$', dashboard.views.lazy_load_kudos, name='lazy_load_kudos'),
re_path(r'^kudos/receive/v3/(?P<key>.*)/(?P<txid>.*)/(?P<network>.*)?', kudos.views.receive, name='kudos_receive'),
re_path(r'^kudos/search/$', kudos.views.search, name='kudos_search'),
re_path(
r'^kudos/(?P<address>\w*)/(?P<token_id>\d+)/(?P<name>\w*)',
kudos.views.details_by_address_and_token_id,
name='kudos_details_by_address_and_token_id'
),
re_path(r'^kudos/(?P<kudos_id>\d+)/(?P<name>\w*)', kudos.views.details, name='kudos_details'),
re_path(r'^kudos/address/(?P<handle>.*)', kudos.views.kudos_preferred_wallet, name='kudos_preferred_wallet'),
re_path(r'^dynamic/kudos/(?P<kudos_id>\d+)/(?P<name>\w*)', kudos.views.image, name='kudos_details'),

# api views
url(r'^api/v0.1/profile/(.*)?/keywords', dashboard.views.profile_keywords, name='profile_keywords'),
url(r'^api/v0.1/funding/save/?', dashboard.ios.save, name='save'),
url(r'^api/v0.1/faucet/save/?', faucet.views.save_faucet, name='save_faucet'),
url(r'^api/v0.1/', include(dbrouter.urls)),
url(r'^api/v0.1/', include(ebrouter.urls)),
url(r'^actions/api/v0.1/', include(dbrouter.urls)), # same as active, but not cached in cloudfront
url(r'^api/v0.1/', include(kdrouter.urls)),
url(r'^actions/api/v0.1/', include(dbrouter.urls)), # same as active, but not cached in cluodfront
url(r'^api/v0.1/users_search/', dashboard.views.get_users, name='users_search'),

url(r'^api/v0.1/kudos_search/', dashboard.views.get_kudos, name='kudos_search'),
# Health check endpoint
re_path(r'^health/', include('health_check.urls')),
re_path(r'^lbcheck/?', healthcheck.views.lbcheck, name='lbcheck'),
Expand Down Expand Up @@ -252,6 +275,9 @@

# admin views
re_path(r'^_administration/?', admin.site.urls, name='admin'),
path('_administration/email/new_kudos', retail.emails.new_kudos, name='new_kudos'),
path('_administration/email/kudos_mint', retail.emails.kudos_mint, name='kudos_mint'),
path('_administration/email/kudos_mkt', retail.emails.kudos_mkt, name='kudos_mkt'),
path('_administration/email/new_bounty', retail.emails.new_bounty, name='admin_new_bounty'),
path('_administration/email/roundup', retail.emails.roundup, name='roundup'),
path('_administration/email/faucet_rejected', retail.emails.faucet_rejected, name='email_faucet_rejected'),
Expand Down
24 changes: 0 additions & 24 deletions app/assets/onepager/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,6 @@ body {
background-attachment: fixed;
}

body::after {
content: '';
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: inherit;
opacity: 0;
z-index: 1;
background-color: #ffffff;
background-image: url('/static/onepager/images/overlay.png'), -moz-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/onepager/images/overlay.png'), -webkit-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/onepager/images/overlay.png'), -ms-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/onepager/images/overlay.png'), linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-repeat: repeat, no-repeat;
background-size: 100px 100px, cover;
background-position: top left, center center;
-moz-transition: opacity 1.75s ease-out;
-webkit-transition: opacity 1.75s ease-out;
-ms-transition: opacity 1.75s ease-out;
transition: opacity 1.75s ease-out;
}

body.is-loading:after {
opacity: 1;
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/onepager/js/receive.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ window.onload = function() {
}
ipfs.catText(document.ipfs_key_to_secret, function(err, key2) {
if (err) {
_alert('could not reach IPFS. please try again later.', 'error');
_alert('Could not reach IPFS. please try again later.', 'error');
return;
}
document.priv_key = combine_secrets(key2, document.gitcoin_secret);
Expand Down
4 changes: 0 additions & 4 deletions app/assets/v2/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,6 @@ p a {
color: #25e899;
}

.btn:focus {
box-shadow: none;
}

.cta-green {
background-color: var(--gc-green);
text-align: center;
Expand Down
10 changes: 0 additions & 10 deletions app/assets/v2/css/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@
box-shadow: inset 0 -3.25em 0 0 var(--hover);
}

.slide {
--color: #8fc866;
--hover: #66c887;
}

.slide:hover,
.slide:focus {
box-shadow: inset 6.5em 0 0 0 var(--hover);
}

.offset {
--color: #19bc8b;
--hover: #1973bc;
Expand Down
70 changes: 58 additions & 12 deletions app/assets/v2/css/gitcoin.css
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ div.button-pink {
cursor: pointer;
}

.gc-round-text-input {
height: 32px;
border: 1px solid #eee;
outline: none;
padding-left: 10px;
font-weight: 300;
}

.gc-border-black {
border: 1px solid black !important;
}
Expand All @@ -407,16 +415,12 @@ div.button-pink {
border: 1px solid #37ea9c !important;
}

.gc-selected {
border: 1px solid #4ef6ad !important;
.gc-border-blue {
border-color: #0D0764;
}

.gc-round-text-input {
height: 32px;
border: 1px solid #eee;
outline: none;
padding-left: 10px;
font-weight: 300;
.gc-selected {
border: 1px solid #4ef6ad !important;
}

.gc-round-text-form {
Expand Down Expand Up @@ -467,10 +471,11 @@ div.button-pink {
/* stylelint-disable-next-line */
font-family: 'Font Awesome 5 Free';
content: '\f107';
font-size: 16px;
font-size: 1.2em;
margin-right: auto;
margin-top: auto;
float: right;
font-weight: 600;
}

.accordion.active:after {
Expand Down Expand Up @@ -554,17 +559,29 @@ div.button-pink {
}
}

/* AutoComplete */
.select2-container .select2-selection--single {
height: 2.5rem !important
.nav-tabs .nav-line {
color: #4A4A4A;
border-width: 0px 0px 3px 0;
}
.nav-tabs .nav-line.active {
color: #0D0764;
border-color: #0D0764;
background-color: transparent;
}

.border-transparent {
border-color: transparent;
}

/* AutoComplete */

.select2-results__option,
.select2-search--dropdown .select2-search__field {
font-size: 0.8rem
}

.select2-container--default .select2-selection--single {
height: 2.5rem !important;
border-radius: 2px !important;
border-color: black !important;
}
Expand Down Expand Up @@ -656,3 +673,32 @@ div.button-pink {
}
}
/* TODO: End */

/* fallback for send tip navbar */
.d-none {
display: none!important;
}

@media (min-width: 768px) {

.d-md-block {
display: block!important;
}
.d-md-flex {
display: -ms-flexbox!important;
display: flex!important;
}
.d-md-none {
display: none!important;
}
}

.notification-dot {
background-color: #ef3427;
width: 0.5rem;
height: 0.5rem;
position: absolute;
top: 6px;
border-radius: 30px;
left: 6px;
}
37 changes: 37 additions & 0 deletions app/assets/v2/css/kudos/range-slider.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
$blue: #0D0764;

[data-rangeslider] {
-webkit-appearance: none;
width: 100%;
height: 2px;
background: $blue;
outline: none;
margin: 1rem 0;

&::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
border-radius: 50px;
background: $blue;
cursor: pointer;
transition: .1s all linear;
}

&:hover::-webkit-slider-thumb {
width: 22px;
height: 22px;
}
&:focus::-webkit-slider-thumb {
width: 26px;
height: 26px;
border-radius: 50px 50px 4px;
transform: rotate(45deg);
margin-bottom: 50px;
}

&::-webkit-slider-runnable-track {}
}


Loading

0 comments on commit bb911ee

Please sign in to comment.