Compare commits
36 Commits
13320628ae
...
develop
Author | SHA1 | Date | |
---|---|---|---|
c3ce84143f | |||
6e3418402c | |||
e378054972 | |||
450819f6b4 | |||
c65cc00a9e | |||
42f193efc1 | |||
ac19b02797 | |||
7aa3546e0a | |||
5c538f8e93 | |||
a9750631c2 | |||
ade2ebcfc2 | |||
0c0724aacf | |||
6cbc4b4763 | |||
c1d4046c93 | |||
cc566d4a39 | |||
2833e58bef | |||
4923c6c67d | |||
5864efd24f | |||
080ed4553e | |||
2d2eccb600 | |||
84e6808883 | |||
26bd5207f3 | |||
cb08e0af64 | |||
5510766ecb | |||
bec6882d27 | |||
243697a054 | |||
0e5e34cd5f | |||
4796639b2e | |||
88df2f547a | |||
cf7538913a | |||
3d270b1e8d | |||
6744b8aa90 | |||
079ccdf0b9 | |||
ba438e540e | |||
b7f0ffe682 | |||
08cf6df8fc |
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@ composer.lock
|
||||
# Uploads
|
||||
/public/uploads/
|
||||
/resources/data/
|
||||
/public/assets/images/*/
|
||||
|
@ -37,7 +37,7 @@ foreach ($files as $file) {
|
||||
$container = $builder->build();
|
||||
$container->set('env', $__environment);
|
||||
$app = Bridge::create($container);
|
||||
$app->setBasePath($container->get('base_url'));
|
||||
$app->setBasePath($container->get('urls.base'));
|
||||
|
||||
foreach ($folders as $folder) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
|
@ -1,3 +0,0 @@
|
||||
<?php
|
||||
// Global visit counter
|
||||
//$app->add(new ProVM\KI\Common\Middleware\Visits($app->getContainer()->get('file.visits'), $app->getContainer()->get('visits.time')));
|
@ -39,7 +39,8 @@ return [
|
||||
],
|
||||
'scripts' => [
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/semantic.min.js'
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/semantic.min.js',
|
||||
'https://cdn.jsdelivr.net/npm/jquery.marquee@1.5.0/jquery.marquee.min.js'
|
||||
]
|
||||
];
|
||||
},
|
||||
@ -51,8 +52,32 @@ return [
|
||||
$file = json_decode(trim(file_get_contents($filename)));
|
||||
return $file->visits;
|
||||
},
|
||||
Slim\Views\Blade::class => function(Container $c) {
|
||||
return new Slim\Views\Blade(
|
||||
'segmentos' => function(Container $c) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$c->get('folders.data'),
|
||||
'segmentos.json'
|
||||
]);
|
||||
$segmentos = json_decode(trim(file_get_contents($filename)));
|
||||
return $segmentos;
|
||||
},
|
||||
'email' => function(Container $c) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$c->get('folders.data'),
|
||||
'emails.json'
|
||||
]);
|
||||
$emails = json_decode(trim(file_get_contents($filename)));
|
||||
return $emails->settings;
|
||||
},
|
||||
'emails' => function(Container $c) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$c->get('folders.data'),
|
||||
'emails.json'
|
||||
]);
|
||||
$emails = json_decode(trim(file_get_contents($filename)));
|
||||
return $emails->emails;
|
||||
},
|
||||
ProVM\KI\Common\Alias\View::class => function(Container $c) {
|
||||
return new ProVM\KI\Common\Implementation\View(
|
||||
$c->get('folders.templates'),
|
||||
$c->get('folders.cache'),
|
||||
null,
|
||||
@ -63,7 +88,10 @@ return [
|
||||
'header' => (object) [
|
||||
'fecha' => ucwords(Carbon::today()->locale('es')->isoFormat('D MMMM YYYY')),
|
||||
'hora' => Carbon::now()->format('H:i a'),
|
||||
'uf' => $c->get('ProVM\KI\Common\Service\Indicadores')->get('uf', Carbon::today())->valor
|
||||
'uf' => $c->get('ProVM\KI\Common\Service\Indicadores')->get('uf', Carbon::today())->valor,
|
||||
'menu' => (object) [
|
||||
'segmentos' => $c->get('segmentos')
|
||||
]
|
||||
],
|
||||
'footer' => (object) [
|
||||
'visitas' => $c->get('visitas')
|
||||
@ -73,5 +101,24 @@ return [
|
||||
},
|
||||
ProVM\KI\Common\Service\Indicadores::class => function(Container $c) {
|
||||
return new ProVM\KI\Common\Service\Indicadores($c->get('urls.indicadores'));
|
||||
},
|
||||
ProVM\Common\Factory\Model::class => function(Container $c) {
|
||||
return new ProVM\Common\Factory\Model(
|
||||
$c->get('folders.data'),
|
||||
$c->get('folders.public')
|
||||
);
|
||||
},
|
||||
ProVM\KI\Common\Alias\Message::class => function(Container $c) {
|
||||
return new ProVM\KI\Common\Implementation\Message();
|
||||
},
|
||||
ProVM\KI\Common\Alias\Mailer::class => function(Container $c) {
|
||||
return new ProVM\KI\Common\Implementation\Mailer([
|
||||
'host' => $c->get('email')->host->name,
|
||||
'username' => $c->get('email')->user->name,
|
||||
'password' => $c->get('email')->user->password
|
||||
]);
|
||||
},
|
||||
Psr\Log\LoggerInterface::class => function(Container $c) {
|
||||
return new ProVM\Common\Implementation\Logger(implode(DIRECTORY_SEPARATOR, [$c->get('folders.base'), 'admin.log']));
|
||||
}
|
||||
];
|
||||
|
6
common/Alias/Mailer.php
Normal file
6
common/Alias/Mailer.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Common\Alias;
|
||||
|
||||
interface Mailer {
|
||||
public function send(Message $message): bool;
|
||||
}
|
4
common/Alias/Message.php
Normal file
4
common/Alias/Message.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Common\Alias;
|
||||
|
||||
interface Message {}
|
9
common/Alias/View.php
Normal file
9
common/Alias/View.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Common\Alias;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
|
||||
interface View {
|
||||
public function render(Response $response, $template, array $data = []);
|
||||
public function fetch($template, array $data = []);
|
||||
}
|
@ -4,7 +4,7 @@ namespace ProVM\KI\Common\Controller\Web\Admin;
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use ProVM\KI\Common\Alias\View;
|
||||
|
||||
class Faq {
|
||||
public function __invoke(Request $request, Response $response, View $view, Container $container) {
|
||||
|
@ -4,7 +4,7 @@ namespace ProVM\KI\Common\Controller\Web\Admin;
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use ProVM\KI\Common\Alias\View;
|
||||
|
||||
class Home {
|
||||
public function __invoke(Request $request, Response $response, View $view, Container $container): Response {
|
||||
@ -29,7 +29,7 @@ class Home {
|
||||
$avisos = json_decode(trim(file_get_contents($filename)));
|
||||
|
||||
if (isset($post['estado'])) {
|
||||
$avisos->activo = (bool) $post['estado'];
|
||||
$avisos->activo = ($post['estado'] !== 'false');
|
||||
} else {
|
||||
$aviso = (object) [
|
||||
'titulo' => '',
|
||||
|
@ -4,7 +4,8 @@ namespace ProVM\KI\Common\Controller\Web\Admin;
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use Psr\Log\LoggerInterface as Logger;
|
||||
use ProVM\KI\Common\Alias\View;
|
||||
|
||||
class Nosotros {
|
||||
public function __invoke(Request $request, Response $response, View $view, Container $container) {
|
||||
@ -15,19 +16,30 @@ class Nosotros {
|
||||
$nosotros = trim(json_decode(trim(file_get_contents($filename))));
|
||||
return $view->render($response, 'admin.nosotros', compact('nosotros'));
|
||||
}
|
||||
public function guardar(Request $request, Response $response, Container $container) {
|
||||
public function guardar(Request $request, Response $response, Container $container, Logger $logger) {
|
||||
$logger->info('Llamado a guardar en Nosotros.');
|
||||
$post = $request->getParsedBody();
|
||||
$logger->info('Información en post:', compact('post'));
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'nosotros.json'
|
||||
]);
|
||||
$nosotros = trim(json_decode(trim(file_get_contents($filename))));
|
||||
$logger->info('Contenido de nosotros.json', compact('nosotros'));
|
||||
$data = trim(json_decode(json_encode($post['nosotros'])));
|
||||
|
||||
$status = false;
|
||||
if ($nosotros != $data) {
|
||||
$status = (file_put_contents($filename, json_encode($post['nosotros'])) !== false);
|
||||
if ($status) {
|
||||
$logger->info('Guardados los cambios en nosotros.json');
|
||||
} else {
|
||||
$logger->notice('No se pudo guardar los cambios en nosotros.json');
|
||||
}
|
||||
} else {
|
||||
$logger->info('No se han hecho cambios en nosotros.');
|
||||
}
|
||||
|
||||
$code = 301;
|
||||
if ($status) {
|
||||
$code = 302;
|
||||
|
@ -4,120 +4,42 @@ namespace ProVM\KI\Common\Controller\Web\Admin;
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use ProVM\KI\Common\Alias\View;
|
||||
use Carbon\Carbon;
|
||||
use ProVM\Common\Factory\Model as ModelFactory;
|
||||
use ProVM\KI\Producto;
|
||||
|
||||
class Productos {
|
||||
public function __invoke(Request $request, Response $response, View $view, Container $container): Response {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
]);
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
public function __invoke(Request $request, Response $response, View $view, ModelFactory $factory): Response {
|
||||
$productos = $factory->find(Producto::class)->many();
|
||||
return $view->render($response, 'admin.productos', compact('productos'));
|
||||
}
|
||||
public function edit(Request $request, Response $response, View $view, Container $container, $producto): Response {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
]);
|
||||
$id = $producto;
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
$producto = $productos[$producto];
|
||||
$producto->id = $id;
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'destacados.json'
|
||||
]);
|
||||
$destacados = json_decode(trim(file_get_contents($filename)));
|
||||
$destacado = false;
|
||||
if (array_search($id, $destacados) !== false) {
|
||||
$destacado = true;
|
||||
}
|
||||
$producto->destacado = $destacado;
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.public'),
|
||||
'assets',
|
||||
'images',
|
||||
mb_strtolower($producto->nombre)
|
||||
]);
|
||||
$producto->images = [];
|
||||
if (file_exists($folder)) {
|
||||
$files = new \DirectoryIterator($folder);
|
||||
foreach ($files as $file) {
|
||||
if ($file->isDir()) {
|
||||
continue;
|
||||
}
|
||||
$producto->images []= $file->getFilename();
|
||||
}
|
||||
}
|
||||
public function edit(Request $request, Response $response, View $view, Container $container, ModelFactory $factory, $producto): Response {
|
||||
$producto = $factory->find(Producto::class)->where([['id', $producto]])->one();
|
||||
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'segmentos.json'
|
||||
]);
|
||||
$segmentos = json_decode(trim(file_get_contents($filename)));
|
||||
return $view->render($response, 'admin.producto', compact('producto', 'segmentos'));
|
||||
$properties = $producto->getProperties();
|
||||
return $view->render($response, 'admin.producto', compact('producto', 'segmentos', 'properties'));
|
||||
}
|
||||
public function do_edit(Request $request, Response $response, Container $container, $producto): Response {
|
||||
public function do_edit(Request $request, Response $response, Container $container, ModelFactory $factory, $producto): Response {
|
||||
$post = $request->getParsedBody();
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
$producto = $factory->find(Producto::class)->where([['id', $producto]])->one();
|
||||
|
||||
$f = Carbon::today();
|
||||
$post['publicacion'] = $producto->publicacion ?? implode(' ', [
|
||||
$f->day,
|
||||
'de',
|
||||
ucfirst($f->locale('es')->isoFormat('MMMM')) . ',',
|
||||
$f->year
|
||||
]);
|
||||
$id = $producto;
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
$producto = $productos[$producto];
|
||||
$changed = false;
|
||||
$post['id'] = $producto->id;
|
||||
$producto->map((object) $post);
|
||||
|
||||
$fields = ['nombre', 'segmento', 'direccion', 'comuna', 'ciudad', 'bono', 'rentabilidad', 'estado',
|
||||
'cuota', 'unidades', 'modelos', 'descripcion', 'entrega'];
|
||||
foreach ($fields as $field) {
|
||||
if (!isset($producto->$field) or $post[$field] != $producto->$field) {
|
||||
$producto->$field = $post[$field];
|
||||
$changed = true;
|
||||
}
|
||||
}
|
||||
$valor = number_format($post['valor'], 0, ',', '.');
|
||||
if (!isset($producto->valor) or $producto->valor != $valor) {
|
||||
$producto->valor = $valor;
|
||||
$changed = true;
|
||||
}
|
||||
$tamaño = $post['tamaño_min'] . ' - ' . $post['tamaño_max'] . ' m²';
|
||||
if (!isset($producto->tamaño) or $producto->tamaño != $tamaño) {
|
||||
$producto->tamaño = $tamaño;
|
||||
$changed = true;
|
||||
}
|
||||
|
||||
$status1 = false;
|
||||
if ($changed) {
|
||||
$productos[$id] = $producto;
|
||||
$status1 = (file_put_contents($filename, json_encode($productos, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES)) !== false);
|
||||
}
|
||||
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'destacados.json'
|
||||
]);
|
||||
$destacados = json_decode(trim(file_get_contents($filename)));
|
||||
$changed = false;
|
||||
if (isset($post['destacado']) and $post['destacado'] == 'on') {
|
||||
if (array_search($id, $destacados) === false) {
|
||||
$destacados []= $id;
|
||||
sort($destacados);
|
||||
$changed = true;
|
||||
}
|
||||
} else {
|
||||
if (($i = array_search($id, $destacados)) !== false) {
|
||||
unset($destacados[$i]);
|
||||
$destacados = array_values($destacados);
|
||||
$changed = true;
|
||||
}
|
||||
}
|
||||
$status2 = false;
|
||||
if ($changed) {
|
||||
$status2 = (file_put_contents($filename, json_encode($destacados)) !== false);
|
||||
}
|
||||
$producto->save();
|
||||
|
||||
return $response
|
||||
->withHeader('Location', implode('/', [$container->get('urls')->admin, 'productos']));
|
||||
@ -130,82 +52,30 @@ class Productos {
|
||||
$segmentos = json_decode(trim(file_get_contents($filename)));
|
||||
return $view->render($response, 'admin.productos.add', compact('segmentos'));
|
||||
}
|
||||
public function do_add(Request $request, Response $response, Container $container): Response {
|
||||
public function do_add(Request $request, Response $response, Container $container, ModelFactory $factory): Response {
|
||||
$post = $request->getParsedBody();
|
||||
|
||||
$producto = (object) [];
|
||||
$fields = ['nombre', 'segmento', 'direccion', 'comuna', 'ciudad', 'bono', 'rentabilidad', 'estado',
|
||||
'cuota', 'unidades', 'modelos', 'descripcion', 'entrega'];
|
||||
foreach ($fields as $field) {
|
||||
$producto->$field = $post[$field];
|
||||
}
|
||||
$valor = number_format($post['valor'], 0, ',', '.');
|
||||
$producto->valor = $valor;
|
||||
$tamaño = $post['tamaño_min'] . ' - ' . $post['tamaño_max'] . ' m²';
|
||||
$producto->tamaño = $tamaño;
|
||||
|
||||
$f = Carbon::today();
|
||||
$producto->publicacion = implode(' ', [
|
||||
$post['publicacion'] = implode(' ', [
|
||||
$f->day,
|
||||
'de',
|
||||
ucfirst($f->locale('es')->isoFormat('MMMM')) . ',',
|
||||
$f->year
|
||||
]);
|
||||
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
]);
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
$productos []= $producto;
|
||||
file_put_contents($filename, json_encode($productos, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES));
|
||||
|
||||
$producto = $factory->create(Producto::class, (object) $post);
|
||||
if (isset($post['destacado']) and $post['destacado'] == 'on') {
|
||||
$id = count($productos) - 1;
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'destacados.json'
|
||||
]);
|
||||
$destacados = json_decode(trim(file_get_contents($filename)));
|
||||
$destacados []= $id;
|
||||
sort($destacados);
|
||||
file_put_contents($filename, json_encode($destacados));
|
||||
$producto->destacado(true);
|
||||
}
|
||||
$producto->save();
|
||||
|
||||
return $response
|
||||
->withHeader('Location', implode('/', [$container->get('urls')->admin, 'productos']));
|
||||
}
|
||||
public function delete(Request $request, Response $response, Container $container): Response {
|
||||
public function delete(Request $request, Response $response, ModelFactory $factory): Response {
|
||||
$post = $request->getParsedBody();
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
]);
|
||||
$id = $post['id'];
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
$producto = $productos[$id];
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.public'),
|
||||
'assets',
|
||||
'images',
|
||||
mb_strtolower($producto->nombre)
|
||||
]);
|
||||
unset($productos[$id]);
|
||||
$status = false;
|
||||
$status |= (file_put_contents($filename, json_encode($productos, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES)) !== false);
|
||||
if (file_exists($folder)) {
|
||||
$status |= rmdir($folder);
|
||||
}
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'destacados.json'
|
||||
]);
|
||||
$destacados = json_decode(trim(file_get_contents($filename)));
|
||||
if (($i = array_search($id, $destacados)) !== false) {
|
||||
unset($destacados[$i]);
|
||||
$destacados = array_values($destacados);
|
||||
$status |= (file_put_contents($filename, json_encode($destacados)) !== false);
|
||||
}
|
||||
$producto = $factory->find(Producto::class)->where([['id', $post['id']]])->one();
|
||||
$status = $producto->delete();
|
||||
|
||||
$output = [
|
||||
'information' => $post,
|
||||
'estado' => $status
|
||||
@ -215,35 +85,16 @@ class Productos {
|
||||
->withHeader('Content-Type', 'application/json')
|
||||
->withStatus(201);
|
||||
}
|
||||
public function add_image(Request $request, Response $response, Container $container, $producto): Response {
|
||||
public function add_image(Request $request, Response $response, ModelFactory $factory, $producto): Response {
|
||||
$post = $request->getParsedBody();
|
||||
$files = $request->getUploadedFiles();
|
||||
$file = $files['imagen'];
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
]);
|
||||
$id = $producto;
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
$producto = $productos[$producto];
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.public'),
|
||||
'assets',
|
||||
'images',
|
||||
mb_strtolower($producto->nombre)
|
||||
]);
|
||||
if (!file_exists($folder)) {
|
||||
mkdir($folder);
|
||||
}
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$folder,
|
||||
$file->getClientFilename()
|
||||
]);
|
||||
$file->moveTo($filename);
|
||||
$producto = $factory->find(Producto::class)->where([['id', $producto]])->one();
|
||||
$status = $producto->addImagen($file);
|
||||
|
||||
$output = [
|
||||
'informacion' => $id,
|
||||
'estado' => file_exists($filename)
|
||||
'informacion' => $producto->id,
|
||||
'estado' => $status
|
||||
];
|
||||
$response->getBody()->write(json_encode($output));
|
||||
return $response
|
||||
@ -262,26 +113,10 @@ class Productos {
|
||||
mb_strtolower($producto->nombre)
|
||||
]);
|
||||
}
|
||||
public function delete_image(Request $request, Response $response, Container $container, $producto): Response {
|
||||
public function delete_image(Request $request, Response $response, ModelFactory $factory, $producto): Response {
|
||||
$post = $request->getParsedBody();
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
]);
|
||||
$id = $producto;
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
$producto = $productos[$producto];
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.public'),
|
||||
'assets',
|
||||
'images',
|
||||
mb_strtolower($producto->nombre)
|
||||
]);
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$folder,
|
||||
$post['imagen']
|
||||
]);
|
||||
$status = unlink($filename);
|
||||
$producto = $factory->find(Producto::class)->where([['id', $producto]])->one();
|
||||
$status = $producto->deleteImagen($post['imagen']);
|
||||
|
||||
$output = [
|
||||
'estado' => $status
|
||||
@ -299,5 +134,26 @@ class Productos {
|
||||
'images',
|
||||
mb_strtolower($producto->nombre)
|
||||
]);
|
||||
return $response;
|
||||
}
|
||||
public function fields(Request $request, Response $response): Response {
|
||||
$post = $request->getParsedBody();
|
||||
$class = implode("\\", [
|
||||
'ProVM',
|
||||
'KI',
|
||||
'Productos',
|
||||
rtrim($post['segmento'], 's')
|
||||
]);
|
||||
$obj = new $class;
|
||||
$properties = $obj->getProperties();
|
||||
|
||||
$output = [
|
||||
'information' => $post,
|
||||
'fields' => $properties
|
||||
];
|
||||
$response->getBody()->write(json_encode($output, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
|
||||
return $response
|
||||
->withHeader('Content-Type', 'application/json')
|
||||
->withStatus(201);
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ namespace ProVM\KI\Common\Controller\Web;
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use Carbon\Carbon;
|
||||
use ProVM\KI\Common\Alias\View;
|
||||
|
||||
class Base {
|
||||
public function __invoke(Request $request, Response $response, View $view, Container $container) {
|
||||
@ -37,6 +37,6 @@ class Base {
|
||||
]);
|
||||
$resumen = json_decode(trim(file_get_contents($filename)));
|
||||
$indicadores = ['uf' => 'UF', 'euro' => 'Euro', 'imacec' => 'IMACEC', 'dolar' => 'USD', 'ipc' => 'IPC', 'utm' => 'UTM', 'bitcoin' => 'BitCoin', 'libra_cobre' => 'Lb. Cu'];
|
||||
return $view->render($response, 'home', compact('aviso', 'avisos', 'destacados', 'segmentos', 'resumen', 'indicadores'));
|
||||
return $view->render($response, 'home', compact('avisos', 'destacados', 'segmentos', 'resumen', 'indicadores'));
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,63 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Common\Controller\Web;
|
||||
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use ProVM\KI\Common\Alias\Message;
|
||||
use ProVM\KI\Common\Alias\Mailer;
|
||||
use ProVM\KI\Common\Alias\View;
|
||||
|
||||
class Contacto {
|
||||
public function __invoke(Request $request, Response $response, View $view) {
|
||||
public function __invoke(Request $request, Response $response, View $view): Response {
|
||||
return $view->render($response, 'contacto');
|
||||
}
|
||||
public function enviar(Request $request, Response $response, Container $container, Mailer $mailer): Response {
|
||||
$post = $request->getParsedBody();
|
||||
$body = [];
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.templates'),
|
||||
'contacto',
|
||||
'email.php'
|
||||
]);
|
||||
$html = file_get_contents($filename);
|
||||
foreach ($post as $key => $val) {
|
||||
$body []= ucwords($key) . ': ' . $val;
|
||||
$html = str_replace('{{$' . $key . '}}', $val, $html);
|
||||
}
|
||||
$body = implode(PHP_EOL, $body);
|
||||
$subject = 'Contacto Web - ' . $post['nombre'];
|
||||
|
||||
$message = $container->make(Message::class)
|
||||
->setFrom($container->get('emails')[0])
|
||||
->addTo($container->get('emails')[0])
|
||||
->addCc($container->get('emails')[1])
|
||||
->setSubject($subject)
|
||||
->setBody($body)
|
||||
->setHTMLBody($html);
|
||||
$status = $mailer->send($message);
|
||||
$message = $container->make(Message::class)
|
||||
->setFrom($container->get('emails')[0])
|
||||
->addTo($post['mail'], $post['nombre'])
|
||||
->setSubject($subject)
|
||||
->setBody('Su correo a CapitalInvestments ha sido recibido.');
|
||||
$mailer->send($message);
|
||||
|
||||
$output = [
|
||||
'informacion' => $post,
|
||||
'estado' => $status,
|
||||
'mail' => [
|
||||
'from' => $post['mail'],
|
||||
'to' => $container->get('emails')[0],
|
||||
'cc' => $container->get('emails')[1],
|
||||
'asunto' => $subject,
|
||||
'mensaje' => $body,
|
||||
'html' => $html
|
||||
]
|
||||
];
|
||||
$response->getBody()->write(json_encode($output));
|
||||
return $response
|
||||
->withHeader('Content-Type', 'application/json')
|
||||
->withStatus(201);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace ProVM\KI\Common\Controller\Web;
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use ProVM\KI\Common\Alias\View;
|
||||
|
||||
class Faq {
|
||||
public function __invoke(Request $request, Response $response, View $view, Container $container) {
|
||||
|
@ -4,7 +4,7 @@ namespace ProVM\KI\Common\Controller\Web;
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use ProVM\KI\Common\Alias\View;
|
||||
|
||||
class Nosotros {
|
||||
public function __invoke(Request $request, Response $response, View $view, Container $container) {
|
||||
@ -13,7 +13,22 @@ class Nosotros {
|
||||
'nosotros.json'
|
||||
]);
|
||||
$nosotros = json_decode(trim(file_get_contents($filename)));
|
||||
$nosotros = $this->str_split_unicode($nosotros, strlen($nosotros) / 2, '-');
|
||||
$min = 200;
|
||||
$max_phrase = 50;
|
||||
if (strlen($nosotros) > $min) {
|
||||
$half = strlen($nosotros) / 2;
|
||||
$pos = mb_strpos($nosotros, '.', $half); // Siguiente punto despues de la mitad
|
||||
if ($pos > $half + $max_phrase) { // Si está muy lejos de la mitad busca otra posicion
|
||||
$pos = mb_strrpos($nosotros, '.', -$half) + 1; // Punto antes de la mitad
|
||||
}
|
||||
$nosotros = $this->str_split_unicode($nosotros, $pos);
|
||||
if (count($nosotros) > 2) {
|
||||
$s1 = array_shift($nosotros);
|
||||
$nosotros = [$s1, implode('', $nosotros)];
|
||||
}
|
||||
} else {
|
||||
$nosotros = [$nosotros];
|
||||
}
|
||||
return $view->render($response, 'nosotros', compact('nosotros'));
|
||||
}
|
||||
protected function str_split_unicode($str, $l = 0) {
|
||||
|
@ -4,7 +4,9 @@ namespace ProVM\KI\Common\Controller\Web;
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use ProVM\KI\Common\Alias\View;
|
||||
use ProVM\Common\Factory\Model as ModelFactory;
|
||||
use ProVM\KI\Producto;
|
||||
|
||||
class Productos {
|
||||
public function __invoke(Request $request, Response $response, Container $container, View $view): Response {
|
||||
@ -15,59 +17,23 @@ class Productos {
|
||||
$segmentos = json_decode(trim(file_get_contents($filename)));
|
||||
return $view->render($response, 'productos.list', compact('segmentos'));
|
||||
}
|
||||
public function show(Request $request, Response $response, Container $container, View $view, $producto): Response {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
]);
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'destacados.json'
|
||||
]);
|
||||
$destacados = json_decode(trim(file_get_contents($filename)));
|
||||
$destacado = false;
|
||||
if (array_search($producto, $destacados) !== false) {
|
||||
$destacado = true;
|
||||
}
|
||||
$id = $producto;
|
||||
$producto = $productos[$producto];
|
||||
$producto->destacado = $destacado;
|
||||
$producto->id = $id;
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.public'),
|
||||
'assets',
|
||||
'images',
|
||||
mb_strtolower($producto->nombre)
|
||||
]);
|
||||
$producto->images = [];
|
||||
if (file_exists($folder)) {
|
||||
$files = new \DirectoryIterator($folder);
|
||||
foreach ($files as $file) {
|
||||
if ($file->isDir()) {
|
||||
continue;
|
||||
}
|
||||
$producto->images []= $file->getFilename();
|
||||
}
|
||||
}
|
||||
public function show(Request $request, Response $response, View $view, ModelFactory $factory, $producto): Response {
|
||||
$producto = $factory->find(Producto::class)->where([['id', $producto]])->one();
|
||||
return $view->render($response, 'productos.show', compact('producto'));
|
||||
}
|
||||
public function segmento(Request $request, Response $response, Container $container, $segmento): Response {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
]);
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
public function segmento(Request $request, Response $response, ModelFactory $factory, $segmento): Response {
|
||||
$productos = $factory->find(Producto::class);
|
||||
if ($segmento != 'todo') {
|
||||
$productos = array_filter($productos, function($item) use ($segmento) {
|
||||
return (str_replace(' ', '_', mb_strtolower($item->segmento)) == $segmento);
|
||||
});
|
||||
$productos = $productos->where([['segmento', ucwords($segmento)]]);
|
||||
}
|
||||
$productos = $productos->many();
|
||||
$output = [
|
||||
'information' => [
|
||||
'segmento' => $segmento
|
||||
],
|
||||
'productos' => array_keys($productos)
|
||||
'productos' => array_map(function($item) {
|
||||
return $item->id;
|
||||
}, $productos)
|
||||
];
|
||||
$response->getBody()->write(json_encode($output));
|
||||
return $response
|
||||
@ -87,7 +53,8 @@ class Productos {
|
||||
],
|
||||
'destacados' => []
|
||||
];
|
||||
for ($i = ($page - 1) * 4; $i < $page * 4; $i ++) {
|
||||
$n = min(4, count($destacados));
|
||||
for ($i = ($page - 1) * $n; $i < $page * $n; $i ++) {
|
||||
$output['destacados'] []= $destacados[$i];
|
||||
}
|
||||
$response->getBody()->write(json_encode($output));
|
||||
@ -95,42 +62,9 @@ class Productos {
|
||||
->withHeader('Content-Type', 'application/json')
|
||||
->withStatus(201);
|
||||
}
|
||||
public function ficha(Request $request, Response $response, Container $container, View $view, $producto): Response {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'productos.json'
|
||||
]);
|
||||
$productos = json_decode(trim(file_get_contents($filename)));
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.data'),
|
||||
'destacados.json'
|
||||
]);
|
||||
$destacados = json_decode(trim(file_get_contents($filename)));
|
||||
$destacado = false;
|
||||
if (array_search($producto, $destacados) !== false) {
|
||||
$destacado = true;
|
||||
}
|
||||
$id = $producto;
|
||||
$producto = $productos[$producto];
|
||||
$producto->destacado = $destacado;
|
||||
$producto->id = $id;
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.public'),
|
||||
'assets',
|
||||
'images',
|
||||
mb_strtolower($producto->nombre)
|
||||
]);
|
||||
$producto->imagen = 'default.jpg';
|
||||
if (file_exists($folder)) {
|
||||
$files = new \DirectoryIterator($folder);
|
||||
foreach ($files as $file) {
|
||||
if ($file->isDir()) {
|
||||
continue;
|
||||
}
|
||||
$producto->imagen = implode('/', [mb_strtolower($producto->nombre), $file->getFilename()]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $view->render($response, 'productos.ficha', compact('producto'));
|
||||
public function ficha(Request $request, Response $response, View $view, ModelFactory $factory, $producto): Response {
|
||||
$producto = $factory->find(Producto::class)->where([['id', $producto]])->one();
|
||||
$properties = $producto->getFicha();
|
||||
return $view->render($response, 'productos.ficha', compact('producto', 'properties'));
|
||||
}
|
||||
}
|
||||
|
102
common/Implementation/Mailer.php
Normal file
102
common/Implementation/Mailer.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Common\Implementation;
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer as BaseMailer;
|
||||
use PHPMailer\PHPMailer\SMTP;
|
||||
use ProVM\KI\Common\Alias\Mailer as MailerInterface;
|
||||
use ProVM\KI\Common\Alias\Message;
|
||||
|
||||
class Mailer implements MailerInterface {
|
||||
protected $host;
|
||||
protected $port;
|
||||
protected $user;
|
||||
protected $is_secure = false;
|
||||
public function __construct(array $settings) {
|
||||
if (!isset($settings['host'])) {
|
||||
throw new \Exception('Host is missing in ' . get_called_class());
|
||||
}
|
||||
$this->host = $settings['host'];
|
||||
if (!isset($settings['username'])) {
|
||||
throw new \Exception('User name is missing in ' . get_called_class());
|
||||
}
|
||||
$this->user = (object) ['name' => null, 'password' => null];
|
||||
$this->user->name = $settings['username'];
|
||||
if (!isset($settings['password'])) {
|
||||
throw new \Exception('User password is missing in ' . get_called_class());
|
||||
}
|
||||
$this->user->password = $settings['password'];
|
||||
$this->port = 25;
|
||||
if (isset($settings['secure']) and $settings['secure'] == 'ssl') {
|
||||
$this->is_secure = true;
|
||||
$this->port = 465;
|
||||
}
|
||||
if (isset($settings['port'])) {
|
||||
$this->port = $settings['port'];
|
||||
}
|
||||
}
|
||||
public function isSecure(): bool {
|
||||
return $this->is_secure;
|
||||
}
|
||||
public function send(Message $message): bool {
|
||||
$mailer = new BaseMailer();
|
||||
$mailer->isSMTP();
|
||||
//$mailer->SMTPDebug = SMTP::DEBUG_SERVER;
|
||||
$mailer->Host = $this->host;
|
||||
$mailer->SMTPAuth = true;
|
||||
$mailer->Username = $this->user->name;
|
||||
$mailer->Password = $this->user->password;
|
||||
$mailer->Port = $this->port;
|
||||
if ($this->isSecure()) {
|
||||
$mailer->SMTPSecure = BaseMailer::ENCRYPTION_STARTTLS;
|
||||
}
|
||||
|
||||
try {
|
||||
$from = $message->getFrom();
|
||||
if ($from->name !== null) {
|
||||
$mailer->setFrom($from->email, $from->name);
|
||||
} else {
|
||||
$mailer->setFrom($from->email);
|
||||
}
|
||||
foreach ($message->getTo() as $to) {
|
||||
if ($to->name !== null) {
|
||||
$mailer->addAddress($to->email, $to->name);
|
||||
} else {
|
||||
$mailer->addAddress($to->email);
|
||||
}
|
||||
}
|
||||
$ccs = $message->getCc();
|
||||
if (!empty($ccs)) {
|
||||
foreach ($ccs as $cc) {
|
||||
if ($cc->name !== null) {
|
||||
$mailer->addCC($cc->email, $cc->name);
|
||||
} else {
|
||||
$mailer->addCC($cc->email);
|
||||
}
|
||||
}
|
||||
}
|
||||
$bccs = $message->getBcc();
|
||||
if (!empty($bccs)) {
|
||||
foreach ($bccs as $bcc) {
|
||||
if ($bcc->name !== null) {
|
||||
$mailer->addBCC($bcc->email, $bcc->name);
|
||||
} else {
|
||||
$mailer->addBCC($bcc->email);
|
||||
}
|
||||
}
|
||||
}
|
||||
$mailer->Subject = $message->getSubject();
|
||||
if ($message->isHtml()) {
|
||||
$mailer->Body = $message->getHtmlBody();
|
||||
$mailer->isHTML();
|
||||
$mailer->AltBody = $message->getBody();
|
||||
} else {
|
||||
$mailer->Body = $message->getBody();
|
||||
}
|
||||
|
||||
$mailer->send();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
100
common/Implementation/Message.php
Normal file
100
common/Implementation/Message.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Common\Implementation;
|
||||
|
||||
use ProVM\KI\Common\Alias\Message as MessageInterface;
|
||||
|
||||
class Message implements MessageInterface {
|
||||
protected $from;
|
||||
public function setFrom(string $email, string $name = null): Message {
|
||||
$this->from = $this->formatEmail($email, $name);
|
||||
return $this;
|
||||
}
|
||||
public function getFrom() {
|
||||
return $this->from;
|
||||
}
|
||||
protected $reply_to;
|
||||
public function addReplyTo(string $email, string $name = null): Message {
|
||||
if ($this->reply_to === null) {
|
||||
$this->reply_to = [];
|
||||
}
|
||||
$this->reply_to []= $this->formatEmail($email, $name);
|
||||
return $this;
|
||||
}
|
||||
public function getReplyTo() {
|
||||
return $this->reply_to;
|
||||
}
|
||||
protected $subject;
|
||||
public function setSubject(string $subject): Message {
|
||||
$this->subject = $subject;
|
||||
return $this;
|
||||
}
|
||||
public function getSubject(): string {
|
||||
return $this->subject;
|
||||
}
|
||||
protected $to;
|
||||
public function addTo(string $email, string $name = null): Message {
|
||||
if ($this->to === null) {
|
||||
$this->to = [];
|
||||
}
|
||||
$this->to []= $this->formatEmail($email, $name);
|
||||
return $this;
|
||||
}
|
||||
public function getTo(): array {
|
||||
return $this->to;
|
||||
}
|
||||
protected $cc;
|
||||
public function addCc(string $email, string $name = null): Message {
|
||||
if ($this->cc === null) {
|
||||
$this->cc = [];
|
||||
}
|
||||
$this->cc []= $this->formatEmail($email, $name);
|
||||
return $this;
|
||||
}
|
||||
public function getCc() {
|
||||
return $this->cc;
|
||||
}
|
||||
protected $bcc;
|
||||
public function addBcc(string $email, string $name = null): Message {
|
||||
if ($this->bcc === null) {
|
||||
$this->bcc = [];
|
||||
}
|
||||
$this->bcc []= $this->formatEmail($email, $name);
|
||||
return $this;
|
||||
}
|
||||
public function getBcc() {
|
||||
return $this->bcc;
|
||||
}
|
||||
protected $body;
|
||||
public function setBody(string $body): Message {
|
||||
$this->body = $body;
|
||||
return $this;
|
||||
}
|
||||
public function getBody(): string {
|
||||
return $this->body;
|
||||
}
|
||||
protected $html;
|
||||
protected $is_html = false;
|
||||
public function setHtmlBody(string $body): Message {
|
||||
$this->html = $body;
|
||||
$this->is_html = true;
|
||||
return $this;
|
||||
}
|
||||
public function getHtmlBody(): string {
|
||||
return $this->html;
|
||||
}
|
||||
public function isHtml(): bool {
|
||||
return $this->is_html;
|
||||
}
|
||||
|
||||
protected function formatEmail(string $email, string $name = null) {
|
||||
if (!$name && preg_match('#^(.+) +<(.*)>$#D', $email, $matches)) {
|
||||
[, $name, $email] = $matches;
|
||||
$name = stripslashes($name);
|
||||
$tmp = substr($name, 1, -1);
|
||||
if ($name === '"' . $tmp . '"') {
|
||||
$name = $tmp;
|
||||
}
|
||||
}
|
||||
return (object) ['name' => $name, 'email' => $email];
|
||||
}
|
||||
}
|
7
common/Implementation/View.php
Normal file
7
common/Implementation/View.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Common\Implementation;
|
||||
|
||||
use Slim\Views\Blade as BaseView;
|
||||
use ProVM\KI\Common\Alias\View as ViewInterface;
|
||||
|
||||
class View extends BaseView implements ViewInterface {}
|
@ -9,12 +9,12 @@
|
||||
"nyholm/psr7": "^1.2",
|
||||
"nyholm/psr7-server": "^0.4.1",
|
||||
"nesbot/carbon": "^2.32",
|
||||
"guzzlehttp/guzzle": "^6.5"
|
||||
"guzzlehttp/guzzle": "^6.5",
|
||||
"phpmailer/phpmailer": "^6.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5",
|
||||
"kint-php/kint": "^3.3",
|
||||
"zeuxisoo/slim-whoops": "^0.7.2",
|
||||
"joshtronic/php-loremipsum": "^1.0"
|
||||
},
|
||||
"license": "UNLICENSED",
|
||||
@ -27,7 +27,8 @@
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ProVM\\KI\\Common\\": "common",
|
||||
"ProVM\\KI\\": "src"
|
||||
"ProVM\\KI\\": "src",
|
||||
"ProVM\\Common\\": "provm/common"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
163
provm/common/Factory/Model.php
Normal file
163
provm/common/Factory/Model.php
Normal file
@ -0,0 +1,163 @@
|
||||
<?php
|
||||
namespace ProVM\Common\Factory;
|
||||
|
||||
use ProVM\Common\Implementation\Model as BaseModel;
|
||||
|
||||
class Model {
|
||||
protected $data_folder;
|
||||
protected $image_folder;
|
||||
public function __construct(string $data_folder, string $image_folder) {
|
||||
$this->data_folder = $data_folder;
|
||||
$this->image_folder = $image_folder;
|
||||
}
|
||||
|
||||
public function getFolder(): string {
|
||||
return $this->data_folder;
|
||||
}
|
||||
public function get($file) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$this->data_folder,
|
||||
$file
|
||||
]);
|
||||
return json_decode(trim(file_get_contents($filename)));
|
||||
}
|
||||
protected function reset() {
|
||||
$this->class = null;
|
||||
$this->conditions = null;
|
||||
$this->limits = null;
|
||||
}
|
||||
protected $class;
|
||||
public function find(string $class): Model {
|
||||
if (!class_exists($class) or !is_subclass_of($class, \ProVM\Common\Implementation\Model::class)) {
|
||||
throw new \InvalidArgumentException($class . ' is not defined.');
|
||||
}
|
||||
$this->reset();
|
||||
$this->class = $class;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* JSON
|
||||
* [
|
||||
* {
|
||||
* <field>,
|
||||
* <value>,
|
||||
* <operator>
|
||||
* },
|
||||
* ...
|
||||
* ]
|
||||
* @var array
|
||||
*/
|
||||
protected $conditions;
|
||||
public function where(array $conditions): Model {
|
||||
if ($this->conditions === null) {
|
||||
$this->conditions = [];
|
||||
}
|
||||
foreach ($conditions as $condition) {
|
||||
$c = ['field' => $condition[0], 'value' => $condition[1], 'operator' => '=='];
|
||||
if (isset($condition[2])) {
|
||||
$c['operator'] = $condition[2];
|
||||
}
|
||||
$this->conditions []= (object) $c;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
protected function parseWhere(array $data): array {
|
||||
if ($this->conditions === null) {
|
||||
return $data;
|
||||
}
|
||||
foreach ($this->conditions as $condition) {
|
||||
$str = implode(' ', [
|
||||
$condition->field,
|
||||
$condition->operator,
|
||||
(is_string($condition->value)) ? "'" . $condition->value . "'" : $condition->value
|
||||
]);
|
||||
return array_filter($data, function($item) use ($str) {
|
||||
$bool = true;
|
||||
eval("\$bool = (\$item->" . $str . ');');
|
||||
return $bool;
|
||||
});
|
||||
}
|
||||
}
|
||||
protected $limits;
|
||||
public function limit(int $limit): Model {
|
||||
if ($this->limits === null) {
|
||||
$this->limits = (object) ['limit' => null, 'offset' => 0];
|
||||
}
|
||||
$this->limits->limit = $limit;
|
||||
return $this;
|
||||
}
|
||||
public function offset(int $offset): Model {
|
||||
if ($this->limits === null) {
|
||||
$this->limits = (object) ['limit' => null, 'offset' => 0];
|
||||
}
|
||||
$this->limits->offset = $offset;
|
||||
return $this;
|
||||
}
|
||||
protected function parseLimits(array $data): array {
|
||||
if ($this->limits === null or $this->limits->limit === null) {
|
||||
return $data;
|
||||
}
|
||||
return array_slice($data, $this->limits->offset, $this->limits->limit);
|
||||
}
|
||||
protected function getFilename(): string {
|
||||
$data = explode("\\", $this->class);
|
||||
return implode(DIRECTORY_SEPARATOR, [
|
||||
$this->data_folder,
|
||||
str_replace(' ', '_', mb_strtolower(array_pop($data))) . 's.json'
|
||||
]);
|
||||
}
|
||||
protected function build(): array {
|
||||
$filename = $this->getFilename();
|
||||
$data = json_decode(trim(file_get_contents($filename)));
|
||||
$data = $this->parseWhere($data);
|
||||
$data = $this->parseLimits($data);
|
||||
return $data;
|
||||
}
|
||||
protected function fillObject($data): BaseModel {
|
||||
$class = $this->class;
|
||||
if (strpos($class, 'Producto') !== false) {
|
||||
$segmento = str_replace(' ', '', $data->segmento);
|
||||
$class = implode("\\", [
|
||||
$class . 's',
|
||||
rtrim($segmento, 's')
|
||||
]);
|
||||
}
|
||||
$obj = new $class;
|
||||
$obj->map($data);
|
||||
$obj->setFactory($this);
|
||||
$obj->setImageFolder($this->image_folder);
|
||||
return $obj;
|
||||
}
|
||||
public function one(): BaseModel {
|
||||
$data = $this->limit(1)->build();
|
||||
$item = $data[0];
|
||||
$obj = $this->fillObject($item);
|
||||
return $obj;
|
||||
}
|
||||
public function many(): array {
|
||||
$data = $this->build();
|
||||
foreach ($data as &$item) {
|
||||
$obj = $this->fillObject($item);
|
||||
$item = $obj;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function array(): array {
|
||||
return $this->build();
|
||||
}
|
||||
|
||||
public function create(string $class, $data) {
|
||||
if (strpos($class, 'Producto') !== false) {
|
||||
$segmento = str_replace(' ', '', $data->segmento);
|
||||
$class = implode("\\", [
|
||||
$class . 's',
|
||||
rtrim($segmento, 's')
|
||||
]);
|
||||
}
|
||||
$obj = new $class;
|
||||
$obj->map($data);
|
||||
$obj->setFactory($this);
|
||||
$obj->setImageFolder($this->image_folder);
|
||||
return $obj;
|
||||
}
|
||||
}
|
67
provm/common/Implementation/Logger.php
Normal file
67
provm/common/Implementation/Logger.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
namespace ProVM\Common\Implementation;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\LogLevel;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class Logger implements LoggerInterface {
|
||||
protected $output_file;
|
||||
public function __construct(string $filename) {
|
||||
if (!file_exists($filename)) {
|
||||
$f = fopen($filename, 'c');
|
||||
fclose($f);
|
||||
}
|
||||
if (!file_exists($filename)) {
|
||||
throw new \Exception('Can not create log file.');
|
||||
}
|
||||
$this->output_file = $filename;
|
||||
}
|
||||
public function emergency($message, array $context = []) {
|
||||
return $this->log(LogLevel::EMERGENCY, $message, $context);
|
||||
}
|
||||
public function alert($message, array $context = []) {
|
||||
return $this->log(LogLevel::ALERT, $message, $context);
|
||||
}
|
||||
public function critical($message, array $context = []) {
|
||||
return $this->log(LogLevel::CRITICAL, $message, $context);
|
||||
}
|
||||
public function error($message, array $context = []) {
|
||||
return $this->log(LogLevel::ERROR, $message, $context);
|
||||
}
|
||||
public function warning($message, array $context = []) {
|
||||
return $this->log(LogLevel::WARNING, $message, $context);
|
||||
}
|
||||
public function notice($message, array $context = []) {
|
||||
return $this->log(LogLevel::NOTICE, $message, $context);
|
||||
}
|
||||
public function info($message, array $context = []) {
|
||||
return $this->log(LogLevel::INFO, $message, $context);
|
||||
}
|
||||
public function debug($message, array $context = []) {
|
||||
return $this->log(LogLevel::DEBUG, $message, $context);
|
||||
}
|
||||
public function log($level, $message, array $context = []) {
|
||||
$refl = new \ReflectionClass(LogLevel::class);
|
||||
$levels = $refl->getConstants();
|
||||
if (array_search($level, array_values($levels)) === false) {
|
||||
throw new \InvalidArgumentException('Invalid log level.');
|
||||
}
|
||||
|
||||
$f = Carbon::now('America/Santiago');
|
||||
$output = [
|
||||
'time' => $f->format('Y-m-d H:i:s,v'),
|
||||
'message' => $message
|
||||
];
|
||||
if (count($context) > 0) {
|
||||
$output['context'] = $context;
|
||||
}
|
||||
|
||||
$data = json_decode(trim(file_get_contents($this->output_file)));
|
||||
if ($data === null) {
|
||||
$data = [];
|
||||
}
|
||||
$data []= $output;
|
||||
file_put_contents($this->output_file, json_encode($data, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
60
provm/common/Implementation/Model.php
Normal file
60
provm/common/Implementation/Model.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace ProVM\Common\Implementation;
|
||||
|
||||
use ProVM\Common\Factory\Model as ModelFactory;
|
||||
|
||||
abstract class Model implements \JsonSerializable {
|
||||
abstract public function map($data): Model;
|
||||
protected $factory;
|
||||
public function setFactory(ModelFactory $factory) {
|
||||
$this->factory = $factory;
|
||||
}
|
||||
public function __get(string $name) {
|
||||
if (!property_exists($this, $name)) {
|
||||
throw new \InvalidArgumentException($name . ' is not a property of ' . get_called_class());
|
||||
}
|
||||
return $this->$name;
|
||||
}
|
||||
public function save() {
|
||||
$filename = $this->getFilename();
|
||||
$data = json_decode(trim(file_Get_contents($filename)));
|
||||
if ($this->id === null) {
|
||||
$this->id = array_reduce($data, function($max, $item) {
|
||||
return (($max < $item->id) ? $item->id : $max);
|
||||
}, 0) + 1;
|
||||
$data []= $this->jsonSerialize();
|
||||
} else {
|
||||
foreach ($data as $i => $item) {
|
||||
if ($item->id == $this->id) {
|
||||
$data[$i] = $this->jsonSerialize();
|
||||
}
|
||||
}
|
||||
}
|
||||
$data = array_values($data);
|
||||
return (file_put_contents($filename, json_encode($data, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)) !== false);
|
||||
}
|
||||
public function delete() {
|
||||
$filename = $this->getFilename();
|
||||
$data = json_decode(trim(file_Get_contents($filename)));
|
||||
foreach ($data as $i => $item) {
|
||||
if ($item->id == $this->id) {
|
||||
unset($data[$i]);
|
||||
}
|
||||
}
|
||||
$data = array_values($data);
|
||||
return (file_put_contents($filename, json_encode($data, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)) !== false);
|
||||
}
|
||||
protected function getFilename(): string {
|
||||
$data = explode("\\", get_called_class());
|
||||
$folder = $this->factory->getFolder();
|
||||
$class = array_pop($data);
|
||||
$productos = ['Bodega', 'Oficina', 'Retail', 'Terreno'];
|
||||
if (array_search($class, $productos) !== false) {
|
||||
$class = 'Producto';
|
||||
}
|
||||
return implode(DIRECTORY_SEPARATOR, [
|
||||
$folder,
|
||||
str_replace(' ', '_', mb_strtolower($class)) . 's.json'
|
||||
]);
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 153 KiB |
@ -1,19 +1,5 @@
|
||||
/* line 3, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/admin.scss */
|
||||
#admin {
|
||||
background-color: #f4f4f4;
|
||||
padding-top: 3rem;
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
#admin { background-color: #f4f4f4; padding-top: 3rem; padding-bottom: 2rem; }
|
||||
|
||||
/* line 8, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/admin.scss */
|
||||
#admin .button {
|
||||
background-color: #429ab7;
|
||||
color: white;
|
||||
}
|
||||
#admin .button { background-color: #429ab7; color: white; }
|
||||
|
||||
/* line 13, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/admin.scss */
|
||||
#admin .container > .header, #admin .container > .grid > .column > .header, #admin .container > .grid > .row > .column > .header {
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=admin.css.map */
|
||||
#admin .container > .header, #admin .container > .grid > .column > .header, #admin .container > .grid > .row > .column > .header { padding-bottom: 2rem; }
|
||||
|
@ -1,14 +1,5 @@
|
||||
/* line 3, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/faqs.scss */
|
||||
#faq {
|
||||
background-color: #a7a9ab;
|
||||
color: white;
|
||||
padding-top: 3rem;
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
#faq { background-color: #a7a9ab; color: white; padding-top: 3rem; padding-bottom: 4rem; }
|
||||
|
||||
/* line 10, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/faqs.scss */
|
||||
#faq .header, #faq .title, #faq .content {
|
||||
color: inherit;
|
||||
}
|
||||
#faq .header, #faq .title, #faq .content { color: inherit; }
|
||||
|
||||
/*# sourceMappingURL=faqs.css.map */
|
||||
#faq .accordion { font-size: 1.2rem; }
|
||||
|
@ -1,188 +1,51 @@
|
||||
/* line 3, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
.header {
|
||||
color: inherit !important;
|
||||
font-family: inherit !important;
|
||||
}
|
||||
.header { color: inherit !important; font-family: inherit !important; }
|
||||
|
||||
/* line 8, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#banner {
|
||||
padding-top: 12rem;
|
||||
padding-bottom: 12rem;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 1920px auto;
|
||||
background-blend-mode: multiply;
|
||||
}
|
||||
#banner { padding-top: 12rem; padding-bottom: 12rem; background-color: rgba(0, 0, 0, 0.6); background-position: center; background-repeat: no-repeat; background-size: 1920px auto; background-blend-mode: multiply; }
|
||||
|
||||
/* line 17, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#banner #mensaje {
|
||||
margin-bottom: 2rem;
|
||||
color: white;
|
||||
font-weight: 300;
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
#banner #mensaje { margin-bottom: 2rem; color: white; font-weight: 300; font-size: 1.6rem; }
|
||||
|
||||
/* line 23, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#banner #mensaje .header {
|
||||
font-weight: 900 !important;
|
||||
font-size: 1.9rem;
|
||||
}
|
||||
#banner #mensaje .header { font-weight: 900 !important; font-size: 1.9rem; }
|
||||
|
||||
/* line 28, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#banner .button {
|
||||
font-family: inherit;
|
||||
font-weight: 900;
|
||||
background-color: #0d103c !important;
|
||||
color: white;
|
||||
}
|
||||
#banner .button { font-family: inherit; font-weight: 900; background-color: #0d103c !important; color: white; }
|
||||
|
||||
/* line 36, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#aviso {
|
||||
color: white;
|
||||
background-color: #429ab7;
|
||||
padding-top: 5rem;
|
||||
padding-bottom: 3rem;
|
||||
font-size: 1.6rem;
|
||||
font-weight: 300;
|
||||
}
|
||||
#aviso { color: white; background-color: #429ab7; padding-top: 5rem; padding-bottom: 3rem; font-size: 1.6rem; font-weight: 300; }
|
||||
|
||||
/* line 44, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#aviso .header {
|
||||
font-weight: 900;
|
||||
}
|
||||
#aviso .header { font-weight: 900; }
|
||||
|
||||
/* line 49, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#destacados {
|
||||
padding-top: 3rem;
|
||||
padding-bottom: 5rem;
|
||||
background-color: #a7a9ab;
|
||||
min-height: 40rem;
|
||||
}
|
||||
#destacados { padding-top: 3rem; padding-bottom: 5rem; background-color: #a7a9ab; min-height: 40rem; }
|
||||
|
||||
/* line 55, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#destacados .header {
|
||||
color: #0d103c !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
#destacados .header { color: #0d103c !important; font-weight: 600; }
|
||||
|
||||
/* line 59, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#destacados .titulo {
|
||||
font-size: 1.6rem;
|
||||
font-weight: 900;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
#destacados .titulo { font-size: 1.6rem; font-weight: 900; padding-bottom: 1rem; }
|
||||
|
||||
/* line 64, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#destacados .ficha {
|
||||
border-radius: 0;
|
||||
border: 0;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
#destacados .ficha { border-radius: 0; border: 0; box-shadow: none !important; }
|
||||
|
||||
/* line 70, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#destacados .ficha .content .segment {
|
||||
background-color: #f4f4f4 !important;
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
font-weight: 300;
|
||||
}
|
||||
#destacados .ficha .content .segment { background-color: #f4f4f4 !important; padding-top: 0 !important; padding-bottom: 0 !important; font-weight: 300; }
|
||||
|
||||
/* line 76, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#destacados .ficha .content .button {
|
||||
font-family: inherit !important;
|
||||
font-weight: 900;
|
||||
padding-top: 0.3rem !important;
|
||||
padding-bottom: 0.3rem !important;
|
||||
background-color: #0d103c !important;
|
||||
}
|
||||
#destacados .ficha .content .button { font-family: inherit !important; font-weight: 900; padding-top: 0.3rem !important; padding-bottom: 0.3rem !important; background-color: #0d103c !important; }
|
||||
|
||||
/* line 84, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#destacados .ficha .image {
|
||||
overflow: hidden;
|
||||
}
|
||||
#destacados .ficha .image { height: 11rem; overflow: hidden; display: flex; align-items: center; }
|
||||
|
||||
/* line 87, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#destacados .ficha .overlay {
|
||||
background-color: #0d103c;
|
||||
color: white;
|
||||
opacity: 0.8;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
top: 1.9rem;
|
||||
right: -2.2rem;
|
||||
width: 10rem;
|
||||
padding-top: .3rem;
|
||||
padding-bottom: .3rem;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
#destacados .ficha .image img { width: 100%; vertical-align: middle; }
|
||||
|
||||
/* line 106, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#destacados .active {
|
||||
font-weight: 900;
|
||||
}
|
||||
#destacados .ficha .overlay { background-color: #0d103c; color: white; opacity: 0.8; text-align: center; position: absolute; z-index: 999; top: 1.9rem; right: -2.2rem; width: 10rem; padding-top: .3rem; padding-bottom: .3rem; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); }
|
||||
|
||||
/* line 111, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#segmentos {
|
||||
padding-top: 4rem;
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
#destacados .active { font-weight: 900; }
|
||||
|
||||
/* line 115, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#segmentos .titulo {
|
||||
color: #0d103c !important;
|
||||
}
|
||||
#segmentos { padding-top: 4rem; padding-bottom: 4rem; }
|
||||
|
||||
/* line 121, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#segmentos .grid .basic.segment .header {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
#segmentos .titulo { color: #0d103c !important; }
|
||||
|
||||
/* line 128, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#resumen {
|
||||
background-position: center;
|
||||
background-position-y: -60rem;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 2600px auto;
|
||||
min-height: 20rem;
|
||||
padding-top: 3rem;
|
||||
}
|
||||
#segmentos .grid .basic.segment .header { margin-top: 1rem; }
|
||||
|
||||
/* line 136, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#resumen .inverted.circular.segment {
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
#resumen { background-position: center; background-position-y: -60rem; background-repeat: no-repeat; background-size: 2600px auto; min-height: 20rem; padding-top: 3rem; }
|
||||
|
||||
/* line 141, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#indicadores {
|
||||
background-color: #a7a9ab;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
min-height: 5rem;
|
||||
}
|
||||
#resumen .inverted.circular.segment { background-color: rgba(0, 0, 0, 0.8); }
|
||||
|
||||
/* line 147, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#indicadores .slideshow {
|
||||
overflow: hidden;
|
||||
height: 6rem;
|
||||
}
|
||||
#indicadores { background-color: #a7a9ab; padding-top: 1rem; padding-bottom: 1rem; height: 4rem; }
|
||||
|
||||
/* line 151, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/home.scss */
|
||||
#indicadores .slideshow .slide {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
background-color: white;
|
||||
padding: 0;
|
||||
margin: 1rem;
|
||||
width: 8rem !important;
|
||||
padding-top: .5rem;
|
||||
padding-bottom: .5rem;
|
||||
text-align: center;
|
||||
}
|
||||
#indicadores .slideshow { overflow: hidden; text-align: center; height: 2rem; }
|
||||
|
||||
/*# sourceMappingURL=home.css.map */
|
||||
#indicadores .slideshow .slide { display: inline; float: left; color: white; padding: 0; margin-right: 1rem; text-align: center; padding-left: 1rem; padding-right: 2rem; border-right: thin solid black; }
|
||||
|
||||
#indicadores .slideshow .slide .value:last-child { padding-left: 0.3rem; font-weight: 100 !important; }
|
||||
|
@ -6,9 +6,9 @@
|
||||
"../../../resources/assets/sass/_pallete.scss"
|
||||
],
|
||||
"sourcesContent": [
|
||||
"@import 'pallete';\r\n\r\n.header {\r\n color: inherit !important;\r\n font-family: inherit !important;\r\n}\r\n\r\n#banner {\r\n padding-top: 12rem;\r\n padding-bottom: 12rem;\r\n background-color: rgba(0, 0, 0, 0.6);\r\n background-position: center;\r\n background-repeat: no-repeat;\r\n background-size: 1920px auto;\r\n background-blend-mode: multiply;\r\n\r\n #mensaje {\r\n margin-bottom: 2rem;\r\n color: white;\r\n font-weight: 300;\r\n font-size: 1.6rem;\r\n\r\n .header {\r\n font-weight: 900 !important;\r\n font-size: 1.9rem;\r\n }\r\n }\r\n .button {\r\n font-family: inherit;\r\n font-weight: 900;\r\n background-color: $azul-oscuro !important;\r\n color: white;\r\n }\r\n}\r\n\r\n#aviso {\r\n color: white;\r\n background-color: $marca;\r\n padding-top: 5rem;\r\n padding-bottom: 3rem;\r\n font-size: 1.6rem;\r\n font-weight: 300;\r\n\r\n .header {\r\n font-weight: 900;\r\n }\r\n}\r\n\r\n#destacados {\r\n padding-top: 3rem;\r\n padding-bottom: 5rem;\r\n background-color: $gris-medio;\r\n min-height: 40rem;\r\n\r\n .header {\r\n color: $azul-oscuro !important;\r\n font-weight: 600;\r\n }\r\n .titulo {\r\n font-size: 1.6rem;\r\n font-weight: 900;\r\n padding-bottom: 1rem;\r\n }\r\n .ficha {\r\n border-radius: 0;\r\n border: 0;\r\n box-shadow: none !important;\r\n\r\n .content {\r\n .segment {\r\n background-color: $gris-claro !important;\r\n padding-top: 0 !important;\r\n padding-bottom: 0 !important;\r\n font-weight: 300;\r\n }\r\n .button {\r\n font-family: inherit !important;\r\n font-weight: 900;\r\n padding-top: 0.3rem !important;\r\n padding-bottom: 0.3rem !important;\r\n background-color: #0d103c !important;\r\n }\r\n }\r\n .image {\r\n overflow: hidden;\r\n }\r\n .overlay {\r\n background-color: #0d103c;\r\n color: white;\r\n opacity: 0.8;\r\n text-align: center;\r\n position: absolute;\r\n z-index: 999;\r\n top: 1.9rem;\r\n right: -2.2rem;\r\n width: 10rem;\r\n padding-top: .3rem;\r\n padding-bottom: .3rem;\r\n -webkit-transform: rotate(45deg);\r\n -moz-transform: rotate(45deg);\r\n -ms-transform: rotate(45deg);\r\n -o-transform: rotate(45deg);\r\n transform: rotate(45deg);\r\n }\r\n }\r\n .active {\r\n font-weight: 900;\r\n }\r\n}\r\n\r\n#segmentos {\r\n padding-top: 4rem;\r\n padding-bottom: 4rem;\r\n\r\n .titulo {\r\n color: $azul-oscuro !important;\r\n }\r\n\r\n .grid {\r\n .basic.segment {\r\n .header {\r\n margin-top: 1rem;\r\n }\r\n }\r\n }\r\n}\r\n\r\n#resumen {\r\n background-position: center;\r\n background-position-y: -60rem;\r\n background-repeat: no-repeat;\r\n background-size: 2600px auto;\r\n min-height: 20rem;\r\n padding-top: 3rem;\r\n\r\n .inverted.circular.segment {\r\n background-color: rgba(0, 0, 0, 0.8);\r\n }\r\n}\r\n\r\n#indicadores {\r\n background-color: $gris-medio;\r\n padding-top: 1rem;\r\n padding-bottom: 1rem;\r\n min-height: 5rem;\r\n\r\n .slideshow {\r\n overflow: hidden;\r\n height: 6rem;\r\n\r\n .slide {\r\n display: inline-block;\r\n float: left;\r\n background-color: white;\r\n padding: 0;\r\n margin: 1rem;\r\n width: 8rem !important;\r\n padding-top: .5rem;\r\n padding-bottom: .5rem;\r\n text-align: center;\r\n }\r\n }\r\n}\r\n",
|
||||
"@import 'pallete';\r\n\r\n.header {\r\n color: inherit !important;\r\n font-family: inherit !important;\r\n}\r\n\r\n#banner {\r\n padding-top: 12rem;\r\n padding-bottom: 12rem;\r\n background-color: rgba(0, 0, 0, 0.6);\r\n background-position: center;\r\n background-repeat: no-repeat;\r\n background-size: 1920px auto;\r\n background-blend-mode: multiply;\r\n\r\n #mensaje {\r\n margin-bottom: 2rem;\r\n color: white;\r\n font-weight: 300;\r\n font-size: 1.6rem;\r\n\r\n .header {\r\n font-weight: 900 !important;\r\n font-size: 1.9rem;\r\n }\r\n }\r\n .button {\r\n font-family: inherit;\r\n font-weight: 900;\r\n background-color: $azul-oscuro !important;\r\n color: white;\r\n }\r\n}\r\n\r\n#aviso {\r\n color: white;\r\n background-color: $marca;\r\n padding-top: 5rem;\r\n padding-bottom: 3rem;\r\n font-size: 1.6rem;\r\n font-weight: 300;\r\n\r\n .header {\r\n font-weight: 900;\r\n }\r\n}\r\n\r\n#destacados {\r\n padding-top: 3rem;\r\n padding-bottom: 5rem;\r\n background-color: $gris-medio;\r\n min-height: 40rem;\r\n\r\n .header {\r\n color: $azul-oscuro !important;\r\n font-weight: 600;\r\n }\r\n .titulo {\r\n font-size: 1.6rem;\r\n font-weight: 900;\r\n padding-bottom: 1rem;\r\n }\r\n .ficha {\r\n border-radius: 0;\r\n border: 0;\r\n box-shadow: none !important;\r\n\r\n .content {\r\n .segment {\r\n background-color: $gris-claro !important;\r\n padding-top: 0 !important;\r\n padding-bottom: 0 !important;\r\n font-weight: 300;\r\n }\r\n .button {\r\n font-family: inherit !important;\r\n font-weight: 900;\r\n padding-top: 0.3rem !important;\r\n padding-bottom: 0.3rem !important;\r\n background-color: #0d103c !important;\r\n }\r\n }\r\n .image {\r\n height: 11rem;\r\n overflow: hidden;\r\n display: flex;\r\n align-items: center;\r\n img {\r\n width: 100%;\r\n vertical-align: middle;\r\n }\r\n }\r\n .overlay {\r\n background-color: #0d103c;\r\n color: white;\r\n opacity: 0.8;\r\n text-align: center;\r\n position: absolute;\r\n z-index: 999;\r\n top: 1.9rem;\r\n right: -2.2rem;\r\n width: 10rem;\r\n padding-top: .3rem;\r\n padding-bottom: .3rem;\r\n -webkit-transform: rotate(45deg);\r\n -moz-transform: rotate(45deg);\r\n -ms-transform: rotate(45deg);\r\n -o-transform: rotate(45deg);\r\n transform: rotate(45deg);\r\n }\r\n }\r\n .active {\r\n font-weight: 900;\r\n }\r\n}\r\n\r\n#segmentos {\r\n padding-top: 4rem;\r\n padding-bottom: 4rem;\r\n\r\n .titulo {\r\n color: $azul-oscuro !important;\r\n }\r\n\r\n .grid {\r\n .basic.segment {\r\n .header {\r\n margin-top: 1rem;\r\n }\r\n }\r\n }\r\n}\r\n\r\n#resumen {\r\n background-position: center;\r\n background-position-y: -60rem;\r\n background-repeat: no-repeat;\r\n background-size: 2600px auto;\r\n min-height: 20rem;\r\n padding-top: 3rem;\r\n\r\n .inverted.circular.segment {\r\n background-color: rgba(0, 0, 0, 0.8);\r\n }\r\n}\r\n\r\n#indicadores {\r\n background-color: $gris-medio;\r\n padding-top: 1rem;\r\n padding-bottom: 1rem;\r\n height: 4rem;\r\n\r\n .slideshow {\r\n overflow: hidden;\r\n text-align: center;\r\n height: 2rem;\r\n\r\n .slide {\r\n display: inline;\r\n float: left;\r\n color: white;\r\n padding: 0;\r\n margin-right: 1rem;\r\n text-align: center;\r\n\r\n .value:last-child {\r\n padding-left: 0.3rem;\r\n font-weight: 100 !important;\r\n }\r\n padding-left: 1rem;\r\n padding-right: 2rem;\r\n border-right: thin solid black;\r\n }\r\n }\r\n}\r\n",
|
||||
"$marca: #429ab7;\r\n$gris-oscuro: #808284;\r\n$gris-medio: #a7a9ab;\r\n$gris-claro: #f4f4f4;\r\n$azul-oscuro: #0d103c;\r\n"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": ";AAEA,AAAA,OAAO,CAAC;EACN,KAAK,EAAE,kBAAkB;EACzB,WAAW,EAAE,kBAAkB;CAChC;;;AAED,AAAA,OAAO,CAAC;EACN,WAAW,EAAE,KAAK;EAClB,cAAc,EAAE,KAAK;EACrB,gBAAgB,EAAE,kBAAkB;EACpC,mBAAmB,EAAE,MAAM;EAC3B,iBAAiB,EAAE,SAAS;EAC5B,eAAe,EAAE,WAAW;EAC5B,qBAAqB,EAAE,QAAQ;CAmBhC;;;AA1BD,AASE,OATK,CASL,QAAQ,CAAC;EACP,aAAa,EAAE,IAAI;EACnB,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,GAAG;EAChB,SAAS,EAAE,MAAM;CAMlB;;;AAnBH,AAeI,OAfG,CASL,QAAQ,CAMN,OAAO,CAAC;EACN,WAAW,EAAE,cAAc;EAC3B,SAAS,EAAE,MAAM;CAClB;;;AAlBL,AAoBE,OApBK,CAoBL,OAAO,CAAC;EACN,WAAW,EAAE,OAAO;EACpB,WAAW,EAAE,GAAG;EAChB,gBAAgB,EC1BN,OAAO,CD0Bc,UAAU;EACzC,KAAK,EAAE,KAAK;CACb;;;AAGH,AAAA,MAAM,CAAC;EACL,KAAK,EAAE,KAAK;EACZ,gBAAgB,ECrCV,OAAO;EDsCb,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;EACpB,SAAS,EAAE,MAAM;EACjB,WAAW,EAAE,GAAG;CAKjB;;;AAXD,AAQE,MARI,CAQJ,OAAO,CAAC;EACN,WAAW,EAAE,GAAG;CACjB;;;AAGH,AAAA,WAAW,CAAC;EACV,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;EACpB,gBAAgB,ECjDL,OAAO;EDkDlB,UAAU,EAAE,KAAK;CAwDlB;;;AA5DD,AAME,WANS,CAMT,OAAO,CAAC;EACN,KAAK,ECnDK,OAAO,CDmDG,UAAU;EAC9B,WAAW,EAAE,GAAG;CACjB;;;AATH,AAUE,WAVS,CAUT,OAAO,CAAC;EACN,SAAS,EAAE,MAAM;EACjB,WAAW,EAAE,GAAG;EAChB,cAAc,EAAE,IAAI;CACrB;;;AAdH,AAeE,WAfS,CAeT,MAAM,CAAC;EACL,aAAa,EAAE,CAAC;EAChB,MAAM,EAAE,CAAC;EACT,UAAU,EAAE,eAAe;CAsC5B;;;AAxDH,AAqBM,WArBK,CAeT,MAAM,CAKJ,QAAQ,CACN,QAAQ,CAAC;EACP,gBAAgB,ECnEX,OAAO,CDmEkB,UAAU;EACxC,WAAW,EAAE,YAAY;EACzB,cAAc,EAAE,YAAY;EAC5B,WAAW,EAAE,GAAG;CACjB;;;AA1BP,AA2BM,WA3BK,CAeT,MAAM,CAKJ,QAAQ,CAON,OAAO,CAAC;EACN,WAAW,EAAE,kBAAkB;EAC/B,WAAW,EAAE,GAAG;EAChB,WAAW,EAAE,iBAAiB;EAC9B,cAAc,EAAE,iBAAiB;EACjC,gBAAgB,EAAE,kBAAkB;CACrC;;;AAjCP,AAmCI,WAnCO,CAeT,MAAM,CAoBJ,MAAM,CAAC;EACL,QAAQ,EAAE,MAAM;CACjB;;;AArCL,AAsCI,WAtCO,CAeT,MAAM,CAuBJ,QAAQ,CAAC;EACP,gBAAgB,EAAE,OAAO;EACzB,KAAK,EAAE,KAAK;EACZ,OAAO,EAAE,GAAG;EACZ,UAAU,EAAE,MAAM;EAClB,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,GAAG;EACZ,GAAG,EAAE,MAAM;EACX,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,KAAK;EAClB,cAAc,EAAE,KAAK;EACrB,iBAAiB,EAAE,aAAa;EAChC,cAAc,EAAE,aAAa;EAC7B,aAAa,EAAE,aAAa;EAC5B,YAAY,EAAE,aAAa;EAC3B,SAAS,EAAE,aAAa;CACzB;;;AAvDL,AAyDE,WAzDS,CAyDT,OAAO,CAAC;EACN,WAAW,EAAE,GAAG;CACjB;;;AAGH,AAAA,UAAU,CAAC;EACT,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;CAarB;;;AAfD,AAIE,UAJQ,CAIR,OAAO,CAAC;EACN,KAAK,EC/GK,OAAO,CD+GG,UAAU;CAC/B;;;AANH,AAUM,UAVI,CAQR,KAAK,CACH,MAAM,AAAA,QAAQ,CACZ,OAAO,CAAC;EACN,UAAU,EAAE,IAAI;CACjB;;;AAKP,AAAA,QAAQ,CAAC;EACP,mBAAmB,EAAE,MAAM;EAC3B,qBAAqB,EAAE,MAAM;EAC7B,iBAAiB,EAAE,SAAS;EAC5B,eAAe,EAAE,WAAW;EAC5B,UAAU,EAAE,KAAK;EACjB,WAAW,EAAE,IAAI;CAKlB;;;AAXD,AAQE,QARM,CAQN,SAAS,AAAA,SAAS,AAAA,QAAQ,CAAC;EACzB,gBAAgB,EAAE,kBAAkB;CACrC;;;AAGH,AAAA,YAAY,CAAC;EACX,gBAAgB,EC3IL,OAAO;ED4IlB,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;EACpB,UAAU,EAAE,IAAI;CAkBjB;;;AAtBD,AAME,YANU,CAMV,UAAU,CAAC;EACT,QAAQ,EAAE,MAAM;EAChB,MAAM,EAAE,IAAI;CAab;;;AArBH,AAUI,YAVQ,CAMV,UAAU,CAIR,MAAM,CAAC;EACL,OAAO,EAAE,YAAY;EACrB,KAAK,EAAE,IAAI;EACX,gBAAgB,EAAE,KAAK;EACvB,OAAO,EAAE,CAAC;EACV,MAAM,EAAE,IAAI;EACZ,KAAK,EAAE,eAAe;EACtB,WAAW,EAAE,KAAK;EAClB,cAAc,EAAE,KAAK;EACrB,UAAU,EAAE,MAAM;CACnB"
|
||||
"mappings": ";AAEA,AAAA,OAAO,CAAC;EACN,KAAK,EAAE,kBAAkB;EACzB,WAAW,EAAE,kBAAkB;CAChC;;;AAED,AAAA,OAAO,CAAC;EACN,WAAW,EAAE,KAAK;EAClB,cAAc,EAAE,KAAK;EACrB,gBAAgB,EAAE,kBAAkB;EACpC,mBAAmB,EAAE,MAAM;EAC3B,iBAAiB,EAAE,SAAS;EAC5B,eAAe,EAAE,WAAW;EAC5B,qBAAqB,EAAE,QAAQ;CAmBhC;;;AA1BD,AASE,OATK,CASL,QAAQ,CAAC;EACP,aAAa,EAAE,IAAI;EACnB,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,GAAG;EAChB,SAAS,EAAE,MAAM;CAMlB;;;AAnBH,AAeI,OAfG,CASL,QAAQ,CAMN,OAAO,CAAC;EACN,WAAW,EAAE,cAAc;EAC3B,SAAS,EAAE,MAAM;CAClB;;;AAlBL,AAoBE,OApBK,CAoBL,OAAO,CAAC;EACN,WAAW,EAAE,OAAO;EACpB,WAAW,EAAE,GAAG;EAChB,gBAAgB,EC1BN,OAAO,CD0Bc,UAAU;EACzC,KAAK,EAAE,KAAK;CACb;;;AAGH,AAAA,MAAM,CAAC;EACL,KAAK,EAAE,KAAK;EACZ,gBAAgB,ECrCV,OAAO;EDsCb,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;EACpB,SAAS,EAAE,MAAM;EACjB,WAAW,EAAE,GAAG;CAKjB;;;AAXD,AAQE,MARI,CAQJ,OAAO,CAAC;EACN,WAAW,EAAE,GAAG;CACjB;;;AAGH,AAAA,WAAW,CAAC;EACV,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;EACpB,gBAAgB,ECjDL,OAAO;EDkDlB,UAAU,EAAE,KAAK;CA+DlB;;;AAnED,AAME,WANS,CAMT,OAAO,CAAC;EACN,KAAK,ECnDK,OAAO,CDmDG,UAAU;EAC9B,WAAW,EAAE,GAAG;CACjB;;;AATH,AAUE,WAVS,CAUT,OAAO,CAAC;EACN,SAAS,EAAE,MAAM;EACjB,WAAW,EAAE,GAAG;EAChB,cAAc,EAAE,IAAI;CACrB;;;AAdH,AAeE,WAfS,CAeT,MAAM,CAAC;EACL,aAAa,EAAE,CAAC;EAChB,MAAM,EAAE,CAAC;EACT,UAAU,EAAE,eAAe;CA6C5B;;;AA/DH,AAqBM,WArBK,CAeT,MAAM,CAKJ,QAAQ,CACN,QAAQ,CAAC;EACP,gBAAgB,ECnEX,OAAO,CDmEkB,UAAU;EACxC,WAAW,EAAE,YAAY;EACzB,cAAc,EAAE,YAAY;EAC5B,WAAW,EAAE,GAAG;CACjB;;;AA1BP,AA2BM,WA3BK,CAeT,MAAM,CAKJ,QAAQ,CAON,OAAO,CAAC;EACN,WAAW,EAAE,kBAAkB;EAC/B,WAAW,EAAE,GAAG;EAChB,WAAW,EAAE,iBAAiB;EAC9B,cAAc,EAAE,iBAAiB;EACjC,gBAAgB,EAAE,kBAAkB;CACrC;;;AAjCP,AAmCI,WAnCO,CAeT,MAAM,CAoBJ,MAAM,CAAC;EACL,MAAM,EAAE,KAAK;EACb,QAAQ,EAAE,MAAM;EAChB,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,MAAM;CAKpB;;;AA5CL,AAwCM,WAxCK,CAeT,MAAM,CAoBJ,MAAM,CAKJ,GAAG,CAAC;EACF,KAAK,EAAE,IAAI;EACX,cAAc,EAAE,MAAM;CACvB;;;AA3CP,AA6CI,WA7CO,CAeT,MAAM,CA8BJ,QAAQ,CAAC;EACP,gBAAgB,EAAE,OAAO;EACzB,KAAK,EAAE,KAAK;EACZ,OAAO,EAAE,GAAG;EACZ,UAAU,EAAE,MAAM;EAClB,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,GAAG;EACZ,GAAG,EAAE,MAAM;EACX,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,KAAK;EAClB,cAAc,EAAE,KAAK;EACrB,iBAAiB,EAAE,aAAa;EAChC,cAAc,EAAE,aAAa;EAC7B,aAAa,EAAE,aAAa;EAC5B,YAAY,EAAE,aAAa;EAC3B,SAAS,EAAE,aAAa;CACzB;;;AA9DL,AAgEE,WAhES,CAgET,OAAO,CAAC;EACN,WAAW,EAAE,GAAG;CACjB;;;AAGH,AAAA,UAAU,CAAC;EACT,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;CAarB;;;AAfD,AAIE,UAJQ,CAIR,OAAO,CAAC;EACN,KAAK,ECtHK,OAAO,CDsHG,UAAU;CAC/B;;;AANH,AAUM,UAVI,CAQR,KAAK,CACH,MAAM,AAAA,QAAQ,CACZ,OAAO,CAAC;EACN,UAAU,EAAE,IAAI;CACjB;;;AAKP,AAAA,QAAQ,CAAC;EACP,mBAAmB,EAAE,MAAM;EAC3B,qBAAqB,EAAE,MAAM;EAC7B,iBAAiB,EAAE,SAAS;EAC5B,eAAe,EAAE,WAAW;EAC5B,UAAU,EAAE,KAAK;EACjB,WAAW,EAAE,IAAI;CAKlB;;;AAXD,AAQE,QARM,CAQN,SAAS,AAAA,SAAS,AAAA,QAAQ,CAAC;EACzB,gBAAgB,EAAE,kBAAkB;CACrC;;;AAGH,AAAA,YAAY,CAAC;EACX,gBAAgB,EClJL,OAAO;EDmJlB,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;EACpB,MAAM,EAAE,IAAI;CAwBb;;;AA5BD,AAME,YANU,CAMV,UAAU,CAAC;EACT,QAAQ,EAAE,MAAM;EAChB,UAAU,EAAE,MAAM;EAClB,MAAM,EAAE,IAAI;CAkBb;;;AA3BH,AAWI,YAXQ,CAMV,UAAU,CAKR,MAAM,CAAC;EACL,OAAO,EAAE,MAAM;EACf,KAAK,EAAE,IAAI;EACX,KAAK,EAAE,KAAK;EACZ,OAAO,EAAE,CAAC;EACV,YAAY,EAAE,IAAI;EAClB,UAAU,EAAE,MAAM;EAMlB,YAAY,EAAE,IAAI;EAClB,aAAa,EAAE,IAAI;EACnB,YAAY,EAAE,gBAAgB;CAC/B;;;AA1BL,AAmBM,YAnBM,CAMV,UAAU,CAKR,MAAM,CAQJ,MAAM,AAAA,WAAW,CAAC;EAChB,YAAY,EAAE,MAAM;EACpB,WAAW,EAAE,cAAc;CAC5B"
|
||||
}
|
@ -1,113 +1,43 @@
|
||||
/* line 3, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
body {
|
||||
font-family: Roboto, sans-serif !important;
|
||||
}
|
||||
body { font-family: Roboto, sans-serif !important; }
|
||||
|
||||
/* line 7, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
.brand {
|
||||
color: #000070 !important;
|
||||
}
|
||||
.brand { color: #000070 !important; }
|
||||
|
||||
/* line 10, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
.inverted.brand {
|
||||
background-color: #000070 !important;
|
||||
color: white !important;
|
||||
}
|
||||
.inverted.brand { background-color: #000070 !important; color: white !important; }
|
||||
|
||||
/* line 14, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
.button.brand {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.button.brand { box-shadow: none !important; }
|
||||
|
||||
/* line 17, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
.title.image {
|
||||
width: 15rem;
|
||||
}
|
||||
.title.image { width: 15rem; }
|
||||
|
||||
/* line 22, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
header #franja {
|
||||
background-color: #707070;
|
||||
color: white !important;
|
||||
}
|
||||
header #franja { background-color: #707070; color: white !important; }
|
||||
|
||||
/* line 26, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
header #franja .menu {
|
||||
color: inherit !important;
|
||||
}
|
||||
header #franja .menu { color: inherit !important; }
|
||||
|
||||
/* line 29, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
header #franja .menu .spacer {
|
||||
width: 3rem;
|
||||
}
|
||||
header #franja .menu .spacer { width: 3rem; }
|
||||
|
||||
/* line 32, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
header #franja .menu .input {
|
||||
height: 1.3rem !important;
|
||||
}
|
||||
header #franja .menu .input { height: 1.3rem !important; }
|
||||
|
||||
/* line 37, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
header .menu {
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
header .menu { margin-top: 0 !important; margin-bottom: 0 !important; }
|
||||
|
||||
/* line 41, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
header .menu .logo {
|
||||
font-size: 2rem;
|
||||
font-weight: 900;
|
||||
}
|
||||
header .menu .logo { font-size: 2rem; font-weight: 900; }
|
||||
|
||||
/* line 48, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
a {
|
||||
color: inherit !important;
|
||||
}
|
||||
header .menu #productos_menu .menu { border: thin solid white; box-shadow: none; }
|
||||
|
||||
/* line 52, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
.menu {
|
||||
font-family: inherit !important;
|
||||
}
|
||||
header .menu #productos_menu .menu .item:hover { background-color: #a7a9ab !important; }
|
||||
|
||||
/* line 55, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
.item {
|
||||
font-family: inherit !important;
|
||||
color: inherit !important;
|
||||
}
|
||||
a { color: inherit !important; }
|
||||
|
||||
/* line 60, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
#contacto {
|
||||
background-color: #f4f4f4;
|
||||
padding-top: 3rem;
|
||||
padding-bottom: 3rem;
|
||||
}
|
||||
.menu { font-family: inherit !important; }
|
||||
|
||||
/* line 65, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
#contacto .header {
|
||||
color: #0d103c !important;
|
||||
font-weight: 900;
|
||||
}
|
||||
.item { font-family: inherit !important; color: inherit !important; }
|
||||
|
||||
/* line 69, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
#contacto .form .button {
|
||||
background-color: #429ab7;
|
||||
color: white;
|
||||
}
|
||||
#contacto { background-color: #f4f4f4; padding-top: 3rem; padding-bottom: 3rem; }
|
||||
|
||||
/* line 75, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
footer {
|
||||
background-color: #429ab7;
|
||||
color: white;
|
||||
margin: 0;
|
||||
}
|
||||
#contacto .header { color: #0d103c !important; font-weight: 900; }
|
||||
|
||||
/* line 80, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
footer .menu {
|
||||
margin: 0 !important;
|
||||
}
|
||||
#contacto .form .button { background-color: #429ab7; color: white; }
|
||||
|
||||
/* line 83, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/main.scss */
|
||||
footer .menu .label {
|
||||
background-color: white !important;
|
||||
color: #429ab7 !important;
|
||||
}
|
||||
footer { background-color: #429ab7; color: white; margin: 0; }
|
||||
|
||||
/*# sourceMappingURL=main.css.map */
|
||||
footer .menu { margin: 0 !important; }
|
||||
|
||||
footer .menu .label { background-color: white !important; color: #429ab7 !important; }
|
||||
|
@ -1,19 +1,5 @@
|
||||
/* line 3, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/nosotros.scss */
|
||||
#nosotros {
|
||||
background-color: #a7a9ab;
|
||||
color: white;
|
||||
padding-top: 3rem;
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
#nosotros { background-color: #a7a9ab; color: white; font-size: 1.2rem !important; padding-top: 3rem; padding-bottom: 4rem; }
|
||||
|
||||
/* line 10, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/nosotros.scss */
|
||||
#nosotros .header {
|
||||
color: inherit;
|
||||
}
|
||||
#nosotros .header { color: inherit; }
|
||||
|
||||
/* line 13, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/nosotros.scss */
|
||||
#nosotros .column {
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=nosotros.css.map */
|
||||
#nosotros .column { text-align: justify; }
|
||||
|
@ -1,130 +1,45 @@
|
||||
/* line 3, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto {
|
||||
background-color: #a7a9ab;
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
#producto { background-color: #a7a9ab; padding-bottom: 2rem; }
|
||||
|
||||
/* line 7, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto .titulo {
|
||||
color: #0d103c !important;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
#producto .titulo { color: #0d103c !important; padding-top: 2rem; padding-bottom: 1rem; }
|
||||
|
||||
/* line 9, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto .titulo .header {
|
||||
color: #0d103c !important;
|
||||
}
|
||||
#producto .titulo .header { color: #0d103c !important; }
|
||||
|
||||
/* line 12, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto .titulo .direccion {
|
||||
padding-left: 2rem;
|
||||
}
|
||||
#producto .titulo .direccion { padding-left: 2rem; }
|
||||
|
||||
/* line 15, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto .titulo .publicado {
|
||||
padding-top: .5rem;
|
||||
}
|
||||
#producto .titulo .publicado { padding-top: .5rem; }
|
||||
|
||||
/* line 21, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #galeria {
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
#producto #galeria { padding-bottom: 4rem; }
|
||||
|
||||
/* line 24, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #galeria > .image {
|
||||
height: 53rem;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
#producto #galeria > .image { height: 53rem; overflow: hidden; display: flex; align-items: center; }
|
||||
|
||||
/* line 29, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #galeria > .image img {
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
#producto #galeria > .image img { width: 100%; vertical-align: middle; }
|
||||
|
||||
/* line 35, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #galeria #thumbnails {
|
||||
padding-top: 2rem;
|
||||
}
|
||||
#producto #galeria #thumbnails { padding-top: 2rem; }
|
||||
|
||||
/* line 38, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #galeria #thumbnails .image {
|
||||
height: 8rem;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
#producto #galeria #thumbnails .image { height: 8rem; overflow: hidden; display: flex; align-items: center; }
|
||||
|
||||
/* line 43, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #galeria #thumbnails .image img {
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
#producto #galeria #thumbnails .image img { width: 100%; vertical-align: middle; }
|
||||
|
||||
/* line 50, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #buscar {
|
||||
color: #404041 !important;
|
||||
padding-top: 2rem;
|
||||
}
|
||||
#producto #buscar { color: #404041 !important; padding-top: 2rem; }
|
||||
|
||||
/* line 54, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #buscar .header {
|
||||
color: inherit;
|
||||
}
|
||||
#producto #buscar .header { color: inherit; }
|
||||
|
||||
/* line 57, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #buscar .divider {
|
||||
background-color: white;
|
||||
}
|
||||
#producto #buscar .divider { background-color: white; }
|
||||
|
||||
/* line 61, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #buscar .field input[type='text'] {
|
||||
background-color: inherit !important;
|
||||
}
|
||||
#producto #buscar .field input[type='text'] { background-color: inherit !important; }
|
||||
|
||||
/* line 66, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #buscar .slider .track-fill {
|
||||
background-color: #0d103c !important;
|
||||
}
|
||||
#producto #buscar .slider .track-fill { background-color: #0d103c !important; }
|
||||
|
||||
/* line 70, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #buscar .price_label {
|
||||
margin-top: -1rem;
|
||||
float: right;
|
||||
}
|
||||
#producto #buscar .price_label { margin-top: -1rem; float: right; }
|
||||
|
||||
/* line 77, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #datos .tabular .item {
|
||||
background-color: #f4f4f4 !important;
|
||||
border: thin solid white;
|
||||
}
|
||||
#producto #datos .tabular .item { background-color: #f4f4f4 !important; border: thin solid white; }
|
||||
|
||||
/* line 81, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #datos .tabular .item:not(.active) {
|
||||
border: thin solid #f4f4f4;
|
||||
background-color: white !important;
|
||||
}
|
||||
#producto #datos .tabular .item:not(.active) { border: thin solid #f4f4f4; background-color: white !important; }
|
||||
|
||||
/* line 85, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #datos .tabular .item:last-child {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
#producto #datos .tabular .item:last-child { margin-left: 1rem; }
|
||||
|
||||
/* line 90, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #datos .segment {
|
||||
border: none !important;
|
||||
}
|
||||
#producto #datos .segment { border: none !important; background-color: #808284; color: white; }
|
||||
|
||||
/* line 94, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #datos .segment .informacion .row {
|
||||
border-bottom: thin dotted white;
|
||||
}
|
||||
#producto #datos .segment .informacion .row { border-bottom: thin dotted white; }
|
||||
|
||||
/* line 97, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/producto.scss */
|
||||
#producto #datos .segment .informacion .row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=producto.css.map */
|
||||
#producto #datos .segment .informacion .row:last-child { border-bottom: none; }
|
||||
|
@ -1,72 +1,19 @@
|
||||
/* line 3, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/productos.scss */
|
||||
#productos {
|
||||
background-color: #a7a9ab;
|
||||
padding-top: 2rem;
|
||||
}
|
||||
#productos { background-color: #a7a9ab; padding-top: 2rem; }
|
||||
|
||||
/* line 7, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/productos.scss */
|
||||
#productos .titulo {
|
||||
color: #0d103c !important;
|
||||
}
|
||||
#productos .titulo { color: #0d103c !important; }
|
||||
|
||||
/* line 11, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/productos.scss */
|
||||
#productos .tabular.menu .item {
|
||||
color: #404041 !important;
|
||||
}
|
||||
#productos .tabular.menu .item { color: #404041 !important; }
|
||||
|
||||
/* line 15, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/productos.scss */
|
||||
#productos .grid {
|
||||
padding-top: 2rem;
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
#productos .grid { padding-top: 2rem; padding-bottom: 2rem; }
|
||||
|
||||
/* line 19, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/productos.scss */
|
||||
#productos .grid .ficha {
|
||||
border-radius: 0;
|
||||
border: 0;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
#productos .grid .ficha { border-radius: 0; border: 0; box-shadow: none !important; }
|
||||
|
||||
/* line 25, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/productos.scss */
|
||||
#productos .grid .ficha .content .segment {
|
||||
background-color: #e6e6e7 !important;
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
font-weight: 300;
|
||||
}
|
||||
#productos .grid .ficha .content .segment { background-color: #e6e6e7 !important; padding-top: 0 !important; padding-bottom: 0 !important; font-weight: 300; }
|
||||
|
||||
/* line 31, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/productos.scss */
|
||||
#productos .grid .ficha .content .button {
|
||||
font-family: inherit !important;
|
||||
font-weight: 900;
|
||||
padding-top: 0.3rem !important;
|
||||
padding-bottom: 0.3rem !important;
|
||||
background-color: #0d103c !important;
|
||||
}
|
||||
#productos .grid .ficha .content .button { font-family: inherit !important; font-weight: 900; padding-top: 0.3rem !important; padding-bottom: 0.3rem !important; background-color: #0d103c !important; }
|
||||
|
||||
/* line 39, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/productos.scss */
|
||||
#productos .grid .ficha .image {
|
||||
overflow: hidden;
|
||||
}
|
||||
#productos .grid .ficha .image { height: 11rem; overflow: hidden; display: flex; align-items: center; }
|
||||
|
||||
/* line 42, ../../Workspace/git/provm/capitalinvestments/resources/assets/sass/productos.scss */
|
||||
#productos .grid .ficha .overlay {
|
||||
background-color: #0d103c;
|
||||
color: white;
|
||||
opacity: 0.8;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
top: 1.9rem;
|
||||
right: -2.2rem;
|
||||
width: 10rem;
|
||||
padding-top: .3rem;
|
||||
padding-bottom: .3rem;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
#productos .grid .ficha .image img { width: 100%; vertical-align: middle; }
|
||||
|
||||
/*# sourceMappingURL=productos.css.map */
|
||||
#productos .grid .ficha .overlay { background-color: #0d103c; color: white; opacity: 0.8; text-align: center; position: absolute; z-index: 999; top: 1.9rem; right: -2.2rem; width: 10rem; padding-top: .3rem; padding-bottom: .3rem; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); }
|
||||
|
@ -6,9 +6,9 @@
|
||||
"../../../resources/assets/sass/_pallete.scss"
|
||||
],
|
||||
"sourcesContent": [
|
||||
"@import 'pallete';\r\n\r\n#productos {\r\n background-color: $gris-medio;\r\n padding-top: 2rem;\r\n\r\n .titulo {\r\n color: $azul-oscuro !important;\r\n }\r\n\r\n .tabular.menu .item {\r\n color: #404041 !important;\r\n }\r\n\r\n .grid {\r\n padding-top: 2rem;\r\n padding-bottom: 2rem;\r\n\r\n .ficha {\r\n border-radius: 0;\r\n border: 0;\r\n box-shadow: none !important;\r\n\r\n .content {\r\n .segment {\r\n background-color: #e6e6e7 !important;\r\n padding-top: 0 !important;\r\n padding-bottom: 0 !important;\r\n font-weight: 300;\r\n }\r\n .button {\r\n font-family: inherit !important;\r\n font-weight: 900;\r\n padding-top: 0.3rem !important;\r\n padding-bottom: 0.3rem !important;\r\n background-color: $azul-oscuro !important;\r\n }\r\n }\r\n .image {\r\n overflow: hidden;\r\n }\r\n .overlay {\r\n background-color: $azul-oscuro;\r\n color: white;\r\n opacity: 0.8;\r\n text-align: center;\r\n position: absolute;\r\n z-index: 999;\r\n top: 1.9rem;\r\n right: -2.2rem;\r\n width: 10rem;\r\n padding-top: .3rem;\r\n padding-bottom: .3rem;\r\n -webkit-transform: rotate(45deg);\r\n -moz-transform: rotate(45deg);\r\n -ms-transform: rotate(45deg);\r\n -o-transform: rotate(45deg);\r\n transform: rotate(45deg);\r\n }\r\n }\r\n }\r\n}\r\n",
|
||||
"@import 'pallete';\r\n\r\n#productos {\r\n background-color: $gris-medio;\r\n padding-top: 2rem;\r\n\r\n .titulo {\r\n color: $azul-oscuro !important;\r\n }\r\n\r\n .tabular.menu .item {\r\n color: #404041 !important;\r\n }\r\n\r\n .grid {\r\n padding-top: 2rem;\r\n padding-bottom: 2rem;\r\n\r\n .ficha {\r\n border-radius: 0;\r\n border: 0;\r\n box-shadow: none !important;\r\n\r\n .content {\r\n .segment {\r\n background-color: #e6e6e7 !important;\r\n padding-top: 0 !important;\r\n padding-bottom: 0 !important;\r\n font-weight: 300;\r\n }\r\n .button {\r\n font-family: inherit !important;\r\n font-weight: 900;\r\n padding-top: 0.3rem !important;\r\n padding-bottom: 0.3rem !important;\r\n background-color: $azul-oscuro !important;\r\n }\r\n }\r\n .image {\r\n height: 11rem;\r\n overflow: hidden;\r\n display: flex;\r\n align-items: center;\r\n img {\r\n width: 100%;\r\n vertical-align: middle;\r\n }\r\n }\r\n .overlay {\r\n background-color: $azul-oscuro;\r\n color: white;\r\n opacity: 0.8;\r\n text-align: center;\r\n position: absolute;\r\n z-index: 999;\r\n top: 1.9rem;\r\n right: -2.2rem;\r\n width: 10rem;\r\n padding-top: .3rem;\r\n padding-bottom: .3rem;\r\n -webkit-transform: rotate(45deg);\r\n -moz-transform: rotate(45deg);\r\n -ms-transform: rotate(45deg);\r\n -o-transform: rotate(45deg);\r\n transform: rotate(45deg);\r\n }\r\n }\r\n }\r\n}\r\n",
|
||||
"$marca: #429ab7;\r\n$gris-oscuro: #808284;\r\n$gris-medio: #a7a9ab;\r\n$gris-claro: #f4f4f4;\r\n$azul-oscuro: #0d103c;\r\n"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": ";AAEA,AAAA,UAAU,CAAC;EACT,gBAAgB,ECDL,OAAO;EDElB,WAAW,EAAE,IAAI;CAyDlB;;;AA3DD,AAIE,UAJQ,CAIR,OAAO,CAAC;EACN,KAAK,ECHK,OAAO,CDGG,UAAU;CAC/B;;;AANH,AAQE,UARQ,CAQR,QAAQ,AAAA,KAAK,CAAC,KAAK,CAAC;EAClB,KAAK,EAAE,kBAAkB;CAC1B;;;AAVH,AAYE,UAZQ,CAYR,KAAK,CAAC;EACJ,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;CA4CrB;;;AA1DH,AAgBI,UAhBM,CAYR,KAAK,CAIH,MAAM,CAAC;EACL,aAAa,EAAE,CAAC;EAChB,MAAM,EAAE,CAAC;EACT,UAAU,EAAE,eAAe;CAsC5B;;;AAzDL,AAsBQ,UAtBE,CAYR,KAAK,CAIH,MAAM,CAKJ,QAAQ,CACN,QAAQ,CAAC;EACP,gBAAgB,EAAE,kBAAkB;EACpC,WAAW,EAAE,YAAY;EACzB,cAAc,EAAE,YAAY;EAC5B,WAAW,EAAE,GAAG;CACjB;;;AA3BT,AA4BQ,UA5BE,CAYR,KAAK,CAIH,MAAM,CAKJ,QAAQ,CAON,OAAO,CAAC;EACN,WAAW,EAAE,kBAAkB;EAC/B,WAAW,EAAE,GAAG;EAChB,WAAW,EAAE,iBAAiB;EAC9B,cAAc,EAAE,iBAAiB;EACjC,gBAAgB,EC/BZ,OAAO,CD+BoB,UAAU;CAC1C;;;AAlCT,AAoCM,UApCI,CAYR,KAAK,CAIH,MAAM,CAoBJ,MAAM,CAAC;EACL,QAAQ,EAAE,MAAM;CACjB;;;AAtCP,AAuCM,UAvCI,CAYR,KAAK,CAIH,MAAM,CAuBJ,QAAQ,CAAC;EACP,gBAAgB,ECtCV,OAAO;EDuCb,KAAK,EAAE,KAAK;EACZ,OAAO,EAAE,GAAG;EACZ,UAAU,EAAE,MAAM;EAClB,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,GAAG;EACZ,GAAG,EAAE,MAAM;EACX,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,KAAK;EAClB,cAAc,EAAE,KAAK;EACrB,iBAAiB,EAAE,aAAa;EAChC,cAAc,EAAE,aAAa;EAC7B,aAAa,EAAE,aAAa;EAC5B,YAAY,EAAE,aAAa;EAC3B,SAAS,EAAE,aAAa;CACzB"
|
||||
"mappings": ";AAEA,AAAA,UAAU,CAAC;EACT,gBAAgB,ECDL,OAAO;EDElB,WAAW,EAAE,IAAI;CAgElB;;;AAlED,AAIE,UAJQ,CAIR,OAAO,CAAC;EACN,KAAK,ECHK,OAAO,CDGG,UAAU;CAC/B;;;AANH,AAQE,UARQ,CAQR,QAAQ,AAAA,KAAK,CAAC,KAAK,CAAC;EAClB,KAAK,EAAE,kBAAkB;CAC1B;;;AAVH,AAYE,UAZQ,CAYR,KAAK,CAAC;EACJ,WAAW,EAAE,IAAI;EACjB,cAAc,EAAE,IAAI;CAmDrB;;;AAjEH,AAgBI,UAhBM,CAYR,KAAK,CAIH,MAAM,CAAC;EACL,aAAa,EAAE,CAAC;EAChB,MAAM,EAAE,CAAC;EACT,UAAU,EAAE,eAAe;CA6C5B;;;AAhEL,AAsBQ,UAtBE,CAYR,KAAK,CAIH,MAAM,CAKJ,QAAQ,CACN,QAAQ,CAAC;EACP,gBAAgB,EAAE,kBAAkB;EACpC,WAAW,EAAE,YAAY;EACzB,cAAc,EAAE,YAAY;EAC5B,WAAW,EAAE,GAAG;CACjB;;;AA3BT,AA4BQ,UA5BE,CAYR,KAAK,CAIH,MAAM,CAKJ,QAAQ,CAON,OAAO,CAAC;EACN,WAAW,EAAE,kBAAkB;EAC/B,WAAW,EAAE,GAAG;EAChB,WAAW,EAAE,iBAAiB;EAC9B,cAAc,EAAE,iBAAiB;EACjC,gBAAgB,EC/BZ,OAAO,CD+BoB,UAAU;CAC1C;;;AAlCT,AAoCM,UApCI,CAYR,KAAK,CAIH,MAAM,CAoBJ,MAAM,CAAC;EACL,MAAM,EAAE,KAAK;EACb,QAAQ,EAAE,MAAM;EAChB,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,MAAM;CAKpB;;;AA7CP,AAyCQ,UAzCE,CAYR,KAAK,CAIH,MAAM,CAoBJ,MAAM,CAKJ,GAAG,CAAC;EACF,KAAK,EAAE,IAAI;EACX,cAAc,EAAE,MAAM;CACvB;;;AA5CT,AA8CM,UA9CI,CAYR,KAAK,CAIH,MAAM,CA8BJ,QAAQ,CAAC;EACP,gBAAgB,EC7CV,OAAO;ED8Cb,KAAK,EAAE,KAAK;EACZ,OAAO,EAAE,GAAG;EACZ,UAAU,EAAE,MAAM;EAClB,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,GAAG;EACZ,GAAG,EAAE,MAAM;EACX,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,KAAK;EACZ,WAAW,EAAE,KAAK;EAClB,cAAc,EAAE,KAAK;EACrB,iBAAiB,EAAE,aAAa;EAChC,cAAc,EAAE,aAAa;EAC7B,aAAa,EAAE,aAAa;EAC5B,YAAY,EAAE,aAAa;EAC3B,SAAS,EAAE,aAAa;CACzB"
|
||||
}
|
@ -10,4 +10,7 @@
|
||||
.header, .title, .content {
|
||||
color: inherit;
|
||||
}
|
||||
.accordion {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,14 @@
|
||||
}
|
||||
}
|
||||
.image {
|
||||
height: 11rem;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
img {
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.overlay {
|
||||
background-color: #0d103c;
|
||||
@ -142,22 +149,28 @@
|
||||
background-color: $gris-medio;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
min-height: 5rem;
|
||||
height: 4rem;
|
||||
|
||||
.slideshow {
|
||||
overflow: hidden;
|
||||
height: 6rem;
|
||||
text-align: center;
|
||||
height: 2rem;
|
||||
|
||||
.slide {
|
||||
display: inline-block;
|
||||
display: inline;
|
||||
float: left;
|
||||
background-color: white;
|
||||
color: white;
|
||||
padding: 0;
|
||||
margin: 1rem;
|
||||
width: 8rem !important;
|
||||
padding-top: .5rem;
|
||||
padding-bottom: .5rem;
|
||||
margin-right: 1rem;
|
||||
text-align: center;
|
||||
|
||||
.value:last-child {
|
||||
padding-left: 0.3rem;
|
||||
font-weight: 100 !important;
|
||||
}
|
||||
padding-left: 1rem;
|
||||
padding-right: 2rem;
|
||||
border-right: thin solid black;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,15 @@ header {
|
||||
font-size: 2rem;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
#productos_menu .menu {
|
||||
border: thin solid white;
|
||||
box-shadow: none;
|
||||
|
||||
.item:hover {
|
||||
background-color: $gris-medio !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
background-color: $gris-medio;
|
||||
color: white;
|
||||
|
||||
font-size: 1.2rem !important;
|
||||
|
||||
padding-top: 3rem;
|
||||
padding-bottom: 4rem;
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
.titulo {
|
||||
color: $azul-oscuro !important;
|
||||
padding-top: 2rem;
|
||||
.header {
|
||||
color: $azul-oscuro !important;
|
||||
}
|
||||
@ -89,6 +90,8 @@
|
||||
}
|
||||
.segment {
|
||||
border: none !important;
|
||||
background-color: $gris-oscuro;
|
||||
color: white;
|
||||
|
||||
.informacion {
|
||||
.row {
|
||||
|
@ -37,7 +37,14 @@
|
||||
}
|
||||
}
|
||||
.image {
|
||||
height: 11rem;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
img {
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
.overlay {
|
||||
background-color: $azul-oscuro;
|
||||
|
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
use ProVM\KI\Common\Controller\Web\Admin\Home;
|
||||
|
||||
$app->group('/admin', function($app) {
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
__DIR__,
|
||||
@ -13,4 +15,5 @@ $app->group('/admin', function($app) {
|
||||
include_once $file->getRealPath();
|
||||
}
|
||||
}
|
||||
$app->get('[/]', Home::class);
|
||||
});
|
||||
|
@ -2,6 +2,7 @@
|
||||
use ProVM\KI\Common\Controller\Web\Admin\Productos;
|
||||
|
||||
$app->group('/productos', function($app) {
|
||||
$app->post('/campos', [Productos::class, 'fields']);
|
||||
$app->group('/add', function($app) {
|
||||
$app->get('[/]', [Productos::class, 'add']);
|
||||
$app->post('[/]', [Productos::class, 'do_add']);
|
||||
|
@ -2,3 +2,4 @@
|
||||
use ProVM\KI\Common\Controller\Web\Contacto;
|
||||
|
||||
$app->get('/contacto', Contacto::class);
|
||||
$app->post('/contacto', [Contacto::class, 'enviar']);
|
||||
|
@ -41,57 +41,62 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var edit = false
|
||||
var faqs = [
|
||||
@foreach ($faqs as $faq)
|
||||
{
|
||||
titulo: '{{$faq->titulo}}',
|
||||
contenido: '{{$faq->contenido}}'
|
||||
},
|
||||
@endforeach
|
||||
]
|
||||
$(document).ready(() => {
|
||||
$('.titulo').css('cursor', 'pointer').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
var faq = {
|
||||
edit: false,
|
||||
faqs: [
|
||||
@foreach ($faqs as $faq)
|
||||
{
|
||||
titulo: '{{$faq->titulo}}',
|
||||
contenido: "{{implode("\\n", explode(PHP_EOL, $faq->contenido))}}"
|
||||
},
|
||||
@endforeach
|
||||
],
|
||||
setup: () => {
|
||||
$('.titulo').css('cursor', 'pointer').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
|
||||
$("input[name='id']").val(id)
|
||||
$("input[name='titulo']").val(faqs[id].titulo)
|
||||
$("textarea[name='contenido']").val(faqs[id].contenido)
|
||||
$('.button.enviar').html('EDITAR')
|
||||
edit = true
|
||||
})
|
||||
$('.trash.icon').css('cursor', 'pointer').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
var url = '{{$urls->admin}}/faqs/delete'
|
||||
$.post(url, {id: id}, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
$("input[name='id']").val(id)
|
||||
$("input[name='titulo']").val(faq.faqs[id].titulo)
|
||||
$("textarea[name='contenido']").val(faq.faqs[id].contenido)
|
||||
$('.button.enviar').html('EDITAR')
|
||||
faq.edit = true
|
||||
})
|
||||
})
|
||||
$('.button.resetear').click(() => {
|
||||
$("input[name='id']").val('')
|
||||
$('.button.enviar').html('AGREGAR')
|
||||
edit = false
|
||||
})
|
||||
$('.form').trigger('reset')
|
||||
$('.form').submit((e) => {
|
||||
e.preventDefault()
|
||||
var input = {
|
||||
titulo: $("input[name='titulo']").val(),
|
||||
contenido: $("textarea[name='contenido']").val()
|
||||
}
|
||||
if (edit) {
|
||||
input['id'] = $("input[name='id']").val()
|
||||
}
|
||||
var url = '{{$urls->admin}}/faqs/add'
|
||||
$.post(url, input, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
$('.trash.icon').css('cursor', 'pointer').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
var url = '{{$urls->admin}}/faqs/delete'
|
||||
$.post(url, {id: id}, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
})
|
||||
return false
|
||||
})
|
||||
$('.button.resetear').click(() => {
|
||||
$("input[name='id']").val('')
|
||||
$('.button.enviar').html('AGREGAR')
|
||||
faq.edit = false
|
||||
})
|
||||
$('.form').trigger('reset')
|
||||
$('.form').submit((e) => {
|
||||
e.preventDefault()
|
||||
var input = {
|
||||
titulo: $("input[name='titulo']").val(),
|
||||
contenido: $("textarea[name='contenido']").val()
|
||||
}
|
||||
if (faq.edit) {
|
||||
input['id'] = $("input[name='id']").val()
|
||||
}
|
||||
var url = '{{$urls->admin}}/faqs/add'
|
||||
$.post(url, input, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
return false
|
||||
})
|
||||
}
|
||||
}
|
||||
$(document).ready(() => {
|
||||
faq.setup()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -81,93 +81,98 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var edit = false
|
||||
function editAviso(id) {
|
||||
var titulo = $(".link.titulo[data-id='" + id + "']").html()
|
||||
var contenido = $(".link.contenido[data-id='" + id + "']").html()
|
||||
var home = {
|
||||
edit: false,
|
||||
editAviso: (id) => {
|
||||
var titulo = $(".link.titulo[data-id='" + id + "']").html()
|
||||
var contenido = $(".link.contenido[data-id='" + id + "']").html()
|
||||
|
||||
$("input[name='id']").val(id)
|
||||
$("input[name='titulo']").val(titulo)
|
||||
$("input[name='contenido']").val(contenido)
|
||||
edit = true
|
||||
$('.accion').html('EDITAR')
|
||||
}
|
||||
function submitAviso(e) {
|
||||
e.preventDefault()
|
||||
input = {
|
||||
titulo: $("input[name='titulo']").val(),
|
||||
contenido: $("input[name='contenido']").val()
|
||||
}
|
||||
if (edit) {
|
||||
input['id'] = $("input[name='id']").val()
|
||||
}
|
||||
if (input['titulo'] == '') {
|
||||
return false
|
||||
}
|
||||
var url = '{{$urls->admin}}/home/avisos/add'
|
||||
$.post(url, input, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
}, 'json')
|
||||
return false
|
||||
}
|
||||
function deleteAviso(id) {
|
||||
var url = '{{$urls->admin}}/home/avisos/delete'
|
||||
$.post(url, {id: id}, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
}, 'json')
|
||||
}
|
||||
$(document).ready(() => {
|
||||
$('.link').css('cursor', 'pointer').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
editAviso(id)
|
||||
})
|
||||
$('#avisos').trigger('reset')
|
||||
$('#avisos').submit((e) => {
|
||||
submitAviso(e)
|
||||
})
|
||||
$(".button[type='reset']").click((e) => {
|
||||
$("input[name='id']").val('')
|
||||
$('.accion').html('CREAR')
|
||||
edit = false
|
||||
})
|
||||
$('.trash.icon').css('cursor', 'pointer').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
deleteAviso(id)
|
||||
})
|
||||
$('.checkbox').checkbox({
|
||||
onChange: function() {
|
||||
var state = $(this).is(':checked')
|
||||
var url = '{{$urls->admin}}/home/avisos/add'
|
||||
$.post(url, {estado: state}, (data) => {
|
||||
console.debug(data)
|
||||
})
|
||||
}
|
||||
})
|
||||
@if ($avisos->activo)
|
||||
$('.checkbox').checkbox('set checked')
|
||||
@endif
|
||||
$('#resumen').submit((e) => {
|
||||
$("input[name='id']").val(id)
|
||||
$("input[name='titulo']").val(titulo)
|
||||
$("input[name='contenido']").val(contenido)
|
||||
home.edit = true
|
||||
$('.accion').html('EDITAR')
|
||||
},
|
||||
submitAviso: (e) => {
|
||||
e.preventDefault()
|
||||
return false
|
||||
})
|
||||
$('.guardar').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
var url = '{{$urls->admin}}/home/resumen/edit'
|
||||
input = {
|
||||
id: id,
|
||||
titulo: $("input[name='titulo" + id + "']").val(),
|
||||
cantidad: $("input[name='cantidad" + id + "']").val()
|
||||
titulo: $("input[name='titulo']").val(),
|
||||
contenido: $("input[name='contenido']").val()
|
||||
}
|
||||
if (home.edit) {
|
||||
input['id'] = $("input[name='id']").val()
|
||||
}
|
||||
if (input['titulo'] == '') {
|
||||
return false
|
||||
}
|
||||
var url = '{{$urls->admin}}/home/avisos/add'
|
||||
$.post(url, input, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
}, 'json')
|
||||
return false
|
||||
},
|
||||
deleteAviso: (id) => {
|
||||
var url = '{{$urls->admin}}/home/avisos/delete'
|
||||
$.post(url, {id: id}, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
}, 'json')
|
||||
},
|
||||
setup: () => {
|
||||
$('.link').css('cursor', 'pointer').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
home.editAviso(id)
|
||||
})
|
||||
})
|
||||
$('#avisos').trigger('reset')
|
||||
$('#avisos').submit((e) => {
|
||||
home.submitAviso(e)
|
||||
})
|
||||
$(".button[type='reset']").click((e) => {
|
||||
$("input[name='id']").val('')
|
||||
$('.accion').html('CREAR')
|
||||
home.edit = false
|
||||
})
|
||||
$('.trash.icon').css('cursor', 'pointer').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
home.deleteAviso(id)
|
||||
})
|
||||
$('.checkbox').checkbox({
|
||||
onChange: function() {
|
||||
var state = $(this).is(':checked')
|
||||
var url = '{{$urls->admin}}/home/avisos/add'
|
||||
$.post(url, {estado: state}, (data) => {
|
||||
console.debug(data)
|
||||
})
|
||||
}
|
||||
})
|
||||
@if ($avisos->activo)
|
||||
$('.checkbox').checkbox('set checked')
|
||||
@endif
|
||||
$('#resumen').submit((e) => {
|
||||
e.preventDefault()
|
||||
return false
|
||||
})
|
||||
$('.guardar').click(function() {
|
||||
var id = $(this).attr('data-id')
|
||||
var url = '{{$urls->admin}}/home/resumen/edit'
|
||||
input = {
|
||||
id: id,
|
||||
titulo: $("input[name='titulo" + id + "']").val(),
|
||||
cantidad: $("input[name='cantidad" + id + "']").val()
|
||||
}
|
||||
$.post(url, input, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
$(document).ready(() => {
|
||||
home.setup()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -16,22 +16,22 @@
|
||||
<div class="fields">
|
||||
<div class="field">
|
||||
<label>Dirección</label>
|
||||
<input type="text" name="direccion" value="{{$producto->direccion ?? ''}}" />
|
||||
<input type="text" name="calle" value="{{$producto->direccion->calle ?? ''}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Comuna</label>
|
||||
<input type="text" name="comuna" value="{{$producto->comuna ?? ''}}" />
|
||||
<input type="text" name="comuna" value="{{$producto->direccion->comuna ?? ''}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Ciudad</label>
|
||||
<input type="text" name="ciudad" value="{{$producto->ciudad ?? ''}}" />
|
||||
<input type="text" name="ciudad" value="{{$producto->direccion->ciudad ?? ''}}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Segmento</label>
|
||||
<div class="ui selection dropdown">
|
||||
<div class="ui selection dropdown" id="segmento">
|
||||
<input type="hidden" name="segmento" />
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="default text">Segmento</div>
|
||||
@ -49,32 +49,6 @@
|
||||
<input type="text" name="valor" value="{{str_replace('.', '', $producto->valor ?? '')}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Bono Pie en UF</label>
|
||||
<input type="text" name="bono" value="{{$producto->bono ?? ''}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Rentabilidad %</label>
|
||||
<input type="text" name="rentabilidad" value="{{$producto->rentabilidad ?? ''}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Valor Cuota en UF</label>
|
||||
<input type="text" name="cuota" value="{{$producto->cuota ?? ''}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Entrega Estimada</label>
|
||||
<div class="ui calendar">
|
||||
<input type="text" name="entrega" placeholder="Entrega" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Destacado</label>
|
||||
@ -83,40 +57,22 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Estado</label>
|
||||
<input type="text" name="estado" value="{{$producto->estado ?? ''}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Unidades</label>
|
||||
<input type="text" name="unidades" value="{{$producto->unidades ?? ''}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Modelos</label>
|
||||
<input type="text" name="modelos" value="{{$producto->modelos ?? ''}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="fields">
|
||||
<span id="campos"></span>
|
||||
@foreach ($properties as $property)
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Tamaño Mínimo</label>
|
||||
<input type="text" name="tamaño_min" value="{{(isset($producto->tamaño)) ? explode(' - ', rtrim($producto->tamaño, ' m²'))[0] : ''}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Tamaño Máximo</label>
|
||||
<input type="text" name="tamaño_max" value="{{(isset($producto->tamaño)) ? explode(' - ', rtrim($producto->tamaño, ' m²'))[1] : ''}}" />
|
||||
<label>{{$property->label}}</label>
|
||||
<input type="text" name="{{$property->name}}" value="{{$producto->{$property->name} ?? ''}}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ten wide column">
|
||||
<div class="field">
|
||||
<label>Descripción</label>
|
||||
<textarea rows="1" name="descripcion">{{$producto->descripcion ?? ''}}</textarea>
|
||||
@endforeach
|
||||
<span id="end_campos"></span>
|
||||
<div class="row">
|
||||
<div class="ten wide column">
|
||||
<div class="field">
|
||||
<label>Descripción</label>
|
||||
<textarea rows="1" name="descripcion">{{$producto->descripcion ?? ''}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
@ -126,25 +82,6 @@
|
||||
</div>
|
||||
<div id="imagenes" class="ui list"></div>
|
||||
</div>
|
||||
<?php
|
||||
/*
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Video</label>
|
||||
<input type="file" name="video" />
|
||||
</div>
|
||||
<div class="ui list">
|
||||
@if (isset($producto->video))
|
||||
<div class="item">
|
||||
<i class="trash alternate outline icon video"></i>
|
||||
<div class="content">
|
||||
{{$producto->video}}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
*/?>
|
||||
</div>
|
||||
<br />
|
||||
<button class="ui button">GUARDAR</button>
|
||||
@ -153,109 +90,143 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var months = {
|
||||
long: [],
|
||||
short: []
|
||||
}
|
||||
var date = new Date(2018, 0, 1)
|
||||
for (i = 0; i < 12; i ++) {
|
||||
date.setMonth(i)
|
||||
months.long.push(date.toLocaleString('es-ES', {month: "long"}).replace(
|
||||
/\w\S*/g,
|
||||
function(txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
}
|
||||
))
|
||||
months.short.push(date.toLocaleString('es-ES', {month: "short"}).replace(
|
||||
/\w\S*/g,
|
||||
function(txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
}
|
||||
))
|
||||
}
|
||||
function listImage(image) {
|
||||
var icon = $('<i></i>').attr('class', 'trash alternate outline icon')
|
||||
icon.css('cursor', 'pointer').click(function() {
|
||||
var url = '{{$urls->admin}}/producto/{{$producto->id}}/imagen/delete'
|
||||
$.post(url, {imagen: image}, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
var producto = {
|
||||
months: {
|
||||
long: [],
|
||||
short: []
|
||||
},
|
||||
date: new Date(2018, 0, 1),
|
||||
listImage: (image) => {
|
||||
var icon = $('<i></i>').attr('class', 'trash alternate outline icon')
|
||||
icon.css('cursor', 'pointer').click(function() {
|
||||
var url = '{{$urls->admin}}/producto/{{$producto->id}}/imagen/delete'
|
||||
$.post(url, {imagen: image}, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
})
|
||||
$('#imagenes').append(
|
||||
$('<div></div>').attr('class', 'item').append(
|
||||
icon
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'content').html(image)
|
||||
)
|
||||
)
|
||||
},
|
||||
setMonths: () => {
|
||||
for (i = 0; i < 12; i ++) {
|
||||
producto.date.setMonth(i)
|
||||
producto.months.long.push(producto.date.toLocaleString('es-ES', {month: "long"}).replace(
|
||||
/\w\S*/g,
|
||||
function(txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
}
|
||||
))
|
||||
producto.months.short.push(producto.date.toLocaleString('es-ES', {month: "short"}).replace(
|
||||
/\w\S*/g,
|
||||
function(txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
}
|
||||
))
|
||||
}
|
||||
},
|
||||
setup: () => {
|
||||
producto.setMonths()
|
||||
$('#segmento').dropdown({
|
||||
onChange: () => {
|
||||
producto.changeSegmento()
|
||||
}
|
||||
})
|
||||
})
|
||||
$('#imagenes').append(
|
||||
$('<div></div>').attr('class', 'item').append(
|
||||
icon
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'content').html(image)
|
||||
$('#segmento').dropdown('set selected', '{{$producto->segmento}}')
|
||||
producto.linkCalendar()
|
||||
$('.checkbox').checkbox()
|
||||
@if ($producto->destacado())
|
||||
$('.checkbox').checkbox('set checked')
|
||||
@endif
|
||||
$("input[name='imagen']").change(function() {
|
||||
var data = new FormData()
|
||||
data.append('imagen', $(this)[0].files[0])
|
||||
var url = '{{$urls->admin}}/producto/{{$producto->id}}/imagenes/add'
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: 'post',
|
||||
data: data,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
@foreach ($producto->imagenes() as $image)
|
||||
producto.listImage('{{$image}}')
|
||||
@endforeach
|
||||
},
|
||||
linkCalendar: () => {
|
||||
var div = $("input[name='entrega']").parent()
|
||||
div.find('input').remove()
|
||||
div.append(
|
||||
$('<div></div>').attr('class', 'ui calendar').append(
|
||||
$('<input />').attr('type', 'text').attr('name', 'entrega').attr('placeholder', 'Entrega')
|
||||
)
|
||||
)
|
||||
)
|
||||
$('.calendar').calendar({
|
||||
type: 'month',
|
||||
text: {
|
||||
months: producto.months.long,
|
||||
monthsShort: producto.months.short
|
||||
},
|
||||
formatInput: false,
|
||||
onChange: function(a, b) {
|
||||
if (typeof a == 'undefined') {
|
||||
a = new Date()
|
||||
}
|
||||
$(this).find('input').val(('0' + (a.getMonth() + 1)).slice(-2) + '/' + a.getFullYear())
|
||||
}
|
||||
})
|
||||
@if (isset($producto->entrega))
|
||||
var entrega = new Date('{{str_pad(implode('-', array_reverse(explode('/', $producto->entrega))), 7, '20', STR_PAD_LEFT)}}-01T01:00')
|
||||
$('.calendar').calendar('set date', entrega)
|
||||
@endif
|
||||
},
|
||||
changeSegmento: () => {
|
||||
var segmento = $('#segmento').dropdown('get value')
|
||||
if (segmento == '{{$producto->segmento}}') {
|
||||
return
|
||||
}
|
||||
var url = '{{$urls->admin}}/productos/campos'
|
||||
$.post(url, {segmento: segmento}, (data) => {
|
||||
var div = $('#campos')
|
||||
var end = $('#end_campos')
|
||||
var current = div.next()
|
||||
var next = current.next()
|
||||
if (current[0] == end[0] || next[0] == end[0]) {
|
||||
} else {
|
||||
while (next[0] != end[0] || next.length == 0) {
|
||||
current.remove()
|
||||
current = next
|
||||
next = next.next()
|
||||
}
|
||||
}
|
||||
$.each(data.fields, (i, el) => {
|
||||
var campo = $('<div></div>').attr('class', 'column').append(
|
||||
$('<div></div>').attr('class', 'field').append(
|
||||
$('<label></label>').html(el.label)
|
||||
).append(
|
||||
$('<input />').attr('type', 'text').attr('name', el.name)
|
||||
)
|
||||
)
|
||||
end.before(campo)
|
||||
})
|
||||
producto.linkCalendar()
|
||||
})
|
||||
}
|
||||
}
|
||||
$(document).ready(() => {
|
||||
$('.selection.dropdown').dropdown()
|
||||
$('.selection.dropdown').dropdown('set selected', '{{$producto->segmento}}')
|
||||
$('.calendar').calendar({
|
||||
type: 'month',
|
||||
text: {
|
||||
months: months.long,
|
||||
monthsShort: months.short
|
||||
},
|
||||
formatInput: false,
|
||||
onChange: function(a, b) {
|
||||
$(this).find('input').val(('0' + (a.getMonth() + 1)).slice(-2) + '/' + a.getFullYear())
|
||||
}
|
||||
})
|
||||
var entrega = new Date('{{str_pad(implode('-', array_reverse(explode('/', $producto->entrega))), 7, '20', STR_PAD_LEFT)}}-01T01:00')
|
||||
$('.calendar').calendar('set date', entrega)
|
||||
$('.checkbox').checkbox()
|
||||
@if ($producto->destacado)
|
||||
$('.checkbox').checkbox('set checked')
|
||||
@endif
|
||||
$("input[name='imagen']").change(function() {
|
||||
var data = new FormData()
|
||||
data.append('imagen', $(this)[0].files[0])
|
||||
var url = '{{$urls->admin}}/producto/{{$producto->id}}/imagenes/add'
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: 'post',
|
||||
data: data,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
@foreach ($producto->images as $image)
|
||||
listImage('{{$image}}')
|
||||
@endforeach
|
||||
$("input[name='video']").change(function() {
|
||||
var fData = new FormData()
|
||||
fData.append('video', $("input[name='video']")[0].files[0])
|
||||
var url = '{{$urls->admin}}/producto/{{$producto->id}}/video/set'
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: 'post',
|
||||
data: fData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
$('.trash.video').attr('cursor', 'pointer').click(() => {
|
||||
var url = '{{$urls->admin}}/producto/{{$producto->id}}/video/delete'
|
||||
$.post(url, {}, (data) => {
|
||||
if (data.estado) {
|
||||
window.location.reload()
|
||||
}
|
||||
})
|
||||
})
|
||||
producto.setup()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -22,19 +22,19 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($productos as $i => $producto)
|
||||
@foreach ($productos as $producto)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{$urls->admin}}/producto/{{$i}}">
|
||||
<a href="{{$urls->admin}}/producto/{{$producto->id}}">
|
||||
{{$producto->nombre}}
|
||||
</a>
|
||||
</td>
|
||||
<td class="center aligned">
|
||||
<a href="{{$urls->admin}}/producto/{{$i}}">
|
||||
<a href="{{$urls->admin}}/producto/{{$producto->id}}">
|
||||
<i class="edit icon"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td class="center aligned"><i class="trash alternate outline icon" data-id="{{$i}}"></i></td>
|
||||
<td class="center aligned"><i class="trash alternate outline icon" data-id="{{$producto->id}}"></i></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div class="fields">
|
||||
<div class="field">
|
||||
<label>Dirección</label>
|
||||
<input type="text" name="direccion" />
|
||||
<input type="text" name="calle" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Comuna</label>
|
||||
@ -31,7 +31,7 @@
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Segmento</label>
|
||||
<div class="ui selection dropdown">
|
||||
<div class="ui selection dropdown" id="segmento">
|
||||
<input type="hidden" name="segmento" />
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="default text">Segmento</div>
|
||||
@ -49,32 +49,6 @@
|
||||
<input type="text" name="valor" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Bono Pie en UF</label>
|
||||
<input type="text" name="bono" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Rentabilidad %</label>
|
||||
<input type="text" name="rentabilidad" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Valor Cuota en UF</label>
|
||||
<input type="text" name="cuota" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Entrega Estimada</label>
|
||||
<div class="ui calendar">
|
||||
<input type="text" name="entrega" placeholder="Entrega" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Destacado</label>
|
||||
@ -83,40 +57,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Estado</label>
|
||||
<input type="text" name="estado" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Unidades</label>
|
||||
<input type="text" name="unidades" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="field">
|
||||
<label>Modelos</label>
|
||||
<input type="text" name="modelos" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="fields">
|
||||
<div id="campos"></div>
|
||||
<div id="end_campos"></div>
|
||||
<div class="row">
|
||||
<div class="ten wide column">
|
||||
<div class="field">
|
||||
<label>Tamaño Mínimo</label>
|
||||
<input type="text" name="tamaño_min" />
|
||||
<label>Descripción</label>
|
||||
<textarea rows="1" name="descripcion"></textarea>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Tamaño Máximo</label>
|
||||
<input type="text" name="tamaño_max" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ten wide column">
|
||||
<div class="field">
|
||||
<label>Descripción</label>
|
||||
<textarea rows="1" name="descripcion"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -127,40 +75,80 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var months = {
|
||||
long: [],
|
||||
short: []
|
||||
}
|
||||
var date = new Date(2018, 0, 1)
|
||||
for (i = 0; i < 12; i ++) {
|
||||
date.setMonth(i)
|
||||
months.long.push(date.toLocaleString('es-ES', {month: "long"}).replace(
|
||||
/\w\S*/g,
|
||||
function(txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
var producto = {
|
||||
months: {
|
||||
long: [],
|
||||
short: []
|
||||
},
|
||||
date: new Date(2018, 0, 1),
|
||||
setMonths: () => {
|
||||
for (i = 0; i < 12; i ++) {
|
||||
producto.date.setMonth(i)
|
||||
producto.months.long.push(producto.date.toLocaleString('es-ES', {month: "long"}).replace(
|
||||
/\w\S*/g,
|
||||
function(txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
}
|
||||
))
|
||||
producto.months.short.push(producto.date.toLocaleString('es-ES', {month: "short"}).replace(
|
||||
/\w\S*/g,
|
||||
function(txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
}
|
||||
))
|
||||
}
|
||||
},
|
||||
setup: () => {
|
||||
producto.setMonths()
|
||||
$('#segmento').dropdown({
|
||||
onChange: () => {
|
||||
producto.changeSegmento()
|
||||
}
|
||||
))
|
||||
months.short.push(date.toLocaleString('es-ES', {month: "short"}).replace(
|
||||
/\w\S*/g,
|
||||
function(txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
})
|
||||
$('.calendar').calendar({
|
||||
type: 'month',
|
||||
text: {
|
||||
months: producto.months.long,
|
||||
monthsShort: producto.months.short
|
||||
},
|
||||
formatInput: false,
|
||||
onChange: function(a) {
|
||||
$(this).find('input').val(('0' + (a.getMonth() + 1)).slice(-2) + '/' + a.getFullYear())
|
||||
}
|
||||
))
|
||||
})
|
||||
$('.checkbox').checkbox()
|
||||
},
|
||||
changeSegmento: () => {
|
||||
var segmento = $('#segmento').dropdown('get value')
|
||||
var url = '{{$urls->admin}}/productos/campos'
|
||||
$.post(url, {segmento: segmento}, (data) => {
|
||||
var div = $('#campos')
|
||||
var end = $('#end_campos')
|
||||
var current = div.next()
|
||||
var next = current.next()
|
||||
if (current[0] == end[0] || next[0] == end[0]) {
|
||||
} else {
|
||||
while (next[0] != end[0] || next.length == 0) {
|
||||
current.remove()
|
||||
current = next
|
||||
next = next.next()
|
||||
}
|
||||
}
|
||||
$.each(data.fields, (i, el) => {
|
||||
var campo = $('<div></div>').attr('class', 'column').append(
|
||||
$('<div></div>').attr('class', 'field').append(
|
||||
$('<label></label>').html(el.label)
|
||||
).append(
|
||||
$('<input />').attr('type', 'text').attr('name', el.name)
|
||||
)
|
||||
)
|
||||
end.before(campo)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
$(document).ready(() => {
|
||||
$('.selection.dropdown').dropdown()
|
||||
$('.calendar').calendar({
|
||||
type: 'month',
|
||||
text: {
|
||||
months: months.long,
|
||||
monthsShort: months.short
|
||||
},
|
||||
formatInput: false,
|
||||
onChange: function(a) {
|
||||
$(this).find('input').val(('0' + (a.getMonth() + 1)).slice(-2) + '/' + a.getFullYear())
|
||||
}
|
||||
})
|
||||
$('.checkbox').checkbox()
|
||||
producto.setup()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
39
resources/views/contacto/email.php
Normal file
39
resources/views/contacto/email.php
Normal file
@ -0,0 +1,39 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Contacto Web - {{$nombre}}</title>
|
||||
<!--[if !mso]><!-- -->
|
||||
|
||||
<link href='http://fonts.googleapis.com/css2?family=Roboto' rel='stylesheet' type='text/css' />
|
||||
|
||||
<!--<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family: Roboto, sans-serif; font-size: 12pt; color: rgb(109, 110, 112);">
|
||||
<tr>
|
||||
<td style="font-weight: 700; text-align: right;">
|
||||
Nombre
|
||||
</td>
|
||||
<td colspan="6">
|
||||
{{$nombre}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-weight: 700; text-align: right;">
|
||||
Email
|
||||
</td>
|
||||
<td colspan="6">
|
||||
{{$mail}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-weight: 700; text-align: right; vertical-align: top;">
|
||||
Mensaje
|
||||
</td>
|
||||
<td colspan="6">
|
||||
{{$mensaje}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>
|
||||
{{$faq->contenido}}
|
||||
{!!nl2br($faq->contenido)!!}
|
||||
</p>
|
||||
</div>
|
||||
@endforeach
|
||||
|
@ -1,7 +1,5 @@
|
||||
<div id="indicadores">
|
||||
<div class="ui container">
|
||||
<div class="slideshow ui center aligned grid">
|
||||
</div>
|
||||
<div class="marquee slideshow">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -70,6 +68,7 @@
|
||||
},
|
||||
@endforeach
|
||||
],
|
||||
data: [],
|
||||
id: '#indicadores',
|
||||
current: {{count($indicadores)}},
|
||||
findIndicador: (i) => {
|
||||
@ -77,16 +76,22 @@
|
||||
return $.ajax({
|
||||
url: '{{$urls->base}}/indicador/' + indicador.sim,
|
||||
success: (data) => {
|
||||
var div = $('<div></div>').attr('class', 'two wide column slide').append(
|
||||
$('<div></div>').attr('class', 'ui header').attr('data-title', 'Fecha').attr('data-content', data.valor.fecha).append(indicador.titulo).append(
|
||||
$('<div></div>').attr('class', 'sub header').html(data.valor.valor)
|
||||
)
|
||||
)
|
||||
div.find('.header').popup(9)
|
||||
$(indicadores.id).find('.slideshow').append(div)
|
||||
indicadores.data.push(data.valor)
|
||||
indicadores.putIndicador(indicador.titulo, data.valor)
|
||||
}
|
||||
})
|
||||
},
|
||||
putIndicador: (titulo, data) => {
|
||||
var div = $('<div></div>').attr('class', 'slide').append(
|
||||
$('<div></div>').attr('class', 'ui horizontal mini statistic').attr('data-title', 'Fecha').attr('data-content', data.fecha).append(
|
||||
$('<div></div>').attr('class', 'value').html(titulo)
|
||||
).append(
|
||||
$('<div></div>').attr('class', 'value').html(data.valor)
|
||||
)
|
||||
)
|
||||
div.find('.header').popup()
|
||||
$(indicadores.id).find('.slideshow').append(div)
|
||||
},
|
||||
setup: () => {
|
||||
var promises = []
|
||||
promise = null
|
||||
@ -95,7 +100,13 @@
|
||||
promises.push(promise)
|
||||
})
|
||||
Promise.all(promises).then(() => {
|
||||
//slideshow.setup()
|
||||
$.each(indicadores.data, (i, el) => {
|
||||
indicadores.putIndicador(indicadores.indicadores[i].titulo, el)
|
||||
})
|
||||
$('.marquee').marquee({
|
||||
duration: 20000,
|
||||
gap: 50
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -28,17 +28,22 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var max_width = 0
|
||||
var resumen = {
|
||||
max_width: 0,
|
||||
setup: () => {
|
||||
$('#resumen .circular.segment').each(function(i, el) {
|
||||
var width = $(this).css('width')
|
||||
var w = parseInt(width)
|
||||
if (w > resumen.max_width) {
|
||||
resumen.max_width = w
|
||||
}
|
||||
$(this).css('width', resumen.max_width + 'px')
|
||||
$(this).css('height', resumen.max_width + 'px')
|
||||
})
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('#resumen .circular.segment').each(function(i, el) {
|
||||
var width = $(this).css('width')
|
||||
var w = parseInt(width)
|
||||
if (w > max_width) {
|
||||
max_width = w
|
||||
}
|
||||
$(this).css('width', max_width + 'px')
|
||||
$(this).css('height', max_width + 'px')
|
||||
})
|
||||
resumen.setup()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -27,6 +27,10 @@
|
||||
Enviar
|
||||
</button>
|
||||
</div>
|
||||
<div class="ui message transition hidden" id="mensaje_contacto">
|
||||
<i class="close icon"></i>
|
||||
<span id="msg"></span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -65,3 +69,59 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var contacto = {
|
||||
id: "contacto_form",
|
||||
data: {
|
||||
nombre: '',
|
||||
mail: '',
|
||||
mensaje: ''
|
||||
},
|
||||
output: {
|
||||
id: 'mensaje_contacto',
|
||||
success: 'Mensaje enviado.',
|
||||
},
|
||||
url: '{{$urls->base}}/contacto',
|
||||
getData: () => {
|
||||
var form = $(contacto.id)
|
||||
|
||||
contacto.data.nombre = form.find("[name='nombre']").val()
|
||||
contacto.data.mail = form.find("[name='mail']").val()
|
||||
contacto.data.mensaje = form.find("[name='mensaje']").val()
|
||||
},
|
||||
send: () => {
|
||||
$.post(contacto.url, contacto.data, (data) => {
|
||||
$(contacto.output.id).find('#msg').html(contacto.output.success)
|
||||
$(contacto.output.id).addClass('success').removeClass('hidden').show()
|
||||
$(contacto.output.id).find('.close').click(function() {
|
||||
$(contacto.output.id).find('#msg').html('')
|
||||
$(contacto.output.id).addClass('hidden').removeClass('success error')
|
||||
})
|
||||
}, 'json')
|
||||
},
|
||||
checkIds: () => {
|
||||
if (contacto.id.indexOf('#') < 0) {
|
||||
contacto.id = '#' + contacto.id
|
||||
}
|
||||
if (contacto.output.id.indexOf('#') < 0) {
|
||||
contacto.output.id = '#' + contacto.output.id
|
||||
}
|
||||
},
|
||||
setup: () => {
|
||||
contacto.checkIds()
|
||||
$(contacto.id).submit((e) => {
|
||||
e.preventDefault()
|
||||
|
||||
contacto.getData()
|
||||
contacto.send()
|
||||
return false
|
||||
})
|
||||
}
|
||||
}
|
||||
$(document).ready(() => {
|
||||
contacto.setup()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -26,14 +26,6 @@
|
||||
 
|
||||
{{$header->hora}}
|
||||
</div>
|
||||
<div class="right menu">
|
||||
<div class="item">
|
||||
<div class="ui icon input">
|
||||
<input type="text" placeholder="Buscar" name="search" id="search" />
|
||||
<i class="search link icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,9 +9,14 @@
|
||||
<a class="item" href="{{$urls->base}}/nosotros">
|
||||
NOSOTROS
|
||||
</a>
|
||||
<a class="item" href="{{$urls->base}}/productos">
|
||||
PRODUCTOS
|
||||
</a>
|
||||
<div class="ui simple dropdown item" id="productos_menu">
|
||||
<a href="{{$urls->base}}/productos">PRODUCTOS</a>
|
||||
<div class="menu">
|
||||
@foreach ($header->menu->segmentos as $segmento)
|
||||
<a class="item" href="{{$urls->base}}/productos#{{mb_strtolower($segmento->titulo)}}">{{$segmento->titulo}}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<a class="item" href="{{$urls->base}}/faqs">
|
||||
FAQs
|
||||
</a>
|
||||
|
@ -7,46 +7,24 @@
|
||||
{{$producto->segmento}}
|
||||
</div>
|
||||
<div class="descripcion">
|
||||
{{$producto->comuna}}
|
||||
{{$producto->direccion->comuna}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="medium image">
|
||||
@if ($producto->destacado)
|
||||
@if ($producto->destacado())
|
||||
<div class="overlay">Destacado</div>
|
||||
@endif
|
||||
<img src="{{$urls->images}}/{{$producto->imagen}}" />
|
||||
<img src="{{$urls->images}}/{{$producto->imagen()}}" />
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="ui basic segment">
|
||||
<span class="right floated">
|
||||
{{$producto->valor}} UF
|
||||
</span>
|
||||
Valor depto
|
||||
</div>
|
||||
<div class="ui basic segment">
|
||||
<span class="right floated">
|
||||
{{$producto->bono}} UF
|
||||
</span>
|
||||
Bono Pie
|
||||
</div>
|
||||
<div class="ui basic segment">
|
||||
<span class="right floated">
|
||||
{{$producto->rentabilidad}}%
|
||||
</span>
|
||||
Rentabilidad
|
||||
</div>
|
||||
<div class="ui basic segment">
|
||||
<span class="right floated">
|
||||
{{$producto->cuota}} UF
|
||||
</span>
|
||||
Valor cuota
|
||||
</div>
|
||||
<div class="ui basic segment">
|
||||
<span class="right floated">
|
||||
{{$producto->entrega}}
|
||||
</span>
|
||||
Entrega Estimada
|
||||
</div>
|
||||
@foreach ($properties as $property)
|
||||
<div class="ui basic segment">
|
||||
<span class="right floated">
|
||||
{{$property->prefix}}{{$producto->{$property->name} }}{{$property->suffix}}
|
||||
</span>
|
||||
{{$property->label}}
|
||||
</div>
|
||||
@endforeach
|
||||
<span class="right floated">
|
||||
<a href="{{$urls->base}}/producto/{{$producto->id}}">
|
||||
<button class="ui inverted brand button">
|
||||
|
@ -34,60 +34,84 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var loaded = {
|
||||
todo: false,
|
||||
@foreach ($segmentos as $segmento)
|
||||
var productos = {
|
||||
id: '#productos',
|
||||
current_hash: '',
|
||||
loaded: {
|
||||
todo: false,
|
||||
@foreach ($segmentos as $segmento)
|
||||
'{{mb_strtolower($segmento->titulo)}}': false,
|
||||
@endforeach
|
||||
}
|
||||
function loadSegmento(segmento) {
|
||||
if (loaded[segmento]) {
|
||||
return
|
||||
}
|
||||
var name = segmento
|
||||
if (name.indexOf(' ') > -1) {
|
||||
name = name.replaceAll(' ', '_')
|
||||
}
|
||||
var url = '{{$urls->base}}/productos/segmento/' + name
|
||||
$(".tab[data-tab='" + segmento + "']").find('.grid').html('')
|
||||
loaded[segmento] = true
|
||||
$.getJSON(url, (data) => {
|
||||
$(".tab[data-tab='" + segmento + "']").find('.grid').append(
|
||||
$('<div></div>').attr('class', 'ui active centered inline loader')
|
||||
)
|
||||
$.each(data.productos, (i, el) => {
|
||||
getProducto(segmento, el)
|
||||
})
|
||||
})
|
||||
}
|
||||
function getProducto(segmento, id_producto) {
|
||||
var url = '{{$urls->base}}/producto/' + id_producto + '/ficha'
|
||||
$.ajax({
|
||||
url: url,
|
||||
success: (data) => {
|
||||
if ($(".tab[data-tab='" + segmento + "']").find('.grid').find('.loader').length > 0) {
|
||||
$(".tab[data-tab='" + segmento + "']").find('.grid').html('')
|
||||
}
|
||||
$(".tab[data-tab='" + segmento + "']").find('.grid').append(
|
||||
$('<div></div>').attr('class', 'column').append(data)
|
||||
)
|
||||
@endforeach
|
||||
},
|
||||
loadSegmento: (segmento) => {
|
||||
if (productos.loaded[segmento]) {
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
$(document).ready(() => {
|
||||
loadSegmento('todo')
|
||||
$('#productos').find('.tabular.menu .item').tab({
|
||||
onFirstLoad: (tabPath, parameterArray, historyEvent) => {
|
||||
if (tabPath == 'todo') {
|
||||
var name = segmento
|
||||
if (name.indexOf(' ') > -1) {
|
||||
name = name.replaceAll(' ', '_')
|
||||
}
|
||||
var url = '{{$urls->base}}/productos/segmento/' + name
|
||||
$(".tab[data-tab='" + segmento + "']").find('.grid').html('')
|
||||
productos.loaded[segmento] = true
|
||||
$.getJSON(url, (data) => {
|
||||
$(".tab[data-tab='" + segmento + "']").find('.grid').append(
|
||||
$('<div></div>').attr('class', 'ui active centered inline loader')
|
||||
)
|
||||
if (data.productos.length == 0) {
|
||||
$(".tab[data-tab='" + segmento + "']").find('.grid').html('No hay productos en este segmento.')
|
||||
return
|
||||
}
|
||||
loadSegmento(tabPath)
|
||||
$.each(data.productos, (i, el) => {
|
||||
productos.getProducto(segmento, el)
|
||||
})
|
||||
})
|
||||
},
|
||||
getProducto: (segmento, id_producto) => {
|
||||
var url = '{{$urls->base}}/producto/' + id_producto + '/ficha'
|
||||
$.ajax({
|
||||
url: url,
|
||||
success: (data) => {
|
||||
if ($(".tab[data-tab='" + segmento + "']").find('.grid').find('.loader').length > 0) {
|
||||
$(".tab[data-tab='" + segmento + "']").find('.grid').html('')
|
||||
}
|
||||
$(".tab[data-tab='" + segmento + "']").find('.grid').append(
|
||||
$('<div></div>').attr('class', 'column').append(data)
|
||||
)
|
||||
}
|
||||
})
|
||||
},
|
||||
setup: () => {
|
||||
productos.loadSegmento('todo')
|
||||
$(productos.id).find('.tabular.menu .item').tab({
|
||||
onFirstLoad: (tabPath, parameterArray, historyEvent) => {
|
||||
if (tabPath == 'todo') {
|
||||
return
|
||||
}
|
||||
productos.loadSegmento(tabPath)
|
||||
}
|
||||
})
|
||||
$('#productos_menu').find('.menu .item').click(function() {
|
||||
productos.getHash($(this).attr('href').split('#')[1])
|
||||
})
|
||||
if (window.location.hash) {
|
||||
productos.getHash(window.location.hash)
|
||||
}
|
||||
})
|
||||
if (window.location.hash) {
|
||||
var start = (window.location.hash).replace('#', '').replace('%20', ' ')
|
||||
$('#productos').find('.tabular.menu .item').tab('change tab', start)
|
||||
},
|
||||
getHash: (hash) => {
|
||||
if (typeof hash == 'undefined') {
|
||||
hash = window.location.hash
|
||||
}
|
||||
var start = (hash).replace('#', '').replace('%20', ' ')
|
||||
if (productos.current_hash == start) {
|
||||
return
|
||||
}
|
||||
productos.current_hash = start
|
||||
$(productos.id).find('.tabular.menu .item').tab('change tab', start)
|
||||
}
|
||||
}
|
||||
$(document).ready(() => {
|
||||
productos.setup()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -30,15 +30,38 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function changePrice(min, max) {
|
||||
var buscar = {
|
||||
min: 1000,
|
||||
max: 30000,
|
||||
changePrice: (min, max) => {
|
||||
$("input[name='precio']").val(min + '-' + max)
|
||||
formatter = new Intl.NumberFormat('de-DE')
|
||||
$('.price_label').html(formatter.format(min) + ' - ' + formatter.format(max) + ' UF')
|
||||
},
|
||||
setup: () => {
|
||||
buscar.changePrice(buscar.min, buscar.max)
|
||||
$('#precio').slider({
|
||||
min: buscar.min,
|
||||
max: buscar.max,
|
||||
start: buscar.min,
|
||||
end: buscar.max,
|
||||
step: 500,
|
||||
onChange: (range, min, max) => {
|
||||
buscar.changePrice(min, max)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
/*function changePrice(min, max) {
|
||||
$("input[name='precio']").val(min + '-' + max)
|
||||
formatter = new Intl.NumberFormat('de-DE')
|
||||
$('.price_label').html(formatter.format(min) + ' - ' + formatter.format(max) + ' UF')
|
||||
}
|
||||
var gMin = 1000
|
||||
var gMax = 30000
|
||||
var gMax = 30000*/
|
||||
$(document).ready(() => {
|
||||
changePrice(gMin, gMax)
|
||||
buscar.setup()
|
||||
/*changePrice(gMin, gMax)
|
||||
$('#precio').slider({
|
||||
min: gMin,
|
||||
max: gMax,
|
||||
@ -48,7 +71,7 @@
|
||||
onChange: (range, min, max) => {
|
||||
changePrice(min, max)
|
||||
}
|
||||
})
|
||||
})*/
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div class="ui top attached tabular menu">
|
||||
<a class="active item" data-tab="informacion">Información</a>
|
||||
<a class="item" data-tab="mapa">Ver Mapa</a>
|
||||
@if (isset($producto->descripcion))
|
||||
@if (property_exists($producto, 'descripcion'))
|
||||
<a class="item" data-tab="descripcion">Descripción del producto</a>
|
||||
@endif
|
||||
</div>
|
||||
@ -10,62 +10,7 @@
|
||||
<div class="ui grid">
|
||||
<div class="four wide column">
|
||||
<div class="ui two columns grid informacion">
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
Precio:
|
||||
</div>
|
||||
<div class="column">
|
||||
{{$producto->valor ?? ''}} UF
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
Estado:
|
||||
</div>
|
||||
<div class="column">
|
||||
{{$producto->estado ?? ''}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
Tipo:
|
||||
</div>
|
||||
<div class="column">
|
||||
{{$producto->segmento ?? ''}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
Ubicación:
|
||||
</div>
|
||||
<div class="column">
|
||||
{{$producto->comuna ?? ''}}, {{$producto->ciudad ?? ''}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
Unidades:
|
||||
</div>
|
||||
<div class="column">
|
||||
{{$producto->unidades ?? ''}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
Modelos:
|
||||
</div>
|
||||
<div class="column">
|
||||
{{$producto->modelos ?? ''}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
Tamaño
|
||||
</div>
|
||||
<div class="column">
|
||||
{{$producto->tamaño ?? ''}}
|
||||
</div>
|
||||
</div>
|
||||
@include('productos.producto.ficha')
|
||||
</div>
|
||||
</div>
|
||||
<div class="twelve wide column">
|
||||
@ -75,11 +20,11 @@
|
||||
</div>
|
||||
<div class="ui bottom attached basic segment tab" data-tab="mapa">
|
||||
<div class="ui embed" id="map" data-source="Google Maps"
|
||||
data-url="https://maps.google.com/maps?hl=es&amp;q={{(isset($producto->direccion)) ? str_replace(' ', '%20', implode(', ', [
|
||||
$producto->direccion, $producto->comuna
|
||||
])) : 'Santiago,%20Chile'}}&amp;ie=UTF8&amp;z={{(isset($producto->direccion)) ? 16 : 11}}&amp;iwloc=B&amp;output=embed"></div>
|
||||
data-url="https://maps.google.com/maps?hl=es&amp;q={{($producto->direccion) ? str_replace(' ', '%20', implode(', ', [
|
||||
$producto->direccion->calle, $producto->direccion->comuna
|
||||
])) : 'Santiago,%20Chile'}}&amp;ie=UTF8&amp;z={{($producto->direccion) ? 16 : 11}}&amp;iwloc=B&amp;output=embed"></div>
|
||||
</div>
|
||||
@if (isset($producto->descripcion))
|
||||
@if (property_exists($producto, 'descripcion'))
|
||||
<div class="ui bottom attached basic segment tab" data-tab="descripcion">
|
||||
<p>
|
||||
{!!nl2br($producto->descripcion)!!}
|
||||
|
10
resources/views/productos/producto/ficha.blade.php
Normal file
10
resources/views/productos/producto/ficha.blade.php
Normal file
@ -0,0 +1,10 @@
|
||||
@foreach ($producto->getShow() as $property)
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
{{$property->label}}:
|
||||
</div>
|
||||
<div class="column">
|
||||
{{$property->prefix}}{{$producto->{$property->name} ?? ''}}{{$property->suffix}}
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
@ -1,10 +1,10 @@
|
||||
<div id="galeria">
|
||||
@if (count($producto->images))
|
||||
@if (count($producto->imagenes()))
|
||||
<div class="ui image" data-id="0">
|
||||
<img src="{{$urls->images}}/{{mb_strtolower($producto->nombre)}}/{{$producto->imagen}}" />
|
||||
<img src="{{$urls->images}}/{{$producto->imagen()}}" />
|
||||
</div>
|
||||
<div class="ui grid" id="thumbnails">
|
||||
@foreach ($producto->images as $i => $image)
|
||||
@foreach ($producto->imagenes() as $i => $image)
|
||||
@if ($i == 0)
|
||||
@continue
|
||||
@endif
|
||||
@ -20,49 +20,49 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var images = [
|
||||
@foreach ($producto->images as $image)
|
||||
'{{$urls->images}}/{{mb_strtolower($producto->nombre)}}/{{$image}}',
|
||||
@endforeach
|
||||
]
|
||||
function populateThumbs(current) {
|
||||
var thumbs = $('#thumbnails')
|
||||
thumbs.html('')
|
||||
$.each(images, (i, el) => {
|
||||
if (i == current) {
|
||||
return
|
||||
}
|
||||
thumbs.append(
|
||||
$('<div></div>').attr('class', 'three wide column').append(
|
||||
$('<div></div>').attr('class', 'ui image').attr('data-id', i).append(
|
||||
$('<img />').attr('src', el)
|
||||
var galeria = {
|
||||
images: [
|
||||
@foreach ($producto->imagenes() as $image)
|
||||
'{{$urls->images}}/{{mb_strtolower($producto->nombre)}}/{{$image}}',
|
||||
@endforeach
|
||||
],
|
||||
populateThumbs: (current) => {
|
||||
var thumbs = $('#thumbnails')
|
||||
thumbs.html('')
|
||||
$.each(galeria.images, (i, el) => {
|
||||
if (i == current) {
|
||||
return
|
||||
}
|
||||
thumbs.append(
|
||||
$('<div></div>').attr('class', 'three wide column').append(
|
||||
$('<div></div>').attr('class', 'ui image').attr('data-id', i).append(
|
||||
$('<img />').attr('src', el)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
})
|
||||
$('#galeria').find('.grid .image').click(function(e) {
|
||||
var id = $(this).attr('data-id')
|
||||
changeImage(id)
|
||||
})
|
||||
}
|
||||
function changeImage(id) {
|
||||
var big = $('#galeria>.image')
|
||||
big.find('img').attr('src', images[id])
|
||||
big.attr('data-id', id)
|
||||
populateThumbs(id)
|
||||
$('#thumbnails .image').css('cursor', 'pointer')
|
||||
})
|
||||
$('#galeria').find('.grid .image').click(function(e) {
|
||||
var id = $(this).attr('data-id')
|
||||
galeria.changeImage(id)
|
||||
})
|
||||
},
|
||||
changeImage: (id) => {
|
||||
var big = $('#galeria>.image')
|
||||
big.find('img').attr('src', galeria.images[id])
|
||||
big.attr('data-id', id)
|
||||
galeria.populateThumbs(id)
|
||||
},
|
||||
setup: () => {
|
||||
$('#galeria').find('.grid .image').click(function(e) {
|
||||
var id = $(this).attr('data-id')
|
||||
galeria.changeImage(id)
|
||||
})
|
||||
$('#thumbnails .image').css('cursor', 'pointer')
|
||||
}
|
||||
}
|
||||
$(document).ready(() => {
|
||||
$('#galeria').find('.grid .image').click(function(e) {
|
||||
var id = $(this).attr('data-id')
|
||||
changeImage(id)
|
||||
/*var big = $('#galeria>.image')
|
||||
var big_id = big.attr('data-id')
|
||||
big.find('img').attr('src', images[id])
|
||||
big.attr('data-id', id)
|
||||
$(this).find('img').attr('src', images[big_id])
|
||||
$(this).attr('data-id', big_id)
|
||||
populateThumbs(id)*/
|
||||
})
|
||||
galeria.setup()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -3,23 +3,19 @@
|
||||
@section('page_content')
|
||||
<div id="producto">
|
||||
<div class="ui container">
|
||||
<div class="ui one columns grid">
|
||||
<div class="column">
|
||||
<div class="titulo">
|
||||
<span class="ui header">
|
||||
{{$producto->nombre}}
|
||||
</span>
|
||||
<span class="direccion">
|
||||
{{$producto->direccion ?? ''}}, {{$producto->comuna ?? ''}}, {{$producto->ciudad ?? ''}}
|
||||
</span>
|
||||
<div class="publicado">
|
||||
Publicado el {{$producto->publicacion ?? ''}}
|
||||
</div>
|
||||
</div>
|
||||
@include('productos.producto.galeria')
|
||||
@include('productos.producto.datos')
|
||||
<div class="titulo">
|
||||
<span class="ui header">
|
||||
{{$producto->nombre}}
|
||||
</span>
|
||||
<span class="direccion">
|
||||
{{'' . ($producto->direccion ?? '')}}
|
||||
</span>
|
||||
<div class="publicado">
|
||||
Publicado el {{$producto->publicacion ?? ''}}
|
||||
</div>
|
||||
</div>
|
||||
@include('productos.producto.galeria')
|
||||
@include('productos.producto.datos')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
30
src/Direccion.php
Normal file
30
src/Direccion.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace ProVM\KI;
|
||||
|
||||
use ProVM\Common\Implementation\Model;
|
||||
|
||||
class Direccion extends Model {
|
||||
public function map($data): Model {
|
||||
$this->calle = $data->calle;
|
||||
$this->comuna = $data->comuna ?? '';
|
||||
$this->ciudad = $data->ciudad ?? '';
|
||||
return $this;
|
||||
}
|
||||
public function __toString(): string {
|
||||
$str = [$this->calle];
|
||||
if ($this->comuna != '') {
|
||||
$str []= $this->comuna;
|
||||
}
|
||||
if ($this->ciudad != '') {
|
||||
$str []= $this->ciudad;
|
||||
}
|
||||
return implode(', ', $str);
|
||||
}
|
||||
public function jsonSerialize() {
|
||||
return [
|
||||
'calle' => $this->calle,
|
||||
'comuna' => $this->comuna,
|
||||
'ciudad' => $this->ciudad
|
||||
];
|
||||
}
|
||||
}
|
228
src/Producto.php
Normal file
228
src/Producto.php
Normal file
@ -0,0 +1,228 @@
|
||||
<?php
|
||||
namespace ProVM\KI;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use ProVM\Common\Implementation\Model;
|
||||
|
||||
class Producto extends Model {
|
||||
protected $id;
|
||||
protected $nombre;
|
||||
protected $segmento;
|
||||
protected $direccion;
|
||||
protected $valor;
|
||||
protected $destacado;
|
||||
protected $descripcion;
|
||||
protected $publicacion;
|
||||
|
||||
public function valor(float $valor = -1) {
|
||||
if ($valor == -1) {
|
||||
return $this->valor;
|
||||
}
|
||||
$this->valor = number_format($valor, 0, ',', '.');
|
||||
}
|
||||
public function setPublicacion(\DateTime $fecha) {
|
||||
$this->publicacion = implode(' ', [
|
||||
$fecha->day,
|
||||
'de',
|
||||
ucwords($fecha->locale('es')->isoFormat('MMMM')) . ',',
|
||||
$fecha->year
|
||||
]);
|
||||
}
|
||||
public function getPublicacion() {
|
||||
return Carbon::parse($this->publicacion);
|
||||
}
|
||||
public function destacado(bool $destacado = null) {
|
||||
if ($destacado === null) {
|
||||
if ($this->destacado === null) {
|
||||
$destacados = $this->factory->get('destacados.json');
|
||||
$this->destacado = (array_search($this->id, $destacados) !== false);
|
||||
}
|
||||
return $this->destacado;
|
||||
}
|
||||
$this->destacado = $destacado;
|
||||
}
|
||||
protected $image_folder;
|
||||
public function setImageFolder(string $folder) {
|
||||
$this->image_folder = implode(DIRECTORY_SEPARATOR, [
|
||||
$folder,
|
||||
'assets',
|
||||
'images',
|
||||
mb_strtolower($this->nombre)
|
||||
]);
|
||||
}
|
||||
protected $imagenes;
|
||||
public function imagenes() {
|
||||
if ($this->imagenes === null) {
|
||||
$folder = $this->image_folder;
|
||||
$this->imagenes = [];
|
||||
if (!file_exists($folder)) {
|
||||
return $this->imagenes;
|
||||
}
|
||||
$files = new \DirectoryIterator($folder);
|
||||
foreach ($files as $file) {
|
||||
if ($file->isDir()) {
|
||||
continue;
|
||||
}
|
||||
$this->imagenes []= $file->getFilename();
|
||||
}
|
||||
sort($this->imagenes);
|
||||
}
|
||||
return $this->imagenes;
|
||||
}
|
||||
public function addImagen($file) {
|
||||
if (!file_exists($this->image_folder)) {
|
||||
mkdir($this->image_folder);
|
||||
}
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$this->image_folder,
|
||||
$file->getClientFilename()
|
||||
]);
|
||||
$file->moveTo($filename);
|
||||
if ($this->imagenes === null) {
|
||||
$this->imagenes = [];
|
||||
}
|
||||
$this->imagenes []= $file->getClientFilename();
|
||||
return file_exists($filename);
|
||||
}
|
||||
public function deleteImagen(string $file) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$this->image_folder,
|
||||
$file
|
||||
]);
|
||||
if (!file_exists($filename)) {
|
||||
return false;
|
||||
}
|
||||
$status = unlink($filename);
|
||||
|
||||
if (count(scandir($this->image_folder)) == 2) {
|
||||
rmdir($this->image_folder);
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
protected $imagen;
|
||||
public function imagen() {
|
||||
if ($this->imagen === null) {
|
||||
$this->imagen = 'default.jpg';
|
||||
$img = $this->imagenes();
|
||||
if (count($img) > 0) {
|
||||
$this->imagen = implode('/', [mb_strtolower($this->nombre), $img[0]]);
|
||||
}
|
||||
}
|
||||
return $this->imagen;
|
||||
}
|
||||
public function map($data): Model {
|
||||
$this->id = $data->id ?? null;
|
||||
$this->nombre = $data->nombre;
|
||||
$this->segmento = $data->segmento;
|
||||
$this->valor = $data->valor;
|
||||
$this->direccion = new Direccion();
|
||||
$this->direccion->map($data);
|
||||
$this->destacado((isset($data->destacado) and $data->destacado == 'on') ? true : false);
|
||||
$this->descripcion = $data->descripcion;
|
||||
$this->publicacion = $data->publicacion;
|
||||
foreach ($this->properties as $property) {
|
||||
$this->$property = $data->$property ?? '';
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function __get(string $name) {
|
||||
if (method_exists($this, $name)) {
|
||||
return $this->$name();
|
||||
}
|
||||
if (!property_exists($this, $name) and array_search($name, $this->properties) === false) {
|
||||
throw new \InvalidArgumentException($name . ' no es una propiedad de ' . get_called_class());
|
||||
}
|
||||
return $this->$name;
|
||||
}
|
||||
public function __set(string $name, $value) {
|
||||
if (!property_exists($this, $name) and array_search($name, $this->properties) === false) {
|
||||
throw new \InvalidArgumentException($name . ' no es una propiedad de ' . get_called_class());
|
||||
}
|
||||
$this->$name = $value;
|
||||
}
|
||||
public function jsonSerialize() {
|
||||
$arr = [
|
||||
'id' => $this->id,
|
||||
'nombre' => $this->nombre,
|
||||
'segmento' => $this->segmento,
|
||||
'valor' => $this->valor,
|
||||
'destacado' => $this->destacado,
|
||||
'descripcion' => $this->descripcion,
|
||||
'publicacion' => $this->publicacion
|
||||
];
|
||||
foreach ($this->properties as $property) {
|
||||
$arr[$property] = $this->$property;
|
||||
}
|
||||
$arr = array_merge($arr, $this->direccion->jsonSerialize());
|
||||
return $arr;
|
||||
}
|
||||
public function save() {
|
||||
$this->changeDestacado();
|
||||
return parent::save();
|
||||
}
|
||||
public function delete() {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$this->factory->getFolder(),
|
||||
'destacados.json'
|
||||
]);
|
||||
$destacados = json_decode(trim(file_get_contents($filename)));
|
||||
foreach ($destacados as $i => $id) {
|
||||
if ($id == $this->id) {
|
||||
unset($destacados[$i]);
|
||||
}
|
||||
}
|
||||
sort($destacados);
|
||||
file_put_contents($filename, json_encode($destacados));
|
||||
foreach ($this->imagenes() as $imagen) {
|
||||
$this->deleteImagen($imagen);
|
||||
}
|
||||
|
||||
return parent::delete();
|
||||
}
|
||||
public function changeDestacado() {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$this->factory->getFolder(),
|
||||
'destacados.json'
|
||||
]);
|
||||
$destacados = json_decode(trim(file_get_contents($filename)));
|
||||
|
||||
$changed = false;
|
||||
if (!$this->destacado()) {
|
||||
foreach ($destacados as $i => $id) {
|
||||
if ($id == $this->id) {
|
||||
unset($destacados[$i]);
|
||||
$changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$found = false;
|
||||
foreach ($destacados as $i => $id) {
|
||||
if ($id == $this->id) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$destacados []= $this->id;
|
||||
$changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($changed) {
|
||||
sort($destacados);
|
||||
file_put_contents($filename, json_encode($destacados));
|
||||
}
|
||||
}
|
||||
public function getProperties(): array {
|
||||
$properties = [];
|
||||
foreach ($this->properties as $property) {
|
||||
$p = (object) [
|
||||
'label' => ucwords($property),
|
||||
'name' => $property
|
||||
];
|
||||
$properties []= $p;
|
||||
}
|
||||
return $properties;
|
||||
}
|
||||
}
|
73
src/Productos/Bodega.php
Normal file
73
src/Productos/Bodega.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Productos;
|
||||
|
||||
use ProVM\KI\Producto;
|
||||
|
||||
class Bodega extends Producto {
|
||||
protected $properties = [
|
||||
'modulo',
|
||||
'tamaño',
|
||||
'oficina',
|
||||
'superficie',
|
||||
'uf_m2'
|
||||
];
|
||||
|
||||
/*public function uf_m2() {
|
||||
return $this->arriendo / ($this->superficie ?? 1);
|
||||
}*/
|
||||
public function getProperties(): array {
|
||||
$properties = parent::getProperties();
|
||||
foreach ($properties as &$property) {
|
||||
if ($property->name == 'uf_m2') {
|
||||
$property->labe = 'UF/m²';
|
||||
}
|
||||
}
|
||||
return $properties;
|
||||
}
|
||||
public function getFicha(): array {
|
||||
$properties = [
|
||||
[
|
||||
'label' => 'Superficie',
|
||||
'name' => 'superficie',
|
||||
'suffix' => ' m²'
|
||||
],
|
||||
[
|
||||
'label' => 'Valor Arriendo',
|
||||
'name' => 'valor',
|
||||
'suffix' => ' UF'
|
||||
],
|
||||
[
|
||||
'label' => 'UF/m²',
|
||||
'name' => 'uf_m2',
|
||||
'suffix' => ' UF/m²'
|
||||
]
|
||||
];
|
||||
array_walk($properties, function(&$item) {
|
||||
$item['prefix'] = $item['prefix'] ?? '';
|
||||
$item['suffix'] = $item['suffix'] ?? '';
|
||||
$item = (object) $item;
|
||||
});
|
||||
return $properties;
|
||||
}
|
||||
public function getShow(): array {
|
||||
$data = $this->getFicha();
|
||||
$data []= (object) [
|
||||
'label' => 'Modulo',
|
||||
'name' => 'modulo'
|
||||
];
|
||||
$data []= (object) [
|
||||
'label' => 'Oficina',
|
||||
'name' => 'oficina'
|
||||
];
|
||||
$data []= (object) [
|
||||
'label' => 'Tamaño',
|
||||
'name' => 'tamaño',
|
||||
'suffix' => ' m²'
|
||||
];
|
||||
array_walk($data, function(&$item) {
|
||||
$item->prefix = $item->prefix ?? '';
|
||||
$item->suffix = $item->suffix ?? '';
|
||||
});
|
||||
return $data;
|
||||
}
|
||||
}
|
81
src/Productos/Oficina.php
Normal file
81
src/Productos/Oficina.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Productos;
|
||||
|
||||
use ProVM\KI\Producto;
|
||||
use ProVM\Common\Implementation\Model;
|
||||
|
||||
class Oficina extends Producto {
|
||||
protected $properties = [
|
||||
'sector',
|
||||
'm2',
|
||||
'baños',
|
||||
'privados',
|
||||
'plazo',
|
||||
'uf_m2'
|
||||
];
|
||||
|
||||
public function privados() {
|
||||
if ($this->privados == 0) {
|
||||
return 'planta libre';
|
||||
}
|
||||
return 'privados ' . $this->privados;
|
||||
}
|
||||
public function getProperties(): array {
|
||||
$properties = parent::getProperties();
|
||||
foreach ($properties as &$property) {
|
||||
if ($property->name == 'uf_m2') {
|
||||
$property->labe = 'UF/m²';
|
||||
}
|
||||
}
|
||||
return $properties;
|
||||
}
|
||||
public function getFicha(): array {
|
||||
$properties = [
|
||||
[
|
||||
'label' => 'Valor Arriendo',
|
||||
'name' => 'valor',
|
||||
'suffix' => ' UF'
|
||||
],
|
||||
[
|
||||
'label' => 'Superficie',
|
||||
'name' => 'm2',
|
||||
'suffix' => ' m²'
|
||||
],
|
||||
[
|
||||
'label' => 'Baños',
|
||||
'name' => 'baños'
|
||||
],
|
||||
[
|
||||
'label' => 'Privados',
|
||||
'name' => 'privados'
|
||||
]
|
||||
];
|
||||
array_walk($properties, function(&$item) {
|
||||
$item['prefix'] = $item['prefix'] ?? '';
|
||||
$item['suffix'] = $item['suffix'] ?? '';
|
||||
$item = (object) $item;
|
||||
});
|
||||
return $properties;
|
||||
}
|
||||
public function getShow() {
|
||||
$data = $this->getFicha();
|
||||
$data []= (object) [
|
||||
'label' => 'Plazo de Contrato',
|
||||
'name' => 'plazo'
|
||||
];
|
||||
$data []= (object) [
|
||||
'label' => 'UF/m²',
|
||||
'name' => 'uf_m2',
|
||||
'suffix' => ' UF/m²'
|
||||
];
|
||||
$data []= (object) [
|
||||
'label' => 'Sector',
|
||||
'name' => 'sector'
|
||||
];
|
||||
array_walk($data, function(&$item) {
|
||||
$item->prefix = $item->prefix ?? '';
|
||||
$item->suffix = $item->suffix ?? '';
|
||||
});
|
||||
return $data;
|
||||
}
|
||||
}
|
150
src/Productos/Retail.php
Normal file
150
src/Productos/Retail.php
Normal file
@ -0,0 +1,150 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Productos;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use ProVM\KI\Producto;
|
||||
|
||||
class Retail extends Producto {
|
||||
protected $properties = [
|
||||
'bono',
|
||||
'rentabilidad',
|
||||
'cuota',
|
||||
'entrega',
|
||||
'estado',
|
||||
'unidades',
|
||||
'modelos',
|
||||
'tamaños'
|
||||
];
|
||||
|
||||
public function setTamaños(int $min, int $max = -1) {
|
||||
if ($max == -1) {
|
||||
$max = $min;
|
||||
}
|
||||
$this->tamaños = $min . ' - ' . $max . ' m²';
|
||||
}
|
||||
public function getTamaños() {
|
||||
return $this->tamaños;
|
||||
}
|
||||
public function setEntrega(\DataTime $fecha) {
|
||||
$this->entrega = $fecha->format('%m/%Y');
|
||||
}
|
||||
public function getEntrega() {
|
||||
return Carbon::parse(implode('-', array_reverse(explode('/', $this->entrega))) . '-01');
|
||||
}
|
||||
public function getDireccion() {
|
||||
return implode(', ', [
|
||||
$this->direccion->calle,
|
||||
$this->direccion->comuna ?? '',
|
||||
$this->direccion->ciudad ?? ''
|
||||
]);
|
||||
}
|
||||
public function getProperties(): array {
|
||||
$properties = [];
|
||||
$properties []= (object) [
|
||||
'label' => 'Bono Pie %',
|
||||
'name' => 'bono'
|
||||
];
|
||||
$properties []= (object) [
|
||||
'label' => 'Rentabilidad %',
|
||||
'name' => 'rentabilidad'
|
||||
];
|
||||
$properties []= (object) [
|
||||
'label' => 'Valor Cuota en $',
|
||||
'name' => 'cuota'
|
||||
];
|
||||
$properties []= (object) [
|
||||
'label' => 'Entrega Estimada',
|
||||
'name' => 'entrega'
|
||||
];
|
||||
$properties []= (object) [
|
||||
'label' => 'Estado',
|
||||
'name' => 'estado'
|
||||
];
|
||||
$properties []= (object) [
|
||||
'label' => 'Unidades',
|
||||
'name' => 'unidades'
|
||||
];
|
||||
$properties []= (object) [
|
||||
'label' => 'Modelos',
|
||||
'name' => 'modelos'
|
||||
];
|
||||
$properties []= (object) [
|
||||
'label' => 'Tamaños',
|
||||
'name' => 'tamaños'
|
||||
];
|
||||
return $properties;
|
||||
}
|
||||
public function getFicha(): array {
|
||||
$properties = [
|
||||
[
|
||||
'label' => 'Valor Depto',
|
||||
'name' => 'valor',
|
||||
'suffix' => ' UF'
|
||||
],
|
||||
[
|
||||
'label' => 'Bono Pie',
|
||||
'name' => 'bono',
|
||||
'suffix' => '%'
|
||||
],
|
||||
[
|
||||
'label' => 'Rentabilidad',
|
||||
'name' => 'rentabilidad',
|
||||
'suffix' => '%'
|
||||
],
|
||||
[
|
||||
'label' => 'Valor Cuota',
|
||||
'name' => 'cuota',
|
||||
'prefix' => '$'
|
||||
],
|
||||
[
|
||||
'label' => 'Entrega Estimada',
|
||||
'name' => 'entrega'
|
||||
]
|
||||
];
|
||||
array_walk($properties, function(&$item) {
|
||||
$item['prefix'] = $item['prefix'] ?? '';
|
||||
$item['suffix'] = $item['suffix'] ?? '';
|
||||
$item = (object) $item;
|
||||
});
|
||||
return $properties;
|
||||
}
|
||||
public function getShow() {
|
||||
$properties = [
|
||||
[
|
||||
'label' => 'Precio',
|
||||
'name' => 'valor',
|
||||
'suffix' => ' UF'
|
||||
],
|
||||
[
|
||||
'label' => 'Estado',
|
||||
'name' => 'estado'
|
||||
],
|
||||
[
|
||||
'label' => 'Tipo',
|
||||
'name' => 'segmento'
|
||||
],
|
||||
[
|
||||
'label' => 'Ubicación',
|
||||
'name' => 'getDireccion'
|
||||
],
|
||||
[
|
||||
'label' => 'Unidades',
|
||||
'name' => 'unidades'
|
||||
],
|
||||
[
|
||||
'label' => 'Modelos',
|
||||
'name' => 'modelos'
|
||||
],
|
||||
[
|
||||
'label' => 'Tamaño',
|
||||
'name' => 'tamaños'
|
||||
]
|
||||
];
|
||||
array_walk($properties, function(&$item) {
|
||||
$item['prefix'] = $item['prefix'] ?? '';
|
||||
$item['suffix'] = $item['suffix'] ?? '';
|
||||
$item = (object) $item;
|
||||
});
|
||||
return $properties;
|
||||
}
|
||||
}
|
40
src/Productos/Terreno.php
Normal file
40
src/Productos/Terreno.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace ProVM\KI\Productos;
|
||||
|
||||
use ProVM\KI\Producto;
|
||||
|
||||
class Terreno extends Producto {
|
||||
protected $properties = [
|
||||
'sector',
|
||||
'delimitacion',
|
||||
'superficie'
|
||||
];
|
||||
|
||||
public function getFicha(): array {
|
||||
$properties = [
|
||||
[
|
||||
'label' => 'Sector',
|
||||
'name' => 'sector'
|
||||
],
|
||||
[
|
||||
'label' => 'Valor Total',
|
||||
'name' => 'valor',
|
||||
'suffix' => ' UF'
|
||||
],
|
||||
[
|
||||
'label' => 'Superficie',
|
||||
'name' => 'superficie',
|
||||
'suffix' => ' m²'
|
||||
]
|
||||
];
|
||||
array_walk($properties, function(&$item) {
|
||||
$item['prefix'] = $item['prefix'] ?? '';
|
||||
$item['suffix'] = $item['suffix'] ?? '';
|
||||
$item = (object) $item;
|
||||
});
|
||||
return $properties;
|
||||
}
|
||||
public function getShow() {
|
||||
return $this->getFicha();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user