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

Don't merge - Review Tuesday #34

Open
wants to merge 74 commits into
base: review-base
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a9886c5
Create Migration and Models
Jan 8, 2016
5ff2147
Add badge model and migration
Jan 8, 2016
c073021
Update README.rdoc
aquarian5 Jan 8, 2016
a4ca6cf
Add geocode capabilitity to PC and OCC
Jan 8, 2016
1d36805
Add geocode capability to PC and OCC
Jan 8, 2016
e2a8b39
fix fields in migration and create seeds
Jan 8, 2016
c54e360
Add geocode gem
Jan 8, 2016
bc55a06
create search routes and controllers
Jan 8, 2016
24cebab
Merge pull request #1 from nyc-copperheads-2016/search_for_occ_by_zip
aquarian5 Jan 8, 2016
fac7727
Add User Login
Jan 8, 2016
61d965f
User Login Form Complete; Includes Associated Views
Jan 8, 2016
74b9c39
Merge pull request #2 from nyc-copperheads-2016/fix_user_login_views
dfroberts2 Jan 8, 2016
5ab6b91
Added calender, some functionality
eshou1014 Jan 8, 2016
df63182
Added calender
eshou1014 Jan 9, 2016
7ce53af
Merge pull request #4 from nyc-copperheads-2016/Add-calender-to-app
dfroberts2 Jan 9, 2016
e389652
Add Link To Login For Users
Jan 9, 2016
473dc6d
Create Dropdown Menu For PrimaryCare and OnCall Caregivers
Jan 9, 2016
5e4ff2b
Merge pull request #5 from nyc-copperheads-2016/add_link_to_login
dfroberts2 Jan 9, 2016
22e28fb
Add search and return methods for searching for OCCs
Jan 8, 2016
bc21602
Render a proper organized view for OCC and PC search results
Jan 9, 2016
474228d
Continue working on registration and validation
Jan 9, 2016
5d4a384
Merge pull request #7 from nyc-copperheads-2016/search_for_occ_by_zip
eshou1014 Jan 9, 2016
856fe11
Added appointment functionality. MVP
eshou1014 Jan 9, 2016
70756fb
Merge pull request #8 from nyc-copperheads-2016/Add-calender-to-app
dfroberts2 Jan 9, 2016
0be1f87
Search function works on current user
Jan 9, 2016
587dc71
Merge pull request #9 from nyc-copperheads-2016/search_for_occ_by_zip
eshou1014 Jan 9, 2016
3d754e6
add primary and oncall controllers
Jan 9, 2016
2e9a2b3
Merge pull request #10 from nyc-copperheads-2016/add_controllers_for_…
dfroberts2 Jan 9, 2016
4d8eeda
Added edit forms for both caregivers routes
eshou1014 Jan 9, 2016
35eb8fe
Merge pull request #11 from nyc-copperheads-2016/Edit-profile-routes-…
eshou1014 Jan 9, 2016
de2d652
Routes are correct but cant edit info in the profile for both caregiv…
eshou1014 Jan 10, 2016
b51235b
Merge pull request #12 from nyc-copperheads-2016/Edit-profile-routes-…
dfroberts2 Jan 10, 2016
608191e
Add show profile pages for OCC and PC
Jan 9, 2016
e858e76
Add scheduling features
Jan 10, 2016
9f9529f
Merge pull request #13 from nyc-copperheads-2016/add_controllers_for_…
dfroberts2 Jan 10, 2016
fded56a
Added Edit profile functionality to PrimaryCaregiver only
eshou1014 Jan 10, 2016
d4f989b
Merge pull request #14 from nyc-copperheads-2016/Edit-profile-routes-…
aquarian5 Jan 10, 2016
7e07c63
Add appointment time and details to calendar view, finish PC appointm…
Jan 10, 2016
c8e60ea
add calendar to pc show page, add confirmed field to appointment
Jan 10, 2016
3b89c87
add applications table and confirmation field to appointments
Jan 10, 2016
5735602
Merge pull request #15 from nyc-copperheads-2016/pc_apply_appointments
aquarian5 Jan 10, 2016
6fd417c
add text messaging functionality so that Primary Caregivers and On Ca…
Jan 10, 2016
d5081f3
Merge pull request #16 from nyc-copperheads-2016/add_text_messaging_f…
dfroberts2 Jan 10, 2016
d0eaaf7
Add functionality so that OCCs can create 'applications' on appointme…
Jan 10, 2016
1a9e933
Merge pull request #17 from nyc-copperheads-2016/pc_apply_appointments
aquarian5 Jan 10, 2016
7cce5cd
PC can select applications from occs
Jan 11, 2016
4dd3fa7
Merge pull request #18 from nyc-copperheads-2016/pc_apply_appointments
aquarian5 Jan 11, 2016
bba4a5b
Add Email Capablity When Primary Caregiver Wants To Message An On Cal…
Jan 11, 2016
41be6ea
Merge pull request #19 from nyc-copperheads-2016/add_email_for_pc_on_occ
dfroberts2 Jan 11, 2016
b202c2f
Add Email Functionality
Jan 11, 2016
0ace1e2
Merge pull request #20 from nyc-copperheads-2016/add_email_for_pc_on_occ
dfroberts2 Jan 11, 2016
e7c3a0b
Incomplete view of show appointments
Jan 11, 2016
f8146fc
Merge pull request #21 from nyc-copperheads-2016/show_appointments
dfroberts2 Jan 11, 2016
a5e73a1
add ENV Variables To Text Messaging and Email Code For Privacy
Jan 11, 2016
b915283
Merge pull request #22 from nyc-copperheads-2016/add_ENV_to_text_and_…
dfroberts2 Jan 11, 2016
92fffda
complete confirmed appointments page
Jan 11, 2016
2ba4e0d
Merge pull request #23 from nyc-copperheads-2016/add_confirmed_appoin…
eshou1014 Jan 11, 2016
306c812
Added badges functionality
eshou1014 Jan 11, 2016
0c08709
Merge pull request #24 from nyc-copperheads-2016/Edit-profile-routes-…
dfroberts2 Jan 11, 2016
93fb7a8
add action mailer files
Jan 11, 2016
1378ba3
Merge pull request #25 from nyc-copperheads-2016/add_email_confirmati…
dfroberts2 Jan 11, 2016
dd34615
Integrate bootstrap setup
eshou1014 Jan 11, 2016
65c38fc
Merge pull request #27 from nyc-copperheads-2016/Integrate-Bootstrap-…
eshou1014 Jan 11, 2016
335e335
Added video background
eshou1014 Jan 12, 2016
2068baa
Deleted video and added video background functionality
eshou1014 Jan 12, 2016
2fa3a53
Merge pull request #28 from nyc-copperheads-2016/Integrate-Bootstrap-…
aquarian5 Jan 12, 2016
b266865
add email confirmation to appointment scheduling events
Jan 12, 2016
0a2cec1
add reminders to appointments
Jan 12, 2016
0531047
Attempt delayed text reminders implementation--incomplete
Jan 12, 2016
8e1ce63
Merge pull request #29 from nyc-copperheads-2016/add_email_confirmati…
eshou1014 Jan 12, 2016
c8f2ca0
add text reminders that are delayed and sent according to reminder time
Jan 12, 2016
731bf86
Styled homepage
eshou1014 Jan 12, 2016
4225625
Merge pull request #31 from nyc-copperheads-2016/add_text_reminders_f…
eshou1014 Jan 12, 2016
75f26da
Merge pull request #32 from nyc-copperheads-2016/style-homepage
eshou1014 Jan 12, 2016
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
23 changes: 23 additions & 0 deletions app/controllers/applications_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class ApplicationsController < ApplicationController
def new
@appointment = Appointment.find_by(id: params[:appointment_id])
@application = Application.new
end

def create
@appointment = Appointment.find_by(id: params[:appointment_id])
@application = Application.new(application_params)
@application.on_call_caregiver = current_user.loginable
@application.appointment = @appointment
if @application.save
redirect_to primary_caregiver_path(@appointment.caregiver_relationship.primary_caregiver)
else
render :new
end
end

private
def application_params
params.require(:application).permit(:body)
end
end
2 changes: 1 addition & 1 deletion app/controllers/appointments_controller.rb
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ def index
def create
pc = PrimaryCaregiver.find_by(id: params[:primary_caregiver_id])
relationship = CaregiverRelationship.create(primary_caregiver: pc)
appointment = Appointment.new(caregiver_relationship: relationship, date: params[:date], start_time: DateTime.parse(params[:date]), confirmed: false)
appointment = Appointment.new(caregiver_relationship: relationship, date: params[:date], start_time: DateTime.parse(params[:date]), pc_confirmed: false, occ_confirmed: false)
relationship.save
appointment.save
redirect_to primary_caregiver_appointments_path(pc)
3 changes: 3 additions & 0 deletions app/models/application.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
class Application < ActiveRecord::Base
belongs_to :appointment
belongs_to :on_call_caregiver

validates :body, presence: true
end
4 changes: 2 additions & 2 deletions app/models/appointment.rb
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ class Appointment < ActiveRecord::Base
belongs_to :caregiver_relationship
has_many :reviews
has_many :reminders
has_many :applications
has_many :applications, dependent: :destroy

def convert_to_datetime(time)
d = date
@@ -15,6 +15,6 @@ def self.appt_dates(appointments)
end

def convert_to_time
start_time.strftime("At %I:%M%p")
start_time.strftime("%I:%M%p")
end
end
3 changes: 3 additions & 0 deletions app/models/login.rb
Original file line number Diff line number Diff line change
@@ -25,5 +25,8 @@ def self.change_to_loginable(logins)
loginables
end

def full_name
first_name + " " + last_name
end

end
15 changes: 15 additions & 0 deletions app/views/applications/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="appointment-details">
<h1>Appointment Details</h1>
<p>When? <%= @appointment.date %> @ <%= @appointment.convert_to_time %></p>
<p>How Long? <%= @appointment.duration %> hours</p>
<p>Details: <%= @appointment.details %></p>
</div>

<div class="application-details">
<%= form_for [@appointment,@application] do |f| %>
<%= f.text_area :body %>
<div>
<%= f.submit 'Send Caregiver A Message'%>
</div>
<% end %>
</div>
11 changes: 11 additions & 0 deletions app/views/appointments/edit.html.erb
Original file line number Diff line number Diff line change
@@ -25,3 +25,14 @@
</div>
</div>
</div>

<div="applcations">
<h2>Applications for this Appointment</h2>
<% @appointment.applications.each do |application| %>
<div class="application">
Application from: <%=application.on_call_caregiver.login.full_name%> in <%=application.on_call_caregiver.login.city_state%>:
<%= link_to 'See Profile', on_call_caregiver_path(application.on_call_caregiver) %>
<p><%= application.body%></p>
</div>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/views/appointments/index.html.erb
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
<% appointments.each do |appointment| %>
<div>
<% if appointment.details && appointment.details.length > 0 %>
<%= appointment.convert_to_time %>:
@ <%= appointment.convert_to_time %>:
<%= link_to appointment.details[0..25], edit_primary_caregiver_appointment_path(@pc, appointment) %>
<% else %>
<%= link_to "Add Availability Details", edit_primary_caregiver_appointment_path(@pc, appointment) %>
2 changes: 1 addition & 1 deletion app/views/primary_caregivers/show.html.erb
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
<% appointments.each do |appointment| %>
<div>
Needs Caretaking!
<%= link_to 'Apply To Help' %>
<%= link_to 'Apply To Help', new_appointment_application_path(appointment) %>
</div>
<% end %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/search/results.html.erb
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<%@caregiver.each do |caregiver| %>
<div class="result"
<div class="basic-info">
<span class="name"><%= caregiver.login.first_name %> <%= caregiver.login.last_name %> </span>
<span class="name"><%= caregiver.login.full_name </span>
<span class="city-state"><%= caregiver.login.city %>, <%= caregiver.login.state %></span>
</div>
<div class="additional-info">
4 changes: 4 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Rails.application.routes.draw do
get 'search/on_call_caregivers' => 'search#OCC'
get 'search/primary_caregivers' => 'search#PC'

resources :appointments do
resources :applications, only: [:new, :create]
end
resources :primary_caregivers do
resources :appointments
end