89 lines
3.0 KiB
Plaintext
89 lines
3.0 KiB
Plaintext
|
|
|
|
|
|
-if @m_odr.start_at > Date.today and params[:force].to_s == ""
|
|
%div{:style => "margin-top:30px;font-weight:bold;font-weight:800;font-size:2em;text-transform:uppercase;font-family: 'Open Sans','Helvetica Neue', Helvetica, sans-serif;text-align:center;"}
|
|
-count = ((@m_odr.start_at) - (Date.today))
|
|
|
|
-if @m_odr.landing_text?
|
|
=@m_odr.landing_text
|
|
-else
|
|
Démarrage
|
|
%div{:style => "font-weight:bold;font-weight:800;text-transform:uppercase;font-family: 'Open Sans','Helvetica Neue', Helvetica, sans-serif;text-align:center;line-height:200px;position:relative;top:-40px"}
|
|
dans
|
|
.clock{:style => "margin:2em;display:inline-block;width:auto;margin:0 auto;position:relative;top:35px"}
|
|
-if count > 1
|
|
jours !
|
|
-else
|
|
jour !
|
|
<script type="text/javascript">
|
|
=raw "var clock_max = #{count};"
|
|
</script>
|
|
:javascript
|
|
var countup;
|
|
|
|
var clock = $('.clock').FlipClock(0, {
|
|
clockFace: 'Counter',
|
|
minimumDigits: 1,
|
|
callbacks:{
|
|
init:function (){
|
|
|
|
}
|
|
}
|
|
});
|
|
if(clock_max > 0){
|
|
countup = setInterval(function() {
|
|
clock.increment();
|
|
if(clock.getTime().time >= clock_max) {
|
|
clock.stop();
|
|
clearInterval(countup);
|
|
}
|
|
}, 0);}
|
|
|
|
-if false
|
|
%p{:style => "font-weight:bold;font-size:2em;text-transform:uppercase;font-family:'Helvetica Neue', Helvetica, sans-serif;"}
|
|
jours avant l'ouverture
|
|
|
|
|
|
-else
|
|
#odr_form
|
|
.form_pannel
|
|
=form_tag "", :method => "get", :onsubmit => "" do
|
|
%p
|
|
=text_field_tag :code, params[:code],:class => "form-control", :placeholder => "Numéro du bon d'achat"
|
|
|
|
%p{:style => "text-align:center;"}
|
|
=submit_tag "Rechercher", :class => "btn btn-primary"
|
|
|
|
|
|
%hr
|
|
-if params[:code].to_s != ""
|
|
-@m_odr_rep = MOdrRep.where(:ba_number => params[:code].to_s.upcase).first
|
|
|
|
-if params[:code].to_s != "" and !@m_odr_rep
|
|
%p Le bon d'achat portant ce numéro n'a pas été trouvé
|
|
|
|
-elsif @m_odr_rep
|
|
-if params[:to_use].to_s == "true"
|
|
-@m_odr_rep.ba_used = true
|
|
-@m_odr_rep.save
|
|
|
|
%p
|
|
N° Bon d'achat :
|
|
=@m_odr_rep.ba_number
|
|
|
|
d'une valeur de
|
|
=number_to_currency @m_odr_rep.remise
|
|
|
|
%p
|
|
Statut :
|
|
-if !@m_odr_rep.ba_used
|
|
=state_helper "Non utilisé"
|
|
%br
|
|
%br
|
|
=link_to "Signaler comme utilisé dès maintenant", params.permit!.merge({:to_use => true}), :data => {:confirm => "Attention, une fois indiqué comme utilisé ce bon d'achat sera désactivé."}
|
|
|
|
-else
|
|
=state_helper "Déjà utilisé"
|
|
|
|
|