From a1da11b814f925477dbed2b54483ca5f98f5b9a9 Mon Sep 17 00:00:00 2001 From: anishTP <119032387+anishTP@users.noreply.github.com> Date: Sat, 16 Nov 2024 11:31:41 +0530 Subject: [PATCH] Add primary venue title to project card footer (#2136) * Add primary venue title to project card * Flattened nested if conditions in the project card footer * Use trans tag when there's a comma; indent if statements * Fixed missing references to featured_project --------- Co-authored-by: Kiran Jonnalagadda --- funnel/templates/macros.html.jinja2 | 15 +++++++++++++-- funnel/templates/profile_layout.html.jinja2 | 19 ++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/funnel/templates/macros.html.jinja2 b/funnel/templates/macros.html.jinja2 index 4e8745af6..37b1498ef 100644 --- a/funnel/templates/macros.html.jinja2 +++ b/funnel/templates/macros.html.jinja2 @@ -190,8 +190,19 @@

{{ faicon(icon='search', css_class="search-icon", baseline=false) }} {{ snippet_html }}

{% endif %}
- {%- if include_details %} -
{% if project.primary_venue %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {% if project.primary_venue.city %}{{ project.primary_venue.city }}{% else %}{{ project.primary_venue.title }}{% endif %}{% elif project.location %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ project.location }}{% endif %}
+ {%- if include_details and (project.primary_venue or project.location) -%} +
+ {{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} + {%- if project.primary_venue.title and project.primary_venue.city %} + {% trans venue=project.primary_venue.title, city=project.primary_venue.city -%} + {{ venue }}, {{ city }} + {%- endtrans %} + {%- elif project.primary_venue.title %} + {{ project.primary_venue.title }} + {%- elif project.location %} + {{ project.location }} + {%- endif -%} +
{% endif %}
diff --git a/funnel/templates/profile_layout.html.jinja2 b/funnel/templates/profile_layout.html.jinja2 index 7eb466319..d444f2738 100644 --- a/funnel/templates/profile_layout.html.jinja2 +++ b/funnel/templates/profile_layout.html.jinja2 @@ -126,9 +126,22 @@
-
-
{% if featured_project.primary_venue %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {% if featured_project.primary_venue.city %}{{ featured_project.primary_venue.city }}{% else %}{{ featured_project.primary_venue.title }}{% endif %}{% elif featured_project.location %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ featured_project.location }}{% endif %}
-
+ {%- if featured_project.primary_venue or featured_project.location %} +
+
+ {{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} + {%- if featured_project.primary_venue.title and featured_project.primary_venue.city %} + {% trans venue=featured_project.primary_venue.title, city=featured_project.primary_venue.city -%} + {{ venue }}, {{ city }} + {%- endtrans %} + {%- elif featured_project.primary_venue.title %} + {{ featured_project.primary_venue.title }} + {%- elif featured_project.location %} + {{ featured_project.location }} + {%- endif -%} +
+
+ {%- endif %} {% endif %}