From 0e37348e146fc34e80d534b1eaf6ed61339538ee Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 24 Sep 2023 08:50:43 +0100 Subject: [PATCH 1/7] Don't try and built search with Postgres --- confarchive/model.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/confarchive/model.py b/confarchive/model.py index 9949275..6fc4561 100644 --- a/confarchive/model.py +++ b/confarchive/model.py @@ -5,9 +5,8 @@ import typing import sqlalchemy import sqlalchemy.orm.decl_api -from sqlalchemy import Index, func, text +from sqlalchemy import func from sqlalchemy.dialects import postgresql -from sqlalchemy.dialects.postgresql import TSVECTOR from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.orderinglist import ordering_list @@ -172,22 +171,6 @@ class Event(TimeStampedModel): event_type = Column(String) url = Column(String) cancelled = Column(Boolean) - search_vector = Column(TSVECTOR) - - trigger = text( - """ - CREATE TRIGGER event_vector_update BEFORE INSERT OR UPDATE - ON event FOR EACH ROW EXECUTE FUNCTION - tsvector_update_trigger(search_vector, 'pg_catalog.english', title, abstract, description); - """ - ) - - Index( - "event_search_vector_idx", - search_vector, - postgresql_using="gin", - postgresql_ops={"abstract_search_vector": "gin_trgm_ops"}, - ) conference = relationship("Conference", back_populates="events") From a7e2d1706327e29cf5454ebff34b3560084cd3f7 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 24 Sep 2023 08:51:34 +0100 Subject: [PATCH 2/7] Show photos next to speaker name. --- templates/top_speakers.html | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/templates/top_speakers.html b/templates/top_speakers.html index ff3b533..b8ed59d 100644 --- a/templates/top_speakers.html +++ b/templates/top_speakers.html @@ -26,10 +26,30 @@ .container { position: relative; } + + + .person { + display: flex; + align-items: top; + margin-bottom: 10px; + } + + .info { + flex: 1; /* Allow text to take remaining space */ + padding-right: 10px; /* Add spacing between text and image */ + } + + img.photo { + max-width: 120px; /* Set max width for images */ + height: auto; /* Maintain image aspect ratio */ + } + + + {% endblock %} -{% set show_images = True %} +{% set show_images = False %} {% block title %}Conference archive{% endblock %} @@ -88,16 +108,20 @@ {% if loop.first or loop.previtem[1] != count %}

{{ count }} conferences

{% endif %} -
- +
+ {% set photo = person.photo_filename() %} + 👤 - {{ person.name }} + {{ person.name }}
({{ count }} conferences, {{ person.event_count }} talks) {% if person.photo_filename() %}📷{% endif %} {% if person.wikidata_qid %} Wikidata {% endif %}
+ {% if photo %} + {{ person.name }} + {% endif %}
{% endfor %} From 2cf5dbb22ebfce64ad9eba79821c2f881113eb17 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 24 Sep 2023 08:52:29 +0100 Subject: [PATCH 3/7] Remove unused code. --- templates/top_speakers.html | 75 +------------------------------------ 1 file changed, 1 insertion(+), 74 deletions(-) diff --git a/templates/top_speakers.html b/templates/top_speakers.html index b8ed59d..183d550 100644 --- a/templates/top_speakers.html +++ b/templates/top_speakers.html @@ -1,33 +1,7 @@ {% extends "base.html" %} {% block style %} -