home

parent 5b85f6d2
......@@ -10,8 +10,7 @@
<a class="navbar-brand" href="{% url 'index' %}">
<img width="30" height="30" src="{% static "heart.png" %}" alt="icon"> PyPrevention </a>
<center>
<a class="btn btn-dark" type="button" href="">Link 1</a>
<a class="btn btn-dark" type="button" href="">Link 2</a>
<a class="btn btn-dark" type="button" href="{% url 'dashboard' %}">Dashboard</a>
</center>
{% if user.is_authenticated %}
<div class="dropdown show">
......
{% extends "base.html" %}
{% block content %}
DASHBOARD !!
{% endblock %}
......@@ -2,65 +2,51 @@
{% block content %}
{% load static %}
<div class="container-fluid">
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-4">Bonjour Monsieur {{user.username}},</h1>
<p class="lead">Bienvenue sur votre espace.</p>
</div>
</div>
<div class="row">
<div class="col">
<a href="https://www.w3schools.com">
<div class="card mx-auto" style="width: 18rem; height:10rem;">
<img class="card-img-top" src="https://www.cadredesante.com/spip/local/cache-vignettes/L379xH251/hopital-dessin-g-7f972.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Mes patients</h5>
</div>
</div>
</a>
<div class="container">
<div class="jumbotron mt-3">
<h1 class="display-4">Dear {{user.username}},</h1>
<p class="lead">Welcome to your workspace.</p>
</div>
<div class="col">
<a href="https://www.w3schools.com">
<div class="card mx-auto" style="width: 18rem; height:10rem;">
<img class="card-img-top" src="https://www.cadredesante.com/spip/local/cache-vignettes/L379xH251/hopital-dessin-g-7f972.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Mes patients</h5>
<div class="row mb-5">
<div class="col-sm-4">
<a href="{% url 'doctors' %}">
<div class="card mx-auto">
<img class="card-img-top" src="{% static "doctor.png" %}" alt="doctors">
<div class="card-body mx-auto">
<a href="{% url 'doctors' %}" class="btn btn-success">Doctors</a>
</div>
</div>
</div>
</a>
</div>
<div class="col">
<a href="https://www.w3schools.com">
<div class="card mx-auto" style="width: 18rem; height:10rem;">
<img class="card-img-top" src="https://www.cadredesante.com/spip/local/cache-vignettes/L379xH251/hopital-dessin-g-7f972.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Mes patients</h5>
</a>
</div>
<div class="col-sm-4">
<a href="{% url 'patients' %}">
<div class="card mx-auto">
<img class="card-img-top" src="{% static "patient.png" %}" alt="patients">
<div class="card-body mx-auto">
<a href="{% url 'patients' %}" class="btn btn-success">Patients</a>
</div>
</div>
</div>
</a>
</div>
<div class="col">
<a href="https://www.w3schools.com">
<div class="card mx-auto" style="width: 18rem; height:10rem;">
<img class="card-img-top" src="https://www.cadredesante.com/spip/local/cache-vignettes/L379xH251/hopital-dessin-g-7f972.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Mes patients</h5>
</a>
</div>
<div class="col-sm-4">
<a href="{% url 'dashboard' %}">
<div class="card mx-auto">
<img class="card-img-top" src="{% static "dashboard.png" %}" alt="dashboard">
<div class="card-body mx-auto">
<a href="{% url 'dashboard' %}" class="btn btn-success">My Dashboard</a>
</div>
</div>
</div>
</a>
</div>
</div>
</a>
</div>
</div>
<!--div>Icons made by <a href="https://www.flaticon.com/authors/popcorns-arts" title="Icon Pond">Icon Pond</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div-->
{% endblock %}
{% extends 'base.html' %}
{% block content %}
<div class="container">
{% load static %}
<div class="row mt-5">
{% for patient in patients %}
<div class="col">
<div class="card" style="width: 18rem;">
<img class="card-img-top" src="{% static "patient.jpg" %}" alt="patient">
<div class="card-body mx-auto">
<h5 class="card-title">{{patient.first_name}} {{patient.last_name}}</h5>
<p class="card-text">date_of_birth : {{patient.date_of_birth}}</p>
<p class="card-text">Doctor : {{patient.doctor}}</p>
<a href="#" class="btn btn-primary">fdp</a>
</div>
</div>
</div>
{% if forloop.counter|divisibleby:"4" or forloop.last %}
</div> <!--end row-->
{% endif %}
{% endfor %}
</div>
{% endblock %}
......@@ -13,5 +13,7 @@ urlpatterns = [
path('patient/new', views.patient_new, name='patient_new'),
path('doctor/new', views.doctor_new, name='doctor_new'),
path('doctors', views.doctors, name='doctors'),
path('patients', views.patients, name='patients'),
path('dashboard', views.dashboard, name='dashboard'),
]
......@@ -49,6 +49,16 @@ def login(request):
def home(request):
return render(request, 'home.html')
@login_required
def doctors(request):
doctors = Doctor.objects.all()
return render(request, 'doctors.html', {"doctors" : doctors})
@login_required
def patients(request):
patients = Patient.objects.all()
return render(request, 'patients.html', {"patients" : patients})
@login_required
def dashboard(request):
return render(request, 'dashboard.html')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment