From 1fb67a6044b6de4762294debf312bc02a427d676 Mon Sep 17 00:00:00 2001 From: princekhunt Date: Tue, 9 Jul 2024 13:31:43 +0530 Subject: [PATCH] Improving code: following DRY practices --- .../registration/AnonymousDirectLogin.html | 37 +++---------- registration/templates/registration/Base.html | 41 ++++++++++++++ .../templates/registration/GenerateKeys.html | 38 +++---------- registration/templates/registration/Home.html | 41 ++++---------- .../templates/registration/Login.html | 53 +++---------------- .../templates/registration/Signup.html | 48 +++-------------- .../templates/registration/iframe_base.html | 43 ++++----------- 7 files changed, 87 insertions(+), 214 deletions(-) create mode 100644 registration/templates/registration/Base.html diff --git a/registration/templates/registration/AnonymousDirectLogin.html b/registration/templates/registration/AnonymousDirectLogin.html index 551ec38..433789f 100644 --- a/registration/templates/registration/AnonymousDirectLogin.html +++ b/registration/templates/registration/AnonymousDirectLogin.html @@ -1,34 +1,12 @@ -{%load static%} - - - - - - - - - +{% extends "registration/Base.html" %} +{% load static %} - - - - - - - - - - - - - - - - PrivatePing - Anonymous Direct Login +{% block content %} + +PrivatePing - Anonymous Direct Login -
{% csrf_token %}
@@ -39,11 +17,8 @@

Checking Browser...

{{ form.hcaptcha }}
-
- - - + {% endblock %} \ No newline at end of file diff --git a/registration/templates/registration/Base.html b/registration/templates/registration/Base.html new file mode 100644 index 0000000..7c478b6 --- /dev/null +++ b/registration/templates/registration/Base.html @@ -0,0 +1,41 @@ +{% load static %} + + + + + + + + + + + + + + + + + + + + + + + + + + + {% block content %}{% endblock %} + + + + + + + \ No newline at end of file diff --git a/registration/templates/registration/GenerateKeys.html b/registration/templates/registration/GenerateKeys.html index 70c7b90..8906a19 100644 --- a/registration/templates/registration/GenerateKeys.html +++ b/registration/templates/registration/GenerateKeys.html @@ -1,44 +1,18 @@ +{% extends "registration/Base.html" %} {% load static %} - - - - - - - - - - - - - - - - - - - - - - - - - - - PrivatePing - Securing Session +{% block content %} + +PrivatePing - Securing Session -

Generating Secure Keypair...

+
- - - - \ No newline at end of file +{% endblock %} \ No newline at end of file diff --git a/registration/templates/registration/Home.html b/registration/templates/registration/Home.html index b6ba306..2abc9b6 100644 --- a/registration/templates/registration/Home.html +++ b/registration/templates/registration/Home.html @@ -1,32 +1,11 @@ +{% extends "registration/Base.html" %} {% load static %} - - - - - - - - - +{% block content %} - - + - - - - - - - - - - - - - PrivatePing: A secure messaging Application +PrivatePing: A secure messaging Application @@ -49,9 +28,10 @@
An open source project, Initiated by Prince Khunt & - Viraj Bhingradiya. Checkout project on Github. + Viraj Bhingradiya. Give a + ⭐️ on Github. +
Checkout + Contributors!
@@ -70,7 +50,4 @@
An open source project, Initiated by "{% url 'registration:anonymous_direct_login' %}"; } - - - - \ No newline at end of file + {% endblock %} \ No newline at end of file diff --git a/registration/templates/registration/Login.html b/registration/templates/registration/Login.html index 7c2a242..e5f8533 100644 --- a/registration/templates/registration/Login.html +++ b/registration/templates/registration/Login.html @@ -1,47 +1,14 @@ +{% extends "registration/Base.html" %} {% load static %} - - - - - - - - - - - - - - - - - - - - - - - - - - - PrivatePing - Login - +{% block content %} + +PrivatePing - Login - -
- @@ -76,8 +43,7 @@

PrivatePing - Login

- Loading + Loading

{% csrf_token %}
@@ -105,13 +71,10 @@

Do you know?

{{fact}}
- +
- - - - - \ No newline at end of file + {% endblock %} \ No newline at end of file diff --git a/registration/templates/registration/Signup.html b/registration/templates/registration/Signup.html index 3255460..5107747 100644 --- a/registration/templates/registration/Signup.html +++ b/registration/templates/registration/Signup.html @@ -1,44 +1,14 @@ +{% extends "registration/Base.html" %} {% load static %} - - - - - - - - - - - - - - - - - - - - - - - - - - - PrivatePing - Signup +{% block content %} + +PrivatePing - Signup - -
- @@ -125,14 +95,10 @@

Do you know?

{{fact}}
- +
- - - - - - \ No newline at end of file + {% endblock %} \ No newline at end of file diff --git a/registration/templates/registration/iframe_base.html b/registration/templates/registration/iframe_base.html index 250492e..8fb803f 100644 --- a/registration/templates/registration/iframe_base.html +++ b/registration/templates/registration/iframe_base.html @@ -1,37 +1,14 @@ - +{% extends "registration/Base.html" %} {% load static %} - - - - - - - - - +{% block content %} + + PrivatePing: A secure messaging Application + - - - - + + + - - - - - - - - PrivatePing: A secure messaging Application - - - - - - - - \ No newline at end of file +{% endblock %} \ No newline at end of file