Merge with branch november_presentation

This commit is contained in:
chris2tof committed 2011-12-01 13:50:49 +08:00
commit a0ec38ca99
1037 files changed
+6079 -129824

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 798 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 KiB

Binary file not shown.
+39
View File
@@ -0,0 +1,39 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
$(function () {
$('#panel_sidebar a, #panel_main a.nav').live('click',
function () {
$.getScript(this.href);
history.pushState(null, document.title, this.href);
return false;
}
);
$('#panel_main a.reload').live('click',
function () {
$.getScript(this.href);
history.replaceState(null, document.title, this.href);
return false;
}
);
$('.form').live('submit', function () {
$.post(this.action, $(this).serialize(), null, 'script');
return false;
});
$(window).bind("popstate", function () {
$.getScript(location.href);
});
});
+2
View File
@@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
+71
View File
@@ -0,0 +1,71 @@
function r_editor(tgetUrl,tpostUrl,tfilename,toption){
if(!toption){ toption =new Array();}
if(!toption['width']){toption['width']=400;}
if(!toption['height']){toption['height']=300;}
var editor = this;
editor.filename = tfilename;
editor.getUrl = tgetUrl;
editor.postUrl = tpostUrl;
editor.nodeToBeChanged=""
editor.width = toption['width'];
editor.height = toption['height'];
var html='';
editor.init = function(){
code = "<span id='file_editor' style='border:solid; width:"+editor.width+"px;height:"+editor.height+"px; float:right;' ><textarea style='height:87%;width:97%;resize:none;border:none;' ></textarea><input type='button' class='send' value='Send' ><input type='button' class='discard' value='Discard' ></span>";
html = $(code);
html.children("textarea").load(editor.getUrl);
html.children("input.discard").click(function(){
editor.destroy();
});
html.children("input.send").click(function(){
editor.send();
});
return html;
};
editor.reload = function(){
$.get(editor.getUrl,function(data){
html.children("textarea").text(data);
});
};
editor.send = function(){
$.post(editor.postUrl,{filename:editor.filename,context:html.children("textarea").val(),authenticity_token:$('meta[name=csrf-token]').attr('content')},null,"script");
};
editor.destroy = function(){
html.remove();
};
}
$(".r_edit").live("click",function(){
new_editor = new r_editor($(this).attr("path"),"edit_file",$(this).attr("filename"));
$(this).after(new_editor.init());
});
$(".r_snapshot").live({
mouseenter:
function(){
$(this).append($("<span></span>").html('<p class="z-preview"><img src="'+$(this).attr("path")+'"width="220" height="19" /></p>'));
},
mouseleave:
function(){
$(this).find("span:last").remove();
}
}
);
$('input.multi_files').live("change", function(){
$(this).parent().prev("ul").append("<li>" + $(this).val() + "</li>");
new_node = $(this).parent().clone();
$(this).parent().css("display","none");
new_node.children('input.multi_files').val("");
$(this).parent().before(new_node);
});
$('a.remove_mark').live("click",function(){
$(this).prev("input").val("true");
$(this).parent().css("text-decoration","line-through")
$(this).parent().removeClass("r_snapshot");
$(this).next().remove();
$(this).remove();
return false;
});
+16
View File
@@ -0,0 +1,16 @@
/*
*
* Easy front-end framework
*
* Copyright (c) 2009 Alen Grakalic
* http://easyframework.com/license.php
*
* supported by Templatica (http://templatica.com)
* and Css Globe (http://cssglobe.com)
*
* built to be used with jQuery library
* http://jquery.com
*
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(8($){$.1Y={2S:8(3){6 g={j:\'#2T 2U\',1x:\'2V\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).q(8(){$(4).1Z(8(){$(\'20:21\',4).15(Q);$(\'a:21\',4).1f(3.1x)},8(){$(\'20\',4).V();$(\'a\',4).1g(3.1x)})})},22:8(3){6 g={j:\'.22\',17:10,1y:25,23:1h,o:\'2W\',f:\'\',1z:\'\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);6 f;s $(3.j).q(8(){6 p=$(4).l(\'p\');$(4).1Z(8(e){f=(3.f!=\'\')?3.f:p;f=(3.1z!=\'\')?$(\'#\'+3.1z).24():f;$(4).l(\'p\',\'\');b(f!=\'\'&&f!=2X){$(\'W\').26(\'<I o="\'+3.o+\'">\'+f+\'</I>\');$(\'#\'+3.o).m({\'X\':\'18\',\'1A\':\'1B\'}).m(\'t\',(e.27-3.1y)+\'J\').m(\'y\',(e.1i+3.17)+\'J\').15(\'28\')}},8(){$(\'#\'+3.o).A();$(4).l(\'p\',p)});$(4).2Y(8(e){6 x=((e.1i+3.17+$(4).r())<$(K).r())?(e.1i+3.17):(e.1i-3.17-$(4).r()-16);$(\'#\'+3.o).m(\'t\',(e.27-3.1y)+\'J\').m(\'y\',(x+\'J\'))});b(3.23){$(4).2Z(8(e){$(\'#\'+3.o).A();$(4).l(\'p\',p)})}})},29:8(3){6 g={j:\'.29\',k:\'30\',2a:\'31...\',2b:\'32 33 34 a 35 36 37 38, 39 19 3a 4 K 3b 3c 3d.\',2c:\'3e\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).q(8(){$(4).19(8(e){e.3f();b($.1a.2d)$.3g.2e=R;6 1j=$.1a.3h&&$.1a.2f.2g(0,1)<7;6 2h=$.1a.2d&&$.1a.2f<=9.5;6 w=$(K).r();6 h=$(2i).B();6 2j=$(K).r()/2;6 2k=$(K).B()/2;L=8(){$(\'#\'+3.k+\'1k\').A();b(Y!=0)$(\'#\'+3.k+\'f\').m(\'r\',Y+\'J\');b(Z!=0)$(\'#\'+3.k+\'f\').m(\'B\',Z+\'J\');1C($(\'#\'+3.k+\'f\'));$(\'11\',\'#\'+3.k+\'f\').m(\'1l\',\'1D\')};1C=8(c){$(c).m({\'3i\':\'3j\',\'2l\':\'#2m\',\'2n\':\'#3k\',\'u-3l\':\'y\',\'2o\':\'y\',\'X\':\'3m\',\'z-2p\':\'3n\',\'1D\':\'1m\'});6 y=2j-$(c).r()/2;6 t=2k-$(c).B()/2;$(c).m({\'y\':y,\'t\':t,\'1A\':\'1B\'}).15(\'1E\');b(1j)$(c).m({\'X\':\'18\',\'t\':(t+$(K).1F())+\'J\'});b(2h)$(c).m({\'X\':\'18\',\'t\':(2i.W[\'3o\']/2-$(c).B()/2+$(K).1F())+\'J\'})};b(1j)$(\'1n, 1o, 2q\').m(\'1l\',\'1m\');C=8(){$(\'#\'+3.k+\'f\').u(3.2b);L()};A=8(){$(\'#\'+3.k).A();$(\'#\'+3.k+\'f\').A();$(\'#\'+3.k+\'1k\').A();b(1j)$(\'1n, 1o, 2q\').m(\'1l\',\'1D\')};$(\'<I o="\'+3.k+\'"></I>\').M(\'W\').m({\'r\':w,\'B\':h,\'2l\':\'#3p\',\'X\':\'18\',\'t\':\'0\',\'y\':\'0\',\'z-2p\':\'3q\',\'2e\':.7}).19(8(){A()});6 n=$(4).l(\'n\');6 12=n.2g(n.3r(\'.\')).1G();6 f;6 Y=0;6 Z=0;6 1b=1h;$(\'<I o="\'+3.k+\'1k">\'+3.2a+\'</I>\').M(\'W\');1C($(\'#\'+3.k+\'1k\'));$(\'<I o="\'+3.k+\'f"></I>\').M(\'W\');b($(4).13(\'1p\')){6 1p=\'<1o r="Q%" B="Q%"><1H 1I="2r" 1J="R" /><1H 1I="2s" 1J="2t" /><1H 1I="3s" 1J="\'+n+\'" /><1n 1K="\'+n+\'" 1L="3t/x-3u-1p" 2r="R" 2s="2t" r="Q%" B="Q%"></1n></1o>\';$(1p).M(\'#\'+3.k+\'f\');Y=3v;Z=3w;1b=R}E{b(12==\'.3x\'||12==\'.3y\'||12==\'.3z\'||12==\'.3A\'||12==\'.3B\'){6 11=1M 3C();$(11).C(8(){C()}).m(\'1l\',\'1m\').M(\'#\'+3.k+\'f\');11.2u=8(){L();11.2u=8(){}};11.1K=n+\'?\'+(1M 2v()).2w()+\' =\'+(1M 2v()).2w()}E b(n.3D(0)==\'#\'){$(n).3E().1g(\'1m\').L().M(\'#\'+3.k+\'f\');$.1Y.2x(\'#\'+3.k+\'f 2y\');1b=R}E{$(\'<3F 3G="0" 3H="3I" 3J="r:Q%;B:Q%" 1K="\'+n+\'" />\').M(\'#\'+3.k+\'f\');Y=3K;Z=3L;1b=R}};6 T=$(4).l(\'T\').1N(\';\');$.q(T,8(i){b(T[i].1q(\'r\')!=-1)Y=T[i].1N(\':\')[1];b(T[i].1q(\'B\')!=-1)Z=T[i].1N(\':\')[1]});b(1b)L();$(\'<1O>\'+3.2c+\'</1O>\').M(\'#\'+3.k+\'f\').m({\'X\':\'18\',\'2o\':\'y\',\'y\':\'0\',\'t\':\'-3M\',\'2n\':\'#2m\',\'2z\':\'2A\'});$(\'#\'+3.k+\', #\'+3.k+\'f 1O\').19(8(){A()})})})},2B:8(3){6 g={j:\'a\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);6 1c=K.3N.1c;1c=1c.3O(\'3P.\',\'\').1G();s $(3.j).q(8(){6 n=$(4).l(\'n\').1G();b(n.1q(\'2C://\')!=-1&&n.1q(1c)==-1){$(4).l(\'v\',\'3Q\');$(4).1f(\'2B\')}})},2D:8(3){6 g={j:\'.2D\',2E:3R,2F:1h};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).q(8(){6 c=$(4);6 1r=$(c).2G().1r;6 U=0;8 1P(){6 14=2H.3S(2H.3T()*1r)+1;s 14};8 L(){b(3.2F){6 14=1P();3U(14==U){14=1P()};U=14}E{U=(U==1r)?1:U+1};$(c).2G().V();$(\':3V-3W(\'+U+\')\',c).15(\'3X\')};L();3Y(L,3.2E)})},2I:8(3){6 g={j:\'a.2I\',3Z:1E};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).19(8(){6 v=$($(4).l(\'n\'));6 1Q=$(v).1Q().t;$(\'24,W\').40({1F:1Q},1E,\'41\')})},42:8(3){6 g={j:\'.2J\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).q(8(){6 v;b($(4).13(\'2K\')){v=$(4).2K().V()}E b($(4).13(\'o\')){v=$(4).l(\'n\');v=$(v).V()}E{v=$(4).43().V()};$(4).m(\'2z\',\'2A\');$(4).2J(8(){$(4).1f(\'2L\');$(v).44()},8(){$(v).45();$(4).1g(\'2L\')})})},2x:8(3){6 g={j:\'2y\',N:\'46 1s O\',2M:\'47 1R 48 1s O\',2N:\'49 1s O\',2O:\'4a 4b 1s O\',1t:\'4c\'};8 1u(c){b($(c).D()==\'\'||1S(c)){6 P=($(c).l(\'p\')!=\'\')?$(c).l(\'p\'):3.N;C(c,P)}};8 1v(c,1L){6 1d,N;4d(1L){2P\'1T\':1d=/(4e|2C|4f):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;N=3.2N;2Q;2P\'1U\':6 1d=/[\\d\\4g-]/;N=3.2O;2Q;4h:1d=/^[^@]+@[^@]+.[a-z]{2,}$/;N=3.2M};6 D=$(c).D();b(D.4i(1d)==-1||1S(c)){6 P=($(c).l(\'p\')!=\'\')?$(c).l(\'p\'):N;C(c,P)}};8 1S(c){6 u=$(\'1e[1V=\'+$(c).l(\'o\')+\']\').u();s(u==$(c).D())};8 C(c,P){6 1w=$(c).1w();1w.2Line truncated
+3
View File
@@ -0,0 +1,3 @@
$("#page_design_id").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
});
+3
View File
@@ -0,0 +1,3 @@
$(function (){
$(".engine_loading").load($(this).attr("widget_path"));
});
View File
Whitespace-only changes.
+354
View File
@@ -0,0 +1,354 @@
html, body{
height: 100%;
margin: 0;
padding: 0;
}
html{
background: url(<%= asset_path "body.jpg" %>) no-repeat scroll 0 0 transparent;
background-size: cover;
}
body{
color: #000000;
font-family: helvetica,arial,sans-serif;
margin: 0;
padding: 0;
}
#panel_banner_link{
background: url(<%= asset_path "orbitbar1.png" %>) repeat-x scroll 0 0;
height: 52px;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
.hmenu{
height: 40px;
position: absolute;
right: 0;
top: 1px;
width: 250px;
}
#orbit{
background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent;
cursor:pointer;
height: 43px;
left: 10px;
position: relative;
width: 41px;
}
#orbit:hover{
background-position:0 -43px;
box-shadow: 0 3px 3px #000000;
}
#orbit:hover #orblist{
display:block;
}
#orblist{
background: none repeat scroll 0 0 #FFFFFF;
border-radius: 0 3px 3px 3px;
box-shadow: 0 3px 3px #000000;
display: none;
margin: 0;
padding: 10px;
position: absolute;
top: 43px;
width: 130px;
}
#orblist li{
border-bottom:1px solid #aaa;
list-style:none;
}
.orblink{
color: #333333;
display: block;
font: 12px/100% arial,sans-serif;
padding: 5px;
text-decoration: none;
}
.orblink:hover{
background:#eee;
color:#333;
}
#log_out a{
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent;
border: medium none !important;
display: block !important;
height: 40px !important;
line-height: normal !important;
padding: 0 !important;
position: absolute;
right: 0px;
text-indent: -10000px;
top: 0px;
width: 43px !important;
}
#log_out a:hover{
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important;
}
.lang{
color: #FFFFFF;
font-size: 15px;
line-height: 40px;
position: absolute;
right: 55px;
top: 0;
}
.lang a{
color:#fff;
text-decoration:none;
}
.lang a:hover{
text-decoration:underline;
}
#panel_container{
height: 100%;
}
#panel_container h1{
color: #FFFFFF;
font: 32px/100% helvetica,arial,sans-serif;
margin: 0 0 20px;
padding: 0;
text-shadow: 0 0 5px #000000;
}
#panel_header{
background: none repeat scroll 0 0 #F1F1F1;
border-bottom: 1px solid #818181;
padding: 10px;
}
#panel_header :after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#panel_header #nav{
margin:0;
padding:0;
width:100%;
}
#panel_header #nav li{
float: left;
list-style: none outside none;
}
#panel_header #nav li a{
background: none repeat scroll 0 0 #fff;
border-radius: 13px 13px 13px 13px;
border: 1px solid #D6D6D6;
color: #000000;
float: left;
font-size:15px;
margin: 0 20px 0 0;
padding: 5px 10px;
text-decoration: none;
}
#panel_header #nav li a:hover{
background: none repeat scroll 0 0 #818181;
border-radius: 13px 13px 13px 13px;
color: #fff;
}
#panel_content{
height: 100%;
}
.main{
float: left;
height: 100%;
padding: 0 1%;
width: 81%;
}
.main2{
padding: 62px 0 0;
}
.main table{
border-collapse: collapse;
width:100%;
}
.main table th{
border-bottom: 1px solid #222222;
color: #FFFFFF;
font: 20px/100% helvetica,arial,sans-serif;
letter-spacing: 0.05em;
padding: 10px;
text-shadow: 0 0 3px #000000;
}
.main table td{
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.5);
border-bottom: 1px solid #222222;
color: #FFFFFF;
padding: 10px;
text-align: center;
}
.main table td a{
background: none repeat scroll 0 0 #FFFFFF;
border-radius: 5px 5px 5px 5px;
color: #000000;
padding: 5px;
text-decoration: none;
}
.main table td a:hover{
background: none repeat scroll 0 0 #eee;
border-radius: 5px 5px 5px 5px;
color: #333;
}
.secondary{
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.75);
box-shadow: 3px 0 3px #000000;
float: left;
height: 100%;
padding: 0 1%;
width: 14%;
}
.secondary2{
padding: 62px 0 0;
}
.secondary ul{
margin: 0;
padding: 0;
}
.secondary ul li{
list-style:none;
}
.secondary ul li a{
border-bottom: 1px solid #333;
color: #AAAAAA;
display: block;
padding: 14px 0;
text-align: left;
text-decoration: none;
}
.seclink1{
background: url(<%= asset_path "icon1.png" %>) no-repeat scroll 20px 8px transparent;
border-bottom: 1px solid #333;
color: #AAAAAA;
display: block;
padding: 14px 0 14px 60px !important;
text-align: left;
text-decoration: none;
}
.seclink2{
background: url(<%= asset_path "icon2.png" %>) no-repeat scroll 20px 14px transparent;
border-bottom: 1px solid #333;
color: #AAAAAA;
display: block;
padding: 14px 0 14px 60px !important;
text-align: left;
text-decoration: none;
}
.secondary ul li a:hover{
color: #fff;
}
#panel_footer{
background: none repeat scroll 0 0 #FFFFFF;
display:none;
clear: both;
padding: 10px;
}
#panel_footer p{
margin:0;
}
label{
color: #FFFFFF;
display: block;
text-shadow: 0 0 5px #000000;
width: 130px;
}
p{
margin:0 0 10px;
}
#panel_main p label{
float: left;
padding: 3px;
width: 100px;
}
#panel_main .translation_missing{
float: left;
padding: 3px;
width: 100px;
}
.text{
border: 1px solid #818181;
border-radius: 3px 3px 3px 3px;
font: 12px/100% helvetica,arial,sans-serif;
padding: 3px;
width: 205px;
}
#site_info{
background: none repeat scroll 0 0 #FFFFFF;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 0 5px #000000;
/* height: 289px;*/
margin: 0 0 20px;
overflow: hidden;
width: 600px;
}
#siteinfo_title{
background: none repeat scroll 0 0 #333333;
color: #FFFFFF;
font: 24px/50px arial,sans-serif;
height: 50px;
margin: 0;
padding: 0 0 0 20px;
text-shadow: 0 1px 0 #000000;
}
#siteinfo_tb{
background: none repeat scroll 0 0 #FFFFFF;
}
#siteinfo_tb td{
background: none repeat scroll 0 0 transparent;
border-bottom: 1px solid #333333;
color: #333333;
}
.buy_btn{
float:left;
margin: 0 10px 0 0;
}
.main table td .buy_btn a{
background: url("/assets/buy_btn.png") no-repeat scroll 0 0 transparent;
color: #000000;
display: block;
font-size: 22px;
height: 37px;
line-height: 37px;
text-align: center;
text-decoration: none;
text-shadow: 0 1px 0 #FFFFFF;
width: 170px;
padding: 0px;
}
.buy_btn a:hover{
background-position:0 bottom;
}
.bought_btn{
background: url("/assets/bought_btn.png") no-repeat scroll 0 0 transparent;
color: #FFFFFF;
float:left;
font-size: 22px;
height: 37px;
line-height: 37px;
margin: 0 10px 0 0;
text-align: center;
text-shadow: 0 1px 0 #C06408;
width: 170px;
}
+7
View File
@@ -0,0 +1,7 @@
/*
*This is a manifest file that'll automatically include all the stylesheets available in this directory
*and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
*the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*/
+230
View File
@@ -0,0 +1,230 @@
html, body{
height: 100%;
margin: 0;
padding: 0;
}
html{
background: url(<%= asset_path "body.jpg" %>) no-repeat scroll 0 0 transparent;
background-size: cover;
}
body{
color: #000000;
font-family: helvetica,arial,sans-serif;
margin: 0;
padding: 0;
}
#panel_banner_link{
background: url(<%= asset_path "orbitbar1.png" %>) repeat-x scroll 0 0;
height: 52px;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
.hmenu{
height: 40px;
position: absolute;
right: 0;
top: 1px;
width: 250px;
}
#orbit{
background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent;
cursor:pointer;
height: 43px;
left: 10px;
position: relative;
width: 41px;
}
#orbit:hover{
background-position:0 -43px;
box-shadow: 0 3px 3px #000000;
}
#orbit:hover #orblist{
display:block;
}
#orblist{
background: none repeat scroll 0 0 #FFFFFF;
border-radius: 0 3px 3px 3px;
box-shadow: 0 3px 3px #000000;
display: none;
margin: 0;
padding: 10px;
position: absolute;
top: 43px;
width: 130px;
z-index:10;
}
#orblist li{
border-bottom:1px solid #aaa;
list-style:none;
}
.orblink{
color: #333333;
display: block;
font: 12px/100% arial,sans-serif;
padding: 5px;
text-decoration: none;
}
.orblink:hover{
background:#eee;
color:#333;
}
#log_out a{
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent;
border: medium none !important;
display: block !important;
height: 40px !important;
line-height: normal !important;
padding: 0 !important;
position: absolute;
right: 0px;
text-indent: -10000px;
top: 0px;
width: 43px !important;
}
#log_out a:hover{
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important;
}
.lang{
color: #FFFFFF;
font-size: 15px;
line-height: 40px;
position: absolute;
right: 55px;
top: 0;
}
.lang a{
color:#fff;
text-decoration:none;
}
.lang a:hover{
text-decoration:underline;
}
#panel_container{
height: 100%;
}
#panel_container h1{
font: 28px/100% helvetica,arial,sans-serif;
margin: 0 0 20px;
padding: 0;
}
#panel_header{
background: none repeat scroll 0 0 #F1F1F1;
border-bottom: 1px solid #818181;
padding: 10px;
}
#panel_header:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#panel_header #panel_nav{
margin:0;
padding:0;
width:100%;
}
#panel_header #panel_nav li{
float: left;
list-style: none outside none;
}
#panel_header #panel_nav li a{
background: none repeat scroll 0 0 #fff;
border-radius: 13px 13px 13px 13px;
border: 1px solid #D6D6D6;
color: #000000;
float: left;
font-size:15px;
margin: 0 20px 0 0;
padding: 5px 10px;
text-decoration: none;
}
#panel_header #panel_nav li a:hover{
background: none repeat scroll 0 0 #818181;
border-radius: 13px 13px 13px 13px;
color: #fff;
}
#panel_content{
height: 100%;
}
#panel_sidebar2{
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.75);
box-shadow: 3px 0 3px #000000;
float: left;
height: 100%;
width: 16%;
}
#panel_sidebar{
padding: 62px 0 0;
}
#panel_sidebar ul{
background: none repeat scroll 0 0 #13547C;
margin: 0;
padding: 0 0 0 10px;
}
#panel_sidebar ul li{
background: none repeat scroll 0 0 #13547C;
border-top: 1px solid #145B87;
color: #FFFFFF;
font-size: 11px;
line-height: 29px;
list-style: none outside none;
}
#panel_sidebar li ul{
}
#panel_sidebar li ul ul{
}
#panel_sidebar a{
color: #FFFFFF;
font-size: 11px;
text-decoration: none;
}
#panel_sidebar a:hover{}
#panel_main2{
background:#fff;
float: left;
height: 100%;
padding: 0 1%;
width: 82%;
}
#panel_main{
padding: 62px 0 0;
}
#panel_main p label{
display: block;
padding: 3px;
}
#panel_main .translation_missing{
float: left;
padding: 3px;
width: 100px;
}
.text{
border: 1px solid #818181;
border-radius: 3px 3px 3px 3px;
font: 12px/100% helvetica,arial,sans-serif;
padding: 3px;
width: 205px;
}
+4
View File
@@ -0,0 +1,4 @@
/*
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/
+12
View File
@@ -0,0 +1,12 @@
.z-preview * {
width: 100%;
height: 100%;
}
.z-preview {
background: white;
border: solid;
position: absolute;
width: 200px;
float: right;
height: 200px;
}
+10
View File
@@ -0,0 +1,10 @@
ul.hmenu {
list-style: none;
margin: 0 0 2em;
padding: 0;
text-align: right;
}
ul.hmenu li {
display: inline;
}
View File
Whitespace-only changes.
+24
View File
@@ -0,0 +1,24 @@
ul.list{
margin:1em 0;
padding:0;
border-top:1px solid #ccc;
width:200px;
}
ul.list li{
margin:0;
padding:.5em 0;
list-style:none;
border-bottom:1px solid #ccc;
}
.error{
color:red;
}
.notice, .message{
color:green;
}
.warning{
color:orange;
}
+507
View File
@@ -0,0 +1,507 @@
/*
*This is a manifest file that'll automatically include all the stylesheets available in this directory
*and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
*the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*/
a, a:hover {
text-decoration: none;
outline:none;
}
html,body {
height:100%;
margin:0;
font-family: Helvetica, '微軟正黑體';
overflow-x:hidden
}
ul {
list-style:none;
list-style-image:none;
margin:0;
padding:0;
}
.info_input input{
border:none;
padding:5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
input:focus, select:focus, textarea:focus {
outline:none;
-moz-outline-radius: 0;
}
.clear:after {
content:".";
clear:both;
height:0;
display:block;
visibility:hidden;
}
#content{
height:100%;
}
#sidebar {
position:fixed;
top:0;
left:0;
height: 100%;
width:220px;
/*background-color:rgba(245,245,245,1);*/
background:url(<%= asset_path '75.png' %>) repeat left top;
-moz-box-shadow: 3px 0px 4px #472a12; /* Firefox */
-webkit-box-shadow: 3px 0px 4px #472a12;/* Safari 和 Chrome */
box-shadow: 3px 0px 4px #472a12; /* Opera 10.5 + */
}
#search {
background:url(<%= asset_path 'search_block_bg.jpg' %>) repeat-x left top;
margin-top:43px;
padding:15px 12px;
height:20px;
}
#search input {
background:url(<%= asset_path 'search_bg.png' %>) no-repeat left top;
border:none;
width:154px;
height:20px;
padding: 0 20px;
font-family:Helvetica;
}
h1 {
background:url(<%= asset_path 'h1_bg.png' %>) repeat-x left top;
margin:0;
line-height:21px;
height:21px;
font-size:12px;
padding-left:10px;
font-weight:normal;
text-shadow:0px -1px 0px #000;
color:#FFF;
border-top:1px solid #424344;
border-bottom:1px solid #1b1b1b;
}
#user_list .member_setup ul li.set_1 {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
#roles_list .member_setup ul li.set_2 {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
#infos_list .member_setup ul li.set_3 {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
#user_list .member_setup ul li.set_1 a span {
background-position:left bottom;
color:#eeeeee;
}
#roles_list .member_setup ul li.set_2 a span {
background-position:left bottom;
color:#eeeeee;
}
.member_setup ul {
color:#fff;
font-size:12px;
background:url(<%= asset_path 'line.png' %>) repeat-x left bottom;
}
.member_setup ul li {
background:url(<%= asset_path 'sidebar_li.jpg' %>) repeat-x left top;
/* line-height:31px;*/
border-top:1px solid #424344;
border-bottom:1px solid #000000;
}
.member_setup ul li:hover {
background-position:left bottom;
border-top:1px solid #406cc3;
border-bottom:1px solid #242628;
}
.member_setup ul li a {
display: block;
padding: 7px 0 6px 12px;
color:#c4c4c4;
}
.member_setup ul li a span {
background:url(<%= asset_path 'add_mamber.png' %>) left top no-repeat;
text-shadow: 0px 1px 0px #000;
line-height: 18px;
padding: 2px 0 1px 35px;
}
.member_setup ul li a:hover span {
background-position:left bottom;
color:#eeeeee;
}
#main{
position: relative;
margin-left: 260px;
padding-right: 40px;
height:100%;
}
.main_list {
padding-top:70px;
}
.main_list ul {
clear:both;
}
.main_list li {
background:url(<%= asset_path '75.png' %>) repeat left top;
margin-bottom:20px;
}
.main_list li span {
display:inline-block;
float:left;
padding-left:20px;
color:#fff;
font-size:14px;
line-height:40px;
width:18%;
}
.main_list li.list_head {
background:none;
margin-bottom:10px;
}
.main_list li.list_head span {
font-size:16px;
line-height:inherit;
text-shadow: 0px 1px 1px #3e2914;
}
.main_list li.list_item {
position:relative;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 0px 0px 6px #291508; /* Firefox */
-webkit-box-shadow: 0px 0px 6px #291508;/* Safari 和 Chrome */
box-shadow: 0px 0px 6px #291508; /* Opera 10.5 + */
}
.main_list li.list_item:hover {
border:1px solid #3699dd;
}
.main_list li.disable {
opacity:0.6;
}
.main_list li.list_item:hover span {
line-height:38px;
}
.main_list li .roles {
}
.main_list li .name {
}
.main_list li .email {
}
.main_list li .admin{
}
.main_list li .action{
float: right;
width:10%;
}
#main .action a{
background-image:url(<%= asset_path 'icon.png' %>);
text-indent:-9999px;
display:inline-block;
width:19px;
height:19px;
margin-top:8px;
margin-right:10px;
}
#main .action a.show{
background-position:left top;
}
#main .action a.edit{
background-position:-19px top;
}
#main .action a.delete{
background-position:-38px top;
}
#main a.switch{
background:url(<%= asset_path 'switch.png' %>) no-repeat left 3px;
width:40px;
}
#main .disable a.switch{
background:url(<%= asset_path 'switch.png' %>) no-repeat left bottom;
}
#main .action a.show:hover{
background-position:left -19px;
}
#main .action a.edit:hover{
background-position:-19px -19px;
}
#main .action a.delete:hover{
background-position:-38px -19px;
}
#main .list_item .roles {
background-image:url(<%= asset_path 'roles_type.jpg' %>);
background-repeat:repeat-x;
border-radius: 5px 0 0 5px;
-moz-border-radius: 5px 0 0 5px;
-webkit-border-radius: 5px 0 0 5px;
}
#roles_list .roles_block .action a{
margin-top:0;
margin-right:0;
}
.student {
background-position:0 -5px;
}
.teacher {
background-position:0 -54px;
}
#add_new a {
background-position:-54px -17px;
}
#add_new a:hover {
background-position: -54px 3px;
}
.buttom {
float:right;
}
#confirm a{
background-position:4px -70px;
}
#confirm a:hover{
background-position: 4px -51px;
}
#create a{
background-image: none;
padding: 0 10px;
}
#update a{
background-position:4px -112px;
}
#update a:hover{
background-position:4px -89px;
}
#back a{
background-position:4px -156px;
}
#back a:hover{
background-position:4px -133px;
}
.buttom a {
margin:0 0 20px 10px;
background-image:url(<%= asset_path 'icon.png' %>);
background-repeat:no-repeat;
font-size:12px;
color:#FFF;
display:inline-block;
padding:0 10px 0 25px;
background-color: rgba(0, 0, 0, 0.75);
line-height:24px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 3px 0px 4px #180902; /* Firefox */
-webkit-box-shadow: 3px 0px 4px #180902;/* Safari 和 Chrome */
box-shadow: 3px 0px 4px #180902; /* Opera 10.5 + */
}
.buttom a:hover {
color:#000;
font-weight:bold;
background-color: rgba(255, 255, 255, 1);
}
#porfile{
padding-top:100px;
}
#porfile h2 {
color: #FFFFFF;
font-weight: normal;
margin: 0;
padding: 0;
text-shadow: 0 3px 2px #000000;
position:absolute;
top:-30px;
}
#porfile .user_mail {
text-align: center;
background:url(<%= asset_path 'upload_but.png' %>) repeat-x left top;
border:none;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
padding:3px 10px 1px;
margin-top:10px;
width:110px;
height: 21px;
font-size: 12px;
color:#666666;
text-shadow: 0 1px 0 #FFFFFF;
}
#porfile label {
display:block;
text-shadow: 0 1px 0 #FFFFFF;
background:url(<%= asset_path 'upload_but.png' %>) repeat-x left top;
height: 25px;
width:110px;
padding: 0 0 0 18px;
border:1px solid #d8d8d8;
margin-top:10px;
color:#666666;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
#porfile label:hover{
background-position:left bottom;
color:#000;
border:1px solid #a6a6a6;
}
#porfile label input {
border:none;
margin: 6px 15px 0 0;
float:left;
}
#porfile label span {
display:block;
float:left;
line-height:27px;
font-size:12px;
}
.roles_block {
min-width:710px;
margin-bottom:50px;
position:relative;
padding-bottom: 20px;
background:url(<%= asset_path '75.png' %>) repeat left top;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
-webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
}
#user_list .roles_block {
margin-left:180px;
}
#person {
text-align:center;
left: 265px;
position: fixed;
top: 75px;
}
#person img {
background-color:#FFF;
padding:5px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
-webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
}
#person .mail {
color: #FFFFFF;
font-size: 12px;
text-shadow:0px 1px 0px #333;
font-weight:bold;
background:url(<%= asset_path 'line.png' %>) repeat-x left top;
padding-top:10px;
}
#upload, #edit{
margin: 0 auto;
display:block;
text-shadow: 0 1px 0 #FFFFFF;
background:url(<%= asset_path 'upload_but.png' %>) repeat-x left top;
height: 25px;
line-height:27px;
color:#666666;
width:128px;
text-align:center;
font-size:12px;
border:1px solid #d8d8d8;
margin-top:10px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
#upload:hover{
background-position:left bottom;
color:#000;
border:1px solid #a6a6a6;
}
#main hr{
height:8px;
border:none;
margin:0;
border-radius: 5px 5px 0px 0px;
-moz-border-radius: 5px 5px 0px 0px;
-webkit-border-radius: 5px 5px 0px 0px;
border-bottom:1px solid #000;
}
#basic_block hr{
background-color:#666666;
}
#teacher_block hr{
background-color:#0071a9;
}
#student_block hr{
background-color:#af0045;
}
.info_input {
padding:10px 20px;
}
.info_input table {
color:#fff;
width:100%;
font-size:14px;
}
.info_input table td {
padding:5px 10px 5px 0;
width: 10%;
}
.info_input .list_head {
background:url(<%= asset_path 'line.png' %>) left bottom repeat-x;
}
.info_input .list_head td {
}
.info_input .list_item {
color:#AEAEAE;
}
.info_input .add {
display:block;
padding-left:22px;
font-size:12px;
line-height:21px;
height:19px;
background:url(<%= asset_path 'icon.png' %>) no-repeat -59px 0;
margin-top: 10px;
color: #DDDDDD;
}
.info_input .add:hover {
color:#FFF;
background-position:-59px -19px;
}
.info_input li {
height:30px;
margin-bottom: 5px;
}
.info_input li span {
display:inline-block;
float:left;
color:#fff;
font-size:14px;
line-height:30px;
margin-right:10px;
}
#user_list .info_input li span {
width: 25%;
}
#roles_list .info_input li span {
width:15%;
}
.info_input li span:last-child {
}
#person select {
background:url(<%= asset_path 'upload_but.png' %>) repeat-x left top;
border:1px solid #d8d8d8;
margin-top: 10px;
width: 130px;
padding:3px 6px 3px 14px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border:none;
}
+305
View File
@@ -0,0 +1,305 @@
body{
background:url(<%= asset_path 'wood_floor.jpg' %>) fixed center 0;
/*background:url(images/jobs.jpg) fixed center bottom;*/
-moz-background-size:cover;
background-size:cover;
color: #000000;
margin: 0;
padding: 0;
}
#hmenu{
background:url(<%= asset_path 'orbitbar1.png' %>) repeat-x 0 0;
height: 50px;
position:fixed;
top:0;
left:0;
width:100%;
z-index: 5;
}
#orbit_icon {
margin-left: 10px;
}
#orbit_icon a {
background:url(<%= asset_path 'bar_orbit.png' %>) no-repeat scroll left top transparent;
height: 43px;
width: 41px;
display:block;
text-indent:-9999px;
}
#orbit_icon a:hover {
background:url(<%= asset_path 'bar_orbit.png' %>) no-repeat scroll left 50% transparent;
}
#hmenu #left{
left: 51px;
position: absolute;
top: 1px;
}
#hmenu #left a{
border-left: 1px solid #000000;
border-right: 1px solid #7F8488;
color: #FFFFFF;
display: block;
font-size: 17px;
height: 40px;
line-height: 40px;
padding: 0 10px;
text-align: center;
text-decoration: none;
}
#hmenu #left a:hover{
background:#000;
color: #FFFFFF;
}
#hmenu #right{
position: absolute;
right: 10px;
top: 1px;
width: 393px;
}
#hmenu #right a{
border-left: 1px solid #7F8488;
border-right: 1px solid #7F8488;
color: #FFFFFF;
display: block;
font-size: 17px;
height: 40px;
line-height: 40px;
padding: 0 10px;
text-align: center;
text-decoration: none;
width: 65px;
}
#hmenu #right a:hover{
background:#000;
color: #FFFFFF;
}
#hmenu form{
left: 27px;
position: absolute;
top: 8px;
}
#login_id{
background:url(<%= asset_path 'bar_id.png' %>) no-repeat scroll 0 0 transparent;
border: medium none;
color: #818181;
font-family: arial,sans-serif;
height: 26px;
left: 70px;
position: absolute;
top: 0;
width: 119px;
}
#login_id input {
background: none repeat scroll 0 0 transparent;
border: medium none;
font-family: arial,sans-serif;
height: 15px;
left: 21px;
position: absolute;
top: 4px;
width: 92px;
}
#login_pw {
background:url(<%= asset_path 'bar_pw.png' %>) no-repeat scroll 0 0 transparent;
border: medium none;
color: #818181;
font-family: arial,sans-serif;
height: 26px;
left: 193px;
position: absolute;
top: 0;
width: 119px;
}
#login_pw input {
background: none repeat scroll 0 0 transparent;
border: medium none;
font-family: arial,sans-serif;
height: 15px;
left: 21px;
position: absolute;
top: 4px;
width: 92px;
}
#login_btn input {
background:url(<%= asset_path 'bar_btn.png' %>) no-repeat scroll 0 0 transparent;
border: medium none;
color: #FFFFFF;
cursor: pointer;
font-family: arial,sans-serif;
height: 26px;
left: 316px;
margin: 0;
padding: 0 0 2px;
position: absolute;
top: 0;
width: 50px;
}
#log_out a{
background:url(<%= asset_path 'service_btn.png' %>) no-repeat scroll right 0 transparent;
border: medium none !important;
display: block !important;
height: 40px !important;
line-height: normal !important;
padding: 0 !important;
position: absolute;
/* right: -9px;*/
text-indent: -10000px;
top: 0px;
width: 43px !important;
}
#log_out a:hover{
background:url(<%= asset_path 'service_btn.png' %>) no-repeat scroll right bottom transparent !important;
}
#hmenu #right select{
font-family: helvetica,arial,sans-serif;
left: 97px;
position: absolute;
top: 10px;
width: 120px;
}
.content{
padding: 10px;
}
#user_info{
background: none repeat scroll 0 0 #FEFEFE;
border: 1px solid #818181;
border-radius: 5px 5px 5px 5px;
margin: 0 0 20px;
padding: 10px;
width: 250px;
}
#user_info table{
border-collapse: collapse;
width: 100%;
}
#user_info table td{
padding: 3px;
}
#sites_info{
background: -webkit-gradient(linear, left top, left bottom, from(white), to(#F8F8F8));
border: 1px solid #818181;
border-radius: 5px 5px 5px 5px;
float: left;
margin: 0 20px 20px 0;
width: 30%;
min-width: 320px;
}
#sites_info h3{
background: none repeat scroll 0 0 #EEEEEE;
border: 1px solid #DDDDDD;
border-radius: 5px 5px 5px 5px;
font: 24px/100% helvetica,arial,sans-serif;
margin: 2% 2% 0;
padding: 1%;
}
#sites_info table{
background: none repeat scroll 0 0 #fff;
border: 1px solid #DDDDDD;
border-radius: 5px 5px 5px 5px;
margin: 2%;
width: 96%;
}
#sites_info table td{
padding: 10px 5px;
}
#sites_info table th{
border-right: 1px solid #DDDDDD;
color: #808080;
font-size: 18px;
font-weight: normal;
padding: 10px 5px;
text-align: right;
width: 20%;
}
#purchases{
background: -webkit-gradient(linear, left top, left bottom, from(white), to(#F8F8F8));
border: 1px solid #818181;
border-radius: 5px 5px 5px 5px;
float: left;
width: 30%;
min-width: 320px;
}
#purchases h3{
background: none repeat scroll 0 0 #EEEEEE;
border: 1px solid #DDDDDD;
border-radius: 5px 5px 5px 5px;
font: 24px/100% helvetica,arial,sans-serif;
margin: 2% 2% 0;
padding: 1%;
}
#purchases table{
background: none repeat scroll 0 0 #fff;
border: 1px solid #DDDDDD;
border-radius: 5px 5px 5px 5px;
margin: 2%;
width: 96%;
}
#purchases table th{
border-right: 1px solid #DDDDDD;
color: #808080;
font-size: 18px;
font-weight: normal;
padding: 10px 5px;
text-align: right;
width: 20%;
}
#purchases table td{
padding: 10px 5px;
}
.design_page{
}
.style_list{
background:url(<%= asset_path 'preview.png' %>) no-repeat 0 0;
height:246px;
margin: 20px 0;
padding: 0 0 0 236px;
}
.style_list ul{
margin:0;
padding:0;
}
.style_list li{
color: #EDA330;
font-size: 20px;
list-style: none outside none;
margin: 0 0 20px;
}
.list_title{
color: #818181;
display: block;
font: 24px/100% ·L³n¥¿¶ÂÅé,sans-serif;
}
.buy_btn a{
background:url(<%= asset_path "buy_btn.png" %>) no-repeat scroll 0 0 transparent;
color: #000000;
display: block;
font-size: 22px;
height: 37px;
line-height: 37px;
text-align: center;
text-decoration: none;
text-shadow: 0 1px 0 #FFFFFF;
width: 170px;
}
.buy_btn a:hover{
background-position:0 bottom;
}
.bought_btn{
background:url(<%= asset_path "bought_btn.png" %>) no-repeat scroll 0 0 transparent;
color: #FFFFFF;
font-size: 22px;
height: 37px;
line-height: 37px;
text-align: center;
text-shadow: 0 1px 0 #C06408;
width: 170px;
}
+300
View File
@@ -0,0 +1,300 @@
/*
*
* Easy front-end framework
*
* Copyright (c) 2009 Alen Grakalic
* http://easyframework.com/license.php
*
* supported by Templatica (http://templatica.com)
* and Css Globe (http://cssglobe.com)
*
*/
/*
for more info about the strucure of this file
please read http://easyframework.com/documentation.php
*/
/* HTML elements */
h1, h2, h3, h4, h5, h6{
font-weight:normal;
margin:0;
line-height:1em;
}
h1{font-size:2em;margin-bottom:.5em;}
h2{font-size:1.75em;margin-bottom:.5142em;padding-top:.2em;}
h3{font-size:1.5em;margin-bottom:.7em;padding-top:.3em;}
h4{font-size:1.25em;margin-bottom:.6em;}
h5,h6{font-size:1em;margin-bottom:.5em;font-weight:bold;}
p, blockquote, ul, ol, dl, form, table, pre{line-height:inherit;margin:0 0 1.5em 0;}
ul, ol, dl{padding:0;}
ul ul, ul ol, ol ol, ol ul, dd{margin:0;}
li{margin:0 0 0 2em;display:list-item;list-style-position:outside;}
blockquote, dd{padding:0 0 0 2em;}
pre, code, samp, kbd, var{font:100% mono-space,monospace;}
pre{overflow:auto;}
abbr, acronym{
text-transform:uppercase;
border-bottom:1px dotted #000;
letter-spacing:1px;
}
abbr[title], acronym[title]{cursor:help;}
small{font-size:.9em;}
sup, sub{font-size:.8em;}
em, cite, q{font-style:italic;}
img{border:none;}
hr{display:none;}
table{width:100%;border-collapse:collapse;}
th,caption{text-align:left;}
form div{margin:.5em 0;clear:both;}
label{display:block;}
fieldset{margin:0;padding:0;border:none;}
legend{font-weight:bold;}
input[type="radio"],input[type="checkbox"], .radio, .checkbox{margin:0 .25em 0 0;}
/* // HTML elements */
/* common */
.left{float:left;margin-right:1em;}
.right{float:right;margin-left:1em;}
.center{text-align:center;}
.clear{clear:both;}
.first{margin-left:0 !important;}
.last{margin-right:0 !important;}
.top{margin-top:0 !important;}
.bottom{margin-bottom:0 !important;}
.hidden, .print{display:none;}
.graphic{
margin:0;
padding:0;
display:block;
overflow:hidden;
text-indent:-8000px;
}
/* // common */
/* base */
body, table, input, textarea, select, li, button{
font:1em Helvetica, Arial, Sans-Serif;
line-height:1.5em;
color:#333;
}
body{
font-size:13px;
background:#fff;
margin:0;
padding:0;
text-align:center;
}
a, a:visited{
text-decoration:none;
color:#06C;
}
a:hover{color:#999;}
ins{text-decoration:none;color:#900;font-style:italic;}
code{color:#555;}
pre{
margin-left:2em;
padding-left:2em;
border-left:1px solid #ccc;
}
blockquote{
margin-left:2em;
border-left:1px solid #ccc;
font-style:italic;
}
dt{font-weight:bold;}
th, td{padding:.5em 1em;line-height:1.5em;}
th{background:#eee;}
td{border-bottom:1px solid #eee;}
caption{font-style:italic;color:#777;margin:.5em 0;}
fieldset{
border:1px solid #ccc;
padding:1em 2em;
margin:0 0 1.5em 0;
}
legend{padding:2px 5px;}
form div.col{clear:none;}form div.first{clear:both;}
form div{overflow:hidden;}
input[type="text"], input[type="password"], textarea, .field, .area, select{
border:1px solid #aaa;
padding:5px;
background:#fff;
width:200px;
line-height:1em;
margin:0;
}
select{width:212px;}
textarea, .area{overflow:auto; height:150px; width:400px;}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus, .focus{background:#f5f5f5;outline:none;}
.submit{}
button{
border:none;
background:#555;
color:#fff;
padding:0 2.5em;
height:2em;
line-height:2em;
cursor:pointer;
}
.note, .success, .error{display:block;}
.error{color:#900;}
.success{color:#060;}
.note{font-weight:bold;}
.notvalid{border:1px solid #900 !important;}
.pullquote{
width:20%;
float:left;
margin-right:2em;
padding-right:2em;
border-right:1px solid #ccc;
text-align:right;
font-size:1.1em;
font-style:italic;
color:#777;
margin-bottom:.5em;
}
.boxout{
width:20%;
float:right;
margin-left:2em;
padding:1em 2em;
border:1px solid #ccc;
margin-bottom:.5em;
}
#easy_tooltip{
border:1px solid #e1e1e1;
padding:2px 10px;
background:#f5f5f5;
}
/* base */
/* layout */
#container{
margin:0 auto;
width:920px;
text-align:left;
position:relative;
}
.inner{
position:relative;
}
#header{
position:relative;
}
#footer{
position:relative;
clear:both;
}
.content{
clear:both;
padding:1em 0;
}
.main, .secondary, .tertiary, .quaternary{
float:left;
display:inline;
}
.main{width:700px;}
.secondary{width:200px;margin-left:20px;}
.tertiary{}
.quaternary{}
/* grid */
.cols{} /* main column container class */
.col{
float:left;
display:inline;
width:48%;margin-left:4%; /* 2 equal width columns layout - default */
}
.cols3 .col{width:30%;margin-left:5%;} /* 3 equal width columns layout */
.cols4 .col{width:22%;margin-left:4%;} /* 4 equal width columns layout */
/* use following classes to build custom grid (add as many as you want) */
.col1, .col2, .col3{float:left;display:inline;}
.col1{}
.col2{}
.col3{}
.indent1{}
.indent2{}
.indent3{}
/* grid */
/* // layout */
/* navigation */
#nav, #nav ul, #nav li{
margin:0;
padding:0;
list-style:none;
}
#nav li{
float:left;
display:inline;
position:relative;
line-height:32px;
height:32px;
margin-right:2em;
}
#nav ul{
position:absolute;
left:0;
top:32px;
padding:5px 10px;
width:200px;
background:#fff;
display:none;
z-index:1000;
}
#nav ul li{
float:none;
display:block;
}
/* //navigation */
/* header */
#header h1{
line-height:50px;
height:50px;
margin:0;
}
#header h1 a{
}
/* // header */
/* clearfix */
.inner:after, .content:after, .cols:after, .fixed:after{
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}
.inner, .content, .cols, .fixed{display:block;min-height:1%;}
* html .inner, * html .content, * html .cols, * html .fixed{height:1%;}
/* // clearfix */
@@ -0,0 +1,150 @@
/*
*
* Easy front-end framework
*
* Copyright (c) 2009 Alen Grakalic
* http://easyframework.com/license.php
*
* supported by Templatica (http://templatica.com)
* and Css Globe (http://cssglobe.com)
*
*/
/* HTML elements */
h1, h2, h3, h4, h5, h6{
font-weight:normal;
margin:0;
line-height:1em;
}
h1{font-size:2em;margin-bottom:.5em;}
h2{font-size:1.75em;margin-bottom:.5142em;padding-top:.2em;}
h3{font-size:1.5em;margin-bottom:.7em;padding-top:.3em;}
h4{font-size:1.25em;margin-bottom:.6em;}
h5,h6{font-size:1em;margin-bottom:.5em;font-weight:bold;}
p, blockquote, ul, ol, dl, form, table{line-height:inherit;margin:0 0 1.5em 0;}
ul, ol, dl{padding:0;}
ul ul, ul ol, ol ol, ol ul, dd{margin:0;}
li{margin:0;display:list-item;list-style-position:inside;}
blockquote, dd, li{padding:0 0 0 2em;}
pre, code, samp, kbd, var{font:100% mono-space,monospace;}
pre{overflow:auto;}
abbr, acronym{
text-transform:uppercase;
border:none;
letter-spacing:1px;
}
small{font-size:90%;}
sup, sub{font-size:85%;}
em, cite, q{font-style:italic;}
img{border:none;}
table{width:100%;border-collapse:collapse;}
th,caption{text-align:left;}
form{display:none;}
/* // HTML elements */
/* common */
.left{float:left;margin-right:1em;}
.right{float:right;margin-left:1em;}
.center{text-align:center;}
.clear{clear:both;}
.first{margin-left:0 !important;}
.last{margin-right:0 !important;}
.top{margin-top:0 !important;}
.bottom{margin-bottom:0 !important;}
.hidden, .graphic{display:none;}
/* // common */
/* base */
body, table, input, textarea, select, li, button{
font:100% Helvetica, Arial, Sans-Serif;
line-height:180%;
color:#000;
}
body{
font-size:13px;
background:#fff;
margin:0;
padding:0;
}
a{
text-decoration:none;
color:#555;
}
ins{text-decoration:none;color:#900;font-style:italic;}
code{color:#555;}
pre{
margin-left:2em;
padding-left:2em;
border-left:1px solid #ccc;
}
blockquote{
margin-left:2em;
border-left:1px solid #ccc;
font-style:italic;
}
dt{font-weight:bold;}
th, td{padding:8px;}
th{background:#eee;}
td{border-bottom:1px solid #eee;}
caption{font-style:italic;color:#777;margin:.5em 0;}
.excerpt{font-size:120%;font-style:italic;}
.note{font-weight:bold;}
/* base */
/* misc */
#container{}
.inner{}
#header{
margin-bottom:1em;
border-bottom:1px solid #ccc;
padding-bottom:1em;
}
.content{}
.main, .secondary, .tertiary, .quaternary{}
.main{}
.secondary{}
.tertiary{}
.quaternary{}
#footer{
margin-top:1em;
border-top:1px solid #ccc;
padding-top:1em;
position:relative;
clear:both;
}
#nav, .nav{display:none;}
#header h1{
line-height:50px;
height:50px;
margin:0;
}
#header h1 a{
}
/* // misc */
/* clearfix */
.inner:after, .content:after, .cols:after, .fixed:after{
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}
.inner, .content, .cols, .fixed{display:block;min-height:1%;}
* html .inner, * html .content, * html .cols, * html .fixed{height:1%;}
/* // clearfix */
Binary file not shown.
+147
View File
@@ -0,0 +1,147 @@
class Admin::DesignsController < ApplicationController
require "net/http"
require "uri"
require 'zip/zip'
layout "admin"
before_filter :authenticate_user!
before_filter :is_admin?
def upload_package
if !params[:design].nil?
temp_file = Tempfile.new("temp_file")
original_file = params[:design][:package_file]
#if original_file.content_type == 'application/zip'
temp_file.write(original_file.read.force_encoding('UTF-8'))
temp_file.rewind
filename = File.basename(original_file.original_filename,".zip")
unzip_design(temp_file, filename)
#else
# flash[:error] = "Upload file should be in zip format"
#end
temp_file.close
end
end
def index
@designs = Design.all.entries
end
def new
@design = Design.new
end
def update
@design = Design.find(params[:id])
if @design.update_attributes(params[:design])
flash[:notice] = "Successfully updated design and tasks."
redirect_to admin_designs_url(@design)
else
render :action => 'edit'
end
end
def edit_file
@design = Design.find(params[:id])
filename = params[:filename]
files = @design.themes + @design.javascripts + @design.images
file_to_removed = files.find{ |obj|
obj.file_filename == filename
}
type = file_to_removed._type
new_file = ""
Dir.mktmpdir('design_temp'){ |dir|
temp_file = File.new(dir+'/'+filename,'w+')
temp_file.write params[:context]
replace_target = eval("@design.#{type.downcase.pluralize}")
new_file = replace_target.build(:file => temp_file,:to_save=>true)
file_to_removed.destroy
new_file.save
temp_file.close
}
respond_to do |format|
format.js {}
end
end
def edit
@design = Design.find(params[:id])
end
def destroy
@design = Design.find(params[:id])
@design.destroy
redirect_to admin_designs_url
end
def create
@design = Design.new(params[:design])
if @design.save
flash[:notice] = "Successfully created design and tasks."
redirect_to admin_designs_url
else
render :action => 'new'
end
end
protected
def unzip_design(file, zip_name)
Zip::ZipFile.open(file) { |zip_file|
design = Design.new.from_json(zip_file.read("#{zip_name}/info.json"))
Dir.mktmpdir('f_path') { |dir|
design.build_layout
themes_entries = []
javascripts_entries = []
images_entries = []
zip_file.entries.each do |entry|
case (path = entry.to_s)
when /\A(#{zip_name})\/(default\.css)\z/ #for default css
filename = File.basename(entry.to_s)
temp_file = File.new(dir + '/' + filename, 'w+')
temp_file.write (zip_file.read entry ).force_encoding('UTF-8')
default_css = design.build_default_css
default_css.file = temp_file
default_css.file_filename = filename
default_css.to_save = true
when /\A(#{zip_name})\/(reset\.css)\z/ #for reset css
filename = File.basename(entry.to_s)
temp_file = File.new(dir + '/' + filename, 'w+')
temp_file.write (zip_file.read entry ).force_encoding('UTF-8')
reset_css = design.build_reset_css
reset_css.file = temp_file
reset_css.file_filename = filename
reset_css.to_save = true
when /\A(#{zip_name})\/(layout\.html)\z/ #for layout html
filename = File.basename(entry.to_s)
temp_file = File.new(dir + '/' + filename, 'w+')
temp_file.write (zip_file.read entry ).force_encoding('UTF-8')
design.layout.file = temp_file
design.layout.to_save=true
when /\A(#{zip_name})\/(themes)\/.*(\.css)\z/ #for themes css
themes_entries << entry
when /\A(#{zip_name})\/(javascripts)\/.*(\.js)\z/ #for js
javascripts_entries << entry
when /\A(#{zip_name})\/(images)\/.*((\.jpg)|(\.png)|(\.gif))\z/ #for img
images_entries << entry
end
end
['themes', 'javascripts', 'images'].each do |type|
eval("#{type}_entries").each do |entry|
filename = File.basename entry.to_s
temp_file = File.new(dir + '/' + filename, 'w+')
temp_file.write (zip_file.read entry).force_encoding('UTF-8')
build_and_store = eval("design.#{type}").build
build_and_store.file = temp_file
build_and_store.file_filename = filename
build_and_store.to_save = true
end
end
}
design.save
}
end
end
+1 -1
View File
@@ -12,7 +12,7 @@ class Admin::ItemsController < ApplicationController
if params[:item_id]
@item = Item.find(params[:item_id])
else
@item = Item.first(:conditions => {:parent_id => nil})
@item = get_homepage
end
end
@@ -1,54 +0,0 @@
class Admin::LayoutsController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :is_admin?
def index
@layouts = Layout.all.entries
end
def show
#TODO
# @layout = Layout.find(params[:id])
# redirect_to "/#{@layout.name}"
end
def new
@layout = Layout.new
end
def edit
@layout = Layout.find(params[:id])
end
def create
@layout = Layout.new(params[:layout])
if @layout.save
flash[:notice] = t('admin.create_success_layout')
redirect_to admin_layouts_url
else
render :action => 'new'
end
end
def update
@layout = Layout.find(params[:id])
if @layout.update_attributes(params[:layout])
flash[:notice] = t('admin.update_success_layout')
redirect_to admin_layouts_url
else
render :action => "edit"
end
end
def destroy
@layout = Layout.find(params[:id])
@layout.destroy
redirect_to admin_layouts_url
end
end
@@ -28,6 +28,7 @@ class Admin::PagePartsController < ApplicationController
@partial = 'edit_text'
@part_locale = params[:part_locale] || I18n.locale.to_s
when 'module'
@plugins=[{:module=>"Blog",:widgets=>[{:name=>"Blog",:path=>"panel/blog/widget_latest_post"},{:name=>"Blog",:path=>"panel/blog/widget_index"}]}]
when 'snippet'
end
end
+14 -6
View File
@@ -21,14 +21,15 @@ class Admin::PagesController < ApplicationController
@item = Page.new
@item.is_published = true
@item.parent_id = @parent_item.id rescue nil
@designs = Design.all.entries
@default_design = Design.first
end
def edit
@item = Page.find(params[:id])
# @item.content = parse_content(@item.content, {:locale => 'show'})
@item.content = parse_page_code(@item)
@i18n_variable = @item.i18n_variable
@code = params[:code]
@designs = Design.all.entries
@design = @item.design
end
def create
@@ -52,11 +53,10 @@ class Admin::PagesController < ApplicationController
def update
@item = Page.find(params[:id])
parse_content_update_code(@item, params[:page][:content])
if @item.update_attributes(params[:item])
if @item.update_attributes(params[:page])
flash[:notice] = t('admin.update_success_page')
respond_to do |format|
format.html {
format.html {
redirect_to admin_page_url(@item)
}
format.js {}
@@ -86,4 +86,12 @@ class Admin::PagesController < ApplicationController
end
end
def reload_themes
@design = Design.find(params[:id])
@themes = @design.themes
respond_to do |format|
format.js {}
end
end
end
@@ -0,0 +1,186 @@
class Admin::PurchasesController < ApplicationController
require "net/http"
require "uri"
require 'zip/zip'
layout "admin"
def index
@purchases = Purchase.all.entries
end
def download
@purchase = Purchase.first(:conditions => {:id => params[:id]})
download_purchase(@purchase, request.env['REQUEST_URI'].split('admin')[0].chop)
@purchase.downloaded = true
@purchase.save
redirect_to admin_purchases_url
end
def install_app
unzip_app
redirect_to admin_purchases_url
end
protected
def download_purchase(purchase, url)
uri = URI.parse("http://#{APP_CONFIG['store_ip']}/download/purchase")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
public_key = OpenSSL::PKey::RSA.new(File.read(APP_CONFIG['main_public_key']))
encrypted_data = public_key.public_encrypt({:purchase_id => purchase.purchase_id,
:purchase_type => purchase._type,
:roaming_id => Site.find(session[:site]).roaming_id,
:url => url}.to_json)
request.set_form_data({ :purchase => encrypted_data})
response = http.request(request)
temp_file = Tempfile.new("temp_file")
temp_file.binmode
temp_file.write response.body
temp_file.rewind
zip_name = response['content-disposition'].split('filename=')[1].gsub(/[\\\"]|.zip/, '') rescue ''
case purchase._type
when 'Pdesign'
unzip_design(temp_file, zip_name)
when 'PModuleApp'
unzip_module_app(temp_file, zip_name)
end
temp_file.close
temp_file.unlink
end
def unzip_design(file, zip_name)
Zip::ZipFile.open(file) do |zip_file|
encrypted = {}
['encrypted_data', 'encrypted_key', 'encrypted_iv'].each do |e|
encrypted.merge!(e => zip_file.read(e))
end
orig_file = decrypt_data(encrypted['encrypted_data'], encrypted['encrypted_key'], encrypted['encrypted_iv'])
temp_file = Tempfile.new("temp_file_zip")
temp_file.binmode
temp_file.write orig_file
temp_file.rewind
Zip::ZipFile.open(temp_file) { |orig_zip|
design = Design.new.from_json(orig_zip.read("#{zip_name}/#{zip_name}.json"))
Dir.mktmpdir('f_path') { |dir|
build_file(orig_zip, zip_name, dir, design.layout) if design.layout
build_file(orig_zip, zip_name, dir, design.default_css) if design.default_css
build_file(orig_zip, zip_name, dir, design.reset_css) if design.reset_css
['themes', 'javascripts', 'images'].each do |type|
design.send(type).each do |object|
build_file(orig_zip, zip_name, dir, object, type)
end
end
}
temp_file.close
temp_file.unlink
design.save
}
end
end
def unzip_app
zip_name = "NewBlog"
file = "#{Rails.root}/lib/NewBlog.zip"
destination = "#{Rails.root}/vendor/plugins"
Zip::ZipFile.open(file) do |zip_file|
orig_file = file
temp_file = Tempfile.new("temp_file_zip")
temp_file.binmode
temp_file.write orig_file
temp_file.rewind
app = AppModule.new.from_json(zip_file.read("#{zip_name}/#{zip_name}/#{zip_name}.json"))
zip_file.each do |f|
if (f.to_s=~/^#{zip_name}\/#{zip_name}\/*/)
f_path=File.join(destination, f.name.gsub(/^#{zip_name}\//, ''))
FileUtils.mkdir_p(File.dirname(f_path))
zip_file.extract(f, f_path) unless File.exist?(f_path)
end
end
log = Logger.new(STDOUT)
log.level = Logger::WARN
log.warn("App unzip procress is finished,please restart the server to apply effect")
#TODO Perform touch tmp/restart to restart in production env
end
end
def unzip_module_app(file, zip_name)
destination = "#{Rails.root}/vendor/plugins"
Zip::ZipFile.open(file) do |zip_file|
encrypted = {}
['encrypted_data', 'encrypted_key', 'encrypted_iv'].each do |e|
encrypted.merge!(e => zip_file.read(e))
end
orig_file = decrypt_data(encrypted['encrypted_data'], encrypted['encrypted_key'], encrypted['encrypted_iv'])
temp_file = Tempfile.new("temp_file_zip")
temp_file.binmode
temp_file.write orig_file
temp_file.rewind
Zip::ZipFile.open(temp_file) { |orig_zip|
module_app = ModuleApp.new.from_json(orig_zip.read("#{zip_name}/#{zip_name}.json"))
orig_zip.remove("#{zip_name}/#{zip_name}.json")
orig_zip.each do |orig|
inner_temp_file = Tempfile.new("inner_temp_file_zip")
inner_temp_file.binmode
inner_temp_file.write orig_zip.read(orig)
inner_temp_file.rewind
Zip::ZipFile.open(inner_temp_file) {|inner_zip|
inner_zip.each do |f|
if (f.to_s=~/^#{zip_name}\/*/)
f_path = File.join(destination, f.name)
FileUtils.mkdir_p(File.dirname(f_path))
inner_zip.extract(f, f_path) unless File.exist?(f_path)
end
end
}
inner_temp_file.close
inner_temp_file.unlink
end
module_app.save
log = Logger.new(STDOUT)
log.level = Logger::WARN
log.warn("App unzip procress is finished,please restart the server to apply effect")
}
temp_file.close
temp_file.unlink
end
end
def build_file(orig_zip, zip_name, dir, object, type = nil)
title = object.file_filename
temp = File.new(dir + '/' + title, 'w+')
temp.write orig_zip.read(zip_name + '/' + (type ? (type + '/') : '') + title)
object.file = temp
object.to_save = true
end
def unzip_file (file, destination)
end
end
+16
View File
@@ -0,0 +1,16 @@
class Admin::SitesController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :is_admin?
def index
@site = Site.first
redirect_to :action => :new unless @site
end
def new
@site = Site.new
end
end
@@ -5,6 +5,8 @@ class Admin::SnippetsController < ApplicationController
before_filter :find_parent_item
before_filter :is_admin?
#Snippet is a object admin user can define his own tag and being used later on in parser
def show
#TODO
end
@@ -1,6 +1,6 @@
class Admin::UserAttributesController < ApplicationController
layout "admin"
layout "member"
before_filter :authenticate_user!
def index
@@ -1,6 +1,6 @@
class Admin::UserInfoModelsController < ApplicationController
layout "admin"
layout "member"
before_filter :authenticate_user!
before_filter :is_admin?
before_filter :set_attribute, :only => [:index, :show, :new, :edit]
@@ -1,6 +1,6 @@
class Admin::UserRoleModelsController < ApplicationController
layout "admin"
layout "member"
before_filter :authenticate_user!
before_filter :is_admin?
before_filter :set_attribute, :only => [:index, :show, :new, :edit]
@@ -1,6 +1,6 @@
class Panel::UsersController < ApplicationController
class Admin::UsersController < ApplicationController
layout "panel"
layout "member"
before_filter :authenticate_user!
def index
@@ -28,7 +28,7 @@ class Panel::UsersController < ApplicationController
user_role.save
user_role.attribute_values.each(&:save)
end
flash[:notice] = t('panel.create_success_user')
flash[:notice] = t('admin.create_success_user')
redirect_to :action => :index
else
render :action => :new
@@ -48,10 +48,10 @@ class Panel::UsersController < ApplicationController
@user.avatar = params[:file] if params[:file]
if @user.id.to_s.eql?(session['warden.user.user.key'][1].to_s) && @user.admin != params[:user][:admin].to_i.to_b
flash.now[:error] = t('panel.cant_revoke_self_admin')
flash.now[:error] = t('admin.cant_revoke_self_admin')
end
if !flash[:error] && @user.update_attributes(params[:user])
flash[:notice] = t('panel.update_success_user')
flash[:notice] = t('admin.update_success_user')
redirect_to :action => :index
else
get_info_role_models
@@ -61,7 +61,7 @@ class Panel::UsersController < ApplicationController
def destroy
if params[:id].eql?(session['warden.user.user.key'][1].to_s)
flash[:error] = t('panel.cant_delete_self')
flash[:error] = t('admin.cant_delete_self')
else
@user = User.find(params[:id])
@user.destroy
+43
View File
@@ -6,6 +6,25 @@ class ApplicationController < ActionController::Base
helper :all
before_filter :set_locale, :set_site
def get_all_app_engines
ary = ["vender/plugins/NewBlog"]
app_engines = ary.collect{|t|
Rails::Engine.find t
}
app_engines.each{ |t|
# t.
}
end
def flaten_controller
ary=[]
Find.find(File.join(Rails.root , 'vendor/plugins/')) { |name|
require_dependency(name) if /_controller\.rb$/ =~ name
ary << name
}
ary
end
# Find the parent for the given item
def find_parent_item
@parent_item = Item.first(:conditions => { :id => BSON::ObjectId(params[:parent_id]) }) rescue nil
@@ -25,6 +44,8 @@ class ApplicationController < ActionController::Base
end
end
protected
# Set I18n.locale
def set_locale
# update session if passed
@@ -55,5 +76,27 @@ class ApplicationController < ActionController::Base
def set_current_item
session[:current_page] = params[:id] || @item.id rescue nil
end
def decrypt_data(encrypted_data, encrypted_key, encrypted_iv)
site = Site.find(session[:site])
if encrypted_data
private_key = OpenSSL::PKey::RSA.new(site.private_key)
cipher = OpenSSL::Cipher.new('aes-256-cbc')
cipher.decrypt
cipher.key = private_key.private_decrypt(encrypted_key)
cipher.iv = private_key.private_decrypt(encrypted_iv)
decrypted_data = cipher.update(encrypted_data)
decrypted_data << cipher.final
else
''
end
end
def get_homepage
Item.first(:conditions => {:parent_id => nil})
end
end
+18
View File
@@ -0,0 +1,18 @@
require 'mongo'
class GridfsController < ActionController::Metal
def serve
gridfs_path = env["PATH_INFO"].gsub("/gridfs/", "")
begin
gridfs_file = Mongo::GridFileSystem.new(Mongoid.database).open(gridfs_path, 'r')
self.response_body = gridfs_file.read
self.content_type = gridfs_file.content_type
rescue
self.status = :file_not_found
self.content_type = 'text/plain'
self.response_body = ''
end
end
end
-18
View File
@@ -1,18 +0,0 @@
class SitesController < ApplicationController
#layout 'set_up'
def index
@site = Site.first
if @site
@title = "site"
else
redirect_to :action => :new
end
end
def new
@site = Site.new
end
end
+1 -1
View File
@@ -12,7 +12,7 @@ module Admin::ItemHelper
ret << "<ul>"
ret << "<li>"
ret << (link_to node.name, dest)
ret << ' | ' << (link_to t('admin.code'), eval("edit_admin_#{node._type.downcase}_path(node, :code => true)")) if node._type.eql?('Page')
ret << ' | ' << (link_to t('admin.edit'), eval("edit_admin_#{node._type.downcase}_path(node)")) if node._type.eql?('Page')
ret << ' | ' << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page') if node._type.eql?('Page')
ret << ' | ' << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link') if node._type.eql?('Page')
ret << ' | ' << (link_to t(:delete), eval("delete_admin_#{node._type.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete')
+16
View File
@@ -0,0 +1,16 @@
module Admin::UserHelper
def show_user_attribute(object, key, locale = '')
attribute = object.attribute_values.detect {|av| av.key.to_s.eql?(key.to_s) || av[locale.to_s].eql?(locale.to_s) } rescue nil
if attribute
if locale.to_s.blank?
attribute['key']
else
attribute[locale.to_s]
end
else
''
end
end
end
+4
View File
@@ -0,0 +1,4 @@
module DesignHelper
end
Binary file not shown.
+108
View File
@@ -0,0 +1,108 @@
class Design
include Mongoid::Document
include Mongoid::Timestamps
field :title
field :author
field :intro
field :version
has_many :pages
embeds_one :layout
embeds_one :default_css, :class_name => "Stylesheet"
embeds_one :reset_css, :class_name => "Stylesheet"
embeds_many :stylesheets
embeds_many :themes
embeds_many :javascripts
embeds_many :images
embeds_many :custom_images, as: :design_image
validates_presence_of :title
validates_presence_of :author
after_save :procs_embedded_objects
# after_destroy :del_embedded_objects
def javascripts=(*attrs)
self.files = (attrs << 'javascripts')
end
def themes=(*attrs)
self.files = (attrs << 'themes')
end
def images=(*attrs)
self.files = (attrs << 'images')
end
# Update or create the attribute_model records
def files=(attrs)
case attrs.last
when 'layout'
files = self.layout.build
else
files = eval(attrs.last)
end
attrs[0].each do |a|
if a[:id].blank? && !a[:file].blank?
files.build(:file => a[:file], :to_save => true)
else
files.each do |file|
if file.id.to_s == a[:id]
file.to_destroy = a[:to_destroy]
end
end
end
end
end
protected
def del_embedded_objects
[[self.layout],self.themes, self.javascripts, self.images].each do |objects|
objects.each do |object|
object.destroy
end
end
end
def procs_embedded_objects
[self.javascripts, self.images].each do |objects|
objects.each do |object|
process_object(object)
end
end
if self.layout.to_save
self.layout.to_save = false
self.layout.save
end
[[self.default_css], [self.reset_css], self.themes].each do |objects|
objects.each do |object|
if object
to_parse_url = object.to_save ? true : false
process_object(object)
object.parse_urls if to_parse_url
end
end
end
end
def process_object(object)
if object.to_save
if object.file_filename.nil?
new_object = self.send(object._type.downcase.pluralize).build(object)
object.destroy
new_object.to_save = false
new_object.save
else
object.to_save = false
object.save
end
end
if object.to_destroy
object.destroy
end
end
end
+10
View File
@@ -0,0 +1,10 @@
class DesignFile
include Mongoid::Document
include Mongoid::Timestamps
mount_uploader :file, AssetUploader
field :to_save, :type => Boolean
field :to_destroy, :type => Boolean
end
+11
View File
@@ -0,0 +1,11 @@
class Image < DesignFile
field :in_css, :type => Boolean
field :name
field :html_id
field :html_class
embedded_in :design_image, polymorphic: true
mount_uploader :file, ImageUploader
end
+3
View File
@@ -0,0 +1,3 @@
class Javascript < DesignFile
embedded_in :design
end
+24
View File
@@ -0,0 +1,24 @@
class Layout < DesignFile
include Parser
attr_reader :content
embeds_one :menu
embedded_in :design
embeds_many :layout_parts
after_save :parse_layout
def content
self.file.read.force_encoding("UTF-8") rescue ''
end
def self.exist_one?
Layout.count > 0
end
def parse_layout
parse_layout_contents(self)
end
end
+18
View File
@@ -0,0 +1,18 @@
class LayoutPart
include Mongoid::Document
include Mongoid::Timestamps
field :name
field :id_tag
field :editable, :type => Boolean
field :class_tag
field :content
embedded_in :layout
def editable?
self.editable
end
end
+10
View File
@@ -0,0 +1,10 @@
class Menu
include Mongoid::Document
include Mongoid::Timestamps
field :levels, :type => Integer
field :values, :type => Hash
embedded_in :layout
end
+35
View File
@@ -0,0 +1,35 @@
class Stylesheet < DesignFile
embedded_in :design
mount_uploader :file_orig, AssetUploader
def parse_urls
orig_content = content = self.file.read.force_encoding("UTF-8")
self.remove_file!
self.remove_file_orig!
names = []
images = self.design.images
content.scan(/(?<=url)(.*?)(?=\))/){
css_name = $1.gsub(' ','').gsub('(','')
name = File.basename(css_name).gsub(/[\\\"]/, '')
file_name = images.detect{ |i| i.file_filename.eql?(name) }.file_url rescue nil
names << [css_name, file_name]
}
names.each do |name|
content.gsub!(name[0], name[1]) if name[1]
end
Dir.mktmpdir('f_path') { |dir|
orig_file_name = self.file_filename
temp_file = File.new(dir + '/' + orig_file_name, 'w+')
temp_file.write orig_content.force_encoding("UTF-8")
self.file_orig = temp_file
temp_file = File.new(dir + '/' + orig_file_name, 'w+')
temp_file.write content.force_encoding("UTF-8")
self.file = temp_file
self.save
}
end
end
+13
View File
@@ -0,0 +1,13 @@
class Theme < Stylesheet
embedded_in :design
field :name
before_save :set_name
protected
def set_name
self.name = File.basename(self.file_filename,".css")
end
end
-21
View File
@@ -1,21 +0,0 @@
class Layout
include Mongoid::Document
include Mongoid::Timestamps
field :name, :index => true
field :description
field :content
references_many :children, :class_name => "Item"
has_many :layout_parts
validates_presence_of :name
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
validates_uniqueness_of :name
def self.exist_one?
Layout.count > 0
end
end
-11
View File
@@ -1,11 +0,0 @@
class LayoutPart
include Mongoid::Document
include Mongoid::Timestamps
field :name
field :content
belongs_to :layout
end
+13
View File
@@ -0,0 +1,13 @@
class ModuleApp
include Mongoid::Document
include Mongoid::Timestamps
field :name_of_app
field :version
field :organization
field :author
field :intro
field :update_info
field :create_date
end
+9 -23
View File
@@ -1,20 +1,17 @@
class Page < Item
#include LayoutSupport
field :content
field :layout_name
field :layout_id
field :theme_id, :type => BSON::ObjectId, :default => nil
validates_presence_of :layout_name, :layout_id
referenced_in :layout
belongs_to :design
has_many :page_parts
embeds_many :custom_images, as: :design_image
def create_parts
page_layout = self.get_layout
page_layout.layout_parts.each do |p|
self.page_parts.create( :name => p.name, :i18n_variable_id => I18nVariable.create.id, :kind => 'text' ) if p['editable']
page_design = self.design
page_design.layout.layout_parts.each do |p|
self.page_parts.create( :name => p.name, :i18n_variable_id => I18nVariable.create.id, :kind => 'text' ) if p.editable?
end
end
@@ -26,19 +23,8 @@ class Page < Item
end
end
def get_layout
Layout.find(layout_id)
end
protected
def setup_default_value
super
if self.layout_id
self.layout_name = get_layout.name
end
def is_home?
self.parent ? false : true
end
end
+3
View File
@@ -0,0 +1,3 @@
class PDesign < Purchase
end
+3
View File
@@ -0,0 +1,3 @@
class PModuleApp < Purchase
end
+12
View File
@@ -0,0 +1,12 @@
class Purchase
include Mongoid::Document
include Mongoid::Timestamps
field :purchase_id
field :title
field :author
field :intro
field :downloaded, :type => Boolean
field :download_date, :type => Date
end
+23
View File
@@ -6,4 +6,27 @@ class Site
field :in_use_locales, :type => Array
field :valid_locales, :type => Array
field :roaming_id
field :private_key, :type => Binary
field :public_key, :type => Binary
field :school
field :department
def generate_keys
private_key = OpenSSL::PKey::RSA.generate(2048)
self.public_key = private_key.public_key.to_s
self.private_key = private_key.to_s
end
def registered?
!self.roaming_id.blank?
end
def up_to_date?
p res = %x(git remote show origin)
res = res.split('rails_3_1').pop.gsub('(', '').gsub(')','').strip rescue nil
res.eql?('local out of date') ? false : true
end
end
@@ -11,7 +11,7 @@ class AttributeModel
field :built_in, :type => Boolean, :default => false
field :disabled, :type => Boolean, :default => false
embedded_in :user_attribute_model, :inverse_of => :attribute_models
embedded_in :user_attribute_model
validates_uniqueness_of :key
# Destroy the i18n_variable
@@ -29,7 +29,8 @@ class AttributeModel
if self.i18n_variable_id
self.i18n_variable.update_attributes(attr)
else
var = I18nVariable.new(attr.merge({:key => self.key, :document_class => self.class, :parent_id => self.user_attribute_model.i18n_variable_id}))
# var = I18nVariable.new(attr.merge({:key => self.key, :document_class => self.class, :parent_id => self.user_attribute_model.i18n_variable_id}))
var = I18nVariable.new(attr.merge({:key => self.key, :document_class => self.class}))
var.save
self.i18n_variable_id = var.id
end
File renamed without changes.
+10 -22
View File
@@ -8,12 +8,11 @@ class User
mount_uploader :avatar, AvatarUploader
field :admin, :type => Boolean, :default => true
field :active_roles, :type => Array
field :active_role
has_many :user_attributes
has_many :user_roles
has_many :user_infos
before_save :clean_active_roles
# Update or create the user_role records
def user_roles=(*attrs)
@@ -49,26 +48,15 @@ class User
self.user_roles.detect {|a| a.key.to_s == key.to_s }
end
# Get the active user_role_models
def get_active_role_models
self.active_roles.map{ |role| get_role_model(role) } rescue []
end
# Get an user_role_model from key
def get_role_model(key)
UserRoleModel.first(:conditions => {:key => key})
end
# Get the active roles names or default to '-'
def get_roles
(self.active_roles.nil? || self.active_roles.empty?) ? '-' : self.active_roles.map{|role| I18nVariable.first(:conditions => {:key => role})[I18n.locale] rescue role}.join(' / ')
end
protected
# Remove empty values
def clean_active_roles
self.active_roles.delete('') if self.active_roles
def name
infos = self.user_infos.detect {|info| info.key.to_s.eql?('profile') }
if infos
first_name = infos.attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
last_name = infos.attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
return "#{first_name} #{last_name}"
else
return nil
end
end
end
@@ -7,7 +7,7 @@ class UserAttribute
has_many :attribute_values
# Update or create the attribute_value records
def attributes=(*args)
def attribute_values=(*args)
args[0].each do |value|
if value[:id].blank?
attribute_values.build(value)
@@ -53,7 +53,7 @@ class UserAttributeModel
end
def is_disabled?
self.disabled
self.disabled.blank? ? false : self.disabled
end
def get_enabled_attribute_models
File renamed without changes.
Loaded 100 of 1037 files, more files were not shown because too many files have changed in this diff. Show more