Spanish translation for tudulis.com

In my previous post, I mention that tudulis.com is now support internationalization or i18n, and it’s currently only support English and Indonesian. But thanks to the generosity of Rodrigo Perez, tudulis.com now also support Spanish. Since I can only speak English (beside Indonesian of course), I’ll be very happy if there’s somebody who want to do the translation to other languages :)

To translate to other language, you can copy the eng directory in app/locale directory, change the name to the language code you’re about to translate (like esp for spanish, eng for english, or ind for indonesian), refer to ISO 639-2 for a list of available language code, put it back in the same directory as the eng directory and edit the LC_MESSAGES/default.po file with any application that can edit po files (like poedit), and place the resulting default.mo file in the same directory as the default.po file, and that’s it. After you done all that you can email me if you want your translation to be added to tudulis.com :)

tudulis now support i18n

Just a quick note, tudulis, the free, online, todo list management app is now support internationalization or i18n for short. Currently it only support english and indonesian localization, but you can add your own translation too. Just follow this instruction to add your locale, after you get the source code, or you can fork the source code and send me a pull request. that’s it for now and happy translating :)

PS: some screenshots for the localize interface

Dynamically add and remove input field in rails without javascript

when dealing with nested form field using accepts_nested_attributes_for in ruby on rails, I always tempted to ada feature where the user can dynamically add or remove form field on the form. Usually people achieve this with the help of javascript function. But I want to use plain html for the sake of ‘progressive enhancement’, if that’s works than I can apply some javascript to make it more interactive, it turns out to be pretty simple with ruby on rails.

first, the models

# recipe model
class Recipe < ActiveRecord::Base
  has_many :ingredients
  accepts_nested_attributes_for :ingredients, :allow_destroy => true

  validates_presence_of :name
end

# Ingredient model
class Ingredient < ActiveRecord::Base
  belongs_to :recipe
end

then the controller

class RecipesController < ApplicationController def index @recipes = Recipe.all end def show @recipe = Recipe.find(params[:id]) end def new @recipe = Recipe.new @recipe.ingredients.build # build ingredient attributes, nothing new here end def create @recipe = Recipe.new(params[:recipe]) if params[:add_ingredient] # add empty ingredient associated with @recipe @recipe.ingredients.build elsif params[:remove_ingredient] # nested model that have _destroy attribute = 1 automatically deleted by rails else # save goes like usual if @recipe.save flash[:notice] = "Successfully created recipe." redirect_to @recipe and return end end render :action => 'new' end def edit @recipe = Recipe.find(params[:id]) end def update @recipe = Recipe.find(params[:id]) if params[:add_ingredient] # rebuild the ingredient attributes that doesn't have an id unless params[:recipe][:ingredients_attributes].blank? for attribute in params[:recipe][:ingredients_attributes] @recipe.ingredients.build(attribute.last.except(:_destroy)) unless attribute.last.has_key?(:id) end end # add one more empty ingredient attribute @recipe.ingredients.build elsif params[:remove_ingredient] # collect all marked for delete ingredient ids removed_ingredients = params[:recipe][:ingredients_attributes].collect { |i, att| att[:id] if (att[:id] && att[:_destroy].to_i == 1) } # physically delete the ingredients from database Ingredient.delete(removed_ingredients) flash[:notice] = "Ingredients removed." for attribute in params[:recipe][:ingredients_attributes] # rebuild ingredients attributes that doesn't have an id and its _destroy attribute is not 1 @recipe.ingredients.build(attribute.last.except(:_destroy)) if (!attribute.last.has_key?(:id) && attribute.last[:_destroy].to_i == 0) end else # save goes like usual if @recipe.update_attributes(params[:recipe]) flash[:notice] = "Successfully updated recipe." redirect_to @recipe and return end end render :action => 'edit' end def destroy @recipe = Recipe.find(params[:id]) @recipe.destroy flash[:notice] = "Successfully destroyed recipe." redirect_to recipes_url end end

the views ( form partial )

<% form_for @recipe do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </p>
  <p>
    <%= f.label :description %><br />
    <%= f.text_area :description, :rows => 4, :cols => 50 %>
  </p>
  <h3>Ingredients</h3>
  <% f.fields_for :ingredients do |ing| %>
    <p>
      <%= ing.label :name %>
      <%= ing.text_field :name, :size => 50 %>
      <%= ing.check_box :_destroy %>
      <%= ing.label :_destroy, 'delete' %>
    </p>
  <% end -%>
  <p>
    <%= f.submit 'Add ingredient', :name => "add_ingredient" %>
    <%= f.submit 'Delete checked ingredients', :name => "remove_ingredient" %>
    <%= f.submit %>
  </p>
<% end %>

and the code in actions…

now that the basic foundation is working, adding some javascript to add an remove nested fields should be fun :)

Tudulis now support OAuth with twitter

Tudulis, the free and simple online todo and task management application has a new feature, now user can register and/or login via twitter, how awesome is that? :P

here’s some screenshots…

in case you don’t know, the source code for tudulis is available for you to download, or if you prefer to use the existing running application go here. Support for another OAuth provider (facebook, google, yahoo) is in progress.

tudulis is now LIVE !!!

For those who don’t know, TuDuLis is an application that I created just for fun, it’s a todo list management, created using cakePHP. The great news is that it is now live on http://tudulis.com. It’s absolutely free (you can even download the source code) so if anybody found it to be useful, feel free to use it, just register and then start managing your todos.

Currently there’s several things that don’t quite work though, like the contact page and PDF download links, I’m working on it now so just hang in there :)

TuDuLis, simple web-based todo list management with CakePHP

It’s been a while :D

Recently I just create a simple todo list application powered with CakePHP framework. I called the application TuDuLis. The application is inspired from 37signal’s tadalist application. I like tadalist because of its simplicity and strong focus, it’s just do what it intended to do, which is to manage todo list, and that’s all, and that is where I think its strong point lies.

So I try to make something similar, and I thought it would be fun to create it with another language (tadalist is made with Ruby and Ruby on Rails framework) so I choose PHP and CakePHP application framework (mostly because PHP and CakePHP is the only language and framework I know beside Ruby and RoR :P).

Some Screenshots

The application is freely available on http://github.com/rahmat-budiharso/tudulis

Some of the features are:

  • You can ceate List of task and tasks (obviously)
  • Ajax enabled
  • To mark a task as finished, simply click on the checkbox in front of every task
  • Finished task can be undo or mark as unfinished by clearing the checkmark
  • Finished task can be delete by clicking on the delete button next to each finished task
  • Only a list with all of its tasks are finished can be deleted

So feel free to try it out :)