Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix card image display on twitter cards #6488

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ def users_directory(request):

params = {
'is_staff': request.user.is_staff,
'avatar_url': static('v2/images/twitter_cards/tw_cards-07.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-07.png')) ,
'active': 'users',
'title': 'Users',
'meta_title': "",
Expand Down Expand Up @@ -1199,7 +1199,7 @@ def dashboard(request):
params = {
'active': 'dashboard',
'title': title,
'avatar_url': static('v2/images/twitter_cards/tw_cards-01 copy.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-01 copy.png')),
'meta_title': "Issue & Open Bug Bounty Marketplace | Gitcoin",
'meta_description': "Find open bug bounties & freelance development jobs including crypto bounty reward value in USD, expiration date and bounty age.",
'keywords': json.dumps([str(key) for key in Keyword.objects.all().values_list('keyword', flat=True)]),
Expand Down Expand Up @@ -2087,7 +2087,7 @@ def quickstart(request):
activities = Activity.objects.filter(activity_type='new_bounty').order_by('-created')[:5]
context = deepcopy(qs.quickstart)
context["activities"] = activities
context['avatar_url'] = static('v2/images/twitter_cards/tw_cards-01.png')
context['avatar_url'] = request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-01.png'))
return TemplateResponse(request, 'quickstart.html', context)


Expand Down Expand Up @@ -3407,7 +3407,7 @@ def new_bounty(request):
except (ValueError, Activity.DoesNotExist):
pass

params['avatar_url'] = static('v2/images/twitter_cards/tw_cards-01.png')
params['avatar_url'] = request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-01.png'))
return TemplateResponse(request, 'bounty/fund.html', params)


Expand Down Expand Up @@ -3780,7 +3780,7 @@ def hackathon(request, hackathon='', panel='prizes'):
'is_registered': json.dumps(True if is_registered else False),
'hackathon_not_started': hackathon_not_started,
'user': request.user,
'avatar_url': static('v2/images/twitter_cards/tw_cards-02.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-02.png')),
'tags': view_tags,
'activities': [],
'SHOW_DRESSING': False,
Expand Down Expand Up @@ -3847,7 +3847,7 @@ def hackathon_onboard(request, hackathon=''):
'title': f'{hackathon_event.name.title()} Onboard',
'hackathon': hackathon_event,
'referer': referer,
'avatar_url': static('v2/images/twitter_cards/tw_cards-02.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-02.png')),
'is_registered': is_registered,
'sponsors': sponsors
}
Expand Down Expand Up @@ -3912,7 +3912,7 @@ def hackathon_projects(request, hackathon='', specify_project=''):

title = f'{hackathon_event.name.title()} Projects'
desc = f"{title} in the recent Gitcoin Virtual Hackathon"
avatar_url = hackathon_event.logo.url if hackathon_event.logo else static('v2/images/twitter_cards/tw_cards-02.png')
avatar_url = hackathon_event.logo.url if hackathon_event.logo else request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-02.png'))

if order_by not in {'created_on', '-created_on'}:
order_by = '-created_on'
Expand Down Expand Up @@ -4003,7 +4003,7 @@ def hackathon_get_project(request, bounty_id, project_id=None):
'bounty': bounty,
'projects': projects,
'project_selected': project_selected,
'avatar_url': static('v2/images/twitter_cards/tw_cards-02.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-02.png')),
}
return TemplateResponse(request, 'dashboard/hackathon/project_new.html', params)

Expand Down Expand Up @@ -4226,7 +4226,7 @@ def get_hackathons(request):
params = {
'active': 'hackathons',
'title': 'Hackathons',
'avatar_url': static('v2/images/twitter_cards/tw_cards-02.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-02.png')),
'card_desc': "Gitcoin runs Virtual Hackathons. Learn, earn, and connect with the best hackers in the space -- only on Gitcoin.",
'events': events,
}
Expand Down
4 changes: 2 additions & 2 deletions app/grants/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def grants(request):
'current_partners': current_partners,
'past_partners': past_partners,
'card_desc': f'❇️ LIVE NOW! Up to $250k Matching Funding on Gitcoin Grants',
'avatar_url': static('v2/images/twitter_cards/tw_cards-03.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-03.png')),
'card_type': 'summary_large_image',
'avatar_height': 1097,
'avatar_width': 1953,
Expand Down Expand Up @@ -1066,7 +1066,7 @@ def quickstart(request):
params = {
'active': 'grants_quickstart',
'title': _('Quickstart'),
'avatar_url': static('v2/images/twitter_cards/tw_cards-03.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-03.png')),
}
return TemplateResponse(request, 'grants/quickstart.html', params)

Expand Down
14 changes: 7 additions & 7 deletions app/kudos/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def about(request):
'title': 'Kudos',
'card_title': _('Each Kudos is a unique work of art.'),
'card_desc': _('It can be sent to highlight, recognize, and show appreciation.'),
'avatar_url': static('v2/images/twitter_cards/tw_cards-06.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-06.png')),
'card_player_override': 'https://www.youtube.com/embed/EOlMTOzmKKk',
'card_player_stream_override': static('v2/card/kudos.mp4'),
'card_player_thumb_override': static('v2/card/kudos.png'),
'card_player_stream_override': request.build_absolute_uri(static('v2/card/kudos.mp4')),
'card_player_thumb_override': request.build_absolute_uri(static('v2/card/kudos.png')),
"listings": listings
}
return TemplateResponse(request, 'kudos_about.html', context)
Expand Down Expand Up @@ -147,7 +147,7 @@ def marketplace(request):
'title': title,
'card_title': _('Each Kudos is a unique work of art.'),
'card_desc': _('It can be sent to highlight, recognize, and show appreciation.'),
'avatar_url': static('v2/images/twitter_cards/tw_cards-06.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-06.png')),
'listings': listings,
'network': network
}
Expand Down Expand Up @@ -201,7 +201,7 @@ def details(request, kudos_id, name):
'title': 'Details',
'card_title': _('Each Kudos is a unique work of art.'),
'card_desc': _('It can be sent to highlight, recognize, and show appreciation.'),
'avatar_url': static('v2/images/kudos/assets/kudos-image.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/kudos/assets/kudos-image.png')),
'kudos': kudos,
'related_handles': list(set(kudos.owners_handles))[:num_kudos_limit],
'target': f'/activity?what=kudos:{kudos.pk}',
Expand Down Expand Up @@ -314,7 +314,7 @@ def send_2(request):
params = {
'active': 'send',
'issueURL': request.GET.get('source'),
'avatar_url': static('v2/images/twitter_cards/tw_cards-06.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-06.png')),
'class': 'send2',
'recommend_gas_price': recommend_min_gas_price_to_confirm_in_time(confirm_time_minutes_target),
'from_email': getattr(request.user, 'email', ''),
Expand Down Expand Up @@ -826,7 +826,7 @@ def newkudos(request):
'msg': None,
'nav': 'kudos',
'title': "Mint new Kudos",
'avatar_url': static('v2/images/twitter_cards/tw_cards-06.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-06.png')),
}

if not request.user.is_authenticated:
Expand Down
4 changes: 2 additions & 2 deletions app/quests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def editquest(request, pk=None):
'package': package,
'the_quest': quest,
'questions': questions,
'avatar_url': static('v2/images/twitter_cards/tw_cards-05.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-05.png')),
'backgrounds': [ele[0] for ele in Quest.BACKGROUNDS],
'answer_correct': request.POST.getlist('answer_correct[]',[]),
'seconds_to_respond': request.POST.getlist('seconds_to_respond[]',[]),
Expand Down Expand Up @@ -346,7 +346,7 @@ def index(request):
'point_value': point_value,
'show_loading': show_loading,
'current_round_number': current_round_number,
'avatar_url': static('v2/images/twitter_cards/tw_cards-05.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-05.png')),
'card_desc': 'Gitcoin Quests is a fun, gamified way to learn about the web3 ecosystem, compete with your friends, earn rewards, and level up your decentralization-fu!',
}

Expand Down
2 changes: 2 additions & 0 deletions app/retail/templates/tribes/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<meta name="description" content="Build relationships and meaningful projects while forming an open source tribe.">
<link rel="stylesheet" href="{% static "v2/css/retail/plans.css" %}" />
<link rel="stylesheet" href="{% static "v2/css/retail/tribes_landing.css" %}" />
{% include 'shared/cards_pic.html' %}

</head>
<body class="tribes-landing g-font-muli">
{% include 'shared/tag_manager_2.html' %}
Expand Down
8 changes: 3 additions & 5 deletions app/retail/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def funder_bounties(request):
'slides': slides,
'slideDurationInMs': 6000,
'active': 'bounties_funder',
'avatar_url': static('v2/images/twitter_cards/tw_cards-01.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-01.png')),
'hide_newsletter_caption': True,
'hide_newsletter_consent': True,
'gitcoin_description': gitcoin_description,
Expand Down Expand Up @@ -430,7 +430,7 @@ def contributor_bounties(request, tech_stack):

# tech_stack = '' #uncomment this if you wish to disable contributor specific LPs
context = {
'avatar_url': static('v2/images/twitter_cards/tw_cards-01.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-01.png')),
'onboard_slides': onboard_slides,
'slides': slides,
'slideDurationInMs': 6000,
Expand Down Expand Up @@ -500,10 +500,8 @@ def how_it_works(request, work_type):


def robotstxt(request):
hidden_profiles = list(JSONStore.objects.get(view='hidden_profiles').data)
context = {
'settings': settings,
'hidden_profiles': hidden_profiles,
}
return TemplateResponse(request, 'robots.txt', context, content_type='text')

Expand Down Expand Up @@ -1700,7 +1698,7 @@ def tribes(request):
'plans': plans,
'tribes': tribes,
'testimonials': testimonials,
'avatar_url': static('v2/images/twitter_cards/tw_cards-07.png'),
'avatar_url': request.build_absolute_uri(static('v2/images/twitter_cards/tw_cards-07.png')),
'reasons': reasons
}

Expand Down