Hack patching home page modals

This commit is contained in:
Will Marshall
2014-06-20 16:26:27 +10:00
parent 1ed634239d
commit 21589fd5b0
5 changed files with 65 additions and 32 deletions

View File

@@ -8,7 +8,7 @@ Darkswarm.factory 'Enterprises', (enterprises, CurrentHub)->
@dereference()
dereference: ->
if CurrentHub.hub
if CurrentHub.hub?.id
CurrentHub.hub = @enterprises_by_id[CurrentHub.hub.id]
for enterprise in @enterprises

View File

@@ -1,12 +1,13 @@
%div.modal-centered{bindonce: true, "bo-if" => "enterprise.email || enterprise.website || enterprise.phone"}
%h5.modal-header Contact
%p{"ng-if" => "enterprise.phone"}
{{ enterprise.phone }}
%div{bindonce: true}
%div.modal-centered{"bo-if" => "enterprise.email || enterprise.website || enterprise.phone"}
%h5.modal-header Contact
%p{"ng-if" => "enterprise.phone"}
{{ enterprise.phone }}
%p{"bo-if" => "enterprise.email"}
%a{"ng-href" => "mailto:{{enterprise.email | stripUrl}}", target: "_blank" }
{{ enterprise.email | stripUrl }}
%p{"ng-if" => "enterprise.email"}
%a{"ng-href" => "mailto:{{enterprise.email | stripUrl}}", target: "_blank" }
{{ enterprise.email | stripUrl }}
%p{"ng-if" => "enterprise.website"}
%a{"ng-href" => "http://{{enterprise.website | stripUrl}}", target: "_blank" }
{{ enterprise.website | stripUrl }}
%p{"ng-if" => "enterprise.website"}
%a{"ng-href" => "http://{{enterprise.website | stripUrl}}", target: "_blank" }
{{ enterprise.website | stripUrl }}

View File

@@ -1,19 +1,19 @@
%div.modal-centered{"ng-if" => "producer.twitter || producer.facebook || producer.linkedin || producer.instagram"}
%div.modal-centered{"ng-if" => "enterprise.twitter || enterprise.facebook || enterprise.linkedin || enterprise.instagram"}
%h5.modal-header Follow
.follow-icons{bindonce: true}
%span{"ng-if" => "producer.twitter"}
%a{"ng-href" => "http://twitter.com/{{producer.twitter}}", target: "_blank"}
%span{"ng-if" => "enterprise.twitter"}
%a{"ng-href" => "http://twitter.com/{{enterprise.twitter}}", target: "_blank"}
%i.ofn-i_041-twitter
%span{"ng-if" => "producer.facebook"}
%a{"ng-href" => "http://{{producer.facebook | stripUrl}}", target: "_blank"}
%span{"ng-if" => "enterprise.facebook"}
%a{"ng-href" => "http://{{enterprise.facebook | stripUrl}}", target: "_blank"}
%i.ofn-i_044-facebook
%span{"ng-if" => "producer.linkedin"}
%a{"ng-href" => "http://{{producer.linkedin | stripUrl}}", target: "_blank"}
%span{"ng-if" => "enterprise.linkedin"}
%a{"ng-href" => "http://{{enterprise.linkedin | stripUrl}}", target: "_blank"}
%i.ofn-i_042-linkedin
%span{"ng-if" => "producer.instagram"}
%a{"ng-href" => "http://instagram.com/{{producer.instagram}}", target: "_blank"}
%span{"ng-if" => "enterprise.instagram"}
%a{"ng-href" => "http://instagram.com/{{enterprise.instagram}}", target: "_blank"}
%i.ofn-i_043-instagram

View File

@@ -1,23 +1,55 @@
%ofn-modal{title: "{{enterprise.name}}"}
.highlight
.highlight-row
.highlight-top
%p.right
{{ enterprise.address.city }} , {{enterprise.address.state}}
{{ [enterprise.address.city, enterprise.address.state] | printArray}}
%h3
%i.ofn-i_036-producers
{{ enterprise.name }}
%img.hero-img{"ng-src" => "{{enterprise.promo_image}}"}
.row.pad-top{bindonce: true}
.small-12.large-6.columns
%img.producer-logo{"bo-src" => "enterprise.logo", "bo-if" => "enterprise.logo"}
%h5.modal-header About
%p{"ng-bind-html" => "enterprise.long_description"}
.row{bindonce: true}
.small-12.large-8.columns
%div{"ng-show" => "enterprise.long_description.length > 0 || enterprise.logo"}
%h5.modal-header About
.about-container
%img.enterprise-logo{"bo-src" => "enterprise.logo", "bo-if" => "enterprise.logo"}
%p.text-small{"ng-bind-html" => "enterprise.long_description"}
.small-12.large-6.columns
%ng-include{src: "'partials/contact.html'"}
%ng-include{src: "'partials/follow.html'"}
.small-12.large-4.columns
%div.modal-centered{"bo-if" => "enterprise.email || enterprise.website || enterprise.phone"}
%h5.modal-header Contact
%p{"bo-if" => "enterprise.phone"}
{{ enterprise.phone }}
%p{"bo-if" => "enterprise.email"}
%a{"ng-href" => "mailto:{{enterprise.email | stripUrl}}", target: "_blank" }
{{ enterprise.email | stripUrl }}
%p{"bo-show" => "enterprise.website"}
%a{"ng-href" => "http://{{enterprise.website}}", target: "_blank" }
{{ enterprise.website | stripUrl }}
%div.modal-centered{"bo-if" => "enterprise.twitter || enterprise.facebook || enterprise.linkedin || enterprise.instagram"}
%h5.modal-header Follow
.follow-icons{bindonce: true}
%span{"bo-show" => "enterprise.twitter"}
%a{"ng-href" => "http://twitter.com/{{enterprise.twitter}}", target: "_blank"}
%i.ofn-i_041-twitter
%span{"bo-show" => "enterprise.facebook"}
%a{"ng-href" => "http://{{enterprise.facebook | stripUrl}}", target: "_blank"}
%i.ofn-i_044-facebook
%span{"bo-show" => "enterprise.linkedin"}
%a{"ng-href" => "http://{{enterprise.linkedin | stripUrl}}", target: "_blank"}
%i.ofn-i_042-linkedin
%span{"bo-show" => "enterprise.instagram"}
%a{"ng-href" => "http://instagram.com/{{enterprise.instagram}}", target: "_blank"}
%i.ofn-i_043-instagram
%a.close-reveal-modal.outside{"ng-click" => "$close()"}
%i.ofn-i_009-close

View File

@@ -22,7 +22,7 @@ feature 'Home', js: true do
it "should grey out hubs that are not in an order cycle" do
create(:simple_product, distributors: [d1, d2])
visit root_path
page.should have_selector 'hub.inactive', text: d1.name
page.should have_selector 'hub.inactive'
page.should have_selector 'hub.inactive', text: d2.name
end