first commit
This commit is contained in:
170
templates/newsletter/newsletter.php
Normal file
170
templates/newsletter/newsletter.php
Normal file
@@ -0,0 +1,170 @@
|
||||
<? global $lang;?>
|
||||
<div id="newsletter">
|
||||
<form method="POST" data-toggle="validator" role="form" id="newsletter-form">
|
||||
<div class="form-group">
|
||||
<label for="newsletter-email"><?= ucfirst( $lang['email'] );?> <span class='red'>*</span>:</label>
|
||||
<input type='email' id="email" name="email" class="form-control" required />
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="checkbox" id="agreement" /> <?= $lang['newsletter-zgoda'];?>
|
||||
</div>
|
||||
<div class="form-group clearfix">
|
||||
<a href="#" class="btn btn-primary" id="newsletter-signin">Zapisz się</a>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<span id="first" class="bold"><?= $lang['newsletter-administrator-danych-1'];?></span> <span id="second" class="hidden"><?= $lang['newsletter-administrator-danych-2'];?></span><a href="#" id="toggle-data"><?= $lang['rozwin'];?></a>
|
||||
</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 offset-sm-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 offset-sm-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 offset-sm-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 offset-sm-3',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= $lang['zamknij'];?>',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
42
templates/newsletter/preview.php
Normal file
42
templates/newsletter/preview.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<? global $settings;?>
|
||||
<? if ( $this -> settings['newsletter_header'] ):?>
|
||||
<?= $this -> settings['newsletter_header'];?>
|
||||
<? endif;?>
|
||||
<div style="border-bottom: 1px solid #ccc; padding: 10px 0 0 0;">
|
||||
<? if ( is_array( $this -> template ) ):?>
|
||||
<div style="padding: 10px; background: #F1F1F1; margin-bottom: 10px">
|
||||
<?= $this -> template['text']?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? 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="<? if ( $settings['ssl'] ) echo 'https'; else echo 'http';?>://<?= $_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;?>
|
||||
<? else:?>
|
||||
<? if ( $this -> dates ):?>
|
||||
<div style="padding: 10px; background: #F1F1F1; margin-bottom: 10px; text-align: center;">
|
||||
--- brak artykułów w danym okresie ---
|
||||
</div>
|
||||
<? endif;?>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<? if ( $this -> settings['newsletter_footer_2'] ):?>
|
||||
<?= $this -> settings['newsletter_footer_2'];?>
|
||||
<? endif;?>
|
||||
Reference in New Issue
Block a user