Commit ca3a2c4c authored by Ozoux's avatar Ozoux

Make the get a quote button to send a chat

parent 070dbfcb
Pipeline #32 failed with stage
......@@ -20,7 +20,7 @@
<div class="row center card-order">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#modal-{{ .Params.name }}">
Order
Get a quote
</button>
<div class="modal fade" id="modal-{{ .Params.name }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
......@@ -30,27 +30,25 @@
<h4 class="modal-title" id="myModalLabel">Personal details</h4>
</div>
<div class="modal-body">
<form action="mailto:contact@indie.host" method="post" >
<div class="form-group">
<input class="form-control" type="text" name="first_name" placeholder="First Name" required/>
<input id="first-{{ .Params.name }}" class="form-control" type="text" name="first_name" placeholder="First Name" required/>
</div>
<div class="form-group">
<input class="form-control" type="text" name="last_name" placeholder="Last Name" required/>
<input id="last-{{ .Params.name }}" class="form-control" type="text" name="last_name" placeholder="Last Name" required/>
</div>
<div class="form-group">
<input class="form-control" type="email" name="email" placeholder="Email" required/>
<input id="email-{{ .Params.name }}" class="form-control" type="email" name="email" placeholder="Email" required/>
</div>
<div class="form-group">
<input class="form-control" type="domain" name="Domain Name" placeholder="Choose a domain name or ask us for help to pick one"/>
<input id="domain-{{ .Params.name }}" class="form-control" type="domain" name="Domain Name" placeholder="Choose a domain name or ask us for help to pick one"/>
</div>
<div class="form-group">
<input class="form-control" type="text" name="comment" placeholder="If you have any questions or remarks">
<input id="question-{{ .Params.name }}" class="form-control" type="text" name="comment" placeholder="If you have any questions or remarks">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<input type="submit" name="submit" class="btn btn-primary" value="Get a Quote">
<button class="app-request btn btn-primary" data-appid="{{ .Params.name }}">Get a quote</button>
</div>
</form>
</div>
</div>
</div>
......
$(document).on('click', '.app-request', function () {
var appid = $(this).data('appid');
var first = document.getElementById('first-' + appid).value
var last = document.getElementById('last-' + appid).value
var domain = document.getElementById('domain-' + appid).value
var email = document.getElementById('email-' + appid).value
var question = document.getElementById('question-' + appid).value
text = first + ' ' + last + ' ' + email + ' would like ' + appid + ' on ' + domain + ' - question: ' + question;
jQuery.post(
'https://chat.indie.host/hooks/vGTrWc3BSB4CYZ4hx/2Fxzw2n9o6fWAo4HmKe6SgZfWLNiYjjy7934LAMkEzWYEfZt',
{'text':text},
function() {
$('#button-' + appid).prop('value', 'Thanks! Your Hoster will contact you soon!').prop("disabled",true);;
});
});
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