From dcfeec05aa92417f9dcaa446786f2fe9743777f7 Mon Sep 17 00:00:00 2001 From: Lucas McCullum Date: Wed, 9 Sep 2020 08:07:31 -0400 Subject: [PATCH] People Page: change photo alt and id #60 Changes the photos on the People Page to include a more descriptive alt tag: Roger Mark to photo of Roger Mark. Also changes photo id to be more descriptive: Roger_Mark to photo_of_Roger_Mark. Fixes part of #60. Changes photo alt tag --- main.py | 10 +++++++--- templates/people.html | 8 ++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index f159ef5..3731ffd 100755 --- a/main.py +++ b/main.py @@ -399,11 +399,15 @@ def people(): """ data = _data() - path = "sitedata" - fn = "people.yml" + path = 'sitedata' + fn = 'people.yml' with open(os.path.join(path, fn), 'r') as f: - data["people"] = yaml.safe_load(f) + data['people'] = yaml.safe_load(f) + + for i in range(len(data['people']['current_members'])): + data['people']['current_members'][i]['tag_id'] = 'photo_of_' + \ + data['people']['current_members'][i]['name'].replace(' ','_') return render_template('people.html', **data) diff --git a/templates/people.html b/templates/people.html index 03c6a38..8edae5e 100644 --- a/templates/people.html +++ b/templates/people.html @@ -24,14 +24,14 @@

People

Current members

{% for person in people.current_members %} -
+
{% if person.image %} - {{ person.name }} + Photo of {{ person.name }} {% else %} - {{ person.name }} + Photo of {{ person.name }} {% endif %}
@@ -47,7 +47,7 @@

People