lib/generators/freeberry/base/templates/views/manage/assets/_collection.html.erb in freeberry-0.2.9 vs lib/generators/freeberry/base/templates/views/manage/assets/_collection.html.erb in freeberry-0.3.0

- old
+ new

@@ -1,9 +1,6 @@ <% unless model.new_record? %> - <% javascript "jquery.fancybox-1.3.2.pack.js" %> - <% stylesheet "fancybox/jquery.fancybox-1.3.2.css" %> - <div class="gray-blocks"> <div style="padding: 20px;" class="bg-bl"> <div style="padding: 0px 0px 15px;" class="gr-title"><%= t('manage.pictures') %></div> <%= content_tag(:div, :id=>"swf_collection_#{model.id}", :class=>"galery") do %> @@ -19,31 +16,17 @@ <%= render :partial=>"/manage/assets/swfscript", :locals=>{:model=>model, :klass=>model.pictures.name } %> <script type='text/javascript'> $(document).ready(function(){ - /*$("div.galery a.fancybox").fancybox({ - 'titleShow' : true, - 'transitionIn' : 'none', - 'transitionOut' : 'none' - });*/ - - $('div.galery a.del').bind("ajax:complete", function(){ - var pid = $(this).attr('href').replace('/manage/assets/', ''); - $('#picture_' + pid).fadeOut(1); - }); - - $("div.galery").sortable({ - revert: true, - update: function(event, ui){ - var data = $('div.galery').sortable('serialize'); - $.ajax({ - url: "<%= sort_manage_assets_path(:klass => model.pictures.name) %>", - data: data, - dataType: 'script', - type: 'POST' - }); - } - }); + Manage.init_assets('div.galery', '<%= sort_manage_assets_path(:klass => model.pictures.name) %>'); }); + </script> + <script id="asset_tmpl" type="text/x-jquery-tmpl"> + <div id="<%= dom_class(model.class.reflections[:pictures].klass) %>_${id}" class="asset ill"> + <%= link_to image_tag("manage/empty.gif", :alt=>t('manage.delete'), :title=>t('manage.delete')), + "/manage/assets/${id}", :remote => true, :method => :delete, :confirm => t('manage.confirm_delete'), :class => "del" %> + + <a class="fancybox" href="${link_path}"><img title="${image_title}" src="${image_path}"></a> + </div> </script> <% end %>