Skip to content

Commit

Permalink
(feat): Using some feature of Django templates for inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
LopesLs committed Jan 3, 2024
1 parent 3d150a1 commit 9cc31bb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 50 deletions.
30 changes: 12 additions & 18 deletions scheduleManagement/templates/account/login.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
{% load socialaccount %}

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign In</title>
{% block title %} <title>Sign In</title> {% endblock %}
</head>
<body>
<title>Sign In</title>

<h1>Sign in</h1>

<p>Still don't have an account, then please <a href="{{ signup_url }}">sign up</a></p>

{% url 'account_login' as login_url %}

<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Login</button>
</form>

{% load socialaccount %}

<a href="{% provider_login_url 'google'%}">Login with google</a>
{% block content %}
<h1>Sign in</h1>

<p>Still don't have an account, then please <a href="{{ signup_url }}">sign up</a></p>

{% include "partials/form_component.html" with value="Login" %}

<a href="{% provider_login_url 'google'%}">Login with google</a>
{% endblock %}
</body>
</html>
23 changes: 8 additions & 15 deletions scheduleManagement/templates/account/logout.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Logout</title>
</head>
<body>
{% extends 'account/login.html' %}

{% block title %} <title>Logout</title> {% endblock %}

{% block content %}
<h1>Logout</h1>
<p>Are you sure that you want to logout of <strong>{{ user.username }}</strong></p>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button>Continue</button>
</form>
</body>
</html>

{% include "partials/form_component.html" with value="Continue" %}
{% endblock %}
2 changes: 1 addition & 1 deletion scheduleManagement/templates/confirm-delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ <h1>{{ object_type | capfirst }} | Delete</h1>

<p>Are you sure you want to delete <strong>{{ object }}?</strong></p>

{% include 'partials/form_component.html' with value="Yes, i'm sure" delete=true %}
{% include "partials/form_component.html" with value="Yes, i'm sure" delete=true %}
{% endblock %}
25 changes: 9 additions & 16 deletions scheduleManagement/templates/socialaccount/login.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign in via google</title>
</head>
<body>
{% extends 'account/login.html' %}

{% block title %} <title>Sign in via google</title> {% endblock %}

{% block content %}
<h1>Sign via google</h1>
<p>You area about to sign with a third-party environment</p>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button>Continue</button>
</form>
</body>
</html>
<p>You are about to sign with a third-party environment</p>

{% include "partials/form_component.html" with value="Continue" %}
{% endblock %}

0 comments on commit 9cc31bb

Please sign in to comment.