Commit 467b57b4 by Luis Perez

Merge branch 'master' of http://git.setisl.com/inutraliaapp/2018_web_app

# Conflicts:
#	fuel/app/classes/controller/listacompra/index.php
#	fuel/app/views/listacompra/index.twig
parents d97732a8 72f658ad
......@@ -64,4 +64,10 @@ class Controller_App extends Controller{
return new \Response(json_encode(array('localidades' => $array_localidades)));
}
public function notify($type,$message){
Session::set('notification',array('type' => $type, 'text' => $message));
}
}
\ No newline at end of file
......@@ -84,7 +84,7 @@ class Controller_Listacompra_Index extends \Controller_App{
}
}
Session::set_flash('success', "Se han borrado los ingredientes correctamente");
$this->notify("success","Se han borrado los ingredientes correctamente");
return Response::redirect_back();
}
......
......@@ -125,6 +125,7 @@ class Twig_Seti_Extension extends Twig_Extension
'sha1' => new Twig_Function_Function('sha1'),
'var_dump' => new Twig_Function_Function('var_dump'),
'is_divisible' => new Twig_Function_Method($this, 'is_divisible'),
'session_delete' => new Twig_Function_Method($this, 'session_delete'),
);
}
......@@ -199,4 +200,14 @@ class Twig_Seti_Extension extends Twig_Extension
return ($num%$div == 0) ? true : false;
}
/**
*
* Borra de session por key
*
* @param $key
*/
public function session_delete($key){
Session::delete($key);
}
}
......@@ -34,15 +34,16 @@
<div class="cs-loader">
<div class="cs-loader-logo" >
<img src="assets/img/logos/inutralia.png" class="img-responsive-custom">
<div class="cs-loader-inner">
<label></label>
<label></label>
<label></label>
<label></label>
<label></label>
<label></label>
</div>
</div>
<div class="cs-loader-inner">
<label></label>
<label></label>
<label></label>
<label></label>
<label></label>
<label></label>
</div>
</div>
<!--menú vertical y horizontal-->
{% include 'layout/menu.twig' %}
......@@ -53,6 +54,22 @@
{% endblock %}
</div>
{#PREPARAMOS NOTIFICAION PARA MOSTRAR EL MODAL#}
{% if session_get('notification') %}
<input class="notification type" value="{{ session_get('notification.type') }}">
<input class="notification text" value="{{ session_get('notification.text') }}">
{{ session_delete('notification') }}
{% endif %}
{#FIN NOTIFICAION#}
{% include 'modals/modal_notification.twig ' %}
<!--modal instrucciones pantalla-->
{% include 'modals/modal_info.twig' %}
......
......@@ -34,15 +34,16 @@
<div class="cs-loader">
<div class="cs-loader-logo" >
<img src="assets/img/logos/inutralia.png" class="img-responsive-custom">
<div class="cs-loader-inner">
<label></label>
<label></label>
<label></label>
<label></label>
<label></label>
<label></label>
</div>
</div>
<div class="cs-loader-inner">
<label></label>
<label></label>
<label></label>
<label></label>
<label></label>
<label></label>
</div>
</div>
<!--menú vertical y horizontal-->
......
......@@ -25,16 +25,18 @@
</div>
<div class="container-box-border-box">
<form class="ac-custom ac-checkmark" autocomplete="off">
<ul class="text-left ml0">
{% if count(ingredients) == 0 %}
<h4>Sin Ingredientes</h4>
{% endif %}
{% for i in ingredients %}
<li> <input id="check_{{ i.id }}" name="check_{{ i.id }}" type="checkbox" used="{{ i.used }}" rel="{{ i.ingredient_id }}" {% if i.ingredient_id == null %} rel2="{{ i.id }}" {% endif %}/><label for="check_{{ i.id }}">{{ i.desc }}</label></li>
{% endfor %}
</ul>
</form>
<div class="div-scrollable-lista">
<form class="ac-custom ac-checkmark" autocomplete="off">
<ul class="text-left ml0">
{% if count(ingredients) == 0 %}
<h4>Sin Ingredientes</h4>
{% endif %}
{% for i in ingredients %}
<li> <input id="check_{{ i.id }}" name="check_{{ i.id }}" type="checkbox" used="{{ i.used }}" rel="{{ i.ingredient_id }}" {% if i.ingredient_id == null %} rel2="{{ i.id }}" {% endif %}/><label for="check_{{ i.id }}">{{ i.desc }}</label></li>
{% endfor %}
</ul>
</form>
</div>
</div>
</div>
</div>
......@@ -42,10 +44,11 @@
<h3 class="mt40" >Puedes editar tu lista de la compra borrando y añadiendo productos.</h3>
<!--botones-->
<div class="row ">
<div class="col-md-6">
<div class="col-xs-6">
<button class="btn btn-custom btn-delete mt20" data-toggle="modal" data-target="#modalDeleteAll" ><i class="fa fa-trash"></i> Todos</button>
</div>
<div class="col-md-6">
<div class="col-xs-6">
<button class="btn btn-custom btn-delete mt20" data-toggle="modal" data-target="#modalDelete"><i class="fa fa-trash"></i> Marcados</button>
</div>
</div>
......
......@@ -10,11 +10,12 @@
<div class="text-center">
<img src="assets/img/listacompra/add_producto.png" class="img-responsive-custom mt40"/>
<h2>AÑADIR PRODUCTO</h2>
<p>Los productos que añadas manualmente no se enviarán a DelSuper en el caso de que elijas esta opción de compra.</p>
</div>
<div class="content pb40">
<div class="content pb40 mt40">
<form>
<p>Producto</p>
<label>Producto</label>
<input type="text" class="form-control" name="product" id="product" value=""/>
<div class="mt20">
......
......@@ -265,6 +265,7 @@
<!--modal recomendaciones resto del día-->
{% include 'modal_resto_dia.twig' %}
{% include 'modals/modal_saved.twig' %}
{% endblock %}
......
<!-- Modal info template -->
<div class="modal fade" id="modalNotification" tabindex="-1" role="dialog" aria-labelledby="modalSuccess">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div class="text-center">
<img src="" class="img-responsive-custom img-type"/>
</div>
<div class="content text-center pb40">
<h2 class="text-message"></h2>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -13,6 +13,12 @@ $(window).load(function() {
// Control Checked inputs
control_inputs_checked();
// Open modal notification
show_modal_notification();
});
......@@ -94,7 +100,13 @@ function control_inputs_checked() {
*/
function diff_input_checked(el) {
var class_separate = $(el).closest("form").attr('class').split(' ');
var class_form_input = $(el).closest("form.ac-custom").attr('class');
if(typeof class_form_input === "undefined"){
return false
}
var class_separate = class_form_input.split(' ');
var class_type = class_separate[class_separate.length-1];
......@@ -154,4 +166,16 @@ function print_radio_checked(el,type) {
draw( el, type );
}
function show_modal_notification() {
if($('.notification').length !== 0){
$('.img-type').attr('src',$('.notification.type').val() === "success" ? "assets/img/save.png" : "assets/img/notsave.png");
$('.text-message').text($('.notification.text').val());
$('#modalNotification').modal('show');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment