smallroomsoftware.com

Flowy page layouts

Posted on February 18, 2008

For a long time we've wanted to get better looking property adverts onto Rentability. We thought about offering several layout templates that the owner could choose from. Then we thought about totally "floating" layouts where the user creates several "blocks" of content (text or photos) that are designed to flow down the page and be happy with different page widths and font sizes. The user doesn't have precise control over the placement of blocks. Instead, they have a bunch of blocks, of different dimensions that slot together down the page (from right to left and top to bottom) filling all available space. With fixed element widths (say a third or two thirds of the page) you can get a nice magazine/newspaper style look. Of course, a simple CSS float:left won't work all that well - you get a lot of holes where elements sort of clear:right as they wrap around down the page. So I tried to create this 'flowy' layout with javascript. The javascript measures each block, figures out how it slots into the layout, then positions it absolutely.

In the editing UI I've used scriptaculous to animate the reflowing of reordered blocks. This isn't always entirely intuitive - try the demo below - but then the whole approach is a compromise of sorts.

It's not beyond the realms of possibility that a layout will flow slightly differently on two different browsers. Actually, Sim's advert for the Pigeonnier lays out differently on IE than it does on Safari. Both looks great though! It's interesting how robust this technique can be.

Unless I've shown you a preview, you're probably wondering what the hell I'm going on about. Here's a demo page that you can play with (the changes you make are only visible by you).

Simple java properties style rails localisation with Gibberish

Posted on July 23, 2007

I had a session preparing the Rentability front-end for localization the other day. Luckily I found the Gibberish rails plugin which makes localizing the static text fairly painless - you can store the translated strings in yml files, and the syntax is very simple. I made a slight patch to gibberish so it'll print the key next to each string on the live app so that the human translator can see where each key is used on the running site:

module Gibberish
  module Localize
    alias_method :old_translate, :translate
    def translate(string, key, *args)
      str = old_translate(string, key, *args)
      "#{str} <span class=\"translation-key\">#{key}</span>"
    end
  end
end

You can put that in environment.rb (maybe if RAILS__ENV == 'development'). Here's some CSS:

span.translation-key {
  font-size: 11px;
  font-weight: normal;
  color: black;
  background-color: yellow;
  font-family: geneva;
  border: 1px solid #444;
  padding: 0 1px;
  text-transform: none;
  font-style: normal;
}

First real enquiry!

Posted on May 28, 2007

Yesterday turned out to be a landmark for Rentability. We processed our first real, genuine enquiry from a real, genuine prospective holiday-maker! To quote Dr. Emmett Brown, "It works! It works! I finally created something that works!".

This actually happened quicker than we'd predicted and it was helped along by the fact that we have a much larger number of properties in Whistler, BC than everywhere else in the world put together.

Back in France

Posted on February 23, 2007

Vodka Tonics I'm back in France and we're getting rentability.com ready for a few days of face-to-face alpha testing and then we'll start a period of beta testing. Multi-unit properties (e.g. B&B) are in for beta now which is great.

Quite lovely to be back! It's a busy house but we're making progress. We must be working hard - I've been here over a week and we've played no Collin Mcrae (although that might have something to do with Josh's new Wii).

Hosting by site5.com