RB.constants = { project_id: <%= @project.id %>, sprint_id: <%= @sprint ? @sprint.id : "null" %>, protect_against_forgery: <%= protect_against_forgery? ? "true" : "false" %>, request_forgery_protection_token: '<%= request_forgery_protection_token %>', form_authenticity_token: '<%= form_authenticity_token %>' }; RB.i18n = { generating_graph: '<%= l("backlogs.generating_chart") %>', burndown_graph: '<%= l("backlogs.burndown_graph") %>' }; RB.urlFor = (function () { var routes = { update_sprint: '<%= url_for(:controller => 'rb_sprints', :action => 'update', :sprint_id => ":id") %>', create_story: '<%= url_for(:controller => 'rb_stories', :action => 'create') %>', update_story: '<%= url_for(:controller => 'rb_stories', :action => 'update', :id => ":id") %>', create_task: '<%= url_for(:controller => 'rb_tasks', :action => 'create') %>', update_task: '<%= url_for(:controller => 'rb_tasks', :action => 'update', :id => ":id") %>', create_impediment: '<%= url_for(:controller => 'rb_impediments', :action => 'create') %>', update_impediment: '<%= url_for(:controller => 'rb_impediments', :action => 'update', :id => ":id") %>', show_updated_items: '<%= url_for(:controller => 'rb_updated_items', :action => 'show', :project_id => ":id") %>', show_burndown_chart: '<%= url_for(:controller => 'rb_burndown_charts', :action => 'show', :sprint_id => ":id", :project_id =>":project_id") %>' }; return function (routeName, options) { route = routes[routeName]; if (options){ if (options.id) { route = route.replace(":id", options.id); } if (options.project_id){ route = route.replace(":project_id", options.project_id); } } return route; } }());