replace old prototype/jrails code for periodic checks and start work on autocomplete and edit projects

Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
Reinier Balt 2010-10-05 21:27:00 +02:00
parent 69c811e365
commit c834403340
24 changed files with 588 additions and 53 deletions

View file

@ -2,7 +2,7 @@
project = project_form
%>
<% form_remote_tag(:url => project_path(project), :html => { :id => dom_id(project, 'edit_form'), :class => "inline-form "+dom_id(project, 'edit_form')+"-edit-project-form", :method => :put }) do -%>
<%# form_remote_tag(:url => project_path(project), :html => { :id => dom_id(project, 'edit_form'), :class => "inline-form "+dom_id(project, 'edit_form')+"-edit-project-form", :method => :put }) do -%>
<div id="error_status"><%= error_messages_for("project") %></div>
<%= source_view_tag( @source_view ) -%>
@ -40,5 +40,5 @@ project = project_form
</div>
<br/><br/>
<% end -%>
<%# end -%>

View file

@ -14,8 +14,9 @@
<% else -%>
'<%= project.default_tags -%>' as the default tags.
<% end -%>
<%= link_to_remote(
"Edit Project Settings",
<a class ="project_edit_settings" id="link_edit_<%=dom_id(project)-%>" href="<%=url_for(:controller => 'projects', :action => 'edit', :id => project.id)%>">Edit Project Settings</a>
<%#= link_to_remote(
"",
:url => {:controller => 'projects', :action => 'edit', :id => project.id},
:method => 'get',
:with => "'_source_view=#{@source_view}'",

View file

@ -0,0 +1,11 @@
newHtml = "<%= escape_javascript(render(:partial => 'project_form', :locals => { :project_form => @project })) %>"
$('div#<%=dom_id(@project, 'edit')%>').html(newHtml);
$('div#<%=dom_id(@project)%>').hide();
$('div#<%=dom_id(@project, 'edit')%>').show();
$('input.project-name').focus();
<%#*page[dom_id(@project, 'edit')].replace_html :partial => 'project_form', :locals => { :project_form => @project }%>
<%#*page[@project].hide%>
<%#*page[dom_id(@project, 'edit')].show%>
<%#*page[dom_id(@project, 'edit_form')].find('input.project-name').focus%>

View file

@ -1,4 +0,0 @@
page[dom_id(@project, 'edit')].replace_html :partial => 'project_form', :locals => { :project_form => @project }
page[@project].hide
page[dom_id(@project, 'edit')].show
page[dom_id(@project, 'edit_form')].find('input.project-name').focus