Compare commits

..
Author SHA1 Message Date
Matt K. Fu 74f9dea6b9 Merge commit '20bdeb3c2d55f6c0404ae604108c4c23c3d4aa67' into development 2013-04-02 18:40:48 +08:00
Matt K. Fu 20bdeb3c2d fix widget and fronted setting interface. checked with Spen 2013-04-02 18:39:46 +08:00
Matt K. Fu 695d712843 Merge commit '8b44f930f38d70098da5793bd795400eb088a052' into development
Conflicts:
	app/assets/javascripts/orbitdesktop.js
2013-04-02 18:05:30 +08:00
Matt K. Fu 3476237fa7 solved conflicts 2013-04-01 17:18:41 +08:00
48 changed files with 810 additions and 827 deletions

No files matched your search

+1 -4
View File
@@ -17,7 +17,4 @@ uploads/**/*
*.swp
*.pid
*.lck
.sass-cache/*
*.supported
*.lck
Binary file not shown.

Before

Width:  |  Height:  |  Size: 824 B

After

Width:  |  Height:  |  Size: 613 B

@@ -2,11 +2,11 @@ function update_cates_and_tags()
{
$('.select_option,.select_all').removeAttr('disabled');
$(".select_all:checked").each(function( obj ) {
$(this).parent().siblings('label').find('.select_option').attr('disabled',true);
// $(this).parent().siblings('label').find('.select_option').attr('disabled',"disabled");
$(this).parent().siblings('label').find('.select_option').removeAttr('checked');
});
$(".select_option:checked").each(function( obj ) {
$(this).parent().siblings('label').find('.select_all').attr('disabled',true);
// $(this).parent().siblings('label').find('.select_all').attr('disabled',"disabled");
$(this).parent().siblings('label').find('.select_all').removeAttr('checked');
});
}
+18 -22
View File
@@ -109,7 +109,7 @@ var orbitDesktop = function(dom){
this.themesettings = "";
this.theme = "4f8d3f493b67fcd05f086359";
this.transitionTime = 500;
this.currenthtml = "home";
this.currenthtml = "desktop.html";
this.currentface = "home";
this.desktopData = {};
this.tp = "";
@@ -632,7 +632,7 @@ var orbitDesktop = function(dom){
}
this.initializeDesktop = function(target,url,cache){ //this is for initializing main desktops that are sections and tiles
if(!target)target = "home";
if(!target)target = "desktop";
var bindHandlers = function(){ // this function will bind all the handlers in the desktop
// var groupWrapperWidth = 0;
// $("div#desktop .group").each(function(){groupWrapperWidth+=$(this).outerWidth(true);});
@@ -844,6 +844,7 @@ var orbitDesktop = function(dom){
x = parseInt(shape[0].substr(1,1));
y = parseInt(shape[1].substr(1,1));
}else{
console.log(row + " : " + col);
x = parseInt(shape[0].substr(1,1));
if(total_x % 2 == 0){
row = row + y;
@@ -866,7 +867,7 @@ var orbitDesktop = function(dom){
if(tile.data_category == "app")
$li = $('<li data-id="'+tile.id+'" class="app" data-row="'+row+'" data-col="'+col+'" data-sizex="'+x+'" data-sizey="'+y+'" data-title="'+tile.title+'" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile.data_content+'" class="appicon" onclick="return false;" data-url="'+tile.link+'"><img src="'+o.iconPath+tile.data_content+'.png" alt="" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
else
$li = $('<li data-id="'+tile.id+'" class="widget '+f+'" data-row="'+row+'" data-col="'+col+'" data-sizex="'+x+'" data-sizey="'+y+'" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'" js-link="'+tile.js[0].url+'" css-link="'+tile.css.url+'"><span class="tile '+tilecolor+' '+op+'"></span><div class="appholder"><div class="thmtxt o-loading"><i class="icon-spinning icon-spinner"></i> Loading</div></div><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
$li = $('<li data-id="'+tile.id+'" class="widget '+f+'" data-row="'+row+'" data-col="'+col+'" data-sizex="'+x+'" data-sizey="'+y+'" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'" js-link="'+tile.js[0].url+'" css-link="'+tile.css.url+'"><span class="tile '+tilecolor+' '+op+'"></span><div class="appholder"><div class="thmtxt all-loading"><i class="icon-spinner icon-spin"></i> Loading </div></div><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
@@ -1147,9 +1148,9 @@ var orbitDesktop = function(dom){
});
$.post("/desktop/save_desktop_settings",{"save":"appnewsection","appid":ui.draggable.attr("id"),"newsectionid":$(this).data("content"),"desktopid":o.desktopId});
// if(o.sectionId == $(this).data("content") || o.sectionId == elementParent.attr("id")){
if(o.sectionId == $(this).data("content") || o.sectionId == elementParent.attr("id")){
o.desktopData["home"]="";
// }
}
}
$(this).find('span.tile').addClass('op06',400);
},
@@ -1606,7 +1607,6 @@ var orbitDesktop = function(dom){
})
};
this.initializeWidgets = function(){ // this function will initialize all the widgets in the desktop
var elements = $("#group_wrapper li.widget");
$.each(elements,function(){
var widget = $(this);
@@ -1666,18 +1666,20 @@ var orbitDesktop = function(dom){
};
this.simple_drop_down = function(){
// simple dropdown menu
var $sdm = $('.sdm');
if( $sdm.find('.sdm_o') ){
$sdm.find('a').andSelf().on({
mouseenter: function(){
$(this).addClass('thmc2 thmtxt');
},
mouseleave: function(){
$(this).removeClass('thmc2 thmtxt');
}
if( !$('.sdm').children('.sdm_o').length > 0 ){
return;
} else {
$('.sdm').hover(function(){
$(this).stop(1,1).toggleClass('thmc2 thmtxt');
}, function(){
$(this).stop(1,1).toggleClass('thmc2 thmtxt');
});
$('.sdm').find('a').hover(function(){
$(this).stop(1,1).toggleClass('thmc2 thmtxt');
}, function(){
$(this).stop(1,1).toggleClass('thmc2 thmtxt');
});
}
};
this.simple_tab = function(){
// tab
@@ -1734,12 +1736,6 @@ var orbitDesktop = function(dom){
});
});
}
this.use_select2 = function(){
$('select:not(.select2-offscreen)').select2({
minimumResultsForSearch: -1
// minimumInputLength: -1
});
}
o.initialize();
}
+7 -1
View File
@@ -147,7 +147,7 @@ var orbitDesktopAPI = function(){
return;
}
}
var whtml =$('<div id="app_frame_'+o.windowcounter+'" class="thmc2 app_frame" data-app="'+settings.appid+'"><div id="content"><div id="header" class="hh3"><div class="dtitle hh3 hp" style="text-transform:capitalize;"><span class="thmtxth">'+settings.title+'</span></div><span class="icon-remove hh3 hp thmtxt"></span></div><div id="holder_'+o.windowcounter+'" class="app_holder"><iframe src="'+appurl+'" frameborder="0" scrolling="auto"></iframe><div class="clear"></div></div></div></div>');
var whtml =$('<div id="app_frame_'+o.windowcounter+'" class="thmc2 app_frame" data-app="'+settings.appid+'"><div id="content"><div id="header" class="hh3"><div class="dtitle w2 hh3 hp" style="text-transform:capitalize;"><span class="thmtxth">'+settings.title+'</span></div><span class="icon-remove hh3 hp thmtxt"></span></div><div id="holder_'+o.windowcounter+'" class="app_holder"><iframe src="'+appurl+'" frameborder="0" scrolling="auto"></iframe><div class="clear"></div></div></div></div>');
$(o.contentHolder).append(whtml);
var parentwindow = $(o.contentHolder).find("div#app_frame_"+o.windowcounter);
var app_holder_height = parentwindow.height() - 72;
@@ -206,6 +206,12 @@ var orbitDesktopAPI = function(){
}
}
};
this.use_select2 = function(){
$('select:not(.select2-offscreen)').select2({
minimumResultsForSearch: -1
// minimumInputLength: -1
});
}
};
orbitDesktopAPI.prototype.notifyImgPath = "temp";
orbitDesktopAPI.prototype.wallpaperPath = "temp";
+12 -20
View File
@@ -1,5 +1,10 @@
function get_part_id(){
return $(".edit_page_part,.edit_page").attr("action").split('/').pop();
function append_id(){
if ($("#object_id").length == 1) {
return "&id="+$("#object_id").val();
}
else{
return '';
};
}
$("div.editable").live("mouseenter mouseleave", function (event) {
@@ -7,37 +12,24 @@ $("div.editable").live("mouseenter mouseleave", function (event) {
});
$("#page_design").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
$.getScript($(this).attr('rel') + '?design_id=' + $(this).val() + append_id());
});
// $("#page_module_app_id").live('change', function() {
// var app_id = $(this).val();
// if(app_id!=''){
// $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_after_module_changed',function(data, textStatus){
// if(textStatus == 'success'){
// $(this).after(data);
// }
// });
// }
// else{
// $("#app_page_url").children().remove();
// }
// });
$("#module_app_list select").live('change', function() {
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val()); //?part_id=' + get_part_id());
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val() + append_id());
});
$("#widget_list select,#frontend_list select").live('change', function() {
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() );//+ '&part_id=' + get_part_id());
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() + append_id() );
});
$("#tag_list select").live('change', function() {
$.getScript($(this).attr('rel') + '?type=' + $(this).val());
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + append_id() );
});
$("select.widget_field_select").live('change', function() {
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val());
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val() + append_id() );
});
$('.part_kind').live('click', function() {
@@ -92,17 +92,20 @@
z-index: 9;
left: 0;
top: 60px;
font-size: 15px;
width: 120px; }
.sdm_o li {
border-top: solid 1px #f2f2f2; }
.sdm_o li:first-child {
border: none; }
.sdm_o a {
display: block; }
.sdm_o .admtxt {
display: block;
line-height: 36px; }
font-size: 15px; }
.sdm_o li {
border-top: solid 1px #f2f2f2; }
.sdm_o li:first-child {
border: none; }
.sdm_o a {
display: block; }
.sdm_o .admtxt {
display: block;
line-height: 36px; }
/* simple dropdown menu with indicator */
.sdm_mdr .sdm_t {
@@ -116,12 +119,15 @@
.s_menu {
font-size: 15px;
line-height: 36px; }
.s_menu li {
border-top: solid 1px #dddddd; }
.s_menu li:first-child {
border: none; }
.s_menu a {
display: block; }
.s_menu li {
border-top: solid 1px #dddddd; }
.s_menu li:first-child {
border: none; }
.s_menu a {
display: block; }
/* simple tabs */
.s_tab {
@@ -191,8 +197,7 @@
.s_form input[type=text]:focus,
.s_form input[type=password]:focus,
.s_form textarea:focus {
background-color: #f7f7f7;
border-color: #c4c4c4; }
background-color: #f7f7f7; }
.s_form textarea {
resize: none; }
.s_form textarea.full_height {
@@ -245,23 +250,27 @@
line-height: 36px;
position: relative;
z-index: 9; }
.toolbar .sdm, .toolbar .fn_g {
display: inline-block;
vertical-align: top; }
.toolbar .sdm_o {
top: 36px;
background-color: #f0f0f0; }
.toolbar button {
border: none;
outline: none;
padding: 0 16px;
margin: 0;
font-family: inherit;
font-size: 15px;
vertical-align: top; }
.toolbar .fn_btn {
display: inline-block;
vertical-align: top; }
.toolbar .sdm, .toolbar .fn_g {
display: inline-block;
vertical-align: top; }
.toolbar .sdm_o {
top: 36px;
background-color: #f0f0f0; }
.toolbar button {
border: none;
outline: none;
padding: 0 16px;
margin: 0;
font-family: inherit;
font-size: 15px;
vertical-align: top; }
.toolbar .fn_btn {
display: inline-block;
vertical-align: top; }
/* tiny scrollbar */
.tinycanvas {
@@ -359,7 +368,10 @@
.tinycanvas:hover .scrollbar {
visibility: visible;
opacity: 1; }
.toolbar + .tinycanvas, .s_tab + .tinycanvas {
height: 480px; }
#panel_r .tinycanvas {
padding: 12px 0; }
.toolbar + .tinycanvas,
.s_tab + .tinycanvas {
height: 480px; }
#panel_r .tinycanvas {
padding: 12px 0; }
@@ -58,21 +58,19 @@
left: 0;
top: 60px;
font-size: 15px;
width: 120px;
li {
border-top: solid 1px #f2f2f2;
}
li:first-child {
border: none;
}
a {
display: block;
}
.admtxt {
display: block;
line-height: 36px;
}
.sdm_o li {
border-top: solid 1px #f2f2f2;
}
.sdm_o li:first-child {
border: none;
}
.sdm_o a {
display: block;
}
.sdm_o .admtxt {
display: block;
line-height: 36px;
}
/* simple dropdown menu with indicator */
@@ -88,16 +86,15 @@
.s_menu {
font-size: 15px;
line-height: 36px;
li {
border-top: solid 1px #ddd;
}
li:first-child {
border: none;
}
a {
display: block;
}
}
.s_menu li {
border-top: solid 1px #ddd;
}
.s_menu li:first-child {
border: none;
}
.s_menu a {
display: block;
}
/* simple tabs */
@@ -168,7 +165,6 @@
&:focus {
background-color: lighten($gray, 10%);
border-color: darken($gray, 10%);
}
}
textarea {
@@ -232,28 +228,27 @@
line-height: 36px;
position: relative;
z-index: 9;
.sdm, .fn_g {
display: inline-block;
vertical-align: top;
}
.sdm_o {
top: 36px;
background-color: #f0f0f0;
}
button {
border: none;
outline: none;
padding: 0 16px;
margin: 0;
font-family: inherit;
font-size: 15px;
vertical-align: top;
}
.fn_btn {
display: inline-block;
vertical-align: top;
}
}
.toolbar .sdm, .toolbar .fn_g {
display: inline-block;
vertical-align: top;
}
.toolbar .sdm_o {
top: 36px;
background-color: #f0f0f0;
}
.toolbar button {
border: none;
outline: none;
padding: 0 16px;
margin: 0;
font-family: inherit;
font-size: 15px;
vertical-align: top;
}
.toolbar .fn_btn {
display: inline-block;
vertical-align: top;
}
/* tiny scrollbar */
@@ -356,11 +351,11 @@
visibility: visible;
opacity: 1;
}
.toolbar + &,
.s_tab + & {
height: 480px;
}
#panel_r & {
padding: 12px 0;
}
}
.toolbar + .tinycanvas,
.s_tab + .tinycanvas {
height: 480px;
}
#panel_r .tinycanvas {
padding: 12px 0;
}
+135 -101
View File
@@ -70,14 +70,11 @@ a:focus {
.clear:after {
display: table;
width: 100%;
content: '';
clear: both; }
content: ''; }
.o-loading {
font-size: 13px;
font-weight: normal; }
.fullsize .o-loading {
padding: 12px; }
.o-loading i {
font-size: 20px; }
@@ -469,8 +466,6 @@ a:focus {
margin: 0 12px 0 0;
position: relative;
z-index: 9; }
.dtitle .sdm_o {
width: auto; }
.tile {
display: block;
@@ -512,6 +507,7 @@ a:focus {
.theme_preview {
width: 528px;
height: 150px;
line-height: 36px;
font-size: 15px; }
@@ -522,11 +518,6 @@ a:focus {
margin-right: 12px; }
.theme_plate > div:first-child {
margin-right: 48px; }
.theme_plate .g_sep {
margin-right: 0; }
#color_input th {
vertical-align: bottom; }
.stock_wallpaper .ssl_item {
margin-bottom: 6px; }
@@ -536,11 +527,6 @@ a:focus {
font-weight: normal;
line-height: 60px;
text-align: left; }
.s_title.size_large {
font-size: 36px; }
.s_title.size_small {
font-size: 15px;
line-height: 2em; }
.s_subtitle {
font-size: 15px;
@@ -574,18 +560,8 @@ a:focus {
max-width: 340px; }
.g_sep {
width: 12px;
border-left: solid 1px white;
-webkit-box-sizing: border-box;
/* webkit */
-khtml-box-sizing: border-box;
/* konqueror */
-moz-box-sizing: border-box;
/* firefox */
-ms-box-sizing: border-box;
/* ie */
box-sizing: border-box;
/* css3 */ }
width: 11px;
border-left: solid 1px white; }
.grp {
height: 528px;
@@ -610,6 +586,7 @@ a:focus {
/* list item */
.list_t_item {
/*padding: 2px;*/
overflow: hidden; }
.list_t_title {
@@ -630,74 +607,118 @@ a:focus {
font-size: 11px;
-webkit-text-size-adjust: none; }
/* Connection Page */
#connection_setting {
height: 492px; }
#connection_setting .s_form {
float: left;
margin: 0 12px 0 0;
padding-left: 24px;
height: 100%;
border-left: solid 1px #dddddd; }
#connection_setting .s_form:first-child {
padding-left: 0;
border: none; }
#connection_setting .s_form label {
line-height: 30px; }
#connection_setting .s_form .c_icon, #connection_setting .s_form .c_name {
display: inline-block;
vertical-align: middle; }
#connection_setting .s_form .c_name {
padding: 0 12px;
font-size: 18px; }
#connection_setting .s_form input[type=text], #connection_setting .s_form input[type=password] {
width: 202px; }
#connection_setting .setting_btn {
margin-left: 12px; }
#connection_setting .setting_btn.disable {
background-color: #ddd;
cursor: default; }
#connection_setting .c_status {
float: right;
padding: 6px;
background-color: #eee;
color: #ccc;
font-size: 9px;
font-weight: normal;
-webkit-text-size-adjust: none;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
transition: background-color 0.5s ease; }
#connection_setting .c_status_on {
background-color: #51A351;
color: #fff; }
#connection_setting .c_info {
padding: 7px 6px;
background-color: #fcfcfc;
cursor: default;
font-size: 18px;
font-weight: normal; }
/* Journal Papers */
[page-name="journal_p_list"] .list_t_item .inner {
padding-left: 30px; }
[page-name="journal_p_list"] .list_item_action {
font-size: 12px;
float: left;
margin-left: -30px; }
[page-name="journal_p_list"] .list_item_action a {
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px; }
[page-name="journal_p_list"] .list_item_action .icon-star-empty {
color: #999;
font-size: 20px; }
[page-name="journal_p_list"] .list_item_action .icon-star {
color: #faa732;
font-size: 20px; }
[page-name="journal_p_list"] .list_item_action .icon-check-empty {
color: #999;
font-size: 20px; }
[page-name="journal_p_list"] .list_item_action .icon-check {
color: #333;
font-size: 20px; }
[page-name="journal_p_list"] .file_view .list_t_des {
overflow: hidden; }
[page-name="journal_p_list"] .list_item_action a {
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px; }
[page-name="journal_p_list"] .list_item_action .icon-star-empty {
color: #999;
font-size: 20px; }
[page-name="journal_p_list"] .list_item_action .icon-star {
color: #faa732;
font-size: 20px; }
[page-name="journal_p_list"] .list_item_action .icon-check-empty {
color: #999;
font-size: 20px; }
[page-name="journal_p_list"] .list_item_action .icon-check {
color: #333;
font-size: 20px; }
[page-name="journal_p_list"] .list_t_item.file_view {
height: 148px; }
[page-name="journal_p_list"] .file_view .file {
float: left;
width: 120px;
display: inline-block;
width: 62px;
height: 50px;
padding: 6px;
margin: 1px;
position: relative;
-webkit-box-sizing: border-box;
/* webkit */
-khtml-box-sizing: border-box;
/* konqueror */
-moz-box-sizing: border-box;
/* firefox */
-ms-box-sizing: border-box;
/* ie */
box-sizing: border-box;
/* css3 */ }
[page-name="journal_p_list"] .file_view .file:hover {
background-color: #f7f7f7; }
[page-name="journal_p_list"] .file_view .file img {
width: 38px;
height: 38px;
position: absolute;
left: 6px;
top: 6px; }
[page-name="journal_p_list"] .file_view .file .filetitle {
display: block;
width: 100%;
height: 38px;
padding-left: 40px;
overflow: hidden;
-webkit-box-sizing: border-box;
/* webkit */
-khtml-box-sizing: border-box;
/* konqueror */
-moz-box-sizing: border-box;
/* firefox */
-ms-box-sizing: border-box;
/* ie */
box-sizing: border-box;
/* css3 */ }
text-align: center; }
[page-name="journal_p_list"] .file_view .file:hover {
background-color: #ddd; }
[page-name="journal_p_list"] .file_view .file img {
width: 24px;
display: block;
margin: 0 auto;
margin-top: 4px; }
[page-name="journal_p_list"] .file_view .filetitle {
font-size: 11px;
-webkit-text-size-adjust: none; }
/* Journal Paper Add */
#paper_add .s_grid_con {
@@ -706,22 +727,27 @@ a:focus {
margin-left: 12px;
padding-left: 12px;
border-left: solid 1px #eeeeee; }
#paper_add .s_grid_con:first-child {
margin-left: 0;
padding-left: 0;
border: none; }
#paper_add .s_grid_con:first-child {
margin-left: 0;
padding-left: 0;
border: none; }
#paper_add .f_w {
width: 336px; }
#paper_add label {
margin-right: 0; }
/* Journal Journal list */
[page-name="journal_p_journal"] .datalist_item .inner {
padding-left: 30px; }
[page-name="journal_p_journal"] .list_item_action {
font-size: 12px;
float: left;
margin-left: -30px; }
[page-name="journal_p_journal"] .list_item_action i {
color: #999;
font-size: 20px;
@@ -730,6 +756,7 @@ a:focus {
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px; }
[page-name="journal_p_journal"] .list_t_desc {
font-family: Arial, sans-serif;
font-size: 12px;
@@ -738,17 +765,21 @@ a:focus {
/* Journal Co-Author */
[page-name="journal_p_coauthor"] .list_t_item {
height: 110px; }
[page-name="journal_p_coauthor"] .list_item_function a {
display: inline-block;
padding: 4px;
font-family: Arial, sans-serif;
font-size: 11px;
-webkit-text-size-adjust: none; }
[page-name="journal_p_coauthor"] .info {
font-family: Arial, sans-serif; }
[page-name="journal_p_coauthor"] .info li {
margin-bottom: 8px;
color: #999; }
[page-name="journal_p_coauthor"] .info .name {
font-size: 18px;
line-height: 24px;
@@ -757,6 +788,7 @@ a:focus {
/* Journal Co-Author Relationship*/
[page-name="journal_p_coauthor_relation"] .edit_co_author_relation {
/*margin-left: -10px;*/ }
[page-name="journal_p_coauthor_relation"] .form_space {
margin-bottom: 10px;
font-size: 18px;
@@ -777,16 +809,18 @@ a:focus {
right: 0;
bottom: 0;
z-index: 12; }
.app_frame .app_holder {
background-color: #fff;
position: absolute;
width: 100%; }
.app_frame #header .icon-remove {
display: block;
float: right;
line-height: 60px;
font-size: 20px;
cursor: pointer; }
.app_frame .app_holder {
background-color: #fff;
position: absolute;
width: 100%; }
.app_frame #header .icon-remove {
display: block;
float: right;
line-height: 60px;
font-size: 20px;
cursor: pointer; }
/*Tooltip popup */
.desktop_toolpopup {
+155 -167
View File
@@ -66,15 +66,11 @@ a:focus { outline: none; }
display: table;
width: 100%;
content: '';
clear: both;
}
.o-loading {
font-size: 13px;
font-weight: normal;
.fullsize & {
padding: 12px;
}
i {
font-size: 20px;
}
@@ -446,11 +442,7 @@ a:focus { outline: none; }
margin: 0 12px 0 0;
position: relative;
z-index: 9;
.sdm_o {
width: auto;
}
}
.tile {
display: block;
width: 100%;
@@ -458,7 +450,7 @@ a:focus { outline: none; }
position: absolute;
left: 0;
top: 0;
}
}
.widget.gs_w {
cursor: move;
}
@@ -492,6 +484,7 @@ a:focus { outline: none; }
}
.theme_preview {
width: 528px;
height: 150px;
line-height: 36px;
font-size: 15px;
}
@@ -505,12 +498,6 @@ a:focus { outline: none; }
> div:first-child {
margin-right: 48px;
}
.g_sep {
margin-right: 0;
}
}
#color_input th {
vertical-align: bottom
}
.stock_wallpaper {
.ssl_item {
@@ -523,14 +510,6 @@ a:focus { outline: none; }
font-weight: normal;
line-height: 60px;
text-align: left;
&.size_large {
font-size: 36px;
}
&.size_small {
font-size: 15px;
line-height: 2em;
}
}
.s_subtitle {
font-size: 15px;
@@ -567,9 +546,9 @@ a:focus { outline: none; }
max-width: 340px;
}
.g_sep {
width: 12px;
border-left: solid 1px #fff;
@include box-sizing;
width: 11px;
border-left:
solid 1px #fff;
}
@@ -593,7 +572,7 @@ a:focus { outline: none; }
}
/* list item */
.list_t_item { overflow: hidden; }
.list_t_item { /*padding: 2px;*/ overflow: hidden; }
.list_t_title {
margin-bottom: 6px;
color: #333;
@@ -613,145 +592,155 @@ a:focus { outline: none; }
-webkit-text-size-adjust: none;
}
/* Journal Papers */
[page-name="journal_p_list"] {
.list_t_item .inner { padding-left: 30px; }
.list_item_action {
font-size: 12px;
float: left;
margin-left: -30px;
a {
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px;
}
.icon-star-empty { color: #999; font-size: 20px; }
.icon-star { color: #faa732; font-size: 20px; }
.icon-check-empty { color: #999; font-size: 20px; }
.icon-check { color: #333; font-size: 20px; }
}
.file_view {
.list_t_des {
overflow: hidden;
}
.file {
float: left;
width: 120px;
height: 50px;
padding: 6px;
margin: 1px;
position: relative;
@include box-sizing;
/* Connection Page */
#connection_setting { height: 492px; }
#connection_setting .s_form {
float: left;
margin: 0 12px 0 0;
padding-left: 24px;
height: 100%;
border-left: solid 1px #ddd;
}
#connection_setting .s_form:first-child { padding-left: 0; border: none; }
#connection_setting .s_form label { line-height: 30px; }
#connection_setting .s_form .c_icon, #connection_setting .s_form .c_name {
display: inline-block;
vertical-align: middle;
}
#connection_setting .s_form .c_name { padding: 0 12px; font-size: 18px; }
#connection_setting .s_form input[type=text], #connection_setting .s_form input[type=password] { width: 202px; }
#connection_setting .setting_btn { margin-left: 12px; }
#connection_setting .setting_btn.disable { background-color: #ddd; cursor: default; }
#connection_setting .c_status {
float: right;
padding: 6px;
background-color: #eee;
color: #ccc;
font-size: 9px;
font-weight: normal;
-webkit-text-size-adjust: none;
@include transition-type("background-color",0.5);
}
#connection_setting .c_status_on { background-color: #51A351; color: #fff; }
#connection_setting .c_info {
padding: 7px 6px;
background-color: #fcfcfc;
cursor: default;
font-size: 18px;
font-weight: normal;
}
&:hover {
background-color: lighten($gray, 10%);
}
img {
width: 38px;
height: 38px;
position: absolute;
left: 6px;
top: 6px;
}
.filetitle {
display: block;
width: 100%;
height: 38px;
padding-left: 40px;
overflow: hidden;
@include box-sizing;
}
}
}
/* Journal Papers */
[page-name="journal_p_list"] .list_t_item .inner { padding-left: 30px; }
[page-name="journal_p_list"] .list_item_action {
font-size: 12px;
float: left;
margin-left: -30px;
}
[page-name="journal_p_list"] .list_item_action a {
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px;
}
[page-name="journal_p_list"] .list_item_action .icon-star-empty { color: #999; font-size: 20px; }
[page-name="journal_p_list"] .list_item_action .icon-star { color: #faa732; font-size: 20px; }
[page-name="journal_p_list"] .list_item_action .icon-check-empty { color: #999; font-size: 20px; }
[page-name="journal_p_list"] .list_item_action .icon-check { color: #333; font-size: 20px; }
[page-name="journal_p_list"] .list_t_item.file_view {
height: 148px;
}
[page-name="journal_p_list"] .file_view .file {
display: inline-block;
width: 62px;
height: 50px;
text-align: center;
}
[page-name="journal_p_list"] .file_view .file:hover {
background-color: #ddd;
}
[page-name="journal_p_list"] .file_view .file img {
width: 24px;
display: block;
margin: 0 auto;
margin-top: 4px;
}
[page-name="journal_p_list"] .file_view .filetitle {
font-size: 11px;
-webkit-text-size-adjust: none;
}
/* Journal Paper Add */
#paper_add {
.s_grid_con {
float: left;
height: 456px;
margin-left: 12px;
padding-left: 12px;
border-left: solid 1px #eee;
&:first-child {
margin-left: 0;
padding-left: 0;
border: none;
}
}
.f_w { width: 336px; }
label { margin-right: 0; }
#paper_add .s_grid_con {
float: left;
height: 456px;
margin-left: 12px;
padding-left: 12px;
border-left: solid 1px #eee;
}
#paper_add .s_grid_con:first-child { margin-left: 0; padding-left: 0; border: none; }
#paper_add .f_w { width: 336px; }
#paper_add label { margin-right: 0; }
/* Journal Journal list */
[page-name="journal_p_journal"] {
.datalist_item .inner {
padding-left: 30px;
}
.list_item_action {
font-size: 12px;
float: left;
margin-left: -30px;
}
.list_item_action i {
color: #999;
font-size: 20px;
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px;
}
.list_t_desc {
font-family: Arial, sans-serif;
font-size: 12px;
color: #999;
}
[page-name="journal_p_journal"] .datalist_item .inner {
padding-left: 30px;
}
[page-name="journal_p_journal"] .list_item_action {
font-size: 12px;
float: left;
margin-left: -30px;
}
[page-name="journal_p_journal"] .list_item_action i {
color: #999;
font-size: 20px;
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px;
}
[page-name="journal_p_journal"] .list_t_desc {
font-family: Arial, sans-serif;
font-size: 12px;
color: #999;
}
/* Journal Co-Author */
[page-name="journal_p_coauthor"] {
.list_t_item {
height: 110px;
}
.list_item_function {}
.list_item_function a {
display: inline-block;
padding: 4px;
font-family: Arial, sans-serif;
font-size: 11px;
-webkit-text-size-adjust: none;
}
.info {
font-family: Arial, sans-serif;
}
.info li {
margin-bottom: 8px;
color: #999;
}
.info .name {
font-size: 18px;
line-height: 24px;
color: #333;
}
[page-name="journal_p_coauthor"] {}
[page-name="journal_p_coauthor"] .list_t_item {
height: 110px;
}
[page-name="journal_p_coauthor"] .list_item_function {}
[page-name="journal_p_coauthor"] .list_item_function a {
display: inline-block;
padding: 4px;
font-family: Arial, sans-serif;
font-size: 11px;
-webkit-text-size-adjust: none;
}
[page-name="journal_p_coauthor"] .info {
font-family: Arial, sans-serif;
}
[page-name="journal_p_coauthor"] .info li {
margin-bottom: 8px;
color: #999;
}
[page-name="journal_p_coauthor"] .info .name {
font-size: 18px;
line-height: 24px;
color: #333;
}
/* Journal Co-Author Relationship*/
[page-name="journal_p_coauthor_relation"]{
.edit_co_author_relation {
/*margin-left: -10px;*/
}
.form_space {
margin-bottom: 10px;
font-size: 18px;
font-family: Arial, sans-serif;
}
[page-name="journal_p_coauthor_relation"] .edit_co_author_relation {
/*margin-left: -10px;*/
}
[page-name="journal_p_coauthor_relation"] .form_space {
margin-bottom: 10px;
font-size: 18px;
font-family: Arial, sans-serif;
}
/* Journal New Co-Author */
#new_co_author label {
@@ -770,19 +759,18 @@ a:focus { outline: none; }
right: 0;
bottom: 0;
z-index: 12;
.app_holder {
background-color: #fff;
position: absolute;
width: 100%;
}
#header .icon-remove {
display: block;
float: right;
line-height: 60px;
font-size: 20px;
cursor: pointer;
}
}
.app_frame .app_holder {
background-color: #fff;
position: absolute;
width: 100%;
}
.app_frame #header .icon-remove {
display: block;
float: right;
line-height: 60px;
font-size: 20px;
cursor: pointer;
}
/*Tooltip popup */
@@ -65,7 +65,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
font-size: 1px;
text-decoration: none;
border: 0;
background: url("select2/select2.png") right top no-repeat;
background: url(<%= asset_path "desktop/select2/select2.png" %>) right top no-repeat;
cursor: pointer;
outline: 0; }
@@ -86,7 +86,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
position: absolute;
z-index: 9999;
top: 100%;
background-color: #dddddd;
background: #fff;
color: #000;
border: 1px solid #dddddd;
border-top: 0; }
@@ -98,12 +98,12 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
.select2-container .select2-choice div {
display: block;
width: 21px;
width: 20px;
height: 100%;
position: absolute;
right: 0;
top: 0;
border-left: solid 1px #dddddd;
background: #ccc;
-webkit-box-sizing: border-box;
/* webkit */
-khtml-box-sizing: border-box;
@@ -119,7 +119,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
display: block;
width: 100%;
height: 100%;
background: url("select2/select2.png") no-repeat 0 50%; }
background: url(<%= asset_path "desktop/select2/select2.png" %>) no-repeat 0 1px; }
.select2-search {
display: inline-block;
@@ -152,21 +152,23 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
margin-top: 4px; }
.select2-search input.select2-active {
background: white image-url("select2-spinner.gif") no-repeat 100%; }
background: white image-url(<%= asset_path "desktop/select2/select2-spinner.gif" %>) no-repeat 100%; }
.select2-container-active .select2-choice,
.select2-container-active .select2-choices {
outline: none; }
.select2-dropdown-open .select2-choice {
border-bottom-color: transparent; }
border-bottom-color: transparent;
background-color: #eee; }
.select2-dropdown-open .select2-choice div {
background-color: #dddddd;
background: transparent;
border-left: none;
filter: none; }
.select2-dropdown-open .select2-choice div b {
background-position: -20px 50%; }
background-position: -18px 1px; }
/* results */
.select2-results {
@@ -263,7 +265,7 @@ disabled look for disabled choices in the results dropdown
display: none; }
.select2-more-results.select2-active {
background: #f4f4f4 image-url("select2-spinner.gif") no-repeat 100%; }
background: #f4f4f4 image-url(<%= asset_path "desktop/select2/select2-spinner.gif" %>) no-repeat 100%; }
.select2-more-results {
background: #f4f4f4;
@@ -325,7 +327,7 @@ disabled look for disabled choices in the results dropdown
background: transparent !important; }
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
background: white image-url("select2-spinner.gif") no-repeat 100% !important; }
background: white image-url(<%= asset_path "desktop/select2/select2-spinner.gif" %>) no-repeat 100% !important; }
.select2-default {
color: #999999 !important; }
@@ -354,23 +356,23 @@ disabled look for disabled choices in the results dropdown
.select2-search-choice-close {
display: block;
width: 10px;
height: 10px;
width: 12px;
height: 13px;
position: absolute;
right: 3px;
top: 5px;
top: 4px;
font-size: 1px;
outline: none;
background: url("select2/select2.png") right top no-repeat; }
background: url(<%= asset_path "desktop/select2/select2.png" %>) right top no-repeat; }
.select2-container-multi .select2-search-choice-close {
left: 3px; }
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
background-position: right -20px; }
background-position: right -11px; }
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
background-position: right -20px; }
background-position: right -11px; }
/* disabled styles */
.select2-container-multi.select2-container-disabled .select2-choices {
@@ -395,13 +397,12 @@ disabled look for disabled choices in the results dropdown
.select2-offscreen {
position: absolute;
left: -10000px;
top: 0; }
left: -10000px; }
/* Retina-ize icons */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
background-image: url("select2/select2x2.png") !important;
background-image: url(<%= asset_path "desktop/select2/select2x2.png" %>) !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important; }
@@ -86,7 +86,8 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
position: absolute;
z-index: 9999;
top: 100%;
background-color: $gray;
background: #fff;
color: #000;
border: 1px solid $gray;
border-top: 0;
@@ -100,12 +101,12 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
.select2-container .select2-choice div {
display: block;
width: 21px;
width: 20px;
height: 100%;
position: absolute;
right: 0;
top: 0;
border-left: solid 1px $gray;
background: #ccc;
@include box-sizing;
}
@@ -113,7 +114,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
display: block;
width: 100%;
height: 100%;
background: url('select2/select2.png') no-repeat 0 50%;
background: url('select2/select2.png') no-repeat 0 1px;
}
.select2-search {
@@ -166,15 +167,16 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
.select2-dropdown-open .select2-choice {
border-bottom-color: transparent;
background-color: #eee;
}
.select2-dropdown-open .select2-choice div {
background-color: $gray;
// border-left: none;
background: transparent;
border-left: none;
filter: none;
}
.select2-dropdown-open .select2-choice div b {
background-position: -20px 50%;
background-position: -18px 1px;
}
/* results */
@@ -375,11 +377,11 @@ disabled look for disabled choices in the results dropdown
.select2-search-choice-close {
display: block;
width: 10px;
height: 10px;
width: 12px;
height: 13px;
position: absolute;
right: 3px;
top: 5px;
top: 4px;
font-size: 1px;
outline: none;
background: url('select2/select2.png') right top no-repeat;
@@ -390,10 +392,10 @@ disabled look for disabled choices in the results dropdown
}
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
background-position: right -20px;
background-position: right -11px;
}
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
background-position: right -20px;
background-position: right -11px;
}
/* disabled styles */
@@ -425,7 +427,6 @@ disabled look for disabled choices in the results dropdown
.select2-offscreen {
position: absolute;
left: -10000px;
top: 0;
}
/* Retina-ize icons */
+57 -72
View File
@@ -1,7 +1,6 @@
class Admin::PagePartsController < OrbitBackendController
include Admin::FrontendWidgetInterface
layout "site_editor"
before_filter :authenticate_user!
before_filter :is_admin?
before_filter :set_current_item
@@ -18,59 +17,75 @@ class Admin::PagePartsController < OrbitBackendController
end
end
def new
end
def edit
@part = PagePart.find(params[:id])
@module_apps = ModuleApp.where(:key.in=>OrbitApp::Module::WidgetUtility.all.keys).order_by(:title, :asc)
@module_app = @part.module_app ? @part.module_app : nil
@user_choose = @part.widget_path
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
@tag_objects = @r_tag.classify.constantize.all rescue nil
if @module_app
@widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0]
@widget_style = @module_app.get_widget_style[@widget_path][:style] unless @widget_path.nil? or @module_app.nil?
end
@module_apps = ModuleApp.for_widget_select
@categories = nil
@tags = nil
@page_frontend_data_counts = nil
# @frontend_styles = nil
unless @module_app.nil?
@categories = @module_app.get_categories
@tags = @module_app.get_tags
end
@widget_path = @part.widget_path ? @part.widget_path : (@module_app.widgets.keys[0] rescue nil)
if @module_app && @module_app.widgets.any?{|b| b.class == Array}
@widget_style = @module_app.widgets[@widget_path] if !@widget_path.blank? && !@module_app.widgets.blank?
end
@selected={
:module_app=> @part.module_app ? @part.module_app : nil,
:app_frontend_url=> @part.widget_path || "default_widget", #@module_apps.first
:category=>nil, #fetch by method: get_categories_and_tags
:tag=>nil, #fetch by method: get_categories_and_tags
:page_frontend_data_count=>nil,
:frontend_style => nil,
:widget_path=> nil
}
@selected[:widget_path] = @part.widget_path ? @part.widget_path : (@selected[:module_app].widgets.keys[0] rescue nil)
get_categories_and_tags
get_frontend_data_count
@app_frontend_urls = get_app_frontend_urls
end
def create
def reload_widgets
@part = PagePart.find params[:id]
@selected={
:module_app=> ModuleApp.find(params["module_app_id"])
}
get_categories_and_tags
get_frontend_data_count
@selected[:app_frontend_url] = @selected[:module_app].has_default_widget? ? 'default_widget' : @selected[:module_app].widget_options.first.name
end
def reload_widget_styles
@part = PagePart.find(params[:id])
@selected={
:module_app=> ModuleApp.find(params["module_app_id"]),
:app_frontend_url=> params["frontend"], #@module_apps.first
:category=>nil, #fetch by method: get_categories_and_tags
:tag=>nil, #fetch by method: get_categories_and_tags
:page_frontend_data_count=>nil,
:frontend_style => nil,
:widget_path=> nil
}
get_categories_and_tags
get_frontend_data_count
end
def reload_widget_field
@index = params[:field_seri].to_i
@part = PagePart.find(params[:id])
@selected = {
:module_app=> ModuleApp.find(params["module_app_id"]),
:default_widget_field=>params[:widget_field_value]
}
end
def update
@part = PagePart.find(params[:id])
# params[:page_part][:widget_field_type] = nil
# params[:page_part][:widget_field_is_link] = nil
if params[:page_part][:module_app].blank?
params[:page_part][:module_app] = nil
end
if params[:page_part][:tag].nil? || params[:page_part][:tag].include?("nil")
params[:page_part][:tag] = []
end
if params[:page_part][:category].nil? || params[:page_part][:category].include?("nil")
params[:page_part][:category] = []
end
clean_tags_and_category_params
# params[:page_part][:widget_field].each{|t| t[2] = (t[2]=="true" ? true : false )} if !params[:page_part][:widget_field].blank?
if @part.update_attributes(params[:page_part])
@@ -101,41 +116,6 @@ class Admin::PagePartsController < OrbitBackendController
redirect_to admin_items_url( :parent_id => @item.parent_id )
end
def reload_widget_field
@index = params[:field_seri].to_i
@part = PagePart.find params[:id]
@choosen_field = params[:widget_field_value]
@module_app = @part.module_app
@module_app = ModuleApp.find params[:module_app_id] if @module_app.nil?
end
def reload_widgets
@part = PagePart.find params[:id]
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
@categories =@module_app ? @module_app.get_categories : []
@tags =@module_app ? @module_app.get_tags : []
@widget_path = @module_app.widgets.keys[0] if (@module_app && @module_app.widgets[0].blank? )
@widget_style = @module_app.widgets[@widget_path] if ( !@widget_path.blank? )
@part.widget_path = @module_app.widgets.first if( @module_app)
respond_to do |format|
format.js {}
end
end
def reload_widget_styles
@module_app = ModuleApp.find(params[:module_app_id])
@part = PagePart.find params[:id]
@user_choose =@widget_path= params[:frontend]
@widget_style = @module_app.widgets[@widget_path]
respond_to do |format|
format.js {}
end
end
def reload_r_tag_options
@part = PagePart.find params[:id]
@r_tag = params[:type]
@@ -146,6 +126,11 @@ class Admin::PagePartsController < OrbitBackendController
end
protected
def get_app_frontend_urls
@selected[:module_app] ? @selected[:module_app].widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} : []
# has_old_value = @selected[:module_app].app_pages[@selected[:app_frontend_url]]
# @frontend_styles = has_old_value ? has_old_value["style"] : (@selected[:module_app].app_pages.first[1]["style"] rescue nil)
end
def set_children_sub_menu(part)
part.page.children.each do |child|
+111 -99
View File
@@ -1,5 +1,6 @@
class Admin::PagesController < Admin::ItemsController
helper Admin::PagePartsHelper
include Admin::FrontendWidgetInterface
def show
@item = Page.find(params[:id])
respond_to do |format|
@@ -13,40 +14,123 @@ helper Admin::PagePartsHelper
def new
@item = Page.new
@item.parent = Item.find(params[:parent_id]) rescue nil
@apps = ModuleApp.where(:key.in => OrbitApp::Module::FrontendUtility.all.keys)
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
# @apps = ModuleApp.for_frontend_select
@designs = Design.all.entries
@design = Design.first
@themes = Design.first.themes
@module_apps = ModuleApp.for_frontend_select
@app_frontend_urls = nil
@categories = nil
@tags = nil
@page_frontend_data_counts = nil
@frontend_styles = nil
@selected={
:design => @designs.first,
:theme=> @themes.first,
:module_app=>nil,#@module_apps.first
:app_frontend_url=> nil, #@module_apps.first
:category=>nil,
:tag=>nil,
:page_frontend_data_count=>nil,
:frontend_style => nil
}
end
def edit
@item = Page.find(params[:id])
@user_choose = @item.app_frontend_url
@apps = ModuleApp.where(:key.in => OrbitApp::Module::FrontendUtility.all.keys)
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
@designs = Design.all.entries
@design = @item.design ? @item.design : @designs.first
@themes = @item.design ? @item.design.themes : @designs.first.themes
@module_apps = ModuleApp.for_frontend_select
@categories = nil
@tags = nil
@page_frontend_data_counts = nil
@frontend_styles = nil
if @item.module_app
@app_frontend_urls = []
setup_app_frontend_and_style
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if @item.module_app.has_default_widget?
@selected={
:design => @item.design || @designs.first,
:theme=> @item.theme,
:module_app=>@item.module_app,#@module_apps.first
:app_frontend_url=> @item.app_frontend_url, #@module_apps.first
:category=>nil, #fetch by method: get_categories_and_tags
:tag=>nil, #fetch by method: get_categories_and_tags
:page_frontend_data_count=>nil,
:frontend_style => nil
}
@app_frontend_urls = @item.module_app ? select_array_for_app_frontend_urls(@item.module_app.app_pages) : nil
get_categories_and_tags
get_frontend_data_count
end
@module_app = @item.module_app
@frontend_path = @item.app_frontend_url
if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array}
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
end
get_categories_and_tags
else
@module_app = @module_apps[0]
def reload_themes
design = Design.find(params[:design_id])
@themes = design.themes
respond_to do |format|
format.js {}
end
end
def reload_frontend_pages
@item = Page.find(params[:id]) rescue Page.new
@selected={
:design => nil,
:theme=> nil,
:module_app=>(ModuleApp.find(params[:module_app_id]) rescue nil),
:app_frontend_url=> @item.app_frontend_url || 'default_widget', #@module_apps.first
:category=>nil, #fetch by method: get_categories_and_tags
:tag=>nil, #fetch by method: get_categories_and_tags
:page_frontend_data_count=>nil,
:frontend_style => nil
}
@app_frontend_urls = @selected[:module_app] ? select_array_for_app_frontend_urls(@selected[:module_app].app_pages) : nil
get_categories_and_tags
get_frontend_data_count
get_frontend_styles
respond_to do |format|
format.js {}
end
end
def reload_front_end_setting
@item = Page.find(params[:id]) rescue Page.new
@categories = nil
@tags = nil
@page_frontend_data_counts = nil
@selected={
# :design => @item.design || @designs.first,
# :theme=> @item.theme,
:module_app=>ModuleApp.find(params[:module_app_id]),
:app_frontend_url=> params[:frontend] ,
:category=>nil, #fetch by method: get_categories_and_tags
:tag=>nil, #fetch by method: get_categories_and_tags
:page_frontend_data_count=>nil,
:frontend_style => nil
}
@app_frontend_urls = @selected[:module_app].nil? ? nil : @selected[:module_app].app_pages.each{|name,data| [I18n.t(data["i18n"]),name]}
@frontend_styles = @selected[:module_app].app_pages[params["frontend"]]["style"] rescue nil
end
def reload_widget_field
@index = params[:field_seri].to_i
@item = Page.find(params[:id]) rescue Page.new
@selected = {
:module_app=> (ModuleApp.find(params[:module_app_id]) || @item.module_app ),
:default_widget_field=>params[:widget_field_value]
}
# @choosen_field = params[:widget_field_value]
# @module_app = @item.module_app
# @module_app = ModuleApp.find params[:module_app_id] if @module_app.nil?
end
def create
clean_tags_and_category_params
@item = Page.new(params[:page])
if @item.module_app && @item.module_app.key == 'page_content'
@@ -63,7 +147,6 @@ helper Admin::PagePartsHelper
end
else
flash.now[:error] = t('create.error.page')
@apps = ModuleApp.where(:key.in => OrbitApp::Module::FrontendUtility.all.keys)
@designs = Design.all.entries
@design = Design.first
render :action => "new"
@@ -71,28 +154,12 @@ helper Admin::PagePartsHelper
end
def update
clean_tags_and_category_params
@item = Page.find(params[:id])
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
end
# params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type], params[:page][:frontend_field_is_link] ) if params[:page][:frontend_field]
# params[:page][:frontend_field_type] = nil
# params[:page][:frontend_field_is_link] = nil
if params[:page][:tag].nil? || params[:page][:tag].include?("nil")
params[:page][:tag] = []
end
if params[:page][:category].nil? || params[:page][:category].include?("nil")
params[:page][:category] = []
end
# params[:page][:frontend_field].each{|t| t[2] = (t[2]=="true" ? true : false )} if !params[:page][:frontend_field].blank?
if @item.update_attributes(params[:page])
flash[:notice] = t('update.success.page')
respond_to do |format|
@@ -126,65 +193,10 @@ helper Admin::PagePartsHelper
end
end
def reload_front_end_setting
@item = Page.find params[:id] rescue nil
@module_app = ModuleApp.find params[:module_app_id]
@user_choose = params[:frontend] #choosen frontend
protected
@app_frontend_urls = @module_app.nil? ? nil : @module_app.app_pages.each{|name,data| [I18n.t(data["i18n"]),name]}
@frontend_styles = @module_app.app_pages[params["frontend"]]["style"] rescue nil
# =======
# @chosen_frontend = @user_choose = params[:frontend]
# >>>>>>> Stashed changes
end
def get_categories_and_tags
unless @module_app.nil?
@categories = @module_app.get_categories
@tags = @module_app.get_tags
end
def get_frontend_styles
has_old_value = @selected[:module_app].app_pages[@selected[:app_frontend_url]]
@frontend_styles = has_old_value ? has_old_value["style"] : (@selected[:module_app].app_pages.first[1]["style"] rescue nil)
end
def setup_app_frontend_and_style
if @module_app.nil?
@item.module_app.app_pages.each{|name,data| @app_frontend_urls << [I18n.t(data["i18n"]),name]}
@frontend_styles = @item.module_app.app_pages[@item.frontend_style]["style"] if @frontend_styles.nil? && @item && @item.module_app.app_pages[@item.frontend_style]
@frontend_styles = @item.module_app.app_pages.first[1]["style"] if @frontend_styles.nil? && @item
else
@module_app.app_pages.each{|name,data| @app_frontend_urls << [I18n.t(data["i18n"]),name]}
@frontend_styles = @module_app.app_pages[params["frontend"]]["style"] rescue nil
@frontend_styles = @module_app.app_pages.first[1]["style"] if @frontend_styles.nil?
end
end
def reload_frontend_pages
@item = Page.find params[:id] rescue nil
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
@app_frontend_urls = []
setup_app_frontend_and_style
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if(@module_app && @module_app.has_default_widget?)
get_categories_and_tags
respond_to do |format|
format.js {}
end
end
def reload_themes
@design = Design.find(params[:id])
@themes = @design.themes
respond_to do |format|
format.js {}
end
end
def reload_widget_field
@index = params[:field_seri].to_i
@item = params.has_key?(:id) ? Page.find(params[:id] ) : Page.new
@choosen_field = params[:widget_field_value]
@module_app = @page.module_app
@module_app = ModuleApp.find params[:module_app_id] if @module_app.nil?
end
end
+8 -1
View File
@@ -48,11 +48,18 @@ class DefaultWidgetController< OrbitWidgetController
@widget_image_field = @default_widget["image"] || @default_widget[:image]
case @page_part
when Page
@fields = @page_part.frontend_field
@frontend_field_names = @page_part.frontend_field_name
@frontend_classes = @page_part.frontend_class
@frontend_sat_to_links = @page_part.frontend_sat_to_link
@data_limit = @page_part.frontend_data_count.is_a?(Fixnum) ? @page_part.frontend_data_count : (@page_part.frontend_data_count.to_i rescue 3)
@paginate = true
@page_id = @page_part.id
when PagePart
@frontend_field_names = @page_part.widget_field_name
@frontend_classes = @page_part.widget_class
@frontend_sat_to_links = @page_part.widget_sat_to_link
@fields = @page_part.widget_field
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
end
@@ -0,0 +1,58 @@
module Admin::FrontendWidgetInterface
protected
def get_categories_and_tags
unless @selected[:module_app].nil?
@categories = @selected[:module_app].get_categories
@tags = @selected[:module_app].get_tags
end
end
def get_frontend_data_count
local_item = set_local_item
@page_frontend_data_counts = @selected[:module_app].get_registration.get_data_count rescue []
@selected[:page_frontend_data_count] = case local_item
when PagePart
local_item.widget_data_count
when Page
local_item.frontend_data_count
end
end
def clean_tags_and_category_params
field_name = set_field_name
if self.class==Admin::PagePartsController and params[field_name][:module_app].blank?
params[field_name][:module_app] = nil
end
if params[field_name][:tag].nil? || params[field_name][:tag].include?("nil")
params[field_name][:tag] = []
end
if params[field_name][:category].nil? || params[field_name][:category].include?("nil")
params[field_name][:category] = []
end
end #of clean_tags_and_category_params
def set_local_item
local_item = @part
local_item = @item if local_item.nil? && @item
local_item
end
def set_field_name
case self.class.to_s
when "Admin::PagesController"
return "page"
when "Admin::PagePartsController"
return "page_part"
end # of case
end
def select_array_for_app_frontend_urls(hash)
ary = hash.collect{|name,data| [I18n.t(data["i18n"]),name]}
ary << [I18n.t('default_widget.name'),'default_widget'] if @selected[:module_app] and @selected[:module_app].has_default_widget?
ary
end
end
+15 -28
View File
@@ -1,7 +1,8 @@
module Admin::PagePartsHelper
include Admin::FrontendWidgetInterface
def support_link
url_method = @module_app.get_default_widget[:url_method]
url_method = @selected[:module_app].get_default_widget[:url_method]
unless url_method.nil?
res = "Link:"
res << select_tag( "page_part[widget_field_is_link][]", options_for_select([["NotLink",false],["Link1",url_method]]))
@@ -9,10 +10,8 @@ module Admin::PagePartsHelper
end
end
def get_widget_field_rel(local_item=nil)
local_item = @part if local_item.nil? && @part
local_item = @item if local_item.nil? && @item
case local_item
def get_widget_field_rel
case set_local_item
when Page
reload_after_list_changed_admin_pages_path
when PagePart
@@ -34,8 +33,7 @@ module Admin::PagePartsHelper
unless field_is_checked.nil? and assign_field_name_value.nil?
origin_field = nil
origin_field = @module_app.widget_fields.select{|t| t.first.to_s==(assign_field_name_value || local_item.default_widget_field_name[i])}.first
origin_field = @selected[:module_app].widget_fields.select{|t| t.first.to_s==(assign_field_name_value || local_item.default_widget_field_name[i])}.first
if origin_field and origin_field[2]==:link #choosen_field_is_link
@@ -51,11 +49,10 @@ module Admin::PagePartsHelper
end
def widget_field_options(i,local_item=nil)
local_item = @part if local_item.nil? && @part
local_item = @item if local_item.nil? && @item
local_item = set_local_item
options = @module_app.widget_fields.collect do |widget_field|
label = I18n.t("#{@module_app.key}.default_widget.#{widget_field[0]}")
options = @selected[:module_app].widget_fields.collect do |widget_field|
label = I18n.t("#{@selected[:module_app].key}.default_widget.#{widget_field[0]}")
[label, widget_field[0]]
end
case local_item
@@ -66,11 +63,9 @@ module Admin::PagePartsHelper
end
end
def widget_fiield_class_options(i,local_item=nil)
def widget_field_class_options(i,local_item=nil)
options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
local_item = @part if local_item.nil? && @part
local_item = @item if local_item.nil? && @item
local_item = set_local_item
case local_item
when Page
options_for_select(options, (local_item.frontend_class[i] if (local_item) ))
@@ -115,12 +110,8 @@ module Admin::PagePartsHelper
end
def nil_checkbox_button(part,tag_or_cate)
field_name = case part
when PagePart
'page_part'
when Page
'page'
end
field_name = set_field_name
content_tag :label,:class=>"radio inline" do
op = check_box_tag("#{field_name}[#{tag_or_cate}][]", 'nil' , eval("#{tag_or_cate}_checked_value(part,'')"),:class=>'select_all')
op << I18n.t("default_widget.no_value")
@@ -128,12 +119,8 @@ module Admin::PagePartsHelper
end
def nil_radio_button(part,tag_or_cate)
field_name = case part
when PagePart
'page_part'
when Page
'page'
end
field_name = set_field_name
content_tag :label,:class=>"radio inline" do
op = radio_button(field_name, tag_or_cate, '' , :checked => eval("#{tag_or_cate}_checked_value(part,'')"))
op << I18n.t("default_widget.no_value")
@@ -141,7 +128,7 @@ module Admin::PagePartsHelper
end
def show_default_widget_setting_panel
@module_app && @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget'
@selected[:module_app] && @selected[:module_app].has_default_widget? && (@selected[:app_frontend_url]== 'default_widget')
end
def show_custom_widget_setting_panel
+10 -4
View File
@@ -19,11 +19,17 @@ class ModuleApp
self[:widgets] = reg.get_widgets
end
# def app_pages
# get_registration.get_app_pages
# end
# scope :for_frontend_select,
scope :standard_sorting ,order_by(:title, :asc)
def self.for_widget_select
where(:key.in=>OrbitApp::Module::WidgetUtility.all.keys).order_by(:title, :asc)
end
def self.for_frontend_select
where(:key.in => OrbitApp::Module::FrontendUtility.all.keys).excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
end
def enable_frontend?
self[:enable_frontend]
+3 -2
View File
@@ -7,7 +7,7 @@ class Page < Item
field :content, localize: true
field :app_frontend_url
field :theme_id, :type => BSON::ObjectId, :default => nil
# field :theme_id, :type => BSON::ObjectId, :default => nil
field :category,type: Array, :default => []
field :tag, type: Array,:default => []
field :view_count, :type => Integer, :default => 0
@@ -21,7 +21,8 @@ class Page < Item
field :frontend_sat_to_link , :type => Array,:default => []
field :frontend_data_count
belongs_to :theme
belongs_to :design
belongs_to :module_app
has_many :page_parts, :dependent => :destroy
@@ -1 +1 @@
<%= f.select :module_app_id, @apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
<%= f.select :module_app_id, @module_apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
@@ -3,14 +3,14 @@
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls well">
<% if @module_app.nil? || @module_app.widgets.nil? || (@module_app.widgets[@widget_path].blank? rescue true) %>
<% if @selected[:module_app].nil? || @selected[:module_app].widgets.nil? || (@selected[:module_app].widgets[@selected[:app_frontend_url]].blank? rescue true) || @selected[:module_app].widgets[@selected[:app_frontend_url]]["style"].nil? %>
<%= t("default_widget.no_support_setting")%>
<%else%>
<%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]["style"]) %>
<%= select('page_part', 'widget_style', @selected[:module_app].widgets[@selected[:app_frontend_url]]["style"]) %>
<% end %>
</div>
</div>
<% if(@module_app && @module_app.widget_options(@widget_path)) %>
<% if(@selected[:module_app] && @selected[:module_app].widget_options(@selected[:app_frontend_url])) %>
<div class="style_switch control-group">
<label class="control-label"><%= t("default_widget.select_widget_ext_option") %></label>
<div class="controls well" >
@@ -27,14 +27,14 @@
<span class="span5"></span>
</div>
<% @module_app.widget_fields.each_with_index do |widget_field, i| %>
<% @selected[:module_app].widget_fields.each_with_index do |widget_field, i| %>
<div class="rows clear">
<span class="span4">
<%= i+1 %>
<%= select_tag "#{object_name}[#{field_name}][][field_name]", widget_field_options(i), :include_blank => true ,:class=>'widget_field_select',:field_seri => i ,:id=>"#{object_name}_#{field_name}_#{i}",:rel=>reload_rel%>
</span>
<span class="span3">
<%= select_tag "#{object_name}[#{field_name}][][class]", widget_fiield_class_options(i), :include_blank => true %> <br />
<%= select_tag "#{object_name}[#{field_name}][][class]", widget_field_class_options(i), :include_blank => true %> <br />
</span>
<span class="span5 link_switch_holder">
<%= link_to_field_switch(i,object_name,field_name) %>
@@ -5,14 +5,13 @@
<% when PagePart %>
<% field_name = "page_part[widget_style]" %>
<% end %>
<div class="style_switch control-group">
<label class="control-label">
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls well">
<ul class="clear">
<% if @module_app.get_default_widget["enabled_styles"].include?("typeA") %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeA") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeA",style_checked_value(object,"typeA") %>
@@ -23,7 +22,7 @@
</li>
<% end %>
<% if @module_app.get_default_widget["enabled_styles"].include?("typeB_style2") %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeB_style2") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeB_style2",style_checked_value(object,"typeB_style2") %>
@@ -33,7 +32,7 @@
</label>
</li>
<% end %>
<% if @module_app.get_default_widget["enabled_styles"].include?("typeB_style3") %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeB_style3") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeB_style3",style_checked_value(object,"typeB_style3") %>
@@ -43,7 +42,7 @@
</label>
</li>
<% end %>
<% if @module_app.get_default_widget["enabled_styles"].include?("typeB_style4") %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeB_style4") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeB_style4",style_checked_value(object,"typeB_style4") %>
@@ -53,7 +52,7 @@
</label>
</li>
<% end %>
<% if @module_app.get_default_widget["enabled_styles"].include?("typeC") %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeC") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeC",style_checked_value(object,"typeC") %>
@@ -17,7 +17,7 @@
<%= t "default_widget.select_module_app" %>
</label>
<div class="controls">
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@module_app.id rescue nil)), {:include_blank => true }, {:rel => reload_after_module_changed_admin_page_part_path,:id=>"page_module_app_id"} %>
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@selected[:module_app].id rescue nil)), {:include_blank => true }, {:rel => reload_after_module_changed_admin_page_part_path,:id=>"page_module_app_id"} %>
</div>
</div>
@@ -26,7 +26,8 @@
<%= t "default_widget.select_widget_path" %>
</label>
<div class="controls">
<%= f.select :widget_path, @module_app ? @module_app.widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} : [], {}, { :selected => @part.widget_path, :rel => get_widget_field_rel } %>
<%#= @module_app ? @module_app.widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} %>
<%= f.select :widget_path, @app_frontend_urls , {}, { :selected => @selected[:app_frontend_url], :rel => get_widget_field_rel } %>
</div>
</div>
@@ -1,4 +1,7 @@
<% @module_app.widget_options(@widget_path).get_options.each do |key,settings| %>
<% if (not(@selected[:module_app].widget_options(@selected[:app_frontend_url]).blank?) and @selected[:app_frontend_url]!='default_widget')%>
<% @selected[:module_app].widget_options(@selected[:app_frontend_url]).get_options.each do |key,settings| %>
<% options = settings[:opts] %>
<%= label_tag(t(settings[:label_i18n]))%>
<% case options%>
@@ -12,3 +15,4 @@
<% end %>
<% end %>
@@ -1 +1 @@
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page_part','widget_field',nil,@choosen_field) %>");
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page_part','widget_field',nil,@selected[:default_widget_field]) %>");
@@ -1,11 +1,11 @@
<% if @module_app%>
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| [I18n.t(v['i18n']),k]},@part.widget_path) %>");
<% if @selected[:module_app]%>
$('#widget_list select').html("<%= j options_for_select(@selected[:module_app].widgets.collect{|k,v| [I18n.t(v['i18n']),k]},@selected[:app_frontend_url]) %>");
$("#widget_data_source_category").html("<%= j render :partial => 'widget_data_source_category',:locals=>{:object=>@part} %>");
$("#widget_data_source_tag").html("<%= j render :partial => 'widget_data_source_tag',:locals=>{:object=>@part} %>");
$("#data_count").html("<%= j render :partial => 'admin/pages/data_count_field',:locals=>{:field_name=>'page_part[widget_data_count]',:field_value=>@part.widget_data_count } %>");
<% if @part %>
<% if show_default_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>");
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel',:locals=>{:object=>@part} %>");
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting',:locals=>{:object=>@part} %>");
<% elsif show_custom_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
@@ -4,7 +4,7 @@
</label>
<div class="controls well">
<% if @frontend_styles%>
<%= select('page', 'frontend_style', @frontend_styles) %>
<%= select('page', 'frontend_style', @frontend_styles,{:selected => @selected[:frontend_style]}) %>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% end %>
@@ -2,5 +2,5 @@
<%= t("default_widget.widget_data_count") %>
</label>
<div class="controls">
<%= select_tag(field_name,options_for_select((@module_app.get_registration.get_data_count rescue []),field_value )) %>
<%= select_tag(field_name,options_for_select(@page_frontend_data_counts||[],field_value )) %>
</div>
+7 -7
View File
@@ -1,13 +1,13 @@
<%= f.error_messages %>
<%= f.hidden_field :parent, :value => (@item.parent.id rescue nil) %>
<%= f.hidden_field :id, :value => (@item.id),:id=>"object_id" %>
<div class="control-group">
<%= f.label :name, '*'+t(:name), :class => 'control-label' %>
<div class="controls">
<%= f.text_field :name, :class => 'text input-xlarge' %>
<span class="help-inline">請輸入數字或英文,不可使用空白</span>
<span class="help-inline"><%= I18n.t("front_page.name_field_helper") %></span>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
@@ -27,14 +27,14 @@
<div class="control-group">
<%= f.label :name, t(:template_name), :class => 'control-label' %>
<div class="controls">
<%= f.collection_select :design, @designs, :id, :title, {:selected => @design.id}, {:rel => reload_themes_admin_pages_path} %>
<%= f.collection_select :design, @designs, :id, :title, {:selected => (@selected[:design].id rescue nil) }, {:rel => reload_themes_admin_pages_path} %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
<div class="control-group">
<%= f.label :name, t(:theme), :class => 'control-label' %>
<div class="controls">
<%= f.select :theme_id, @design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %>
<%= f.select :theme_id, @themes.collect { |t| [t.name.capitalize, t.id] }, {:include_blank => true, :selected=>(@selected[:theme].id rescue nil) } %>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div>
</div>
@@ -42,14 +42,14 @@
<div class="control-group" id="module_app_list">
<%= f.label '',t("default_widget.select_module_app"), :class => 'control-label' %>
<div class="controls">
<%= f.select :module_app_id, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@module_app.id rescue nil)), {:include_blank => true }, {:rel => reload_after_module_changed_admin_pages_path,:id=>"page_module_app_id"} %>
<%= f.select :module_app_id, options_from_collection_for_select(@module_apps, :id, :module_name, :selected =>(@selected[:module_app].id rescue nil)), {:include_blank => true }, {:rel => reload_after_module_changed_admin_pages_path,:id=>"page_module_app_id"} %>
</div>
</div>
<div class="control-group" id="frontend_list">
<%= f.label '', t("front_page.select_app_url"), :class => 'control-label' %>
<div class="controls" id="app_page_url">
<%= select('page','app_frontend_url', @app_frontend_urls || [],{}, {:selected => (@item.app_frontend_url || 'default_widget'),:rel => reload_after_list_changed_admin_pages_path}) rescue ''%>
<%= select('page','app_frontend_url', @app_frontend_urls || [], {:selected => @selected[:app_frontend_url],:rel => reload_after_list_changed_admin_pages_path}) rescue ''%>
</div>
</div>
@@ -67,7 +67,7 @@
</div>
<div class="control-group" id='data_count'>
<%= render :partial=>'data_count_field',:locals=>{:field_name=>"page[frontend_data_count]",:field_value=>@item.frontend_data_count} %>
<%= render :partial=>'data_count_field',:locals=>{:field_name=>"page[frontend_data_count]",:field_value=>@selected[:page_frontend_data_count]} %>
</div>
<div class="control-group">
@@ -4,7 +4,7 @@
<% @module_app.widget_fields.each_with_index do |frontend_field, i| %>
<%= i+1 %>
<%= select_tag "page[frontend_field][]",widget_field_options(i,@item) , :include_blank => true %>
<%= select_tag "page[frontend_field_type][]", widget_fiield_class_options(i,@item), :include_blank => true %> <br />
<%= select_tag "page[frontend_field_type][]", widget_field_class_options(i,@item), :include_blank => true %> <br />
<% end %>
<% end %>
@@ -1,25 +1,25 @@
<% if @module_app %>
<% if @selected[:module_app] %>
$('#app_page_category').html("<%= j render :partial => 'admin/page_parts/widget_data_source_category' ,:locals=>{:object=>@item}%>");
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@item} %>");
$("#data_count").html("<%= j render :partial => 'admin/pages/data_count_field',:locals=>{:field_name=>'page[frontend_data_count]',:field_value=>(@item.frontend_data_count rescue nil)} %>");
<% if !@module_app.app_pages.blank? or @module_app.has_default_widget? %>
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', options_for_select(@app_frontend_urls, (@item.app_frontend_url || 'default_widget')),{},{:rel => reload_after_list_changed_admin_pages_path}) %>");
<% if !@selected[:module_app].app_pages.blank? or @selected[:module_app].has_default_widget? %>
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', options_for_select(@app_frontend_urls, @selected[:app_frontend_url]),{},{:rel => reload_after_list_changed_admin_pages_path}) %>");
<% else %>
$('#app_page_url').html("<div class='well'><%= t('default_widget.no_support_setting')%></div>");
<% end %>
<% if @app_frontend_urls.first =='default_widget' %>
$('#app_page_frontend_style').html("<%= escape_javascript(select 'page', 'frontend_style', @module_app.widgets[@frontend_path]) if !@frontend_path.blank? %>");
$('#app_page_frontend_style').html("<%= escape_javascript(select 'page', 'frontend_style', @selected[:module_app].widgets[@selected[:app_frontend_url]]) %>");
<% else %>
$('#app_page_frontend_style').html("<%= t('default_widget.no_support_setting')%>");
<% end %>
<% if show_default_widget_setting_panel %>
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@page} %>");
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@item} %>");
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@page} %>");
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@page} %>");
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@item} %>");
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@item} %>");
<% else %>
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
<% end %>
@@ -1 +1 @@
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page','frontend_field',nil,@choosen_field) %>");
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page','frontend_field',nil,@selected[:default_widget_field]) %>");
+4 -4
View File
@@ -3,15 +3,15 @@
<table class="default_widget_tb" border="0" cellpadding="0" cellspacing="0" >
<thead>
<tr>
<% @fields.each do |field|%>
<th><%= content_tag(:span,get_field_header(field[0]),:class=>field[1])%></th>
<% @frontend_field_names.each_with_index do |field,index|%>
<%= content_tag(:th,content_tag(:span,get_field_header(field),:class=>@frontend_classes[index]))unless field.blank?%>
<% end %>
</tr>
</thead>
<% @data.each do |row_data| %>
<tr>
<% @fields.each do |field|%>
<td><%= content_tag(:span,link_to_field(row_data,field[0], field[2], {orig_page: @page_id.to_s}),:class=>field[1])%></td>
<% @frontend_field_names.each_with_index do |field,index|%>
<%= content_tag(:td,content_tag(:span,link_to_field(row_data,field, @frontend_sat_to_links[index], {orig_page: @page_id.to_s}),:class=>@frontend_classes[index]))unless field.blank?%>
<% end %>
</tr>
<% end %>
+2 -2
View File
@@ -6,8 +6,8 @@
<%= image_tag row_data.send(@widget_image_field)%>
</div>
<div class="wrap">
<% @fields.each do |field|%>
<%= content_tag(:span,link_to_field(row_data,field[0], field[2], {orig_page: @page_id.to_s}),:class=>field[1])%>
<% @frontend_field_names.each_with_index do |field,index|%>
<%= content_tag(:span,link_to_field(row_data,field, @frontend_sat_to_links[index], {orig_page: @page_id.to_s}),:class=>@frontend_classes[index]) unless field.blank?%>
<% end %>
</div>
<% end %>
+2 -2
View File
@@ -5,8 +5,8 @@
<ul class="default_widget_list">
<% @data.each do |row_data| %>
<%= content_tag(:li) do %>
<% @fields.each do |field|%>
<%= content_tag(:span, link_to_field(row_data,field[0], field[2], {orig_page: @page_id.to_s}),:class=>field[1])%>
<% @frontend_field_names.each_with_index do |field,index|%>
<%= content_tag(:span, link_to_field(row_data,field, @frontend_sat_to_links[index], {orig_page: @page_id.to_s}),:class=>@frontend_classes[index]) unless field.blank?%>
<% end %>
<% end %>
<% end %>
+1 -1
View File
@@ -1,7 +1,7 @@
<div id="side">
<div id="rwidget" class="wh2 thmc4">
<ul class="docklist">
<li class="d_cate"><a callback-method='initializeDesktop' href="desktop/desktop" class="widget_fn wh2 hh2" id='home' onclick="return false;"><span class="widget_icon"><img src="" alt="Home" id="home_icon" width="30" height="30"/></span></a>
<li class="d_cate"><a callback-method='initializeDesktop' href="desktop/" class="widget_fn wh2 hh2" id='home' onclick="return false;"><span class="widget_icon"><img src="" alt="Home" id="home_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh2 thmc4" style="width: 180px;">
<li class="dock_item"><a callback-method='initializeAppSearch' href="<%= desktop_app_manager_path %>" class="widget_fn wh2 hh2" id="d_app_manager" onclick="return false;"><span class="widget_icon"><img src="" alt="App Manager" id="app_manager_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeSectionsManager' href="<%= desktop_allsections_path %>" class="widget_fn wh2 hh2" id="d_sections" custom-load="sections" onclick="return false;"><span class="widget_icon"><img src="" alt="All Sections" id="sections_icon" width="30" height="30"/></span></a></li>
+4 -4
View File
@@ -2,10 +2,10 @@
<div class="overview" content-layout="simple" base-width="1000">
<div class="s_title hh2">Section Names</div>
<ul class="s_form" id="desktop_names">
<li class="s_grid_row"><label class="s_grid s_grid_4" for="s_name1">Section 1</label><input id="s_name1" class="s_grid s_grid_8" type="text" value=""></li>
<li class="s_grid_row"><label class="s_grid s_grid_4" for="s_name2">Section 2</label><input id="s_name2" class="s_grid s_grid_8" type="text" value=""></li>
<li class="s_grid_row"><label class="s_grid s_grid_4" for="s_name3">Section 3</label><input id="s_name3" class="s_grid s_grid_8" type="text" value=""></li>
<li class="s_grid_row"><label class="s_grid s_grid_4" for="s_name4">Section 4</label><input id="s_name4" class="s_grid s_grid_8" type="text" value=""></li>
<li class="s_grid_row"><label for="s_name1">Section 1</label><input id="s_name1" type="text" value=""></li>
<li class="s_grid_row"><label for="s_name2">Section 2</label><input id="s_name2" type="text" value=""></li>
<li class="s_grid_row"><label for="s_name3">Section 3</label><input id="s_name3" type="text" value=""></li>
<li class="s_grid_row"><label for="s_name4">Section 4</label><input id="s_name4" type="text" value=""></li>
</ul>
<div class="s_subtitle">sample desciption</div>
<div class="s_action">
+5 -5
View File
@@ -21,7 +21,7 @@
<div class="theme_preview vp thmbgc" style="background-color: #000;" id="theme_preview_area">
<div class="thmtxth hh1 hp" style="margin-left:108px;">Theme Text1</div>
<div class="theme_plate">
<div class="thmc4 h1 wh2"></div>
<div class="thmc4 h1 wh3"></div>
<div class="thmc1 h1 w1"><div class="thmtxt hp">Theme Text2</div></div>
<div class="g_sep h1 op07"></div>
<div class="thmc2 h1 w1"><div class="thmtxt hp">Theme Text</div></div>
@@ -30,10 +30,10 @@
<div>
<table id="color_input" cellpadding="0" cellspacing="0" border="0" width="528" >
<tr>
<th class="s_title size_small hh2" width="190px">Theme Color</th>
<th class="s_title size_small hh2">Line Color</th>
<th class="s_title size_small hh2" width="120px">Text Color</th>
<th class="s_title size_small hh2" width="120px">Background Color</th>
<th class="s_title hh2" width="190px">Theme Color</th>
<th class="s_title hh2">Line Color</th>
<th class="s_title hh2" width="120px">Text Color</th>
<th class="s_title hh2" width="120px">Background Color</th>
</tr>
<tr>
<td>
+7 -12
View File
@@ -2,22 +2,17 @@
<div class="s_title hh2">Password Managment</div>
<%= form_for(resource, :as => resource_name, :url => users_passwd_path(resource_name), :html => { :method => :put, "form-type"=>"ajax_form" ,"callback-method"=>"passwordUpdate" }) do |f| %>
<ul class="s_form">
<li class="s_grid_row">
<%= f.label :current_password, :class => 's_grid s_grid_4' %>
<%= f.password_field :current_password, :class => 's_grid s_grid_8' %>
</li>
<li class="s_grid_row"><%= f.label :current_password %>
<%= f.password_field :current_password %></li>
<li class="s_grid_row">
<%= f.label :password, :class => 's_grid s_grid_4' %>
<%= f.password_field :password, :class => 's_grid s_grid_8' %>
</li>
<li class="s_grid_row"><%= f.label :password %>
<%= f.password_field :password %></li>
<li class="s_grid_row">
<%= f.label :password_confirmation, :class => 's_grid s_grid_4' %>
<%= f.password_field :password_confirmation, :class => 's_grid s_grid_8' %>
</li>
<li class="s_grid_row"><%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %></li>
</ul>
<div class="s_action"><%= f.submit "Update", :class => "setting_btn thmc1 thmtxt w1 hh1 hp" %></div>
<% end %>
</div>
+1
View File
@@ -209,6 +209,7 @@ en:
forgot_password: Forgot your password?
frequency: Frequency
front_page:
name_field_helper: Can not be blank
select_app_url:
is_published:
menu_enable_lang:
+1
View File
@@ -209,6 +209,7 @@ zh_tw:
forgot_password: 忘記密碼?
frequency: 頻率
front_page:
name_field_helper: 請輸入數字或英文,不可使用空白
select_app_url: 模組前台樣式
is_published: 是否公開
menu_enable_lang: 選單啓用語系
+2 -2
View File
@@ -8,10 +8,10 @@ defaults: &defaults
development:
<<: *defaults
database: test_site_harry
database: test_site
test:
<<: *defaults
database: test_site_harry
database: test_site
# set these environment variables on your prod server
production:
+8 -19
View File
@@ -1,24 +1,13 @@
# encoding: utf-8
namespace :tiles do
task :destroy_build_tiles => :environment do
Tile.destroy_all
secs = Section.all
dws = DesktopWidget.all
secs.each do |sec,x|
grp = sec.groups.first
t = Tile.new(data_category: "app", data_content: "wikibooks", position: 1, shape: "w1 h1", title: "WikiBooks")
grp.tiles+=[t]
t = Tile.new(data_category: "app", data_content: "envocab", position: 2, shape: "w1 h1", title: "English Vocabulary")
grp.tiles+=[t]
@i = 3
dws.each do |dw|
t = Tile.new(data_category: "widget", position: @i,desktop_widget_id: dw.id)
@i = @i + 1
grp.tiles+=[t]
end
grp.save!
namespace :desktop do
task :destroy_build_desktop => :environment do
Desktop.all.destroy_all
u = User.all
u.each do |us|
x = us.initialize_desktop
x.save!
puts "Desktop created for " + us.email.to_s
end
puts "Section " + x + " done!"
end
end
@@ -13,7 +13,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
var bindHandlers = function(){ // to bind handlers for list page
o.simple_drop_down();
}
bindHandlers();
var bindSecondaryHandlers = function(){
$("#journal_p div#paper_list a.icon-check-empty").click(function(){
@@ -7,6 +7,7 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
page ||= 1
@per_column = 5
case @view_by
when "abstract"
@per_column = 1
@@ -2,7 +2,7 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
def publication_record publication, view
content_tag :li,
"item" => "true",
:class => "list_t_item #{view}_view" do
:class => "list_t_item" do
marker + \
content(publication, view) + \
edit_or_delete(publication)
@@ -69,15 +69,14 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
content_tag(:span, file.title, :class => "filetitle"),
file.file.url,
:class => "file",
"target" => "_blank",
"title" => file.title)
"target" => "_blank")
}.inject(:+)
end
def check_file_type file
if not file.nil?
file_type = MIME::Types.type_for(file).first.to_s.split("/")[1]
file_type = "/assets/ft-icons/#{file_type}/#{file_type}-sm-32_32.png"
file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png"
else
file_type = ""
end
@@ -1,84 +0,0 @@
<div class="toolbar hh1">
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-check"></span></div>
<div class="admbg sdm_o">
<ul id="journal_selection_options">
<li><a class="hp hh1 admtxt" href="all" ajax-remote="false" callback-method="allnone">All</a></li>
<li><a class="hp hh1 admtxt" href="none" ajax-remote="false" callback-method="allnone">None</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">More</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh1 admtxt" href="">Delete</a></li>
<li><a class="hp hh1 admtxt" href="">Tag</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Tag</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh1 admtxt" href="">All</a></li>
<li><a class="hp hh1 admtxt" href="">Starred</a></li>
<li><a class="hp hh1 admtxt" href="">MIT</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Status</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh1 admtxt" href="">All</a></li>
<li><a class="hp hh1 admtxt" href="">Published</a></li>
<li><a class="hp hh1 admtxt" href="">Pending</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">View</div>
<div class="admbg sdm_o">
<ul id="journal_view_selection">
<li><%= link_to "Journal", panel_personal_journal_desktop_journal_pages_path + "?view=journal_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
<li><%= link_to "Title", panel_personal_journal_desktop_journal_pages_path + "?view=paper_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
<li><%= link_to "File", panel_personal_journal_desktop_journal_pages_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
<li><%= link_to "Keywords", panel_personal_journal_desktop_journal_pages_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
<li><%= link_to "Abstract", panel_personal_journal_desktop_journal_pages_path + "?view=abstract", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh1 admtxt" href="">Full</a></li>
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
<li><a class="hp hh1 admtxt" href="">Private</a></li>
<li><a class="hp hh1 admtxt" href="">Group</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1" id='ns'>New Share</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh1 admtxt remote_url" href="<%= panel_personal_journal_plugin_writing_journals_path %>">Full</a></li>
<li><a class="hp hh1 admtxt" href="">Abstract</a></li>
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
<li><a class="hp hh1 admtxt" href="">Private</a></li>
<li><a class="hp hh1 admtxt" href="">Group</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" page-name="journal_p_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<% @writing_journals.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</div>