<%= output_errors('', {:class => 'help-box'}, @aggregation) %> <%# TODO Add preview as single feed ie merge everything into a single feed and show that. %>

<%= t('muck.raker.edit_aggregation')%>

<% custom_form_for(@aggregation, :url => polymorphic_url([@parent, @aggregation]), :id => 'update-aggregation-form') do |f| -%> <%= f.text_field :title, { :label => t('muck.raker.add_aggregation_title') } %> <%= f.submit t('muck.general.save'), :id => 'update-aggregation-button' %> <% end -%>

<%= t('muck.raker.add_feed') %>

<% custom_form_for(@aggregation, :url => polymorphic_url([@parent, @aggregation]), :id => 'add-feed-form') do |f| -%> <%= text_field_tag :uri, '', :id => 'add_uri' %> <%= submit_tag t('muck.raker.add_feed'), :id => 'add-feed-button' %> <% end -%>

<%= t('muck.raker.add_opml_to_aggregation')%>

<%= I18n.t('muck.raker.add_sources_by_tag') %>

<% custom_form_for(@aggregation, :url => polymorphic_url([@parent, @aggregation]), :id => 'add-sources-form') do |f| -%> <%= text_field_tag :terms %> <%= f.submit t('muck.raker.add_more_sources'), :id => 'add-sources-button' %>
<%= data_sources(@service_categories) %>
<% end -%>
<%= google_feeds(@feeds, @show_controls, @number_of_items, @number_of_images, @number_of_videos) %>
<%= render :partial => 'google/feeds_scripts' %> <% content_for :javascript do -%> jQuery(document).ready(function() { jQuery("#add-feed-button").click(function() { jQuery('#add-feed-waiting').show(); var form = jQuery(this).parents('form'); jQuery.post(form.attr('action') + '.json', form.serialize(), function(data){ var json = eval('(' + data + ')'); if(json.success && json.feeds.length > 0){ jQuery('#aggregation-feeds').prepend(json.html); } else { <%= jquery_message('#ajax-messages') %> } jQuery('#add-feed-waiting').hide(); }); return false; }); }); <% end -%>