dodati payment kodovi, generisanje kodova, pdf view,promena payment page

This commit is contained in:
2025-06-20 00:56:57 +02:00
parent 44bb4578b1
commit 65b58e3bb9
13 changed files with 221 additions and 36 deletions

View File

@@ -0,0 +1,11 @@
{% extends "admin/base_site.html" %}
{% block content %}
<div id="content-main">
<h2>Generate Payment Codes</h2>
<form method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" name="apply" value="Generate" class="default">
</form>
</div>
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "admin/change_list.html" %}
{% block object-tools %}
<div style="padding: 12px 0; display: flex; gap: 8px;">
<div style="padding: 12px 0;">
<a href="{% url 'admin:generate-codes' %}" class="button">Generate Payment Codes</a>
</div>
<div style="padding: 12px 0;">
<a href="{% url 'core:payment_codes_pdf' %}?filter_by=all" class="button">All (PDF)</a>
<a href="{% url 'core:payment_codes_pdf' %}?filter_by=used" class="button">Used (PDF)</a>
<a href="{% url 'core:payment_codes_pdf' %}?filter_by=available" class="button">Unused (PDF)</a>
</div>
</div>
{{ block.super }}
{% endblock %}

View File

@@ -5,11 +5,6 @@
<main class="flex-grow">
<section id="cyber-measures" class="bg-secondary">
<div class="text-center">
<a class="text-accent font-semibold tracking-wider uppercase text-sm" href="{% url 'core:no_confidential_data' %}">No confidential data</a>
</div>
</section>
<!-- WhitepaperSection -->
<section class="bg-gradient-to-br from-primary to-teal-700 text-light-text py-20 md:py-32 relative">

View File

@@ -1,19 +1,33 @@
{% extends 'base.html' %}
{% block content %}
<section class="py-16 bg-secondary sm:py-24 p-body-full">
<div class="max-w-lg w-full mx-auto text-center shadow-lg border border-success rounded-xl p-8 bg-white">
<h2 class="text-3xl font-extrabold mb-4 text-success">Payment</h2>
<p class="mb-8 text-gray-700 text-lg">
Click the button below to securely pay and access your document.
</p>
<form method="post">
<section class="py-24 bg-gradient-to-br from-teal-100 to-primary flex items-center justify-center">
<div class="max-w-md w-full mx-auto text-center shadow-2xl border border-accent rounded-2xl p-4 bg-white/90 backdrop-blur">
<h2 class="text-3xl font-extrabold mb-6 text-accent">Payment</h2>
<p class="text-lg text-gray-700 mb-6">Please enter your payment code to proceed to document.</p>
{% if success %}
<p class="text-green-600 font-semibold mb-4">{{ success }}</p>
{% endif %}
<form method="post" class="space-y-6">
{% csrf_token %}
<button type="submit" class="nav-link-desktop bg-transparent border-2 border-accent text-accent hover:bg-accent hover:text-primary font-semibold py-3 px-8 rounded-lg text-lg transition-all duration-300 ease-in-out">
Pay & Check Your document
<input
type="text"
name="code"
maxlength="10"
class="w-full px-4 py-3 border-2 border-accent rounded-lg focus:outline-none focus:ring-2 focus:ring-accent text-lg tracking-widest text-center font-mono mb-2"
placeholder="Enter your code"
required
>
<button
type="submit"
class="w-full bg-accent text-primary hover:bg-yellow-400 font-bold py-3 px-8 rounded-lg shadow-lg text-lg transition-all duration-200 ease-in-out transform hover:scale-105"
>
Enter Code
</button>
</form>
{% if error %}
<p class="text-red-600 mt-6 font-semibold text-lg">{{ error }}</p>
{% endif %}
</div>
</section>
{% endblock %}

View File

@@ -0,0 +1,39 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PDF payment report</title>
<link rel="stylesheet" href="{% static 'css/document.css' %}">
</head>
<body>
<h1>Payment Codes Report</h1>
<table>
<thead>
<tr>
<th>Code</th>
<th>Created At</th>
<th>Used</th>
<th>Company</th>
<th>Used At</th>
</tr>
</thead>
<tbody>
{% for code in codes %}
<tr>
<td>{{ code.code }}</td>
<td>{{ code.created_at }}</td>
<td>{{ code.used|yesno:"Yes,No" }}</td>
{% if code.company %}
<td>{{ code.company.name }}</td>
{% else %}
<td>-</td>
{% endif %}
<td>{{ code.used_at|default:"-" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>