Skip to content

Commit

Permalink
fixes cards
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrothwell committed Jan 2, 2025
1 parent d8f5fe4 commit 0cde2d4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 46 deletions.
33 changes: 14 additions & 19 deletions src/components/ElectionOfficeCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const props = defineProps({
// computed
const i18nLocale = computed(() => {
return this.$i18n.locale;
});
// const i18nLocale = computed(() => {
// return this.$i18n.locale;
// });
const hoursTableOrLine = computed(() => {
let value;
if (this.$props.item.open_24_hours === "TRUE") {
if (props.item.properties.open_24_hours === "TRUE") {
value = 'line';
} else {
value = 'table';
Expand Down Expand Up @@ -57,7 +57,7 @@ const hours = computed(() => {
for (let [ index, day ] of daysArray.entries()) {
console.log('day:', day, 'index:', index);
let fridayWeekendHours = this.item['friday_weekend_hours'];
let fridayWeekendHours = props.item.properties['friday_weekend_hours'];
let isWeekend;
if (fridayWeekendHours === "TRUE") {
isWeekend = [ 'Sunday', 'Friday', 'Saturday' ].includes(day);
Expand All @@ -66,13 +66,13 @@ const hours = computed(() => {
}
let hours;
if (isWeekend && this.item['weekend_start']) {
hours = this.item['weekend_start'] + ' - ' + this.item['weekend_end'];
if (isWeekend && props.item.properties['weekend_start']) {
hours = props.item.properties['weekend_start'] + ' - ' + props.item.properties['weekend_end'];
} else if (isWeekend) {
hours = this.$i18n.messages[this.i18nLocale].closed;
// hours = "Closed";
} else if (!isWeekend) {
hours = this.item['weekday_start'] + ' - ' + this.item['weekday_end'];
hours = props.item.properties['weekday_start'] + ' - ' + props.item.properties['weekday_end'];
}
let scheduleOrClosed = hours;
Expand All @@ -88,34 +88,29 @@ const hours = computed(() => {
const arrayFields = computed(() => {
let allFields = [ 'site_type', 'multilingual_support', 'site_accessible' ];
let finalArray = [];
let item = this.item;
let item = props.item;
for (let field of allFields) {
let values = [];
if (field === 'site_type') {
if (item[field] === 'Election office') {
if (item.properties[field] === 'Election office') {
values.push('details.ballotRep');
}
}
if (field === 'site_type') {
if (item[field] === 'Election office') {
if (item.properties[field] === 'Election office') {
values.push('details.ballotDropoff');
}
}
// if (field === 'site_type') {
// if (item[field] === 'Election office') {
// values.push('details.staff');
// }
// }
if (field === 'multilingual_support') {
if (item[field] === 'TRUE') {
if (item.properties[field] === 'TRUE') {
values.push('details.interpretationAvailable');
}
}
if (field === 'site_accessible') {
if (item[field] === 'TRUE') {
if (item.properties[field] === 'TRUE') {
values.push('details.wheelchair');
}
}
Expand Down Expand Up @@ -154,7 +149,7 @@ const arrayFields = computed(() => {
:columns="hours.columns"
:rows="hours.rows"
:sort-options="{ enabled: false }"
style-class="vgt-table condensed"
style-class="table"
>
<template
slot="table-column"
Expand Down
13 changes: 7 additions & 6 deletions src/components/ExpandCollapseContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,26 @@ const props = defineProps({
// computed
const section = computed(() => {
return props.item.site_type;
return props.item.properties.site_type;
});
</script>

<!-- <div :class="isMobile ? 'main-content-mobile' : 'main-content'"> -->
<template>
<div :class="isMobile ? 'main-content-mobile' : 'main-content'">
<div class='main-content'>
<div class="columns top-section">
<div class="column is-6">
<div
v-if="item.street_address"
v-if="item.properties.street_address"
class="columns is-mobile"
>
<div class="column is-1">
<font-awesome-icon icon="map-marker-alt" />
</div>

<div class="column is-11">
{{ item.street_address }}<br>
{{ item.properties.street_address }}<br>
Philadelphia, PA {{ item.zip }}<br>
</div>
</div>
Expand All @@ -44,14 +45,14 @@ const section = computed(() => {
class="column is-6"
>
<div
v-if="item.phone_number"
v-if="item.properties.phone_number"
class="columns is-mobile"
>
<div class="column is-1">
<font-awesome-icon icon="phone" />
</div>
<div class="column is-11">
{{ item.phone_number }}
{{ item.properties.phone_number }}
</div>
</div>
</div>
Expand Down
13 changes: 7 additions & 6 deletions src/components/OfficialBallotReturnDropBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const props = defineProps({
// computed
const hoursTableOrLine = computed(() => {
let value;
if (this.$props.item.open_24_hours === "TRUE") {
if (props.item.open_24_hours === "TRUE") {
value = 'line';
} else {
value = 'table';
Expand Down Expand Up @@ -62,12 +62,13 @@ const hours = computed(() => {
];
let rows = [];
for (let [ index, day ] of days.entries()) {
let closed = this.$i18n.messages[this.i18nLocale].closed;
// let closed = this.$i18n.messages[this.i18nLocale].closed;
let closed = t('closed');
console.log('closed:', closed);
let scheduleOrClosed = this.item[day+'_hours'] || closed;
let scheduleOrClosed = props.item[day+'_hours'] || closed;
rows.push({
id: index + 1,
days: this.daysKey[day],
days: daysKey.value[day],
schedule: scheduleOrClosed,
});
}
Expand All @@ -77,7 +78,7 @@ const hours = computed(() => {
const arrayFields = computed(() => {
let allFields = [ 'site_type', 'multilingual_support', 'site_accessible' ];
let finalArray = [];
let item = this.item;
let item = props.item;
for (let field of allFields) {
let values = [];
Expand Down Expand Up @@ -152,7 +153,7 @@ const arrayFields = computed(() => {
:columns="hours.columns"
:rows="hours.rows"
:sort-options="{ enabled: false }"
style-class="vgt-table condensed"
style-class="table"
>
<template
slot="table-column"
Expand Down
33 changes: 18 additions & 15 deletions src/components/OfficialMobileBallotReturnCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const props = defineProps({
// computed
const i18nLocale = computed(() => {
return this.$i18n.locale;
});
// const i18nLocale = computed(() => {
// return this.$i18n.locale;
// });
const hoursTableOrLine = computed(() => {
let value;
if (this.$props.item.open_24_hours === "TRUE") {
if (props.item.properties.open_24_hours === "TRUE") {
value = "line";
} else {
value = "table";
Expand Down Expand Up @@ -67,12 +67,13 @@ const hours = computed(() => {
];
let rows = [];
for (let [ index, day ] of days.entries()) {
let closed = this.$i18n.messages[this.i18nLocale].closed;
// let closed = this.$i18n.messages[this.i18nLocale].closed;
let closed = t('closed');
console.log('closed:', closed);
let scheduleOrClosed = this.item[day+'_hours'] || closed;
let scheduleOrClosed = props.item.properties[day+'_hours'] || closed;
rows.push({
id: index + 1,
days: this.daysKey[day],
days: daysKey.value[day],
schedule: scheduleOrClosed,
});
}
Expand All @@ -82,42 +83,42 @@ const hours = computed(() => {
const arrayFields = computed(() => {
let allFields = [ "site_type", "multilingual_support", "site_accessible" ];
let finalArray = [];
let item = this.item;
let item = props.item;
for (let field of allFields) {
let values = [];
if (field === "site_type") {
if (item[field] === "Election office") {
if (item.properties[field] === "Election office") {
values.push("details.inPerson");
// value = 'In-person registration and mail-in voting, Mail-in ballot drop-off.';
}
}
if (field === "site_type") {
if (item[field] === "Election office") {
if (item.properties[field] === "Election office") {
values.push("details.ballotDropoff");
// value = 'In-person registration and mail-in voting, Mail-in ballot drop-off.';
}
}
if (field === "site_type") {
if (item[field] === "Official mobile mail-in ballot return") {
if (item.properties[field] === "Official mobile mail-in ballot return") {
values.push("details.ballotDropoffMobile");
values.push("details.ballotDropoffMobileStandAlone");
// value = 'In-person registration and mail-in voting, Mail-in ballot drop-off.';
}
}
if (field === "multilingual_support") {
if (item[field] === "TRUE") {
if (item.properties[field] === "TRUE") {
values.push("details.interpretationAvailable");
// value = 'Telephonic interpretation services available.';
}
}
if (field === "site_accessible") {
if (item[field] === "TRUE") {
if (item.properties[field] === "TRUE") {
values.push("details.wheelchair");
// value = 'Wheelchair accessible.';
}
Expand Down Expand Up @@ -156,7 +157,7 @@ const arrayFields = computed(() => {
:columns="hours.columns"
:rows="hours.rows"
:sort-options="{ enabled: false }"
style-class="vgt-table condensed"
style-class="table"
>
<template
slot="table-column"
Expand Down Expand Up @@ -195,12 +196,14 @@ const arrayFields = computed(() => {
</template>
</vue-good-table>


</section>

</template>

<style lang="scss">
.uppercase {
text-transform: capitalize;
}
</style>

0 comments on commit 0cde2d4

Please sign in to comment.