Skip to content

Commit 25174c3

Browse files
committed
Merge remote-tracking branch 'origin/stable'
2 parents 7e82ea0 + 08f51d8 commit 25174c3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

app/grants/admin.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
1919
"""
2020
from django.contrib import admin
21+
from django.utils.html import format_html
2122
from django.utils.safestring import mark_safe
2223

2324
from grants.models import CLRMatch, Contribution, Grant, MatchPledge, PhantomFunding, Subscription
@@ -180,6 +181,21 @@ def error_email_copy_not_active(self, instance):
180181
class ContributionAdmin(GeneralAdmin):
181182
"""Define the Contribution administration layout."""
182183
raw_id_fields = ['subscription']
184+
list_display = ['id', 'txn_url', 'profile', 'created_on', 'amount', 'token', 'tx_cleared', 'success']
185+
186+
def txn_url(self, obj):
187+
tx_id = obj.tx_id
188+
tx_url = 'https://etherscan.io/tx/' + tx_id
189+
return format_html("<a href='{}' target='_blank'>{}</a>", tx_url, tx_id)
190+
191+
def profile(self, obj):
192+
return obj.subscription.contributor_profile
193+
194+
def token(self, obj):
195+
return obj.subscription.token_symbol
196+
197+
def amount(self, obj):
198+
return obj.subscription.amount_per_period
183199

184200

185201
admin.site.register(PhantomFunding, GeneralAdmin)

0 commit comments

Comments
 (0)