From 2ca1f8ffb6437a7714349b192456bcf05c1c3d99 Mon Sep 17 00:00:00 2001 From: anishTP Date: Wed, 13 Nov 2024 15:37:36 +0530 Subject: [PATCH 1/4] Add primary venue title to project card --- funnel/templates/macros.html.jinja2 | 2 +- funnel/templates/profile_layout.html.jinja2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/funnel/templates/macros.html.jinja2 b/funnel/templates/macros.html.jinja2 index 4e8745af6..488aa84bf 100644 --- a/funnel/templates/macros.html.jinja2 +++ b/funnel/templates/macros.html.jinja2 @@ -191,7 +191,7 @@ {% 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 project.primary_venue %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {% if project.primary_venue.title and project.primary_venue.city %}{{ project.primary_venue.title }}, {{ project.primary_venue.city }}{% else %}{{ project.primary_venue.city }}{% endif %}{% elif project.location %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ project.location }}{% endif %}
{% endif %}
diff --git a/funnel/templates/profile_layout.html.jinja2 b/funnel/templates/profile_layout.html.jinja2 index 7eb466319..254b1ca85 100644 --- a/funnel/templates/profile_layout.html.jinja2 +++ b/funnel/templates/profile_layout.html.jinja2 @@ -127,7 +127,7 @@
-
{% 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 %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {% if featured_project.primary_venue.title and featured_project.primary_venue.city %}{{ featured_project.primary_venue.title }}, {{ featured_project.primary_venue.city }}{% else %}{{ featured_project.primary_venue.city }}{% endif %}{% elif featured_project.location %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ featured_project.location }}{% endif %}
{% endif %} From db4a48e12ee6b6d89d3466e92fd9da24e677f8e9 Mon Sep 17 00:00:00 2001 From: anishTP Date: Wed, 13 Nov 2024 17:20:16 +0530 Subject: [PATCH 2/4] Flattened nested if conditions in the project card footer --- funnel/templates/macros.html.jinja2 | 2 +- funnel/templates/profile_layout.html.jinja2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/funnel/templates/macros.html.jinja2 b/funnel/templates/macros.html.jinja2 index 488aa84bf..de1e50e3c 100644 --- a/funnel/templates/macros.html.jinja2 +++ b/funnel/templates/macros.html.jinja2 @@ -191,7 +191,7 @@ {% endif %}
{%- if include_details %} -
{% if project.primary_venue %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {% if project.primary_venue.title and project.primary_venue.city %}{{ project.primary_venue.title }}, {{ project.primary_venue.city }}{% else %}{{ project.primary_venue.city }}{% endif %}{% elif project.location %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ project.location }}{% endif %}
+
{% if project.primary_venue.title and project.primary_venue.city %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ project.primary_venue.title }}, {{ project.primary_venue.city }}{% elif project.primary_venue.title %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ project.primary_venue.title }}{% elif project.location %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ project.location }}{% endif %}
{% endif %}
diff --git a/funnel/templates/profile_layout.html.jinja2 b/funnel/templates/profile_layout.html.jinja2 index 254b1ca85..efd99fb7b 100644 --- a/funnel/templates/profile_layout.html.jinja2 +++ b/funnel/templates/profile_layout.html.jinja2 @@ -127,7 +127,7 @@
-
{% if featured_project.primary_venue %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {% if featured_project.primary_venue.title and featured_project.primary_venue.city %}{{ featured_project.primary_venue.title }}, {{ featured_project.primary_venue.city }}{% else %}{{ featured_project.primary_venue.city }}{% endif %}{% elif featured_project.location %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ featured_project.location }}{% endif %}
+
{% if featured_project.primary_venue.title and featured_project.primary_venue.city %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ featured_project.primary_venue.title }}, {{ featured_project.primary_venue.city }}{% elif featured_project.primary_venue.title %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ featured_project.primary_venue.title }}{% elif featured_project.location %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ featured_project.location }}{% endif %}
{% endif %} From 1c64fc77ca83b0ef97b19217f8f931747c624525 Mon Sep 17 00:00:00 2001 From: Kiran Jonnalagadda Date: Fri, 15 Nov 2024 19:10:55 +0530 Subject: [PATCH 3/4] Use trans tag when there's a comma; indent if statements --- 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 de1e50e3c..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.title and project.primary_venue.city %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ project.primary_venue.title }}, {{ project.primary_venue.city }}{% elif project.primary_venue.title %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ project.primary_venue.title }}{% 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 efd99fb7b..845e3451b 100644 --- a/funnel/templates/profile_layout.html.jinja2 +++ b/funnel/templates/profile_layout.html.jinja2 @@ -126,9 +126,22 @@ -
-
{% if featured_project.primary_venue.title and featured_project.primary_venue.city %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ featured_project.primary_venue.title }}, {{ featured_project.primary_venue.city }}{% elif featured_project.primary_venue.title %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ featured_project.primary_venue.title }}{% elif featured_project.location %}{{ faicon(icon='map-marker-alt', icon_size='caption', baseline=false) }} {{ featured_project.location }}{% endif %}
-
+ {%- if project.primary_venue or 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=project.primary_venue.title, city=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 %} From 6c49a13c8ffaa519149913993a18c8aac8b00f7b Mon Sep 17 00:00:00 2001 From: anishTP Date: Sat, 16 Nov 2024 10:52:20 +0530 Subject: [PATCH 4/4] Fixed missing references to featured_project --- funnel/templates/profile_layout.html.jinja2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/funnel/templates/profile_layout.html.jinja2 b/funnel/templates/profile_layout.html.jinja2 index 845e3451b..d444f2738 100644 --- a/funnel/templates/profile_layout.html.jinja2 +++ b/funnel/templates/profile_layout.html.jinja2 @@ -126,12 +126,12 @@ - {%- if project.primary_venue or project.location %} + {%- 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=project.primary_venue.title, city=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 %}