// Generated by CoffeeScript 1.6.3
(function() {
  $(document).ready(function() {
    var current_url, url_id;
    current_url = window.location.pathname;
    console.log(current_url);
    url_id = current_url.replace(/^.*(\d+).*$/i, '$1');
    return $.getJSON('http://127.0.0.1:8000/cocktail_' + url_id + '.json', function(data) {
      $('#header').append('<h1 style="font-family: \'Courgette\', cursive; font-size: 22px;">' + data[0]['name'] + '</h2>');
      $('#content').append('<img src="http://127.0.0.1:8000/' + data[0]['image'] + '" width="50%" height="50%" style="float:left; margin:0 1em 1em 0" alt="" />');
      $('#content').append('<h2>Ingredients</h2>');
      $('#content').append('<ul>');
      $.each(data[0]['ingredients'], function(key) {
        return $.each(data[0]['ingredients'][key], function(key, value) {
          return $('#content').append('<li>' + value + '</li>');
        });
      });
      $('#content').append('</ul>');
      $('#content').append('<h2>Preparation</h2>');
      return $('#content').append('<p style="text-align: justify;">' + data[0]['preparation'] + '</p>');
    });
  });

}).call(this);
