From 6764ddfa432f6e120c5c4791ca88fe78e7bbebbc Mon Sep 17 00:00:00 2001 From: Nathan Pham Date: Thu, 1 Dec 2016 04:25:54 +0000 Subject: [PATCH 1/4] fix donor page --- app/views/donors/show.html.haml | 63 ++++++++++++++++++--------------- db/schema.rb | 2 +- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/app/views/donors/show.html.haml b/app/views/donors/show.html.haml index 7f6e45f..1bd20f5 100644 --- a/app/views/donors/show.html.haml +++ b/app/views/donors/show.html.haml @@ -1,29 +1,34 @@ -%h1 #{@donor.first_name} #{@donor.last_name} - -%h2 Published Dedications -- @tiers.each do |tier| - - @donor_published_dedications_by_tier[tier].each do |dedication| - %div{:class => "dedication", :id => dedication.id} - .col-md-4.portfolio-item - .panel.panel-default - .panel-heading - %h4= dedication.tier - .panel-body - %p= dedication.dedication - %p= link_to "#{dedication.hospital.name}", hospital_path(Hospital.find(dedication.hospital_id)) - %p= link_to "View Dedication", dedication_path(dedication), :id => "view_#{dedication.id}" - -- if @show_unpublished - %h2 Unpublished Dedications - - @tiers.each do |tier| - - @donor_unpublished_dedications_by_tier[tier].each do |dedication| - %div{:class => "dedication", :id => dedication.id} - .col-md-4.portfolio-item - .panel.panel-default - .panel-heading - %h4= dedication.tier - .panel-body - %p= dedication.dedication - %p= link_to "#{dedication.hospital.name}", hospital_path(Hospital.find(dedication.hospital_id)) - %p= link_to "View Dedication", dedication_path(dedication), :id => "view_#{dedication.id}" - %p= link_to "Edit", edit_dedication_path(dedication.id) \ No newline at end of file +.container + .devise + %h1 #{@donor.first_name} #{@donor.last_name} + %hr/ + + %h3 Published Dedications + - @tiers.each do |tier| + .row + - @donor_published_dedications_by_tier[tier].each do |dedication| + %div{:class => "dedication", :id => dedication.id} + .col-md-4 + .panel.panel-info + .panel-heading + %h4= dedication.tier + .panel-body + %p= dedication.dedication + %p= link_to "#{dedication.hospital.name}", hospital_path(Hospital.find(dedication.hospital_id)) + %p= link_to "View Dedication", dedication_path(dedication), :id => "view_#{dedication.id}" + + - if @show_unpublished + %h3 Unpublished Dedications + - @tiers.each do |tier| + .row + - @donor_unpublished_dedications_by_tier[tier].each do |dedication| + %div{:class => "dedication", :id => dedication.id} + .col-md-4 + .panel.panel-info + .panel-heading + %h4= dedication.tier + .panel-body + %p= dedication.dedication + %p= link_to "#{dedication.hospital.name}", hospital_path(Hospital.find(dedication.hospital_id)) + %p= link_to "View Dedication", dedication_path(dedication), :id => "view_#{dedication.id}" + %p= link_to "Edit", edit_dedication_path(dedication.id) diff --git a/db/schema.rb b/db/schema.rb index 7a2a860..df79618 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -29,8 +29,8 @@ t.integer "hospital_id" t.integer "donor_id" t.string "tier" + t.boolean "published", default: false t.string "date" - t.boolean "published" end create_table "donors", force: :cascade do |t| From f9b632078a1a62ed1f2000d0036edbce5478d48b Mon Sep 17 00:00:00 2001 From: Nathan Pham Date: Thu, 1 Dec 2016 04:39:17 +0000 Subject: [PATCH 2/4] Fix donor page cucumber fail --- app/views/donors/show.html.haml | 12 +++++++++--- features/donors_page.feature | 8 +------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/donors/show.html.haml b/app/views/donors/show.html.haml index 1bd20f5..dd6e6e3 100644 --- a/app/views/donors/show.html.haml +++ b/app/views/donors/show.html.haml @@ -15,7 +15,9 @@ .panel-body %p= dedication.dedication %p= link_to "#{dedication.hospital.name}", hospital_path(Hospital.find(dedication.hospital_id)) - %p= link_to "View Dedication", dedication_path(dedication), :id => "view_#{dedication.id}" + .btn.btn-default.btn-round.btn-sm + %a{:href => dedication_path(dedication)} + View Dedication - if @show_unpublished %h3 Unpublished Dedications @@ -30,5 +32,9 @@ .panel-body %p= dedication.dedication %p= link_to "#{dedication.hospital.name}", hospital_path(Hospital.find(dedication.hospital_id)) - %p= link_to "View Dedication", dedication_path(dedication), :id => "view_#{dedication.id}" - %p= link_to "Edit", edit_dedication_path(dedication.id) + .btn.btn-default.btn-round.btn-sm + %a{:href => dedication_path(dedication)} + View Dedication + .btn.btn-default.btn-round.btn-sm + %a{:href => edit_dedication_path(dedication.id)} + Edit diff --git a/features/donors_page.feature b/features/donors_page.feature index 6433d47..1159cac 100644 --- a/features/donors_page.feature +++ b/features/donors_page.feature @@ -32,12 +32,6 @@ Feature: List of Dedications for a Donor And I follow "Hospital 1" Then I should be on the hospital page for "Hospital 1" - Scenario: When I click on a dedication page, I should be taken to that dedication's page - And I follow "view_2" - Then I should be on the dedication page for dedication 2 - Scenario: When I visit a hidden donor I should see an error page Given I am on the donor page for "Tina Martinez" - Then I should see "Invalid Donor ID" - - \ No newline at end of file + Then I should see "Invalid Donor ID" \ No newline at end of file From 84e22420c8f455ed85004b0169d98f818dc27880 Mon Sep 17 00:00:00 2001 From: Nathan Pham Date: Thu, 1 Dec 2016 04:41:26 +0000 Subject: [PATCH 3/4] Fix layout for dedication edit page --- app/views/dedications/edit.html.haml | 36 +++++++++++++++------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/app/views/dedications/edit.html.haml b/app/views/dedications/edit.html.haml index 3937a6c..51f6ce3 100644 --- a/app/views/dedications/edit.html.haml +++ b/app/views/dedications/edit.html.haml @@ -1,17 +1,19 @@ -%h1 Edit Dedication and Consent for Digital Wall of Founders - -= form_tag dedication_path(@dedication), :method => :put do - - %h2 Dedication - = label :dedication, :dedication, 'Write a dedication for your donation' - = text_field :dedication, 'dedication' - - %h2 Digital Wall of Founders - = label :dedication, :status, 'I want my dedication to appear on the Digital Wall of Founders' - = check_box :dedication, 'status', {}, 'true', 'false' - - %p We want to keep the Digital Wall of Founders as close to the physical Walls of Founders - in hospitals as possible, so once you "Publish" your dedication you must contact an admin to change it. - Until you publish your dedication it will not appear on the Digital Wall of Founders. - = submit_tag 'Save' - = submit_tag 'Publish', name: 'publish' \ No newline at end of file +.container + .devise + %h1 Edit Dedication and Consent for Digital Wall of Founders + + = form_tag dedication_path(@dedication), :method => :put do + + %h2 Dedication + = label :dedication, :dedication, 'Write a dedication for your donation' + = text_field :dedication, 'dedication' + + %h2 Digital Wall of Founders + = label :dedication, :status, 'I want my dedication to appear on the Digital Wall of Founders' + = check_box :dedication, 'status', {}, 'true', 'false' + + %p We want to keep the Digital Wall of Founders as close to the physical Walls of Founders + in hospitals as possible, so once you "Publish" your dedication you must contact an admin to change it. + Until you publish your dedication it will not appear on the Digital Wall of Founders. + = submit_tag 'Save' + = submit_tag 'Publish', name: 'publish' \ No newline at end of file From 32c979c8e956db445a36986fc50d44fc739e27be Mon Sep 17 00:00:00 2001 From: Nathan Pham Date: Thu, 1 Dec 2016 05:52:57 +0000 Subject: [PATCH 4/4] add hospital story --- app/views/hospitals/show.html.haml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/views/hospitals/show.html.haml b/app/views/hospitals/show.html.haml index 2af3530..c7c9f6b 100644 --- a/app/views/hospitals/show.html.haml +++ b/app/views/hospitals/show.html.haml @@ -12,16 +12,13 @@ = image_tag "sankara2.jpg", class: "img-responsive img-thumbnail" .col-md-4 %h3 Project Description - %p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra euismod odio, gravida pellentesque urna varius vitae. Sed dui lorem, adipiscing in adipiscing et, interdum nec metus. Mauris ultricies, justo eu convallis placerat, felis enim. + %p= @hospital.story %li Surgeries: = @hospital.surgeries %li Cost: = @hospital.cost - %li - Story: - = @hospital.story %head %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/