diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 30b7e0d..018c49d 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -19,6 +19,8 @@ class CreateUsersTable extends Migration $table->string('email')->unique()->nullable(); $table->timestamp('email_verified_at')->nullable(); $table->foreignId('grupo_de_compra_id')->nullable(); + $table->boolean('is_admin'); + $table->unique(['name', 'is_admin']); $table->string('password'); $table->rememberToken(); $table->timestamps(); diff --git a/database/seeds/GrupoDeCompraSeeder.php b/database/seeds/GrupoDeCompraSeeder.php index c76a22d..a2d80ad 100644 --- a/database/seeds/GrupoDeCompraSeeder.php +++ b/database/seeds/GrupoDeCompraSeeder.php @@ -32,6 +32,14 @@ class GrupoDeCompraSeeder extends Seeder $usersToInsert[] = [ 'name' => $registro['barrio'], 'password' => Hash::make($registro['barrio']), + "is_admin" => 0, + 'grupo_de_compra_id' => $key + ]; + + $usersToInsert[] = [ + 'name' => $registro['barrio'] . "_admin", + 'password' => Hash::make("admin"), + "is_admin" => 1, 'grupo_de_compra_id' => $key ]; } diff --git a/public/js/login.js b/public/js/login.js index 783b064..3aa8b6b 100644 --- a/public/js/login.js +++ b/public/js/login.js @@ -109,6 +109,37 @@ Vue.component('login', { } }); +Vue.component('admin-login', { + template: ` +
+
+ +

+ +

+

Si no la sabés, consultá a la comisión de informática.

+
+
+
+ + +
+
+
`, + data() { + return { + visible: false, + gdc: null + } + }, + mounted() { + Event.$on('gdc-seleccionado', (gdc) => { + this.gdc = gdc; + this.visible = true; + }); + } +}); + new Vue({ el: '#root' }); \ No newline at end of file diff --git a/resources/views/auth/admin_login.blade.php b/resources/views/auth/admin_login.blade.php new file mode 100644 index 0000000..cdd8ee1 --- /dev/null +++ b/resources/views/auth/admin_login.blade.php @@ -0,0 +1,53 @@ + + + + + + {{ config('app.name', 'Compras del MPS') }} + + + + + + +
+ +
+
+

+ Ingresar como admin +

+

+ Ingresa aquí para aprobar los pedidos de tus compas del barrio una vez que te hayan transferido el pago. +

+ @error('name') +
+ Contraseña incorrecta, intentalo nuevamente. +
+ @enderror + +
+ @csrf + + +
+
+
+
+ + + + + diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index d06446a..53f085c 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -4,29 +4,46 @@ {{ config('app.name', 'Compras del MPS') }} + -
-
-

- Compras MPS -

-

- Bienvenidx a la aplicación de compras del Mercado Popular de Subsistencia -

- @error('name') -
- Contraseña incorrecta, intentalo nuevamente. + +
+ +
+
+

+ Canasta 78 - JUNIO +

+

+ Bienvenidx a la aplicación de compras del Mercado Popular de Subsistencia +

+ @error('name') +
+ Contraseña incorrecta, intentalo nuevamente. +
+ @enderror + +
+ @csrf + + +
+
diff --git a/routes/web.php b/routes/web.php index 9251cf0..de36776 100644 --- a/routes/web.php +++ b/routes/web.php @@ -53,3 +53,7 @@ Route::middleware('auth')->group( function() { })->name('obtenerSesion'); }); }); + +Route::get('/admin-login', function() { + return view("auth/admin_login"); +});