diff --git a/src/components/topics/Ballots.vue b/src/components/topics/Ballots.vue index 1eb8a9d..591f410 100644 --- a/src/components/topics/Ballots.vue +++ b/src/components/topics/Ballots.vue @@ -70,8 +70,8 @@ const nextElectionDate = computed(() => { > + {{ $t('ballot.topic.links.link1') }} diff --git a/src/components/topics/ElectedOfficials.vue b/src/components/topics/ElectedOfficials.vue index cbc0cd8..fbbbea7 100644 --- a/src/components/topics/ElectedOfficials.vue +++ b/src/components/topics/ElectedOfficials.vue @@ -4,12 +4,19 @@ import useTransforms from '@/composables/useTransforms'; const { nth, phoneNumber, titleCase } = useTransforms(); import { useElectedOfficialsStore } from '@/stores/ElectedOfficialsStore'; -import { computed } from 'vue'; +import { computed, getCurrentInstance } from 'vue'; import VerticalTable from '@/components/VerticalTable.vue'; const ElectedOfficialsStore = useElectedOfficialsStore(); +const instance = getCurrentInstance(); +import i18nFromFiles from '@/i18n/i18n.js'; +const messages = computed(() => { + return i18nFromFiles.i18n.data.messages[instance.appContext.config.globalProperties.$i18n.locale]; +}) +if (import.meta.env.VITE_DEBUG == 'true') console.log('messages:', messages); + const formatMember = (person, termLength, districtLabel) => { if (import.meta.env.VITE_DEBUG == 'true') console.log('person:', person); @@ -88,6 +95,19 @@ const electedOfficial = computed(() => { return value2; }); +const councilAtLarge = computed(() => { + if (!ElectedOfficialsStore.electedOfficials.rows || !ElectedOfficialsStore.electedOfficials.rows.length) return null; + let councilAtLarge = ElectedOfficialsStore.electedOfficials.rows.filter((item) => { + return item.office == "city_council_at_large"; + }); + let theString = ''; + for (const [ index, councilMember ] of councilAtLarge.entries()) { + theString += formatMember(councilMember, 4); + index < councilAtLarge.length - 1 ? theString += '

' : theString += ''; + } + return theString; +}); + // const council = computed(() => { // if (electedOfficials.value) { // let value = electedOfficials.value.filter((item) => { @@ -124,13 +144,13 @@ const electedOfficial = computed(() => { const electedRepsData = computed(() => [ { - label: 'District Council Member', + label: messages.value.electedOfficials.topic.verticalTable1.districtCouncilMember, value: electedOfficial.value, }, - // { - // label: 'City Hall Office', - // value: office.value, - // }, + { + label: messages.value.electedOfficials.topic.verticalTable1.atLargeCouncilMembers, + value: councilAtLarge.value, + }, // { // label: 'Current Term', // value: term.value, diff --git a/src/components/topics/PollingPlace.vue b/src/components/topics/PollingPlace.vue index d344011..5082e83 100644 --- a/src/components/topics/PollingPlace.vue +++ b/src/components/topics/PollingPlace.vue @@ -88,8 +88,8 @@ const pollingPlaceData = computed(() => { :table-id="'pollingPlaceTable'" :data="pollingPlaceData" /> + {{ $t('pollingPlace.topic.verticalTable1.link') }} diff --git a/src/i18n/es.js b/src/i18n/es.js index 781aedc..596672b 100644 --- a/src/i18n/es.js +++ b/src/i18n/es.js @@ -287,9 +287,9 @@ export default { "term": "Term", "pollingPlace": "Polling Place", "verticalTable1": { - "title": "City Officials", - "districtCouncilMember": "District Council Member", - "atLargeCouncilMembers": "At-Large Council Members", + "title": "Spanish City Officials", + "districtCouncilMember": "Spanish District Council Member", + "atLargeCouncilMembers": "Spanish At-Large Council Members", "mayor": "Mayor", "districtAttorney": "District Attorney", "controller": "Controller", diff --git a/src/stores/ElectedOfficialsStore.js b/src/stores/ElectedOfficialsStore.js index ad5ad3a..2078062 100644 --- a/src/stores/ElectedOfficialsStore.js +++ b/src/stores/ElectedOfficialsStore.js @@ -27,6 +27,7 @@ export const useElectedOfficialsStore = defineStore("ElectedOfficialsStore", { OR eo.office = 'state_house' AND eo.district = s.state_house \ OR eo.office = 'state_senate' AND eo.district = s.state_senate \ OR eo.office = 'us_house' AND eo.district = s.federal_house \ + OR eo.office != 'city_council' AND eo.office != 'state_house' AND eo.office != 'state_senate' AND eo.office != 'us_house' \ `; const response = await fetch(url); this.electedOfficials = await response.json();