Makes submission process easier

This commit is contained in:
Alicia Sykes 2024-03-23 14:58:12 +00:00
parent 4cde653f4d
commit 6a60d21888
8 changed files with 163 additions and 78 deletions

View file

@ -127,7 +127,10 @@
<div class="form-row">
<label for="service-github">GitHub Repository</label>
<input type="text" bind:value={$serviceGithub} id="service-github" required autocomplete="off">
<p>Share a link to where the project's source is located</p>
<p>
Share a link to where the project's source is located.<br />
Use the format [user]/[repo] e.g, lissy93/dashy
</p>
</div>
<!-- ToS;DR ID -->

View file

@ -64,7 +64,7 @@
href={makeEditRequest(categoryName, sectionName, serviceName, yamlContent)}>
<FontAwesome iconName="edit" /> Submit Edit to {serviceName}
</a>
<a class="button-link" href="/edit">
<a class="button-link" href="/submit">
<FontAwesome iconName="add" /> Add alternative
</a>
</div>

View file

@ -176,6 +176,15 @@ const { previous, next } = makePaginationLinks();
</section>
)}
{services.length > 0 && (<section class="submit-alternative">
<h3>Submit New Entry</h3>
<p>
Are we missing anything?
You can help us improve this page, by <a href="/submit">submitting a new entry</a>
</p>
</section>
)}
<div class="pagination-navigation">
{ previous ? (
<Button url={`/${slugify(categoryName)}/${slugify(previous)}`}>
@ -255,7 +264,7 @@ h2 {
}
.further-info, .notable-mentions, .word-of-warning {
.further-info, .notable-mentions, .word-of-warning, .submit-alternative {
h3 {
font-size: 1.4rem;
margin: 1rem 0;

View file

@ -1,72 +0,0 @@
---
import Layout from '@layouts/Layout.astro';
import AddNewService from '@components/things/AddNewService.svelte';
---
<Layout title="Awesome Privacy">
<section>
<h2>About our Data</h2>
<p>
All data on Awesome Privacy is community maintained via Git.
<br />
You can make edits/additions/removals by editing the
<a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a> file.
To learn more, see the <a href="/about#our-data">about page</a>.
</p>
</section>
<section>
<h2>Submit an Addition</h2>
<AddNewService client:load />
</section>
<section>
<h2>Submit a Removal Request</h2>
<p>
You can submit a removal request by browsing to a given service's page,
and clicking the "Request Removal" button.
This will open a form where you can justify your reasoning, to get it
deleted from the <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a> file.
</p>
</section>
<section>
<h2>Edit a Listing</h2>
<p>
Edits are welcome! All data is located in
<a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a>.
<br>
To modify an entry, navigate to it's page, scroll to the bottom, and click "Edit".
This will take you to directly to the relevant lines in the file, where you can make your changes.
</p>
</section>
</Layout>
<style lang="scss">
section {
margin: 2rem auto;
padding: 1rem;
width: 1000px;
max-width: calc(100% - 5rem);
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 0 2rem;
border: 2px solid var(--foreground);
box-shadow: 6px 6px 0 var(--foreground);
background: var(--accent-fg);
@media(max-width: 768px) {
max-width: 95%;
padding: 0.5rem;
margin: 0 auto;
}
p {
margin-top: 0;
}
h2 {
margin-bottom: 0.5rem;
}
}
</style>

View file

@ -13,7 +13,9 @@ const categories = (await fetchData())?.categories;
<section>
<h1>Search</h1>
<Search client:visible data={categories} />
<p class="sitemap-link">Or, view all pages in the <a href="/sitemap">Sitemap</a></p>
<p class="sitemap-link">
Browse <a href="/all">all listings</a>, or see all pages in the <a href="/sitemap">Sitemap</a>
</p>
</section>
</Layout>

View file

@ -25,7 +25,7 @@ const categories = (await fetchData() as AwesomePrivacy)?.categories || [];
<a href="/">Home</a>
</li>
<li>
<a href="/edit">Edit</a>
<a href="/submit">Submit Listing</a>
</li>
<li>
<a href="/api">API</a>

143
web/src/pages/submit.astro Normal file
View file

@ -0,0 +1,143 @@
---
import Layout from '@layouts/Layout.astro';
import AddNewService from '@components/things/AddNewService.svelte';
import { fetchGitHubStats } from '@utils/fetch-repo-info'
import { formatDate } from '@utils/dates-n-stuff';
const commits = (await fetchGitHubStats('lissy93/awesome-privacy')).commits;
---
<Layout title="Awesome Privacy">
<section>
<h2>About our Data</h2>
<p class="about-data">
All data on Awesome Privacy is community maintained via Git,
this keeps everything transparent, and means anyone can submit edits.
You can learn more about how our data is managed on our <a href="/about#our-data">about page</a>.
<br /><br />
You can make ammendments/additions/removals simply by editing the
<a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a> file.
<br />
Before you proceed, please first read our <a href="https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md">Contributing Docs</a>
<br /><br />
Awesome Privacy is a community-maintained resource, it's thanks to
contributors like you, that it's able to grow and stay up to date 💜
</p>
</section>
<section>
<h2>Submit an Addition</h2>
<AddNewService client:load />
</section>
<section>
<h2>Submit a Removal Request</h2>
<p>
You can submit a removal request by browsing to a given service's page,
and clicking the "Request Removal" button.
This will open a form where you can justify your reasoning, to get it
deleted from the <a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a> file.
</p>
</section>
<section>
<h2>Edit a Listing</h2>
<p>
Edits are welcome! All data is located in
<a href="github.com/lissy93/awesome-privacy/blob/main/awesome-privacy.yml">awesome-privacy.yml</a>.
<br>
To modify an entry, navigate to it's page, scroll to the bottom, and click "Edit".
This will take you to directly to the relevant lines in the file, where you can make your changes.
</p>
</section>
<section>
<h2>Checklist</h2>
<ul>
<li>You must read the <a href="https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md">Contributing</a> guidelines before proceeding</li>
<li>All listing must meed our <a href="/about#creteria">Criteria</a> to be considered privacy-respecting</li>
<li>Double check that your changes haven't already been proposed</li>
<li>If you're associated with a service included, you must declare your affiliation</li>
<li>Before commiting changes, ensure the YAML syntax is valid and it complies with our schema</li>
<li>Please complete the issue or PR description template in full, do not remove any fields</li>
<li>All submissions must be made via <a href="https://github.com/Lissy93/awesome-privacy">our GitHub</a>, do not email/PM maintainers</li>
</ul>
</section>
{commits && commits.length > 0 && (
<section>
<h2>Recent Changes</h2>
<p class="about-data">
You can view a full ledger of all updates made
at <a href="https://github.com/lissy93/awesome-privacy">github.com/lissy93/awesome-privacy</a>
</p>
<ul class="commit-log">
{commits.map((commit) => (
<li title={commit.sha}>
{commit.message}<br />
<img width="14" src={commit.authorAvatar} />
<small>
By <a href={`https://github.com/${commit.authorUsername}`}>{commit.authorName || commit.authorUsername}</a>
on <a href={`https://github.com/Lissy93/awesome-privacy/commit/${commit.sha}`}>{formatDate(commit.authorDate)}</a>
</small>
</li>
))}
</ul>
</section>
)}
</Layout>
<style lang="scss">
section {
margin: 2rem auto;
padding: 1rem;
width: 1000px;
max-width: calc(100% - 5rem);
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 0 2rem;
border: 2px solid var(--foreground);
box-shadow: 6px 6px 0 var(--foreground);
background: var(--accent-fg);
border-radius: var(--curve-sm);
@media(max-width: 768px) {
max-width: 95%;
padding: 0.5rem;
margin: 0 auto;
}
p {
margin-top: 0;
}
h2 {
margin-bottom: 0.5rem;
}
ul {
margin-top: 0;
padding-left: 1rem;
list-style: circle;
}
.about-data {
font-size: 1.2rem;
}
.commit-log {
column-width: 350px;
li {
small {
font-size: 0.8rem;
opacity: 0.7;
a { text-transform: capitalize;}
}
img {
border-radius: var(--curve-md);
margin-right: 0.5rem;
}
}
}
}
</style>

View file

@ -42,7 +42,7 @@ export const makeAdditionRequest = (formData: {
const additionalInfoText: string = `\n${userInfo}`
+ `\n\n**YAML Content for Addition**\n\n\`\`\`yaml\n${yamlText || '# nothing yet'}\n\`\`\`\n`
+ `\n\n<sup>This ticket was submitted via `
+ `<a href="https://awesome-privacy.xyz/edit">awesome-privacy.xyz/edit</a></sup>`;
+ `<a href="https://awesome-privacy.xyz/submit">awesome-privacy.xyz/submit</a></sup>`;
const issueTitle = `[ADDITION] ${formData.serviceName} (Complete)`;
const queryParams = new URLSearchParams({