Skip to content

Commit

Permalink
feat: add privacy policy page
Browse files Browse the repository at this point in the history
  • Loading branch information
Th1nkK1D committed Jun 28, 2024
1 parent 62b5a22 commit 02acf89
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 27 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Full process template for citizen initiative campaign, from digital signatures c
- An online form with signature pad
- Signatures counter, from both offline and online channel
- Support offline sign locations list
- Privacy policy template
- GitHub Action's Workflow file for build and deploy to Github Pages
2. **Database configuration** _(Firebase, and Google Sheets with Sheethuahua)_
- Firebase rules for spamming protection for online submission
Expand Down Expand Up @@ -113,6 +114,7 @@ Most of the campaign information can be config via [`e-initiative.config.mjs`](e
- Color theme defined in [`e-initiative.config.mjs`](e-initiative.config.mjs) is available as a Tailwind class. For VSCode user, Tailwind extension is recommended for Tailwind class auto-completion.
- Typography CSS global utility classes are defined in [`src/styles/typography.css`](src/styles/typography.css) and ready to be used.
- Design system is corresponded to the [Figma](https://www.figma.com/design/CmcP7sbvY4KSRshC2fKCfD/e-initiative-template)
- Don't forget to review the privacy policy in [`src/pages/privacy-policy.astro`](src/pages/privacy-policy.astro) and remove the _"mark"_ tags (for highlighting) after updating the content.

To start Astro development server and Firebase emulator:

Expand Down
1 change: 0 additions & 1 deletion e-initiative.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export default {
petition: {
endDate: new Date('2024-10-10 GMT+7'),
expectedSignatures: 10000,
privacyPolicyUrl: 'https://wevis.info/terms-of-use/',
offline: {
formUrl: 'petition-form.pdf',
formExampleImageUrl: 'https://placehold.co/280x397?text=example',
Expand Down
18 changes: 18 additions & 0 deletions src/components/BackHomeLink.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
interface Props {
class?: string;
}
---

<a
href="/"
class=`flex flex-row items-center gap-1 px-2 text-accent underline ${Astro.props.class}`
>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<rect width="16" height="16" fill="white"></rect>
<path
d="M7 13L7.705 12.295L3.915 8.5H14V7.5H3.915L7.705 3.705L7 3L2 8L7 13Z"
fill="currentColor"></path>
</svg>
<span class="link-01 h-4">กลับหน้าหลัก</span>
</a>
2 changes: 0 additions & 2 deletions src/models/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export interface EInitiativeConfig {
petition: {
/** Build after campaign end will disable signature submission */
endDate: Date;
/** URL to privacy policy */
privacyPolicyUrl: string;
/** Number of signatures goal */
expectedSignatures: number;
/** Offline channel information
Expand Down
37 changes: 13 additions & 24 deletions src/pages/locations.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import LocationList from '../components/locations/LocationList.svelte';
import Body from '../layouts/Body.astro';
import { getLocations } from '../utils/sheets';
import UpdateTimestamp from '../components/UpdateTimestamp.svelte';
import BackHomeLink from '../components/BackHomeLink.astro';
import Config from '../../e-initiative.config.mjs';
if (!Config.sheets?.enableLocations) {
Expand All @@ -17,30 +18,18 @@ const { totalLocations, locationByProvinces } = await getLocations();
---

<Body>
<main class="flex flex-col">
<SectionContainer innerClass="flex w-full max-w-screen-md flex-col gap-8">
<a
href="/"
class="flex max-w-2xl flex-row items-center gap-1 px-2 text-accent underline"
>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<rect width="16" height="16" fill="white"></rect>
<path
d="M7 13L7.705 12.295L3.915 8.5H14V7.5H3.915L7.705 3.705L7 3L2 8L7 13Z"
fill="currentColor"></path>
</svg>
<span class="link-01 h-4">กลับหน้าหลัก</span>
</a>
<SectionContainer
outerClass="relative"
innerClass="flex w-full max-w-screen-md flex-col gap-8"
>
<BackHomeLink class="absolute left-1 top-3" />

<h1 class="heading-responsive-02 text-center leading-none">
มีจุดตั้งโต๊ะทั้งหมด {totalLocations} จุด ใน {
locationByProvinces.length
}
จังหวัด
</h1>
<UpdateTimestamp class="text-center" />
<h1 class="heading-responsive-02 text-center leading-none">
มีจุดตั้งโต๊ะทั้งหมด {totalLocations} จุด ใน {locationByProvinces.length}
จังหวัด
</h1>
<UpdateTimestamp class="text-center" />

<LocationList {locationByProvinces} />
</SectionContainer>
</main>
<LocationList {locationByProvinces} />
</SectionContainer>
</Body>
Loading

0 comments on commit 02acf89

Please sign in to comment.