Skip to content

Commit

Permalink
Some stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipoertel committed Nov 22, 2011
1 parent deea5f8 commit 3557e1b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/decorators/flat_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def availability
end

# overwrites the attribute
def visit_at
def visit_at_with_distance
return unless model.visit_at
s = I18n.l(model.visit_at, :format => :german)
s << " (%s)" % h.content_tag('i', h.distance_of_time_in_words_to_now(model.visit_at))
Expand All @@ -57,7 +57,7 @@ def comment
end

def contact
h.auto_link("#{model.contact_person} #{model.phone}")
h.auto_link("#{model.contact_person || '(no contact given)'}, #{model.phone || '(no phone given)'}")
end

def subtitle_with_contact
Expand Down
1 change: 1 addition & 0 deletions app/models/flat/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Flat::Options
new
contact
contacted
contacted_2nd_time
want_to_visit
visit_scheduled
visited
Expand Down
3 changes: 2 additions & 1 deletion app/views/flats/_overview_map.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ function initialize() {
// set up new map
var mapOptions = {
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
mapTypeId: google.maps.MapTypeId.ROADMAP,
scaleControl: true
};
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

Expand Down
9 changes: 4 additions & 5 deletions app/views/visits/_flat.html.haml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
= link_to(h(flat.street), flat, :class => "street-name")
= link_to(h(flat.street), edit_flat_path(flat), :class => "street-name")
,
= flat.neighbourhood

= image_tag 'http://www.wg-gesucht.de/favicon.ico' if flat.scraped?
%small= link_to 'edit', edit_flat_path(flat)
%br
= "#{flat.square_meters}"
= number_to_currency(flat.price, :unit => '€', :precision => 0)
= number_to_currency(flat.square_meter_price, :unit => '€', :separator => ",", :precision => 0) + "/m²"
-
Phone:
=raw flat.phone.blank? ? "<b style='color:#d00'><i>missing</i></b>" : flat.phone


= raw flat.contact

= flat.priority
1 change: 1 addition & 0 deletions app/views/visits/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

%ol
- flats.reverse.each do |flat|
- flat = FlatDecorator.decorate(flat) # HACK!
%li{:class => (flat.visit_passed?) ? 'passed' : nil}
%time= l(flat.visit_at, :format => "%H:%M")
= render :partial => "flat", :locals => { :flat => flat }

0 comments on commit 3557e1b

Please sign in to comment.