Commit ef3b4b05 authored by Sylvain Kerkour's avatar Sylvain Kerkour

theme

parent 14d7c9c5
Pipeline #147305160 passed with stages
in 57 seconds
......@@ -11,58 +11,12 @@ date = 2019-02-05T01:42:42+02:00
<br />
<div id="osw-alert"></div>
<div id="fe-alert"></div>
<div class="loader center"></div>
<div class="spinner-border text-primary" role="status" style="display: none;" id="osw-loader">
<span class="sr-only">Loading...</span>
</div>
Are you Sure?
<a href="/"><button type="button" class="btn btn-primary">Cancel</button></a>
<button type="button" class="btn btn-danger" id="osw-unsubscribe-btn">Yes, unsubscribe me</button>
<script type="text/javascript">
function unsubscribe() {
hideAlert();
var urlParams = new URLSearchParams(window.location.search);
var token = urlParams.get('token');
var contactId = urlParams.get('contact');
if (token == null || contactId == null) {
hideLoader();
displayError('Error unsuscribing. Please click again on the link provided in the email.');
return;
}
var query = 'mutation($input: UnsubscribeContactInput!) { unsubscribeContact(input: $input) }';
var variables = {
input: {
id: decodeURIComponent(contactId),
token: token,
},
};
graphqlReq(query, variables)
.done(function(data) {
if (data.errors && data.errors.length > 0) {
displayError(data.errors[0].message);
return ;
}
displaySuccess('You no longer will receive our emails. Have a good day!');
})
.fail(function() {
displayError('Error unsuscribing. Please click again on the link provided in the email.');
})
.always(function() {
hideLoader();
})
}
$(document).ready(function() {
hideLoader();
$("#osw-unsubscribe-btn").click(function(e) {
e.preventDefault();
unsubscribe();
});
});
</script>
<h1>{{ .Title }}</h1>
<div class="center">
<!-- <div class="center">
<h3><a href="/subscribe"><button type="button">Subscribe</button></a></h3>
<small>
I’ll email you once a week on open source, sustainability and avoiding complexity. <br />
You can subscribe by Email, RSS or Mastodon
</small>
</div>
</div> -->
<div>
{{ .Content }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment