Created a base template for login / signup, Fixed some html design issues on login / signup pages, Added Billing Address Form to payment page, Handle Billing Address Form validation, Created VirtualMachinePlan model in order to store user purchased VM, Create method in order to create a stripe plan , Investigated about stripe payment workflows
This commit is contained in:
commit
5456c4c341
17 changed files with 573 additions and 415 deletions
|
|
@ -129,7 +129,6 @@
|
|||
<!-- Proccess payment lib -->
|
||||
<script type="text/javascript" src="{% static 'hosting/js/payment.js' %}"></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -17,67 +17,6 @@
|
|||
<div class="row text-center">
|
||||
|
||||
<div class="block">
|
||||
|
||||
{% for vm in vm_types %}
|
||||
<div class="row well pricing">
|
||||
<form class="form-inline p-green" role="form">
|
||||
<div class="btn-group col-md-3">
|
||||
<div class="form-group">
|
||||
|
||||
<big>
|
||||
{{vm.hosting_company_name}}
|
||||
</big>
|
||||
|
||||
<p>
|
||||
{{vm.description}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group col-md-2">
|
||||
<div class="form-group">
|
||||
<label for="cores">Cores:</label>
|
||||
<select class="form-control" id="cores">
|
||||
{% with ''|center:10 as range %}
|
||||
{% for _ in range %}
|
||||
<option>{{ forloop.counter }}</option>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group col-md-2">
|
||||
<label for="memory">Memory: </label>
|
||||
<div class="form-group">
|
||||
|
||||
<select class="form-control short-input" id="memory">
|
||||
{% with ''|center:50 as range %}
|
||||
{% for _ in range %}
|
||||
<option>{{ forloop.counter }}</option>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
</select>
|
||||
<span>GiB</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label for="Disk Size">Disk Size: </label>
|
||||
<input class="form-control short-input" type="number" id="disk_space" min="0" value="0"/>
|
||||
<span>GiB</span>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<h3>$199</h3>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<button type="submit" class="btn btn-default">Buy it</button>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <button type="submit" class="btn btn-default">Submit</button> -->
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% for vm in vm_types %}
|
||||
<div class="col-xs-12 col-sm-6 col-md-3">
|
||||
<form class="form-inline" method="POST" action="{{request.path}}">
|
||||
|
|
@ -128,7 +67,7 @@
|
|||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<input id="{{vm.hosting_company}}-final-price" type="hidden" name="final_price" value="{{vm.default_price|floatformat}}">
|
||||
<input id="{{vm.hosting_company}}-final-price-input" type="hidden" name="final_price" value="{{vm.default_price|floatformat}}">
|
||||
<h3 id="{{vm.hosting_company}}-final-price">{{vm.default_price|floatformat}}CHF</h3>
|
||||
<span>per month</span>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1,148 +1,33 @@
|
|||
{% extends "hosting/base_short.html" %}
|
||||
{% load staticfiles bootstrap3%}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
{% block content %}
|
||||
|
||||
<head>
|
||||
<div class="intro-auth intro-login">
|
||||
<div class="container">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="intro-message">
|
||||
<h2 class="section-heading">Login</h2>
|
||||
<form action="{% url 'hosting:login' %}" method="post" class="form" novalidate>
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
{% bootstrap_field field show_label=False type='fields'%}
|
||||
{% endfor %}
|
||||
{% bootstrap_form_errors form type='non_fields'%}
|
||||
{% buttons %}
|
||||
<button type="submit" class="btn btn-default">
|
||||
Login
|
||||
</button>
|
||||
{% endbuttons %}
|
||||
</form>
|
||||
<span>Doesn't have an account ? <a class="unlink" href="{% url 'hosting:signup' %}">Sign up</a></span>
|
||||
|
||||
<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>Rails Hosting.ch - Ruby on Rails as easy as possible</title>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'hosting/css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="{% static 'hosting/css/landing-page.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
|
||||
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
|
||||
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<!-- Navigation -->
|
||||
<nav class="navbar navbar-default topnav" role="navigation">
|
||||
<div class="container topnav">
|
||||
<!-- Brand and toggle get grouped for better mobile display -->
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand topnav" href="#"><img src="img/logo_black.svg"></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 href="#how">How it works</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#your">Your infrastructure</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#our">Our inftrastructure</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#price">Pricing</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#contact">Contact</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.navbar-collapse -->
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
</nav>
|
||||
|
||||
|
||||
<!-- Header -->
|
||||
<a name="about"></a>
|
||||
<div class="intro-header">
|
||||
<div class="container">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="intro-message">
|
||||
<h2>Login</h2>
|
||||
<form action="{% url 'hosting:login' %}" method="post" class="form" novalidate>
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
{% bootstrap_field field show_label=False type='fields'%}
|
||||
{% endfor %}
|
||||
{% bootstrap_form_errors form type='non_fields'%}
|
||||
{% buttons %}
|
||||
<button type="submit" class="btn btn-default">
|
||||
Login
|
||||
</button>
|
||||
{% endbuttons %}
|
||||
</form>
|
||||
<ul class="list-inline intro-social-buttons">
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
|
||||
</div>
|
||||
<!-- /.intro-header -->
|
||||
|
||||
<!-- Footer -->
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<ul class="list-inline">
|
||||
<li>
|
||||
<a href="#">Home</a>
|
||||
</li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<li>
|
||||
<a href="#about">How it works</a></li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<li>
|
||||
<a href="#about">Your infrastructure</a></li>
|
||||
<li>⋅</li>
|
||||
<li>
|
||||
<a href="#about">Our infrastructure</a></li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<li>
|
||||
<a href="#services">Pricing</a>
|
||||
</li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<li>
|
||||
<a href="#contact">Contact</a>
|
||||
</li>
|
||||
<ul class="list-inline intro-social-buttons">
|
||||
|
||||
</ul>
|
||||
<p class="copyright text-muted small">Copyright © ungleich GmbH {% now "Y" %}. All Rights Reserved</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="js/jquery.js"></script>
|
||||
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,26 @@
|
|||
{%block content %}
|
||||
<!-- Credit card form -->
|
||||
<div>
|
||||
<div class="container">
|
||||
<div class="container payment-container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4 col-md-offset-2 billing">
|
||||
<h3><b>Billing Address</b></h3>
|
||||
<hr>
|
||||
<form role="form" id="billing-form" method="post" action="{% url 'hosting:payment' %}" novalidate>
|
||||
{% for field in form %}
|
||||
{% csrf_token %}
|
||||
{% bootstrap_field field show_label=False type='fields'%}
|
||||
{% endfor %}
|
||||
{% bootstrap_form_errors form type='non_fields'%}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4 col-md-offset-2 creditcard-box">
|
||||
<h3><b>Payment Details</b></h3>
|
||||
<hr>
|
||||
<div>
|
||||
<div class="panel-body">
|
||||
<div>
|
||||
<form role="form" id="payment-form" novalidate>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
@ -68,7 +81,7 @@
|
|||
<hr>
|
||||
<p><b>Memory</b> <span class="pull-right">{{request.session.vm_specs.memory}} GiB</span></p>
|
||||
<hr>
|
||||
<p><b>Disk space</b> <span class="pull-right">{{request.session.vm_specs.memory}} GiB</span></p>
|
||||
<p><b>Disk space</b> <span class="pull-right">{{request.session.vm_specs.disk_size}} GiB</span></p>
|
||||
<hr>
|
||||
<h4>Total<p class="pull-right"><b>{{request.session.vm_specs.final_price}} CHF</b></p></h4>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<li><i class="fa-li fa fa-check-square-o fa-lg"></i>
|
||||
<p class="lead">Ubuntu 14.04 as the operating system, full root access!</p>
|
||||
</li>
|
||||
<li><i class="fa-li fa fa-check-square-o fa-lg"></i><p class="lead">rbenv to let you decide which Ruby version you want to use</p></li>s
|
||||
<li><i class="fa-li fa fa-check-square-o fa-lg"></i><p class="lead">rbenv to let you decide which Ruby version you want to use</p></li>
|
||||
<li><i class="fa-li fa fa-check-square-o fa-lg"></i><p class="lead">nginx as the frontend Server (optional with SSL Support)</p></li>
|
||||
<li><i class="fa-li fa fa-check-square-o fa-lg"></i><p class="lead">uwsgi to have your application talk to nginx and vice versa
|
||||
<li><i class="fa-li fa fa-check-square-o fa-lg"></i><p class="lead">PostgreSQL as the database</p>
|
||||
|
|
|
|||
|
|
@ -1,149 +1,29 @@
|
|||
{% extends "hosting/base_short.html" %}
|
||||
{% load staticfiles 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>Signup</title>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'hosting/css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="{% static 'hosting/css/landing-page.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
|
||||
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
|
||||
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<!-- Navigation -->
|
||||
<nav class="navbar navbar-default navbar-fixed-top topnav" role="navigation">
|
||||
<div class="container topnav">
|
||||
<!-- Brand and toggle get grouped for better mobile display -->
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand topnav" href="#"><img src="{% static 'hosting/img/logo_black.svg' %}"></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 href="#how">How it works</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#your">Your infrastructure</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#our">Our inftrastructure</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#price">Pricing</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#contact">Contact</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.navbar-collapse -->
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
</nav>
|
||||
|
||||
|
||||
<!-- Header -->
|
||||
<a name="about"></a>
|
||||
<div class="intro-header-2">
|
||||
{% block content %}
|
||||
<div class="intro-auth intro-signup">
|
||||
<div class="container">
|
||||
<div class="col-md-4"> </div><div class="col-md-4">
|
||||
<div class="intro-message">
|
||||
<h2>Sign up</h2>
|
||||
<form action="{% url 'hosting:signup' %}" method="post" class="form" novalidate>
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
{% bootstrap_field field show_label=False %}
|
||||
{% endfor %}
|
||||
{% buttons %}
|
||||
<button type="submit" class="btn btn-default">
|
||||
Signup
|
||||
</button>
|
||||
{% endbuttons %}
|
||||
</form>
|
||||
<ul class="list-inline intro-social-buttons">
|
||||
|
||||
</ul>
|
||||
<div class="col-md-4"> </div>
|
||||
<div class="col-md-4">
|
||||
<div class="intro-message">
|
||||
<h2 class="section-heading">Sign up</h2>
|
||||
|
||||
<form action="{% url 'hosting:signup' %}" method="post" class="form" novalidate>
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
{% bootstrap_field field show_label=False %}
|
||||
{% endfor %}
|
||||
{% buttons %}
|
||||
<button type="submit" class="btn btn-default">
|
||||
Sign up
|
||||
</button>
|
||||
{% endbuttons %}
|
||||
</form>
|
||||
<span>Already have an account ? <a class="unlink" href="{% url 'hosting:login' %}">Log in</a></span>
|
||||
<ul class="list-inline intro-social-buttons">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.container -->
|
||||
|
||||
</div>
|
||||
<!-- /.intro-header -->
|
||||
|
||||
<!-- Footer -->
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<ul class="list-inline">
|
||||
<li>
|
||||
<a href="#">Home</a>
|
||||
</li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<li>
|
||||
<a href="#about">How it works</a></li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<li>
|
||||
<a href="#about">Your infrastructure</a></li>
|
||||
<li>⋅</li>
|
||||
<li>
|
||||
<a href="#about">Our infrastructure</a></li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<li>
|
||||
<a href="#services">Pricing</a>
|
||||
</li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<li>
|
||||
<a href="#contact">Contact</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="copyright text-muted small">Copyright © ungleich GmbH {% now "Y" %}. All Rights Reserved</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="js/jquery.js"></script>
|
||||
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue