🏡 index : github.com/shreyas-satish/govote.git

author Nemo <me@captnemo.in> 2023-12-08 11:19:38.0 +05:30:00
committer Nemo <me@captnemo.in> 2023-12-08 11:23:22.0 +05:30:00
commit
7df89fd7b85ec876693414074758c9b8059e1712 [patch]
tree
82988fdeac4671eee1d8cc11bc7ca9b2a3a0cd95
parent
9e560fd8a7dbc5f499a55838abfbe52ec3957196
download
7df89fd7b85ec876693414074758c9b8059e1712.tar.gz

Improve table to include post office



Diff

 faq.md           |  7 +++++++
 index.html       |  1 +
 assets/script.js | 34 ++++++++++++++++++++++++----------
 3 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/faq.md b/faq.md
index 2c1a6e2..68f4f33 100644
--- a/faq.md
+++ a/faq.md
@@ -33,4 +33,9 @@
**I don't have a pre existing voter Id, help?**

Fill Form 6 with the same details instead of Form 8. Make sure you were born
before 1st January 2006, or you will be too young to vote this time.
before 1st January 2006, or you will be too young to vote this time.

**Bangalore isn't a tehsil/taluka**
Yes, but the boundaries for Bangalore's various talukas are unclear, and it is okay
to just submit Bangalore. If you have any suggestions on how to get a taluka from
an address, please let us know.
diff --git a/index.html b/index.html
index 7658720..8e71dad 100644
--- a/index.html
+++ a/index.html
@@ -196,6 +196,7 @@
        const textToCopy = "Hey! Check out this neat guide that helps you change your address for the voter id so you can vote from Bangalore! https://blr.vote";
        navigator.clipboard.writeText(textToCopy)
            .then(() => {
                // TODO: Flash the copyButton
                // Success message or action
            })
            .catch(err => {
diff --git a/assets/script.js b/assets/script.js
index a7bb335..4f1b504 100644
--- a/assets/script.js
+++ a/assets/script.js
@@ -217,7 +217,7 @@
    }

    features = findFeaturesContainingPoint(window.geojson, turf.point([lng, lat]));
    let details = "Not in a Bangalore Constituency"
    let details = "Couldn't find a Bangalore Constituency, check FAQ"
    let tehsil = "Bangalore"; // until we have more clarity, this works
    if (features.length == 1) {
      ward = window.ward = wardLookup[features[0].properties['id'].toString()]
@@ -225,27 +225,35 @@
      let pcId = CONSTITUENCY_MAP[acID][0];
      let pcName = CONSTITUENCY_MAP[acID][1];
      let eciDistrict = CONSTITUENCY_MAP[acID][2];
      let commonDetails = `<tr>
          <td><strong>District</strong></td>
          <td>${eciDistrict}</td>
        </tr>
        <tr>
          <td><strong>Assembly Constituency (AC)</strong></td>
          <td>${ward['ac_id']} - ${ward['ac_name']}</td>
        </tr>`;
      details = `
      <table>
        <tbody>
          <tr>
            <td><strong>District</strong></td>
            <td>${eciDistrict}</td>
          </tr>
          ${commonDetails}
        </tbody>
      </table>`;

      document.getElementById('location-details').innerHTML = `
      <table>
        <tbody>
          ${commonDetails}
          <tr>
            <td><strong>Assembly Constituency (AC)</strong></td>
            <td>${ward['ac_id']} - ${ward['ac_name']}</td>
            <td><strong>Tehsil/Taluka</strong></td>
            <td>${tehsil}</td>
          </tr>
          <tr>
            <td><strong>Tehsil</strong></td>
            <td>${tehsil}</td>
            <td><strong>Post Office (Pick One)</strong></td>
            <td><ul>${window.postOffice}</ul></td>
          </tr>
        </tbody>
      </table>`;

      console.log(details)

      document.getElementById('location-details').innerHTML = details;
    }
    infowindow.setContent(details);
    infowindow.open(map, marker);