credit card, button, modal size fixed
This commit is contained in:
parent
8f44c43850
commit
1648d9558c
7 changed files with 75 additions and 39 deletions
|
@ -19,7 +19,6 @@ $( document ).ready(function() {
|
|||
}
|
||||
if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
|
||||
// Only send the token to relative URLs i.e. locally.
|
||||
alert("POR AQUI");
|
||||
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +33,6 @@ $( document ).ready(function() {
|
|||
|
||||
function submit_payment(e){
|
||||
$('#billing-form').submit();
|
||||
alert("POR AQUI2");
|
||||
// $form.submit();
|
||||
}
|
||||
|
||||
|
@ -44,7 +42,7 @@ $( document ).ready(function() {
|
|||
|
||||
/* If you're using Stripe for payments */
|
||||
function payWithStripe(e) {
|
||||
console.log("submiting33");
|
||||
console.log("submiting");
|
||||
e.preventDefault();
|
||||
|
||||
if (!$('.agree-terms').is(':checked')){
|
||||
|
@ -55,7 +53,6 @@ $( document ).ready(function() {
|
|||
|
||||
/* Visual feedback */
|
||||
$form.find('[type=submit]').html('Validating <i class="fa fa-spinner fa-pulse"></i>');
|
||||
alert("POR AQUI3");
|
||||
console.log("submiting2");
|
||||
var PublishableKey = window.stripeKey;
|
||||
alert(PublishableKey);
|
||||
|
@ -63,7 +60,6 @@ $( document ).ready(function() {
|
|||
Stripe.card.createToken($form, function stripeResponseHandler(status, response) {
|
||||
if (response.error) {
|
||||
/* Visual feedback */
|
||||
alert("POR AQUI32345");
|
||||
$form.find('[type=submit]').html('Try again');
|
||||
/* Show Stripe errors on the form */
|
||||
$form.find('.payment-errors').text(response.error.message);
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
<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="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>
|
||||
|
||||
<div class="modal fade bs-example-modal-sm" id="cancel-booking-modal" tabindex="-1" role="dialog">
|
||||
|
|
|
@ -19,18 +19,17 @@
|
|||
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;
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin: 30px auto 30px;
|
||||
color: #88c7d7;
|
||||
}
|
||||
}
|
||||
.price2 {
|
||||
|
||||
|
||||
|
@ -38,6 +37,45 @@
|
|||
-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-content">
|
||||
<div class="modal-body">
|
||||
<div class="modal-dialog" role="document">
|
||||
|
||||
<section id="price2">
|
||||
<div class="container">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<section id="price2">
|
||||
<div class="container">
|
||||
|
||||
<!--<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">×</span></button>
|
||||
<div class="price-box">
|
||||
|
||||
<div class="row col-xs-12 col-sm-12 col-lg-10 text-center wow fadeInDown">
|
||||
<div class="price-box">
|
||||
<span class="glyphicon glyphicon-flag"></span>
|
||||
<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>
|
||||
|
|
|
@ -72,14 +72,15 @@
|
|||
</form>
|
||||
|
||||
{% 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">Type: {{cc_brand}}</h2>
|
||||
<input type="hidden" name="credit_card_needed" value="false"/>
|
||||
</form>
|
||||
<h2 class="billing-head">Credit Card (New One)</h2>
|
||||
<div class="signup-form form-group row">
|
||||
{% csrf_token %}
|
||||
|
||||
<form role="form" id="payment-form" novalidate>
|
||||
{% csrf_token %}
|
||||
<div class="row">
|
||||
|
@ -125,7 +126,8 @@
|
|||
<div class="row">
|
||||
<div class="row">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</form>
|
||||
<br>
|
||||
<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>
|
||||
|
|
|
@ -18,7 +18,7 @@ urlpatterns = [
|
|||
url(_(r'probar/?$'), Probar, name='probar'),
|
||||
url(_(r'login/validate/(?P<pk>\!\w+)/?$'), ValidateUser.as_view(), name='validate-login'),
|
||||
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'contact/?$'), ContactView.as_view(), name='contact'),
|
||||
url(_(r'login/?$'), LoginView.as_view(), name='login'),
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import json
|
||||
import datetime
|
||||
|
||||
from django.views.decorators.csrf import csrf_protect, csrf_exempt
|
||||
from django.template import RequestContext
|
||||
from django.conf import settings
|
||||
from django.shortcuts import get_object_or_404, render
|
||||
from django.forms import ModelForm
|
||||
|
@ -71,7 +72,6 @@ class ValidateView(SignupViewMixin):
|
|||
form_class = SignupForm
|
||||
success_url = reverse_lazy('digitalglarus:login')
|
||||
|
||||
|
||||
#def activarUsuario(request, pk):
|
||||
#if request.method == 'POST':
|
||||
# u = U.objects.get(pk = pk)
|
||||
|
@ -83,6 +83,7 @@ class ValidateView(SignupViewMixin):
|
|||
#resp['msg'] = 0 #0 para exito
|
||||
#return HttpResponse(json.dumps(resp), content_type ='application/json')
|
||||
|
||||
@csrf_exempt
|
||||
def TermsAndConditions(request):
|
||||
#template_name ="digitalglarus/new_credit_card.html"
|
||||
print (request.user)
|
||||
|
@ -94,14 +95,9 @@ def TermsAndConditions(request):
|
|||
credit_card_data = last_booking_order.get_booking_cc_data() if last_booking_order \
|
||||
and last_booking_order.get_booking_cc_data() \
|
||||
else last_membership_order.get_membership_order_cc_data()
|
||||
for t in m:
|
||||
print (t)
|
||||
print ("Credit cad last4",credit_card_data['last4'])
|
||||
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})
|
||||
|
||||
current_billing_address = request.user.billing_addresses.first()
|
||||
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))
|
||||
'''
|
||||
def get_success_url(self):
|
||||
# redirect to membership orders list if user has at least one.
|
||||
|
|
Loading…
Reference in a new issue