first commit
This commit is contained in:
171
templates/newsletter/newsletter.php
Normal file
171
templates/newsletter/newsletter.php
Normal file
@@ -0,0 +1,171 @@
|
||||
<? global $lang;?>
|
||||
<div id="newsletter">
|
||||
<div class="title"><?= ucfirst( $lang['newsletter'] );?></div>
|
||||
<div id="text"><?= $lang['newsletter-text'];?></div>
|
||||
<form method="POST" data-toggle="validator" role="form" id="newsletter-form">
|
||||
<div class="form-group input">
|
||||
<input type='email' id="email" name="email" class="form-control" required placeholder="<?= ucfirst( $lang['email'] );?>">
|
||||
<a href="#" class="btn btn-danger" id="newsletter-signin"><span class="text">Zapisz się</span></a>
|
||||
</div>
|
||||
<div class="form-group agreement">
|
||||
<input type="checkbox" id="agreement" /> <span id="first" class="bold"><?= $lang['newsletter-zgoda-1'];?></span> <span id="second" class="hidden"><?= $lang['newsletter-zgoda-2'];?></span><a href="#" id="toggle-data"><?= $lang['rozwin'];?></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( click_event, '#newsletter-form #toggle-data', function()
|
||||
{
|
||||
var second = $( this ).parents( '.form-group' ).children( '#second' );
|
||||
|
||||
if ( second.hasClass( 'hidden' ) )
|
||||
{
|
||||
second.removeClass( 'hidden' );
|
||||
$( this ).html( '<?= $lang['zwin'];?>' );
|
||||
}
|
||||
else
|
||||
{
|
||||
second.addClass( 'hidden' );
|
||||
$( this ).html( '<?= $lang['rozwin'];?>' );
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$( 'body' ).on( click_event, '#newsletter-form #newsletter-signin', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
if ( !$( '#newsletter-form #agreement' ).is( ':checked' ) )
|
||||
{
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( $lang['blad'] );?>',
|
||||
content: '<?= $lang['newsletter-zgoda-komunikat'];?>',
|
||||
type: 'blue',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'confirm|10000',
|
||||
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: 'fas fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'confirm|10000',
|
||||
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: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
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: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'confirm|10000',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= $lang['zamknij'];?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
28
templates/newsletter/preview.php
Normal file
28
templates/newsletter/preview.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<div style="border-bottom: 1px solid #ccc;">
|
||||
<?= $this -> settings['newsletter_header'];?>
|
||||
</div>
|
||||
<div style="border-bottom: 1px solid #ccc; padding: 10px 0 0 0;">
|
||||
<? if ( is_array( $this -> articles ) ): foreach ( $this -> articles as $article ):?>
|
||||
<? $article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $article['language']['title'] );?>
|
||||
<div style="padding: 10px; background: #F1F1F1; margin-bottom: 10px">
|
||||
<?
|
||||
$article['language']['seo_link'] ? $url = $article['language']['seo_link'] : $url = 'a-' . $article['id'] . '-' . \S::seo( $article['language']['title'] );
|
||||
?>
|
||||
<a href="http://www.<?= $_SERVER['SERVER_NAME'];?>/<?= $url;?>" title="<?= $article['language']['title'];?>" style="margin-bottom: 10px; display: block; font-size: 14px; color: #5b7fb1; font-weight: 600;">
|
||||
<?= $article['language']['title'];?>
|
||||
</a>
|
||||
<div>
|
||||
<?
|
||||
if ( $article['language']['entry'] )
|
||||
echo $article['language']['entry'];
|
||||
else
|
||||
echo $article['language']['text'];
|
||||
?>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
<div style="border-bottom: 1px solid #ccc; padding: 10px 0 0 0;">
|
||||
<?= $this -> settings['newsletter_footer'];?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user