Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
danlipert committed Jan 9, 2020
2 parents 7e82ea0 + 08f51d8 commit 25174c3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/grants/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
from django.contrib import admin
from django.utils.html import format_html
from django.utils.safestring import mark_safe

from grants.models import CLRMatch, Contribution, Grant, MatchPledge, PhantomFunding, Subscription
Expand Down Expand Up @@ -180,6 +181,21 @@ def error_email_copy_not_active(self, instance):
class ContributionAdmin(GeneralAdmin):
"""Define the Contribution administration layout."""
raw_id_fields = ['subscription']
list_display = ['id', 'txn_url', 'profile', 'created_on', 'amount', 'token', 'tx_cleared', 'success']

def txn_url(self, obj):
tx_id = obj.tx_id
tx_url = 'https://etherscan.io/tx/' + tx_id
return format_html("<a href='{}' target='_blank'>{}</a>", tx_url, tx_id)

def profile(self, obj):
return obj.subscription.contributor_profile

def token(self, obj):
return obj.subscription.token_symbol

def amount(self, obj):
return obj.subscription.amount_per_period


admin.site.register(PhantomFunding, GeneralAdmin)
Expand Down

0 comments on commit 25174c3

Please sign in to comment.