Skip to content

Commit

Permalink
Merge pull request #46 from njazari/wip_UI_final
Browse files Browse the repository at this point in the history
Wip ui final
  • Loading branch information
trpham authored Dec 1, 2016
2 parents deb2742 + 32c979c commit 5895763
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 58 deletions.
36 changes: 19 additions & 17 deletions app/views/dedications/edit.html.haml
Original file line number Diff line number Diff line change
@@ -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'
.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'
69 changes: 40 additions & 29 deletions app/views/donors/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
%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)
.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))
.btn.btn-default.btn-round.btn-sm
%a{:href => dedication_path(dedication)}
View Dedication

- 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))
.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
5 changes: 1 addition & 4 deletions app/views/hospitals/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}/
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
8 changes: 1 addition & 7 deletions features/donors_page.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Then I should see "Invalid Donor ID"

0 comments on commit 5895763

Please sign in to comment.