Skip to content

Commit

Permalink
docs: #85 add legal docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Aug 2, 2024
1 parent 1b2807b commit cc95ba6
Show file tree
Hide file tree
Showing 10 changed files with 722 additions and 55 deletions.
26 changes: 26 additions & 0 deletions app/Http/Controllers/RefundPolicyController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Str;
use Inertia\Inertia;
use Laravel\Jetstream\Jetstream;

class RefundPolicyController extends Controller
{
/**
* Show the privacy policy for the application.
*
* @return \Inertia\Response
*/
public function show(Request $request)
{
$policyFile = Jetstream::localizedMarkdownPath('refund.md');

return Inertia::render('RefundPolicy', [
'policy' => Str::markdown(file_get_contents($policyFile)),
]);
}
}
22 changes: 17 additions & 5 deletions resources/js/Components/AuthenticationCard.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
<script setup>
import LegalNotice from "@/Components/LegalNotice.vue";
</script>

<template>
<div class="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100 dark:bg-gray-900">
<div
class="min-h-screen flex flex-col items-center justify-around pt-6 sm:pt-0 bg-gray-100 dark:bg-gray-900"
>
<div>
<slot name="logo" />
</div>
<div>
<slot name="logo" />
</div>

<div class="w-full sm:max-w-md mt-6 px-6 py-4 bg-white dark:bg-gray-800 shadow-md overflow-hidden sm:rounded-lg">
<slot />
<div
class="w-full sm:max-w-md mt-6 px-6 py-4 bg-white dark:bg-gray-800 shadow-md overflow-hidden sm:rounded-lg"
>
<slot />
</div>
</div>

<LegalNotice />
</div>
</template>
59 changes: 59 additions & 0 deletions resources/js/Components/LegalNotice.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<template>
<div class="flex flex-col items-center">
<a
href="https://x.com/b_shulha"
class="flex gap-2 text-sm"
target="_blank"
>
<svg
class="w-6 h-6 text-gray-800 dark:text-white"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<path
fill-rule="evenodd"
d="M22 5.892a8.178 8.178 0 0 1-2.355.635 4.074 4.074 0 0 0 1.8-2.235 8.343 8.343 0 0 1-2.605.981A4.13 4.13 0 0 0 15.85 4a4.068 4.068 0 0 0-4.1 4.038c0 .31.035.618.105.919A11.705 11.705 0 0 1 3.4 4.734a4.006 4.006 0 0 0 1.268 5.392 4.165 4.165 0 0 1-1.859-.5v.05A4.057 4.057 0 0 0 6.1 13.635a4.192 4.192 0 0 1-1.856.07 4.108 4.108 0 0 0 3.831 2.807A8.36 8.36 0 0 1 2 18.184 11.732 11.732 0 0 0 8.291 20 11.502 11.502 0 0 0 19.964 8.5c0-.177 0-.349-.012-.523A8.143 8.143 0 0 0 22 5.892Z"
clip-rule="evenodd"
/>
</svg>

<span class="underline hover:text-blue-500">@b_shulha</span>
</a>

<div
class="w-full flex flex-col gap-4 items-center px-6 py-4 text-xs text-gray-500"
>
<div>
<a
href="https://ptah.sh/"
class="underline hover:text-blue-500"
target="_blank"
>Ptah.sh</a
>
&copy; {{ new Date().getFullYear() }}
</div>
<div class="flex gap-4">
<div>
<div>Operated by Bohdan Shulha, Private Entrepreneur</div>
<div>00-833, Warsaw, ul. Sienna 75, lok. 8.51</div>
</div>
<div>
<div>Tax Identification Number (NIP): 5223265838</div>
<div>
Contact Email:
<a
href="mailto:[email protected]"
class="underline hover:text-blue-500"
>[email protected]</a
>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts"></script>
62 changes: 44 additions & 18 deletions resources/js/Pages/Auth/Login.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
<script setup>
import { Head, Link, useForm } from '@inertiajs/vue3';
import AuthenticationCard from '@/Components/AuthenticationCard.vue';
import AuthenticationCardLogo from '@/Components/AuthenticationCardLogo.vue';
import Checkbox from '@/Components/Checkbox.vue';
import InputError from '@/Components/InputError.vue';
import InputLabel from '@/Components/InputLabel.vue';
import PrimaryButton from '@/Components/PrimaryButton.vue';
import TextInput from '@/Components/TextInput.vue';
import { Head, Link, useForm } from "@inertiajs/vue3";
import AuthenticationCard from "@/Components/AuthenticationCard.vue";
import AuthenticationCardLogo from "@/Components/AuthenticationCardLogo.vue";
import Checkbox from "@/Components/Checkbox.vue";
import InputError from "@/Components/InputError.vue";
import InputLabel from "@/Components/InputLabel.vue";
import PrimaryButton from "@/Components/PrimaryButton.vue";
import TextInput from "@/Components/TextInput.vue";
import SecondaryButton from "@/Components/SecondaryButton.vue";
defineProps({
canResetPassword: Boolean,
status: String,
});
const form = useForm({
email: '',
password: '',
email: "",
password: "",
remember: false,
});
const submit = () => {
form.transform(data => ({
form.transform((data) => ({
...data,
remember: form.remember ? 'on' : '',
})).post(route('login'), {
onFinish: () => form.reset('password'),
remember: form.remember ? "on" : "",
})).post(route("login"), {
onFinish: () => form.reset("password"),
});
};
</script>
Expand All @@ -37,7 +38,10 @@ const submit = () => {
<AuthenticationCardLogo />
</template>

<div v-if="status" class="mb-4 font-medium text-sm text-green-600 dark:text-green-400">
<div
v-if="status"
class="mb-4 font-medium text-sm text-green-600 dark:text-green-400"
>
{{ status }}
</div>

Expand Down Expand Up @@ -72,19 +76,41 @@ const submit = () => {
<div class="block mt-4">
<label class="flex items-center">
<Checkbox v-model:checked="form.remember" name="remember" />
<span class="ms-2 text-sm text-gray-600 dark:text-gray-400">Remember me</span>
<span class="ms-2 text-sm text-gray-600 dark:text-gray-400"
>Remember me</span
>
</label>
</div>

<div class="flex items-center justify-end mt-4">
<Link v-if="canResetPassword" :href="route('password.request')" class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800">
<Link
v-if="canResetPassword"
:href="route('password.request')"
class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
>
Forgot your password?
</Link>

<PrimaryButton class="ms-4" :class="{ 'opacity-25': form.processing }" :disabled="form.processing">
<PrimaryButton
class="ms-4"
:class="{ 'opacity-25': form.processing }"
:disabled="form.processing"
>
Log in
</PrimaryButton>
</div>
</form>

<hr class="m-8" />
<div class="flex gap-4 mb-4 justify-center">
<span class="text-sm">New user?</span>

<Link
v-if="canResetPassword"
:href="route('register')"
class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
>Create an account
</Link>
</div>
</AuthenticationCard>
</template>
81 changes: 60 additions & 21 deletions resources/js/Pages/Auth/Register.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<script setup>
import { Head, Link, useForm } from '@inertiajs/vue3';
import AuthenticationCard from '@/Components/AuthenticationCard.vue';
import AuthenticationCardLogo from '@/Components/AuthenticationCardLogo.vue';
import Checkbox from '@/Components/Checkbox.vue';
import InputError from '@/Components/InputError.vue';
import InputLabel from '@/Components/InputLabel.vue';
import PrimaryButton from '@/Components/PrimaryButton.vue';
import TextInput from '@/Components/TextInput.vue';
import { Head, Link, useForm } from "@inertiajs/vue3";
import AuthenticationCard from "@/Components/AuthenticationCard.vue";
import AuthenticationCardLogo from "@/Components/AuthenticationCardLogo.vue";
import Checkbox from "@/Components/Checkbox.vue";
import InputError from "@/Components/InputError.vue";
import InputLabel from "@/Components/InputLabel.vue";
import PrimaryButton from "@/Components/PrimaryButton.vue";
import TextInput from "@/Components/TextInput.vue";
const form = useForm({
name: '',
email: '',
password: '',
password_confirmation: '',
name: "",
email: "",
password: "",
password_confirmation: "",
terms: false,
});
const submit = () => {
form.post(route('register'), {
onFinish: () => form.reset('password', 'password_confirmation'),
form.post(route("register"), {
onFinish: () => form.reset("password", "password_confirmation"),
});
};
</script>
Expand Down Expand Up @@ -73,7 +73,10 @@ const submit = () => {
</div>

<div class="mt-4">
<InputLabel for="password_confirmation" value="Confirm Password" />
<InputLabel
for="password_confirmation"
value="Confirm Password"
/>
<TextInput
id="password_confirmation"
v-model="form.password_confirmation"
Expand All @@ -82,28 +85,64 @@ const submit = () => {
required
autocomplete="new-password"
/>
<InputError class="mt-2" :message="form.errors.password_confirmation" />
<InputError
class="mt-2"
:message="form.errors.password_confirmation"
/>
</div>

<div v-if="$page.props.jetstream.hasTermsAndPrivacyPolicyFeature" class="mt-4">
<div
v-if="$page.props.jetstream.hasTermsAndPrivacyPolicyFeature"
class="mt-4"
>
<InputLabel for="terms">
<div class="flex items-center">
<Checkbox id="terms" v-model:checked="form.terms" name="terms" required />
<Checkbox
id="terms"
v-model:checked="form.terms"
name="terms"
required
/>

<div class="ms-2">
I agree to the <a target="_blank" :href="route('terms.show')" class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800">Terms of Service</a> and <a target="_blank" :href="route('policy.show')" class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800">Privacy Policy</a>
I agree to the
<a
target="_blank"
:href="route('terms.show')"
class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
>Terms of Service</a
>,
<a
target="_blank"
:href="route('policy.show')"
class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
>Privacy Policy</a
>, and
<a
target="_blank"
:href="route('refund-policy.show')"
class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
>Refund Policy</a
>
</div>
</div>
<InputError class="mt-2" :message="form.errors.terms" />
</InputLabel>
</div>

<div class="flex items-center justify-end mt-4">
<Link :href="route('login')" class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800">
<Link
:href="route('login')"
class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
>
Already registered?
</Link>

<PrimaryButton class="ms-4" :class="{ 'opacity-25': form.processing }" :disabled="form.processing">
<PrimaryButton
class="ms-4"
:class="{ 'opacity-25': form.processing }"
:disabled="form.processing"
>
Register
</PrimaryButton>
</div>
Expand Down
27 changes: 27 additions & 0 deletions resources/js/Pages/RefundPolicy.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script setup>
import { Head } from "@inertiajs/vue3";
import AuthenticationCardLogo from "@/Components/AuthenticationCardLogo.vue";
defineProps({
policy: String,
});
</script>

<template>
<Head title="Refund Policy" />

<div class="font-sans text-gray-900 dark:text-gray-100 antialiased">
<div class="pt-4 bg-gray-100 dark:bg-gray-900">
<div class="min-h-screen flex flex-col items-center pt-6 sm:pt-0">
<div>
<AuthenticationCardLogo />
</div>

<div
class="w-full sm:max-w-2xl mt-6 p-6 bg-white dark:bg-gray-800 shadow-md overflow-hidden sm:rounded-lg prose dark:prose-invert"
v-html="policy"
/>
</div>
</div>
</div>
</template>
Loading

0 comments on commit cc95ba6

Please sign in to comment.