0% found this document useful (0 votes)
56 views11 pages

Parcial Participante Puede Ver Sus Pruebas: Commit Authored 1 Day Ago by

The document summarizes code changes made in a commit to a GitLab repository. The changes include: 1) Adding authentication for portal users and login/logout functionality for portal access. 2) Sending email notifications with portal links to participants. 3) Allowing participants to view their tests from the portal after logging in.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views11 pages

Parcial Participante Puede Ver Sus Pruebas: Commit Authored 1 Day Ago by

The document summarizes code changes made in a commit to a GitLab repository. The changes include: 1) Adding authentication for portal users and login/logout functionality for portal access. 2) Sending email notifications with portal links to participants. 3) Allowing participants to view their tests from the portal after logging in.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

Please ensure your account's recovery settings are up to date.

Commit 1f277f30 authored 1 day ago by Guillermo Agudelo

Parcial participante puede ver sus pruebas

parent 86fc35d0 master

1 merge request !4 Enviar enlace a los participantes

Showing 22 changed files  with 487 additions and 17 deletions

  app/Exceptions/Handler.php
... ... @@ -2,6 +2,7 @@
2 2
3 3 namespace App\Exceptions;
4 4
5 + use Illuminate\Auth\AuthenticationException;
5 6 use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
6 7 use Throwable;
7 8
... ... @@ -52,4 +53,17 @@ class Handler extends ExceptionHandler
52 53 {
53 54 return parent::render($request, $exception);
54 55 }
56 +
57 + protected function unauthenticated($request, AuthenticationException $exception)
58 + {
59 + if ($request->expectsJson()) {
60 + return response()->json(['error' => 'Unauthenticated.'], 401);
61 + }
62 +
63 + if ($request->is('*portal*')) {
64 + return redirect()->guest('/portal/login');
65 + }
66 +
67 + return redirect()->guest(route('login'));
68 + }
55 69 }

  app/Http/Controllers/Admin/TestController.php

... ... @@ -3,7 +3,11 @@


3 3 namespace App\Http\Controllers\Admin;
4 4
5 5 use App\Http\Controllers\Controller;
6 + use App\Mail\SendPortalLink;
7 + use App\Models\Partaker;
6 8 use Illuminate\Http\Request;
9 + use Illuminate\Support\Facades\Mail;
10 + use SourcesIds;
7 11
8 12 class TestController extends Controller
9 13 {
... ... @@ -11,4 +15,15 @@ class TestController extends Controller
11 15 {
12 16 return view('admin.tests.index');
13 17 }
18 +
19 + public function sendTests()
20 + {
21 + $clientId = auth()->user()->client_id;
22 + $students = Partaker::where('client_id', $clientId)
23 + ->where('pot_source_id', SourcesIds::ESTUDIANTE)
24 + ->get();
25 +

https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 1/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

26 + Mail::to($students[0]->email)->send(new SendPortalLink($students[0]));
27 + dd('bla');
28 + }
14 29 }

  app/Http/Controllers/Auth/LoginController.php
... ... @@ -3,9 +3,12 @@
3 3 namespace App\Http\Controllers\Auth;
4 4
5 5 use App\Http\Controllers\Controller;
6 + use App\Models\IdentificationType;
7 + use App\Models\Partaker;
6 8 use App\Models\Support\AccessLog;
7 9 use App\Providers\RouteServiceProvider;
8 10 use Illuminate\Foundation\Auth\AuthenticatesUsers;
11 + use Illuminate\Support\Facades\Auth;
9 12 use Symfony\Component\HttpFoundation\Request;
10 13
11 14 class LoginController extends Controller
... ... @@ -38,5 +41,33 @@ class LoginController extends Controller
38 41 public function __construct()
39 42 {
40 43 $this->middleware('guest')->except('logout');
44 + $this->middleware('guest:partaker')->except('logout');
45 + }
46 +
47 + public function partakerLogin()
48 + {
49 + $identificationTypes = IdentificationType::all();
50 + return view('portal.login', ['url' => 'writer', 'identificationTypes' => $identificationTypes]);
51 + }
52 +
53 + public function partakerPerformLogin(Request $request)
54 + {
55 + $this->validate($request, [
56 + 'identification_type_id' => 'required|exists:identification_types,id',
57 + 'identification' => 'required'
58 + ]);
59 +
60 + $partaker = Partaker::where('identification_type_id', $request->get('identification_type_id'))
61 + ->where('identification', $request->get('identification'))
62 + ->first();
63 +
64 + if ($partaker) {
65 + Auth::guard('partaker')->login($partaker);
66 + return redirect()->intended('/portal');
67 + }
68 +
69 + feedback('error', 'No se pudo autenticar. Intente otra vez.');
70 +
71 + return back();
41 72 }
42 73 }

  app/Http/Controllers/Portal/PortalController.php 0 → 100644
1 + <?php
2 +
3 + namespace App\Http\Controllers\Portal;
4 +
5 + use App\Http\Controllers\Controller;
6 + use App\Models\IdentificationType;
7 + use Illuminate\Http\Request;
8 +
9 + class PortalController extends Controller
10 +{
11 + public function index()
12 + {
13 + // \Auth::guard('partaker')->logout();
14 + $tests = auth()->user()->tests;
15 + return view('portal.index', compact('tests'));
16 + }
17 +
18 +}

https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 2/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

  app/Http/Middleware/RedirectIfAuthenticated.php

... ... @@ -18,6 +18,10 @@ class RedirectIfAuthenticated


18 18 */
19 19 public function handle($request, Closure $next, $guard = null)
20 20 {
21 + if ($guard == "partaker" && Auth::guard($guard)->check()) {
22 + return redirect('/portal');
23 + }
24 +
21 25 if (Auth::guard($guard)->check()) {
22 26 return redirect(RouteServiceProvider::HOME);
23 27 }
... ...

  app/Mail/SendPortalLink.php 0 → 100644

1 + <?php
2 +
3 + namespace App\Mail;
4 +
5 + use App\Models\Partaker;
6 + use Illuminate\Bus\Queueable;
7 + use Illuminate\Contracts\Queue\ShouldQueue;
8 + use Illuminate\Mail\Mailable;
9 + use Illuminate\Queue\SerializesModels;
10 +
11 + class SendPortalLink extends Mailable
12 +{
13 + use Queueable, SerializesModels;
14 +
15 + public $partaker;
16 +
17 + /**
18 + * Create a new message instance.
19 + *
20 + * @return void
21 + */
22 + public function __construct(Partaker $partaker)
23 + {
24 + $this->partaker = $partaker;
25 + }
26 +
27 + /**
28 + * Build the message.
29 + *
30 + * @return $this
31 + */
32 + public function build()
33 + {
34 + return $this->markdown('mails/send-portal-link');
35 + }
36 +}

  app/Models/Partaker.php
... ... @@ -2,11 +2,15 @@
2 2
3 3 namespace App\Models;
4 4
5 - use Illuminate\Database\Eloquent\Model;
5 + use Illuminate\Foundation\Auth\User as Authenticatable;
6 + use Silber\Bouncer\Database\HasRolesAndAbilities;
6 7
7 - class Partaker extends Model
8 + class Partaker extends Authenticatable
8 9 {
10 + use HasRolesAndAbilities;
11 +
9 12 protected $guarded = [];
13 + protected $guard = 'partaker';
10 14
11 15 public function getFullNameAttribute()
12 16 {
... ... @@ -52,4 +56,10 @@ class Partaker extends Model
52 56 {
https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 3/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

53 57 return $this->belongsTo(IdentificationType::class);
54 58 }
59 +
60 + public function tests()
61 + {
62 + return $this->hasMany(Test::class);
63 + }
64 +
55 65 }

  app/Models/Test.php 0 → 100644
1 + <?php
2 +
3 + namespace App\Models;
4 +
5 + use Illuminate\Database\Eloquent\Model;
6 +
7 + class Test extends Model
8 +{
9 + public function instrument()
10 + {
11 + if($this->pot_instrument_id) {
12 + return $this->belongsTo(PotInstrument::class, 'pot_instrument_id');
13 + } else {
14 + return $this->belongsTo(TalInstrument::class, 'tal_instrument_id');
15 + }
16 + }
17 +}

  app/Providers/EventServiceProvider.php
... ... @@ -2,6 +2,7 @@
2 2
3 3 namespace App\Providers;
4 4
5 + use App\User;
5 6 use Illuminate\Auth\Events\Login;
6 7 use Illuminate\Auth\Events\Logout;
7 8 use Illuminate\Auth\Events\Registered;
... ... @@ -32,17 +33,21 @@ class EventServiceProvider extends ServiceProvider
32 33 parent::boot();
33 34
34 35 Event::listen(Login::class, function ($event) {
35 - $event->user->accessLogs()->create([
36 - 'ip' => request()->ip(),
37 - 'type' => 'login'
38 - ]);
36 + if ($event->user instanceof User) {
37 + $event->user->accessLogs()->create([
38 + 'ip' => request()->ip(),
39 + 'type' => 'login'
40 + ]);
41 + }
39 42 });
40 43
41 44 Event::listen(Logout::class, function ($event) {
42 - $event->user->accessLogs()->create([
43 - 'ip' => request()->ip(),
44 - 'type' => 'logout'
45 - ]);
45 + if ($event->user instanceof User) {
46 + $event->user->accessLogs()->create([
47 + 'ip' => request()->ip(),
48 + 'type' => 'logout'
49 + ]);
50 + }
46 51 });
47 52 }
48 53 }

  app/Support/Globals.php
... ... @@ -51,11 +51,23 @@ abstract class UserTypes
51 51 }
52 52 }
https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 4/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

53 53
54 - abstract class PartakerTypes
54 + abstract class SourcesIds
55 55 {
56 - const ESTUDIANTE = 'EstudiantE';
57 - const DOCENTE = 'Docente';
58 - const CUIDADOR = 'Cuidador';
56 + const ESTUDIANTE = 1;
57 + const DOCENTE = 2;
58 + const CUIDADOR = 3;
59 +
60 + public static function getConstants() {
61 + $oClass = new ReflectionClass(__CLASS__);
62 + return array_values($oClass->getConstants());
63 + }
64 +}
65 +
66 + abstract class TestStatus
67 +{
68 + const TO_DO = 'Por Hacer';
69 + const INCOMPLETE = 'Incompleta';
70 + const DONE = 'Terminada';
59 71
60 72 public static function getConstants() {
61 73 $oClass = new ReflectionClass(__CLASS__);
... ...

  config/auth.php

... ... @@ -46,6 +46,11 @@ return [


46 46 'provider' => 'users',
47 47 'hash' => false,
48 48 ],
49 +
50 + 'partaker' => [
51 + 'driver' => 'session',
52 + 'provider' => 'partakers',
53 + ],
49 54 ],
50 55
51 56 /*
... ... @@ -75,6 +80,11 @@ return [
75 80 // 'driver' => 'database',
76 81 // 'table' => 'users',
77 82 // ],
83 +
84 + 'partakers' => [
85 + 'driver' => 'eloquent',
86 + 'model' => App\Models\Partaker::class,
87 + ],
78 88 ],
79 89
80 90 /*
... ...

  database/migrations/2020_07_30_104941_create_tests_table.php

... ... @@ -15,7 +15,14 @@ class CreateTestsTable extends Migration


15 15 {
16 16 Schema::create('tests', function (Blueprint $table) {
17 17 $table->id();
18 + $table->foreignId('partaker_id');
19 + $table->unsignedBigInteger('student_id')->nullable();
20 + $table->foreignId('pot_instrument_id')->nullable();
21 + $table->foreignId('tal_instrument_id')->nullable();
22 + $table->enum('status', TestStatus::getConstants());
18 23 $table->timestamps();
24 +
25 + $table->foreign('student_id')->references('id')->on('partakers');
19 26 });
20 27 }
21 28
... ...

  database/seeds/DatabaseSeeder.php

https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 5/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

... ... @@ -19,5 +19,6 @@ class DatabaseSeeder extends Seeder


19 19 $this->call(ModalitySeeder::class);
20 20 $this->call(SessionSeeder::class);
21 21 $this->call(PartakerSeeder::class);
22 + $this->call(TestSeeder::class);
22 23 }
23 24 }

  database/seeds/TestSeeder.php 0 → 100644
1 + <?php
2 +
3 + use Illuminate\Database\Seeder;
4 +
5 + class TestSeeder extends Seeder
6 +{
7 + /**
8 + * Run the database seeds.
9 + *
10 + * @return void
11 + */
12 + public function run()
13 + {
14 + DB::table('tests')->insert([
15 + [
16 + 'partaker_id' => 3,
17 + 'student_id' => null,
18 + 'pot_instrument_id' => 3, //estudiante 8 a 10
19 + 'tal_instrument_id' => null,
20 + 'status' => TestStatus::TO_DO,
21 + 'created_at' => now(),
22 + 'updated_at' => now(),
23 + ],
24 + [
25 + 'partaker_id' => 2,
26 + 'student_id' => 3,
27 + 'pot_instrument_id' => 5, //familiar 8 a 10
28 + 'tal_instrument_id' => null,
29 + 'status' => TestStatus::TO_DO,
30 + 'created_at' => now(),
31 + 'updated_at' => now(),
32 + ],
33 + [
34 + 'partaker_id' => 1,
35 + 'student_id' => 3,
36 + 'pot_instrument_id' => 6, //docente 8 a 10
37 + 'tal_instrument_id' => null,
38 + 'status' => TestStatus::TO_DO,
39 + 'created_at' => now(),
40 + 'updated_at' => now(),
41 + ],
42 + [
43 + 'partaker_id' => 3,
44 + 'student_id' => null,
45 + 'pot_instrument_id' => null,
46 + 'tal_instrument_id' => 1,
47 + 'status' => TestStatus::TO_DO,
48 + 'created_at' => now(),
49 + 'updated_at' => now(),
50 + ],
51 + [
52 + 'partaker_id' => 3,
53 + 'student_id' => null,
54 + 'pot_instrument_id' => null,
55 + 'tal_instrument_id' => 2,
56 + 'status' => TestStatus::TO_DO,
57 + 'created_at' => now(),
58 + 'updated_at' => now(),
59 + ],
60 + [
61 + 'partaker_id' => 3,
62 + 'student_id' => null,
63 + 'pot_instrument_id' => null,
64 + 'tal_instrument_id' => 3,
65 + 'status' => TestStatus::TO_DO,

https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 6/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

66 + 'created_at' => now(),


67 + 'updated_at' => now(),
68 + ],
69 + [
70 + 'partaker_id' => 3,
71 + 'student_id' => null,
72 + 'pot_instrument_id' => null,
73 + 'tal_instrument_id' => 4,
74 + 'status' => TestStatus::TO_DO,
75 + 'created_at' => now(),
76 + 'updated_at' => now(),
77 + ],
78 + ]);
79 + }
80 +}

  notas.txt
1 + . que no se pueda borrar instrumento si tiene preguntas
2 + . que permita editar participantes y usuario sin cambiar email
3 + . debe poder desactivar todos los permisos para admin en permisos y roles
1 4
2 5 hecho
3 6 .quitar lo que no funcione (mi perfil, instituciones)
... ...

  resources/views/admin/tests/index.blade.php
... ... @@ -2,6 +2,12 @@
2 2 @section('content')
3 3 <div class="container" id="roles">
4 4 <h2>Enviar pruebas a participantes</h2>
5 - <a href="#" class="btn btn-primary">Enviar pruebas</a>
5 +
6 + <form action="{{route('admin.tests.send-tests')}}" method="post">
7 + @csrf
8 + <p>Destino: Todos los participantes (Estudiantes, cuidadores, docentes)<br>
9 + Tipo de Prueba: Potencial de Aprendizaje y Campo de Talento</p>
10 + <button class="btn btn-primary" type="submit">Enviar Pruebas</button>
11 + </form>
6 12 </div>
7 13 @endsection

  resources/views/layouts/headers/cards.blade.php
... ... @@ -131,7 +131,11 @@
131 131 </div>
132 132 @else
133 133 @guest
134 - <div class="header bg-gradient-primary pb-3 pt-5 d-flex">
134 + @if(request()->is('*portal*'))
135 + <div class="header bg-gradient-primary pb-6 pt-5 d-flex">
136 + @else
137 + <div class="header bg-gradient-primary pb-3 pt-5 d-flex">
138 + @endif
135 139 <div class="container-fluid">
136 140 <div class="header-body">
137 141 <!-- Card stats -->
... ... @@ -142,7 +146,11 @@
142 146 </div>
143 147 @endguest
144 148 @auth
145 - <div class="header bg-primary py-6 py-md-5" id="navbar-container">
149 + @if(request()->is('*portal*'))
150 + <div class="header bg-primary py-6 pt-md-5 pb-md-6" id="navbar-container">
151 + @else
152 + <div class="header bg-primary py-6 py-md-5" id="navbar-container">
153 + @endif
146 154 <div class="container-fluid">
147 155 <div class="header-body">
148 156 <!-- Card stats -->
... ...

  resources/views/layouts/portal.blade.php 0 → 100644

1 + <!DOCTYPE html>

https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 7/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

2 + <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">


3 + <head>
4 + <meta charset="UTF-8">
5 + <meta http-equiv="X-UA-Compatible" content="ie=edge">
6 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 +
8 + <meta name="csrf-token" id="csrf-token" content="{{ csrf_token() }}">
9 +
10 + <!-- Iconos -->
11 + <link rel="apple-touch-icon" sizes="180x180" href="/images/icons/apple-touch-icon.png">
12 + <link rel="icon" type="image/png" sizes="32x32" href="/images/icons/favicon-32x32.png">
13 + <link rel="icon" type="image/png" sizes="16x16" href="/images/icons/favicon-16x16.png">
14 + <link rel="manifest" href="/images/icons/site.webmanifest">
15 + <link rel="mask-icon" href="/images/icons/safari-pinned-tab.svg" color="#5bbad5">
16 + <link rel="shortcut icon" href="/images/icons/favicon.ico">
17 + <meta name="msapplication-TileColor" content="#00aba9">
18 + <meta name="msapplication-config" content="/images/icons/browserconfig.xml">
19 + <meta name="theme-color" content="#ffffff">
20 +
21 + <link rel="apple-touch-icon" sizes="180x180" href="/images/icons/apple-icon-180.jpg">
22 + <link rel="apple-touch-icon" sizes="167x167" href="/images/icons/apple-icon-167.jpg">
23 + <link rel="apple-touch-icon" sizes="152x152" href="/images/icons/apple-icon-152.jpg">
24 + <link rel="apple-touch-icon" sizes="120x120" href="/images/icons/apple-icon-120.jpg">
25 +
26 + <meta name="apple-mobile-web-app-capable" content="yes">
27 +
28 + <title>{{isset($title) ? $title.' | ' : ''}}{{ config('app.name', 'Argon Dashboard') }}</title>
29 + <!-- Favicon -->
30 + {{-- <link href="{{ asset('argon') }}/img/brand/favicon.png" rel="icon" type="image/png"> --}}
31 + <!-- Fonts -->
32 + <link href="https://fonts.googleapis.com/css2?family=Ubuntu&display=swap" rel="stylesheet">
33 + <!-- Icons -->
34 + <link href="{{ asset('argon') }}/vendor/nucleo/css/nucleo.css" rel="stylesheet">
35 + <link href="{{ asset('argon') }}/vendor/@fortawesome/fontawesome-free/css/all.min.css"
rel="stylesheet">
36 + <!-- Argon CSS -->
37 + <link type="text/css" href="{{ asset('argon') }}/css/argon.css?v=1.0.1" rel="stylesheet">
38 + <!-- Librerias -->
39 + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-
[email protected]/dist/css/bootstrap-select.min.css">
40 + <style>
41 + h1,h2,h3,h4,h5,h6,i,a,p{
42 + font-family: 'Ubuntu', sans-serif;
43 + }
44 + </style>
45 + @include('layouts._includes.css')
46 + @laravelPWA
47 + @stack('css')
48 + </head>
49 + <body class="{{ $class ?? '' }}">
50 +
51 + @auth()
52 + <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
53 + @csrf
54 + </form>
55 + @endauth
56 +
57 + <div class="main-content">
58 + @include('layouts.navbars.navs.guest')
59 + @include('layouts.headers.cards')
60 + <div class="@auth my-3 @endauth">
61 + @yield('content')
62 + </div>
63 + </div>
64 +
65 + @guest()
66 + @include('layouts.footers.guest')
67 + @endguest
68 +
69 + <div class="my-7"></div>
70 +
71 + <script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
72 + <!-- <script src="https://cdn.jsdelivr.net/npm/vue"></script> -->
73 + <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
74 + <script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>

https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 8/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

75 + <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.2/axios.js"></script>
76 + <script src="{{ asset('argon') }}/vendor/jquery/dist/jquery.min.js"></script>
77 + <script src="{{ asset('argon') }}/vendor/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
78 + <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap-
select.min.js"></script>
79 + <script src="https://cdn.jsdelnameivr.net/npm/[email protected]/dist/js/i18n/defaults-
es_ES.min.js"></script>
80 + <script src="https://cdnjs.cloudflare.com/ajax/libs/ajax-bootstrap-select/1.4.5/js/ajax-bootstrap-
select.min.js"></script>
81 + @include('layouts._includes.js')
82 + @include('_includes.feedback')
83 +
84 + @stack('js')
85 +
86 + <!-- Argon JS -->
87 + <script src="{{ asset('argon') }}/js/argon.js?v=1.0.0"></script>
88 + </body>
89 + </html>

  resources/views/mails/send-portal-link.blade.php 0 → 100644
1 + @component('mail::message')
2 + # Hola, {{$partaker->first_name}}
3 +
4 + Te hemos asignado unas prueba para que las realices. Por favor, da click en el botón para entrar al portal
y realizar las pruebas.
5 +
6 + @component('mail::button', ['url' => route('portal.login')])
7 + Ver Pruebas
8 + @endcomponent
9 +
10 + Gracias,<br>
11 + {{ config('app.name') }}
12 + @endcomponent

  resources/views/portal/index.blade.php 0 → 100644
1 + @extends('layouts.portal', ['title' => 'Realizar Pruebas', 'titleIcon' =>
asset('images/icons/Prueba_3.png')])
2 + @section('content')
3 + <div class="container" id="tests">
4 + <h2>Realizar Pruebas</h2>
5 +
6 + <p>Bienvenido, a continuación se listan las pruebas asignadas a usted.</p>
7 +
8 + <x-table>
9 + <!-- <x&#45;slot name="headerRight"> -->
10 + <!-- <a class="btn btn&#45;primary" href="#" @click.prevent="showModalCreate"> -->
11 + <!-- <i class="fa fa&#45;plus"></i> Agregar Nuevo Rol -->
12 + <!-- </a> -->
13 + <!-- </x&#45;slot> -->
14 + <table class="table align-items-center table-flush table-hover">
15 + <thead class="thead-light">
16 + <tr>
17 + <th>#</th>
18 + <th><i class="fa fa-eye"></i> Tipo</th>
19 + <th><i class="fa fa-file-alt"></i> Prueba</th>
20 + <th><i class="fa fa-check"></i> Estado</th>
21 + <th></th>
22 + </tr>
23 + </thead>
24 + <tbody>
25 + @foreach($tests as $test)
26 + <tr>
27 + <td>{{$loop->iteration}}</td>
28 + <td>{{$test->instrument->name}}</td>
29 + <td>{{$test->instrument->name}}</td>
30 + <td>{{$test->status}}</td>
31 + <td class="text-right">
32 + <a href="#"
33 + class="btn btn-primary py-1 px-2 mr-1"
34 + title="Hacer prueba">
35 + <i class="fa fa-check-circle"></i> Empezar
36 + </a>
37 + </td>

https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 9/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

38 + </tr>
39 + @endforeach
40 + </tbody>
41 + </table>
42 + </x-table>
43 + </div>
44 + @endsection

  resources/views/portal/login.blade.php 0 → 100644
1 + @extends('layouts.portal', ['title' => 'Autenticación - Realizar Pruebas', 'titleIconClass' => 'eye'])
2 + @section('content')
3 + <div class="container" id="roles">
4 +
5 + <form action="{{route('portal.perform-login')}}"
6 + method="post"
7 + class="form-group mx-auto my-4"
8 + style="max-width: 400px">
9 + @csrf
10 +
11 + <h2>Bienvenido, Fulano</h2>
12 +
13 + <p>Ingrese su número de documento para autenticarse.</p>
14 +
15 + <div class="form-group">
16 + <label for="">Tipo de Identificación</label>
17 + <select id="" name="identification_type_id" class="form-control" required>
18 + @foreach($identificationTypes as $type)
19 + <option value="{{$type->id}}">
20 + {{$type->name}} - {{$type->description}}
21 + </option>
22 + @endforeach
23 + </select>
24 + </div>
25 +
26 + <div class="form-group">
27 + <label for="">Número de Identificación</label>
28 + <input type="text" name="identification" class="form-control" required>
29 + </div>
30 +
31 + <button class="btn btn-primary">Ingresar</button>
32 + </form>
33 +
34 +
35 + </div>
36 + @endsection

  routes/web.php
... ... @@ -18,6 +18,8 @@ Route::get('/', function () {
18 18 });
19 19
20 20 Auth::routes();
21 + Route::get('/portal/login', 'Auth\LoginController@partakerLogin')->name('portal.login');
22 + Route::post('/portal/login', 'Auth\LoginController@partakerPerformLogin')->name('portal.perform-login');
21 23
22 24 Route::get('/home', 'HomeController@index')->name('home');
23 25
... ... @@ -41,6 +43,7 @@ Route::group([
41 43 'prefix' => 'admin',
42 44 'as' => 'admin.',
43 45 'namespace' => 'Admin',
46 + 'middleware' => 'auth'
44 47 ], function() {
45 48 Route::resource('institutions', 'InstitutionController')
46 49 ->middleware(['can:'.ability('MANAGE_INSTITUTIONS')]);
... ... @@ -123,10 +126,19 @@ Route::group([
123 126 'as' => 'tests.',
124 127 ], function() {
125 128 Route::get('', 'TestController@index')->name('index');
129 + Route::post('send-tests', 'TestController@sendTests')->name('send-tests');
126 130 });
127 131
128 132 });
129 133

https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 10/11
1/8/2020 Parcial participante puede ver sus pruebas (1f277f30) · Commits · Guillermo Agudelo / apptalento · GitLab

134 + Route::group([
135 + 'prefix' => 'portal',
136 + 'as' => 'portal.',
137 + 'middleware' => 'auth:partaker',
138 + 'namespace' => 'Portal',
139 + ], function() {
140 + Route::get('', 'PortalController@index')->name('index');
141 + });
130 142
131 143 Route::group([
132 144 'prefix' => 'api',
... ...

Write a comment or drag your files here…

Markdown and quick actions are supported

https://gitlab.com/guille.agudelo/apptalento/-/commit/1f277f3027fdce1ad78924229ab1049b8a8a3105 11/11

You might also like