From b9bf30af789cd7d91fff38de7d49cc99e8404c12 Mon Sep 17 00:00:00 2001 From: Yonela Johannes Date: Fri, 10 Mar 2023 16:28:48 +0200 Subject: [PATCH 1/2] index page --- app/views/appointments/index.html.erb | 48 ++++-------------- app/views/appointments/show.html.erb | 72 +++++++++++++-------------- 2 files changed, 47 insertions(+), 73 deletions(-) diff --git a/app/views/appointments/index.html.erb b/app/views/appointments/index.html.erb index 8a288cc..bc1b0ef 100644 --- a/app/views/appointments/index.html.erb +++ b/app/views/appointments/index.html.erb @@ -3,55 +3,29 @@

My Appointments

Upcoming Appointments

<%# upcoming appts %> -
+
+
+
+
<% if @appointments.empty? %>

Upcoming appointments with Doctors:

<% else %> -

Upcoming appointments with Doctors:

<% @appointments.each do |appointment|%> <%= link_to appointment_path(appointment) do %> -
+
-
-

With Dr <%= appointment.doctor_profile.user.last_name%>, for <%= appointment.doctor_profile.specialty %>

-

Appointment date: <%= appointment.date %>

-

Appointment time: <%= appointment.start_time %>

-
Appointment address: <%= appointment.doctor_profile.practice_address %>
-
-
-
email: <%= appointment.doctor_profile.user.email%>
-
Phone no : <%= appointment.doctor_profile.user.phone_number%>
+
+

<%= appointment.doctor_profile.user.last_name%>, for <%= appointment.doctor_profile.specialty %>

+

Appointment date: <%= appointment.date %>

+

Appointment time: <%= appointment.start_time %>

+

Appointment address: <%= appointment.doctor_profile.practice_address %>

<% end %> <% end %> <% end %> - <% if @doctor_appointments.empty? %> -

Upcoming appointments with Patients:

- - <% else %> -

Upcoming appointments with Patients:

- <% @doctor_appointments.each do |appointment|%> - <%= link_to appointment_path(appointment) do %> -
- -
-

With Patient <%= appointment.user.first_name%> <%= appointment.user.last_name%>

-

Appointment date: <%= appointment.date %>

-

Appointment time: <%= appointment.start_time %>

-
-
-
email: <%= appointment.user.email%>
-
Phone no : <%= appointment.user.phone_number%>
-
-
- <% end %> - <% end %> -
- <% end %>
- <%# calendar %> -

Calendar

+
diff --git a/app/views/appointments/show.html.erb b/app/views/appointments/show.html.erb index 09137ad..d69d2a9 100644 --- a/app/views/appointments/show.html.erb +++ b/app/views/appointments/show.html.erb @@ -1,46 +1,46 @@ +
+
+

Appointment details:

-
-
-

Appointment details:

+ <% if current_user.doctor_profile %> +
-<% if current_user.doctor_profile %> -
- -
- -
-
-
-
Date: <%= @appointment.date %>
-

Start Time: <%= @appointment.start_time %>

-

Duration: <%= @appointment.end_time.to_i - @appointment.start_time.to_i %> hours

-

with patient: <%= @appointment.user.first_name %> <%= @appointment.user.last_name %>

+
+
-
-
Notes:
-

<%= @appointment.note %>

+
+
+
Date: <%= @appointment.date %>
+

Start Time: <%= @appointment.start_time %>

+

Duration: <%= @appointment.end_time.to_i - @appointment.start_time.to_i %> hours

+

with patient: <%= @appointment.user.first_name %> <%= @appointment.user.last_name %>

+
+
+
Notes:
+

<%= @appointment.note %>

+
-
-<% else %> + <% else %> -
-
- -
-
-
-
Date: <%= @appointment.date %>
-

Start Time: <%= @appointment.start_time %>

-

Duration: <%= @appointment.end_time.to_i - @appointment.start_time.to_i %> hours

-

with: Dr <%= @appointment.doctor_profile.user.last_name %>, <%= @appointment.doctor_profile.specialty %>

-

Address: <%= @appointment.doctor_profile.practice_address %>

+
+
+
-
-
Notes:
-

<%= @appointment.note %>

+
+
+

Date: <%= @appointment.date %>

+

Start Time: <%= @appointment.start_time %>

+

Duration: <%= @appointment.end_time.to_i - @appointment.start_time.to_i %> hours

+

with: Dr <%= @appointment.doctor_profile.user.last_name %>, <%= @appointment.doctor_profile.specialty %>

+

Address: <%= @appointment.doctor_profile.practice_address %>

+
+
+
Notes:
+

<%= @appointment.note %>

+
-
-<% end %> + <% end %> +
From 08679a8f90990ed438aad45e4499394ab086c367 Mon Sep 17 00:00:00 2001 From: Yonela Johannes Date: Fri, 10 Mar 2023 16:35:17 +0200 Subject: [PATCH 2/2] index page --- app/views/doctor_profiles/show.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/doctor_profiles/show.html.erb b/app/views/doctor_profiles/show.html.erb index 2cd0263..fd43927 100644 --- a/app/views/doctor_profiles/show.html.erb +++ b/app/views/doctor_profiles/show.html.erb @@ -11,6 +11,7 @@ <% else %> <%= image_tag "blank-profile-circle.png", class:"avatar-large" %> <% end %> +
Dr. <%=@doctor_profile.user.first_name %> <%=@doctor_profile.user.first_name %>