njazari/sef-founderwall

View on GitHub
app/views/hospitals/show.html.haml

Summary

Maintainability
Test Coverage
=javascript_include_tag 'application.js'

.container
  .row
    .col-lg-12
      %h1.page-header
        #{@hospital.name}
        %small #{@hospital.city}
                
  .row
    .col-md-8
      = image_tag "sankara2.jpg", class: "img-responsive img-thumbnail"
    .col-md-4
      %h3 Project Description
      %p= @hospital.story
      %li
        Surgeries:
        = @hospital.surgeries
      %li
        Cost:
        = @hospital.cost

      %head
      %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
      :css
        #map {
          height: 150px;
          width: 100%;
        }
      %body
        %h3 Location
        Latitude: #{@hospital.lat} 
        Longitude: #{@hospital.lng}
        #map
        :javascript
          function initMap() {
            var uluru = {lat: #{@hospital.lat}, lng: #{@hospital.lng} };
            var map = new google.maps.Map(document.getElementById('map'), {
              zoom: 6,
              center: uluru
            });
            var marker = new google.maps.Marker({
              position: uluru,
              map: map
            });
          }
      %script{:async => "", :defer => "defer", :src => "https://maps.googleapis.com/maps/api/js?key=AIzaSyBTUBDqxJw2PidgRgXPJg_p84LCVS026l8&callback=initMap"}

  %hr/
        
  .nav.nav-tabs.nav-justified
    - @tiers.each do |tier|
      .btn.btn-default.btn-round.btn-sm
        %a{:href => "##{tier}", :class => 'jump', :name => "#{tier}"} #{tier}
  
  %hr/
  
  - @tiers.each do |tier|
    .row
      %h2{:id => "#{tier}_header"} #{tier}
      - @hospital_published_dedications_by_tier[tier].each do |dedication|
        %div{:class => "dedication", :id => dedication.id} 
          .col-md-4
            .panel.panel-info
              .panel-heading
                %h4= link_to "#{dedication.donor.first_name} #{dedication.donor.last_name}", donor_path(Donor.find(dedication.donor))
              .panel-body
                %p= dedication.dedication
                .btn.btn-default.btn-round.btn-sm
                  // :id => "view_#{dedication.id}
                  %a{:href => dedication_path(dedication), :method => :get}
                    See Dedication
    %hr/