Skip to content

Commit 6b596f4

Browse files
committed
feat: new route of privacy terms
1 parent 67bfdb9 commit 6b596f4

File tree

7 files changed

+47
-18
lines changed

7 files changed

+47
-18
lines changed

app/Http/Controllers/MainController.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace App\Http\Controllers;
44

55
use App\Models\Campaign;
6+
use Illuminate\Support\Facades\Storage;
7+
use Symfony\Component\HttpFoundation\Response;
68

79
class MainController extends Controller
810
{
@@ -22,11 +24,33 @@ public function home()
2224
$query = Campaign::orderBy('created_at', 'desc');
2325

2426
if ($search) {
25-
$query->where('Title', 'like', '%'.$search.'%');
27+
$query->where('Title', 'like', '%' . $search . '%');
2628
}
2729

2830
$campaigns = $query->get();
2931

3032
return view('home', compact('campaigns', 'search'));
3133
}
34+
35+
public function terms()
36+
{
37+
$filename = 'termos_de_uso_e_privacidade.pdf';
38+
$path = 'terms/' . $filename;
39+
40+
$disk = Storage::disk('public');
41+
42+
if (!$disk->exists($path)) {
43+
abort(404, 'O arquivo não existe ou não foi encontrado.');
44+
}
45+
46+
$filePath = $disk->path($path);
47+
48+
$fileContents = file_get_contents($filePath);
49+
50+
return new Response($fileContents, 200, [
51+
'Content-Type' => 'application/pdf',
52+
'Content-Disposition' => 'inline; filename="' . $filename . '"',
53+
'Cache-Control' => 'no-cache, must-revalidate'
54+
]);
55+
}
3256
}

resources/views/auth/register-cpf.blade.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,15 @@
88
<link rel="stylesheet" href="{{ asset('css/fonts.css') }}">
99
<title>DoeIt - Cadastro de CPF</title>
1010
<style>
11-
/* Estilo para garantir que o conteúdo da main preencha o espaço abaixo do navbar */
1211
.content-area {
13-
height: calc(100vh - 64px); /* Supondo que seu navbar tenha 64px (h-16) de altura */
14-
/* Ajuste 64px se o seu secondary_navbar tiver uma altura diferente */
12+
height: calc(100vh - 64px);
1513
}
1614
</style>
1715
</head>
18-
<body class="h-full bg-white dark:bg-neutral-900 text-gray-600 dark:text-gray-100 flex flex-col"> {{-- Adicionado flex flex-col aqui --}}
16+
<body class="h-full bg-white dark:bg-neutral-900 text-gray-600 dark:text-gray-100 flex flex-col">
1917
@include('layouts.secondary_navbar')
2018

21-
{{-- Alterado main para ser um flex container que ocupa a altura restante --}}
22-
<main class="w-full flex-grow flex flex-col items-center justify-center p-4 content-area"> {{-- Adicionado content-area --}}
19+
<main class="w-full flex-grow flex flex-col items-center justify-center p-4 content-area">
2320
<div class="w-full max-w-md space-y-8 px-4 bg-white dark:bg-neutral-800 text-gray-600 dark:text-gray-100 sm:px-0 py-8 rounded-lg shadow-lg">
2421

2522
<div class="flex justify-center mb-2">
@@ -60,8 +57,9 @@ class="w-2/5 px-4 py-2 text-white font-medium bg-[#2AB036] hover:bg-green-700 ac
6057
Salvar CPF
6158
</button>
6259

63-
<p class="text-sm text-[#575761] dark:text-gray-400 mt-4 text-center">
64-
Para continuar é necessário seu CPF.
60+
<p class="text-xs text-gray-600 dark:text-gray-400 mt-4 text-center px-4 leading-relaxed">
61+
Ao inserir seu CPF, você concorda com nossos
62+
<a href="{{ route('politica.pdf') }}" target="_blank" class="font-medium text-[#2AB036] hover:text-[#FF5800] underline">termos de uso e política de privacidade</a>.
6563
</p>
6664
</div>
6765
</form>

resources/views/welcome.blade.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,22 @@ class="w-full bg-gray-100 rounded border border-gray-300 focus:border-orange-500
216216
</template>
217217
</div>
218218
</div>
219+
219220
<div class="mt-8 py-6 border-t items-center justify-between w-full sm:flex w-full">
220-
<div class="mt-6 sm:mt-0 w-full">
221+
<div class="mt-6 sm:mt-0 w-full flex flex-col sm:flex-row justify-center sm:justify-between items-center text-sm text-gray-500 dark:text-gray-400">
222+
223+
<p class="order-2 sm:order-1 mt-4 sm:mt-0 text-center sm:text-left">
224+
&copy; {{ date('Y') }} DoeIt. Todos os direitos reservados.
225+
</p>
226+
227+
<p class="order-1 sm:order-2 text-center sm:text-right">
228+
Ao utilizar nossa plataforma, você concorda com nossos
229+
<a href="{{ route('politica.pdf') }}" target="_blank" class="hover:underline text-indigo-500 dark:text-indigo-400">Termos de Uso e Política de Privacidade</a>.
230+
</p>
221231
</div>
222232
</div>
223-
</footer>
233+
</footer>
234+
</div>
224235
</main>
225236
</body>
226237

routes/web.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Support\Facades\Route;
88

99
Route::get('/', [MainController::class, 'welcome']);
10+
Route::get('/terms', [MainController::class, 'terms'])->name('politica.pdf');
1011

1112
Route::middleware('auth', 'verified')->group(function () {
1213
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
@@ -40,4 +41,4 @@
4041
Route::patch('/cpf', [ProfileController::class, 'registerCpf']);
4142
});
4243

43-
require __DIR__.'/auth.php';
44+
require __DIR__ . '/auth.php';

storage/app/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

storage/app/public/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
*
2-
!.gitignore
1+
campaigns/
134 KB
Binary file not shown.

0 commit comments

Comments
 (0)