[bootstrap] update to bootstrap5

This commit is contained in:
Nico Schottelius 2021-02-13 18:50:28 +01:00
parent c8ce7dbb40
commit 49f52fd41d
5 changed files with 176 additions and 169 deletions

View file

@ -2,7 +2,7 @@
django
djangorestframework
django-auth-ldap
django-bootstrap4
django-bootstrap-v5
psycopg2
ldap3

View file

@ -51,7 +51,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
'django_extensions',
'rest_framework',
'bootstrap4',
'bootstrap5',
'uncloud',
'uncloud_pay',
'uncloud_auth',

View file

@ -1,51 +1,27 @@
{% extends 'bootstrap4/bootstrap4.html' %}
{% extends 'bootstrap5/bootstrap5.html' %}
{% block bootstrap5_before_content %}
{% load bootstrap4 %}
<nav class="navbar sticky-top navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="{% url 'uncloudindex' %}">uncloud</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% block bootstrap4_title %}{% block title %}Welcome to uncloud{% endblock %}{% endblock %}
{% block header %}{% endblock %}
</head>
<body>
{% block bootstrap4_content %}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="{% url 'uncloudindex' %}">uncloud</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<!-- <li class="nav-item"> -->
<!-- <a class="nav-link" href="/random/">Generate random prefix</a> -->
<!-- </li> -->
{% if user.is_authenticated %}
<span class="navbar-text">Logged in as {{ user }}.</span>
<li class="nav-item">
<a class="nav-link" href="{% url 'logout' %}">Logout</a>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{% url 'login' %}">Login</a>
</li>
{% endif %}
</ul>
</div>
</nav>
<div class="container">
{% block body %}{% endblock %}
</div>
{% autoescape off %}{% bootstrap_messages %}{% endautoescape %}
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
{% if user.is_authenticated %}
<span class="navbar-text">Logged in as {{ user }}.</span>
<li class="nav-item">
<a class="nav-link" href="{% url 'logout' %}">Logout</a>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{% url 'login' %}">Login</a>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>
{% endblock %}
</body>
</html>

View file

@ -1,119 +1,148 @@
{% extends 'uncloud/base.html' %}
{% block title %}{% endblock %}
{% block title %}Welcome to uncloud [beta]{% endblock %}
{% block body %}
<div id="content">
<div id="intro" class="row">
<div class=col>
<h1>Welcome to uncloud</h1>
{% block bootstrap5_content %}
<div class="container">
<div id="content">
<div id="intro" class="row">
<div class=col>
<h1>Welcome to uncloud [beta]</h1>
</div>
</div>
</div>
<div id="intro" class="row">
<div class="col"><h3>About uncloud</h3></div>
<div class="col-8">
<p>
Welcome to uncloud, the Open Source cloud management
system by <a href="https://ungleich.ch">ungleich</a>.
It is an <a href="{% url 'api-root' %}">API</a> driven system with
some convience views provided by
the <a href="https://www.django-rest-framework.org/">Django Rest
Framework</a>. You can
freely <a href="https://code.ungleich.ch/uncloud/uncloud/">access
the source code of uncloud</a>.
</p>
<div id="about" class="row">
<div class="col"><h3>About uncloud</h3></div>
<div class="col-8">
<p>
Welcome to uncloud, the Open Source cloud management
system by <a href="https://ungleich.ch">ungleich</a>.
It is an <a href="{% url 'api-root' %}">API</a> driven system with
some convience views provided by
the <a href="https://www.django-rest-framework.org/">Django Rest
Framework</a>. You can
freely <a href="https://code.ungleich.ch/uncloud/uncloud/">access
the source code of uncloud</a>.
<strong>This is a BETA service.</strong> As such, some
functionality might not be very sophisticated.
</p>
</div>
</div>
</div>
<div id="howto" class="row">
<div class="col"><h3>Getting started</h3></div>
<div class="col-8">
<p>uncloud is designed to be as easy as possible to use. However,
there are some "real world" requirements that need to be met to
start using uncloud:
<div id="howto" class="row">
<div class="col"><h3>Getting started</h3></div>
<div class="col-8">
<p>uncloud is designed to be as easy as possible to use. However,
there are some "real world" requirements that need to be met to
start using uncloud:
<ul>
<li>First you need
to <a href="https://account.ungleich.ch">register an
account</a>. If you already have one, you can
<a href="{% url 'login' %}">login</a>.
<li>If you have forgotten your password or other issues with
logging in, you can contact the ungleich support
via <strong>support at ungleich.ch</strong>.
<ul>
<li>First you need
to <a href="https://account.ungleich.ch">register an
account</a>. If you already have one, you can
<a href="{% url 'login' %}">login</a>.
<li>If you have forgotten your password or other issues with
logging in, you can contact the ungleich support
via <strong>support at ungleich.ch</strong>.
<li>Secondy you will need to
<a href="{% url 'billingaddress-list' %}">create a billing
address</a>. This is required for determining the correct
tax.
<li>Next you will need to
<a href="{% url 'cc_register' %}">register a credit card</a>
from which payments can be made. Your credit card will not
be charged without your consent.
</ul>
<li>Secondy you will need to
<a href="{% url 'billingaddress-list' %}">create a billing
address</a>. This is required for determining the correct
tax.
<li>Next you will need to
<a href="{% url 'cc_register' %}">register a credit card</a>
from which payments can be made. Your credit card will not
be charged without your consent.
</ul>
</div>
</div>
</div>
<div id="creditcards" class="row">
<div class="col"><h3>Credit cards</h3></div>
<div class="col-8">
<p>
Credit cards are registered with stripe. We only save a the
last 4 digits and the expiry date of the card to make
identification for you easier.
</p>
<ul>
<li><a href="{% url 'cc_register' %}">Register a credit card</a>
(this is required to be done via Javascript so that we never see
your credit card, but it is sent directly to stripe)
<li><a href="{% url 'stripecreditcard-list' %}">You can list your
credit cards</a>
By default the first credit card is used for charging
("active: true") and later added cards will not be
used. To change this, first disable the active flag and
then set it on another credit card.
<div id="howto" class="row">
<div class="col"><h3>Introduction to uncloud concepts</h3></div>
<div class="col-8">
<p>We plan to offer many services on uncloud ranging from
for free, for a small amount or regular charges. As transfer
fees are a major challenge for our business, we based uncloud
on the <strong>pre-paid account model</strong>. Which means
that you can charge your account and then use your balance to
pay for product usage.</p>
</div>
</div>
</div>
<div id="pay" class="row">
<div class="col"><h3>Billing Address, Payments and Balance</h3></div>
<div class="col-8">
<p>Billing addresses behave similar to credit cards: you can
have many of them, but only one can be active. The active
billing address is taken for creating new orders.</p>
<p>In uncloud we use the pre-paid model: you can add money to
your account via payments. You can always check your
balance. The products you use will automatically be charged from
your existing balance.
</p>
<p>In the future you will be able opt-in to automatically
recharging your account at a certain time frame or whenever it
is below a certain amount</p>
<ul>
<li><a href="{% url 'billingaddress-list' %}">Create or list
your billing addresses</a>
<li><a href="{% url 'payment-list' %}">Make a payment or list your payments</a>
<li><a href="{% url 'payment-balance-list' %}">Show your balance</a>
</ul>
<div id="creditcards" class="row">
<div class="col"><h3>Credit cards</h3></div>
<div class="col-8">
<p>
Credit cards are registered with stripe. We only save a the
last 4 digits and the expiry date of the card to make
identification for you easier.
</p>
<ul>
<li><a href="{% url 'cc_register' %}">Register a credit card</a>
(this is required to be done via Javascript so that we never see
your credit card, but it is sent directly to stripe)
<li><a href="{% url 'stripecreditcard-list' %}">You can list your
credit cards</a>
By default the first credit card is used for charging
("active: true") and later added cards will not be
used. To change this, first disable the active flag and
then set it on another credit card.
</div>
</div>
</div>
<div id="pay" class="row">
<div class="col"><h3>Billing Address, Payments and Balance</h3></div>
<div class="col-8">
<p>Billing addresses behave similar to credit cards: you can
have many of them, but only one can be active. The active
billing address is taken for creating new orders.</p>
<div id="net" class="row">
<div class="col"><h3>Networking</h3></div>
<div class="col-8">
<p>
With uncloud you can use a variety of network related
services.
</p>
<p>In uncloud we use the pre-paid model: you can add money to
your account via payments. You can always check your
balance. The products you use will automatically be charged from
your existing balance.
</p>
<ul>
<li>You can <a href="{% url 'wireguardvpnnetwork-list' %}">list or
create VPNs</a> based on wireguard
<li>You can also <a href="{% url 'wireguardvpnnetworksizes-list'
%}">list which network sizes are available</a>
</ul>
<p>In the future you will be able opt-in to automatically
recharging your account at a certain time frame or whenever it
is below a certain amount</p>
<ul>
<li><a href="{% url 'billingaddress-list' %}">Create or list
your billing addresses</a>
<li><a href="{% url 'payment-list' %}">Make a payment or list your payments</a>
<li><a href="{% url 'payment-balance-list' %}">Show your balance</a>
</ul>
</div>
</div>
<div id="net" class="row">
<div class="col"><h3>Networking</h3></div>
<div class="col-8">
<p>
With uncloud you can use a variety of network related
services.
</p>
<ul>
<li>You can <a href="{% url 'wireguardvpnnetwork-list' %}">list or
create VPNs</a> based on wireguard
<ul>
<li>Checkout
<a href="{% url 'wireguardvpnnetworksizes-list' %}">which
network sizes are available</a> at the moment.
</ul>
</ul>
</div>
</div>
<div id="net" class="row">
<div class="col"><h3>Current limitations</h3></div>
<div class="col-8">
<ul>
<li>Payments are only possible in CHF.
<li>Bills are not yet visible (payments are, though)
</ul>
</div>
</div>
</div>
</div>
{% endblock %}

View file

@ -1,28 +1,30 @@
{% extends 'uncloud/base.html' %}
{% block header %}
{% block bootstrap5_extra_head %}
<script src="https://js.stripe.com/v3/"></script>
{% endblock %}
{% block body %}
<div id="content">
<h1>Register Credit Card with Stripe</h1>
<p>
By submitting I authorise to send instructions to
the financial institution that issued my card to take
payments from my card account in accordance with the
{% block bootstrap5_content %}
<div class="container">
<div id="content">
<h1>Register Credit Card with Stripe</h1>
<p>
By submitting I authorise to send instructions to
the financial institution that issued my card to take
payments from my card account in accordance with the
terms of my agreement with you.
</p>
</p>
<span id="message"></span>
<div id="card-element"></div>
<button type='button' id="card-button">Save</button>
<div id="ungleichmessage">The card will be registered with stripe.</div>
<span id="message"></span>
<div id="card-element"></div>
<button type='button' id="card-button">Save</button>
<div id="ungleichmessage">The card will be registered with stripe.</div>
<div id="goback" style="display: none;">
<a href="{% url 'uncloudindex' %}">Go back to main page</a>
<div id="goback" style="display: none;">
<a href="{% url 'uncloudindex' %}">Go back to main page</a>
</div>
</div>
</div>
<!-- Enable Stripe from UI elements - standard code -->