refinerycms-videos 1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/colorbox/border.png +0 -0
- data/app/assets/images/colorbox/controls.png +0 -0
- data/app/assets/images/colorbox/ie6/borderBottomCenter.png +0 -0
- data/app/assets/images/colorbox/ie6/borderBottomLeft.png +0 -0
- data/app/assets/images/colorbox/ie6/borderBottomRight.png +0 -0
- data/app/assets/images/colorbox/ie6/borderMiddleLeft.png +0 -0
- data/app/assets/images/colorbox/ie6/borderMiddleRight.png +0 -0
- data/app/assets/images/colorbox/ie6/borderTopCenter.png +0 -0
- data/app/assets/images/colorbox/ie6/borderTopLeft.png +0 -0
- data/app/assets/images/colorbox/ie6/borderTopRight.png +0 -0
- data/app/assets/images/colorbox/loading.gif +0 -0
- data/app/assets/images/colorbox/loading_background.png +0 -0
- data/app/assets/images/colorbox/overlay.png +0 -0
- data/app/assets/images/video_play.png +0 -0
- data/app/assets/javascripts/jquery.colorbox-min.js +4 -0
- data/app/assets/javascripts/jquery.refinerycms-videos.js +18 -0
- data/app/assets/stylesheets/colorbox.css +82 -0
- data/app/controllers/refinery/videos/admin/videos_controller.rb +12 -0
- data/app/controllers/refinery/videos/videos_controller.rb +26 -0
- data/app/models/refinery/videos/video.rb +12 -0
- data/app/views/refinery/videos/admin/videos/_actions.html.erb +25 -0
- data/app/views/{admin → refinery/videos/admin}/videos/_form.html.erb +13 -14
- data/app/views/refinery/videos/admin/videos/_records.html.erb +18 -0
- data/app/views/refinery/videos/admin/videos/_sortable_list.html.erb +5 -0
- data/app/views/refinery/videos/admin/videos/_video.html.erb +20 -0
- data/app/views/refinery/videos/admin/videos/_videos.html.erb +2 -0
- data/app/views/refinery/videos/admin/videos/edit.html.erb +1 -0
- data/app/views/refinery/videos/admin/videos/index.html.erb +7 -0
- data/app/views/refinery/videos/admin/videos/new.html.erb +1 -0
- data/app/views/refinery/videos/videos/index.html.erb +15 -0
- data/config/locales/en.yml +27 -23
- data/config/locales/es.yml +30 -0
- data/config/locales/fr.yml +27 -23
- data/config/locales/nb.yml +27 -19
- data/config/locales/nl.yml +27 -19
- data/config/routes.rb +19 -11
- data/db/migrate/1_create_videos_videos.rb +28 -0
- data/db/seeds.rb +21 -0
- data/lib/generators/refinery/videos_generator.rb +18 -0
- data/lib/refinery/videos/engine.rb +27 -0
- data/lib/refinery/videos.rb +21 -0
- data/lib/refinerycms-videos.rb +1 -21
- data/lib/tasks/{videos.rake → refinery/videos.rake} +5 -5
- data/readme.md +31 -0
- metadata +78 -25
- data/app/controllers/admin/videos_controller.rb +0 -8
- data/app/controllers/videos_controller.rb +0 -19
- data/app/models/video.rb +0 -8
- data/app/views/admin/videos/_actions.html.erb +0 -28
- data/app/views/admin/videos/_records.html.erb +0 -18
- data/app/views/admin/videos/_sortable_list.html.erb +0 -7
- data/app/views/admin/videos/_video.html.erb +0 -15
- data/app/views/admin/videos/_videos.html.erb +0 -2
- data/app/views/admin/videos/edit.html.erb +0 -1
- data/app/views/admin/videos/index.html.erb +0 -10
- data/app/views/admin/videos/new.html.erb +0 -1
- data/app/views/shared/_video.html.erb +0 -5
- data/app/views/videos/index.html.erb +0 -15
- data/config/locales/lolcat.yml +0 -25
- data/lib/generators/refinerycms_videos_generator.rb +0 -6
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,4 @@
|
|
1
|
+
// ColorBox v1.3.17.1 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
|
2
|
+
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
|
3
|
+
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
|
4
|
+
(function(a,b,c){function bc(b){if(!T){O=b,_(a.extend(J,a.data(O,e))),x=a(O),P=0,J.rel!=="nofollow"&&(x=a("."+X).filter(function(){var b=a.data(this,e).rel||this.rel;return b===J.rel}),P=x.index(O),P===-1&&(x=x.add(O),P=x.length-1));if(!R){R=S=!0,q.show();if(J.returnFocus)try{O.blur(),a(O).one(k,function(){try{this.focus()}catch(a){}})}catch(c){}p.css({opacity:+J.opacity,cursor:J.overlayClose?"pointer":"auto"}).show(),J.w=Z(J.initialWidth,"x"),J.h=Z(J.initialHeight,"y"),W.position(0),n&&y.bind("resize."+o+" scroll."+o,function(){p.css({width:y.width(),height:y.height(),top:y.scrollTop(),left:y.scrollLeft()})}).trigger("resize."+o),ba(g,J.onOpen),I.add(C).hide(),H.html(J.close).show()}W.load(!0)}}function bb(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;J.slideshow&&x[1]?(d=function(){E.text(J.slideshowStop).unbind(c).bind(i,function(){if(P<x.length-1||J.loop)a=setTimeout(W.next,J.slideshowSpeed)}).bind(h,function(){clearTimeout(a)}).one(c+" "+j,e),q.removeClass(b+"off").addClass(b+"on"),a=setTimeout(W.next,J.slideshowSpeed)},e=function(){clearTimeout(a),E.text(J.slideshowStart).unbind([i,h,j,c].join(" ")).one(c,d),q.removeClass(b+"on").addClass(b+"off")},J.slideshowAuto?d():e()):q.removeClass(b+"off "+b+"on")}function ba(b,c){c&&c.call(O),a.event.trigger(b)}function _(b){for(var c in b)a.isFunction(b[c])&&c.substring(0,2)!=="on"&&(b[c]=b[c].call(O));b.rel=b.rel||O.rel||"nofollow",b.href=b.href||a(O).attr("href"),b.title=b.title||O.title,typeof b.href=="string"&&(b.href=a.trim(b.href))}function $(a){return J.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function Z(a,b){b=b==="x"?y.width():y.height();return typeof a=="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function Y(c,d){var e=b.createElement("div");c&&(e.id=f+c),e.style.cssText=d||"";return a(e)}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:!1},e="colorbox",f="cbox",g=f+"_open",h=f+"_load",i=f+"_complete",j=f+"_cleanup",k=f+"_closed",l=f+"_purge",m=a.browser.msie&&!a.support.opacity,n=m&&a.browser.version<7,o=f+"_IE6",p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J={},K,L,M,N,O,P,Q,R,S,T,U,V,W,X=f+"Element";W=a.fn[e]=a[e]=function(b,c){var f=this,g;if(!f[0]&&f.selector)return f;b=b||{},c&&(b.onComplete=c);if(!f[0]||f.selector===undefined)f=a("<a/>"),b.open=!0;f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(X)}),g=b.open,a.isFunction(g)&&(g=g.call(f)),g&&bc(f[0]);return f},W.init=function(){y=a(c),q=Y().attr({id:e,"class":m?f+(n?"IE6":"IE"):""}),p=Y("Overlay",n?"position:absolute":"").hide(),r=Y("Wrapper"),s=Y("Content").append(z=Y("LoadedContent","width:0; height:0; overflow:hidden"),B=Y("LoadingOverlay").add(Y("LoadingGraphic")),C=Y("Title"),D=Y("Current"),F=Y("Next"),G=Y("Previous"),E=Y("Slideshow").bind(g,bb),H=Y("Close")),r.append(Y().append(Y("TopLeft"),t=Y("TopCenter"),Y("TopRight")),Y(!1,"clear:left").append(u=Y("MiddleLeft"),s,v=Y("MiddleRight")),Y(!1,"clear:left").append(Y("BottomLeft"),w=Y("BottomCenter"),Y("BottomRight"))).children().children().css({"float":"left"}),A=Y(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(p,q.append(r,A)),s.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),K=t.height()+w.height()+s.outerHeight(!0)-s.height(),L=u.width()+v.width()+s.outerWidth(!0)-s.width(),M=z.outerHeight(!0),N=z.outerWidth(!0),q.css({"padding-bottom":K,"padding-right":L}).hide(),F.click(function(){W.next()}),G.click(function(){W.prev()}),H.click(function(){W.close()}),I=F.add(G).add(D).add(E),s.children().removeClass("hover"),p.click(function(){J.overlayClose&&W.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;R&&J.escKey&&b===27&&(a.preventDefault(),W.close()),R&&J.arrowKey&&x[1]&&(b===37?(a.preventDefault(),G.click()):b===39&&(a.preventDefault(),F.click()))})},W.remove=function(){q.add(p).remove(),a("."+X).removeData(e).removeClass(X)},W.position=function(a,c){function g(a){t[0].style.width=w[0].style.width=s[0].style.width=a.style.width,B[0].style.height=B[1].style.height=s[0].style.height=u[0].style.height=v[0].style.height=a.style.height}var d,e=0,f=0;q.hide(),J.fixed&&!n?q.css({position:"fixed"}):(e=y.scrollTop(),f=y.scrollLeft(),q.css({position:"absolute"})),J.right!==!1?f+=Math.max(y.width()-J.w-N-L-Z(J.right,"x"),0):J.left!==!1?f+=Z(J.left,"x"):f+=Math.max(y.width()-J.w-N-L,0)/2,J.bottom!==!1?e+=Math.max(b.documentElement.clientHeight-J.h-M-K-Z(J.bottom,"y"),0):J.top!==!1?e+=Z(J.top,"y"):e+=Math.max(b.documentElement.clientHeight-J.h-M-K,0)/2,q.show(),d=q.width()===J.w+N&&q.height()===J.h+M?0:a,r[0].style.width=r[0].style.height="9999px",q.dequeue().animate({width:J.w+N,height:J.h+M,top:e,left:f},{duration:d,complete:function(){g(this),S=!1,r[0].style.width=J.w+N+L+"px",r[0].style.height=J.h+M+K+"px",c&&c()},step:function(){g(this)}})},W.resize=function(a){if(R){a=a||{},a.width&&(J.w=Z(a.width,"x")-N-L),a.innerWidth&&(J.w=Z(a.innerWidth,"x")),z.css({width:J.w}),a.height&&(J.h=Z(a.height,"y")-M-K),a.innerHeight&&(J.h=Z(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=z.wrapInner("<div style='overflow:auto'></div>").children();J.h=b.height(),b.replaceWith(b.children())}z.css({height:J.h}),W.position(J.transition==="none"?0:J.speed)}},W.prep=function(b){function h(b){W.position(b,function(){function o(){m&&q[0].style.removeAttribute("filter")}var b,d,g,h,j=x.length,k,n;!R||(n=function(){clearTimeout(V),B.hide(),ba(i,J.onComplete)},m&&Q&&z.fadeIn(100),C.html(J.title).add(z).show(),j>1?(typeof J.current=="string"&&D.html(J.current.replace(/\{current\}/,P+1).replace(/\{total\}/,j)).show(),F[J.loop||P<j-1?"show":"hide"]().html(J.next),G[J.loop||P?"show":"hide"]().html(J.previous),b=P?x[P-1]:x[j-1],g=P<j-1?x[P+1]:x[0],J.slideshow&&E.show(),J.preloading&&(h=a.data(g,e).href||g.href,d=a.data(b,e).href||b.href,h=a.isFunction(h)?h.call(g):h,d=a.isFunction(d)?d.call(b):d,$(h)&&(a("<img/>")[0].src=h),$(d)&&(a("<img/>")[0].src=d))):I.hide(),J.iframe?(k=a("<iframe/>").addClass(f+"Iframe")[0],J.fastIframe?n():a(k).one("load",n),k.name=f+ +(new Date),k.src=J.href,J.scrolling||(k.scrolling="no"),m&&(k.frameBorder=0,k.allowTransparency="true"),a(k).appendTo(z).one(l,function(){k.src="//about:blank"})):n(),J.transition==="fade"?q.fadeTo(c,1,o):o(),y.bind("resize."+f,function(){W.position(0)}))})}function g(){J.h=J.h||z.height(),J.h=J.mh&&J.mh<J.h?J.mh:J.h;return J.h}function d(){J.w=J.w||z.width(),J.w=J.mw&&J.mw<J.w?J.mw:J.w;return J.w}if(!!R){var c=J.transition==="none"?0:J.speed;y.unbind("resize."+f),z.remove(),z=Y("LoadedContent").html(b),z.hide().appendTo(A.show()).css({width:d(),overflow:J.scrolling?"auto":"hidden"}).css({height:g()}).prependTo(s),A.hide(),a(Q).css({"float":"none"}),n&&a("select").not(q.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(j,function(){this.style.visibility="inherit"}),J.transition==="fade"?q.fadeTo(c,0,function(){h(0)}):h(c)}},W.load=function(b){var c,d,g=W.prep;S=!0,Q=!1,O=x[P],b||_(a.extend(J,a.data(O,e))),ba(l),ba(h,J.onLoad),J.h=J.height?Z(J.height,"y")-M-K:J.innerHeight&&Z(J.innerHeight,"y"),J.w=J.width?Z(J.width,"x")-N-L:J.innerWidth&&Z(J.innerWidth,"x"),J.mw=J.w,J.mh=J.h,J.maxWidth&&(J.mw=Z(J.maxWidth,"x")-N-L,J.mw=J.w&&J.w<J.mw?J.w:J.mw),J.maxHeight&&(J.mh=Z(J.maxHeight,"y")-M-K,J.mh=J.h&&J.h<J.mh?J.h:J.mh),c=J.href,V=setTimeout(function(){B.show()},100),J.inline?(Y().hide().insertBefore(a(c)[0]).one(l,function(){a(this).replaceWith(z.children())}),g(a(c))):J.iframe?g(" "):J.html?g(J.html):$(c)?(a(Q=new Image).addClass(f+"Photo").error(function(){J.title=!1,g(Y("Error").text("This image could not be loaded"))}).load(function(){var a;Q.onload=null,J.scalePhotos&&(d=function(){Q.height-=Q.height*a,Q.width-=Q.width*a},J.mw&&Q.width>J.mw&&(a=(Q.width-J.mw)/Q.width,d()),J.mh&&Q.height>J.mh&&(a=(Q.height-J.mh)/Q.height,d())),J.h&&(Q.style.marginTop=Math.max(J.h-Q.height,0)/2+"px"),x[1]&&(P<x.length-1||J.loop)&&(Q.style.cursor="pointer",Q.onclick=function(){W.next()}),m&&(Q.style.msInterpolationMode="bicubic"),setTimeout(function(){g(Q)},1)}),setTimeout(function(){Q.src=c},1)):c&&A.load(c,J.data,function(b,c,d){g(c==="error"?Y("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},W.next=function(){!S&&x[1]&&(P<x.length-1||J.loop)&&(P=P<x.length-1?P+1:0,W.load())},W.prev=function(){!S&&x[1]&&(P||J.loop)&&(P=P?P-1:x.length-1,W.load())},W.close=function(){R&&!T&&(T=!0,R=!1,ba(j,J.onCleanup),y.unbind("."+f+" ."+o),p.fadeTo(200,0),q.stop().fadeTo(300,0,function(){q.add(p).css({opacity:1,cursor:"auto"}).hide(),ba(l),z.remove(),setTimeout(function(){T=!1,ba(k,J.onClosed)},1)}))},W.element=function(){return a(O)},W.settings=d,U=function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),bc(this))},a.fn.delegate?a(b).delegate("."+X,"click",U):a("."+X).live("click",U),a(W.init)})(jQuery,document,this)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// JavaScript Document
|
2
|
+
|
3
|
+
$(document).ready(function() {
|
4
|
+
|
5
|
+
$(".tilevideo a.ytlink").each(function(index) {
|
6
|
+
if ($(this).attr("complete") != "true") {
|
7
|
+
var str = $(this).attr("href");
|
8
|
+
var ytid = str.substring(str.lastIndexOf("/") + 1, str.length);
|
9
|
+
str = "http://www.youtube.com/embed/" + ytid + "?rel=0";
|
10
|
+
$(this).attr("href", str);
|
11
|
+
$(this).attr("complete", "true");
|
12
|
+
$(this).html($(this).html() + "<div class='ytvid_img'><img src='http://img.youtube.com/vi/" + ytid + "/0.jpg' width='290' /></div><img src='/images/video_play.png' class='pic_bg' />")
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
$(".tilevideo a").colorbox({iframe:true, innerWidth:640, innerHeight:390, transition:"elastic", opacity:"0.6"});
|
17
|
+
|
18
|
+
});
|
@@ -0,0 +1,82 @@
|
|
1
|
+
/*
|
2
|
+
ColorBox Core Style:
|
3
|
+
The following CSS is consistent between example themes and should not be altered.
|
4
|
+
*/
|
5
|
+
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
|
6
|
+
#cboxOverlay{position:fixed; width:100%; height:100%;}
|
7
|
+
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
|
8
|
+
#cboxContent{position:relative;}
|
9
|
+
#cboxLoadedContent{overflow:auto;}
|
10
|
+
#cboxTitle{margin:0;}
|
11
|
+
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
|
12
|
+
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
|
13
|
+
.cboxPhoto{float:left; margin:auto; border:0; display:block;}
|
14
|
+
.cboxIframe{width:100%; height:100%; display:block; border:0;}
|
15
|
+
|
16
|
+
/*
|
17
|
+
User Style:
|
18
|
+
Change the following styles to modify the appearance of ColorBox. They are
|
19
|
+
ordered & tabbed in a way that represents the nesting of the generated HTML.
|
20
|
+
*/
|
21
|
+
#cboxOverlay{background:url(../images/colorbox/overlay.png) repeat 0 0;}
|
22
|
+
#colorbox{}
|
23
|
+
#cboxTopLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -100px 0;}
|
24
|
+
#cboxTopRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -129px 0;}
|
25
|
+
#cboxBottomLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -100px -29px;}
|
26
|
+
#cboxBottomRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -129px -29px;}
|
27
|
+
#cboxMiddleLeft{width:21px; background:url(../images/colorbox/controls.png) left top repeat-y;}
|
28
|
+
#cboxMiddleRight{width:21px; background:url(../images/colorbox/controls.png) right top repeat-y;}
|
29
|
+
#cboxTopCenter{height:21px; background:url(../images/colorbox/border.png) 0 0 repeat-x;}
|
30
|
+
#cboxBottomCenter{height:21px; background:url(../images/colorbox/border.png) 0 -29px repeat-x;}
|
31
|
+
#cboxContent{background:#fff; overflow:hidden;}
|
32
|
+
#cboxError{padding:50px; border:1px solid #ccc;}
|
33
|
+
#cboxLoadedContent{margin-bottom:28px;}
|
34
|
+
#cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
|
35
|
+
#cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
|
36
|
+
#cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
|
37
|
+
#cboxPrevious{position:absolute; bottom:0; left:0; background:url(../images/colorbox/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
|
38
|
+
#cboxPrevious.hover{background-position:-75px -25px;}
|
39
|
+
#cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/colorbox/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
|
40
|
+
#cboxNext.hover{background-position:-50px -25px;}
|
41
|
+
#cboxLoadingOverlay{background:url(../images/colorbox/loading_background.png) no-repeat center center;}
|
42
|
+
#cboxLoadingGraphic{background:url(../images/colorbox/loading.gif) no-repeat center center;}
|
43
|
+
#cboxClose{position:absolute; bottom:0; right:0; background:url(../images/colorbox/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
|
44
|
+
#cboxClose.hover{background-position:-25px -25px;}
|
45
|
+
|
46
|
+
/*
|
47
|
+
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
48
|
+
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to IE9.
|
49
|
+
*/
|
50
|
+
.cboxIE #cboxTopLeft,
|
51
|
+
.cboxIE #cboxTopCenter,
|
52
|
+
.cboxIE #cboxTopRight,
|
53
|
+
.cboxIE #cboxBottomLeft,
|
54
|
+
.cboxIE #cboxBottomCenter,
|
55
|
+
.cboxIE #cboxBottomRight,
|
56
|
+
.cboxIE #cboxMiddleLeft,
|
57
|
+
.cboxIE #cboxMiddleRight {
|
58
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
|
59
|
+
}
|
60
|
+
|
61
|
+
/*
|
62
|
+
The following provides PNG transparency support for IE6
|
63
|
+
*/
|
64
|
+
.cboxIE6 #cboxTopLeft{background:url(../images/colorbox/ie6/borderTopLeft.png);}
|
65
|
+
.cboxIE6 #cboxTopCenter{background:url(../images/colorbox/ie6/borderTopCenter.png);}
|
66
|
+
.cboxIE6 #cboxTopRight{background:url(../images/colorbox/ie6/borderTopRight.png);}
|
67
|
+
.cboxIE6 #cboxBottomLeft{background:url(../images/colorbox/ie6/borderBottomLeft.png);}
|
68
|
+
.cboxIE6 #cboxBottomCenter{background:url(../images/colorbox/ie6/borderBottomCenter.png);}
|
69
|
+
.cboxIE6 #cboxBottomRight{background:url(../images/colorbox/ie6/borderBottomRight.png);}
|
70
|
+
.cboxIE6 #cboxMiddleLeft{background:url(../images/colorbox/ie6/borderMiddleLeft.png);}
|
71
|
+
.cboxIE6 #cboxMiddleRight{background:url(../images/colorbox/ie6/borderMiddleRight.png);}
|
72
|
+
|
73
|
+
.cboxIE6 #cboxTopLeft,
|
74
|
+
.cboxIE6 #cboxTopCenter,
|
75
|
+
.cboxIE6 #cboxTopRight,
|
76
|
+
.cboxIE6 #cboxBottomLeft,
|
77
|
+
.cboxIE6 #cboxBottomCenter,
|
78
|
+
.cboxIE6 #cboxBottomRight,
|
79
|
+
.cboxIE6 #cboxMiddleLeft,
|
80
|
+
.cboxIE6 #cboxMiddleRight {
|
81
|
+
_behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
|
82
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Videos
|
3
|
+
class VideosController < ::ApplicationController
|
4
|
+
|
5
|
+
before_filter :find_all_videos
|
6
|
+
before_filter :find_page
|
7
|
+
|
8
|
+
def index
|
9
|
+
# you can use meta fields from your model instead (e.g. browser_title)
|
10
|
+
# by swapping @page for @video in the line below:
|
11
|
+
present(@page)
|
12
|
+
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
def find_all_videos
|
17
|
+
@videos = Video.order('position ASC')
|
18
|
+
end
|
19
|
+
|
20
|
+
def find_page
|
21
|
+
@page = ::Refinery::Page.where(:link_url => "/videos").first
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<ul>
|
2
|
+
<% if ::Refinery::Videos::Admin::VideosController.searchable? %>
|
3
|
+
<li>
|
4
|
+
<%= render '/refinery/admin/search', :url => refinery.videos_admin_videos_path %>
|
5
|
+
</li>
|
6
|
+
<% end %>
|
7
|
+
<li>
|
8
|
+
<%= link_to t('.create_new'), refinery.new_videos_admin_video_path,
|
9
|
+
:class => "add_icon" %>
|
10
|
+
</li>
|
11
|
+
<% if !searching? && ::Refinery::Videos::Admin::VideosController.sortable? && ::Refinery::Videos::Video.any? %>
|
12
|
+
<li>
|
13
|
+
<%= link_to t('.reorder', :what => "Videos"),
|
14
|
+
refinery.videos_admin_videos_path,
|
15
|
+
:id => "reorder_action",
|
16
|
+
:class => "reorder_icon" %>
|
17
|
+
|
18
|
+
<%= link_to t('.reorder_done', :what => "Videos"),
|
19
|
+
refinery.videos_admin_videos_path,
|
20
|
+
:id => "reorder_action_done",
|
21
|
+
:style => "display: none;",
|
22
|
+
:class => "reorder_icon" %>
|
23
|
+
</li>
|
24
|
+
<% end %>
|
25
|
+
</ul>
|
@@ -1,17 +1,19 @@
|
|
1
|
-
<%= form_for [:
|
2
|
-
<%= render
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<%= form_for [refinery, :videos_admin, @video] do |f| -%>
|
2
|
+
<%= render '/refinery/admin/error_messages',
|
3
|
+
:object => @video,
|
4
|
+
:include_object_name => true %>
|
5
|
+
|
6
6
|
|
7
7
|
<div class='field'>
|
8
8
|
<%= f.label :name -%>
|
9
9
|
<%= f.text_field :name, :class => 'larger widest' -%>
|
10
|
+
|
10
11
|
</div>
|
11
12
|
|
12
13
|
<div class='field'>
|
13
14
|
<%= f.label :youtube_url -%>
|
14
15
|
<%= f.text_field :youtube_url -%>
|
16
|
+
|
15
17
|
</div>
|
16
18
|
|
17
19
|
<div class='field'>
|
@@ -19,11 +21,10 @@
|
|
19
21
|
<ul id='page_parts'>
|
20
22
|
<% [:body].each_with_index do |part, part_index| %>
|
21
23
|
<li class='ui-state-default<%= ' ui-state-active' if part_index == 0 %>'>
|
22
|
-
<%= link_to part.to_s.titleize, "##{part}" %>
|
24
|
+
<%= link_to t("#{part}", :scope => "activerecord.attributes.refinery/videos/video", :default => part.to_s.titleize), "##{part}" %>
|
23
25
|
</li>
|
24
26
|
<% end %>
|
25
27
|
</ul>
|
26
|
-
|
27
28
|
<div id='page_part_editors'>
|
28
29
|
<% [:body].each do |part| %>
|
29
30
|
<div class='page_part' id='<%= part %>'>
|
@@ -32,15 +33,13 @@
|
|
32
33
|
<% end %>
|
33
34
|
</div>
|
34
35
|
</div>
|
36
|
+
|
35
37
|
</div>
|
36
38
|
|
37
|
-
<%= render
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
:delete_title => t('delete', :scope => 'admin.videos.video'),
|
42
|
-
:delete_confirmation => t('message', :scope => 'shared.admin.delete', :title => @video.name)
|
43
|
-
} %>
|
39
|
+
<%= render '/refinery/admin/form_actions', :f => f,
|
40
|
+
:continue_editing => false,
|
41
|
+
:delete_title => t('delete', :scope => 'refinery.videos.admin.videos.video'),
|
42
|
+
:delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @video.name) %>
|
44
43
|
<% end -%>
|
45
44
|
<% content_for :javascripts do %>
|
46
45
|
<script>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if searching? %>
|
2
|
+
<h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2>
|
3
|
+
<% end %>
|
4
|
+
<div class='pagination_container'>
|
5
|
+
<% if @videos.any? %>
|
6
|
+
<%= render 'videos' %>
|
7
|
+
<% else %>
|
8
|
+
<p>
|
9
|
+
<% unless searching? %>
|
10
|
+
<strong>
|
11
|
+
<%= t('.no_items_yet') %>
|
12
|
+
</strong>
|
13
|
+
<% else %>
|
14
|
+
<%= t('no_results', :scope => 'refinery.admin.search') %>
|
15
|
+
<% end %>
|
16
|
+
</p>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(video) -%>">
|
2
|
+
<span class='title'>
|
3
|
+
<%= video.name %>
|
4
|
+
|
5
|
+
</span>
|
6
|
+
<span class='actions'>
|
7
|
+
|
8
|
+
<%= link_to refinery_icon_tag("application_go.png"), refinery.videos_video_path(video),
|
9
|
+
:title => t('.view_live_html'),
|
10
|
+
:target => "_blank" %>
|
11
|
+
|
12
|
+
<%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_videos_admin_video_path(video),
|
13
|
+
:title => t('.edit') %>
|
14
|
+
<%= link_to refinery_icon_tag("delete.png"), refinery.videos_admin_video_path(video),
|
15
|
+
:class => "cancel confirm-delete",
|
16
|
+
:title => t('.delete'),
|
17
|
+
:confirm => t('message', :scope => 'refinery.admin.delete', :title => video.name),
|
18
|
+
:method => :delete %>
|
19
|
+
</span>
|
20
|
+
</li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'form' %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<section id='records'>
|
2
|
+
<%= render 'records' %>
|
3
|
+
</section>
|
4
|
+
<aside id='actions'>
|
5
|
+
<%= render 'actions' %>
|
6
|
+
</aside>
|
7
|
+
<%= render '/refinery/admin/make_sortable', :tree => false if !searching? and ::Refinery::Videos::Admin::VideosController.sortable? and ::Refinery::Videos::Video.count > 1 %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'form' %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% content_for :body_content_left do %>
|
2
|
+
<ul class="videos">
|
3
|
+
<% @videos.each do |video| %>
|
4
|
+
<li>
|
5
|
+
<div class="tilevideo" targeturl="<%= video.youtube_url %>">
|
6
|
+
<h1><%= video.name %></h1>
|
7
|
+
<%= link_to('', video.youtube_url, :class => "ytlink") %>
|
8
|
+
<%= raw(video.body) %>
|
9
|
+
</div>
|
10
|
+
</li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render '/refinery/content_page' %>
|
data/config/locales/en.yml
CHANGED
@@ -1,25 +1,29 @@
|
|
1
1
|
en:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
image: image
|
6
|
-
plugins:
|
7
|
-
videos:
|
8
|
-
title: Videos
|
9
|
-
admin:
|
10
|
-
videos:
|
11
|
-
actions:
|
12
|
-
create_new: Add New Video
|
13
|
-
reorder: Reorder Videos
|
14
|
-
reorder_done: Done Reordering Videos
|
15
|
-
records:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
videos:
|
16
5
|
title: Videos
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
6
|
+
videos:
|
7
|
+
admin:
|
8
|
+
videos:
|
9
|
+
actions:
|
10
|
+
create_new: Add New Video
|
11
|
+
reorder: Reorder Videos
|
12
|
+
reorder_done: Done Reordering Videos
|
13
|
+
records:
|
14
|
+
title: Videos
|
15
|
+
sorry_no_results: Sorry! There are no results found.
|
16
|
+
no_items_yet: There are no Videos yet. Click "Add New Video" to add your first video.
|
17
|
+
video:
|
18
|
+
view_live_html: View this video live <br/><em>(opens in a new window)</em>
|
19
|
+
edit: Edit this video
|
20
|
+
delete: Remove this video forever
|
21
|
+
videos:
|
22
|
+
show:
|
23
|
+
other: Other Videos
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
'refinery/videos/video':
|
27
|
+
name: Name
|
28
|
+
youtube_url: Youtube Url
|
29
|
+
body: Body
|
@@ -0,0 +1,30 @@
|
|
1
|
+
es:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
videos:
|
5
|
+
title: Videos
|
6
|
+
# article: masculino/femenino
|
7
|
+
videos:
|
8
|
+
admin:
|
9
|
+
videos:
|
10
|
+
actions:
|
11
|
+
create_new: Crear nuevo video
|
12
|
+
reorder: Reordenar videos
|
13
|
+
reorder_done: Reordenación de videos completada
|
14
|
+
records:
|
15
|
+
title: Videos
|
16
|
+
sorry_no_results: Lo siento, no hay resultados
|
17
|
+
no_items_yet: No hay videos todavía. Pulsa en "Crear nuevo Video" para crear tu primer video.
|
18
|
+
video:
|
19
|
+
view_live_html: Ver este video como abierto al público <br/><em>(abre en ventana nueva)</em>
|
20
|
+
edit: Editar este video
|
21
|
+
delete: Borrar este video para siempre
|
22
|
+
videos:
|
23
|
+
show:
|
24
|
+
other: Otros videos
|
25
|
+
activerecord:
|
26
|
+
attributes:
|
27
|
+
'refinery/videos/video':
|
28
|
+
name: Name
|
29
|
+
youtube_url: Youtube Url
|
30
|
+
body: Body
|
data/config/locales/fr.yml
CHANGED
@@ -1,25 +1,29 @@
|
|
1
1
|
fr:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
image: image
|
6
|
-
plugins:
|
7
|
-
videos:
|
8
|
-
title: Videos
|
9
|
-
admin:
|
10
|
-
videos:
|
11
|
-
actions:
|
12
|
-
create_new: Créer un(e) nouve(au/l/lle) Video
|
13
|
-
reorder: Réordonner les Videos
|
14
|
-
reorder_done: Fin de réordonnancement des Videos
|
15
|
-
records:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
videos:
|
16
5
|
title: Videos
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
6
|
+
videos:
|
7
|
+
admin:
|
8
|
+
videos:
|
9
|
+
actions:
|
10
|
+
create_new: Créer un(e) nouve(au/l/lle) Video
|
11
|
+
reorder: Réordonner les Videos
|
12
|
+
reorder_done: Fin de réordonnancement des Videos
|
13
|
+
records:
|
14
|
+
title: Videos
|
15
|
+
sorry_no_results: "Désolé ! Aucun résultat."
|
16
|
+
no_items_yet: 'Il n''y a actuellement aucun(e) Video. Cliquer sur "Créer un(e) nouve(au/l/lle) Video" pour créer votre premi(er/ère) video.'
|
17
|
+
video:
|
18
|
+
view_live_html: Voir ce(t/tte) video <br/><em>(Ouvre une nouvelle fenêtre)</em>
|
19
|
+
edit: Modifier ce(t/tte) video
|
20
|
+
delete: Supprimer définitivement ce(t/tte) video
|
21
|
+
videos:
|
22
|
+
show:
|
23
|
+
other: Autres Videos
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
'refinery/videos/video':
|
27
|
+
name: Name
|
28
|
+
youtube_url: Youtube Url
|
29
|
+
body: Body
|
data/config/locales/nb.yml
CHANGED
@@ -1,21 +1,29 @@
|
|
1
1
|
nb:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
admin:
|
6
|
-
videos:
|
7
|
-
actions:
|
8
|
-
create_new: Lag en ny Video
|
9
|
-
reorder: Endre rekkefølgen på Videos
|
10
|
-
reorder_done: Ferdig å endre rekkefølgen Videos
|
11
|
-
records:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
videos:
|
12
5
|
title: Videos
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
6
|
+
videos:
|
7
|
+
admin:
|
8
|
+
videos:
|
9
|
+
actions:
|
10
|
+
create_new: Lag en ny Video
|
11
|
+
reorder: Endre rekkefølgen på Videos
|
12
|
+
reorder_done: Ferdig å endre rekkefølgen Videos
|
13
|
+
records:
|
14
|
+
title: Videos
|
15
|
+
sorry_no_results: Beklager! Vi fant ikke noen resultater.
|
16
|
+
no_items_yet: Det er ingen Videos enda. Klikk på "Lag en ny Video" for å legge til din første video.
|
17
|
+
video:
|
18
|
+
view_live_html: Vis hvordan denne video ser ut offentlig <br/><em>(åpner i et nytt vindu)</em>
|
19
|
+
edit: Rediger denne video
|
20
|
+
delete: Fjern denne video permanent
|
21
|
+
videos:
|
22
|
+
show:
|
23
|
+
other: Andre Videos
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
'refinery/videos/video':
|
27
|
+
name: Name
|
28
|
+
youtube_url: Youtube Url
|
29
|
+
body: Body
|
data/config/locales/nl.yml
CHANGED
@@ -1,21 +1,29 @@
|
|
1
1
|
nl:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
admin:
|
6
|
-
videos:
|
7
|
-
actions:
|
8
|
-
create_new: Maak een nieuwe Video
|
9
|
-
reorder: Wijzig de volgorde van de Videos
|
10
|
-
reorder_done: Klaar met het wijzingen van de volgorde van de Videos
|
11
|
-
records:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
videos:
|
12
5
|
title: Videos
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
6
|
+
videos:
|
7
|
+
admin:
|
8
|
+
videos:
|
9
|
+
actions:
|
10
|
+
create_new: Maak een nieuwe Video
|
11
|
+
reorder: Wijzig de volgorde van de Videos
|
12
|
+
reorder_done: Klaar met het wijzingen van de volgorde van de Videos
|
13
|
+
records:
|
14
|
+
title: Videos
|
15
|
+
sorry_no_results: Helaas! Er zijn geen resultaten gevonden.
|
16
|
+
no_items_yet: Er zijn nog geen Videos. Druk op 'Maak een nieuwe Video' om de eerste aan te maken.
|
17
|
+
video:
|
18
|
+
view_live_html: Bekijk deze video op de website <br/><em>(opent een nieuw venster)</em>
|
19
|
+
edit: Bewerk deze video
|
20
|
+
delete: Verwijder deze video voor eeuwig
|
21
|
+
videos:
|
22
|
+
show:
|
23
|
+
other: Andere Videos
|
24
|
+
activerecord:
|
25
|
+
attributes:
|
26
|
+
'refinery/videos/video':
|
27
|
+
name: Name
|
28
|
+
youtube_url: Youtube Url
|
29
|
+
body: Body
|
data/config/routes.rb
CHANGED
@@ -1,11 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
resources :videos, :
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
Refinery::Core::Engine.routes.append do
|
2
|
+
|
3
|
+
# Frontend routes
|
4
|
+
namespace :videos do
|
5
|
+
resources :videos, :path => '', :only => [:index, :show]
|
6
|
+
end
|
7
|
+
|
8
|
+
# Admin routes
|
9
|
+
namespace :videos, :path => '' do
|
10
|
+
namespace :admin, :path => 'refinery' do
|
11
|
+
resources :videos, :except => :show do
|
12
|
+
collection do
|
13
|
+
post :update_positions
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class CreateVideosVideos < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def up
|
4
|
+
create_table :refinery_videos do |t|
|
5
|
+
t.string :name
|
6
|
+
t.string :youtube_url
|
7
|
+
t.text :body
|
8
|
+
t.integer :position
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
def down
|
16
|
+
if defined?(::Refinery::UserPlugin)
|
17
|
+
::Refinery::UserPlugin.destroy_all({:name => "refinerycms-videos"})
|
18
|
+
end
|
19
|
+
|
20
|
+
#if defined?(::Refinery::Page)
|
21
|
+
# ::Refinery::Page.delete_all({:link_url => "/videos/videos"})
|
22
|
+
#end
|
23
|
+
|
24
|
+
drop_table :refinery_videos
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/db/seeds.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
if defined?(::Refinery::User)
|
2
|
+
::Refinery::User.all.each do |user|
|
3
|
+
if user.plugins.where(:name => 'refinerycms-videos').blank?
|
4
|
+
user.plugins.create(:name => 'refinerycms-videos',
|
5
|
+
:position => (user.plugins.maximum(:position) || -1) +1)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
url = "/videos"
|
11
|
+
if defined?(::Refinery::Page) && ::Refinery::Page.where(:link_url => url).empty?
|
12
|
+
page = ::Refinery::Page.create(
|
13
|
+
:title => 'Videos',
|
14
|
+
:link_url => url,
|
15
|
+
:deletable => false,
|
16
|
+
:menu_match => "^#{url}(\/|\/.+?|)$"
|
17
|
+
)
|
18
|
+
Refinery::Pages.default_parts.each do |default_page_part|
|
19
|
+
page.parts.create(:title => default_page_part, :body => nil)
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Refinery
|
2
|
+
class VideosGenerator < Rails::Generators::Base
|
3
|
+
|
4
|
+
def rake_db
|
5
|
+
rake("refinery_videos:install:migrations")
|
6
|
+
end
|
7
|
+
|
8
|
+
def append_load_seed_data
|
9
|
+
create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
|
10
|
+
append_file 'db/seeds.rb', :verbose => true do
|
11
|
+
<<-EOH
|
12
|
+
|
13
|
+
Refinery::Videos::Engine.load_seed
|
14
|
+
EOH
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Refinery
|
2
|
+
module Videos
|
3
|
+
class Engine < Rails::Engine
|
4
|
+
include Refinery::Engine
|
5
|
+
isolate_namespace Refinery::Videos
|
6
|
+
|
7
|
+
engine_name :refinery_videos
|
8
|
+
|
9
|
+
initializer "register refinerycms_videos plugin" do
|
10
|
+
Refinery::Plugin.register do |plugin|
|
11
|
+
plugin.name = "videos"
|
12
|
+
plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.videos_admin_videos_path }
|
13
|
+
plugin.pathname = root
|
14
|
+
plugin.activity = {
|
15
|
+
:class_name => :'refinery/videos/video',
|
16
|
+
:title => 'name'
|
17
|
+
}
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
config.after_initialize do
|
23
|
+
Refinery.register_extension(Refinery::Videos)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'refinerycms-core'
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
autoload :VideosGenerator, 'generators/refinery/videos_generator'
|
5
|
+
|
6
|
+
module Videos
|
7
|
+
require 'refinery/videos/engine'
|
8
|
+
|
9
|
+
class << self
|
10
|
+
attr_writer :root
|
11
|
+
|
12
|
+
def root
|
13
|
+
@root ||= Pathname.new(File.expand_path('../../../', __FILE__))
|
14
|
+
end
|
15
|
+
|
16
|
+
def factory_paths
|
17
|
+
@factory_paths ||= [ root.join('spec', 'factories').to_s ]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/refinerycms-videos.rb
CHANGED
@@ -1,21 +1 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
module Refinery
|
4
|
-
module Videos
|
5
|
-
class Engine < Rails::Engine
|
6
|
-
initializer "static assets" do |app|
|
7
|
-
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
8
|
-
end
|
9
|
-
|
10
|
-
config.after_initialize do
|
11
|
-
Refinery::Plugin.register do |plugin|
|
12
|
-
plugin.name = "videos"
|
13
|
-
plugin.activity = {
|
14
|
-
:class => Video,
|
15
|
-
:title => 'name'
|
16
|
-
}
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
1
|
+
require 'refinery/videos'
|
@@ -1,13 +1,13 @@
|
|
1
1
|
namespace :refinery do
|
2
|
-
|
2
|
+
|
3
3
|
namespace :videos do
|
4
|
-
|
5
|
-
# call this task
|
4
|
+
|
5
|
+
# call this task by running: rake refinery:videos:my_task
|
6
6
|
# desc "Description of my task below"
|
7
7
|
# task :my_task => :environment do
|
8
8
|
# # add your logic here
|
9
9
|
# end
|
10
|
-
|
10
|
+
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
end
|
data/readme.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Refinery CMS Videos
|
2
|
+
|
3
|
+
Simple videos engine for [Refinery CMS](http://refinerycms.com).
|
4
|
+
|
5
|
+
This version of `refinerycms-videos` supports Rails 3.1.x and up.
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
|
9
|
+
Refinery CMS version 2.0.x.
|
10
|
+
|
11
|
+
## Install
|
12
|
+
|
13
|
+
Open up your ``Gemfile`` and add the following:
|
14
|
+
|
15
|
+
gem 'refinerycms-videos', '~> 2.0.0'
|
16
|
+
|
17
|
+
Now, run:
|
18
|
+
|
19
|
+
bundle install
|
20
|
+
|
21
|
+
Next, run:
|
22
|
+
|
23
|
+
rails generate refinery:videos
|
24
|
+
|
25
|
+
Migrate your database:
|
26
|
+
|
27
|
+
rake db:migrate
|
28
|
+
|
29
|
+
And hook up the seed data:
|
30
|
+
|
31
|
+
rake db:seed
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-videos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,38 +9,91 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
|
15
|
-
|
12
|
+
date: 2012-03-14 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: refinerycms-core
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.0.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.0.1
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: refinerycms-testing
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.0.1
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.0.1
|
46
|
+
description: Ruby on Rails Videos extension for Refinery CMS
|
47
|
+
email: james.b.thompson@gmail.com
|
16
48
|
executables: []
|
17
49
|
extensions: []
|
18
50
|
extra_rdoc_files: []
|
19
51
|
files:
|
20
|
-
-
|
21
|
-
-
|
22
|
-
-
|
52
|
+
- app/assets/images/colorbox/border.png
|
53
|
+
- app/assets/images/colorbox/controls.png
|
54
|
+
- app/assets/images/colorbox/ie6/borderBottomCenter.png
|
55
|
+
- app/assets/images/colorbox/ie6/borderBottomLeft.png
|
56
|
+
- app/assets/images/colorbox/ie6/borderBottomRight.png
|
57
|
+
- app/assets/images/colorbox/ie6/borderMiddleLeft.png
|
58
|
+
- app/assets/images/colorbox/ie6/borderMiddleRight.png
|
59
|
+
- app/assets/images/colorbox/ie6/borderTopCenter.png
|
60
|
+
- app/assets/images/colorbox/ie6/borderTopLeft.png
|
61
|
+
- app/assets/images/colorbox/ie6/borderTopRight.png
|
62
|
+
- app/assets/images/colorbox/loading.gif
|
63
|
+
- app/assets/images/colorbox/loading_background.png
|
64
|
+
- app/assets/images/colorbox/overlay.png
|
65
|
+
- app/assets/images/video_play.png
|
66
|
+
- app/assets/javascripts/jquery.colorbox-min.js
|
67
|
+
- app/assets/javascripts/jquery.refinerycms-videos.js
|
68
|
+
- app/assets/stylesheets/colorbox.css
|
69
|
+
- app/controllers/refinery/videos/admin/videos_controller.rb
|
70
|
+
- app/controllers/refinery/videos/videos_controller.rb
|
71
|
+
- app/models/refinery/videos/video.rb
|
72
|
+
- app/views/refinery/videos/admin/videos/edit.html.erb
|
73
|
+
- app/views/refinery/videos/admin/videos/index.html.erb
|
74
|
+
- app/views/refinery/videos/admin/videos/new.html.erb
|
75
|
+
- app/views/refinery/videos/admin/videos/_actions.html.erb
|
76
|
+
- app/views/refinery/videos/admin/videos/_form.html.erb
|
77
|
+
- app/views/refinery/videos/admin/videos/_records.html.erb
|
78
|
+
- app/views/refinery/videos/admin/videos/_sortable_list.html.erb
|
79
|
+
- app/views/refinery/videos/admin/videos/_video.html.erb
|
80
|
+
- app/views/refinery/videos/admin/videos/_videos.html.erb
|
81
|
+
- app/views/refinery/videos/videos/index.html.erb
|
23
82
|
- config/locales/en.yml
|
83
|
+
- config/locales/es.yml
|
24
84
|
- config/locales/fr.yml
|
25
|
-
- config/locales/lolcat.yml
|
26
85
|
- config/locales/nb.yml
|
27
86
|
- config/locales/nl.yml
|
28
87
|
- config/routes.rb
|
29
|
-
-
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
|
38
|
-
- app/views/admin/videos/_sortable_list.html.erb
|
39
|
-
- app/views/admin/videos/_video.html.erb
|
40
|
-
- app/views/admin/videos/_videos.html.erb
|
41
|
-
- app/views/shared/_video.html.erb
|
42
|
-
- app/views/videos/index.html.erb
|
43
|
-
homepage:
|
88
|
+
- db/migrate/1_create_videos_videos.rb
|
89
|
+
- db/seeds.rb
|
90
|
+
- lib/generators/refinery/videos_generator.rb
|
91
|
+
- lib/refinery/videos/engine.rb
|
92
|
+
- lib/refinery/videos.rb
|
93
|
+
- lib/refinerycms-videos.rb
|
94
|
+
- lib/tasks/refinery/videos.rake
|
95
|
+
- readme.md
|
96
|
+
homepage: https://github.com/julesce/refinerycms-videos
|
44
97
|
licenses: []
|
45
98
|
post_install_message:
|
46
99
|
rdoc_options: []
|
@@ -63,5 +116,5 @@ rubyforge_project:
|
|
63
116
|
rubygems_version: 1.8.18
|
64
117
|
signing_key:
|
65
118
|
specification_version: 3
|
66
|
-
summary: Videos
|
119
|
+
summary: Videos extension for Refinery CMS
|
67
120
|
test_files: []
|
@@ -1,19 +0,0 @@
|
|
1
|
-
class VideosController < ApplicationController
|
2
|
-
|
3
|
-
before_filter :find_page
|
4
|
-
|
5
|
-
def index
|
6
|
-
@videos = Video.order('position ASC')
|
7
|
-
|
8
|
-
# you can use meta fields from your model instead (e.g. browser_title)
|
9
|
-
# by swapping @page for @video in the line below:
|
10
|
-
present(@page)
|
11
|
-
end
|
12
|
-
|
13
|
-
protected
|
14
|
-
|
15
|
-
def find_page
|
16
|
-
@page = Page.where(:link_url => "/videos").first
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
data/app/models/video.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
<ul>
|
2
|
-
<% if Admin::VideosController.searchable? %>
|
3
|
-
<li>
|
4
|
-
<%= render :partial => "/shared/admin/search",
|
5
|
-
:locals => {
|
6
|
-
:url => admin_videos_path
|
7
|
-
} %>
|
8
|
-
</li>
|
9
|
-
<% end %>
|
10
|
-
<li>
|
11
|
-
<%= link_to t('.create_new'), new_admin_video_path,
|
12
|
-
:class => "add_icon" %>
|
13
|
-
</li>
|
14
|
-
<% if !searching? and Admin::VideosController.sortable? and Video.count > 1 %>
|
15
|
-
<li>
|
16
|
-
<%= link_to t('.reorder', :what => "Videos"),
|
17
|
-
admin_videos_path,
|
18
|
-
:id => "reorder_action",
|
19
|
-
:class => "reorder_icon" %>
|
20
|
-
|
21
|
-
<%= link_to t('.reorder_done', :what => "Videos"),
|
22
|
-
admin_videos_path,
|
23
|
-
:id => "reorder_action_done",
|
24
|
-
:style => "display: none;",
|
25
|
-
:class => "reorder_icon" %>
|
26
|
-
</li>
|
27
|
-
<% end %>
|
28
|
-
</ul>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<% if searching? %>
|
2
|
-
<h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
|
3
|
-
<% end %>
|
4
|
-
<% if @videos.any? %>
|
5
|
-
<div class='pagination_container'>
|
6
|
-
<%= render :partial => 'videos' %>
|
7
|
-
</div>
|
8
|
-
<% else %>
|
9
|
-
<p>
|
10
|
-
<% unless searching? %>
|
11
|
-
<strong>
|
12
|
-
<%= t('.no_items_yet') %>
|
13
|
-
</strong>
|
14
|
-
<% else %>
|
15
|
-
<%= t('no_results', :scope => 'shared.admin.search') %>
|
16
|
-
<% end %>
|
17
|
-
</p>
|
18
|
-
<% end %>
|
@@ -1,7 +0,0 @@
|
|
1
|
-
<ul id='sortable_list'>
|
2
|
-
<%= render :partial => 'video', :collection => @videos %>
|
3
|
-
</ul>
|
4
|
-
<%= render :partial => "/shared/admin/sortable_list",
|
5
|
-
:locals => {
|
6
|
-
:continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true
|
7
|
-
} %>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(video) -%>">
|
2
|
-
<span class='title'>
|
3
|
-
<%= video.name %>
|
4
|
-
<span class="preview"> </span>
|
5
|
-
</span>
|
6
|
-
<span class='actions'>
|
7
|
-
<%= link_to refinery_icon_tag("application_edit.png"), edit_admin_video_path(video),
|
8
|
-
:title => t('.edit') %>
|
9
|
-
<%= link_to refinery_icon_tag("delete.png"), admin_video_path(video),
|
10
|
-
:class => "cancel confirm-delete",
|
11
|
-
:title => t('.delete'),
|
12
|
-
:confirm => t('message', :scope => 'shared.admin.delete', :title => video.name),
|
13
|
-
:method => :delete %>
|
14
|
-
</span>
|
15
|
-
</li>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= render :partial => "form" %>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<section id='records'>
|
2
|
-
<%= render :partial => 'records' %>
|
3
|
-
</section>
|
4
|
-
<aside id='actions'>
|
5
|
-
<%= render :partial => 'actions' %>
|
6
|
-
</aside>
|
7
|
-
<%= render :partial => '/shared/admin/make_sortable',
|
8
|
-
:locals => {
|
9
|
-
:tree => false
|
10
|
-
} if !searching? and Admin::VideosController.sortable? and Video.count > 1 %>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= render :partial => "form" %>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<% content_for :body_content_title do -%>
|
2
|
-
Videos
|
3
|
-
<% end -%>
|
4
|
-
|
5
|
-
<% content_for :body_content_left do %>
|
6
|
-
<ul class="videos">
|
7
|
-
<% @videos.each do |video| %>
|
8
|
-
<li>
|
9
|
-
<%= render :partial => 'shared/video', :locals => {:video => video} %>
|
10
|
-
</li>
|
11
|
-
<% end %>
|
12
|
-
</ul>
|
13
|
-
<% end %>
|
14
|
-
|
15
|
-
<%= render :partial => "/shared/content_page" %>
|
data/config/locales/lolcat.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
lolcat:
|
2
|
-
shared:
|
3
|
-
admin:
|
4
|
-
image_picker:
|
5
|
-
image: IMAGE
|
6
|
-
plugins:
|
7
|
-
videos:
|
8
|
-
title: Videos
|
9
|
-
admin:
|
10
|
-
videos:
|
11
|
-
actions:
|
12
|
-
create_new: CREATE NEW Video
|
13
|
-
reorder: REORDR Videos
|
14
|
-
reorder_done: DUN REORDERIN Videos
|
15
|
-
records:
|
16
|
-
title: Videos
|
17
|
-
sorry_no_results: SRY! THAR R NO RESULTS FINDZ.
|
18
|
-
no_items_yet: THAR R NO Videos YET. CLICK "CREATE NEW Video" 2 ADD UR FURST video.
|
19
|
-
video:
|
20
|
-
view_live_html: VIEW DIS video LIV <BR/><EM>(OPENS IN NEW WINDOW)</EM>
|
21
|
-
edit: EDIT DIS video
|
22
|
-
delete: REMOOV DIS video FOREVR
|
23
|
-
videos:
|
24
|
-
show:
|
25
|
-
other: OTHR Videos
|