Skip to content

Commit

Permalink
Merge pull request #14 from Dv04/Madhur
Browse files Browse the repository at this point in the history
basic frontend complete
  • Loading branch information
MysteryManav authored Aug 25, 2023
2 parents d3c1de9 + 379af4d commit 27179bb
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 46 deletions.
20 changes: 15 additions & 5 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
app.app_context().push()
app.secret_key = "secret-tunnel"

user = []

@app.route('/')
def home_page():
return render_template('index.html')
return render_template('index.html', user=user)

@app.route('/about')
def about_page():
return render_template('about.html')

@app.route('/login')
def login_page():
Expand All @@ -20,19 +26,23 @@ def register_page():

@app.route('/staff')
def staff_page():
return render_template('staff.html')
return render_template('staff.html', user=user)

@app.route('/reception')
def hospital_page():
return render_template('reception.html')
return render_template('reception.html', user=user)

@app.route('/doctor')
def doctor_page():
return render_template('doctor.html')
return render_template('doctor.html', user=user)

@app.route('/patient')
def patient_page():
return render_template('patient.html')
return render_template('patient.html', user=user)

@app.route('/pharmacy')
def pharmacy_page():
return render_template('pharmacy.html', user=user)

@app.route('/not_found')
@app.errorhandler(404)
Expand Down
Empty file added templates/about.html
Empty file.
54 changes: 50 additions & 4 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,63 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mx-auto ">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="/">Home</a>
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="/facilities">Hospitals</a>
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Hospitals</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="/about">About Us</a>
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">About Us</a>
</li>
{% if user.role == "reception" %}
<li class="nav-item">
<a class="nav-link" href="/programmes">Programmes</a>
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">New Patient</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Existing Patient</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Appointments</a>
</li>
{% endif %}
{% if user.role == "doctor" %}
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">AI-ML</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Speech-To-Text</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Text Scanner</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Form</a>
</li>
{% endif %}
{% if user.role == "staff" %}
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Employee</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Equipment</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Operation Theatre</a>
</li>
{% endif %}
{% if user.role == "patient" %}
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">History</a>
</li>
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Appointment Booking</a>
</li>
{% endif %}
{% if user.login %}
<li class="nav-item">
<a class="nav-link" aria-current="page" href="{{ url_for('home_page') }}">Log Out</a>
</li>
{% endif %}
</ul>
<form class="d-flex mx-auto">
<a class="btn btn-primary ms-5 me-2 rounded-pill fw-bold" type="submit" href="/courses">Log in</a>
Expand Down
35 changes: 23 additions & 12 deletions templates/doctor.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
{% extends 'base.html' %} {% block title %}Doctor{% endblock title %} {% block
body %}
<div class="container">
<div class="card" style="width: 18rem">
<div class="card-body">
<img src="..." class="card-img-top" alt="..." />
<h5 class="card-title">Card title</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk
of the card's content.
</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
<div id="predictive-model">
<div class="container">
<div class="card" style="width: 18rem">
<div class="card-body">
<img src="..." class="card-img-top" alt="..." />
<h5 class="card-title">Card title</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk
of the card's content.
</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
</div>
<div id="speech-to-text">
<p>Speech To Text</p>
</div>
<div id="ocr">
<p>OCR</p>
</div>
<div id="disease-form">
<p>Form Here</p>
</div>
{% endblock body %}
29 changes: 17 additions & 12 deletions templates/patient.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@
{% block title %}Patient{% endblock title %}

{% block body %}
<div class="container">
<div class="card" style="width: 18rem">
<div class="card-body">
<img src="..." class="card-img-top" alt="..." />
<h5 class="card-title">Card title</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk
of the card's content.
</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
<div id="case-history">
{% for case in cases %}
<div class="container">
<div class="card" style="width: 18rem">
<div class="card-body">
<h5 class="card-title"><img src="..." class="card-img-top" alt="..." />Patient Name</h5>
<p class="card-text">
Case Details
</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<div id="book-appointment">
<p>Form Here</p>
</div>
{% endblock body %}
23 changes: 23 additions & 0 deletions templates/pharmacy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% extends 'base.html' %}

{% block title %}Pharmacy{% endblock title %}

{% block body %}
<div id="medicines">
{% for medicine in medicines %}
<div class="container">
<div class="card" style="width: 18rem">
<div class="card-body">
<h5 class="card-title"><img src="..." class="card-img-top" alt="..." />Medicine Name</h5>
<p class="card-text">
Medicine Description
</p>
</div>
</div>
</div>
{% endfor %}
</div>
<div id="prescription">
<p>A search bar to search for the patient prescription on name basis</p>
</div>
{% endblock body %}
22 changes: 9 additions & 13 deletions templates/reception.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
{% block title %}Reception{% endblock title %}

{% block body %}
<div class="container">
<div class="card" style="width: 18rem">
<div class="card-body">
<img src="..." class="card-img-top" alt="..." />
<h5 class="card-title">Card title</h5>
<p class="card-text">
Some quick example text to build on the card title and make up the bulk
of the card's content.
</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<div id="new-patient">
<p>Form here</p>
</div>
<div id="existing-patient">
<p>Form here</p>
</div>
<div id="appointments">
<p>Appointments</p>
</div>
{% endblock body %}
23 changes: 23 additions & 0 deletions templates/staff.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends 'base.html' %}
{% block title %}Staff{% endblock title %}
{% block body %}
<div id="employee">
{% for employee in employees %}
<div class="container">
<div class="card">
Expand All @@ -17,4 +18,26 @@ <h5 class="card-title d-flex mt-2">
</div>
</div>
{% endfor %}
</div>
<div id="equipment">
{% for equipment in equipments %}
<div class="container">
<div class="card">
<div class="card-body">
<h5 class="card-title d-flex mt-2">
<img
src="https://via.placeholder.com/50x50"
class="rounded-circle me-2"
alt="..."
/>Employee Name
</h5>
<p class="card-text">Department Attendance</p>
</div>
</div>
</div>
{% endfor %}
</div>
<div id="operation-room">
<p>A table here</p>
</div>
{% endblock body %}

0 comments on commit 27179bb

Please sign in to comment.