From 9c16ce6caf71247e25c8eb4758ff42e18be13cc6 Mon Sep 17 00:00:00 2001 From: pratishta Date: Fri, 1 Nov 2024 15:21:57 -0400 Subject: [PATCH] Initial work for form response obj --- client/app/components/subscription-form.js | 32 +++++++++++++++---- .../styles/modules/_m-subscription-form.scss | 4 +++ .../components/subscription-form.hbs | 16 ++++++++-- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/client/app/components/subscription-form.js b/client/app/components/subscription-form.js index fa2f3eec..4e9b5c6e 100644 --- a/client/app/components/subscription-form.js +++ b/client/app/components/subscription-form.js @@ -1,7 +1,28 @@ import Component from '@ember/component'; import { action } from '@ember/object'; +import { lookupCommunityDistrict } from '../helpers/lookup-community-district'; +import { inject as service } from '@ember/service'; export default class SubscriptionFormComponent extends Component { + // constructor(...args) { + // super(...args); + // // this.subscriptions = { + // // 'Brooklyn': {}, + // // 'Bronx': {}, + // // 'Manhattan': {}, + // // 'Queens': {}, + // // 'Staten Island': {} + // // } + + // const lookupCommunityDistrictObj = lookupCommunityDistrict(); + // // console.log(lookupCommunityDistrictObj); + + // for (let i = 0; i < lookupCommunityDistrictObj.length; i +=1 ) { + // const district = lookupCommunityDistrictObj[i]; + // console.log(district); + // } + // } + @action checkWholeBorough(event) { const checkboxId = event.target.id; @@ -19,12 +40,9 @@ export default class SubscriptionFormComponent extends Component { } @action - toggleUpdateType(event) { - const checkboxId = event.target.id; - if (checkboxId === "city-wide-checkbox") { - this.set('isCommunityDistrict', false) - } else if (checkboxId === "community-district-checkbox") { - this.set('isCityWide', false) - } + hamdleSubmit(event) { + event.preventDefault(); + console.log('submitting'); + console.log(event); } } \ No newline at end of file diff --git a/client/app/styles/modules/_m-subscription-form.scss b/client/app/styles/modules/_m-subscription-form.scss index 235ed9ad..4578c2e1 100644 --- a/client/app/styles/modules/_m-subscription-form.scss +++ b/client/app/styles/modules/_m-subscription-form.scss @@ -18,6 +18,10 @@ div.disabled { color: $dark-gray; } +.accordion-title:hover, .accordion-title:focus { + background-color: transparent; +} + ul li.accordion-title:last-child { border-bottom: 5px; } diff --git a/client/app/templates/components/subscription-form.hbs b/client/app/templates/components/subscription-form.hbs index f5659231..0e86bf38 100644 --- a/client/app/templates/components/subscription-form.hbs +++ b/client/app/templates/components/subscription-form.hbs @@ -1,4 +1,4 @@ -
+ + {{this.subscriptions}} @@ -77,8 +82,10 @@ for="all-manhattan">Select all {{#each (lookup-community-district) as |cd|}} {{#if (string-includes cd.boro 'Manhattan')}} +
+
{{/if}} {{/each}} @@ -90,8 +97,10 @@ for="all-queens">Select all {{#each (lookup-community-district) as |cd|}} {{#if (string-includes cd.boro 'Queens')}} +
+
{{/if}} {{/each}} @@ -103,8 +112,10 @@ for="all-staten-island">Select all {{#each (lookup-community-district) as |cd|}} {{#if (string-includes cd.boro 'Staten Island')}} +
+
{{/if}} {{/each}} @@ -115,6 +126,7 @@
\ No newline at end of file