Professional Documents
Culture Documents
Agrega State. Agrega Formulario Nuevo Turno. Puede Crear Queue
Agrega State. Agrega Formulario Nuevo Turno. Puede Crear Queue
Agrega State. Agrega Formulario Nuevo Turno. Puede Crear Queue
rega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
app/Branch.php 0 → 100644
1 + <?php
2 +
3 + namespace App;
4 +
5 + class Branch extends Model
6 +{
7 + protected $collectionName = 'branchs';
8 +}
app/Company.php 0 → 100644
1 + <?php
2 +
3 + namespace App;
4 +
5 + class Company extends Model
6 +{
7 + protected $collectionName = 'companys';
8 +}
app/Employee.php 0 → 100644
1 + <?php
2 +
3 + namespace App;
4 +
5 + class Employee extends Model
6 +{
7 + protected $collectionName = 'employees';
8 +}
app/Http/Controllers/AuthController.php
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 1/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
25 28 {
26 29 $email = $request->email;
... ... @@ -28,8 +31,6 @@ class AuthController extends Controller
28 31
29 32 try {
30 33 $user = $this->auth->signInWithEmailAndPassword($email, $password);
31 - session(['user' => $user]);
32 - return redirect()->route('home');
33 34 } catch (\Exception $ex) {
34 35 switch ($ex->getMessage()) {
35 36 case 'EMAIL_NOT_FOUND':
... ... @@ -42,6 +43,28 @@ class AuthController extends Controller
42 43 throw $ex;
43 44 }
44 45 }
46 +
47 + session(['user' => $user, 'state' => []]);
48 +
49 + $employee = new Employee;
50 + $employee->first('uid', '=', \H::id());
51 +
52 + $company = new Company;
53 + $company->find($employee->get('idCompany'));
54 +
55 + $branch = new Branch;
56 + $branch->find($employee->get('idBranch'));
57 +
58 + $state = [
59 + 'employee' => $employee->data(),
60 + 'branch' => $branch->data(),
61 + 'company' => $company->data(),
62 + 'user' => $user,
63 + ];
64 +
65 + session(['state' => $state]);
66 +
67 + return redirect()->route('home');
45 68 }
46 69
47 70
... ... @@ -54,6 +77,8 @@ class AuthController extends Controller
54 77 }
55 78
56 79 session()->forget('user');
80 + session()->forget('state');
81 +
57 82 return redirect()->route('home');
58 83 }
59 84 }
app/Http/Controllers/TurnoController.php → app/Http/Controllers/BranchController.php
app/Http/Controllers/CompanyController.php 0 → 100644
1 + <?php
2 +
3 + namespace App\Http\Controllers;
4 +
5 + use Illuminate\Http\Request;
6 +
7 + class CompanyController extends Controller
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 2/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
8 +{
9 + //
10 +}
app/Http/Controllers/EmployeeController.php 0 → 100644
1 + <?php
2 +
3 + namespace App\Http\Controllers;
4 +
5 + use Illuminate\Http\Request;
6 +
7 + class EmployeeController extends Controller
8 +{
9 + //
10 +}
app/Http/Controllers/QueueController.php 0 → 100644
1 + <?php
2 +
3 + namespace App\Http\Controllers;
4 +
5 + use App\Queue;
6 + use Illuminate\Http\Request;
7 +
8 + class QueueController extends Controller
9 +{
10 + public function index()
11 + {
12 + return view('queue.index');
13 + }
14 +
15 + public function store(Request $request)
16 + {
17 + $data = $request->validate([
18 + 'identification' => 'required',
19 + 'identification-type' => 'required',
20 + 'name' => 'required',
21 + 'id-service' => 'required',
22 + 'is-priority' => 'nullable',
23 + 'date' => 'nullable|date',
24 + 'id-branch' => 'required',
25 + 'id-company' => 'required',
26 + 'state' => 'required',
27 + 'uid' => 'required'
28 + ]);
29 +
30 + $queue = new Queue;
31 + $queue->create([
32 + 'idBranch' => $data['id-branch'],
33 + 'idCompany' => $data['id-company'],
34 + 'idService' => $data['id-service'],
35 + 'isPriority' => (bool)$request->has('is-priority'),
36 + 'state' => $data['state'],
37 + 'uid' => $data['uid'],
38 + 'createdBy' => $data['uid'],
39 + 'createdAt' => now()->toDateTimeString(),
40 + ]);
41 +
42 + return redirect()->route('queue.index');
43 + }
44 +}
app/Http/Controllers/ColaController.php → app/Http/Controllers/TurnController.php
... ... @@ -4,10 +4,10 @@ namespace App\Http\Controllers;
4 4
5 5 use Illuminate\Http\Request;
6 6
7 - class ColaController extends Controller
7 + class TurnController extends Controller
8 8 {
9 9 public function index()
10 10 {
11 - return view('cola.index');
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 3/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
11 + return view('turns.index');
12 12 }
13 13 }
app/Http/Middleware/AuthFirebase.php
app/Model.php 0 → 100644
1 + <?php
2 +
3 + namespace App;
4 +
5 + use Kreait\Firebase\Firestore;
6 +
7 + class Model
8 +{
9 + private $firestore;
10 + private $collection;
11 + private $snapshot;
12 + protected $collectionName;
13 +
14 + public function __construct()
15 + {
16 + $this->firestore = app('firebase.firestore');
17 + $this->collection = $this->firestore->database()->collection($this->collectionName);
18 + }
19 +
20 + public function collection()
21 + {
22 + return $this->collection;
23 + }
24 +
25 + public function all()
26 + {
27 + return $this->collection->documents();
28 + }
29 +
30 + public function find($id)
31 + {
32 + $result = $this->collection->document($id)->snapshot();
33 + $this->snapshot = $result;
34 + return $this->snapshot;
35 + }
36 +
37 + public function where($field, $operation, $value)
38 + {
39 + return $this->collection->where($field, $operation, $value)->documents();
40 + }
41 +
42 + public function first($field, $operation, $value)
43 + {
44 + $results = $this->where($field, $operation, $value);
45 +
46 + if ($results->isEmpty()) {
47 + $this->snapshot = null;
48 + } else {
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 4/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
49 + $this->snapshot = $results->rows()[0];
50 + }
51 +
52 + return $this->snapshot;
53 + }
54 +
55 + public function get($field)
56 + {
57 + if ($field == 'id') return $this->snapshot->id();
58 + return $this->snapshot->get($field);
59 + }
60 +
61 + public function snapshot()
62 + {
63 + return $this->snapshot;
64 + }
65 +
66 + public function data()
67 + {
68 + if ($this->snapshot) {
69 + return array_merge(['id' => $this->snapshot->id()], $this->snapshot->data());
70 + }
71 + return null;
72 + }
73 +
74 +
75 +
76 +
77 +
78 + // MUTATION
79 +
80 + public function create($data)
81 + {
82 + return $this->collection->add($data)->snapshot();
83 + }
84 +}
app/Queue.php 0 → 100644
1 + <?php
2 +
3 + namespace App;
4 +
5 + class Queue extends Model
6 +{
7 + protected $collectionName = 'queues';
8 +}
app/Support/Helpers.php
app/Support/State.php 0 → 100644
1 + <?php
2 +
3 + namespace App\Support;
4 +
5 + class State
6 +{
7 + public static function get(string $itemString = null)
8 + {
9 + $state = session('state', null);
10 +
11 + if (!$state) return null;
12 +
13 + if (!$itemString) return $state;
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 5/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
14 +
15 + $itemStringArray = collect(explode('.', $itemString));
16 +
17 + $result = $state[$itemStringArray->shift()];
18 +
19 + while (count($itemStringArray) > 0) {
20 + $result = collect($result)->get($itemStringArray->shift());
21 + }
22 +
23 + return $result;
24 + }
25 +}
composer.json
composer.lock
config/app.php
... ... @@ -229,6 +229,7 @@ return [
229 229 'View' => Illuminate\Support\Facades\View::class,
230 230
231 231 'H' => App\Support\Helpers::class,
232 + 'State' => App\Support\State::class,
232 233 ],
233 234
234 235 ];
package.json
public/js/easytimer.min.js 0 → 100644
1 + /**
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 6/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
2 + * easytimer.js
3 + * Generated: 2019-12-22
4 + * Version: 4.1.1
5 + */
6 +
7 + !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof
define&&define.amd?define(["exports"],e):e((t=t||self).easytimer={})}(this,function(t){"use
strict";function _(t){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t)
{return typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function e(e,t){var
n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&
(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return
n}function z(r){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?
e(Object(i),!0).forEach(function(t){var e,n,o;e=r,o=i[n=t],n in e?Object.defineProperty(e,n,
{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o}):Object.getOwnPropertyDescriptors?
Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(t)
{Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(i,t))})}return r}function i(t,e,n){var
o,r="";if((t="number"==typeof t?String(t):t).length>e)return
t;for(o=0;o<e;o+=1)r+=String(n);return(r+t).slice(-r.length)}function R()
{this.secondTenths=0,this.seconds=0,this.minutes=0,this.hours=0,this.days=0,this.toString=function(){var
t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:
["hours","minutes","seconds"],e=1<arguments.length&&void 0!==arguments[1]?
arguments[1]:":",n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:2;t=t||
["hours","minutes","seconds"],e=e||":",n=n||2;var o,r=[];for(o=0;o<t.length;o+=1)void 0!==this[t[o]]&&
("secondTenths"===t[o]?r.push(this[t[o]]):r.push(i(this[t[o]],n,"0")));return r.join(e)}}var
n="undefined"!=typeof window?window.CustomEvent:void 0;"undefined"!=typeof window&&"function"!=typeof n&&
((n=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var
n=document.createEvent("CustomEvent");return
n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}).prototype=window.Event.prototype,window.CustomEven
t=n);var B="secondTenths",F="seconds",G="minutes",H="hours",J="days",K=[B,F,G,H,J],N=
{secondTenths:100,seconds:1e3,minutes:6e4,hours:36e5,days:864e5},Q=
{secondTenths:10,seconds:60,minutes:60,hours:24},W="undefined"!=typeof
module&&module.exports&&"function"==typeof require?require("events"):void 0;function X()
{return"undefined"!=typeof document}function Y(){return W}function Z(t,e){return(t%e+e)%e}function o(){var
e,n,r,o,i,s,u,c,a,f,d=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},l=new R,h=new R,p=X()?
document.createElement("span"):Y()?new W.EventEmitter:void 0,v=!1,y=!1,m={},b={detail:
{timer:this}};function w(t,e){var n,o,r=h[e];return o=C(t,N[n=e]),h[n]=o,l[n]=n===J?o:0<=o?Z(o,Q[n]):Q[n]-
Z(o,Q[n]),h[e]!==r}function t(){g(),function(){for(var t in l)l.hasOwnProperty(t)&&"number"==typeof l[t]&&
(l[t]=0);for(var e in h)h.hasOwnProperty(e)&&"number"==typeof h[e]&&(h[e]=0)}()}function g()
{clearInterval(e),e=void 0,y=v=!1}function O(t){I()?(a=E(),s=V(i.target)):D(t),function(){var
t=N[n];if(S(P(Date.now())))return;e=setInterval(j,t),v=!0,y=!1}()}function E(){return P(Date.now())-
h.secondTenths*N[B]*r}function j(){var t=P(Date.now());!function(t)
{t[B]&&M("secondTenthsUpdated",b);t[F]&&M("secondsUpdated",b);t[G]&&M("minutesUpdated",b);t[H]&&M("hoursUpd
ated",b);t[J]&&M("daysUpdated",b)}(T()),o(b.detail.timer),S(t)&&(U(),M("targetAchieved",b))}function T(t)
{var e=0<arguments.length&&void 0!==t?t:P(Date.now()),n=0<r?e-a:a-e,o={};return
o[B]=w(n,B),o[F]=w(n,F),o[G]=w(n,G),o[H]=w(n,H),o[J]=w(n,J),o}function P(t){return
Math.floor(t/N[n])*N[n]}function S(t){return s instanceof Array&&f<=t}function D(t){var e;n=function(t)
{if(function(t){return 0<=K.indexOf(t)}(t=typeof t==="string"?t:F))return t;throw new Error("Error in
precision parameter: ".concat(t," is not a valid value"))}((t=t||{}).precision),o="function"==typeof
t.callback?t.callback:function(){},c=!0===t.countdown,r=!0==c?-1:1,"object"===_(t.startValues)?
(e=t.startValues,u=x(e),l.secondTenths=u[0],l.seconds=u[1],l.minutes=u[2],l.hours=u[3],l.days=u[4],h=L(u,h)
):u=null,a=E(),T(),s="object"===_(t.target)?V(t.target):c?(t.target={seconds:0},V(t.target)):null,m=
{precision:n,callback:o,countdown:"object"===_(t)&&!0===t.countdown,target:s,startValues:u},i=t}function
x(t){var e,n,o,r,i,s;if("object"===_(t))if(t instanceof Array){if(5!==t.length)throw new Error("Array size
not valid");s=t}else{for(var u in t)if(K.indexOf(u)<0)throw new Error("Error in startValues or target
parameter: ".concat(u," is not a valid input value"));s=
[t.secondTenths||0,t.seconds||0,t.minutes||0,t.hours||0,t.days||0]}return
e=s[0],n=s[1]+C(e,10),o=s[2]+C(n,60),r=s[3]+C(o,60),i=s[4]+C(r,24),s[0]=e%10,s[1]=n%60,s[2]=o%60,s[3]=r%24,
s[4]=i,s}function C(t,e){var n=t/e;return n<0?Math.ceil(n):Math.floor(n)}function V(t){if(t){var
e=L(s=x(t));return f=a+e.secondTenths*N[B]*r,s}}function L(t,e){var n=e||{};return
n.days=t[4],n.hours=24*n.days+t[3],n.minutes=60*n.hours+t[2],n.seconds=60*n.minutes+t[1],n.secondTenths=10*
n.seconds+t[[0]],n}function U(){t(),M("stopped",b)}function k(t,e){X()?
p.addEventListener(t,e):Y()&&p.on(t,e)}function A(t,e){X()?
p.removeEventListener(t,e):Y()&&p.removeListener(t,e)}function M(t,e){X()?p.dispatchEvent(new
CustomEvent(t,e)):Y()&&p.emit(t,e)}function q(){return v}function I(){return y}D(d),void 0!==this&&
(this.start=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};t=z({},d,{},t),q()||
(O(t),M("started",b))},this.pause=function(){g(),y=!0,M("paused",b)},this.stop=U,this.reset=function()
{t(),O(i),M("reset",b)},this.isRunning=q,this.isPaused=I,this.getTimeValues=function(){return
l},this.getTotalTimeValues=function(){return h},this.getConfig=function(){return
m},this.addEventListener=k,this.on=k,this.removeEventListener=A,this.off=A)}t.Timer=o,t.default=o,Object.de
fineProperty(t,"__esModule",{value:!0})});
resources/js/app.js
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 7/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
resources/js/bootstrap.js
1 - window._ = require('lodash');
1 + // window._ = require('lodash');
2 2
3 3 /**
4 4 * We'll load jQuery and the Bootstrap jQuery plugin which provides support
... ... @@ -6,12 +6,12 @@ window._ = require('lodash');
6 6 * code may be modified to fit the specific needs of your application.
7 7 */
8 8
9 - try {
10 - window.Popper = require('popper.js').default;
11 - window.$ = window.jQuery = require('jquery');
12 -
13 - require('bootstrap');
14 - } catch (e) {}
9 + // try {
10 + // window.Popper = require('popper.js').default;
11 + // window.$ = window.jQuery = require('jquery');
12 + //
13 + // require('bootstrap');
14 + // } catch (e) {}
15 15
16 16 /**
17 17 * We'll load the axios HTTP library which allows us to easily issue requests
... ... @@ -19,9 +19,9 @@ try {
19 19 * CSRF token as a header based on the value of the "XSRF" token cookie.
20 20 */
21 21
22 - window.axios = require('axios');
23 -
24 - window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
22 + // window.axios = require('axios');
23 + //
24 + // window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
25 25
26 26 /**
27 27 * Echo exposes an expressive API for subscribing to channels and listening
... ...
resources/sass/_variables.scss
1 - // Body
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 8/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
2 - $body-bg: #f8fafc;
3 -
4 - // Typography
5 - $font-family-sans-serif: 'Nunito', sans-serif;
6 - $font-size-base: 0.9rem;
7 - $line-height-base: 1.6;
8 -
9 - // Colors
10 - $blue: #3490dc;
11 - $indigo: #6574cd;
12 - $purple: #9561e2;
13 - $pink: #f66d9b;
14 - $red: #e3342f;
15 - $orange: #f6993f;
16 - $yellow: #ffed4a;
17 - $green: #38c172;
18 - $teal: #4dc0b5;
19 - $cyan: #6cb2eb;
1 + // // Body
2 + // $body-bg: #f8fafc;
3 + //
4 + // // Typography
5 + // $font-family-sans-serif: 'Nunito', sans-serif;
6 + // $font-size-base: 0.9rem;
7 + // $line-height-base: 1.6;
8 + //
9 + // // Colors
10 + // $blue: #3490dc;
11 + // $indigo: #6574cd;
12 + // $purple: #9561e2;
13 + // $pink: #f66d9b;
14 + // $red: #e3342f;
15 + // $orange: #f6993f;
16 + // $yellow: #ffed4a;
17 + // $green: #38c172;
18 + // $teal: #4dc0b5;
19 + // $cyan: #6cb2eb;
resources/sass/app.scss
1 - // Fonts
2 - @import url('https://fonts.googleapis.com/css?family=Nunito');
3 -
4 - // Variables
5 - @import 'variables';
6 -
7 - // Bootstrap
8 - @import '~bootstrap/scss/bootstrap';
1 + // // Fonts
2 + // @import url('https://fonts.googleapis.com/css?family=Nunito');
3 + //
4 + // // Variables
5 + // @import 'variables';
6 + //
7 + // // Bootstrap
8 + // @import '~bootstrap/scss/bootstrap';
1 - @extends('layouts.app')
2 - @section('content')
3 - <div class="container">
4 - <div>
5 - <div class="row">
6 - <div class="col text-center">
7 - <a href="#" class="btn btn-xl btn-primary mb-3">
8 - GENERAR TURNO
9 - </a>
10 - <div>
11 - <p class="mb-0 text-muted">Turno generado</p>
12 - <p class="display-1 d-flex border-bottom justify-content-center align-items-center">
13 - <span class="text-xl text-muted mr-1">#</span>43
14 - </p>
15 - </div>
16 - </div>
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 9/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
17 - </div>
18 -
19 - </div>
20 - </div>
21 - @endsection
resources/views/dashboard.blade.php
1 - @extends('layouts.app')
1 + @extends('layouts.app', ['title' => 'Tablero'])
2 2
3 3 @section('content')
4 4 @include('layouts.headers.cards')
... ...
resources/views/layouts/app.blade.php
resources/views/layouts/navbars/navs/auth.blade.php
... ... @@ -3,7 +3,7 @@
3 3 <div class="container-fluid">
4 4 <!-- Brand -->
5 5 <a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="{{ route('home') }}">
6 - <h1 class="text-white mb-0">Tablero</h1>
6 + <h1 class="text-white mb-0">{{ $title ?? '' }}</h1>
7 7 </a>
8 8 <!-- User -->
9 9 <ul class="navbar-nav align-items-center d-none d-md-flex">
... ...
resources/views/layouts/navbars/sidebar.blade.php
... ... @@ -92,12 +92,12 @@
92 92 {{-- </li> --}}
93 93
94 94 <li class="nav-item">
95 - <a class="nav-link" href="{{ route('cola.index') }}">
95 + <a class="nav-link" href="{{ route('queue.index') }}">
96 96 <i class="fa fa-angle-double-right text-blue"></i>Cola
97 97 </a>
98 98 </li>
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 10/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
99 99 <li class="nav-item">
100 - <a class="nav-link" href="{{ route('turnos.index') }}">
100 + <a class="nav-link" href="{{ route('turns.index') }}">
101 101 <i class="fa fa-users text-orange"></i>Turnos
102 102 </a>
103 103 </li>
... ...
resources/views/queue/index.blade.php 0 → 100644
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 11/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
1 -
2 - @extends('layouts.app')
3 - @section('content')
4 - <div class="container">
5 -
6 - <div class="row">
7 - <div class="col text-center d-flex flex-column align-items-center">
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 12/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
resources/views/turns/index.blade.php 0 → 100644
1 + @extends('layouts.app', ['title' => 'Turnos'])
2 + @section('content')
3 + <div class="container" id="turns">
4 +
5 + <div class="row">
6 + <div class="col text-center d-flex flex-column align-items-center">
7 + <a href="#" class="btn mb-4 btn-primary btn-xl" :class="{'disabled': attendingTurn}">
8 + LLAMAR SIGUIENTE TURNO
9 + </a>
10 +
11 + <h3 class="text-muted mb-0">Turno Actual</h3>
12 + <h1 class="display-1 mb-0 pb-0"><b>43</b></h1>
13 + <h1>María Pinzon</h1>
14 + <p>
15 + <span>Duración del turno: </span>
16 + <span class="h3" id="timer">00:00:00</span>
17 + </p>
18 + <a v-show="attendingTurn" @click.prevent="finishAttention" href="#" class="btn btn-danger btn-
xl">
19 + FINALIZAR ESTE TURNO
20 + </a>
21 + <a v-show="!attendingTurn" @click.prevent="startAttention" href="#" class="btn btn-success btn-
xl">
22 + EMPEZAR ATENCIÓN
23 + </a>
24 + </div>
25 + </div>
26 + </div>
27 +
28 + @push('js')
29 + <script src="{{ asset('js/easytimer.min.js') }}"></script>
30 + <script>
31 + const turns = new Vue({
32 + el: '#turns',
33 + data() {
34 + return {
35 + attendingTurn: false,
36 + timer: new easytimer.Timer(/* default config */),
37 + client: null,
38 + }
39 + },
40 + methods: {
41 + startAttention() {
42 + this.attendingTurn = true
43 + this.startTimer()
44 + },
45 + finishAttention() {
46 + this.attendingTurn = false
47 + this.stopTimer()
48 + },
49 + startTimer() {
50 + this.timer.start(/* config */)
51 + this.timer.addEventListener('secondsUpdated', (e) => {
52 + $('#timer').html(this.timer.getTimeValues().toString())
53 + })
54 + },
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 13/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
55 + stopTimer() {
56 + this.timer.stop()
57 + }
58 + }
59 + })
60 + </script>
61 + @endpush
62 + @endsection
routes/web.php
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 14/15
29/6/2020 Agrega State. Agrega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab
https://gitlab.com/guille.agudelo/transito/-/commit/46449ed4633edde62a1ed9e8f1a177173d98e96e 15/15