<?php
$this->headTitle()->set('Contact Workshop Support');
?>
<?php if (!$partial): ?>
<div class="form-panel">
<h1 class="center">Contact Workshop Support</h1>
<?php endif ?>
<div class="<?php echo $partial ? 'modal hide fade' : '' ?> contact-dialog form-dialog">
<form method="post" class="modal-form">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Contact Workshop Support</h3>
</div>
<div class="modal-body">
<div class="control-group">
<label for="subject">Subject</label>
<select name="subject" class="span4" value="" required>
<?php
foreach ($subjects as $key => $subject) {
echo '<option value="' . $key . '">' . $subject . '</option>';
}
?>
</select>
</div>
<div class="control-group">
<label for="comment">Comment</label>
<textarea name="comment" class="span4" value="" required rows="5"></textarea>
<div class="help-block">
Your comments will be emailed to <?php echo $to; ?>;
replies will be sent to the email address you signed up with.
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-mlarge btn-primary send">Send Comment</button>
</div>
</form>
</div>
<?php if (!$partial): ?>
<div class="links muted center">
<a href="/docs/">Help</a>
</div>
</div>
<?php endif ?>
<script type="text/javascript">
$(function() {
// focus first, empty, input on show
$('.contact-dialog').on('shown', function() {
var comment = $('textarea[name=comment]', this).focus();
});
<?php if ($partial): ?>
swarm.modal.show('.contact-dialog');
<?php endif ?>
$('.contact-dialog form').submit(function(e) {
e.preventDefault();
swarm.form.post('/contact', '.contact-dialog form', function(response){
if (response.isValid) {
$('.contact-dialog form')[0].reset();
<?php if ($partial): ?>
$('.contact-dialog').modal('hide');
<?php else: ?>
// redirect the user to the homepage
window.location = "<?php echo $this->url('home') ?>";
<?php endif ?>
// add notification for 3 seconds
var toolTarget = $('body.authenticated ul.user li.dropdown a.dropdown-toggle');
toolTarget.tooltip({title: 'Message sent successfully.', trigger: 'manual', placement: 'bottom'}).tooltip('show');
setTimeout(function(){
toolTarget.tooltip('destroy');
}, 3000);
}
}, '.contact-dialog .modal-body');
});
});
</script>
# |
Change |
User |
Description |
Committed |
|
#1
|
18334 |
Liz Lam |
initial add of jambox |
|
|