$def with(work,location,tags=[]) $def render_subjects(label, subjects, track_value, prefix=""): $if subjects: $if work: $for tag in tags: $if tag=="Subjects": $if location=="work": $:render_subjects(_("Subjects"), work.get_subjects(),"WorkSection|SubjectClick") $else: $:render_subjects(_("Subjects"), work.get_subjects(),"BookOverview|SubjectClick") $elif tag=="People": $:render_subjects(_("People"), work.subject_people,"WorkSection|SubjectPeopleClick", prefix="person:") $elif tag=="Places": $:render_subjects(_("Places"), work.subject_places,"WorkSection|SubjectPlacesClick", prefix="place:") $elif tag=="Times": $:render_subjects(_("Times"), work.subject_times,"WorkSection|SubjectTimesClick", prefix="time:")