Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appointments card #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 11 additions & 37 deletions app/views/appointments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,29 @@
<h2 class="header">My Appointments</h2>
<h4 class="header">Upcoming Appointments</h4>
<%# upcoming appts %>
<div class="w">
<div class="wrapper">
</div>
<div class="card-product">
<div class="home">
<% if @appointments.empty? %>
<h2>Upcoming appointments with Doctors: </h2>
<% else %>
<h2>Upcoming appointments with Doctors: </h2>
<% @appointments.each do |appointment|%>
<%= link_to appointment_path(appointment) do %>
<div class="card-appointment">
<div class="home">
<img src="https://xsgames.co/randomusers/avatar.php?g=male" />
<div class="card-appointment-infos">
<h2>With Dr <%= appointment.doctor_profile.user.last_name%>, for <%= appointment.doctor_profile.specialty %></h2>
<p>Appointment date: <%= appointment.date %></p>
<p>Appointment time: <%= appointment.start_time %></p>
<h6>Appointment address: <%= appointment.doctor_profile.practice_address %></h6>
</div>
<div class="card-appointment-contact">
<h6>email: <%= appointment.doctor_profile.user.email%></h6>
<h6>Phone no : <%= appointment.doctor_profile.user.phone_number%></h6>
<div class="avatar">
<p class="name"><%= appointment.doctor_profile.user.last_name%>, for <%= appointment.doctor_profile.specialty %></p>
<p class="name">Appointment date: <%= appointment.date %></p>
<p class="specialty">Appointment time: <%= appointment.start_time %></p>
<p class="specialty">Appointment address: <%= appointment.doctor_profile.practice_address %></p>
</div>
</div>
<% end %>
<% end %>
<% end %>
<% if @doctor_appointments.empty? %>
<h2>Upcoming appointments with Patients: </h2>

<% else %>
<h2>Upcoming appointments with Patients: </h2>
<% @doctor_appointments.each do |appointment|%>
<%= link_to appointment_path(appointment) do %>
<div class="card-appointment">
<img src="https://xsgames.co/randomusers/avatar.php?g=male" />
<div class="card-appointment-infos">
<h2>With Patient <%= appointment.user.first_name%> <%= appointment.user.last_name%></h2>
<p>Appointment date: <%= appointment.date %></p>
<p>Appointment time: <%= appointment.start_time %></p>
</div>
<div class="card-appointment-contact">
<h6>email: <%= appointment.user.email%></h6>
<h6>Phone no : <%= appointment.user.phone_number%></h6>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<%# calendar %>
<h4 class="header">Calendar</h4>
</div>
<div>
</div>
</div>
Expand Down
72 changes: 36 additions & 36 deletions app/views/appointments/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
<div class="wrapper">
<div class="container">
<h2 class="header"> Appointment details: </h2>

<br>
<div class="container">
<h3> Appointment details: </h3>
<% if current_user.doctor_profile %>
<div class="wrapper">

<% if current_user.doctor_profile %>
<div class="card-appointment">

<div class="card-appointment-infos">
<img src="https://xsgames.co/randomusers/avatar.php?g=male" />
</div>
<div class="card-appointment-contact">
<div>
<h6> Date: <%= @appointment.date %> </h6>
<p> Start Time: <%= @appointment.start_time %> </p>
<p> Duration: <%= @appointment.end_time.to_i - @appointment.start_time.to_i %> hours </p>
<p> with patient: <%= @appointment.user.first_name %> <%= @appointment.user.last_name %></p>
<div class="card-appointment-infos">
<img src="https://xsgames.co/randomusers/avatar.php?g=male" />
</div>
<div>
<h6> Notes: </h6>
<p><%= @appointment.note %></p></p>
<div class="card-appointment-contact">
<div>
<h6> Date: <%= @appointment.date %> </h6>
<p> Start Time: <%= @appointment.start_time %> </p>
<p> Duration: <%= @appointment.end_time.to_i - @appointment.start_time.to_i %> hours </p>
<p> with patient: <%= @appointment.user.first_name %> <%= @appointment.user.last_name %></p>
</div>
<div>
<h6> Notes: </h6>
<p><%= @appointment.note %></p></p>
</div>
</div>
</div>
</div>
<% else %>
<% else %>

<div class="card-appointment">
<div class="card-appointment-infos">
<img src="https://xsgames.co/randomusers/avatar.php?g=male" />
</div>
<div class="card-appointment-contact">
<div>
<h6> Date: <%= @appointment.date %> </h6>
<p> Start Time: <%= @appointment.start_time %> </p>
<p> Duration: <%= @appointment.end_time.to_i - @appointment.start_time.to_i %> hours </p>
<p> with: Dr <%= @appointment.doctor_profile.user.last_name %>, <%= @appointment.doctor_profile.specialty %> </p>
<p> Address: <%= @appointment.doctor_profile.practice_address %> </p>
<div class="card-appointment">
<div class="card-appointment-infos">
<img class="avatar-large" src="https://xsgames.co/randomusers/avatar.php?g=male" />
</div>
<div>
<h6> Notes: </h6>
<p><%= @appointment.note %></p></p>
<div class="card-appointment-contact">
<div>
<p class="specialty"> Date: <%= @appointment.date %> </p>
<p class="specialty"> Start Time: <%= @appointment.start_time %> </p>
<p class="specialty"> Duration: <%= @appointment.end_time.to_i - @appointment.start_time.to_i %> hours </p>
<p class="specialty"> with: Dr <%= @appointment.doctor_profile.user.last_name %>, <%= @appointment.doctor_profile.specialty %> </p>
<p> Address: <%= @appointment.doctor_profile.practice_address %> </p>
</div>
<div>
<h6> Notes: </h6>
<p><%= @appointment.note %></p></p>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
1 change: 1 addition & 0 deletions app/views/doctor_profiles/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<% else %>
<%= image_tag "blank-profile-circle.png", class:"avatar-large" %>
<% end %>

<div class="card-product-infos">
<h5 class="name"><i class="fa-solid fa-user-doctor"></i> Dr. <%=@doctor_profile.user.first_name %>
<%=@doctor_profile.user.first_name %>
Expand Down