Added DonatorStatus model in order to know if an donator has canceled or not his monthly donation, Now we create a DonatorStatus for the user after receiving his first donation. Added DonatorStatus view. Added donator_status.html in order to allow an user view his donation status , Added action to allow user to cancel his monthly donations. Now the user can logout using navbar. added Donation model to admin.Added command make_donations_charges in order to create stripe current monthly donations from all donators
This commit is contained in:
parent
cb520f6b58
commit
4580a75f89
22 changed files with 611 additions and 232 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{% load static bootstrap3 %}
|
||||
{% load static bootstrap3 i18n %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
|
@ -59,9 +59,20 @@
|
|||
<li>
|
||||
<a class="page-scroll" href="#contact">Contact</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="page-scroll" href="{% url 'nosystemd:login' %}">Login</a>
|
||||
</li>
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
|
||||
<i class="glyphicon glyphicon-user"></i> {{request.user.name}} <span class="caret"></span></a>
|
||||
<ul id="g-account-menu" class="dropdown-menu" role="menu">
|
||||
<li><a href="{% url 'nosystemd:logout' %}"><i class="glyphicon glyphicon-lock"></i> {% trans "Logout"%} </a></li>
|
||||
<li><a href="{% url 'nosystemd:donator_status' %}"><i class="fa fa-heart-o" aria-hidden="true"></i> {% trans "Donation"%} </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<a class="page-scroll" href="{% url 'nosystemd:login' %}">Login</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.navbar-collapse -->
|
||||
|
|
@ -90,7 +101,7 @@
|
|||
<script type="text/javascript" src="//js.stripe.com/v2/"></script>
|
||||
|
||||
<!-- Proccess payment lib -->
|
||||
<script type="text/javascript" src="{% static 'hosting/js/payment.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'nosystemd/js/donation.js' %}"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,36 +8,41 @@
|
|||
<div class="header-content-inner">
|
||||
|
||||
<div class="container payment-container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4 col-md-offset-3" >
|
||||
<h3><b>Monthly Donation</b></h3>
|
||||
<hr>
|
||||
<form role="form" novalidate>
|
||||
<div class="row">
|
||||
<div class="col-xs-9 col-md-4 col-md-offset-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<input type="number" class="form-control" placeholder="Amount to donate" name="donation_amount" />
|
||||
<form role="form" id="donation-form" name="donation-form" method="post" action="{% url 'nosystemd:donations' %}" novalidate>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4 col-md-offset-3" >
|
||||
<h3><b>Monthly Donation</b></h3>
|
||||
<hr>
|
||||
<!-- <form role="form" novalidate> -->
|
||||
<div class="row">
|
||||
<div class="col-xs-9 col-md-4 col-md-offset-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{% bootstrap_field form.donation_amount show_label=False type='fields'%}
|
||||
<!-- <input type="number" class="form-control" placeholder="Amount to donate" name="donation" /> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4 col-md-offset-3 billing">
|
||||
<h3><b>Billing Address</b></h3>
|
||||
<hr>
|
||||
<form role="form" id="billing-form" method="post" action="{% url 'hosting:payment' %}" novalidate>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4 col-md-offset-3 billing">
|
||||
<h3><b>Billing Address</b></h3>
|
||||
<hr>
|
||||
{% for field in form %}
|
||||
{% csrf_token %}
|
||||
{% bootstrap_field field show_label=False type='fields'%}
|
||||
|
||||
{% if not field.name == 'donation_amount' %}
|
||||
{% bootstrap_field field show_label=False type='fields'%}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% bootstrap_form_errors form type='non_fields'%}
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6 col-md-4 col-md-offset-3 creditcard-box">
|
||||
<h3><b>Payment Details</b></h3>
|
||||
|
|
|
|||
74
nosystemd/templates/nosystemd/donation_detail.html
Normal file
74
nosystemd/templates/nosystemd/donation_detail.html
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{% extends "nosystemd/base.html" %}
|
||||
{% load staticfiles bootstrap3 %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
|
||||
<div class="container order-detail-container">
|
||||
<div class="row">
|
||||
<div class="col-xs-8 col-xs-offset-2">
|
||||
<div class="invoice-title">
|
||||
<h2>{% trans "Invoice"%}</h2><h3 class="pull-right">{% trans "Donation #"%} {{donation.id}}</h3>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<address>
|
||||
<h3><b>{% trans "Billing Address:"%}</b></h3>
|
||||
{{user.name}}<br>
|
||||
{{donation.billing_address.street_address}},{{donation.billing_address.postal_code}}<br>
|
||||
{{donation.billing_address.city}}, {{donation.billing_address.country}}.
|
||||
</address>
|
||||
</div>
|
||||
<div class="col-xs-6 text-right">
|
||||
<address>
|
||||
<strong>{% trans "Date:"%}</strong><br>
|
||||
{{donation.created_at}}<br><br>
|
||||
<br><br>
|
||||
</address>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<address>
|
||||
<strong>{% trans "Payment Method:"%}</strong><br>
|
||||
{{donation.cc_brand}} ending **** {{donation.last4}}<br>
|
||||
{{user.email}}
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<h3><b>{% trans "Donation summary"%}</b></h3>
|
||||
<hr>
|
||||
<div class="content">
|
||||
<p><b>{% trans "Donation"%}-{{donation.created_at|date:"M Y"}}</b> <span class="pull-right">{{donation.donation}} USD</span></p>
|
||||
<hr>
|
||||
<h4>{% trans "Total"%}<p class="pull-right"><b>{{donation.donation}} USD</b></p></h4>
|
||||
</div>
|
||||
<br/>
|
||||
{% url 'hosting:payment' as payment_url %}
|
||||
{% if payment_url in request.META.HTTP_REFERER %}
|
||||
<div class=" content pull-right">
|
||||
<a href="{% url 'hosting:virtual_machine_key' order.vm_plan.id %}" ><button class="btn btn-info">{% trans "Finish Configuration"%}</button></a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<hr>
|
||||
{% trans "Thanks for you donation, you can cancel your monthly donation at any time going to profile > cancel danation"%}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<div class=" content pull-right">
|
||||
<a href="{% url 'nosystemd:landing' %}" ><button class="btn btn-info">{% trans "Return to home"%}</button></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%endblock%}
|
||||
40
nosystemd/templates/nosystemd/donator_status.html
Normal file
40
nosystemd/templates/nosystemd/donator_status.html
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{% extends "nosystemd/base.html" %}
|
||||
{% load staticfiles bootstrap3 i18n %}
|
||||
{% block content %}
|
||||
|
||||
<header>
|
||||
<div class="header-content">
|
||||
<div class="header-content-inner">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
|
||||
|
||||
{% if messages %}
|
||||
<ul class="list-unstyled">
|
||||
{% for message in messages %}
|
||||
<li>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<h1 id="homeHeading">Thanks you</h1>
|
||||
<hr>
|
||||
<p>Your monthly donation status is {{donator_status.status}}</p>
|
||||
<form action="{% url 'nosystemd:change_donator_status' donator_status.id %}" method="post" class="form" novalidate>
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-primary btn-xl page-scroll">
|
||||
{% if donator_status.status == 'active'%}
|
||||
{% trans "Cancel Donation"%}
|
||||
{% else %}
|
||||
{% trans "Reanude Donation"%}
|
||||
{% endif %}
|
||||
|
||||
</button>
|
||||
</form>
|
||||
<br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -1,79 +1,6 @@
|
|||
{% load static bootstrap3 %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>Creative - Start Bootstrap Theme</title>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'nosystemd/vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<link href="{% static 'nosystemd/vendor/font-awesome/css/font-awesome.min.css' %}" rel="stylesheet" type="text/css">
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
||||
<link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
|
||||
|
||||
<!-- Plugin CSS -->
|
||||
<link href="{% static 'nosystemd/vendor/magnific-popup/magnific-popup.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Theme CSS -->
|
||||
<link href="{% static 'nosystemd/css/creative.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body id="page-top">
|
||||
|
||||
<nav id="mainNav" class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container-fluid">
|
||||
<!-- Brand and toggle get grouped for better mobile display -->
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
|
||||
<span class="sr-only">Toggle navigation</span> Menu <i class="fa fa-bars"></i>
|
||||
</button>
|
||||
<a class="navbar-brand page-scroll" href="#page-top">nosystemd</a>
|
||||
</div>
|
||||
|
||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a class="page-scroll" href="#about">About</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="page-scroll" href="#services">Services</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="page-scroll" href="#contact">Contact</a>
|
||||
</li>
|
||||
{% if not request.user.is_authenticated %}
|
||||
<li>
|
||||
<a class="page-scroll" href="{% url 'nosystemd:login' %}">Login</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<a class="page-scroll" href=" {% url 'nosystemd:logout' %}">Logout</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.navbar-collapse -->
|
||||
</div>
|
||||
<!-- /.container-fluid -->
|
||||
</nav>
|
||||
{% extends "nosystemd/base.html" %}
|
||||
{% load staticfiles bootstrap3 i18n %}
|
||||
{% block content %}
|
||||
|
||||
<header>
|
||||
<div class="header-content">
|
||||
|
|
@ -81,7 +8,7 @@
|
|||
<h1 id="homeHeading">No more SYSTEMD</h1>
|
||||
<hr>
|
||||
<p>We want to remove systemd from the famous linux distros and create a good replacement</p>
|
||||
<a href="{% url 'nosystemd:donation' %}" class="btn btn-primary btn-xl page-scroll">DONATE NOW</a>
|
||||
<a href="{% url 'nosystemd:donations' %}" class="btn btn-primary btn-xl page-scroll">DONATE NOW</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -170,21 +97,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="{% static 'nosystemd/vendor/jquery/jquery.min.js' %}"></script>
|
||||
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="{% static 'nosystemd/vendor/bootstrap/js/bootstrap.min.js' %}"></script>
|
||||
|
||||
<!-- Plugin JavaScript -->
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
|
||||
<script src="{% static 'nosystemd/vendor/scrollreveal/scrollreveal.min.js' %}"></script>
|
||||
<script src="{% static 'nosystemd/vendor/magnific-popup/jquery.magnific-popup.min.js' %}"></script>
|
||||
|
||||
<!-- Theme JavaScript -->
|
||||
<script src="{% static 'nosystemd/js/creative.min.js' %}"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue