Permalink
Browse files

re organized logos, added default images for venues, acts, events, an…

…d weblinks. Removed logos and such from schema, and updated seeds
  • Loading branch information...
1 parent 3d3c470 commit 430582f2ff141d840d67e74b5d26709930f71ab2 @jschank committed Feb 12, 2012
Showing with 82 additions and 64 deletions.
  1. BIN app/assets/images/{3am-logo.png → act/3-am-logo.png}
  2. BIN app/assets/images/{ → act}/act-logo.png
  3. BIN app/assets/images/{aprilsmith-logo.png → act/april-smith-and-the-great-picture-show-logo.png}
  4. BIN app/assets/images/{burntsienna-logo.png → act/burnt-sienna-logo.png}
  5. BIN app/assets/images/{ → act}/chorduroy-logo.png
  6. BIN app/assets/images/{djjazzyjeff-logo.png → act/dj-jazzy-jeff-logo.png}
  7. BIN app/assets/images/{elementk-logo.png → act/element-k-logo.png}
  8. BIN app/assets/images/{georgeclinton-logo.png → act/george-clinton-parliament-funkadelic-logo.png}
  9. BIN app/assets/images/{gogogadjet-logo.png → act/go-go-gadjet-logo.png}
  10. BIN app/assets/images/{kristennoise-logo.png → act/kristen-and-the-noise-logo.png}
  11. BIN app/assets/images/{kristenjoe-logo.png → act/kristen-joe-logo.png}
  12. BIN app/assets/images/{lauralea-logo.png → act/laura-lea-and-trip-fabulous-logo.png}
  13. BIN app/assets/images/{LauraMarie-logo.png → act/laura-marie-logo.png}
  14. BIN app/assets/images/{Liat-logo.png → act/liat-logo.png}
  15. BIN app/assets/images/{ → act}/lifespeed-logo.png
  16. BIN app/assets/images/{liquida-logo.png → act/liquid-a-logo.png}
  17. BIN app/assets/images/{LizBethRose-logo.png → act/lizbeth-rose-logo.png}
  18. BIN app/assets/images/{LoriCitro-logo.png → act/lori-citro-logo.png}
  19. BIN app/assets/images/{loveseed-logo.png → act/love-seed-mama-jump-logo.png}
  20. BIN app/assets/images/{LoveViaDanceMachine-logo.png → act/love-via-dance-machine-logo.png}
  21. BIN app/assets/images/{Lovebettie-logo.png → act/lovebettie-logo.png}
  22. BIN app/assets/images/{lowercaseblues-logo.png → act/lower-case-blues-logo.png}
  23. BIN app/assets/images/{Luciar-logo.png → act/luciar-logo.png}
  24. BIN app/assets/images/{LuckyDub-logo.png → act/lucky-dub-logo.png}
  25. BIN app/assets/images/{greengenes-logo.png → act/mr-greengenes-logo.png}
  26. BIN app/assets/images/{djsmoky-logo.png → act/smokythewhore-logo.png}
  27. BIN app/assets/images/{splitdecision-logo.png → act/split-decision-logo.png}
  28. BIN app/assets/images/{tableten-logo.png → act/table-ten-logo.png}
  29. BIN app/assets/images/{bangles-logo.png → act/the-bangles-logo.png}
  30. BIN app/assets/images/{ZakSmithBand-logo.png → act/zak-smith-band-logo.png}
  31. BIN app/assets/images/{dbmc-logo.png → event/dewey-beach-music-conference-logo.png}
  32. BIN app/assets/images/{ → event}/event-logo.png
  33. BIN app/assets/images/event/george-clinton-parliament-funkadelic-logo.png
  34. BIN app/assets/images/{jam-logo.png → event/jam-session-logo.png}
  35. BIN app/assets/images/{runningbull-logo.png → event/running-of-the-bull-logo.png}
  36. BIN app/assets/images/{rudder-logo.png → event/rusty-rudder-saturday-night-logo.png}
  37. BIN app/assets/images/{tacotoss-logo.png → event/taco-toss-logo.png}
  38. BIN app/assets/images/event/the-bangles-logo.png
  39. BIN app/assets/images/{starboard-logo.png → event/the-starboard-saturday-night-logo.png}
  40. BIN app/assets/images/{cork-logo.png → venue/bottle-cork-logo.png}
  41. BIN app/assets/images/{garys-logo.png → venue/gary-s-dewey-beach-grill-logo.png}
  42. BIN app/assets/images/{jimmys-logo.png → venue/jimmy-s-grille-logo.png}
  43. BIN app/assets/images/{mcsheas-logo.png → venue/mcshea-s-beach-pub-grill-logo.png}
  44. BIN app/assets/images/{ → venue}/northbeach-logo.png
  45. BIN app/assets/images/venue/rusty-rudder-logo.png
  46. BIN app/assets/images/{lighthouse-logo.png → venue/the-lighthouse-logo.png}
  47. BIN app/assets/images/venue/the-starboard-logo.png
  48. BIN app/assets/images/{ → venue}/venue-logo.png
  49. BIN app/assets/images/{woodys-logo.png → venue/woody-s-east-coast-grille-logo.png}
  50. BIN app/assets/images/{ → weblocation}/facebook-logo.png
  51. BIN app/assets/images/{ → weblocation}/itunes-logo.png
  52. BIN app/assets/images/{ → weblocation}/myspace-logo.png
  53. BIN app/assets/images/{ → weblocation}/twitter-logo.png
  54. BIN app/assets/images/{ → weblocation}/web-logo.png
  55. BIN app/assets/images/weblocation/weblocation-logo.png
  56. BIN app/assets/images/{ → weblocation}/youtube-logo.png
  57. +14 −4 app/helpers/application_helper.rb
  58. +0 −2 db/migrate/20111114171533_create_venues.rb
  59. +0 −1 db/migrate/20111114173325_create_events.rb
  60. +0 −1 db/migrate/20111223193705_create_acts.rb
  61. +0 −1 db/migrate/20111228210928_create_weblocations.rb
  62. +0 −3 db/schema.rb
  63. +46 −46 db/seeds.rb
  64. +22 −6 spec/helpers/application_helper_spec.rb
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
@@ -35,13 +35,23 @@ def upcoming_area(&block)
end
def make_link(link)
- link_to image_tag(image_path(link.weblocation.icon), :class => "webAnchor", :alt => [link.weblocation.tagline, link.weblocation.name].join(' ')), link.url, :target => "_blank"
+ logo = logo_for(link.weblocation)
+ link_to image_tag(logo, :class => "webAnchor", :alt => [link.weblocation.tagline, link.weblocation.name].join(' ')), link.url, :target => "_blank"
end
def logo_for(thing)
- filename = thing.try(:logo)
- return unless filename
- image_path(filename)
+ name = thing.try(:name)
+ global_default_image = "rails.png"
+ return image_path(global_default_image) unless name
+
+ class_name = thing.class.name.parameterize
+ logo_image = "#{class_name}/#{name.parameterize}-logo.png"
+ return image_path(logo_image) if Dewey::Application.assets.find_asset(logo_image)
+
+ default_for_class_image = "#{class_name}/#{class_name}-logo.png"
+ return image_path(default_for_class_image) if Dewey::Application.assets.find_asset(default_for_class_image)
+
+ return image_path(global_default_image)
end
def sortable_name(name)
@@ -12,8 +12,6 @@ def change
t.string :phone
- t.string :logo
-
t.timestamps
end
end
@@ -3,7 +3,6 @@ def change
create_table :events do |t|
t.string :name
t.text :description
- t.string :logo
t.boolean :is_special, :default => false
t.timestamps
@@ -4,7 +4,6 @@ def change
t.string :name
t.text :description
t.string :hometown
- t.string :logo
t.timestamps
end
@@ -3,7 +3,6 @@ def change
create_table :weblocations do |t|
t.string :name
t.string :tagline
- t.string :icon
t.timestamps
end
View
@@ -17,7 +17,6 @@
t.string "name"
t.text "description"
t.string "hometown"
- t.string "logo"
t.datetime "created_at"
t.datetime "updated_at"
t.string "formerly"
@@ -26,7 +25,6 @@
create_table "events", :force => true do |t|
t.string "name"
t.text "description"
- t.string "logo"
t.boolean "is_special", :default => false
t.datetime "created_at"
t.datetime "updated_at"
@@ -85,7 +83,6 @@
t.string "state"
t.string "zip"
t.string "phone"
- t.string "logo"
t.datetime "created_at"
t.datetime "updated_at"
end
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -139,16 +139,32 @@
@thing = double("some model")
end
- it "returns nothing if the object does not have a logo" do
- @thing.stub(:logo)
- helper.logo_for(@thing).should be_nil
+ it "returns rails image if the object does not have a name" do
+ @thing.stub(:name)
+ helper.logo_for(@thing).should eq("/assets/rails.png")
end
- it "returns asset path of logo" do
- @thing.stub(:logo) {"my_logo.png"}
- helper.logo_for(@thing).should eq("/assets/my_logo.png")
+ it "returns asset path of global default logo if it cannot find image for class and name" do
+ @thing.stub(:name) {"my missing logo name"}
+ Dewey::Application.assets.stub(:find_asset).with("/assets/images/my-missing-logo-name-logo.png") {nil}
+ @thing.stub(:class) {Act}
+ Dewey::Application.assets.stub(:find_asset).with("/assets/images/act/act-logo.png") {nil}
+ Dewey::Application.assets.stub(:find_asset).with("/assets/images/rails.png") {Sprockets.StaticAsset.new()}
+
+ helper.logo_for(@thing).should eq("/assets/my-cool-name-logo.png")
end
+ it "returns asset path of default logo for class, if it cannot find image for name" do
+ @thing.stub(:name) {"my missing logo name"}
+ @thing.stub(:class) {Act}
+
+ helper.logo_for(@thing).should eq("/assets/my-cool-name-logo.png")
+ end
+
+ it "returns asset path of logo if it exists" do
+ @thing.stub(:name) {"my cool name"}
+ helper.logo_for(@thing).should eq("/assets/my-cool-name-logo.png")
+ end
end

0 comments on commit 430582f

Please sign in to comment.