forked from godofredoninja/Mapache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom-archive-newsletter.hbs
63 lines (53 loc) · 2.05 KB
/
custom-archive-newsletter.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{{!-- Layout --}}
{{!< default }}
{{!-- Class for <body> --}}
{{#contentFor "mapache_class_body"}}is-newsletter{{/contentFor}}
{{#post}}
{{!-- Background --}}
<div class="page-hero-bg">
<img
class="u-absolute u-sizeFullWidth"
src="{{asset "images/crystal-mountain.png"}}"
srcset="{{asset "images/crystal-mountain.png"}}, {{asset "images/crystal-mountain@2x.png"}} 2x"
style="z-index: -1"
alt=""
/>
</div>
<article class="ne page-hero-wrap">
<header class="page-hero-inner u-container u-maxWidth1000 u-textAlignCenter u-sizeFullWidth">
<h1 class="page-hero-name u-fontSizeJumbo u-fontWeightNormal u-md-fontSize36 u-fontWeightSemibold"><span class="ne-t u-relative">{{title}}</span></h1>
<div class="page-hero-content u-fontWeightThin u-fontSize28 u-md-fontSize22 u-maxWidth740 u-marginAuto">{{custom_excerpt}}</div>
</header>
<section class="ne-body u-relative u-container"><div class="post-inner u-maxWidth1000 u-marginAuto ">{{content}}</div></section>
</article>
{{/post}}
{{#contentFor "scripts"}}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script>
$(document).ready(function() {
var $form = $('#godo-form');
$form.submit(function (e) {
e.preventDefault();
$.ajax({
type: $form.attr('method'),
url: $form.attr('action').replace('/post?', '/post-json?').concat('&c=?'),
data: $form.serialize(),
cache: false,
dataType: 'jsonp',
contentType: 'application/json; charset=utf-8',
success: function(data) {
if (data.result === 'success') {
$('.godo-ne-input').removeClass('error');
$('.godo-ne-success').removeClass('u-hide');
$form.addClass('u-hide');
$('.godo-ne-input').val('');
} else {
$('.godo-ne-input').addClass('error');
}
}
});
return false;
});
});
</script>
{{/contentFor}}