Skip to content

Commit 228ab7b

Browse files
authored
Merge pull request #104 from wcadena/revert-103-desarrollo_1
Revert "Desarrollo 1"
2 parents 807575a + eb63aad commit 228ab7b

4,379 files changed

Lines changed: 303218 additions & 65018 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/node_modules
22
/node_modules_otro
3-
/html/hot
4-
/html/storage
5-
/html/.well-known
3+
/public/hot
4+
/public/storage
5+
/public/.well-known
66
/storage/*.key
77
/storage/*files
88
/vendor

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
## Contribuir a InventarioFinalApp
2-
Damos las gracias y bienvenidas sean todas las correcciones y mejoras en el desarrollo del código de InventarioFinalApp, pruebas y documentación.
1+
## Contribuir a gestor-inventarios-it
2+
Damos las gracias y bienvenidas sean todas las correcciones y mejoras en el desarrollo del código de gestor-inventarios-it, pruebas y documentación.
33
Esta guía detalla como contribuir en el proyecto de una manera que sea eficiente para toda la comunidad.
44

55

@@ -15,7 +15,7 @@ Esta guía detalla como contribuir en el proyecto de una manera que sea eficient
1515

1616
### 1. Prerequisitos
1717

18-
1.1 [Leer el Manual de InventarioFinalApp](/docs/InventarioFinalApp.docx)
18+
1.1 [Leer el Manual de gestor-inventarios-it](/docs/gestor-inventarios-it.docx)
1919
En costrucción
2020

2121
1.2 Tener clara la normalización de código fuente
@@ -27,15 +27,15 @@ En costrucción
2727

2828
### 2. Preparación de ambiente local
2929

30-
2.1 Realizar Fork del repositorio https://github.com/wcadena/inventarioFinalApp a tu cuenta GitHub
30+
2.1 Realizar Fork del repositorio https://github.com/wcadena/gestor-inventarios-it a tu cuenta GitHub
3131

3232
2.2 Clonar el proyecto forkeado desde tu cuenta GitHub. Ejemplo:
3333
```console
34-
https://github.com/wcadena/inventarioFinalApp.git
34+
https://github.com/wcadena/gestor-inventarios-it.git
3535
```
3636
2.3 Agregar el repositorio padre como origen remoto. Ejemplo:
3737
```console
38-
git remote add upstream https://github.com/wcadena/inventarioFinalApp.git
38+
git remote add upstream https://github.com/wcadena/gestor-inventarios-it.git
3939
```
4040
2.4 Luego de clonado el proyecto, crear la rama beta para empezar a trabajar. Ejemplo:
4141
```console
@@ -130,7 +130,7 @@ contáctese con nosotros al correo wcadena@outlook.com
130130

131131
## Traducción
132132

133-
Las traducciones se hacen a partir del [repo original](https://github.com/wcadena/inventarioFinalApp). Los aportes de traducción pueden ser de diferentes maneras:
133+
Las traducciones se hacen a partir del [repo original](https://github.com/wcadena/gestor-inventarios-it). Los aportes de traducción pueden ser de diferentes maneras:
134134

135135
1. Traducir los términos pendientes o nuevos.
136136
2. Corregir traducciones existentes.
@@ -141,7 +141,7 @@ Sin embargo, al traducir queremos utilizar un español internacional.
141141
142142
## Flujo de Trabajo
143143

144-
1. Busca una traducción pendiente en la columna TODO: [ver traducciones pendientes](https://github.com/wcadena/inventarioFinalApp/pendientes).
144+
1. Busca una traducción pendiente en la columna TODO: [ver traducciones pendientes](https://github.com/wcadena/gestor-inventarios-it/pendientes).
145145
2. Asegúrate que nadie esté trabajando en él (te puedes dar cuenta viendo que no haya nadie asignado ni nadie ha comentado que está trabajando).
146146
3. Sigue las reglas descritas abajo y crea tu PR.
147147

app/Exceptions/Handler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Illuminate\Database\QueryException;
1212
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
1313
use Illuminate\Session\TokenMismatchException;
14+
use Illuminate\Support\Facades\Session;
1415
use Illuminate\Validation\ValidationException;
1516
use Symfony\Component\HttpKernel\Exception\HttpException;
1617
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
@@ -66,6 +67,12 @@ public function render($request, Exception $exception)
6667
public function handleException($request, Exception $exception)
6768
{
6869
if (config('app.debug') && !$request->is('api/*')) {
70+
if ($exception instanceof TokenMismatchException) {
71+
Session::flash('TokenMismatchException_ev', true);
72+
73+
return redirect('/login?TokenMismatchException_ev=true');
74+
}
75+
6976
return parent::render($request, $exception);
7077
}
7178
if ($exception instanceof ValidationException) {

app/FileEntry.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@ class FileEntry extends Model
99
{
1010
use SoftDeletes;
1111
protected $dates = ['deleted_at'];
12-
protected $fillable = ['vinculo','vinculo_padre','filename', 'mime', 'path', 'size','user_id','tipo','imageable_type','imageable_id'];
12+
protected $fillable = ['vinculo', 'vinculo_padre', 'filename', 'mime', 'path', 'size', 'user_id', 'tipo', 'imageable_type', 'imageable_id'];
13+
14+
/**
15+
* Get all of the owning imageable models or files.
16+
*/
17+
public function imageable()
18+
{
19+
return $this->morphTo();
20+
}
1321
}

app/Http/Controllers/Auth/ForgotPasswordController.php

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
use App\Http\Controllers\Controller;
66
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7-
use Illuminate\Http\JsonResponse;
8-
use Illuminate\Http\Request;
9-
use Illuminate\Support\Facades\Password;
107

118
class ForgotPasswordController extends Controller
129
{
@@ -20,84 +17,8 @@ class ForgotPasswordController extends Controller
2017
| your application to your users. Feel free to explore this trait.
2118
|
2219
*/
23-
2420
use SendsPasswordResetEmails;
2521

26-
/**
27-
* Send a reset link to the given user.
28-
*
29-
* @param \Illuminate\Http\Request $request
30-
*
31-
* @return \Illuminate\Http\RedirectResponse
32-
*/
33-
public function sendResetLinkEmail(Request $request)
34-
{
35-
$this->validateEmail($request);
36-
37-
// We will send the password reset link to this user. Once we have attempted
38-
// to send the link, we will examine the response then see the message we
39-
// need to show to the user. Finally, we'll send out a proper response.
40-
$response = $this->broker()->sendResetLink(
41-
$request->only('email')
42-
);
43-
44-
return $response == Password::RESET_LINK_SENT
45-
? $this->sendResetLinkResponse($request, $response)
46-
: $this->sendResetLinkFailedResponse($request, $response);
47-
}
48-
49-
/**
50-
* Get the response for a successful password reset link.
51-
*
52-
* @param string $response
53-
*
54-
* @return mixed
55-
*/
56-
protected function sendResetLinkResponse(Request $request, $response)
57-
{
58-
if ($request->expectsJson()) {
59-
return response()->json([
60-
'status' => trans($response),
61-
]);
62-
}
63-
64-
return back()->with('status', trans($response));
65-
}
66-
67-
/**
68-
* Get the response for a failed password reset link.
69-
*
70-
* @param Request $request
71-
* @param $response
72-
*
73-
* @return mixed
74-
*/
75-
protected function sendResetLinkFailedResponse(Request $request, $response)
76-
{
77-
if ($request->expectsJson()) {
78-
return new JsonResponse([
79-
'message' => 'The given data was invalid.',
80-
'errors' => [
81-
'email' => trans($response),
82-
],
83-
], 422);
84-
}
85-
86-
return back()->withErrors(
87-
['email' => trans($response)]
88-
);
89-
}
90-
91-
/**
92-
* Display the form to request a password reset link.
93-
*
94-
* @return \Illuminate\Http\Response
95-
*/
96-
public function showLinkRequestForm()
97-
{
98-
return view('adminlte::auth.passwords.email');
99-
}
100-
10122
/**
10223
* Create a new controller instance.
10324
*

app/Http/Controllers/Auth/LoginController.php

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use App\Http\Controllers\Controller;
66
use Illuminate\Foundation\Auth\AuthenticatesUsers;
7-
use Illuminate\Http\Request;
87

98
class LoginController extends Controller
109
{
@@ -18,21 +17,7 @@ class LoginController extends Controller
1817
| to conveniently provide its functionality to your applications.
1918
|
2019
*/
21-
22-
use AuthenticatesUsers {
23-
attemptLogin as attemptLoginAtAuthenticatesUsers;
24-
}
25-
26-
/**
27-
* Show the application's login form.
28-
*
29-
* @return \Illuminate\Http\Response
30-
*/
31-
public function showLoginForm()
32-
{
33-
return view('adminlte::auth.login');
34-
}
35-
20+
use AuthenticatesUsers;
3621
/**
3722
* Where to redirect users after login.
3823
*
@@ -47,50 +32,6 @@ public function showLoginForm()
4732
*/
4833
public function __construct()
4934
{
50-
$this->middleware('guest', ['except' => 'logout']);
51-
}
52-
53-
/**
54-
* Returns field name to use at login.
55-
*
56-
* @return string
57-
*/
58-
public function username()
59-
{
60-
return config('auth.providers.users.field', 'email');
61-
}
62-
63-
/**
64-
* Attempt to log the user into the application.
65-
*
66-
* @param \Illuminate\Http\Request $request
67-
*
68-
* @return bool
69-
*/
70-
protected function attemptLogin(Request $request)
71-
{
72-
if ($this->username() === 'email') {
73-
return $this->attemptLoginAtAuthenticatesUsers($request);
74-
}
75-
if (!$this->attemptLoginAtAuthenticatesUsers($request)) {
76-
return $this->attempLoginUsingUsernameAsAnEmail($request);
77-
}
78-
79-
return false;
80-
}
81-
82-
/**
83-
* Attempt to log the user into application using username as an email.
84-
*
85-
* @param \Illuminate\Http\Request $request
86-
*
87-
* @return bool
88-
*/
89-
protected function attempLoginUsingUsernameAsAnEmail(Request $request)
90-
{
91-
return $this->guard()->attempt(
92-
['email' => $request->input('username'), 'password' => $request->input('password')],
93-
$request->has('remember')
94-
);
35+
$this->middleware('guest')->except('logout');
9536
}
9637
}

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ class RegisterController extends Controller
2525

2626
use RegistersUsers;
2727

28-
/**
29-
* Show the application registration form.
30-
*
31-
* @return \Illuminate\Http\Response
32-
*/
33-
public function showRegistrationForm()
34-
{
35-
return view('adminlte::auth.register');
36-
}
37-
3828
/**
3929
* Where to redirect users after login / registration.
4030
*

0 commit comments

Comments
 (0)