aerogel-media 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +14 -0
  6. data/Rakefile +1 -0
  7. data/aerogel-media.gemspec +26 -0
  8. data/app/helpers/README.md +7 -0
  9. data/app/helpers/image_tag.rb +26 -0
  10. data/app/routes/README.md +7 -0
  11. data/assets/README.md +1 -0
  12. data/assets/javascripts/aerogel-media.js.coffee +4 -0
  13. data/assets/javascripts/aerogel-media/enable-fancybox.js.coffee +36 -0
  14. data/assets/javascripts/aerogel-media/smart-file-input.js.coffee +132 -0
  15. data/assets/stylesheets/aerogel-media.css.scss +2 -0
  16. data/assets/stylesheets/aerogel-media/smart-file-input.css.scss +12 -0
  17. data/assets/vendor/fancybox2.css.scss +1 -0
  18. data/assets/vendor/fancybox2.js.coffee +1 -0
  19. data/assets/vendor/fancybox2/blank.gif +0 -0
  20. data/assets/vendor/fancybox2/fancybox_loading.gif +0 -0
  21. data/assets/vendor/fancybox2/fancybox_loading@2x.gif +0 -0
  22. data/assets/vendor/fancybox2/fancybox_overlay.png +0 -0
  23. data/assets/vendor/fancybox2/fancybox_sprite.png +0 -0
  24. data/assets/vendor/fancybox2/fancybox_sprite@2x.png +0 -0
  25. data/assets/vendor/fancybox2/helpers/fancybox_buttons.png +0 -0
  26. data/assets/vendor/fancybox2/helpers/jquery.fancybox-buttons.css +97 -0
  27. data/assets/vendor/fancybox2/helpers/jquery.fancybox-buttons.js +122 -0
  28. data/assets/vendor/fancybox2/helpers/jquery.fancybox-media.js +199 -0
  29. data/assets/vendor/fancybox2/helpers/jquery.fancybox-thumbs.css +55 -0
  30. data/assets/vendor/fancybox2/helpers/jquery.fancybox-thumbs.js +162 -0
  31. data/assets/vendor/fancybox2/jquery.fancybox.css +274 -0
  32. data/assets/vendor/fancybox2/jquery.fancybox.js +2020 -0
  33. data/assets/vendor/fancybox2/jquery.fancybox.pack.js +46 -0
  34. data/config/README.md +3 -0
  35. data/config/development/.keep +0 -0
  36. data/config/production/.keep +0 -0
  37. data/db/model/README.md +1 -0
  38. data/db/seed/README.md +1 -0
  39. data/db/seed/development/.keep +0 -0
  40. data/db/seed/production/.keep +0 -0
  41. data/db/seed/seed.template +42 -0
  42. data/lib/aerogel/media.rb +19 -0
  43. data/lib/aerogel/media/core.rb +46 -0
  44. data/lib/aerogel/media/field_types.rb +61 -0
  45. data/lib/aerogel/media/model.rb +60 -0
  46. data/lib/aerogel/media/uploaded_file.rb +15 -0
  47. data/lib/aerogel/media/version.rb +5 -0
  48. data/locales/aerogel-forms.en.yml +8 -0
  49. data/locales/aerogel-forms.ru.yml +8 -0
  50. data/locales/models.en.yml +14 -0
  51. data/locales/models.ru.yml +13 -0
  52. data/public/README.md +1 -0
  53. data/rake/README.md +3 -0
  54. data/views/README.md +1 -0
  55. data/views/form_builder/standard/field_media-file.erb +48 -0
  56. data/views/form_builder/standard/field_media-image.erb +50 -0
  57. metadata +155 -0
@@ -0,0 +1,46 @@
1
+ /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,
3
+ width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
4
+ keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
5
+ (I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
6
+ openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
7
+ isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
8
+ c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
9
+ k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
10
+ b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
11
+ setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;
12
+ d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=
13
+ a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),
14
+ b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),
15
+ y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;
16
+ if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
17
+ (h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,
18
+ {},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,
19
+ mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=
20
+ !0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");
21
+ "image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=
22
+ this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);
23
+ f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,
24
+ e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,
25
+ outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}",
26
+ g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll":
27
+ "no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?
28
+ h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth||
29
+ h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&
30
+ "iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width();
31
+ y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&&
32
+ !a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),
33
+ b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
34
+ a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
35
+ (c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
36
+ f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
37
+ {duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
38
+ b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=
39
+ f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?
40
+ b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),
41
+ p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===
42
+ f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=
43
+ b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,
44
+ e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+
45
+ ":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===
46
+ d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);
@@ -0,0 +1,3 @@
1
+ A place for your ```*.conf``` files.
2
+
3
+ Environment specific configs go into folders 'production' or 'development'.
File without changes
File without changes
@@ -0,0 +1 @@
1
+ A place for your models.
@@ -0,0 +1 @@
1
+ A place for *.seed files.
File without changes
File without changes
@@ -0,0 +1,42 @@
1
+ # A .seed file is a .conf file which stores
2
+ # database seed data and rules.
3
+ #
4
+
5
+ # Model class to use
6
+ #
7
+ # ! required
8
+ model Setting
9
+
10
+ # Attribute name or a list of attribute names to be used as key(s)
11
+ # when finding objects
12
+ #
13
+ # Usage:
14
+ # find_by :name
15
+ # or
16
+ # find_by [:first_name, :last_name]
17
+ #
18
+ # ! required
19
+ find_by :name
20
+
21
+ # Values of attributes listed here will be set even
22
+ # if they exist already in the matching database object.
23
+ #
24
+ # Other attributes in the seed data will be treated as a default value,
25
+ # i.e. they will only be set if the matching database object does not exist
26
+ # or its corresponding attribute is not set.
27
+ #
28
+ # Usage:
29
+ # force :value
30
+ # or:
31
+ # force [:value, :description]
32
+ #
33
+ # default is: no fields are forced
34
+ force :value
35
+
36
+ seeds [
37
+ { name: 'abc', value: '123' },
38
+ { name: 'def', value: '456' },
39
+ { name: 'ghi', value: '789' },
40
+ { name: 'abcdef', value: '123456' }
41
+ ]
42
+
@@ -0,0 +1,19 @@
1
+ require 'aerogel/core'
2
+ require 'aerogel/media/version'
3
+ require 'aerogel/media/core'
4
+ require 'aerogel/media/field_types'
5
+ require 'aerogel/media/model'
6
+ require 'aerogel/media/uploaded_file'
7
+ # require 'aerogel/media/dragonfly_attachment'
8
+
9
+ module Aerogel
10
+
11
+ # Finally, register module's root folder
12
+ register_path File.join( File.dirname(__FILE__), '..', '..' )
13
+
14
+ # configure module
15
+ on_load do |app|
16
+ app.register Aerogel::Media
17
+ end
18
+
19
+ end
@@ -0,0 +1,46 @@
1
+ require 'dragonfly'
2
+ require 'dragonfly/model/validations'
3
+
4
+ module Aerogel::Media
5
+
6
+ # Configures module Aerogel::Media
7
+ #
8
+ def self.registered(app)
9
+
10
+ Dragonfly.app(:image).configure do
11
+ plugin :imagemagick
12
+ url_format '/media/images/:job/:basename.:ext'
13
+ datastore :file, root_path: "media"
14
+
15
+ # Returns human readable description of an attachment
16
+ #
17
+ define :description do
18
+ file_name = name.present? ? name : ''
19
+ "#{file_name} @ #{width}x#{height}, #{Aerogel::I18n.number_to_human_size size}"
20
+ end
21
+ end
22
+
23
+ Dragonfly.app(:file).configure do
24
+ url_format '/media/files/:job/:basename.:ext'
25
+ datastore :file, root_path: "media"
26
+
27
+ # Force any file to download
28
+ response_header 'Content-Disposition' do |job, request, headers|
29
+ "attachment; "+headers['Content-Disposition']
30
+ end
31
+
32
+ # Returns human readable description of an attachment
33
+ #
34
+ define :description do
35
+ file_name = name.present? ? name : ''
36
+ "#{file_name} @ #{Aerogel::I18n.number_to_human_size size}"
37
+ end
38
+ end
39
+
40
+ app.use Dragonfly::Middleware, :image
41
+ app.use Dragonfly::Middleware, :file
42
+
43
+ end
44
+
45
+ end # module Aerogel::Media
46
+
@@ -0,0 +1,61 @@
1
+ #
2
+ # Custom field types for Model#field ..., type: ...
3
+ #
4
+
5
+ module Media
6
+
7
+ class File
8
+ attr_accessor :uid, :name
9
+
10
+ def initialize( mongoid_value )
11
+ case mongoid_value
12
+ when nil
13
+ @uid, @name = nil, nil
14
+ when Array
15
+ @uid, @name = mongoid_value[0], mongoid_value[1]
16
+ when Hash
17
+ @uid, @name = mongoid_value[:uid], mongoid_value[:name]
18
+ when Media::File
19
+ @uid, @name = mongoid_value.uid, mongoid_value.name
20
+ else
21
+ raise ArgumentError.new "Failed to create Media::File value from #{mongoid_value.class}"
22
+ end
23
+ end
24
+
25
+ # Converts an object of this instance into a database friendly value.
26
+ def mongoize
27
+ (uid.nil? && name.nil?) ? nil : [ uid, name ]
28
+ end
29
+
30
+ class << self
31
+ # Get the object as it was stored in the database, and instantiate
32
+ # this custom class from it.
33
+ def demongoize( object )
34
+ object.nil? ? nil : Media::File.new( object )
35
+ end
36
+
37
+ # Takes any possible object and converts it to how it would be
38
+ # stored in the database.
39
+ def mongoize( object )
40
+ Media::File.new(object).mongoize
41
+ end
42
+
43
+ # Converts the object that was supplied to a criteria and converts it
44
+ # into a database friendly form.
45
+ def evolve( object )
46
+ case object
47
+ when Media::File then object.mongoize
48
+ else
49
+ object
50
+ end
51
+ end
52
+ end # class << self
53
+
54
+ end # class File
55
+
56
+ class Image < File
57
+ MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif']
58
+ # definitions here
59
+ end # class Image
60
+
61
+ end # module Media
@@ -0,0 +1,60 @@
1
+ module Model
2
+
3
+ define_field_type Media::File, :define_field_media_file
4
+ define_field_type Media::Image, :define_field_media_image
5
+
6
+ module ClassMethods
7
+
8
+ def define_field_media_file( name, opts = {} )
9
+
10
+ opts = {
11
+ # defaults
12
+ app: :file
13
+ }.deep_merge opts
14
+
15
+ unless self.respond_to? :dragonfly_accessor
16
+ extend Dragonfly::Model
17
+ extend Dragonfly::Model::Validations
18
+ end
19
+
20
+ type = opts[:type]
21
+ define_field_mongoid name, type: type
22
+
23
+ define_method "#{name}_uid" do
24
+ type.new( self[name] ).uid
25
+ end
26
+
27
+ define_method "#{name}_uid=" do |value|
28
+ self[name] = ( type.new( self[name] ).tap {|f| f.uid = value } ).mongoize
29
+ value
30
+ end
31
+
32
+ define_method "#{name}_name" do
33
+ type.new( self[name] ).name
34
+ end
35
+
36
+ define_method "#{name}_name=" do |value|
37
+ self[name] = ( type.new( self[name] ).tap {|f| f.name = value } ).mongoize
38
+ value
39
+ end
40
+
41
+ dragonfly_accessor name, app: opts[:app]
42
+
43
+ alias_method :"dragonfly_accessor_#{name}=", :"#{name}="
44
+ define_method "#{name}=" do |value|
45
+ if Hash === value && value.key?(:tempfile) && value.key?( :filename )
46
+ self.send :"dragonfly_accessor_#{name}=", Aerogel::Media::UploadedFile.new( value )
47
+ else
48
+ self.send :"dragonfly_accessor_#{name}=", value
49
+ end
50
+ end
51
+ end
52
+
53
+ def define_field_media_image( name, opts = {} )
54
+ define_field_media_file name, { app: :image }.merge(opts)
55
+ validates_property :mime_type, of: name, in: Media::Image::MIME_TYPES, message: :not_an_image
56
+ end
57
+
58
+ end # module ClassMethods
59
+
60
+ end # module Model
@@ -0,0 +1,15 @@
1
+ module Aerogel::Media
2
+
3
+ class UploadedFile
4
+ attr_accessor :tempfile, :original_filename, :params
5
+
6
+ # Parses Rack params hash for uploaded file
7
+ #
8
+ def initialize( params )
9
+ self.params = params
10
+ self.tempfile = params[:tempfile]
11
+ self.original_filename = params[:filename]
12
+ end
13
+
14
+ end # class UploadedFile
15
+ end # module Aerogel::Media
@@ -0,0 +1,5 @@
1
+ module Aerogel
2
+ module Media
3
+ VERSION = "1.4.0"
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ en:
2
+ aerogel:
3
+ forms:
4
+ file:
5
+ empty: "no file selected"
6
+ select: "Choose file..."
7
+ change: "Change"
8
+ remove: "Remove"
@@ -0,0 +1,8 @@
1
+ ru:
2
+ aerogel:
3
+ forms:
4
+ file:
5
+ empty: "файл не выбран"
6
+ select: "Выбрать файл..."
7
+ change: "Изменить"
8
+ remove: "Удалить"
@@ -0,0 +1,14 @@
1
+ en:
2
+ errors:
3
+ messages:
4
+ not_an_image: "has invalid file type, an image file is expected"
5
+ mongoid:
6
+ errors:
7
+ not_an_image:
8
+
9
+ models:
10
+ model123: Model 123
11
+
12
+ attributes:
13
+ 'module123/model123':
14
+ attr1: Attr 1
@@ -0,0 +1,13 @@
1
+ ru:
2
+ errors:
3
+ messages:
4
+ not_an_image: "имеет неправильный тип файла, необходим файл изображения"
5
+
6
+ mongoid:
7
+
8
+ models:
9
+ model123: Модель 123
10
+
11
+ attributes:
12
+ 'module123/model123':
13
+ attr1: Аттр 1
@@ -0,0 +1 @@
1
+ A place for static files.
@@ -0,0 +1,3 @@
1
+ A place for module rake tasks.
2
+
3
+ *.rake files found in this folder are included into an end application's Rakefile
@@ -0,0 +1 @@
1
+ A place for module views.
@@ -0,0 +1,48 @@
1
+ <label for="<%= field.css_id %>"><%= field.label -%>
2
+ <% if field.required? -%> <abbr class="required" title="<%= t 'aerogel.forms.required' %>">*</abbr>
3
+ <% end -%>
4
+ </label>
5
+
6
+ <div class="smart-file-input">
7
+ <%= tag :input, type: :hidden,
8
+ name: field.html_name("retained_#{field.name}"),
9
+ value: field.data_object.send(:"retained_#{field.name}")
10
+ %>
11
+ <%= tag :input, type: :hidden,
12
+ name: field.html_name("remove_#{field.name}"),
13
+ class: "file-remove-field"
14
+ %>
15
+ <input id="<%= field.css_id %>" type="file" name="<%= field.html_name %>" <%= field.html_params %> />
16
+
17
+ <div class="file-empty">
18
+ <div>
19
+ <span class="file-label"><i><%= t.aerogel.forms.file.empty %></i></span>
20
+ </div>
21
+ <span class="btn btn-default btn-sm btn-file-select">
22
+ <%= t.aerogel.forms.file.select %>
23
+ </span>
24
+ </div>
25
+ <div class="file-exists">
26
+
27
+ <% if field.value %>
28
+ <div class="file-old">
29
+ <%= icon 'fa-file-o fa-2x', style: 'vertical-align: middle' %>
30
+ <span class="file-label"><%= link_to field.value.url, field.value.try(:description) %></span>
31
+ </div>
32
+ <% end %>
33
+
34
+ <div class="file-new">
35
+ <%= icon 'fa-file-o fa-2x', style: 'vertical-align: middle' %>
36
+ <span class="file-label"></span>
37
+ </div>
38
+ <span class="btn btn-default btn-sm btn-file-change">
39
+ <%= t.aerogel.forms.file.change %>
40
+ </span>
41
+ <span class="btn btn-default btn-sm btn-file-remove">
42
+ <%= t.aerogel.forms.file.remove %>
43
+ </span>
44
+ </div>
45
+ </div>
46
+
47
+ <% field.form_object.options[:multipart] = true %>
48
+
@@ -0,0 +1,50 @@
1
+ <label for="<%= field.css_id %>"><%= field.label -%>
2
+ <% if field.required? -%> <abbr class="required" title="<%= t 'aerogel.forms.required' %>">*</abbr>
3
+ <% end -%>
4
+ </label>
5
+
6
+ <div class="smart-file-input">
7
+ <%= tag :input, type: :hidden,
8
+ name: field.html_name("retained_#{field.name}"),
9
+ value: field.data_object.send(:"retained_#{field.name}")
10
+ %>
11
+ <%= tag :input, type: :hidden,
12
+ name: field.html_name("remove_#{field.name}"),
13
+ class: "file-remove-field"
14
+ %>
15
+ <input id="<%= field.css_id %>" type="file" name="<%= field.html_name %>" <%= field.html_params %> />
16
+
17
+ <div class="file-empty">
18
+ <div>
19
+ <span class="file-label"><i><%= t.aerogel.forms.file.empty %></i></span>
20
+ </div>
21
+ <span class="btn btn-default btn-sm btn-file-select">
22
+ <%= t.aerogel.forms.file.select %>
23
+ </span>
24
+ </div>
25
+ <div class="file-exists">
26
+
27
+ <% if field.value %>
28
+ <div class="file-old">
29
+ <%= image_thumb_tag field.value, 'x'+( field.options[:height] ? field.options[:height] : '100' ) %>
30
+ <br/>
31
+ <span class="file-label"><%= field.value.try(:description) %></span>
32
+ </div>
33
+ <% end %>
34
+
35
+ <div class="file-new">
36
+ <img class="file-preview fancybox"
37
+ height="<%= field.options[:height] ? field.options[:height] : '100' %>" /><br/>
38
+ <span class="file-label"></span>
39
+ </div>
40
+ <span class="btn btn-default btn-sm btn-file-change">
41
+ <%= t.aerogel.forms.file.change %>
42
+ </span>
43
+ <span class="btn btn-default btn-sm btn-file-remove">
44
+ <%= t.aerogel.forms.file.remove %>
45
+ </span>
46
+ </div>
47
+ </div>
48
+
49
+ <% field.form_object.options[:multipart] = true %>
50
+