first commit
This commit is contained in:
162
templates_user/newsletter/newsletter.php
Normal file
162
templates_user/newsletter/newsletter.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<? global $lang;?>
|
||||
<div id="newsletter">
|
||||
<form method="POST" data-toggle="validator" role="form" id="newsletter-form">
|
||||
<div class="form-group form-group--newsletter">
|
||||
<label for="newsletter-email">Zapisz sie do naszego Newslettera</label>
|
||||
<input type='email' id="email" name="email" class="form-control" placeholder="E-mail" required />
|
||||
<a href="#" class="form-group--button btn" id="newsletter-signin"><i class="fa fa-envelope-o"></i></a>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( 'click', '#newsletter-form #toggle-data', function()
|
||||
{
|
||||
if ( $( '#newsletter-form #second' ).hasClass( 'hidden' ) )
|
||||
{
|
||||
$( '#newsletter-form #second' ).removeClass( 'hidden' );
|
||||
$( '#newsletter-form #toggle-data' ).html( '<?= $lang['zwin'];?>' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$( '#newsletter-form #second' ).addClass( 'hidden' );
|
||||
$( '#newsletter-form #toggle-data' ).html( '<?= $lang['rozwin'];?>' );
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$( 'body' ).on( 'click', '#newsletter-form #newsletter-signin', function()
|
||||
{
|
||||
// if ( !$( '#newsletter-form #agreement' ).is( ':checked' ) )
|
||||
// {
|
||||
// $.alert(
|
||||
// {
|
||||
// title: '<?= ucfirst( $lang['blad'] );?>',
|
||||
// content: '<?= $lang['newsletter-zgoda-komunikat'];?>',
|
||||
// type: 'orange',
|
||||
// closeIcon: true,
|
||||
// closeIconClass: 'fa fa-close',
|
||||
// typeAnimated: true,
|
||||
// animation: 'opacity',
|
||||
// autoClose: 'confirm|10000',
|
||||
// columnClass: 'col-sm-6 col-sm-offset-3',
|
||||
// buttons:
|
||||
// {
|
||||
// confirm:
|
||||
// {
|
||||
// text: '<?= $lang['zamknij'];?>',
|
||||
// btnClass: 'btn-blue',
|
||||
// keys: ['enter'],
|
||||
// action: function() {}
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
|
||||
var email = $.trim( $( '#newsletter-form #email' ).val() );
|
||||
var token = $.trim( $( '#newsletter-form #token' ).val() );
|
||||
|
||||
if ( email === '' )
|
||||
{
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( $lang['blad'] );?>',
|
||||
content: '<?= $lang['newsletter-prosze-uzupelnic-email'];?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
autoClose: 'confirm|10000',
|
||||
columnClass: 'col-sm-6 col-sm-offset-3',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= $lang['zamknij'];?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/newsletter/signin/',
|
||||
data:
|
||||
{
|
||||
email: email
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
alert1 = $.alert(
|
||||
{
|
||||
title: '<?= $lang['informacja'];?>',
|
||||
content: '<?= $lang['prosze-czekac'];?>',
|
||||
type: 'blue',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
autoClose: 'confirm|60000',
|
||||
columnClass: 'col-sm-6 col-sm-offset-3',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= $lang['zamknij'];?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
response = jQuery.parseJSON( data );
|
||||
|
||||
$( '.jqibox' ).remove();
|
||||
|
||||
if ( response.status === 'ok' )
|
||||
var msg = '<?= $lang['newsletter-potwierdzenie-dodania'];?>';
|
||||
else
|
||||
var msg = '<?= $lang['newsletter-potwierdzenie-dodania-blad'];?>';
|
||||
|
||||
alert1.close();
|
||||
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= $lang['informacja'];?>',
|
||||
content: msg,
|
||||
type: 'blue',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
autoClose: 'confirm|10000',
|
||||
columnClass: 'col-sm-6 col-sm-offset-3',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= $lang['zamknij'];?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user