credit card, button, modal size fixed

This commit is contained in:
unknown 2016-12-20 11:15:09 -04:00
parent 8f44c43850
commit 1648d9558c
7 changed files with 75 additions and 39 deletions

View file

@ -19,7 +19,6 @@ $( document ).ready(function() {
} }
if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) { if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
// Only send the token to relative URLs i.e. locally. // Only send the token to relative URLs i.e. locally.
alert("POR AQUI");
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
} }
} }
@ -34,7 +33,6 @@ $( document ).ready(function() {
function submit_payment(e){ function submit_payment(e){
$('#billing-form').submit(); $('#billing-form').submit();
alert("POR AQUI2");
// $form.submit(); // $form.submit();
} }
@ -44,7 +42,7 @@ $( document ).ready(function() {
/* If you're using Stripe for payments */ /* If you're using Stripe for payments */
function payWithStripe(e) { function payWithStripe(e) {
console.log("submiting33"); console.log("submiting");
e.preventDefault(); e.preventDefault();
if (!$('.agree-terms').is(':checked')){ if (!$('.agree-terms').is(':checked')){
@ -55,7 +53,6 @@ $( document ).ready(function() {
/* Visual feedback */ /* Visual feedback */
$form.find('[type=submit]').html('Validating <i class="fa fa-spinner fa-pulse"></i>'); $form.find('[type=submit]').html('Validating <i class="fa fa-spinner fa-pulse"></i>');
alert("POR AQUI3");
console.log("submiting2"); console.log("submiting2");
var PublishableKey = window.stripeKey; var PublishableKey = window.stripeKey;
alert(PublishableKey); alert(PublishableKey);
@ -63,7 +60,6 @@ $( document ).ready(function() {
Stripe.card.createToken($form, function stripeResponseHandler(status, response) { Stripe.card.createToken($form, function stripeResponseHandler(status, response) {
if (response.error) { if (response.error) {
/* Visual feedback */ /* Visual feedback */
alert("POR AQUI32345");
$form.find('[type=submit]').html('Try again'); $form.find('[type=submit]').html('Try again');
/* Show Stripe errors on the form */ /* Show Stripe errors on the form */
$form.find('.payment-errors').text(response.error.message); $form.find('.payment-errors').text(response.error.message);

View file

@ -84,7 +84,7 @@
<input type="hidden" name="start_date" value="{{order.booking.start_date}}"> <input type="hidden" name="start_date" value="{{order.booking.start_date}}">
<!-- <a class="" href="{% url 'digitalglarus:booking_orders_list' %}" data-toggle="modal" data-target="#cancel-booking-modal">Cancel booking</a> --> <!-- <a class="" href="{% url 'digitalglarus:booking_orders_list' %}" data-toggle="modal" data-target="#cancel-booking-modal">Cancel booking</a> -->
<a class="btn btn-primary btn-blue" href="{% url 'digitalglarus:booking_orders_list' %}">Go to my page</a> <a class="btn btn-primary btn-blue" href="{% url 'digitalglarus:booking_orders_list' %}">Go to my page</a>
<button type="button" class="btn btn-primary btn-blue" data-toggle="modal" data-target="#cancel-booking-modal">Cancel booking</button> <button type="button" class="btn btn-primary btn-grey" data-toggle="modal" data-target="#cancel-booking-modal">Cancel booking</button>
</p> </p>
<div class="modal fade bs-example-modal-sm" id="cancel-booking-modal" tabindex="-1" role="dialog"> <div class="modal fade bs-example-modal-sm" id="cancel-booking-modal" tabindex="-1" role="dialog">

View file

@ -19,18 +19,17 @@
padding-right: 1.5em padding-right: 1.5em
} }
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
}
#cancel-subscription-modal .modal-dialog {width:1000px;} cancel-subscription-modal .modal-dialog {width:1000px;}
.glyphicon-flag { .glyphicon-flag {
font-size: 44px; font-size: 44px;
display: block; display: block;
text-align: center; text-align: center;
margin: 30px auto 30px; margin: 30px auto 30px;
color: #88c7d7; color: #88c7d7;
} }
.price2 { .price2 {
@ -38,6 +37,45 @@
-moz-background-size: cover; -moz-background-size: cover;
} }
cancel-subscription-modal .modal-body {
max-height: 800px;
}
}
@media screen and (min-width: 780px) {
cancel-subscription-modal .modal-dialog {width:1000px;}
.glyphicon-flag {
font-size: 44px;
display: block;
text-align: center;
margin: 30px auto 30px;
color: #88c7d7;
}
.price2 {
-webkit-background-size: cover;
-moz-background-size: cover;
}
}
@media screen and (min-width: 982px) {
cancel-subscription-modal .modal-dialog {width:600px;}
cancel-subscription-modal .modal-body {
max-height: 600px;
}
} }
@ -212,19 +250,23 @@
<div class="modal fade bs-example-modal-sm" id="cancel-subscription-modal" tabindex="-1" role="dialog" aria-hidden ="true">
<div class="modal fade bs-example-modal-sm" id="cancel-subscription-modal" tabindex="-1" role="dialog" aria-hidden ="true">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-body"> <div class="modal-body">
<section id="price2"> <section id="price2">
<div class="container"> <div class="container">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div class="row col-xs-12 col-sm-12 col-lg-10 text-center wow fadeInDown"> <!--<div class="row col-md-2 text-center wow fadeInDown"></div> -->
<div class="row col-xs-12 col-sm-7 col-lg-6 text-center wow fadeInDown">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div class="price-box"> <div class="price-box">
<span class="glyphicon glyphicon-flag"></span> <span class="glyphicon glyphicon-flag"></span>
<h2 class="section-heading">General Terms & Conditions of Digital Glarus Membership</h2> <h2 class="section-heading">General Terms & Conditions of Digital Glarus Membership</h2>
<h2 class="price">Valid from 31 October 2016, v1.0 dated 31 October 2016</h2> <h2 class="price">Valid from 31 October 2016, v1.0 dated 31 October 2016</h2>

View file

@ -72,14 +72,15 @@
</form> </form>
{% else %} {% else %}
<form role="form" id="billing-form" method="post" action="{% url 'digitalglarus:booking_payment' %}" novalidate> <form role="form" id="billing-form" method="post" action="{% url 'digitalglarus:TermsAndConditions' %}" novalidate>
{% csrf_token %}
<h2 class="membership-lead">Last 4: *****{{last4}}</h2> <h2 class="membership-lead">Last 4: *****{{last4}}</h2>
<h2 class="membership-lead">Type: {{cc_brand}}</h2> <h2 class="membership-lead">Type: {{cc_brand}}</h2>
<input type="hidden" name="credit_card_needed" value="false"/> <input type="hidden" name="credit_card_needed" value="false"/>
</form> </form>
<h2 class="billing-head">Credit Card (New One)</h2> <h2 class="billing-head">Credit Card (New One)</h2>
<div class="signup-form form-group row"> <div class="signup-form form-group row">
{% csrf_token %}
<form role="form" id="payment-form" novalidate> <form role="form" id="payment-form" novalidate>
{% csrf_token %} {% csrf_token %}
<div class="row"> <div class="row">
@ -125,7 +126,8 @@
<div class="row"> <div class="row">
<div class="row"> <div class="row">
<div class="col-xs-6 col-md-6 col-xs-offset-1 col-md-offset-3"> <div class="col-xs-6 col-md-6 col-xs-offset-1 col-md-offset-3">
<button type="button" class="btn btn-primary btn-grey" data-dismiss="modal">Cancel</button> <a class="btn btn-primary btn-grey" href="{% url 'digitalglarus:booking_payment' %}">Go to my page</a>
<button class="btn btn-primary btn-md btn-blck submit-payment" type="submit">Save</button> <button class="btn btn-primary btn-md btn-blck submit-payment" type="submit">Save</button>
</div> </div>
</div> </div>

View file

@ -26,7 +26,7 @@
</form> </form>
<br> <br>
<div class="notice-box"> <div class="notice-box">
<p class="signup-text">Still have trouble? For technical support <a href="mailto:info@ungleich.ch" > Contact us </a>.</p> <p class="signup-text">Still have trouble? For technical support, <a href="mailto:info@ungleich.ch"> contact us </a>.</p>
</div> </div>
</div> </div>

View file

@ -18,7 +18,7 @@ urlpatterns = [
url(_(r'probar/?$'), Probar, name='probar'), url(_(r'probar/?$'), Probar, name='probar'),
url(_(r'login/validate/(?P<pk>\!\w+)/?$'), ValidateUser.as_view(), name='validate-login'), url(_(r'login/validate/(?P<pk>\!\w+)/?$'), ValidateUser.as_view(), name='validate-login'),
url(_(r'^$'), IndexView.as_view(), name='landing'), url(_(r'^$'), IndexView.as_view(), name='landing'),
url(_(r'terms_conditions/?$'), TermsAndConditions, name='TermsAndConditions'), url(_(r'new_credit_card/?$'), TermsAndConditions, name='TermsAndConditions'),
url(_(r'support-us/?$'), SupportusView.as_view(), name='supportus'), url(_(r'support-us/?$'), SupportusView.as_view(), name='supportus'),
url(_(r'contact/?$'), ContactView.as_view(), name='contact'), url(_(r'contact/?$'), ContactView.as_view(), name='contact'),
url(_(r'login/?$'), LoginView.as_view(), name='login'), url(_(r'login/?$'), LoginView.as_view(), name='login'),

View file

@ -1,6 +1,7 @@
import json import json
import datetime import datetime
from django.views.decorators.csrf import csrf_protect, csrf_exempt
from django.template import RequestContext
from django.conf import settings from django.conf import settings
from django.shortcuts import get_object_or_404, render from django.shortcuts import get_object_or_404, render
from django.forms import ModelForm from django.forms import ModelForm
@ -71,7 +72,6 @@ class ValidateView(SignupViewMixin):
form_class = SignupForm form_class = SignupForm
success_url = reverse_lazy('digitalglarus:login') success_url = reverse_lazy('digitalglarus:login')
#def activarUsuario(request, pk): #def activarUsuario(request, pk):
#if request.method == 'POST': #if request.method == 'POST':
# u = U.objects.get(pk = pk) # u = U.objects.get(pk = pk)
@ -83,6 +83,7 @@ class ValidateView(SignupViewMixin):
#resp['msg'] = 0 #0 para exito #resp['msg'] = 0 #0 para exito
#return HttpResponse(json.dumps(resp), content_type ='application/json') #return HttpResponse(json.dumps(resp), content_type ='application/json')
@csrf_exempt
def TermsAndConditions(request): def TermsAndConditions(request):
#template_name ="digitalglarus/new_credit_card.html" #template_name ="digitalglarus/new_credit_card.html"
print (request.user) print (request.user)
@ -94,14 +95,9 @@ def TermsAndConditions(request):
credit_card_data = last_booking_order.get_booking_cc_data() if last_booking_order \ credit_card_data = last_booking_order.get_booking_cc_data() if last_booking_order \
and last_booking_order.get_booking_cc_data() \ and last_booking_order.get_booking_cc_data() \
else last_membership_order.get_membership_order_cc_data() else last_membership_order.get_membership_order_cc_data()
for t in m:
print (t) current_billing_address = request.user.billing_addresses.first()
print ("Credit cad last4",credit_card_data['last4']) return render_to_response('digitalglarus/new_credit_card.html',{'last4':credit_card_data['last4'],'brand_type':credit_card_data['cc_brand'],'stripe_key': settings.STRIPE_API_PUBLIC_KEY,'street_address': current_billing_address.street_address,'city': current_billing_address.city, 'postal_code': current_billing_address.postal_code,'country': current_billing_address.country,},context_instance= RequestContext(request))
print ("Brand type",credit_card_data)
resp = dict()
resp['msg'] = 0 #0 para exito
#return HttpResponse(json.dumps(resp), content_type ='application/json')
return render_to_response('digitalglarus/new_credit_card.html',{'last4':credit_card_data['last4'],'brand_type':credit_card_data['cc_brand'],'stripe_key': settings.STRIPE_API_PUBLIC_KEY})
''' '''
def get_success_url(self): def get_success_url(self):
# redirect to membership orders list if user has at least one. # redirect to membership orders list if user has at least one.