Skip to content

Commit

Permalink
Removed elements animate nicely, still figuring out how to animate ad…
Browse files Browse the repository at this point in the history
…ded form elements. Need to figure out how to place the various nested item errors.
  • Loading branch information
tumes committed Feb 26, 2011
1 parent 2fdf67d commit 59ac6f6
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
@@ -1,3 +1,3 @@
class ApplicationController < ActionController::Base
protect_from_forgery

end
3 changes: 3 additions & 0 deletions app/helpers/application_helper.rb
@@ -1,2 +1,5 @@
module ApplicationHelper
def title(page_title)
content_for(:title) { page_title }
end
end
3 changes: 3 additions & 0 deletions app/helpers/instruments_helper.rb
@@ -1,2 +1,5 @@
module InstrumentsHelper
def title(page_title)
content_for(:title) { page_title }
end
end
3 changes: 3 additions & 0 deletions app/helpers/pages_helper.rb
@@ -1,2 +1,5 @@
module PagesHelper
def title(page_title)
content_for(:title) { page_title }
end
end
2 changes: 2 additions & 0 deletions app/views/devise/registrations/new.html.haml
@@ -1,3 +1,5 @@
- title "New user"

%h1 Sign up
= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
%p
Expand Down
2 changes: 2 additions & 0 deletions app/views/devise/sessions/new.html.haml
@@ -1,3 +1,5 @@
- title "Sign in"

%h1 Sign in
= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
%p
Expand Down
4 changes: 2 additions & 2 deletions app/views/instruments/_analytical_method_fields.html.haml
Expand Up @@ -3,8 +3,8 @@
= f.text_field :name
= link_to_remove_association 'Remove method', f
= f.simple_fields_for :analytes do |analyte|
= render 'analyte_fields', :f => analyte
%br= f.error :analytes
= render 'analyte_fields', :f => analyte
= f.error :analytes
.links{ :id => 'analyte-links' }
= link_to_add_association 'Add analyte', f, :analytes

2 changes: 2 additions & 0 deletions app/views/instruments/edit.html.haml
@@ -1,2 +1,4 @@
- title "Edit instrument"

%h1 Edit instrument #{@instrument.name}
= render :partial => 'instruments/instrument_form'
2 changes: 2 additions & 0 deletions app/views/instruments/index.html.haml
@@ -1,3 +1,5 @@
- title "Instrument index"

%h1 Instrument index

= render @instruments
2 changes: 2 additions & 0 deletions app/views/instruments/new.html.haml
@@ -1,3 +1,5 @@
- title "New instrument"

%h1 New instrument

= render :partial => 'instruments/instrument_form'
Expand Down
3 changes: 1 addition & 2 deletions app/views/layouts/application.html.haml
Expand Up @@ -2,8 +2,7 @@
%html
%head
%meta{ :name => 'viewport', :content => 'width=500'}
%title
/ = title
%title Chromalog | #{ yield(:title) }
= render :partial => 'layouts/stylesheets'
= render :partial => 'layouts/javascript'
%body
Expand Down
2 changes: 2 additions & 0 deletions app/views/pages/home.html.haml
@@ -1,2 +1,4 @@
- title "Home"

%p= link_to "Sign up", new_user_registration_path
%p= link_to "Sign in", new_user_session_path
4 changes: 2 additions & 2 deletions public/javascripts/cocoon.js
Expand Up @@ -15,13 +15,13 @@ $(document).ready(function() {
});

$('.remove_fields.dynamic').live('click', function() {
$(this).closest(".nested-fields").remove();
$(this).closest(".nested-fields").slideUp(200, this.remove);
return false;
});

$('.remove_fields.existing').live('click', function() {
$(this).prev("input[type=hidden]").val("1");
$(this).closest(".nested-fields").hide();
$(this).closest(".nested-fields").slideUp(200, this.hide);
return false;
});

Expand Down

0 comments on commit 59ac6f6

Please sign in to comment.