Create page templates
This commit is contained in:
parent
fe3a900215
commit
9493c13a1f
|
@ -0,0 +1,60 @@
|
|||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Pathogen - Login</title>
|
||||
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
|
||||
<link rel="stylesheet" href="{% static 'style.css' %}" />
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section class="hero is-primary is-fullheight">
|
||||
|
||||
<div class="hero-head">
|
||||
<nav class="navbar navbar-default navbar-static-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="{% url 'home' %}">Pathogen</a>
|
||||
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<sapn class="icon-bar"></sapn>
|
||||
</button>
|
||||
</div>
|
||||
<ul class="nav navbar-nav navbar-right collapse navbar-collapse">
|
||||
{% if user.is_authenticated %}
|
||||
<li><a href="{% url 'profile' %}">Profile</a></li>
|
||||
{% endif %}
|
||||
{% if user.plan == "drilldown" and user.paid %}
|
||||
<li><a href="{% url 'drilldown' %}">Drilldown</a></li>
|
||||
{% endif %}
|
||||
{% if not user.is_authenticated %}
|
||||
<li><a href="{% url 'login' %}">Login</a></li>
|
||||
<li><a href="{% url 'signup' %}">Sign Up</a></li>
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
<li><a href="{% url 'logout' %}">Logout</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,9 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<section>
|
||||
<p>Forgot to add something to your cart? Shop around then come back to pay!</p>
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
|
@ -0,0 +1,60 @@
|
|||
<head>
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
</head>
|
||||
<div class="product-container">
|
||||
<a href="order?product=drilldown">
|
||||
<div class="product">
|
||||
<img
|
||||
src="{{ url_for('static', filename='weekly.jpg') }}"
|
||||
alt="Data image"
|
||||
/>
|
||||
<div class="description">
|
||||
<h3>Drilldown</h3>
|
||||
<h5>200.00</h5>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="order?product=sentiment">
|
||||
<div class="product">
|
||||
<img
|
||||
src="{{ url_for('static', filename='weekly.jpg') }}"
|
||||
alt="Data image"
|
||||
/>
|
||||
<div class="description">
|
||||
<h3>Sentiment</h3>
|
||||
<h5>45.00</h5>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Create an instance of the Stripe object with your publishable API key
|
||||
var stripe = Stripe("pk_test_51HbqYzAKLUD9ELc0KSyiQ9YohsfiUCeBpAfpflAIg2Uu2RFecx3sfWYXzM1xDtI5XlQihqHMnaPKd45JzDuqXdGP00pYWvRvRe");
|
||||
var setupButton = document.getElementById('setup-button');
|
||||
setupButton.addEventListener("click", function () {
|
||||
fetch("/setup-bacs", {
|
||||
method: "POST",
|
||||
})
|
||||
.then(function (response) {
|
||||
return response.json();
|
||||
})
|
||||
.then(function (session) {
|
||||
return stripe.redirectToCheckout({ sessionId: session.id });
|
||||
})
|
||||
.then(function (result) {
|
||||
// If redirectToCheckout fails due to a browser or network
|
||||
// error, you should display the localized error message to your
|
||||
// customer using error.message.
|
||||
if (result.error) {
|
||||
alert(result.error.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error("Error:", error);
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,34 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1 class="title">
|
||||
Welcome to search, {{ name }}!
|
||||
</h1>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="profile-info">
|
||||
<p>PROFILE INFO</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="update-info">
|
||||
{% if user.seti %}
|
||||
{% if user.plan == None %}
|
||||
{% include 'checkout.html' %}
|
||||
{% else %}
|
||||
<form>
|
||||
<button id="button" formaction="/portal">Customer portal</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<button id="setup-button">Setup payment mandate</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="title">
|
||||
Pathogen Products Panel
|
||||
</h1>
|
||||
<h2 class="subtitle">
|
||||
Billing and subscription management
|
||||
</h2>
|
||||
<div class="col">
|
||||
{% if user.subscription_active %}
|
||||
{% include 'checkout.html' %}
|
||||
{% else %}
|
||||
<h2> Please setup a payment mandate in the profile page to view products </h2>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -0,0 +1,67 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1 class="title">
|
||||
Welcome, {{ user.first_name }}!
|
||||
</h1>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="profile-info">
|
||||
<p>Plan: {{ user.plan }}</p>
|
||||
<p>Stripe ID: {{ user.stripeID }}</p>
|
||||
<p>Setup intent: {{ user.seti }}</p>
|
||||
<p>Mandate active: {{ user.mandateActive }}</p>
|
||||
<p>Subscription ID: {{ user.subscriptionID }}</p>
|
||||
<p>Last payment: {{ user.lastPayment }}</p>
|
||||
<p>Creation date: {{ user.creationDate }}</p>
|
||||
<p>Paid: {{ user.paid }}</p>
|
||||
</div>
|
||||
|
||||
<div class="update-info">
|
||||
{% if user.seti %}
|
||||
{% if user.plan == None %}
|
||||
{% include 'checkout.html' %}
|
||||
{% else %}
|
||||
<form>
|
||||
<button id="button" formaction="/portal">Customer portal</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<button id="setup-button">Setup payment mandate</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Create an instance of the Stripe object with your publishable API key
|
||||
var stripe = Stripe("pk_test_51HbqYzAKLUD9ELc0KSyiQ9YohsfiUCeBpAfpflAIg2Uu2RFecx3sfWYXzM1xDtI5XlQihqHMnaPKd45JzDuqXdGP00pYWvRvRe");
|
||||
var setupButton = document.getElementById('setup-button');
|
||||
setupButton.addEventListener("click", function () {
|
||||
fetch("/setup-bacs", {
|
||||
method: "POST",
|
||||
})
|
||||
.then(function (response) {
|
||||
return response.json();
|
||||
})
|
||||
.then(function (session) {
|
||||
return stripe.redirectToCheckout({ sessionId: session.id });
|
||||
})
|
||||
.then(function (result) {
|
||||
// If redirectToCheckout fails due to a browser or network
|
||||
// error, you should display the localized error message to your
|
||||
// customer using error.message.
|
||||
if (result.error) {
|
||||
alert(result.error.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.error("Error:", error);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row vertical-offset-100">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Please sign in</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<img class="logo" src="{% static 'logo.svg' %}">
|
||||
<form method="POST">
|
||||
<fieldset>
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
|
||||
<input class="btn btn-lg btn-dark btn-block" type="submit" value="Login">
|
||||
<div class="register">
|
||||
<p>Don't have an account? <a href="{% url 'signup' %}">Register here</a></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -0,0 +1,27 @@
|
|||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row vertical-offset-100">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Sign up</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<img class="logo" src="{% static 'logo.svg' %}">
|
||||
<form method="POST">
|
||||
<fieldset>
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input class="btn btn-lg btn-dark btn-block" type="submit" value="Sign up">
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -0,0 +1,12 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<head>
|
||||
<title>Thanks for your order!</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<section>
|
||||
<p>We appreciate your business!</p>
|
||||
<p>Download details will be available <a href="{{ url_for('main.profile') }} ">in your profile</a> shortly.</p>
|
||||
</section>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue