-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1076 from xzzy/master2
Add Legal Name & Payment Information Page
- Loading branch information
Showing
11 changed files
with
191 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.29 on 2024-07-02 11:06 | ||
from __future__ import unicode_literals | ||
|
||
import django.core.files.storage | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('accounts', '0034_auto_20230506_0018'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='emailuser', | ||
name='legal_dob', | ||
field=models.DateField(blank=True, null=True, verbose_name='Legal date of birth'), | ||
), | ||
migrations.AddField( | ||
model_name='emailuser', | ||
name='legal_first_name', | ||
field=models.CharField(blank=True, max_length=128, null=True, verbose_name='Legal Given name(s)'), | ||
), | ||
migrations.AddField( | ||
model_name='emailuser', | ||
name='legal_last_name', | ||
field=models.CharField(blank=True, max_length=128, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.29 on 2024-07-02 14:25 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('payments', '0033_auto_20240228_1852'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='PaymentInformationLink', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=1000)), | ||
('textarea', models.TextField(blank=True, null=True)), | ||
('url', models.CharField(max_length=1000)), | ||
('active', models.BooleanField(default=True)), | ||
('created', models.DateTimeField(auto_now_add=True)), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.29 on 2024-07-02 14:29 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('payments', '0034_paymentinformationlink'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='paymentinformationlink', | ||
old_name='textarea', | ||
new_name='description', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{% extends "ledgergw/web/base_b5.html" %} | ||
{% block content %} | ||
|
||
|
||
|
||
<br> | ||
<h1>Payment Portal</h1> | ||
<br> | ||
<div class='col-sm-12'> | ||
Welcome to the payment portal for Department of Biodiversity, Conservation and Attractions. To access a payment service please choose from the options below. | ||
|
||
</div> | ||
<br> | ||
|
||
|
||
{% for pa in pil_array %} | ||
|
||
<div class="card mb-1" > | ||
<div class='row row-eq-height'> | ||
<div class='col-sm-12'> | ||
<div class="row g-0 row-eq-height"> | ||
|
||
<div class="col-sm-8"> | ||
<div class="card-body"> | ||
<h5 class="card-title">{{ pa.title }}</h5> | ||
<p class="card-text">{{ pa.description }}</p> | ||
</div> | ||
</div> | ||
<div class="col-sm-4 text-end "> | ||
<div class='col-sm-12 d-none d-sm-block'> | ||
<a class='mt-4 me-4 btn btn-primary btn-lg' href="{{ pa.url }}">OPEN <i class="bi bi-subtract"></i></a> | ||
</div> | ||
<div class='col-sm-12 d-sm-none d-md-none d-lg-none d-xl-none d-xl-none'> | ||
<div class="d-grid gap-2 p-1"> | ||
<a class="btn btn-primary" href="{{ pa.url }}">OPEN <i class="bi bi-subtract"></i></a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
|
||
|
||
|
||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from django.contrib.auth.mixins import LoginRequiredMixin | ||
from django.contrib.auth.models import Group | ||
from django.core.exceptions import ObjectDoesNotExist, ValidationError | ||
from django.http import HttpResponse, HttpResponseRedirect | ||
from django.views.generic import TemplateView, ListView, DetailView, CreateView, UpdateView, DeleteView, FormView, View | ||
from django.shortcuts import get_object_or_404 | ||
from django.core.cache import cache | ||
|
||
from ledger.payments import models | ||
import json | ||
|
||
class HomeView(TemplateView): | ||
template_name = 'ledger/home.html' | ||
|
||
def get_context_data(self, **kwargs): | ||
context = {} | ||
pil_array = [] | ||
|
||
pil_cache = cache.get('models.PaymentInformationLink.objects.filter(active=True)') | ||
|
||
if pil_cache is None: | ||
payment_information_links = models.PaymentInformationLink.objects.filter(active=True) | ||
for pil in payment_information_links: | ||
row = {} | ||
row['title'] = pil.title | ||
row['description'] = pil.description | ||
row['url'] = pil.url | ||
pil_array.append(row) | ||
cache.set('models.PaymentInformationLink.objects.filter(active=True)',json.dumps(pil_array), 86400) | ||
else: | ||
pil_array = json.loads(pil_cache) | ||
context['pil_array'] = pil_array | ||
return context |