Agrega State. Agrega Formulario Nuevo Turno. Puede Crear Queue

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

29/6/2020 Agrega State. Agrega formulario nuevo turno.

rega formulario nuevo turno. Puede crear queue (46449ed4) · Commits · Guillermo Agudelo / transito-backup · GitLab

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

Commit 46449ed4 authored 3 weeks ago by Guillermo Agudelo

Agrega State. Agrega formulario nuevo turno. Puede crear queue

parent db0f186e master

No related merge requests found

Showing 33 changed files  with 768 additions and 141 deletions

  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

... ... @@ -2,10 +2,14 @@


2 2
3 3 namespace App\Http\Controllers;
4 4
5 + use App\Branch;
6 + use App\Company;
7 + use App\Employee;
5 8 use Illuminate\Http\Request;
6 9 use Kreait\Firebase\Auth;
7 10 use Illuminate\Validation\ValidationException;
8 11
12 +
9 13 class AuthController extends Controller
10 14 {
11 15 private $auth;
... ... @@ -20,7 +24,6 @@ class AuthController extends Controller
20 24 return view('auth.login');
21 25 }
22 26
23 -
24 27 public function performLogin(Request $request)

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

... ... @@ -4,10 +4,7 @@ namespace App\Http\Controllers;


4 4
5 5 use Illuminate\Http\Request;
6 6
7 - class TurnoController extends Controller
7 + class BranchController extends Controller
8 8 {
9 - public function index()
10 - {
11 - return view('turnos.index');
12 - }
9 + //
13 10 }

  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

... ... @@ -4,16 +4,9 @@ namespace App\Http\Middleware;


4 4
5 5 use App\Support\Helpers;
6 6 use Closure;
7 - use Kreait\Firebase\Auth;
8 7
9 8 class AuthFirebase
10 9 {
11 - private $auth;
12 -
13 - public function __construct(Auth $auth)
14 - {
15 - $this->auth = $auth;
16 - }
17 10 /**
18 11 * Handle an incoming request.
19 12 *
... ...

  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

... ... @@ -41,7 +41,7 @@ class Helpers


41 41 $idTokenString = $user->idToken();
42 42
43 43 try {
44 - $verifiedIdToken = $auth->verifyIdToken($idTokenString);
44 + $verifiedIdToken = $auth->verifyIdToken($idTokenString, true);
45 45 } catch (\Exception $ex) {
46 46 session()->forget('user');
47 47 return false;
... ...

  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

... ... @@ -11,6 +11,7 @@


11 11 "php": "^7.2.5",
12 12 "fideloper/proxy": "^4.2",
13 13 "fruitcake/laravel-cors": "^1.0",
14 + "google/cloud-firestore": "^1.13",
14 15 "guzzlehttp/guzzle": "^6.3",
15 16 "kreait/laravel-firebase": "^2.1",
16 17 "laravel-frontend-presets/argon": "^1.1",
... ... @@ -44,7 +45,8 @@
44 45 "database/factories"
45 46 ],
46 47 "files": [
47 - "app/Support/Helpers.php"
48 + "app/Support/Helpers.php",
49 + "app/Support/State.php"
48 50 ]
49 51 },
50 52 "autoload-dev": {
... ...

  composer.lock

This diff is collapsed.

  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

... ... @@ -10,17 +10,9 @@


10 10 "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --
hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 11 },
12 12 "devDependencies": {
13 - "axios": "^0.19",
14 - "bootstrap": "^4.0.0",
15 13 "cross-env": "^7.0",
16 - "jquery": "^3.2",
17 14 "laravel-mix": "^5.0.1",
18 - "lodash": "^4.17.13",
19 - "popper.js": "^1.12",
20 15 "resolve-url-loader": "^2.3.1",
21 - "sass": "^1.20.1",
22 - "sass-loader": "^8.0.0",
23 - "vue": "^2.5.17",
24 16 "vue-template-compiler": "^2.6.10"
25 17 }
26 18 }

  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

... ... @@ -4,9 +4,9 @@

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

4 4 * building robust, powerful web applications using Vue and Laravel.


5 5 */
6 6
7 - require('./bootstrap');
7 + // require('./bootstrap');
8 8
9 - window.Vue = require('vue');
9 + // window.Vue = require('vue');
10 10
11 11 /**
12 12 * The following block of code may be used to automatically register your
... ... @@ -19,7 +19,7 @@ window.Vue = require('vue');
19 19 // const files = require.context('./', true, /\.vue$/i)
20 20 // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
21 21
22 - Vue.component('example-component', require('./components/ExampleComponent.vue').default);
22 + // Vue.component('example-component', require('./components/ExampleComponent.vue').default);
23 23
24 24 /**
25 25 * Next, we will create a fresh Vue application instance and attach it to
... ... @@ -27,6 +27,6 @@ Vue.component('example-component', require('./components/ExampleComponent.vue').
27 27 * or customize the JavaScript scaffolding to fit your unique needs.
28 28 */
29 29
30 - const app = new Vue({
31 - el: '#app',
32 - });
30 + // const app = new Vue({
31 + // el: '#app',
32 + // });

  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';

  resources/views/cola/index.blade.php deleted 100644 → 0

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

... ... @@ -7,7 +7,8 @@


7 7
8 8 <meta name="csrf-token" content="{{ csrf_token() }}">
9 9
10 - <title>{{ config('app.name', 'Argon Dashboard') }}</title>
10 + <title>{{ $title ?? '' }} | {{ config('app.name', 'Argon Dashboard') }}</title>
11 +
11 12 <!-- Favicon -->
12 13 <link href="{{ asset('argon') }}/img/brand/favicon.png" rel="icon" type="image/png">
13 14 <!-- Fonts -->
... ... @@ -17,6 +18,8 @@
17 18 <link href="{{ asset('argon') }}/vendor/@fortawesome/fontawesome-free/css/all.min.css"
rel="stylesheet">
18 19 <!-- Argon CSS -->
19 20 <link type="text/css" href="{{ asset('argon') }}/css/argon.css?v=1.0.0" rel="stylesheet">
21 +
22 + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pretty-checkbox@3.0/dist/pretty-
checkbox.min.css">
20 23 </head>
21 24 <body class="{{ $class ?? '' }}">
22 25 @fauth()
... ... @@ -35,8 +38,11 @@
35 38 @include('layouts.footers.guest')
36 39 @endfguest
37 40
41 + <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
42 + <!-- <script src="https://cdn.jsdelivr.net/npm/vue"></script> -->
38 43 <script src="{{ asset('argon') }}/vendor/jquery/dist/jquery.min.js"></script>
39 44 <script src="{{ asset('argon') }}/vendor/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
45 + <script src="https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/5.4.0/bootbox.min.js"></script>
40 46
41 47 @stack('js')
42 48
... ...

  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

1 + @extends('layouts.app', ['title' => 'Cola'])


2 + @section('content')
3 + <div class="container" id="queue">
4 + <div>
5 + <div class="row">
6 + <div class="col text-center">
7 + <a href="#" class="btn btn-xl btn-primary mb-3" @click.prevent="createTurn">
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>
17 + </div>
18 +
19 + </div>
20 +
21 + <div class="d-none">
22 + <div id="modal-template">
23 + <form action="{{ route('queue.store') }}" method="post">
24 + @csrf
25 + <div class="row">
26 + <div class="col-lg-5">
27 + <div class="form-group">
28 + <label for="">Tipo de Documento</label>
29 + <select v-model="newTurn.client.idType" class="form-control"
name="identification-type" required>
30 + <option value="CC">Cédula de Ciudadanía</option>
31 + <option value="TI">Tarjeta de Identidad</option>
32 + <option value="CI">Cédula de Extrangería</option>
33 + </select>
34 + </div>
35 + </div>
36 + <div class="col-lg-7">
37 + <div class="form-group">
38 + <label for="">Número de Documento</label>
39 + <input type="number" min="1" class="form-control" v-
model="newTurn.client.idNumber" name="identification" required>
40 + </div>
41 + </div>
42 + </div>
43 + <div class="row">
44 + <div class="col">
45 + <div class="form-group">
46 + <label for="">Nombre</label>
47 + <input class="form-control" type="text" v-model="newTurn.client.name"
name="name" required>
48 + </div>
49 + </div>
50 + </div>
51 + <div class="row">
52 + <div class="col-lg-8">
53 + <div class="form-group">
54 + <label for="">Trámite</label>
55 + <select v-model="newTurn.service" class="form-control" name="id-service"
required>
56 + <option value="1">Tramite 1</option>
57 + <option value="2">Tramite 2</option>
58 + <option value="3">Tramite 3</option>
59 + </select>
60 + </div>
61 + </div>

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

62 + <div class="col-lg-4 d-flex align-items-center">


63 + <div class="pretty p-icon p-curve">
64 + <input type="checkbox" v-model="newTurn.isPriority" name="is-priority" />
65 + <div class="state p-primary">
66 + <i class="icon fa fa-check"></i>
67 + <label>Es prioritario</label>
68 + </div>
69 + </div>
70 + </div>
71 + </div>
72 +
73 + <input type="hidden" name="uid" value="{{\H::id()}}">
74 + <input type="hidden" name="id-company" value="{{\State::get('company.id')}}">
75 + <input type="hidden" name="id-branch" value="{{\State::get('branch.id')}}">
76 + <input type="hidden" name="state" value="Activo">
77 +
78 + <input type="submit" class="d-none" id="form-submit">
79 + </form>
80 + </div>
81 + </div>
82 +
83 + </div>
84 +
85 + @push('js')
86 + <script>
87 + const queue = new Vue({
88 + el: '#queue',
89 + data() {
90 + return {
91 + newTurn: {
92 + client: {
93 + idType: null,
94 + idNumber: null,
95 + name: null,
96 + },
97 + service: null,
98 + isPriority: null,
99 + }
100 + }
101 + },
102 + methods: {
103 + createTurn() {
104 + const dialog = bootbox.dialog({
105 + message: '<div id="modal"></div>',
106 + title: 'Generar Turno',
107 + onShow() { $('#modal').html($('#modal-template').html()) },
108 + buttons: {
109 + cancel: {
110 + label: 'Cancelar',
111 + className: 'btn-secondary',
112 + callback(ev) { dialog.modal('hide') }
113 + },
114 + confirm: {
115 + label: 'Generar Turno',
116 + className: 'btn-primary',
117 + callback(ev) { $('#modal #form-submit').click(); return false }
118 + }
119 + }
120 + })
121 + }
122 + }
123 + })
124 + </script>
125 + @endpush
126 + @endsection

  resources/views/turnos/index.blade.php deleted 100644 → 0

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

8 - <a href="#" class="btn mb-4 btn-primary btn-xl" :class="{'disabled': atendiendo}">


9 - LLAMAR SIGUIENTE TURNO
10 - </a>
11 -
12 - <h3 class="text-muted mb-0">Turno Actual</h3>
13 - <h1 class="display-1 mb-0 pb-0"><b>43</b></h1>
14 - <h1>María Pinzon</h1>
15 - <p>
16 - <span>Duración del turno: </span>
17 - <span class="h3">5:42 min</span>
18 - </p>
19 - <a href="#" class="btn btn-danger btn-xl">FINALIZAR ESTE TURNO</a>
20 - </div>
21 - </div>
22 - </div>
23 - @endsection

  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

  resources/views/welcome.blade.php deleted 100644 → 0


1 - @extends('layouts.app', ['class' => 'bg-default'])
2 -
3 - @section('content')
4 - <div class="header bg-gradient-primary py-7 py-lg-8">
5 - <div class="container">
6 - <div class="header-body text-center mt-7 mb-7">
7 - <div class="row justify-content-center">
8 - <div class="col-lg-5 col-md-6">
9 - <h1 class="text-white">{{ __('Welcome to Argon Dashboard FREE Laravel Live
Preview.') }}</h1>
10 - </div>
11 - </div>
12 - </div>
13 - </div>
14 - <div class="separator separator-bottom separator-skew zindex-100">
15 - <svg x="0" y="0" viewBox="0 0 2560 100" preserveAspectRatio="none" version="1.1"
xmlns="http://www.w3.org/2000/svg">
16 - <polygon class="fill-default" points="2560 0 2560 100 0 100"></polygon>
17 - </svg>
18 - </div>
19 - </div>
20 -
21 - <div class="container mt--10 pb-5"></div>
22 - @endsection

  routes/web.php

... ... @@ -38,15 +38,16 @@ Route::group([


38 38 ], function () {
39 39 Route::group([
40 40 'prefix' => 'cola',
41 - 'as' => 'cola.',
41 + 'as' => 'queue.',
42 42 ], function() {
43 - Route::get('', 'ColaController@index')->name('index');
43 + Route::get('', 'QueueController@index')->name('index');
44 + Route::post('', 'QueueController@store')->name('store');
44 45 });
45 46
46 47 Route::group([
47 48 'prefix' => 'turnos',
48 - 'as' => 'turnos.',
49 + 'as' => 'turns.',
49 50 ], function() {
50 - Route::get('', 'TurnoController@index')->name('index');
51 + Route::get('', 'TurnController@index')->name('index');
51 52 });
52 53 });

Write a comment or drag your files here…

Markdown and quick actions are supported

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

You might also like