diff --git a/app/dashboard/templates/onepager/send2.html b/app/dashboard/templates/onepager/send2.html index 3df42f0f65c..9c9d4ebf75d 100644 --- a/app/dashboard/templates/onepager/send2.html +++ b/app/dashboard/templates/onepager/send2.html @@ -30,6 +30,19 @@ + {% endblock %} {% block 'main' %} @@ -63,6 +76,68 @@ .terms { margin-top: 0.75rem; } + + .recent-tips { + color: var(--gc-dark-grey); + text-align: left; + } + .recent-tips .label { + float: left; + width: 15%; + line-height: 1.2; + } + .recent-tips ul { + list-style: none; + } + .recent-tips-list img { + max-width: 40px; + border-radius: 50%; + padding: 2px; + } + .recent-tips-list img:hover { + box-shadow: 0 0 0 2px var(--gc-green-hover); + cursor: pointer; + } + .recent-tips-list img.active { + box-shadow: 0 0 0 2px var(--gc-blue); + } + .recent-tips-list a:hover { + text-decoration: none; + } + + .user-tooltip { + position: relative; + display: inline-block; + } + .user-tooltip .user-tooltip-text { + visibility: hidden; + + background-color: #ffffff; + border: 1px solid var(--gc-dark-grey); + border-radius: 2px; + padding: 3px; + + top: 100%; + left:50%; + transform:translateX(-50%); + + text-align: center; + width: max-content; + position: absolute; + z-index: 1; + margin-top: 5px; + + opacity: 0; + transition: all 0.3s; + } + .user-tooltip:hover .user-tooltip-text { + visibility: visible; + opacity: 1; + } + .user-tooltip .user-tooltip-text a { + color: var(--gc-dark-grey) !important; + } +
@@ -103,6 +178,23 @@

{% trans "Send Tip." %}

{% endif %}
+ {% if recent_tips_profiles %} +
+ {% trans "Recently Sent" %} +
+ +
+
+ {% endif %} {% if is_staff %}
diff --git a/app/dashboard/tip_views.py b/app/dashboard/tip_views.py index b437a3adc75..2ff40e62aa4 100644 --- a/app/dashboard/tip_views.py +++ b/app/dashboard/tip_views.py @@ -462,6 +462,15 @@ def send_tip_2(request): user['avatar_url'] = profile.avatar_baseavatar_related.filter(active=True).first().avatar_url user['preferred_payout_address'] = profile.preferred_payout_address + recent_tips = Tip.objects.filter(sender_profile=request.user.profile).order_by('-created_on') + recent_tips_profiles = [] + + for tip in recent_tips: + if len(recent_tips_profiles) == 7: + break + if tip.recipient_profile not in recent_tips_profiles: + recent_tips_profiles.append(tip.recipient_profile) + params = { 'issueURL': request.GET.get('source'), 'class': 'send2', @@ -470,7 +479,8 @@ def send_tip_2(request): 'from_handle': from_username, 'title': 'Send Tip | Gitcoin', 'card_desc': 'Send a tip to any github user at the click of a button.', - 'fund_request': fund_request + 'fund_request': fund_request, + 'recent_tips_profiles': recent_tips_profiles } if user: