vishwamano

source of vishwamano.com
git clone git://git.ricketyspace.net/vishwamano.git
Log | Files | Refs

commit 959a0912837455372ad2de12997c1a7ef5cbd645
parent 458a03ca42507c48140bb282339bdc1f91a40138
Author: rsiddharth <rsiddharth@ninthfloor.org>
Date:   Sat,  6 Feb 2016 18:13:10 -0500

Added a third aside (Book Shoot).

Diffstat:
post.php | 26++++++++++++++++++++++++++
themes/bs3/js/site.js | 41+++++++++++++++++++++++++++++++++++++++++
themes/bs3/templates/aside.tpl | 99++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
themes/bs3/templates/header.tpl | 9++++++++-
themes/bs3/templates/js.tpl | 2++
5 files changed, 168 insertions(+), 9 deletions(-)

diff --git a/post.php b/post.php @@ -0,0 +1,26 @@ +<?php + +/* Vishmano.com PHP Snafu + + Copyright (C) 2014 rsiddharth <rsiddharth@ninthfloor.org> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + COPYING contains the full text of the GNU Affero General Public + License. If you have not recieved a copy of the file along with + this program, see <http://www.gnu.org/licenses/>. + +*/ + +require_once('./templating.php'); +require_once($abs_path . '/utils.php'); + +print(request_shoot($lemail, $lemail)); diff --git a/themes/bs3/js/site.js b/themes/bs3/js/site.js @@ -0,0 +1,41 @@ +$('#vm-bshoot-form').submit(function(event){ + console.log('subit y.'); + event.preventDefault(); + bshoot_submit(); +}); + +function bshoot_submit() { + $.post('/post.php', $('#vm-bshoot-form').serialize()) + .done(function(data) { + if(data === 'success') + book_shoot_success(); + else + book_shoot_error(); + }); +} + +function book_shoot_success() { + var stype = $('#vm-bshoot-form').find('input[name=stype]').val(); + var alert_text = 'You have successfully requested for ' + stype; + alert_text += ' shoot. <strong>Vishwa Manoharan</strong> will get back to you soon. Should you have a query, kindly call/WhatsApp <strong>+91-9176560151</strong>.'; + show_global_alert(alert_text, 'alert-success'); +} + +function book_shoot_error() { + var alert_text = '<strong>Shoot request unsuccessful</strong>, please try again. If problem persists email <strong>Vishwa Manoharan &lt;vishwa91photography@gmail.com&gt;</strong>.' + show_global_alert(alert_text, 'alert-danger'); +} + + +function show_global_alert(text, type) { + $('#vm-globle-alert-box').html(text); + $('#vm-globle-alert-box').attr('class', 'alert ' + type); + $('.vm-global-alert-container').css('display', 'block'); + setTimeout(function() { + $('.vm-global-alert-container').fadeOut('slow'); + }, 20000); + $('#vm-bshoot-modal').modal('hide'); + $('#vm-bshoot-modal').on('hidden.bs.modal', function(e){ + $('html, body').animate({ scrollTop: 0 }, 'slow'); + }); +} diff --git a/themes/bs3/templates/aside.tpl b/themes/bs3/templates/aside.tpl @@ -1,23 +1,33 @@ <hr class="hr-long"/> <div id="aside-row" class="row"> - <div class="col-sm-offset-1 col-sm-5 p-workshop border-right"> <!-- p-workshop start --> + <div class="col-sm-4 p-workshop border-right"> <!-- p-workshop start --> <h2 class="margin-top text-center"><a href="/workshops/">Learn Photography</a></h2> <hr class="hr-short" /> <div class="p-workshop-updates"> <!-- p-workshop-updates start --> - <p class="text-center"> + <p> <a href="/workshops/">Basics of Photography, 2 Weekend Workshop from March 19, 2016. </a> </p> - <p class="text-center"> + <p> <a href="/workshops/">Advanced Photography, 4 Weekend Workshop from April 2, 2016. </a> </p> </div> <!-- p-workshop-updates end --> </div> <!-- p-workshop end --> - <hr class="hr-long visible-xs"> + <hr class="hr-long visible-xs" /> - <div class="col-sm-6 sitouch"> + <div class="col-sm-4 bshoot border-right"> + <h2 class="margin-top text-center">Book a Shoot</h2> + <hr class="hr-short" /> + <p><a id="vm-bookshoot-modal-trigger" data-toggle="modal" href="#vm-bshoot-modal"> + Kid Portraitures, Couple Portraitures, Modelling Portfolios + and Corporate Portraitures</a>.</p> + </div> <!-- bshoot end --> + + <hr class="hr-long visible-xs" /> + + <div class="col-sm-4 sitouch"> <h2 class="margin-top text-center">Stay in touch</h2> <hr class="hr-short" /> <ul id="stay-in-touch" class="list-inline text-center"> @@ -26,7 +36,80 @@ <li><a href="https://instagram.com/vishwa_mano"><i class="fa fa-instagram"></i></a></li> <li><a href="mailto:vishwa91photography@gmail.com"><i class="fa fa-envelope"></i></a></li> </ul> - </div> - </div> - <hr class="hr-long"/> + </div> <!-- sitouch end --> + </div> <!-- aside row end --> +<hr class="hr-long"/> + +<!-- book a shoot modal start --> +<div class="modal fade" id="vm-bshoot-modal" tabindex="-1" role="dialog" + aria-labelledby="vm-bshoot-modal-label"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> + <span aria-hidden="true">&times;</span> + </button> + <h3 class="modal-title" id="vm-bshoot-modal-label">Book a shoot</h3> + </div> + <div class="modal-body"> + <form id="vm-bshoot-form" method="POST"> + <div class="form-group"> + <label for="vm-bshoot-shoot-name" class="control-label">Name:</label> + <input type="text" name="name" class="form-control" id="vm-bshoot-shoot-name" required> + </div> + <div class="form-group"> + <label for="vm-bshoot-email" class="control-label">Email:</label> + <input type="email" name="email" class="form-control" id="vm-bshoot-email" required> + </div> + <div class="form-group"> + <label for="vm-bshoot-phone" class="control-label">Phone:</label> + <input type="tel" name="phone" class="form-control" id="vm-bshoot-phone"> + </div> + + <div class="form-group"> + <label class="control-label"> Type of Shoot:</label> + <div class="radio"> + <label> + <input type="radio" name="stype" id="vm-bshoot-rdio-kp" value="Kid Portraitures" + required> + Kid Portraitures + </label> + </div> + <div class="radio"> + <label> + <input type="radio" name="stype" id="vm-bshoot-rdio-mp" value="Modelling Portfolio"> + Modelling Portfolio + </label> + </div> + <div class="radio"> + <label> + <input type="radio" name="stype" id="vm-bshoot-rdio-cp" value="Couple Portraitures"> + Couple Portraitures + </label> + </div> + <div class="radio"> + <label> + <input type="radio" name="stype" id="vm-bshoot-rdio-corpp" value="Corporate Portraitures"> + Corporate Portraitures + </label> + </div> + <div class="radio"> + <label> + <input type="radio" name="stype" id="vm-bshoot-rdio-others" value="Others"> + Others + </label> + </div> + </div> <!-- radios end --> + <div class="form-group"> + <label for="vm-bshoot-humantest" class="control-label">What is 100 + 1?:</label> + <input type="number" name="humantest" class="form-control" id="vm-bshoot-humantest" required> + </div> + </form> + </div> <!-- modal body end --> + <div class="modal-footer"> + <button id="vm-bshoot-submit" type="submit" form="vm-bshoot-form" class="btn btn-primary">Book</button> + </div> + </div> <!-- modal dialog end --> + </div> <!-- modal dialog end --> +</div><!-- book a shoot modal start --> diff --git a/themes/bs3/templates/header.tpl b/themes/bs3/templates/header.tpl @@ -43,4 +43,11 @@ </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> - </nav> + </nav> + + <div class="container-fluid vm-global-alert-container"> + <div class="col-sm-offset-1 col-sm-10"> + <div id="vm-globle-alert-box" role="alert"> + </div> + </div> + </div> diff --git a/themes/bs3/templates/js.tpl b/themes/bs3/templates/js.tpl @@ -1,2 +1,4 @@ <script type="text/javascript" src="{$doc_root}themes/bs3/js/vm.min.js"></script> +<script type="text/javascript" + src="{$doc_root}themes/bs3/js/site.js"></script>