Skip to content

Commit

Permalink
Merge pull request #584 from OpenUpSA/fix/member-profile-pic-url-s3
Browse files Browse the repository at this point in the history
Prefix all occurences of {{ member.profile_pic_url }}  with static host
  • Loading branch information
paulmwatson authored Dec 9, 2024
2 parents 27429a3 + 8e36aaa commit 56c1f2f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pmg/templates/admin/inline_membership.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
<div class="col-md-2 text-center">
{% if model and model.member.profile_pic_url %}
<img src="http://pmg-assets.s3-eu-west-1.amazonaws.com/{{ model.member.profile_pic_url }}" style="max-width: 75px;"></img>
<img src="{{ STATIC_HOST }}{{ member.profile_pic_url }}" style="max-width: 75px;"></img>
{% endif %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pmg/templates/macros/members.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro member_badge(member, chairperson=False) -%}
{%- if member.profile_pic_url %}
<a href="{{ member|member_url }}"><img class="member-profile-pic {% if chairperson %}chairperson{% endif %}" src="{{ member.profile_pic_url }}" alt="Profile picture: {{ member.name }}" ></a>
<a href="{{ member|member_url }}"><img class="member-profile-pic {% if chairperson %}chairperson{% endif %}" src="{{ STATIC_HOST }}{{ member.profile_pic_url }}" alt="Profile picture: {{ member.name }}" ></a>
{% else %}
<p class="text-muted">No image available</p>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion pmg/templates/member_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1><i class="fa fa-user"></i> {{ member.name }}</h1>

<div class="row">
<div class="col-md-1">
<img src="{{ member.profile_pic_url }}" alt="{{ member.name }}">
<img src="{{ STATIC_HOST }}{{ member.profile_pic_url }}" alt="{{ member.name }}">
</div>
<div class="col-md-4">
{{ member.bio|safe }}
Expand Down
4 changes: 2 additions & 2 deletions pmg/templates/member_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h1><i class="fa fa-icon fa-user"></i> {{ province.name }} Members</h1>
{% for member in provincial_members %}
<div class="single-mp col-xs-12 col-sm-6 col-md-4 col-lg-3">
<a class="content-card flex" href="{{ member | member_url }}">
<img class="member-profile-pic" src="{{ member.profile_pic_url or '/static/resources/images/no-profile-pic.svg' }}" alt="{{ member.name }}">
<img class="member-profile-pic" src="{{ STATIC_HOST }}{{ member.profile_pic_url or '/static/resources/images/no-profile-pic.svg' }}" alt="{{ member.name }}">
<div>
<h4 class="card-title name">{{ member.name }}</h4>
{% if member.party %}
Expand Down Expand Up @@ -75,7 +75,7 @@ <h5>{{ member.party.name }}</h5>
{% for member in members %}
<div class="single-mp col-xs-12 col-sm-6 col-md-4 col-lg-3">
<a class="content-card flex" href="{{ member | member_url }}">
<img class="member-profile-pic" src="{{ member.profile_pic_url or '/static/resources/images/no-profile-pic.svg' }}" alt="{{ member.name }}">
<img class="member-profile-pic" src="{{ STATIC_HOST }}{{ member.profile_pic_url or '/static/resources/images/no-profile-pic.svg' }}" alt="{{ member.name }}">
<div>
<h4 class="card-title name">{{ member.name }}</h3>
{% if member.party %}
Expand Down
2 changes: 1 addition & 1 deletion pmg/templates/provincial/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h2><i class="fa fa-icon fa-fw fa-user"></i>Members</h2>
{% for member in mpls %}
<div class="col-xs-12 col-sm-6 col-lg-4">
<a class="content-card flex" href="{{ member | member_url }}">
<img class="member-profile-pic" src="{{ member.profile_pic_url or '/static/resources/images/no-profile-pic.svg' }}" alt="{{ member.name }}">
<img class="member-profile-pic" src="{{ STATIC_HOST }}{{ member.profile_pic_url or '/static/resources/images/no-profile-pic.svg' }}" alt="{{ member.name }}">
<div>
<h4 class="card-title">{{ member.name }}</h4>
<h5>{{ member.party.name }}</h5>
Expand Down
2 changes: 1 addition & 1 deletion pmg/templates/provincial/western_cape.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2><i class="fa fa-icon fa-fw fa-user"></i> Members</h2>
{% for member in mpls %}
<div class="col-xs-12 col-sm-6 col-lg-4">
<a class="content-card flex" href="{{ member | member_url }}">
<img class="member-profile-pic" src="{{ member.profile_pic_url or '/static/resources/images/no-profile-pic.svg' }}" alt="{{ member.name }}">
<img class="member-profile-pic" src="{{ STATIC_HOST }}{{ member.profile_pic_url or '/static/resources/images/no-profile-pic.svg' }}" alt="{{ member.name }}">
<div>
<h4 class="card-title">{{ member.name }}</h4>
<h5>{{ member.party.name }}</h5>
Expand Down

0 comments on commit 56c1f2f

Please sign in to comment.