Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f744bf266c |
No files matched your search
@@ -71,7 +71,8 @@ gem 'redis-search'
|
|||||||
gem 'syslog-logger'
|
gem 'syslog-logger'
|
||||||
gem "recaptcha", :require => "recaptcha/rails"
|
gem "recaptcha", :require => "recaptcha/rails"
|
||||||
|
|
||||||
gem "chartkick"
|
gem 'puma'
|
||||||
|
gem 'request-log-analyzer'
|
||||||
gem 'usagewatch'
|
gem 'usagewatch'
|
||||||
|
|
||||||
# Gems used only for assets and not required
|
# Gems used only for assets and not required
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 301 KiB After Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 348 KiB After Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -12,7 +12,6 @@ $(function() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setForm(item.data('form'));
|
setForm(item.data('form'));
|
||||||
if( $( ".color-picker" ).length ) $(".color-picker").miniColors("value",item.data("form").color);
|
|
||||||
pageslide.find('form').attr('action', '/admin/module_apps/' + item.data('module') + '/categories/' + item.data('id'));
|
pageslide.find('form').attr('action', '/admin/module_apps/' + item.data('module') + '/categories/' + item.data('id'));
|
||||||
pageslide.find('form').attr('method', 'put');
|
pageslide.find('form').attr('method', 'put');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ if($.support.touch) {
|
|||||||
$checked.each(function() {
|
$checked.each(function() {
|
||||||
if(!$(this).closest('div').hasClass('togglebox')) {
|
if(!$(this).closest('div').hasClass('togglebox')) {
|
||||||
$(this).wrap('<div class="toggle-control"/>');
|
$(this).wrap('<div class="toggle-control"/>');
|
||||||
if($(this).attr('type') == "hidden" && $(this).attr('value') == 'true') {
|
if($(this).attr('type') == "hidden" && $(this).attr('value')) {
|
||||||
$(this).wrap('<div class="togglebox disable" />');
|
$(this).wrap('<div class="togglebox disabled" />');
|
||||||
} else {
|
} else {
|
||||||
$(this).wrap('<div class="togglebox" />');
|
$(this).wrap('<div class="togglebox" />');
|
||||||
}
|
}
|
||||||
@@ -71,6 +71,7 @@ if($.support.touch) {
|
|||||||
$(this).parent('.togglebox').removeClass('disable').closest('li').removeClass('disabled');
|
$(this).parent('.togglebox').removeClass('disable').closest('li').removeClass('disabled');
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
console.log($(this))
|
||||||
if($(this).prop('checked')) {
|
if($(this).prop('checked')) {
|
||||||
$(this).parent('.togglebox').addClass('disable').closest('li').addClass('disabled');
|
$(this).parent('.togglebox').addClass('disable').closest('li').addClass('disabled');
|
||||||
};
|
};
|
||||||
@@ -540,8 +541,6 @@ function changeStatusHidden() {
|
|||||||
|
|
||||||
// Document Ready
|
// Document Ready
|
||||||
$(function() {
|
$(function() {
|
||||||
showFiltersOnPageRefresh();
|
|
||||||
|
|
||||||
new ini();
|
new ini();
|
||||||
$('#main-wrap').on('click', '.delete', function() {
|
$('#main-wrap').on('click', '.delete', function() {
|
||||||
api.modal($(this).attr('rel'));
|
api.modal($(this).attr('rel'));
|
||||||
@@ -590,35 +589,4 @@ $(function() {
|
|||||||
}
|
}
|
||||||
formTip()
|
formTip()
|
||||||
sidebarNav();
|
sidebarNav();
|
||||||
});
|
});
|
||||||
|
|
||||||
var showFiltersOnPageRefresh = function(){
|
|
||||||
var params = getUrlVars(),
|
|
||||||
paramfilter = params['new_filter[type]'];
|
|
||||||
|
|
||||||
// switch (paramfilter){
|
|
||||||
// case "role":
|
|
||||||
// paramfilter = "status";
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if( paramfilter ){
|
|
||||||
$( "#filter" ).addClass('open');
|
|
||||||
$( '#filter a[href="#collapse-' + paramfilter + '"]').parent().parent().addClass('active');
|
|
||||||
$( '#filter #collapse-' + paramfilter ).addClass('in');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var getUrlVars = function(){
|
|
||||||
var vars = [], hash;
|
|
||||||
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
|
||||||
for(var i = 0; i < hashes.length; i++){
|
|
||||||
hash = hashes[i].split('=');
|
|
||||||
vars.push(decodeURIComponent(hash[0]));
|
|
||||||
vars[decodeURIComponent(hash[0])] = decodeURIComponent(hash[1]);
|
|
||||||
}
|
|
||||||
if(vars[0] == window.location.href){
|
|
||||||
vars =[];
|
|
||||||
}
|
|
||||||
return vars;
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@ var banner_index = 0;
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$.each($(".dymanic_load"),function(){
|
$.each($(".dymanic_load"),function(){
|
||||||
if($(this).attr("path")==''){
|
if($(this).attr("path")==''){
|
||||||
$(this).html("");
|
$(this).html("App setting Failed");
|
||||||
}else{
|
}else{
|
||||||
ajax_load_proc($(this),$(this).attr("path"));
|
ajax_load_proc($(this),$(this).attr("path"));
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,7 @@ $(document).ready(function() {
|
|||||||
function ajax_load_proc(wapper,url,isBanner){
|
function ajax_load_proc(wapper,url,isBanner){
|
||||||
$.get(encodeURI(url), {}, function(respText,textSta,XML){
|
$.get(encodeURI(url), {}, function(respText,textSta,XML){
|
||||||
if (textSta == 'success') {
|
if (textSta == 'success') {
|
||||||
if (respText.indexOf("<title>") == -1) wapper.html(respText);
|
wapper.html(respText);
|
||||||
};
|
};
|
||||||
if(textSta == 'error')
|
if(textSta == 'error')
|
||||||
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
|
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ function customOpenSlide() {
|
|||||||
} else {
|
} else {
|
||||||
$('#pageslide form').prop('method', 'post')
|
$('#pageslide form').prop('method', 'post')
|
||||||
};
|
};
|
||||||
_type == 'page' ? pageSetting(element.data('id'), _edit, pageslide) : linkSetting(element.data('id'), _edit, pageslide);
|
_type == 'page' ? pageSetting(element.data('id'), _edit) : linkSetting(element.data('id'), _edit);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$iFrame.pageslide({
|
$iFrame.pageslide({
|
||||||
@@ -111,32 +111,31 @@ function customOpenSlide() {
|
|||||||
.closest('.navbar-inner')
|
.closest('.navbar-inner')
|
||||||
.addClass('active');
|
.addClass('active');
|
||||||
pageslide.find('.content').css('padding', 0);
|
pageslide.find('.content').css('padding', 0);
|
||||||
// iFrameContent()
|
iFrameContent()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// function iFrameContent() {
|
function iFrameContent() {
|
||||||
// function iFrameFunction(iContents, pc) {
|
function iFrameFunction(iContents, pc) {
|
||||||
// pc.each(function(index, el) {
|
pc.each(function(index, el) {
|
||||||
// if($(this).siblings('*').length == 0) {
|
if($(this).siblings('*').length == 0) {
|
||||||
// var _parentH = $(this).parent('*').outerHeight();
|
var _parentH = $(this).parent('*').outerHeight();
|
||||||
// $(this).css('min-height', _parentH);
|
$(this).css('height', _parentH);
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// iContents.find('#orbit-bar').hide();
|
iContents.find('#orbit-bar').hide();
|
||||||
// iContents.find('.main_wrap').css('margin-top', 0);
|
iContents.find('.main_wrap').css('margin-top', 0);
|
||||||
// iContents.find('a').not('.edit_link a').on('click', function(event) {
|
iContents.find('a').not('.edit_link a').on('click', function(event) {
|
||||||
// event.preventDefault();
|
event.preventDefault();
|
||||||
// }).css('cursor', 'default');
|
}).css('cursor', 'default');
|
||||||
// }
|
}
|
||||||
// $('#pageslide_iframe').load(function() {
|
$('#pageslide_iframe').load(function() {
|
||||||
// var $iContents = $(this).contents(),
|
var $iContents = $(this).contents(),
|
||||||
// $pc = $iContents.find('.page_content');
|
$pc = $iContents.find('.page_content');
|
||||||
// iFrameFunction($iContents, $pc);
|
$(this).get(0).contentWindow.externalFunction(iFrameFunction, $iContents, $pc);
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
|
function pageSetting(id, edit) {
|
||||||
function pageSetting(id, edit, ps) {
|
|
||||||
$pageModule = $('#pageslide #page_module_app_id');
|
$pageModule = $('#pageslide #page_module_app_id');
|
||||||
$pageF2E = $('#pageslide #page_app_frontend_url');
|
$pageF2E = $('#pageslide #page_app_frontend_url');
|
||||||
$pageDivF2E = $('#pageslide #front_url');
|
$pageDivF2E = $('#pageslide #front_url');
|
||||||
@@ -184,29 +183,23 @@ function pageSetting(id, edit, ps) {
|
|||||||
|
|
||||||
if(val.category.length > 0) {
|
if(val.category.length > 0) {
|
||||||
$.each(val.category, function(index, val) {
|
$.each(val.category, function(index, val) {
|
||||||
var _arr = $.inArray($(this)[1], _selectData.module.category);
|
var _arr = $.inArray($(this)[1], _selectData.module.category[1]);
|
||||||
$pageCategory.append('<label class="checkbox"><input type="checkbox" name="page[category][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
$pageCategory.append('<label class="checkbox"><input type="checkbox" name="page[category][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
||||||
if(_arr !== -1) {
|
if(!_selectData.module.category[0] && _arr !== -1) {
|
||||||
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||||
}
|
}
|
||||||
var $all = $pageCategory.siblings('.checkbox').children('.select_all'),
|
_selectData.module.category[0] ? $pageCategory.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
||||||
$hiddenInput = $pageCategory.siblings('input[type="hidden"]');
|
|
||||||
_selectData.module.category.length ? $hiddenInput.removeAttr('name') : $hiddenInput.attr('name', 'page[category][]');
|
|
||||||
_selectData.module.category.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
|
||||||
});
|
});
|
||||||
$pageCategoryGroup.show();
|
$pageCategoryGroup.show();
|
||||||
}
|
}
|
||||||
if(val.tags.length > 0) {
|
if(val.tags.length > 0) {
|
||||||
$.each(val.tags, function(index, val) {
|
$.each(val.tags, function(index, val) {
|
||||||
var _arr = $.inArray($(this)[1], _selectData.module.tags);
|
var _arr = $.inArray($(this)[1], _selectData.module.tags[1]);
|
||||||
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
||||||
if(_arr !== -1) {
|
if(!_selectData.module.tags[0] && _arr !== -1) {
|
||||||
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||||
}
|
}
|
||||||
var $all = $pageTags.siblings('.checkbox').children('.select_all'),
|
_selectData.module.tags[0] ? $pageTags.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
||||||
$hiddenInput = $pageTags.siblings('input[type="hidden"]');
|
|
||||||
_selectData.module.tags.length ? $hiddenInput.removeAttr('name') : $hiddenInput.attr('name', 'page[tag][]');
|
|
||||||
_selectData.module.tags.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
|
||||||
});
|
});
|
||||||
$pageTagsGroup.show();
|
$pageTagsGroup.show();
|
||||||
}
|
}
|
||||||
@@ -244,8 +237,8 @@ function pageSetting(id, edit, ps) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
function linkSetting(id, edit, ps) {
|
function linkSetting(id, edit) {
|
||||||
$linkPublishedTrue = ps.find('#link_is_published_true');
|
$linkPublishedTrue = $('#link_is_published_true');
|
||||||
_status = edit;
|
_status = edit;
|
||||||
if(_status) {
|
if(_status) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -257,7 +250,6 @@ function linkSetting(id, edit, ps) {
|
|||||||
})
|
})
|
||||||
.done(function(data) {
|
.done(function(data) {
|
||||||
_linkData = data;
|
_linkData = data;
|
||||||
console.log($linkPublishedTrue)
|
|
||||||
data.public ? $linkPublishedTrue.prop('checked', true) : $linkPublishedTrue.prop('checked', false);
|
data.public ? $linkPublishedTrue.prop('checked', true) : $linkPublishedTrue.prop('checked', false);
|
||||||
$linkPublishedTrue.prop('checked') ? $('.link-options').slideDown(300) : $('.link-options').slideUp(300);
|
$linkPublishedTrue.prop('checked') ? $('.link-options').slideDown(300) : $('.link-options').slideUp(300);
|
||||||
$.each(_linkData.link, function(index, val) {
|
$.each(_linkData.link, function(index, val) {
|
||||||
@@ -294,6 +286,7 @@ function getView(module_id, id) {
|
|||||||
cache: false,
|
cache: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$pageModule = null,
|
$pageModule = null,
|
||||||
$pageF2E = null,
|
$pageF2E = null,
|
||||||
@@ -334,11 +327,7 @@ $(function() {
|
|||||||
} else {
|
} else {
|
||||||
position = $(ui.item).index();
|
position = $(ui.item).index();
|
||||||
};
|
};
|
||||||
var next_sibling = $(ui.item).next(),
|
$.post("<%= Rails.application.routes.url_helpers.update_position_admin_items_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: position } );
|
||||||
next_sibling_id = null;
|
|
||||||
if( next_sibling )
|
|
||||||
next_sibling_id = next_sibling.attr("id");
|
|
||||||
$.post("<%= Rails.application.routes.url_helpers.update_position_admin_items_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: position, "next_sibling_id" : next_sibling_id } );
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(".sortable").delegate(".brand, .delete", clickEvent, function(e){
|
$(".sortable").delegate(".brand, .delete", clickEvent, function(e){
|
||||||
@@ -401,44 +390,36 @@ $(function() {
|
|||||||
|
|
||||||
if(event.target.id == 'page_module_app_id') {
|
if(event.target.id == 'page_module_app_id') {
|
||||||
$pageCategory.empty();
|
$pageCategory.empty();
|
||||||
var $hiddenInputA = $pageCategory.siblings('input[type="hidden"]');
|
|
||||||
if(val.category.length > 0) {
|
if(val.category.length > 0) {
|
||||||
$.each(val.category, function(index, val) {
|
$.each(val.category, function(index, val) {
|
||||||
if(val !== 0) {
|
if(val !== 0) {
|
||||||
var _arr = _select ? $.inArray($(this)[1], _select.category) : '';
|
var _arr = _select ? $.inArray($(this)[1], _select.category[1]) : '';
|
||||||
$pageCategory.append('<label class="checkbox"><input type="checkbox" name="page[category][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
$pageCategory.append('<label class="checkbox"><input type="checkbox" name="page[category][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
||||||
if(_boolean && _arr !== -1) {
|
if(_select && !_select.category[0] && _arr !== -1) {
|
||||||
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||||
}
|
}
|
||||||
var $all = $pageCategory.siblings('.checkbox').children('.select_all');
|
_select && _val == _select.main && _select.category[0] ? $pageCategory.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
||||||
_boolean && _val == _select.main && _select.category.length ? $hiddenInputA.removeAttr('name') : $hiddenInputA.attr('name', 'page[category][]');
|
|
||||||
_boolean && _val == _select.main && _select.category.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$pageCategoryGroup.slideDown(300);
|
$pageCategoryGroup.show();
|
||||||
} else {
|
} else {
|
||||||
$pageCategoryGroup.slideUp(300);
|
$pageCategoryGroup.hide();
|
||||||
$hiddenInputA.removeAttr('name');
|
|
||||||
}
|
}
|
||||||
$pageTags.empty();
|
$pageTags.empty();
|
||||||
var $hiddenInputB = $pageTags.siblings('input[type="hidden"]');
|
|
||||||
if(val.tags.length > 0) {
|
if(val.tags.length > 0) {
|
||||||
$.each(val.tags, function(index, val) {
|
$.each(val.tags, function(index, val) {
|
||||||
if(val !== 0) {
|
if(val !== 0) {
|
||||||
var _arr = _select ? $.inArray($(this)[1], _select.tags) : '';
|
var _arr = _select ? $.inArray($(this)[1], _select.tags[1]) : '';
|
||||||
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
||||||
if(_boolean && _arr !== -1) {
|
if(_select && !_select.tags[0] && _arr !== -1) {
|
||||||
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||||
}
|
}
|
||||||
var $all = $pageTags.siblings('.checkbox').children('.select_all');
|
_select && _val == _select.main && _select.tags[0] ? $pageTags.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
||||||
_boolean && _val == _select.main && _select.tags.length ? $hiddenInputB.removeAttr('name') : $hiddenInputB.attr('name', 'page[tag][]');
|
|
||||||
_boolean && _val == _select.main && _select.tags.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$pageTagsGroup.slideDown(300);
|
$pageTagsGroup.show();
|
||||||
} else {
|
} else {
|
||||||
$pageTagsGroup.slideUp(300);
|
$pageTagsGroup.hide();
|
||||||
$hiddenInputB.removeAttr('name');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -466,18 +447,12 @@ $(function() {
|
|||||||
|
|
||||||
$('#pageslide').on('change', '.checkbox-groups input', function(event) {
|
$('#pageslide').on('change', '.checkbox-groups input', function(event) {
|
||||||
var $checked = $(this);
|
var $checked = $(this);
|
||||||
|
|
||||||
if($checked.attr('type') == 'checkbox') {
|
if($checked.attr('type') == 'checkbox') {
|
||||||
if($checked.hasClass('select_all')) {
|
if($checked.hasClass('select_all') && $checked.prop('checked')) {
|
||||||
if($checked.prop('checked')) {
|
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
|
||||||
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', true);
|
} else if($checked.prop('checked') && !$checked.hasClass('lang-enable')) {
|
||||||
$checked.closest('.checkbox').siblings('input[type="hidden"]').removeAttr('name');
|
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
|
||||||
} else {
|
} else {
|
||||||
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
|
|
||||||
$checked.closest('.checkbox').siblings('input[type="hidden"]').attr('name', 'page['+$checked.closest('.checkbox-groups').data('for')+'][]');
|
|
||||||
}
|
|
||||||
} else if($checked.hasClass('lang-enable')) {
|
|
||||||
var checkboxes = $checked.closest('.groups').find('input[type="checkbox"]');
|
|
||||||
if($checked.prop('checked')) {
|
if($checked.prop('checked')) {
|
||||||
$checked.closest('.active-link').addClass('active').siblings('active-link').removeClass('active').end().find('.active-mune').slideDown(300);
|
$checked.closest('.active-link').addClass('active').siblings('active-link').removeClass('active').end().find('.active-mune').slideDown(300);
|
||||||
if(_status) {
|
if(_status) {
|
||||||
@@ -491,15 +466,6 @@ $(function() {
|
|||||||
$(this).find('input:eq(0)').prop('checked', true);
|
$(this).find('input:eq(0)').prop('checked', true);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
var _l = $checked.closest('.groups').find('input[type="checkbox"]').length,
|
|
||||||
_c = $checked.closest('.groups').find('input[type="checkbox"]:checked').length;
|
|
||||||
if(_l == _c) {
|
|
||||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', true);
|
|
||||||
} else {
|
|
||||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
|
|
||||||
};
|
|
||||||
_c == 0 ? $checked.closest('.groups').siblings('input[type="hidden"]').attr('name', 'page['+$checked.closest('.checkbox-groups').data('for')+'][]') : $checked.closest('.groups').siblings('input[type="hidden"]').removeAttr('name');
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else if($checked.attr('type') == 'radio' && !$(this).closest('div').hasClass('active-mune')) {
|
} else if($checked.attr('type') == 'radio' && !$(this).closest('div').hasClass('active-mune')) {
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
$(function() {
|
|
||||||
// for toggle-check
|
|
||||||
$('.role_filter_checked').on({
|
|
||||||
change: function() {
|
|
||||||
var _path = $(this).data('path');
|
|
||||||
// var path = <%= @path %>
|
|
||||||
$.ajax({
|
|
||||||
url: _path,
|
|
||||||
type: 'POST',
|
|
||||||
dataType: 'json',
|
|
||||||
data: {remote: true},
|
|
||||||
})
|
|
||||||
.done(function() {})
|
|
||||||
.fail(function() {})
|
|
||||||
.always(function() {});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -222,7 +222,7 @@ $(function() {
|
|||||||
});
|
});
|
||||||
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
||||||
if($(this).hasClass('togglebox')) {
|
if($(this).hasClass('togglebox')) {
|
||||||
if($(this).hasClass('disable')) {
|
if($(this).hasClass('disabled')) {
|
||||||
$(this).find('.toggle-check')
|
$(this).find('.toggle-check')
|
||||||
.attr('value', 'false')
|
.attr('value', 'false')
|
||||||
.closest('.attributes')
|
.closest('.attributes')
|
||||||
@@ -237,7 +237,7 @@ $(function() {
|
|||||||
.children('.attributes-body')
|
.children('.attributes-body')
|
||||||
.fadeOut(300);
|
.fadeOut(300);
|
||||||
}
|
}
|
||||||
$(this).toggleClass('disable');
|
$(this).toggleClass('disabled');
|
||||||
};
|
};
|
||||||
if($(this).hasClass('remove-input')) {
|
if($(this).hasClass('remove-input')) {
|
||||||
$(this).closest('.input-append').fadeOut(300, function() {
|
$(this).closest('.input-append').fadeOut(300, function() {
|
||||||
@@ -382,7 +382,7 @@ $(function() {
|
|||||||
});
|
});
|
||||||
$('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
$('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
||||||
if($(this).hasClass('togglebox')) {
|
if($(this).hasClass('togglebox')) {
|
||||||
if($(this).hasClass('disable')) {
|
if($(this).hasClass('disabled')) {
|
||||||
$(this).find('.toggle-check')
|
$(this).find('.toggle-check')
|
||||||
.attr('value', 'false')
|
.attr('value', 'false')
|
||||||
.closest('.attributes')
|
.closest('.attributes')
|
||||||
@@ -411,7 +411,7 @@ $(function() {
|
|||||||
$(this).parent('.field-type').removeClass('in');
|
$(this).parent('.field-type').removeClass('in');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$(this).toggleClass('disable');
|
$(this).toggleClass('disabled');
|
||||||
};
|
};
|
||||||
if($(this).hasClass('delete')) {
|
if($(this).hasClass('delete')) {
|
||||||
$(this).closest('.attributes').fadeOut(300, function() {
|
$(this).closest('.attributes').fadeOut(300, function() {
|
||||||
|
|||||||
@@ -1,66 +1,93 @@
|
|||||||
|
//Preview need a link in form as Ex and a corresponding PUT action in controller
|
||||||
|
//Ex preview trigger:
|
||||||
|
// <%= link_to "NewPreview", realtime_preview_admin_ad_banner_path(ad_banner_tab) , :class=>'preview_trigger'%>
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$(".post_preview").click(function(){
|
// $(".post_preview").click(function(e){
|
||||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
|
||||||
|
|
||||||
$.post($(this).attr('url'), $(".previewable").serialize() ,function(data){
|
|
||||||
$('#show_preview .modal').modal();
|
|
||||||
$('#show_preview .modal').height(function() {
|
|
||||||
return $(window).height() * 0.7;
|
|
||||||
});
|
|
||||||
},'script');
|
|
||||||
});
|
|
||||||
$(".preview_trigger").click(function(){
|
|
||||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
|
||||||
$.ajax({
|
|
||||||
type: 'PUT',
|
|
||||||
url: $(this).attr("href"),
|
|
||||||
data: $(this).parents("form").serialize(),
|
|
||||||
success: function (msg) {
|
|
||||||
$('#show_preview .modal').modal();
|
|
||||||
$('#show_preview .modal').height(function() {
|
|
||||||
return $(window).height() * 0.7;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
error: function(){
|
|
||||||
alert("ERROR");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
// $('#main-wrap').on(clickEvent, '.post_preview, .preview_trigger', function(e) {
|
|
||||||
// $("#main-wrap").after("<span id='show_preview'></span>");
|
// $("#main-wrap").after("<span id='show_preview'></span>");
|
||||||
// if($(this).hasClass('post_preview')) {
|
// e.preventDefault();
|
||||||
// var attrs = e.target.attributes;
|
// var form = $(this).parents("form").first()
|
||||||
// var url = attrs['url'];
|
// //var cont = form["content"].value;
|
||||||
// $("form.previewable").ajaxSubmit({
|
// // $.ajax({
|
||||||
// beforeSubmit: function(a,f,o){
|
// // type: 'POST',
|
||||||
// o.dataType = 'script';
|
// // url: $(this).attr("href")+'?preview=true',
|
||||||
// o.url = url.nodeValue;
|
// // data: form.serialize(),
|
||||||
// o.type = 'post';
|
// // dataType: "script",
|
||||||
// },success: function(msg) {
|
// // success: function (msg) {
|
||||||
// $('#show_preview .modal').modal()
|
// // $("#"+start_modal_with_id).modal('show'); },
|
||||||
// $('#show_preview .modal').height(function() {
|
// // error: function(){
|
||||||
// return $(window).height() * 0.7;
|
// // alert("ERROR");
|
||||||
// });
|
// // }
|
||||||
// }
|
// // });
|
||||||
|
// url = "/panel/news/back_end/news_bulletins/preview?preview=true"
|
||||||
// });
|
// // alert(url)
|
||||||
// } else if($(this).hasClass('preview_trigger')) {
|
// form.attr("action",url);
|
||||||
// $.ajax({
|
// form.submit();
|
||||||
// type: 'PUT',
|
// //return false;
|
||||||
// url: $(this).attr("href"),
|
|
||||||
// data: $(this).parents("form").serialize(),
|
|
||||||
// success: function (msg) {
|
|
||||||
// $('#show_preview .modal').modal();
|
|
||||||
// $('#show_preview .modal').height(function() {
|
|
||||||
// return $(window).height() * 0.7;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// error: function(){
|
|
||||||
// alert("ERROR");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// });
|
// });
|
||||||
|
// /panel/announcement/back_end/bulletins/preview
|
||||||
|
$('#main-wrap').on(clickEvent, '.post_preview, .preview_trigger', function(e) {
|
||||||
|
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||||
|
if($(this).hasClass('post_preview')) {
|
||||||
|
var attrs = e.target.attributes;
|
||||||
|
var url = attrs['url'];
|
||||||
|
$("form.previewable").ajaxSubmit({
|
||||||
|
beforeSubmit: function(a,f,o){
|
||||||
|
o.dataType = 'script';
|
||||||
|
o.url = url.nodeValue;
|
||||||
|
o.type = 'post';
|
||||||
|
},success: function(msg) {
|
||||||
|
$('#show_preview .modal').modal()
|
||||||
|
$('#show_preview .modal').height(function() {
|
||||||
|
return $(window).height() * 0.7;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
} else if($(this).hasClass('preview_trigger')) {
|
||||||
|
$.ajax({
|
||||||
|
type: 'PUT',
|
||||||
|
url: $(this).attr("href"),
|
||||||
|
data: $(this).parents("form").serialize(),
|
||||||
|
success: function (msg) {
|
||||||
|
$('#show_preview .modal').modal();
|
||||||
|
$('#show_preview .modal').height(function() {
|
||||||
|
return $(window).height() * 0.7;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function(){
|
||||||
|
alert("ERROR");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// $("a.preview_trigger").on('click',function(){
|
||||||
|
// $("#main-wrap").after("<span id='show_preview'></span>");
|
||||||
|
// $.ajax({
|
||||||
|
// type: 'PUT',
|
||||||
|
// url:$(this).attr("href"),
|
||||||
|
// data:$(this).parents("form").serialize(),
|
||||||
|
// success: function (msg) {
|
||||||
|
// $("#"+start_modal_with_id).modal('show'); },
|
||||||
|
// error: function(){
|
||||||
|
// alert("ERROR");
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// return false;
|
||||||
|
// });
|
||||||
|
// $("form.nccu_ajax_form").ajaxForm({
|
||||||
|
// beforeSubmit: function(a,f,o) {
|
||||||
|
// // if(clicked_what.hasClass("post_preview")){
|
||||||
|
// // $("#main-wrap").after("<span id='show_preview'></span>");
|
||||||
|
// // o.dataType = 'script';
|
||||||
|
// // o.url = clicked_what.attr("url");
|
||||||
|
// // }
|
||||||
|
// },
|
||||||
|
// success: function(data) {
|
||||||
|
// // if(!clicked_what.hasClass("post_preview")){
|
||||||
|
// // window.location = data.redirect_url;
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
});
|
});
|
||||||
@@ -51,7 +51,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
if($('.set-sidebar-state').length) {
|
if($('.set-sidebar-state').length) {
|
||||||
if(window.localStorage.getItem('sidebarState') == 1) {
|
if(window.localStorage.getItem('sidebarState') == 1) {
|
||||||
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disable');
|
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disabled');
|
||||||
}
|
}
|
||||||
$('.set-sidebar-state').on({
|
$('.set-sidebar-state').on({
|
||||||
change: function() {
|
change: function() {
|
||||||
|
|||||||
@@ -3,5 +3,4 @@
|
|||||||
//= require lib/all-list
|
//= require lib/all-list
|
||||||
//= require lib/jquery.fastLiveFilter.js
|
//= require lib/jquery.fastLiveFilter.js
|
||||||
//= require lib/checkbox.card.js
|
//= require lib/checkbox.card.js
|
||||||
//= require lib/jquery.form.js
|
//= require lib/jquery.form.js
|
||||||
//= require lib/member/member-role.js
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||||
// the compiled file.
|
// the compiled file.
|
||||||
//
|
//
|
||||||
//= require mobile/jquery-1.7.1
|
//= require jquery
|
||||||
//= require lib/jquery.preload.min.js
|
//= require lib/jquery.preload.min.js
|
||||||
//= require cycle2
|
//= require cycle2
|
||||||
//= require mobile/jquery.mu.image.resize
|
//= require mobile/jquery.mu.image.resize
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ $('#index').live('pageinit',function(){
|
|||||||
});
|
});
|
||||||
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
||||||
$(this).find(".newpic img").muImageResize({width: 280, height: 200});
|
$(this).find(".newpic img").muImageResize({width: 280, height: 200});
|
||||||
// $('.slideshow').cycle({
|
$('.slideshow').cycle({
|
||||||
// fx: $effect,
|
fx: $effect,
|
||||||
// timeout: $timeout
|
timeout: $timeout
|
||||||
// });
|
});
|
||||||
$(".newlist").css({
|
$(".newlist").css({
|
||||||
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
||||||
})
|
})
|
||||||
@@ -113,10 +113,10 @@ $(window).bind("orientationchange", function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
||||||
// $('.slideshow').cycle({
|
$('.slideshow').cycle({
|
||||||
// fx: $effect,
|
fx: $effect,
|
||||||
// timeout: $timeout
|
timeout: $timeout
|
||||||
// });
|
});
|
||||||
|
|
||||||
$(".newlist").css({
|
$(".newlist").css({
|
||||||
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
||||||
|
|||||||
@@ -56,10 +56,4 @@
|
|||||||
width: 26px;
|
width: 26px;
|
||||||
height: 3px;
|
height: 3px;
|
||||||
background: url(miniColors/line.gif) center no-repeat;
|
background: url(miniColors/line.gif) center no-repeat;
|
||||||
}
|
|
||||||
|
|
||||||
.miniColors-trigger.btn {
|
|
||||||
background-image: none;
|
|
||||||
height: 16px;
|
|
||||||
width: 0px;
|
|
||||||
}
|
}
|
||||||
@@ -171,20 +171,12 @@ div[data-role="page"] {
|
|||||||
float: left;
|
float: left;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
min-height: 490px;
|
min-height: 490px;
|
||||||
/*max-height: 490px;*/
|
max-height: 490px;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: 0 10px 10px 0;
|
margin: 0 10px 10px 0;
|
||||||
box-shadow: 0px 3px 5px rgba(0,0,0,.1);
|
box-shadow: 0px 3px 5px rgba(0,0,0,.1);
|
||||||
}
|
}
|
||||||
.content .orbit-cycle-slideshow {
|
|
||||||
height: 300px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.content .orbit-cycle-slideshow img {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
#index .content .newpic {
|
#index .content .newpic {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
@@ -326,22 +318,13 @@ div[id^="dialog"] .content {
|
|||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
@media(min-width:320px){
|
@media(min-width:320px){
|
||||||
.content .orbit-cycle-slideshow {
|
|
||||||
height: 130px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@media(min-width: 480px){
|
@media(min-width: 480px){
|
||||||
.content .orbit-cycle-slideshow {
|
|
||||||
height: 170px;
|
|
||||||
}
|
|
||||||
.content .newitem {
|
.content .newitem {
|
||||||
width: 440px;
|
width: 440px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media(min-width:600px) {
|
@media(min-width:600px) {
|
||||||
.content .orbit-cycle-slideshow {
|
|
||||||
height: 200px;
|
|
||||||
}
|
|
||||||
.main-menu ul {
|
.main-menu ul {
|
||||||
width: 420px;
|
width: 420px;
|
||||||
}
|
}
|
||||||
@@ -350,9 +333,6 @@ div[id^="dialog"] .content {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media(min-width:768px) {
|
@media(min-width:768px) {
|
||||||
.content .orbit-cycle-slideshow {
|
|
||||||
height: 250px;
|
|
||||||
}
|
|
||||||
.main-menu ul {
|
.main-menu ul {
|
||||||
width: 480px;
|
width: 480px;
|
||||||
}
|
}
|
||||||
@@ -364,9 +344,6 @@ div[id^="dialog"] .content {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media(min-width:800px) {
|
@media(min-width:800px) {
|
||||||
.content .orbit-cycle-slideshow {
|
|
||||||
height: 330px;
|
|
||||||
}
|
|
||||||
.main-menu ul {
|
.main-menu ul {
|
||||||
width: 480px;
|
width: 480px;
|
||||||
}
|
}
|
||||||
@@ -375,9 +352,6 @@ div[id^="dialog"] .content {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media(min-width:961px) {
|
@media(min-width:961px) {
|
||||||
.content .orbit-cycle-slideshow {
|
|
||||||
height: 380px;
|
|
||||||
}
|
|
||||||
.main-menu ul {
|
.main-menu ul {
|
||||||
width: 480px;
|
width: 480px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,16 +50,6 @@ class Admin::DashboardsController < OrbitBackendController
|
|||||||
render :json => @usw.uw_diskused_perc.to_s
|
render :json => @usw.uw_diskused_perc.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_month_traffic
|
|
||||||
result = []
|
|
||||||
(0..31).each do |i|
|
|
||||||
the_day = i.day.ago
|
|
||||||
visits = Impression.where( created_at: {'$gte' => the_day.beginning_of_day, '$lte' => the_day.end_of_day}).count
|
|
||||||
result.push({the_day.strftime("%b-%d")=>visits})
|
|
||||||
end
|
|
||||||
render :js => result.to_json
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def get_module_app_count(*args)
|
def get_module_app_count(*args)
|
||||||
|
|||||||
@@ -54,9 +54,10 @@ class Admin::DesignsController < OrbitBackendController
|
|||||||
when 'javascripts', 'themes'#, 'images'
|
when 'javascripts', 'themes'#, 'images'
|
||||||
@object = @design.send(params[:type]).find(params[:object_id])
|
@object = @design.send(params[:type]).find(params[:object_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
Dir.mktmpdir('f_path') { |dir|
|
Dir.mktmpdir('f_path') { |dir|
|
||||||
temp_file = File.new(dir + '/' + File.basename(@object.file.url), 'w+')
|
temp_file = File.new(dir + '/' + File.basename(@object.file.url), 'w+')
|
||||||
temp_file.write(params[:html_code].force_encoding('UTF-8'))
|
temp_file.write(params[:file][:content].force_encoding('UTF-8'))
|
||||||
@object.remove_file!
|
@object.remove_file!
|
||||||
@object.file = temp_file
|
@object.file = temp_file
|
||||||
@object.save
|
@object.save
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class Admin::ItemsController < OrbitBackendController
|
|||||||
|
|
||||||
def update_position
|
def update_position
|
||||||
item = Item.find(params[:id])
|
item = Item.find(params[:id])
|
||||||
item.shift_to(params[:parent_id], params[:position].to_i, params[:next_sibling_id])
|
item.shift_to(params[:parent_id], params[:position].to_i)
|
||||||
render :nothing => true, status: 200
|
render :nothing => true, status: 200
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -40,18 +40,8 @@ class Admin::ItemsController < OrbitBackendController
|
|||||||
m["main"] = [module_app.label, module_app.id.to_s]
|
m["main"] = [module_app.label, module_app.id.to_s]
|
||||||
m["sub"] = module_app.app_pages.map{|name, data| [t(data["i18n"]), name]} rescue []
|
m["sub"] = module_app.app_pages.map{|name, data| [t(data["i18n"]), name]} rescue []
|
||||||
m["sub"] << [I18n.t('default_widget.default_widget'),'default_widget'] if module_app.has_default_widget?
|
m["sub"] << [I18n.t('default_widget.default_widget'),'default_widget'] if module_app.has_default_widget?
|
||||||
|
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||||
if module_app.key == 'member'
|
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||||
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
elsif module_app.key == 'member_staff'
|
|
||||||
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
else
|
|
||||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
|
||||||
end
|
|
||||||
|
|
||||||
m["count"] = module_app.get_registration.get_data_count.to_a
|
m["count"] = module_app.get_registration.get_data_count.to_a
|
||||||
module_apps << m
|
module_apps << m
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ class Admin::PagePartsController < OrbitBackendController
|
|||||||
@class_options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
|
@class_options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
|
||||||
@partial = 'default_widget'
|
@partial = 'default_widget'
|
||||||
else
|
else
|
||||||
|
@frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil
|
||||||
# @frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil
|
|
||||||
@frontend_styles = @module_app.widgets[@part.widget_path]["style"] rescue nil
|
|
||||||
@partial = 'custom_widget' if @frontend_styles.present?
|
@partial = 'custom_widget' if @frontend_styles.present?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -63,19 +61,8 @@ class Admin::PagePartsController < OrbitBackendController
|
|||||||
m = {}
|
m = {}
|
||||||
m["main"] = [module_app.label, module_app.id.to_s]
|
m["main"] = [module_app.label, module_app.id.to_s]
|
||||||
m["sub"] = module_app.widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
|
m["sub"] = module_app.widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
|
||||||
|
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||||
|
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||||
if module_app.key == 'member'
|
|
||||||
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
elsif module_app.key == 'member_staff'
|
|
||||||
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
else
|
|
||||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
|
||||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
|
||||||
end
|
|
||||||
|
|
||||||
m["count"] = module_app.get_registration.get_data_count.to_a
|
m["count"] = module_app.get_registration.get_data_count.to_a
|
||||||
module_apps << m
|
module_apps << m
|
||||||
end
|
end
|
||||||
@@ -108,7 +95,9 @@ class Admin::PagePartsController < OrbitBackendController
|
|||||||
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
|
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
|
||||||
flash.now[:notice] = t('update.success.content')
|
flash.now[:notice] = t('update.success.content')
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.html {
|
||||||
|
redirect_to admin_page_url(@part.page, edit: true)
|
||||||
|
}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@id = params[:id]
|
@id = params[:id]
|
||||||
|
|||||||
@@ -21,16 +21,6 @@ class Admin::PagesController < Admin::ItemsController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if params[:page][:category]
|
|
||||||
if params[:page][:category][0] == ""
|
|
||||||
params[:page][:category] = []
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if params[:page][:tag]
|
|
||||||
if params[:page][:tag][0] == ""
|
|
||||||
params[:page][:tag] = []
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@item = Page.find(params[:id])
|
@item = Page.find(params[:id])
|
||||||
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
|
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 )
|
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||||
@@ -70,8 +60,8 @@ class Admin::PagesController < Admin::ItemsController
|
|||||||
m = {}
|
m = {}
|
||||||
m["main"] = page.module_app_id.to_s
|
m["main"] = page.module_app_id.to_s
|
||||||
m["sub"] = page.app_frontend_url
|
m["sub"] = page.app_frontend_url
|
||||||
m["category"] = page.category.present? ? page.category.map{|c| c.to_s} : []
|
m["category"] = page.category.present? ? [0, page.category.map{|c| c.to_s}] : [1]
|
||||||
m["tags"] = page.tag.present? ? page.tag.map{|c| c.to_s} : []
|
m["tags"] = page.tag.present? ? [0, page.tag.map{|c| c.to_s}] : [1]
|
||||||
m["public"] = page.is_published ? 1 : 0
|
m["public"] = page.is_published ? 1 : 0
|
||||||
m["link"] = @site_valid_locales.inject([]) do |link, locale|
|
m["link"] = @site_valid_locales.inject([]) do |link, locale|
|
||||||
link << [locale, (page.enabled_for && page.enabled_for.include?(locale)) ? 1 : 0, (page.menu_enabled_for && page.menu_enabled_for[locale].eql?('true')) ? 1 :0]
|
link << [locale, (page.enabled_for && page.enabled_for.include?(locale)) ? 1 : 0, (page.menu_enabled_for && page.menu_enabled_for[locale].eql?('true')) ? 1 :0]
|
||||||
|
|||||||
@@ -18,18 +18,11 @@ class ApplicationController < ActionController::Base
|
|||||||
helper_attr :site_valid_locales
|
helper_attr :site_valid_locales
|
||||||
|
|
||||||
def check_backend_openness
|
def check_backend_openness
|
||||||
if !Site.first.backend_openness_on
|
if Site.first.backend_openness_on
|
||||||
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
|
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_mobile_api_openness
|
|
||||||
if !Site.first.mobile_api_openness_on
|
|
||||||
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def site_restart
|
def site_restart
|
||||||
Resque.enqueue(RestartServer)
|
Resque.enqueue(RestartServer)
|
||||||
end
|
end
|
||||||
@@ -245,7 +238,7 @@ class ApplicationController < ActionController::Base
|
|||||||
redirect_to ret
|
redirect_to ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_sorted_and_filtered(object_class, query = nil, objects = nil, pagination = true)
|
def get_sorted_and_filtered(object_class, query = nil, objects = nil)
|
||||||
if params[:filter] || params[:sort] || params[:new_filter]
|
if params[:filter] || params[:sort] || params[:new_filter]
|
||||||
@filter = params[:filter]
|
@filter = params[:filter]
|
||||||
new_filter = params[:new_filter]
|
new_filter = params[:new_filter]
|
||||||
@@ -348,20 +341,7 @@ class ApplicationController < ActionController::Base
|
|||||||
else
|
else
|
||||||
objects = get_viewable(object_class, query)
|
objects = get_viewable(object_class, query)
|
||||||
end
|
end
|
||||||
|
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||||
if (!user_signed_in? && object_class == "bulletin")
|
|
||||||
objects = get_bulletins_for_open_backend(objects)
|
|
||||||
end
|
|
||||||
|
|
||||||
if pagination
|
|
||||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
|
||||||
else
|
|
||||||
filter_authorized_objects(objects)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_bulletins_for_open_backend(objects)
|
|
||||||
objects.select{|object| object.is_rejected == false && object.is_pending == false}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_string_value_from_object(object)
|
def get_string_value_from_object(object)
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ class DefaultWidgetController< OrbitWidgetController
|
|||||||
|
|
||||||
def default_widget
|
def default_widget
|
||||||
@search = params["search_query"].blank? ? false : true
|
@search = params["search_query"].blank? ? false : true
|
||||||
|
|
||||||
if !params[:id].blank? and !params["clicked_field_name"].blank?
|
if !params[:id].blank? and !params["clicked_field_name"].blank?
|
||||||
clicked_field_name = params["clicked_field_name"].to_sym
|
clicked_field_name = params["clicked_field_name"].to_sym
|
||||||
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||||
@@ -70,10 +69,7 @@ class DefaultWidgetController< OrbitWidgetController
|
|||||||
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
@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
|
end
|
||||||
|
|
||||||
if params[:filter_category_id] and !params[:filter_category_id].blank?
|
if @paginate || @search
|
||||||
@data = get_filter_data.page(params[:page_main]).per(@data_limit)
|
|
||||||
|
|
||||||
elsif @paginate || @search
|
|
||||||
if @search
|
if @search
|
||||||
@data = search_result.page(params[:page_main]).per(@data_limit) rescue []
|
@data = search_result.page(params[:page_main]).per(@data_limit) rescue []
|
||||||
else #regular listing
|
else #regular listing
|
||||||
@@ -97,18 +93,6 @@ class DefaultWidgetController< OrbitWidgetController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_filter_data
|
|
||||||
model = @default_widget["query"].classify.constantize
|
|
||||||
if params[:filter_category_id].is_a? Array
|
|
||||||
data = model.where(:category_id.in => params[:filter_category_id])
|
|
||||||
elsif params[:filter_category_id].is_a? String
|
|
||||||
data = model.where(:category_id => params[:filter_category_id])
|
|
||||||
end
|
|
||||||
data.available_for_lang(I18n.locale).can_display.desc(:is_top, :postdate)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_category_field_name
|
def get_category_field_name
|
||||||
@ori_class_name = @ori_class_name.constantize
|
@ori_class_name = @ori_class_name.constantize
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ class DesktopController< ApplicationController
|
|||||||
|
|
||||||
def check_desktop_open
|
def check_desktop_open
|
||||||
@site = Site.first
|
@site = Site.first
|
||||||
if !@site.desktop_closed #Need to be change
|
if @site.desktop_closed #Need to be change
|
||||||
redirect_to '/admin/dashboards'
|
redirect_to '/admin/dashboards'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class MobileController < ApplicationController
|
|||||||
def index
|
def index
|
||||||
date_now = Time.now
|
date_now = Time.now
|
||||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page(params[:page_main]).per(15)
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page(params[:page_main]).per(15)
|
||||||
@ad_banner = AdBanner.find(:all, :conditions => {:title => /Home/i})[0]
|
@ad_banner = AdBanner.where(title: "Banner")[0]
|
||||||
end
|
end
|
||||||
|
|
||||||
def announcement
|
def announcement
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class OrbitBackendController < ApplicationController
|
|||||||
status << 'is_top'
|
status << 'is_top'
|
||||||
status << 'is_hot'
|
status << 'is_hot'
|
||||||
status << 'is_hidden' unless is_guest?
|
status << 'is_hidden' unless is_guest?
|
||||||
if @module_app.is_approvable && (is_manager? || is_sub_manager?)
|
if @module_app.is_approvable && is_manager?
|
||||||
status << 'is_pending'
|
status << 'is_pending'
|
||||||
status << 'is_checked'
|
status << 'is_checked'
|
||||||
status << 'is_rejected'
|
status << 'is_rejected'
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class OrbitMemberController < ApplicationController
|
|||||||
status << 'is_top'
|
status << 'is_top'
|
||||||
status << 'is_hot'
|
status << 'is_hot'
|
||||||
status << 'is_hidden' unless is_guest?
|
status << 'is_hidden' unless is_guest?
|
||||||
if @module_app.is_approvable && (is_manager? || is_sub_manager?)
|
if @module_app.is_approvable && is_manager?
|
||||||
status << 'is_pending'
|
status << 'is_pending'
|
||||||
status << 'is_checked'
|
status << 'is_checked'
|
||||||
status << 'is_rejected'
|
status << 'is_rejected'
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ class PagesController < ApplicationController
|
|||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
before_filter :get_item, :only => [:index_from_link, :show_from_link]
|
before_filter :get_item, :only => [:index_from_link, :show_from_link]
|
||||||
before_filter :check_frontend_open, :only => [:index,:show]
|
before_filter :check_frontend_open, :only => [:index,:show]
|
||||||
before_filter :get_last_update_date, :only => [:index,:show]
|
|
||||||
# caches_page :index
|
# caches_page :index
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@@ -65,25 +64,23 @@ class PagesController < ApplicationController
|
|||||||
url = "/#{@item.path}"
|
url = "/#{@item.path}"
|
||||||
options = ''
|
options = ''
|
||||||
options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].blank?
|
options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}click=#{params[:click]}" unless params[:click].blank?
|
|
||||||
# options << "#{options.blank? ? '?' : '&'}part_id=#{params[:page_part_id]}" unless params[:page_part_id].blank?
|
|
||||||
|
|
||||||
if params[:category_id].is_a? Array
|
if params[:category_id].is_a? Array
|
||||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('filter_category_id',params[:category_id])}" unless params[:category_id].blank?
|
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('category_id',params[:category_id])}" unless params[:category_id].blank?
|
||||||
elsif params[:category_id].is_a? String
|
elsif params[:category_id].is_a? String
|
||||||
options << "#{options.blank? ? '?' : '&'}filter_category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:tag_id].is_a? Array
|
if params[:tag_id].is_a? Array
|
||||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('filter_tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
||||||
elsif params[:category_id].is_a? String
|
elsif params[:category_id].is_a? String
|
||||||
options << "#{options.blank? ? '?' : '&'}filter_tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
|
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank?
|
options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank?
|
||||||
# uri = URI::escape(url + options)
|
uri = URI::escape(url + options)
|
||||||
uri = url + options
|
|
||||||
#uri = URI::escape("#{url}?" + params.collect{|k,v| "#{k}=#{v}"}.join('&'))
|
#uri = URI::escape("#{url}?" + params.collect{|k,v| "#{k}=#{v}"}.join('&'))
|
||||||
redirect_to(uri)unless save_from_no_lang_for_page
|
redirect_to(uri)unless save_from_no_lang_for_page
|
||||||
end
|
end
|
||||||
@@ -97,7 +94,6 @@ class PagesController < ApplicationController
|
|||||||
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}image_id=#{params[:image_id]}" unless params[:image_id].blank?
|
|
||||||
redirect_to(url + options) unless save_from_no_lang_for_page
|
redirect_to(url + options) unless save_from_no_lang_for_page
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -109,101 +105,32 @@ class PagesController < ApplicationController
|
|||||||
protected
|
protected
|
||||||
|
|
||||||
def get_item
|
def get_item
|
||||||
# if params[:page_id]
|
|
||||||
# @item = Item.find(params[:page_id])
|
|
||||||
# elsif params[:same_page_id]
|
|
||||||
# @item = Item.find(params[:same_page_id])
|
|
||||||
# else
|
|
||||||
# category_ids = Array(params[:category_id]) unless params[:category_id].nil?
|
|
||||||
# tag_ids = Array(params[:tag_id]) unless params[:tag_id].nil?
|
|
||||||
# module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
|
||||||
|
|
||||||
# default_query = { is_published: true, module_app_id: module_app.id, :app_frontend_url.in => [params[:app_action], 'default_widget'] }
|
|
||||||
# specific_categories = { :category => category_ids }
|
|
||||||
# in_categories = { :category.in => category_ids }
|
|
||||||
# nil_categories = { :category.in => [nil, []] }
|
|
||||||
# specific_tags = { :tag => tag_ids }
|
|
||||||
# in_tags = { :tag.in => tag_ids }
|
|
||||||
# nil_tags = { :tag.in => [nil, []] }
|
|
||||||
|
|
||||||
# if !category_ids.blank? && !tag_ids.blank?
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories).merge(specific_tags)).first
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories).merge(in_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(specific_tags).merge(in_categories)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_categories).merge(in_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
|
||||||
# elsif !category_ids.blank?
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first
|
|
||||||
# @item = Item.where(default_query.merge(specific_categories)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_categories)).first unless @item
|
|
||||||
# elsif !tag_ids.blank?
|
|
||||||
# @item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first
|
|
||||||
# @item = Item.where(default_query.merge(specific_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
|
||||||
# @item = Item.where(default_query.merge(in_tags)).first unless @item
|
|
||||||
# end
|
|
||||||
# @item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
|
||||||
# @item = Item.where(default_query.merge(nil_categories).merge(nil_tags)).first unless @item
|
|
||||||
# @item = Item.where(default_query).first unless @item
|
|
||||||
# end
|
|
||||||
# raise PageError, 'Missing Frontend Page' if @item.nil?
|
|
||||||
|
|
||||||
# if params[:page_id]
|
|
||||||
# @item = Item.find(params[:page_id])
|
|
||||||
# elsif params[:same_page_id]
|
|
||||||
# @item = Item.find(params[:same_page_id])
|
|
||||||
# else
|
|
||||||
# category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
|
||||||
# tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
|
||||||
# module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
|
||||||
# if !category_ids.blank? && !tag_ids.blank?
|
|
||||||
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => tag_ids})
|
|
||||||
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => [nil, []]}) unless @item
|
|
||||||
# elsif !category_ids.blank?
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :category.in => category_ids).any_in(tag: [nil, []]).first
|
|
||||||
# elsif !tag_ids.blank?
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :tag.in => tag_ids).any_in(category: [nil, []]).first
|
|
||||||
# end
|
|
||||||
# @item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil, []]},"category" => { "$in" => [nil, []]}).first unless @item
|
|
||||||
# # @item = Item.root.children.where(:module_app_id => module_app.id).first
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
|
||||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
|
||||||
# end
|
|
||||||
# raise PageError,'Missing Frontend Page' if @item.nil?
|
|
||||||
|
|
||||||
if params[:page_id]
|
if params[:page_id]
|
||||||
@item = Item.find(params[:page_id])
|
@item = Item.find(params[:page_id])
|
||||||
elsif params[:same_page_id]
|
elsif params[:same_page_id]
|
||||||
@item = Item.find(params[:same_page_id])
|
@item = Item.find(params[:same_page_id])
|
||||||
else
|
else
|
||||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
||||||
category_ids = params[:category_id] ? (params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]) : []
|
|
||||||
tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
||||||
|
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||||
if !category_ids.blank?
|
if !category_ids.blank? && !tag_ids.blank?
|
||||||
@item = Item.where(:category => category_ids).first
|
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => tag_ids})
|
||||||
else
|
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => [nil, []]}) unless @item
|
||||||
if params[:action] && params[:action] == "show_from_link"
|
elsif !category_ids.blank?
|
||||||
model = params[:app_action].classify.constantize rescue nil
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :category.in => category_ids).any_in(tag: [nil, []]).first
|
||||||
if !model.nil?
|
elsif !tag_ids.blank?
|
||||||
item = model.find(params[:id])
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :tag.in => tag_ids).any_in(category: [nil, []]).first
|
||||||
@item = Item.where(:category => [item.category_id.to_s]).first if !module_app.has_category.blank?
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||||
@item = Item.root.children.where(:module_app_id => module_app.id).first unless @item
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil, []]},"category" => { "$in" => [nil, []]}).first unless @item
|
||||||
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
||||||
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
||||||
end
|
end
|
||||||
raise PageError,'Missing Frontend Page' if @item.nil?
|
raise PageError,'Missing Frontend Page' if @item.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_frontend_open
|
def check_frontend_open
|
||||||
if !Site.first.frontend_open && current_user.nil? #Need to be change
|
if Site.first.frontend_open && current_user.nil? #Need to be change
|
||||||
redirect_to '/admin/dashboards'
|
redirect_to '/admin/dashboards'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -217,8 +144,4 @@ class PagesController < ApplicationController
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_last_update_date
|
|
||||||
@last_update_date = t(:total_visitors)+' : '+ Impression.count.to_s+' | '+t(:update_at)+' : '+Bulletin.order_by(:updated_at.desc).limit(1).first[:updated_at].to_s
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
Time.zone = ActiveSupport::TimeZone[+8.hours]
|
|
||||||
FLASH_NOTICE_KEYS = [:error, :notice, :warning]
|
FLASH_NOTICE_KEYS = [:error, :notice, :warning]
|
||||||
|
|
||||||
|
|
||||||
@@ -223,49 +223,36 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def display_visitors(options={})
|
def display_visitors(options={})
|
||||||
Impression.where(options).count
|
Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_visitors_today
|
def display_visitors_today
|
||||||
display_visitors(created_at: {'$gte' => Time.now.beginning_of_day, '$lte' => Time.now})
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_visitors_this_week
|
def display_visitors_this_week
|
||||||
display_visitors(created_at: {'$gte' => Time.now-7.days, '$lte' => Time.now})
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_visitors_this_month
|
def display_visitors_this_month
|
||||||
display_visitors(created_at: {'$gte' => Time.now-30.days, '$lte' => Time.now})
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_visitors_this_year
|
def display_visitors_this_year
|
||||||
display_visitors(created_at: {'$gte' => Time.now-365.days, '$lte' => Time.now})
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_month_traffic
|
def get_month_traffic
|
||||||
result = []
|
result = [['Date','Visits']]
|
||||||
(0..30).each do |i|
|
(0..30).each do |i|
|
||||||
visits = Impression.where( created_at: {
|
the_day = i.day.ago
|
||||||
'$gte' => Time.now.beginning_of_day-i.days,
|
visits = Impression.where( created_at: {'$gte' => the_day.beginning_of_day, '$lte' => the_day.end_of_day}).count
|
||||||
'$lte' => Time.now.end_of_day-i.days}
|
result.push([ the_day.strftime("%b-%d"), visits])
|
||||||
).count
|
# result.push({'x'=> i, 'y'=> visits})
|
||||||
result.push([ Time.now.beginning_of_day-i.days, visits])
|
|
||||||
end
|
end
|
||||||
[:name=> t(:visitors_count),:data=>result]
|
result.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
# def get_today_traffic
|
|
||||||
# result = []
|
|
||||||
# (0..30).each do |i|
|
|
||||||
# the_day = i.day.ago
|
|
||||||
# visits = Impression.where( created_at: {'$gte' => the_day.beginning_of_day, '$lte' => the_day.end_of_day}).count
|
|
||||||
# # result.push([ the_day.to_time.to_i, visits])
|
|
||||||
# result.push([ the_day.strftime("%m %d"), visits])
|
|
||||||
# # result.push({'x'=> i, 'y'=> visits})
|
|
||||||
# end
|
|
||||||
# result
|
|
||||||
# end
|
|
||||||
|
|
||||||
def display_date_time(object)
|
def display_date_time(object)
|
||||||
object.strftime("%Y-%m-%d %H:%M")
|
object.strftime("%Y-%m-%d %H:%M")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ module OrbitBackendHelper
|
|||||||
|
|
||||||
def show_form_status_field(object)
|
def show_form_status_field(object)
|
||||||
#by_object = (!object.is_expired? and object.is_pending?)
|
#by_object = (!object.is_expired? and object.is_pending?)
|
||||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin?)
|
||||||
by_user
|
by_user
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_approval_link(object)
|
def show_approval_link(object)
|
||||||
by_object = (!object.is_expired? and object.is_pending?)
|
by_object = (!object.is_expired? and object.is_pending?)
|
||||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin?)
|
||||||
by_object and by_user
|
by_object and by_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
class UserMailer < Devise::Mailer
|
|
||||||
default :from => "noreply@rulingcom.com"
|
|
||||||
|
|
||||||
def password_reset(user, password)
|
|
||||||
@user = user
|
|
||||||
@password = password
|
|
||||||
mail(:to => user.email,
|
|
||||||
:subject => 'Password Reset Notification')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -44,23 +44,17 @@ class Item
|
|||||||
a
|
a
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_by_parent_and_position(parent, position)
|
def shift_to(new_parent, position)
|
||||||
parent.children.detect{|child| child.position == position}
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def shift_to(new_parent, position, next_sibling_id)
|
|
||||||
position = position.to_i
|
position = position.to_i
|
||||||
new_parent = Item.find(new_parent)
|
new_parent = Item.find(new_parent)
|
||||||
|
current_position_sibling = find_by_parent_and_position(new_parent, position)
|
||||||
if next_sibling_id
|
if current_position_sibling
|
||||||
next_sibling = Item.find(next_sibling_id)
|
if self.position > current_position_sibling.position
|
||||||
self.move_above(next_sibling)
|
self.move_above(current_position_sibling)
|
||||||
else
|
else
|
||||||
self.move_to_bottom
|
self.move_below(current_position_sibling)
|
||||||
end
|
end
|
||||||
|
elsif self.parent != new_parent
|
||||||
if self.parent != new_parent
|
|
||||||
self.parent = new_parent
|
self.parent = new_parent
|
||||||
save
|
save
|
||||||
end
|
end
|
||||||
@@ -92,6 +86,10 @@ class Item
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_by_parent_and_position(parent, position)
|
||||||
|
parent.children.detect{|child| child.position == position}
|
||||||
|
end
|
||||||
|
|
||||||
# Enable the validation for parent_id
|
# Enable the validation for parent_id
|
||||||
def validates_presence_of_parent_id?
|
def validates_presence_of_parent_id?
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class Site
|
|||||||
|
|
||||||
field :frontend_open, :type => Boolean, :default => true
|
field :frontend_open, :type => Boolean, :default => true
|
||||||
field :backend_openness_on, :type => Boolean, :default => false
|
field :backend_openness_on, :type => Boolean, :default => false
|
||||||
field :mobile_api_openness_on, :type => Boolean, :default => false
|
|
||||||
field :desktop_closed, :type => Boolean, :default => false
|
field :desktop_closed, :type => Boolean, :default => false
|
||||||
field :sitemap_menu_in_header, :type => Boolean, :default => false
|
field :sitemap_menu_in_header, :type => Boolean, :default => false
|
||||||
field :enable_terms_of_use, :type => Boolean, :default => false
|
field :enable_terms_of_use, :type => Boolean, :default => false
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ class RoleCategory < RoleFilter
|
|||||||
has_and_belongs_to_many :users
|
has_and_belongs_to_many :users
|
||||||
belongs_to :role
|
belongs_to :role
|
||||||
|
|
||||||
scope :can_display,where(disable: false)
|
|
||||||
|
|
||||||
def self.get_role_data(role_key)
|
def self.get_role_data(role_key)
|
||||||
|
|
||||||
@role = Role.where(:key =>role_key).first
|
@role = Role.where(:key =>role_key).first
|
||||||
|
|||||||
@@ -186,21 +186,20 @@ class User
|
|||||||
}.uniq!
|
}.uniq!
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.get_member_list_attribute_field(role_type,field_key)
|
def self.get_member_list_attribute_field_name(role_type,field_key)
|
||||||
@attribute = ::Attribute.where(:key => role_type).first
|
@attribute = ::Attribute.where(:key => role_type).first
|
||||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first.title
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.get_member_list_attribute_value(user_id,field_id)
|
def self.get_member_list_attribute_value(user_id,role_type,field_key)
|
||||||
# @attribute = ::Attribute.where(:key => role_type).first
|
@attribute = ::Attribute.where(:key => role_type).first
|
||||||
# @AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
@AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||||
return ::AttributeValue.where(attribute_field_id: field_id, :user_id => user_id).first
|
return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.get_role_member_data_by_sort(role, field_key, role_status_id)
|
def self.get_role_member_data_by_sort(role_status_id)
|
||||||
a = Array.new
|
a = Array.new
|
||||||
attribute_field_data = get_member_list_attribute_field(role,field_key)
|
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,"staff","job_title")['val'].to_i, t ] }
|
||||||
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,attribute_field_data.id)['val'].to_i, t ] }
|
|
||||||
member_data = a.sort
|
member_data = a.sort
|
||||||
member_data_tmp = member_data.collect {|v| v[1] }
|
member_data_tmp = member_data.collect {|v| v[1] }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<td class="action span3">
|
<td class="action span3">
|
||||||
<div class="toggle-control" style="float: right;">
|
<div class="toggle-control" style="float: right;">
|
||||||
<div class="togglebox <%= attribute.disabled ? 'disabled' : '' %>">
|
<div class="togglebox <%= attribute.disabled ? 'disabled' : '' %>">
|
||||||
<%= check_box_tag 'accept', attribute.disabled ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@attribute_type}_toggle_path(attribute)")}, :checked=> attribute.disabled} %>
|
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@attribute_type}_toggle_path(attribute)"), method: :post, remote: true, class: "switch" %>
|
||||||
<label><b></b></label>
|
<label><b></b></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// $("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
$("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
||||||
location.reload();
|
|
||||||
$.pageslide.close();
|
$.pageslide.close();
|
||||||
openSlide();
|
openSlide();
|
||||||
@@ -2,64 +2,399 @@
|
|||||||
<h2>
|
<h2>
|
||||||
<i class="icons-book-2"></i>
|
<i class="icons-book-2"></i>
|
||||||
<span class="break"></span>
|
<span class="break"></span>
|
||||||
<%= t(:server_usage) %>
|
Server Status
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-content" style='overflow: hidden; text-align:center;'>
|
<div class="box-content" style='overflow: hidden;'>
|
||||||
<div id="cpu_usage" class="pull-left" style="width:200px; height:160px; display: inline-block;"></div>
|
<span id="cpu_usage" style="min-width: 230px; max-width: 220px; height: 220px; display: inline-block; margin-left: -5px;"></span>
|
||||||
<div id="mem_usage" style="width:200px; height:160px; display: inline-block;"></div>
|
<span id="mem_usage" style="min-width: 230px; max-width: 220px; height: 220px; display: inline-block; margin-left: -5px;"></span>
|
||||||
<div id="disk_usage" class="pull-right" style="width:200px; height:160px; display: inline-block;"></div>
|
<span id="disk_usage" style="min-width: 230px; max-width: 220px; height: 220px; display: inline-block; margin-left: -5px;"></span>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var Gages = { 'CPU':{
|
|
||||||
'JustGage': null,
|
|
||||||
'container': 'cpu_usage',
|
|
||||||
'title': 'CPU Usage',
|
|
||||||
'fn': 'get_cpu_usage',
|
|
||||||
'update_interval': 2000
|
|
||||||
},
|
|
||||||
'Mem':{
|
|
||||||
'JustGage': null,
|
|
||||||
'container': 'mem_usage',
|
|
||||||
'title': 'Memory Usage',
|
|
||||||
'fn': 'get_mem_usage',
|
|
||||||
'update_interval': 10000
|
|
||||||
},
|
|
||||||
'Disk':{
|
|
||||||
'JustGage': null,
|
|
||||||
'container': 'disk_usage',
|
|
||||||
'title': 'Disk Usage',
|
|
||||||
'fn': 'get_disk_usage',
|
|
||||||
'update_interval': 30000
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$.each(Gages,function(id,Gage){
|
// get_cpu_usage();
|
||||||
Gage['JustGage'] = new JustGage({
|
// get_mem_usage();
|
||||||
id: Gage['container'],
|
// get_disk_usage();
|
||||||
value: 0,
|
|
||||||
min: 0,
|
|
||||||
max: 100,
|
|
||||||
title: Gage['title'],
|
|
||||||
shadowVerticalOffset: 10,
|
|
||||||
levelColors: ['#39D824','#FFC33F','#F51F1F'],
|
|
||||||
titleFontColor: '#666',
|
|
||||||
valueFontColor: '#666',
|
|
||||||
labelFontColor: '#666',
|
|
||||||
label: '%',
|
|
||||||
refreshAnimationTime: 800
|
|
||||||
});
|
|
||||||
|
|
||||||
update_usage(Gage);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function update_usage(Gage){
|
// function get_cpu_usage(){
|
||||||
$.get('/admin/dashboards/'+Gage['fn'],function(usage){
|
// $('#cpu_usage').highcharts({
|
||||||
Gage['JustGage'].refresh(parseInt(usage));
|
// chart: {
|
||||||
setTimeout(function(){update_usage(Gage);},Gage['update_interval']);
|
// type: 'gauge',
|
||||||
});
|
// plotBackgroundColor: null,
|
||||||
}
|
// plotBackgroundImage: null,
|
||||||
|
// plotBorderWidth: 0,
|
||||||
|
// plotShadow: false
|
||||||
|
// },
|
||||||
|
|
||||||
|
// title: {
|
||||||
|
// text: 'CPU Usage'
|
||||||
|
// },
|
||||||
|
|
||||||
|
// pane: {
|
||||||
|
// startAngle: -150,
|
||||||
|
// endAngle: 150,
|
||||||
|
// background: [{
|
||||||
|
// backgroundColor: {
|
||||||
|
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||||
|
// stops: [
|
||||||
|
// [0, '#FFF'],
|
||||||
|
// [1, '#333']
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// borderWidth: 0,
|
||||||
|
// outerRadius: '109%'
|
||||||
|
// }, {
|
||||||
|
// backgroundColor: {
|
||||||
|
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||||
|
// stops: [
|
||||||
|
// [0, '#333'],
|
||||||
|
// [1, '#FFF']
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// borderWidth: 1,
|
||||||
|
// outerRadius: '107%'
|
||||||
|
// }, {
|
||||||
|
// // default background
|
||||||
|
// }, {
|
||||||
|
// backgroundColor: '#DDD',
|
||||||
|
// borderWidth: 0,
|
||||||
|
// outerRadius: '105%',
|
||||||
|
// innerRadius: '103%'
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
|
||||||
|
// // the value axis
|
||||||
|
// yAxis: {
|
||||||
|
// min: 0,
|
||||||
|
// max: 100,
|
||||||
|
|
||||||
|
// minorTickInterval: 'auto',
|
||||||
|
// minorTickWidth: 1,
|
||||||
|
// minorTickLength: 10,
|
||||||
|
// minorTickPosition: 'inside',
|
||||||
|
// minorTickColor: '#666',
|
||||||
|
|
||||||
|
// tickPixelInterval: 30,
|
||||||
|
// tickWidth: 2,
|
||||||
|
// tickPosition: 'inside',
|
||||||
|
// tickLength: 10,
|
||||||
|
// tickColor: '#666',
|
||||||
|
// labels: {
|
||||||
|
// step: 2,
|
||||||
|
// rotation: 'auto'
|
||||||
|
// },
|
||||||
|
// title: {
|
||||||
|
// text: ''
|
||||||
|
// },
|
||||||
|
// plotBands: [{
|
||||||
|
// from: 0,
|
||||||
|
// to: 60,
|
||||||
|
// color: '#55BF3B' // green
|
||||||
|
// }, {
|
||||||
|
// from: 60,
|
||||||
|
// to: 80,
|
||||||
|
// color: '#DDDF0D' // yellow
|
||||||
|
// }, {
|
||||||
|
// from: 80,
|
||||||
|
// to: 100,
|
||||||
|
// color: '#DF5353' // red
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
|
||||||
|
// series: [{
|
||||||
|
// name: 'CPU Usage',
|
||||||
|
// data: [0],
|
||||||
|
// dataLabels: {
|
||||||
|
// formatter: function () {
|
||||||
|
// var usage = this.y;
|
||||||
|
// return '<span style="color:#339">'+ usage + ' %</span><br/>';
|
||||||
|
// },
|
||||||
|
// backgroundColor: {
|
||||||
|
// linearGradient: {
|
||||||
|
// x1: 0,
|
||||||
|
// y1: 0,
|
||||||
|
// x2: 0,
|
||||||
|
// y2: 1
|
||||||
|
// },
|
||||||
|
// stops: [
|
||||||
|
// [0, '#DDD'],
|
||||||
|
// [1, '#FFF']
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// tooltip: {
|
||||||
|
// valueSuffix: ' %'
|
||||||
|
// }
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
// function(chart) {
|
||||||
|
// update_cpu_usage(chart);
|
||||||
|
// setInterval(function() {
|
||||||
|
// update_cpu_usage(chart);
|
||||||
|
// }, 2000);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// function update_cpu_usage(chart){
|
||||||
|
// $.get('/admin/dashboards/get_cpu_usage',function(usage){
|
||||||
|
// var point = chart.series[0].points[0],
|
||||||
|
// newVal = Math.round(usage);
|
||||||
|
// point.update(newVal);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// function get_mem_usage(){
|
||||||
|
// $('#mem_usage').highcharts({
|
||||||
|
// chart: {
|
||||||
|
// type: 'gauge',
|
||||||
|
// plotBackgroundColor: null,
|
||||||
|
// plotBackgroundImage: null,
|
||||||
|
// plotBorderWidth: 0,
|
||||||
|
// plotShadow: false
|
||||||
|
// },
|
||||||
|
|
||||||
|
// title: {
|
||||||
|
// text: 'Memory Usage'
|
||||||
|
// },
|
||||||
|
|
||||||
|
// pane: {
|
||||||
|
// startAngle: -150,
|
||||||
|
// endAngle: 150,
|
||||||
|
// background: [{
|
||||||
|
// backgroundColor: {
|
||||||
|
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||||
|
// stops: [
|
||||||
|
// [0, '#FFF'],
|
||||||
|
// [1, '#333']
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// borderWidth: 0,
|
||||||
|
// outerRadius: '109%'
|
||||||
|
// }, {
|
||||||
|
// backgroundColor: {
|
||||||
|
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||||
|
// stops: [
|
||||||
|
// [0, '#333'],
|
||||||
|
// [1, '#FFF']
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// borderWidth: 1,
|
||||||
|
// outerRadius: '107%'
|
||||||
|
// }, {
|
||||||
|
// // default background
|
||||||
|
// }, {
|
||||||
|
// backgroundColor: '#DDD',
|
||||||
|
// borderWidth: 0,
|
||||||
|
// outerRadius: '105%',
|
||||||
|
// innerRadius: '103%'
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
|
||||||
|
// // the value axis
|
||||||
|
// yAxis: {
|
||||||
|
// min: 0,
|
||||||
|
// max: 100,
|
||||||
|
|
||||||
|
// minorTickInterval: 'auto',
|
||||||
|
// minorTickWidth: 1,
|
||||||
|
// minorTickLength: 10,
|
||||||
|
// minorTickPosition: 'inside',
|
||||||
|
// minorTickColor: '#666',
|
||||||
|
|
||||||
|
// tickPixelInterval: 30,
|
||||||
|
// tickWidth: 2,
|
||||||
|
// tickPosition: 'inside',
|
||||||
|
// tickLength: 10,
|
||||||
|
// tickColor: '#666',
|
||||||
|
// labels: {
|
||||||
|
// step: 2,
|
||||||
|
// rotation: 'auto'
|
||||||
|
// },
|
||||||
|
// title: {
|
||||||
|
// text: ''
|
||||||
|
// },
|
||||||
|
// plotBands: [{
|
||||||
|
// from: 0,
|
||||||
|
// to: 60,
|
||||||
|
// color: '#55BF3B' // green
|
||||||
|
// }, {
|
||||||
|
// from: 60,
|
||||||
|
// to: 80,
|
||||||
|
// color: '#DDDF0D' // yellow
|
||||||
|
// }, {
|
||||||
|
// from: 80,
|
||||||
|
// to: 100,
|
||||||
|
// color: '#DF5353' // red
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
|
||||||
|
// series: [{
|
||||||
|
// name: 'Memory Usage',
|
||||||
|
// data: [0],
|
||||||
|
// dataLabels: {
|
||||||
|
// formatter: function () {
|
||||||
|
// var usage = this.y;
|
||||||
|
// return '<span style="color:#339">'+ usage + ' %</span><br/>';
|
||||||
|
// },
|
||||||
|
// backgroundColor: {
|
||||||
|
// linearGradient: {
|
||||||
|
// x1: 0,
|
||||||
|
// y1: 0,
|
||||||
|
// x2: 0,
|
||||||
|
// y2: 1
|
||||||
|
// },
|
||||||
|
// stops: [
|
||||||
|
// [0, '#DDD'],
|
||||||
|
// [1, '#FFF']
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// tooltip: {
|
||||||
|
// valueSuffix: ' %'
|
||||||
|
// }
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
// function(chart) {
|
||||||
|
// update_mem_usage(chart)
|
||||||
|
// setInterval(function() {
|
||||||
|
// update_mem_usage(chart);
|
||||||
|
// }, 5000);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// function update_mem_usage(chart){
|
||||||
|
// $.get('/admin/dashboards/get_mem_usage',function(usage){
|
||||||
|
// var point = chart.series[0].points[0],
|
||||||
|
// newVal = Math.round(usage);
|
||||||
|
// point.update(newVal);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// function get_disk_usage(){
|
||||||
|
// $('#disk_usage').highcharts({
|
||||||
|
// chart: {
|
||||||
|
// type: 'gauge',
|
||||||
|
// plotBackgroundColor: null,
|
||||||
|
// plotBackgroundImage: null,
|
||||||
|
// plotBorderWidth: 0,
|
||||||
|
// plotShadow: false
|
||||||
|
// },
|
||||||
|
|
||||||
|
// title: {
|
||||||
|
// text: 'Disk Usage'
|
||||||
|
// },
|
||||||
|
|
||||||
|
// pane: {
|
||||||
|
// startAngle: -150,
|
||||||
|
// endAngle: 150,
|
||||||
|
// background: [{
|
||||||
|
// backgroundColor: {
|
||||||
|
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||||
|
// stops: [
|
||||||
|
// [0, '#FFF'],
|
||||||
|
// [1, '#333']
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// borderWidth: 0,
|
||||||
|
// outerRadius: '109%'
|
||||||
|
// }, {
|
||||||
|
// backgroundColor: {
|
||||||
|
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||||
|
// stops: [
|
||||||
|
// [0, '#333'],
|
||||||
|
// [1, '#FFF']
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// borderWidth: 1,
|
||||||
|
// outerRadius: '107%'
|
||||||
|
// }, {
|
||||||
|
// // default background
|
||||||
|
// }, {
|
||||||
|
// backgroundColor: '#DDD',
|
||||||
|
// borderWidth: 0,
|
||||||
|
// outerRadius: '105%',
|
||||||
|
// innerRadius: '103%'
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
|
||||||
|
// // the value axis
|
||||||
|
// yAxis: {
|
||||||
|
// min: 0,
|
||||||
|
// max: 100,
|
||||||
|
|
||||||
|
// minorTickInterval: 'auto',
|
||||||
|
// minorTickWidth: 1,
|
||||||
|
// minorTickLength: 10,
|
||||||
|
// minorTickPosition: 'inside',
|
||||||
|
// minorTickColor: '#666',
|
||||||
|
|
||||||
|
// tickPixelInterval: 30,
|
||||||
|
// tickWidth: 2,
|
||||||
|
// tickPosition: 'inside',
|
||||||
|
// tickLength: 10,
|
||||||
|
// tickColor: '#666',
|
||||||
|
// labels: {
|
||||||
|
// step: 2,
|
||||||
|
// rotation: 'auto'
|
||||||
|
// },
|
||||||
|
// title: {
|
||||||
|
// text: ''
|
||||||
|
// },
|
||||||
|
// plotBands: [{
|
||||||
|
// from: 0,
|
||||||
|
// to: 60,
|
||||||
|
// color: '#55BF3B' // green
|
||||||
|
// }, {
|
||||||
|
// from: 60,
|
||||||
|
// to: 80,
|
||||||
|
// color: '#DDDF0D' // yellow
|
||||||
|
// }, {
|
||||||
|
// from: 80,
|
||||||
|
// to: 100,
|
||||||
|
// color: '#DF5353' // red
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
|
||||||
|
// series: [{
|
||||||
|
// name: 'Disk Usage',
|
||||||
|
// data: [0],
|
||||||
|
// dataLabels: {
|
||||||
|
// formatter: function () {
|
||||||
|
// var usage = this.y;
|
||||||
|
// return '<span style="color:#339">'+ usage + ' %</span><br/>';
|
||||||
|
// },
|
||||||
|
// backgroundColor: {
|
||||||
|
// linearGradient: {
|
||||||
|
// x1: 0,
|
||||||
|
// y1: 0,
|
||||||
|
// x2: 0,
|
||||||
|
// y2: 1
|
||||||
|
// },
|
||||||
|
// stops: [
|
||||||
|
// [0, '#DDD'],
|
||||||
|
// [1, '#FFF']
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// tooltip: {
|
||||||
|
// valueSuffix: ' %'
|
||||||
|
// }
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
// function(chart) {
|
||||||
|
// update_disk_usage(chart);
|
||||||
|
// setInterval(function() {
|
||||||
|
// update_disk_usage(chart);
|
||||||
|
// }, 60000);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// function update_disk_usage(chart){
|
||||||
|
// $.get('/admin/dashboards/get_disk_usage',function(usage){
|
||||||
|
// var point = chart.series[0].points[0],
|
||||||
|
// newVal = Math.round(usage);
|
||||||
|
// point.update(newVal);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
</script>
|
</script>
|
||||||
@@ -2,17 +2,58 @@
|
|||||||
<h2>
|
<h2>
|
||||||
<i class="icons-book-2"></i>
|
<i class="icons-book-2"></i>
|
||||||
<span class="break"></span>
|
<span class="break"></span>
|
||||||
<%= t(:monthly_traffic)%>
|
Monthly Traffic
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<div id="month_traffic" style="min-width: 310px; margin: 0 auto">
|
<div id="month_traffic"></div>
|
||||||
<%= line_chart get_month_traffic, :height => "200px", :name => 'Visit',
|
</div>
|
||||||
:library => {
|
<script type="text/javascript">
|
||||||
legend: 'none',
|
google.load("visualization", "1", {packages:["corechart"]});
|
||||||
chartArea:{ width: '95%', left: 50, right: 0},
|
|
||||||
hAxis:{format:'MMM-d',gridlines:{color: '#CCC', count: 31}},
|
var chart;
|
||||||
vAxis:{minValue:-100,viewWindowMode: 'maximized'}
|
var datas =<%= raw(get_month_traffic) %>;
|
||||||
} %>
|
var initData;
|
||||||
</div>
|
|
||||||
</div>
|
google.setOnLoadCallback(init);
|
||||||
|
window.onresize = drawChart;
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
initData = new google.visualization.DataTable();
|
||||||
|
|
||||||
|
$.each(datas,function(idx,data){
|
||||||
|
initData.setValue(idx,1,[data[0],0]);
|
||||||
|
});
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
title: 'Monthly Visits',
|
||||||
|
titlePosition: 'in',
|
||||||
|
fontSize: 10,
|
||||||
|
curveType: 'function',
|
||||||
|
hAxis:{
|
||||||
|
slantedText: true,
|
||||||
|
slantedTextAngle: 35
|
||||||
|
},
|
||||||
|
chartArea:{
|
||||||
|
width: '90%',
|
||||||
|
left: 50,
|
||||||
|
right: 0
|
||||||
|
},
|
||||||
|
animation:{
|
||||||
|
duration: 1000,
|
||||||
|
easing: 'out',
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
drawChart();
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawChart() {
|
||||||
|
chart = new google.visualization.AreaChart(document.getElementById('month_traffic'));
|
||||||
|
chart.draw(google.visualization.arrayToDataTable(initData), options);
|
||||||
|
|
||||||
|
// $.each(datas,function(idx,data){
|
||||||
|
// initData.push([data[0],0]);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,22 +1,13 @@
|
|||||||
<%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>
|
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||||
<%= javascript_include_tag "/static/justgage.1.0.1.min.js" %>
|
|
||||||
<%= javascript_include_tag "/static/raphael.2.1.0.min.js" %>
|
|
||||||
|
|
||||||
<section id="main-wrap">
|
<section id="main-wrap">
|
||||||
<div class="wrap-inner initial">
|
<div class="wrap-inner initial">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<% if is_admin? %>
|
<div class="box span6">
|
||||||
<div class="box span7">
|
|
||||||
<div id='server_loading'>
|
<div id='server_loading'>
|
||||||
<%= render 'server_loading' %>
|
<%= render 'server_loading' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
<div class="box span5">
|
|
||||||
<div id='traffic'>
|
|
||||||
<%= render 'traffic' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="box span">
|
<div class="box span">
|
||||||
@@ -45,6 +36,11 @@
|
|||||||
<%= render 'most_visited' %>
|
<%= render 'most_visited' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="box span4">
|
||||||
|
<div id='traffic'>
|
||||||
|
<%= render 'traffic' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -64,10 +64,6 @@
|
|||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">CSS <b class="caret"></b></a>
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">CSS <b class="caret"></b></a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li class="active"><a href="#html_0" data-toggle="tab"><%= @design.layout.name %></a></li>
|
|
||||||
<% @design.themes.each do |theme| %>
|
|
||||||
<li><a href="#<%= dom_id theme %>" data-toggle="tab"><%= theme.name %></a></li>
|
|
||||||
<%end%>
|
|
||||||
<li><a href="#css_0" data-toggle="tab"><%= @design.css_default.name %></a></li>
|
<li><a href="#css_0" data-toggle="tab"><%= @design.css_default.name %></a></li>
|
||||||
<li><a href="#css_1" data-toggle="tab"><%= @design.css_reset.name %></a></li>
|
<li><a href="#css_1" data-toggle="tab"><%= @design.css_reset.name %></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -80,26 +76,6 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown">
|
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Theme <b class="caret"></b></a>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<% @design.themes.each do |theme| %>
|
|
||||||
<li><a href="#<%= dom_id theme %>" data-toggle="tab"><%= theme.name %></a></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="dropdown">
|
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Images <b class="caret"></b></a>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li><a href="#images" data-toggle="tab">Images</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="dropdown">
|
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Template Info<b class="caret"></b></a>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li><a href="#info" data-toggle="tab">Template Info</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div id="code-groups" class="tab-content">
|
<div id="code-groups" class="tab-content">
|
||||||
<div class="clearfix tab-pane fade active in" id="html_0">
|
<div class="clearfix tab-pane fade active in" id="html_0">
|
||||||
@@ -117,16 +93,8 @@
|
|||||||
<%= render :partial => 'tab_form', :locals => {:type => :css_reset, :object => @design.css_reset} %>
|
<%= render :partial => 'tab_form', :locals => {:type => :css_reset, :object => @design.css_reset} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clearfix tab-pane fade active in" id="images">
|
|
||||||
<%= render :partial => 'images' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="clearfix tab-pane fade active in" id="info">
|
|
||||||
<%= render :partial => 'form' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% @design.javascripts.each do |js| %>
|
<% @design.javascripts.each do |js| %>
|
||||||
<div class="clearfix tab-pane fade active in" id="<%= dom_id js %>">
|
<div class="clearfix tab-pane fade active in" id="#<%= dom_id js %>">
|
||||||
<%= render :partial => 'tab_form', :locals => {:type => :javascripts, :object => js} %>
|
<%= render :partial => 'tab_form', :locals => {:type => :javascripts, :object => js} %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -28,22 +28,20 @@
|
|||||||
<%= select_tag "page[app_frontend_url]", nil, class: "input-xlarge change" %>
|
<%= select_tag "page[app_frontend_url]", nil, class: "input-xlarge change" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox-groups hide" id="page-category-groups" data-for="category">
|
<div class="checkbox-groups hide" id="page-category-groups">
|
||||||
<%= f.label :categories, t(:categories) %>
|
<%= f.label :categories, t(:categories) %>
|
||||||
<%= content_tag :label, class: "checkbox" do %>
|
<%= content_tag :label, class: "checkbox" do %>
|
||||||
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="groups" id="page-category"></div>
|
<div class="groups" id="page-category"></div>
|
||||||
<input type="hidden">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox-groups hide" id="page-tags-groups" data-for="tag">
|
<div class="checkbox-groups hide" id="page-tags-groups">
|
||||||
<%= f.label :tags, t(:tags) %>
|
<%= f.label :tags, t(:tags) %>
|
||||||
<%= content_tag :label, class: "checkbox" do %>
|
<%= content_tag :label, class: "checkbox" do %>
|
||||||
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="groups" id="page-tags"></div>
|
<div class="groups" id="page-tags"></div>
|
||||||
<input type="hidden">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="display-mode"></div>
|
<div class="display-mode"></div>
|
||||||
|
|||||||
@@ -16,9 +16,8 @@
|
|||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to node.title, node.url %>
|
<%= link_to node.title, node.url %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="item-menu">
|
<div class="item-menu">
|
||||||
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), eval("admin_#{node.class.to_s.downcase}_path(node)"), class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
|
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), "/#{node.path}?edit=true", class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
|
||||||
<% if node.class.to_s.downcase.eql?("page") %>
|
<% if node.class.to_s.downcase.eql?("page") %>
|
||||||
<%= link_to content_tag(:i, nil, class: "icon-edit"), "#page", class: "open-slide tip page edit", title: t('editing.page'), data: {title: t('editing.page'), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations)} %>
|
<%= link_to content_tag(:i, nil, class: "icon-edit"), "#page", class: "open-slide tip page edit", title: t('editing.page'), data: {title: t('editing.page'), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations)} %>
|
||||||
<% elsif node.class.to_s.downcase.eql?("link") %>
|
<% elsif node.class.to_s.downcase.eql?("link") %>
|
||||||
|
|||||||
@@ -3,25 +3,4 @@
|
|||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= select 'page_part', 'widget_style', @frontend_styles, {:selected => (@part && @part[:widget_style])}, class: "input-xlarge" %>
|
<%= select 'page_part', 'widget_style', @frontend_styles, {:selected => (@part && @part[:widget_style])}, class: "input-xlarge" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="control-group input-content">
|
|
||||||
<% @module_app.widget_options.tap { |widget|%>
|
|
||||||
<% widget.each { |w|%>
|
|
||||||
<% w.get_options.each do |key, settings| %>
|
|
||||||
<% options = settings[:opts] %>
|
|
||||||
<%= label_tag(t(settings[:label_i18n], :class=>"control-label muted"))%>
|
|
||||||
<% case options%>
|
|
||||||
<% when Hash%>
|
|
||||||
<div class="controls">
|
|
||||||
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)), class: "input-xlarge" %>
|
|
||||||
</div>
|
|
||||||
<% else%>
|
|
||||||
<div class="controls">
|
|
||||||
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)), class: "input-xlarge" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
</div>
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<% 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%>
|
|
||||||
<% when Hash%>
|
|
||||||
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)) %>
|
|
||||||
<% else%>
|
|
||||||
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)) %>
|
|
||||||
<!-- (@part[:widget_field][i][0] if (@part && !@part[:widget_field].blank? && !@part[:widget_field][i].blank?)) ) -->
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<%= javascript_include_tag "lib/items/page_part" %>
|
<%= javascript_include_tag "lib/items/page_part" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= form_for @part, url: {action: "update"}, :remote=>true, html: { class: "form-horizontal main-forms"} do |f| %>
|
|
||||||
|
<%= form_for @part, url: admin_page_part_path(@part), html: { class: "form-horizontal main-forms"} do |f| %>
|
||||||
<%= f.error_messages %>
|
<%= f.error_messages %>
|
||||||
<div class="btn-group" data-toggle="buttons-radio">
|
<div class="btn-group" data-toggle="buttons-radio">
|
||||||
<label href="#none" class="btn btn-large" data-toggle="tab">
|
<label href="#none" class="btn btn-large" data-toggle="tab">
|
||||||
@@ -80,7 +81,7 @@
|
|||||||
<div class="control-group input-content">
|
<div class="control-group input-content">
|
||||||
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}", class: "control-label muted" %>
|
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}", class: "control-label muted" %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.text_field locale, class: 'input-xlarge page_title', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale, :value => (@part.title_translations[locale] rescue nil) %>
|
<%= f.text_field locale, class: 'input-xlarge page_title', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -101,13 +102,13 @@
|
|||||||
<%= f.label :categories, t(:categories), class: "control-label muted" %>
|
<%= f.label :categories, t(:categories), class: "control-label muted" %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= content_tag :label, class: "checkbox" do %>
|
<%= content_tag :label, class: "checkbox" do %>
|
||||||
<%= check_box_tag nil, nil, false, class: "select_all" %> <%= t(:all) %>
|
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="groups" id="page-category">
|
<div class="groups" id="page-category">
|
||||||
<%= content_tag_for(:label, @module_app_categories, class: "checkbox inline") do |category|%>
|
<%= content_tag_for(:label, @module_app_categories, class: "checkbox inline") do |category|%>
|
||||||
<%= check_box_tag("page_part[category][]", category.id, (@part.category.include?(category.id.to_s) rescue false) ) %>
|
<%= check_box_tag("page_part[tag][]", category.id, (@part.category.include?(category.id) rescue false) ) %>
|
||||||
<%= category.title %>
|
<%= category.title %>
|
||||||
<% end if @module_app_categories %>
|
<% end if @module_app_tags %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -119,7 +120,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<div class="groups" id="page-tags">
|
<div class="groups" id="page-tags">
|
||||||
<%= content_tag_for(:label, @module_app_tags, class: "checkbox inline") do |tag|%>
|
<%= content_tag_for(:label, @module_app_tags, class: "checkbox inline") do |tag|%>
|
||||||
<%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id.to_s) rescue false) ) %>
|
<%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id) rescue false) ) %>
|
||||||
<%= tag.name %>
|
<%= tag.name %>
|
||||||
<% end if @module_app_tags %>
|
<% end if @module_app_tags %>
|
||||||
</div>
|
</div>
|
||||||
@@ -160,10 +161,3 @@
|
|||||||
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + "&id=" + "<%= @part.id %>" );
|
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + "&id=" + "<%= @part.id %>" );
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
|
||||||
function toggleChecked(status) {
|
|
||||||
$(".checkbox").each( function() {
|
|
||||||
$(this).attr("checked",status);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
window.location.href="<%= admin_page_url(@part.page, edit: true) %>"
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
<tr id="<%= dom_id role_filter %>" class="<%= role_filter.disable ? 'disable' : '' %>">
|
<tr id="<%= dom_id role_filter %>" class="<% role_filter.disable ? 'disable' : '' %>">
|
||||||
<td><span class="label label-info"><%= role_filter.key %></span></td>
|
<td><span class="label label-info"><%= role_filter.key %></span></td>
|
||||||
<% if @types.is_localized?(:title) %>
|
<% if @types.is_localized?(:title) %>
|
||||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||||
@@ -18,7 +18,15 @@
|
|||||||
<td><%= role_filter.title %></td>
|
<td><%= role_filter.title %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<td class="action dsrgsdgsdg">
|
<td class="action">
|
||||||
<%= check_box_tag 'accept', role_filter.disable ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)")}, :checked=> role_filter.disable} %>
|
<%#= link_to role_filter.disable ? t(:disable) : t(:enable), polymorphic_path([:admin, role_filter]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"btn btn-mini btn-success", :type=>"button" %>
|
||||||
|
|
||||||
|
<div class="toggle-control" style="float: right;">
|
||||||
|
<div class="togglebox <%= role_filter.disable ? 'disabled' : '' %>">
|
||||||
|
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)"), method: :post, remote: true, class: "switch" %>
|
||||||
|
<label><b></b></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<% content_for :side_bar do %>
|
<% content_for :side_bar do %>
|
||||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -10,6 +9,14 @@
|
|||||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
<div id="filter" class="topnav clearfix">
|
||||||
|
<ul class="breadcrumb text-info pull-left">
|
||||||
|
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||||
|
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="bottomnav clearfix">
|
<div class="bottomnav clearfix">
|
||||||
<div class="action pull-right">
|
<div class="action pull-right">
|
||||||
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), eval("new_admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_path(:role_id=>params[:role_id])"), class: "btn btn-primary open-slide" %>
|
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), eval("new_admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_path(:role_id=>params[:role_id])"), class: "btn btn-primary open-slide" %>
|
||||||
@@ -20,4 +27,4 @@
|
|||||||
<%= render 'index' %>
|
<%= render 'index' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% @path = "/admin/#{@app_type == 'role_category' ? 'role_categorys' : @app_type }/" %>
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
// $("#role_filters_index").html("<%= j render 'index' %>")
|
$("#role_filters_index").html("<%= j render 'index' %>")
|
||||||
location.reload();
|
|
||||||
$.pageslide.close();
|
$.pageslide.close();
|
||||||
openSlide();
|
openSlide();
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<% content_for :page_specific_css do -%>
|
<% content_for :page_specific_css do -%>
|
||||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||||
@@ -9,6 +10,13 @@
|
|||||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
<div id="filter" class="topnav clearfix">
|
||||||
|
<ul class="breadcrumb text-info pull-left">
|
||||||
|
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
|
||||||
|
<li class="active"><%= @attribute.title %></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="bottomnav clearfix">
|
<div class="bottomnav clearfix">
|
||||||
<div class="action pull-right">
|
<div class="action pull-right">
|
||||||
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary open-slide"%>
|
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary open-slide"%>
|
||||||
|
|||||||
@@ -132,21 +132,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label muted"><%= I18n.t('site.mobile_version')%></label>
|
|
||||||
<div class="controls">
|
|
||||||
<%= f.check_box :mobile_on , :class=>"toggle-check", :data=> { disabled: true } %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label muted"><%= I18n.t('site.mobile_api_openness_on') %></label>
|
|
||||||
<div class="controls">
|
|
||||||
<%= f.check_box :mobile_api_openness_on , :class=>"toggle-check", :data=> { disabled: true } %>
|
|
||||||
<span class="help-block">Make API available for Mobile Apps</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Language -->
|
<!-- Language -->
|
||||||
@@ -179,7 +164,7 @@
|
|||||||
<label class="control-label muted">Default Language</label>
|
<label class="control-label muted">Default Language</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<% @site_in_use_locales.each do |locale| %>
|
<% @site_in_use_locales.each do |locale| %>
|
||||||
<%= radio_button_tag "site[default_locale]", locale, @locale == locale,:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}", disabled: true } %>
|
<%= radio_button_tag "site[default_locale]", locale, @locale == locale , @site.in_use_locales.include?(locale),:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}", disabled: true } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,12 @@
|
|||||||
|
|
||||||
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
|
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
|
||||||
<div class="attributes-header clearfix">
|
<div class="attributes-header clearfix">
|
||||||
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
|
<div class="toggle-control" style="float: right;">
|
||||||
|
<div class="togglebox <%= role_disable ? 'disabled' : '' %>">
|
||||||
|
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
|
||||||
|
<label><b></b></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<h4><%= role.title %><%= t(:role_info)%></h4>
|
<h4><%= role.title %><%= t(:role_info)%></h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<%=render :partial=>"role",:collection=>Role.where(:disabled=>false).asc("_id")%>
|
<%=render :partial=>"role",:collection=>Role.all.asc("_id")%>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<div id="sidebar-menu">
|
<div id="sidebar-menu">
|
||||||
<div class="scroller">
|
<div class="scroller">
|
||||||
<%= content_tag :ul, :class => "sidebar-nav" do -%>
|
<%= content_tag :ul, :class => "sidebar-nav" do -%>
|
||||||
<%= content_tag :li, :class => active_for_controllers('users_new_interface','roles') do -%>
|
<%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%>
|
||||||
<%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-user'))), admin_users_new_interface_index_path) %>
|
<%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-user'))), admin_users_new_interface_index_path) %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
|
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<%= content_tag :li, link_to((content_tag(:span, t(:add_member))), new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %>
|
<%= content_tag :li, link_to((content_tag(:span, t(:add_member))), new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %>
|
||||||
<%= content_tag :li, link_to((content_tag(:span, t(:member_authorization))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
|
<%= content_tag :li, link_to((content_tag(:span, t(:member_authorization))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
|
||||||
<%= content_tag :li, link_to((content_tag(:span, t(:member_registration))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
|
<%= content_tag :li, link_to((content_tag(:span, t(:member_registration))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
|
||||||
<%= content_tag :li, link_to((content_tag(:span, t(:member_role))),admin_roles_path ), :class => active_for_action('roles', 'index') if (is_admin? rescue nil) %>
|
<%= content_tag :li, link_to((content_tag(:span, t(:member_role))),admin_roles_path ), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
|
||||||
<%= content_tag :li, link_to((content_tag(:span, t(:member_info))), edit_admin_info_path(Info.first.id.to_s)), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) and Info.first %>
|
<%= content_tag :li, link_to((content_tag(:span, t(:member_info))), edit_admin_info_path(Info.first.id.to_s)), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) and Info.first %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,12 +24,12 @@
|
|||||||
<ul class="nav nav-pills filter-nav pull-right">
|
<ul class="nav nav-pills filter-nav pull-right">
|
||||||
<li class="accordion-group">
|
<li class="accordion-group">
|
||||||
<div class="accordion-heading">
|
<div class="accordion-heading">
|
||||||
<a href="#collapse-role" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="filter-group accordion-group">
|
<div class="filter-group accordion-group">
|
||||||
<div class="accordion-body collapse" id="collapse-role">
|
<div class="accordion-body collapse" id="collapse-status">
|
||||||
|
|
||||||
<%= render :partial => "filter"%>
|
<%= render :partial => "filter"%>
|
||||||
|
|
||||||
|
|||||||
@@ -25,12 +25,12 @@
|
|||||||
<ul class="nav nav-pills filter-nav pull-right">
|
<ul class="nav nav-pills filter-nav pull-right">
|
||||||
<li class="accordion-group">
|
<li class="accordion-group">
|
||||||
<div class="accordion-heading">
|
<div class="accordion-heading">
|
||||||
<a href="#collapse-role" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="filter-group accordion-group">
|
<div class="filter-group accordion-group">
|
||||||
<div class="accordion-body collapse" id="collapse-role">
|
<div class="accordion-body collapse" id="collapse-status">
|
||||||
|
|
||||||
<%= render :partial => "filter"%>
|
<%= render :partial => "filter"%>
|
||||||
|
|
||||||
|
|||||||
@@ -25,12 +25,12 @@
|
|||||||
<ul class="nav nav-pills filter-nav pull-right">
|
<ul class="nav nav-pills filter-nav pull-right">
|
||||||
<li class="accordion-group">
|
<li class="accordion-group">
|
||||||
<div class="accordion-heading">
|
<div class="accordion-heading">
|
||||||
<a href="#collapse-role" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="filter-group accordion-group">
|
<div class="filter-group accordion-group">
|
||||||
<div class="accordion-body collapse" id="collapse-role">
|
<div class="accordion-body collapse" id="collapse-status">
|
||||||
|
|
||||||
<%= render :partial => "filter"%>
|
<%= render :partial => "filter"%>
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,22 @@
|
|||||||
<section id="main-wrap">
|
|
||||||
<div class="sign-in have-other-sign-in">
|
|
||||||
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<div class="form">
|
<h1 class="login-logo"><%= t(:ruling_site) %></h1>
|
||||||
<h3 class="login-logo">Reset Your Password</h3>
|
<div id="signin-header">
|
||||||
<div>
|
<h3><%= t(:forgot_password) %></h3>
|
||||||
<input name="utf8" type="hidden" value="" />
|
</div>
|
||||||
<input name="authenticity_token" type="hidden" value="" />
|
<div id="container" class="sign-in">
|
||||||
</div>
|
<%= form_for :user, :url => user_password_path, :html => {:class => 'user_new form-horizontal'} do |f| %>
|
||||||
<!-- <div class="other-sign-in">
|
<%= devise_error_messages! %>
|
||||||
<a class="btn btn-primary" type="submit">Other Sign In</a>
|
<div class="content">
|
||||||
<p>or</p>
|
<div class="main">
|
||||||
</div> -->
|
<div class="control-group clear">
|
||||||
<div class="form-block">
|
<%= f.label :email %>
|
||||||
<div class="form-list clearfix">
|
<%= f.email_field :email, :placeholder => t(:email), :style => "width: 330px;" %>
|
||||||
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
<span class="help-inline">Please correct the error</span>
|
||||||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :class => 'user_new form-horizontal' }) do |f| %>
|
</div>
|
||||||
<%= devise_error_messages! %>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="control-group clear">
|
<div class="form-actions clear">
|
||||||
<label for="user_email">
|
<%= content_tag :button, "Send me reset password instructions", :type => :submit, :class => 'btn btn-primary pull-right' %>
|
||||||
<i class="icons-mail "></i>
|
</div>
|
||||||
</label>
|
<% end %>
|
||||||
<%= f.text_field :email, :placeholder => t(:email), :id=>"user_email" %>
|
</div>
|
||||||
</div>
|
|
||||||
<%= content_tag :button, "Reset Password", :type => :submit, :class => 'btn btn-primary' %>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<!-- Orbit Bar -->
|
||||||
|
<!--#include virtual="include/orbit_bar.html"-->
|
||||||
<section id="main-wrap">
|
<section id="main-wrap">
|
||||||
<div class="sign-in have-other-sign-in">
|
<div class="sign-in have-other-sign-in">
|
||||||
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
|
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
|
||||||
@@ -33,22 +35,25 @@
|
|||||||
</label>
|
</label>
|
||||||
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
|
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||||
<label class="checkbox">
|
</form>
|
||||||
<% if devise_mapping.rememberable? -%>
|
|
||||||
<%= f.check_box :remember_me %> <small><%= f.label :remember_me %></small>
|
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
||||||
<% end -%>
|
<div class="control-group clear">
|
||||||
</label>
|
<label for="user_email">
|
||||||
|
<i class="icon-user"></i>
|
||||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
</label>
|
||||||
|
<input type="text" id="user_id" name="user[id]" placeholder="帳號" />
|
||||||
|
</div>
|
||||||
|
<div class="control-group clear">
|
||||||
|
<label for="user_password">
|
||||||
|
<i class="icons-mail"></i>
|
||||||
|
</label>
|
||||||
|
<input type="text" id="user_email" name="user[email]" placeholder="電子郵件" />
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
|
||||||
<%= link_to content_tag(:small, t(:forgot_password)), new_user_password_path %>
|
|
||||||
</div>
|
|
||||||
<br/>
|
|
||||||
<!-- <div class="register">
|
<!-- <div class="register">
|
||||||
<button class="btn btn-inverse" type="submit">Register</button>
|
<button class="btn btn-inverse" type="submit">Register</button>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<div style='position:relative'>
|
<div style='position:relative'>
|
||||||
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class="orbit-cycle-slideshow" data-cycle-timeout="<%= @ad_banner.timeout_millisecond %>" data-cycle-fx="<%= @ad_banner.ad_fx %>" data-cycle-pager=".banner_nav_<%= @ad_banner.title.dehumanize %>" data-cycle-pager-template="<li class='needed'><a href='#'></a></li>" data-cycle-pager-active-class="activeSlide" data-cycle-random='true' style="z-index: 0">
|
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class="orbit-cycle-slideshow" data-cycle-timeout="<%= @ad_banner.timeout_millisecond %>" data-cycle-fx="<%= @ad_banner.ad_fx %>" data-cycle-pager=".banner_nav_<%= @ad_banner.title.dehumanize %>" data-cycle-pager-template="<li><a href='#'></a></li>" data-cycle-pager-active-class="activeSlide" data-cycle-random='true' style="z-index: 0">
|
||||||
<% @ad_banner.ad_images.can_display.each do |ad_image| %>
|
<% @ad_banner.ad_images.can_display.each do |ad_image| %>
|
||||||
<% link = ad_image_link(ad_image) %>
|
<% link = ad_image_link(ad_image) %>
|
||||||
<%= image_tag ad_image.file, width: @ad_banner.width, height: @ad_banner.height, link_open: ad_image.link_open, link_url: link, style: "display:none; #{'cursor:pointer;' if link.present?}" %>
|
<%= image_tag ad_image.file, width: @ad_banner.width, height: @ad_banner.height, link_open: ad_image.link_open, link_url: link, style: "display:none; #{'cursor:pointer;' if link.present?}" %>
|
||||||
@@ -17,12 +17,6 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
$.preload(a, 2, function(){
|
$.preload(a, 2, function(){
|
||||||
$('.orbit-cycle-slideshow').cycle();
|
$('.orbit-cycle-slideshow').cycle();
|
||||||
var lis = $("ul.banner_nav_<%= @ad_banner.title.dehumanize %> li");
|
|
||||||
if( lis.length > a.length ){
|
|
||||||
for( i = lis.length - 1; i > a.length - 1; i-- ){
|
|
||||||
lis[i].remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
<% if @menu_page %>
|
<% if @menu_page && @menu_page.visible_children.size > 0 %>
|
||||||
<div class='category_list'>
|
<div class='category_list'>
|
||||||
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
|
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
|
||||||
<ul class='list'>
|
<ul class='list'>
|
||||||
|
|
||||||
<% @menu_page.visible_children.each do |child| %>
|
<% @menu_page.visible_children.each do |child| %>
|
||||||
<% if @menu_page.visible_children.nil?%>
|
|
||||||
<p>Test</p>
|
|
||||||
<li class="<%= @page_id.eql?(child.parent.id) ? 'active' : nil %>">
|
|
||||||
<a href="<%= (child.parent.class.to_s.eql?('Page') ? '/' + child.parent.path : child.parent.url) %>"><%= child.parent.title %></a>
|
|
||||||
</li>
|
|
||||||
<% else %>
|
|
||||||
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
|
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
|
||||||
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
|
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Desktop -->
|
<!-- Desktop -->
|
||||||
<% if @site.desktop_closed%>
|
<% if !@site.desktop_closed%>
|
||||||
<li id="orbit-desktop">
|
<li id="orbit-desktop">
|
||||||
<a href="<%= desktop_path %>" role="button">
|
<a href="<%= desktop_path %>" role="button">
|
||||||
<i class="icons-screen"></i> <span class="hide"><%= t(:desktop) %></span>
|
<i class="icons-screen"></i> <span class="hide"><%= t(:desktop) %></span>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<ul class="dropdown-menu" role="menu" aria-labelledby="orbit-user">
|
<ul class="dropdown-menu" role="menu" aria-labelledby="orbit-user">
|
||||||
<li><%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t("users.change_passwd"), admin_users_new_interface_setting_account_path(current_user), tabindex: '-1' %></li>
|
<li><%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t("users.change_passwd"), admin_users_new_interface_setting_account_path(current_user), tabindex: '-1' %></li>
|
||||||
<li><%= link_to content_tag(:i, nil, class: 'icons-vcard') + ' ' + t("users.user_basic_data"), admin_users_new_interface_edit_user_data_path(current_user), tabindex: '-1' %></li>
|
<li><%= link_to content_tag(:i, nil, class: 'icons-vcard') + ' ' + t("users.user_basic_data"), admin_users_new_interface_edit_user_data_path(current_user), tabindex: '-1' %></li>
|
||||||
<% if @site.desktop_closed %>
|
<% if @site.desktop_closed.blank? %>
|
||||||
<li><%= link_to content_tag(:i, nil, class: 'icons-screen') + ' ' + t(:desktop), desktop_path, tabindex: '-1' %></li>
|
<li><%= link_to content_tag(:i, nil, class: 'icons-screen') + ' ' + t(:desktop), desktop_path, tabindex: '-1' %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to content_tag(:i, nil, class: 'icons-logout') + ' ' + t(:logout), destroy_user_session_path, tabindex: '-1' %></li>
|
<li><%= link_to content_tag(:i, nil, class: 'icons-logout') + ' ' + t(:logout), destroy_user_session_path, tabindex: '-1' %></li>
|
||||||
@@ -69,10 +69,10 @@
|
|||||||
<%= f.password_field :password, class: "input-xlarge", placeholder: t(:password) %>
|
<%= f.password_field :password, class: "input-xlarge", placeholder: t(:password) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left" style="width: 150px;">
|
<div class="pull-left" style="width: 150px;">
|
||||||
<label class="checkbox">
|
<!-- <label class="checkbox">
|
||||||
<input type="checkbox" name="user[remember_me]" value="1" checked="checked" />
|
<input type="checkbox" value="">
|
||||||
<small>Remember me</small>
|
<small>Remember me</small>
|
||||||
</label>
|
</label> -->
|
||||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
|
|||||||
@@ -24,16 +24,8 @@
|
|||||||
<div class="wrap-inner">
|
<div class="wrap-inner">
|
||||||
<div id="filter" class="topnav clearfix">
|
<div id="filter" class="topnav clearfix">
|
||||||
<ul class="breadcrumb text-info pull-left">
|
<ul class="breadcrumb text-info pull-left">
|
||||||
<% if !@role.blank? %>
|
|
||||||
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
|
||||||
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
|
|
||||||
<% elsif !@attribute.blank? %>
|
|
||||||
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
|
|
||||||
<li class="active"><%= @attribute.title %></a></li>
|
|
||||||
<% else %>
|
|
||||||
<li><a href="<%= admin_users_new_interface_index_path %>">Member</a> <span class="divider">/</span></li>
|
<li><a href="<%= admin_users_new_interface_index_path %>">Member</a> <span class="divider">/</span></li>
|
||||||
<li class="active">All</li>
|
<li class="active">All</li>
|
||||||
<% end %>
|
|
||||||
</ul>
|
</ul>
|
||||||
<%= yield :right_nav %>
|
<%= yield :right_nav %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -41,6 +41,5 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div id='last_update_date_wrap' style='display:none;'><div id='last_update_date'><%= @last_update_date %></div></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -3,7 +3,9 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>電話:<a href="tel:+886492563489">0492563489</a></li>
|
<li>總機電話:<a href="tel:+886229393091">02-29393091</a></li>
|
||||||
<li>傳真:0492568302</li>
|
<li>傳真:02-29379611</li>
|
||||||
<li>地址:南投縣草屯鎮中正路568號</li>
|
<li>緊急重大事件通聯窗口:校內分機 66119、66110</li>
|
||||||
|
<li>總值日室:<a href="tel:+88229387132">02-29387132</a></li>
|
||||||
|
<li>駐警衛室:<a href="tel:+88229387129">02-29387129</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -5,6 +5,6 @@
|
|||||||
<div id='map_canvas'></div>
|
<div id='map_canvas'></div>
|
||||||
|
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
var $map_center = "23.979724,120.696806"
|
var $map_center = "24.987449, 121.576117"
|
||||||
var $map_zoom = 17
|
var $map_zoom = 17
|
||||||
</script>
|
</script>
|
||||||
@@ -13,21 +13,13 @@
|
|||||||
<div>
|
<div>
|
||||||
<script type="text/javascript" src="/assets/kernel.js"></script>
|
<script type="text/javascript" src="/assets/kernel.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var preview_img;
|
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$("iframe").load(function() {
|
$("iframe").load(function() {
|
||||||
// Get the body element
|
// Get the body element
|
||||||
var frameBody = $("iframe").contents().find('body');
|
var frameBody = $("iframe").contents().find('body');
|
||||||
// Get all links inside the BODY tag
|
// Get all links inside the BODY tag
|
||||||
$("iframe").contents().find('#orbit-bar').hide();
|
$("iframe").contents().find('#orbit-bar').hide();
|
||||||
|
|
||||||
$('.thumbnail').each(function(){
|
|
||||||
if($(this).children('img').length) preview_img = $(this).children('img').attr('src');
|
|
||||||
});
|
|
||||||
|
|
||||||
InsertPreviewImage();
|
|
||||||
|
|
||||||
frameBody.find('a').click(function(e){
|
frameBody.find('a').click(function(e){
|
||||||
//Disable all default actions
|
//Disable all default actions
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -38,14 +30,6 @@
|
|||||||
$("#show_preview").remove();
|
$("#show_preview").remove();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function InsertPreviewImage(){
|
|
||||||
if($("iframe").contents().find('.news_image').length){
|
|
||||||
$("iframe").contents().find('.news_image').append("<a href='' target='_blank'><img src='"+preview_img+"' width='320' height='240' /></a>");
|
|
||||||
}else{
|
|
||||||
setTimeout(InsertPreviewImage,1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
main_public_key: 'lib/main_public_key.pem'
|
main_public_key: 'lib/main_public_key.pem'
|
||||||
# store_ip: 'redmine.rulingcom.com:3001'
|
store_ip: 'redmine.rulingcom.com:3001'
|
||||||
store_ip: 'tp.rulingcom.com:33335'
|
|
||||||
orbit: 'Orbit'
|
orbit: 'Orbit'
|
||||||
ruling_digital: 'RulingDigital'
|
ruling_digital: 'RulingDigital'
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Orbit::Application.configure do
|
|||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
|
|
||||||
# Don't care if the mailer can't send
|
# Don't care if the mailer can't send
|
||||||
config.action_mailer.raise_delivery_errors = true
|
config.action_mailer.raise_delivery_errors = false
|
||||||
|
|
||||||
# Print deprecation notices to the Rails logger
|
# Print deprecation notices to the Rails logger
|
||||||
config.active_support.deprecation = :log
|
config.active_support.deprecation = :log
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
Devise.setup do |config|
|
Devise.setup do |config|
|
||||||
# ==> Mailer Configuration
|
# ==> Mailer Configuration
|
||||||
# Configure the e-mail address which will be shown in DeviseMailer.
|
# Configure the e-mail address which will be shown in DeviseMailer.
|
||||||
config.mailer_sender = "UserMailer"
|
config.mailer_sender = "please-change-me@config-initializers-devise.com"
|
||||||
|
|
||||||
# Configure the class responsible to send e-mails.
|
# Configure the class responsible to send e-mails.
|
||||||
config.mailer = "Devise::Mailer"
|
# config.mailer = "Devise::Mailer"
|
||||||
|
|
||||||
# ==> ORM configuration
|
# ==> ORM configuration
|
||||||
# Load and configure the ORM. Supports :active_record (default) and
|
# Load and configure the ORM. Supports :active_record (default) and
|
||||||
@@ -61,7 +61,7 @@ Devise.setup do |config|
|
|||||||
|
|
||||||
# ==> Configuration for :rememberable
|
# ==> Configuration for :rememberable
|
||||||
# The time the user will be remembered without asking for credentials again.
|
# The time the user will be remembered without asking for credentials again.
|
||||||
config.remember_for = 2.weeks
|
# config.remember_for = 2.weeks
|
||||||
|
|
||||||
# If true, a valid remember token can be re-used between multiple browsers.
|
# If true, a valid remember token can be re-used between multiple browsers.
|
||||||
# config.remember_across_browsers = true
|
# config.remember_across_browsers = true
|
||||||
|
|||||||
@@ -289,7 +289,6 @@ en:
|
|||||||
menu_enabled_for: Menu enabled for
|
menu_enabled_for: Menu enabled for
|
||||||
module: Module
|
module: Module
|
||||||
module_authorization: Module Authorization
|
module_authorization: Module Authorization
|
||||||
monthly_traffic: Monthly Traffic
|
|
||||||
more_plus: more+
|
more_plus: more+
|
||||||
most_visited_page: Most Visited Page
|
most_visited_page: Most Visited Page
|
||||||
multilingual: Multilingual
|
multilingual: Multilingual
|
||||||
@@ -378,7 +377,6 @@ en:
|
|||||||
search_: Search
|
search_: Search
|
||||||
search_google: Search Google
|
search_google: Search Google
|
||||||
setup_member: Member setup
|
setup_member: Member setup
|
||||||
server_usage: Server Usage
|
|
||||||
show: Show
|
show: Show
|
||||||
show_mode:
|
show_mode:
|
||||||
index: Index
|
index: Index
|
||||||
@@ -386,7 +384,6 @@ en:
|
|||||||
thumbnail: Thumbnail
|
thumbnail: Thumbnail
|
||||||
site:
|
site:
|
||||||
backend_openness_on: Backend Openness
|
backend_openness_on: Backend Openness
|
||||||
mobile_api_openness_on: Mobile API Openness
|
|
||||||
default_image: Site default image
|
default_image: Site default image
|
||||||
description: Site description
|
description: Site description
|
||||||
description_help: Description Guide
|
description_help: Description Guide
|
||||||
@@ -400,7 +397,7 @@ en:
|
|||||||
keywords: Site keywords
|
keywords: Site keywords
|
||||||
keywords_help: Keyword Guide
|
keywords_help: Keyword Guide
|
||||||
language: Site language
|
language: Site language
|
||||||
mobile_version: Enable Mobile Web
|
mobile_version: Mobile version
|
||||||
openness: Openness
|
openness: Openness
|
||||||
search: Site Search
|
search: Site Search
|
||||||
search_help: Please Enter the search argument for Google search.
|
search_help: Please Enter the search argument for Google search.
|
||||||
@@ -519,7 +516,6 @@ en:
|
|||||||
vertical: Vertical
|
vertical: Vertical
|
||||||
view: View
|
view: View
|
||||||
view_count: View count
|
view_count: View count
|
||||||
visitors_count: Visits
|
|
||||||
visitors_this_month: This month's visitors
|
visitors_this_month: This month's visitors
|
||||||
visitors_this_week: This week's visitors
|
visitors_this_week: This week's visitors
|
||||||
visitors_this_year: This year's visitors
|
visitors_this_year: This year's visitors
|
||||||
|
|||||||
@@ -290,7 +290,6 @@ zh_tw:
|
|||||||
menu_enabled_for: 選單啟用
|
menu_enabled_for: 選單啟用
|
||||||
module: 模組
|
module: 模組
|
||||||
module_authorization: 模組授權
|
module_authorization: 模組授權
|
||||||
monthly_traffic: 本月流量
|
|
||||||
more_plus: 更多+
|
more_plus: 更多+
|
||||||
most_visited_page: 最多瀏覽頁面
|
most_visited_page: 最多瀏覽頁面
|
||||||
multilingual: 多語系
|
multilingual: 多語系
|
||||||
@@ -379,7 +378,6 @@ zh_tw:
|
|||||||
search_: 搜尋
|
search_: 搜尋
|
||||||
search_google: 搜尋Google
|
search_google: 搜尋Google
|
||||||
setup_member: 會員設定
|
setup_member: 會員設定
|
||||||
server_usage: 主機負載
|
|
||||||
show: 顯示
|
show: 顯示
|
||||||
show_mode:
|
show_mode:
|
||||||
index: 檢索
|
index: 檢索
|
||||||
@@ -389,7 +387,6 @@ zh_tw:
|
|||||||
frontend_closed: 前台關閉?
|
frontend_closed: 前台關閉?
|
||||||
frontend_open: 開啟前台
|
frontend_open: 開啟前台
|
||||||
backend_openness_on: 開啟開放式後台(訪客可遊覽)
|
backend_openness_on: 開啟開放式後台(訪客可遊覽)
|
||||||
mobile_api_openness_on: 開啟手機API
|
|
||||||
enable_personal_desktop: 開啟個人桌面
|
enable_personal_desktop: 開啟個人桌面
|
||||||
default_image: 預設圖像
|
default_image: 預設圖像
|
||||||
description: 網站描述
|
description: 網站描述
|
||||||
@@ -520,7 +517,6 @@ zh_tw:
|
|||||||
vertical: 垂直的
|
vertical: 垂直的
|
||||||
view: 檢視
|
view: 檢視
|
||||||
view_count: 查看次數
|
view_count: 查看次數
|
||||||
visitors_count: 造訪人次
|
|
||||||
visitors_this_month: 本月造訪人次
|
visitors_this_month: 本月造訪人次
|
||||||
visitors_this_week: 本星期造訪人次
|
visitors_this_week: 本星期造訪人次
|
||||||
visitors_this_year: 今年造訪人次
|
visitors_this_year: 今年造訪人次
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ defaults: &defaults
|
|||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: orbit_site_new
|
database: test_site
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: orbit_site_new
|
database: test_site
|
||||||
|
|
||||||
# set these environment variables on your prod server
|
# set these environment variables on your prod server
|
||||||
production:
|
production:
|
||||||
@@ -24,4 +24,4 @@ production:
|
|||||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: orbit_site_new
|
database: test_site
|
||||||
@@ -70,7 +70,7 @@ Orbit::Application.routes.draw do
|
|||||||
get 'get_cpu_usage'
|
get 'get_cpu_usage'
|
||||||
get 'get_mem_usage'
|
get 'get_mem_usage'
|
||||||
get 'get_disk_usage'
|
get 'get_disk_usage'
|
||||||
get 'get_month_traffic'
|
# get 'get_month_traffic'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :designs do
|
resources :designs do
|
||||||
|
|||||||
@@ -3,18 +3,15 @@ production:
|
|||||||
hostname: localhost
|
hostname: localhost
|
||||||
port: 8982
|
port: 8982
|
||||||
log_level: WARNING
|
log_level: WARNING
|
||||||
solr_home: solr
|
|
||||||
|
|
||||||
development:
|
development:
|
||||||
solr:
|
solr:
|
||||||
hostname: localhost
|
hostname: localhost
|
||||||
port: 8982
|
port: 8982
|
||||||
log_level: INFO
|
log_level: INFO
|
||||||
solr_home: solr
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
solr:
|
solr:
|
||||||
hostname: localhost
|
hostname: localhost
|
||||||
port: 8981
|
port: 8981
|
||||||
log_level: WARNING
|
log_level: WARNING
|
||||||
solr_home: solr
|
|
||||||
@@ -12,9 +12,9 @@ module DefaultWidgetTagHelper
|
|||||||
if param.is_a?(Array) and !param.blank?
|
if param.is_a?(Array) and !param.blank?
|
||||||
params_str << param.collect{|t| "#{index}[]=#{t}"}.join("&")
|
params_str << param.collect{|t| "#{index}[]=#{t}"}.join("&")
|
||||||
params.delete index
|
params.delete index
|
||||||
params_str = params_str + "&"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
params_str = params_str + (params_str.eql?("?") ? params.to_param : "&#{params.to_param}" )
|
params_str = params_str + (params_str.eql?("?") ? params.to_param : "&#{params.to_param}" )
|
||||||
content_tag :div,:class=> 'more' do
|
content_tag :div,:class=> 'more' do
|
||||||
link_to I18n.t(@more_link[:label_i18n]),[eval("#{@more_link[:path_method]}"),params_str].join()
|
link_to I18n.t(@more_link[:label_i18n]),[eval("#{@more_link[:path_method]}"),params_str].join()
|
||||||
|
|||||||
@@ -279,8 +279,8 @@ module OrbitCoreLib
|
|||||||
end
|
end
|
||||||
|
|
||||||
def check_user_can_use
|
def check_user_can_use
|
||||||
unless current_or_guest_user.admin? || (@module_app.is_manager?(current_or_guest_user) if @module_app.present?) || (@module_app.is_sub_manager?(current_or_guest_user) if @module_app.present?) || (@module_app.can_approve?(current_or_guest_user) if @module_app.present?)
|
unless current_or_guest_user.admin? || @module_app.is_manager?(current_or_guest_user) || @module_app.is_sub_manager?(current_or_guest_user) || @module_app.can_approve?(current_or_guest_user)
|
||||||
redirect_to admin_dashboards_url
|
redirect_to root_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ module ParserFrontEnd
|
|||||||
args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if !args["tag_id"].blank? and args["tag_id"].is_a? String
|
args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if !args["tag_id"].blank? and args["tag_id"].is_a? String
|
||||||
# tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
|
# tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
|
||||||
# category = params[:category_id].blank? ? page[:category] : params[:category_id]
|
# category = params[:category_id].blank? ? page[:category] : params[:category_id]
|
||||||
|
|
||||||
body = Nokogiri::HTML(page.content)
|
body = Nokogiri::HTML(page.content)
|
||||||
|
|
||||||
if @edit
|
if @edit
|
||||||
body.css('.page_part').each do |page_part|
|
body.css('.page_part').each do |page_part|
|
||||||
part = PagePart.find(page_part['part_id']) rescue nil
|
part = PagePart.find(page_part['part_id']) rescue nil
|
||||||
@@ -40,16 +42,19 @@ module ParserFrontEnd
|
|||||||
end
|
end
|
||||||
|
|
||||||
body.css('orbit_front').each do |front|
|
body.css('orbit_front').each do |front|
|
||||||
|
|
||||||
if front['value']
|
if front['value']
|
||||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div id='#{front['id']}' class='#{front['class']}'>#{eval(front['value']).to_s}</div>")
|
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div id='#{front['id']}' class='#{front['class']}'>#{eval(front['value']).to_s}</div>")
|
||||||
else
|
else
|
||||||
ret = ''
|
ret = ''
|
||||||
part = PagePart.find(front['part_id']) if front['part_id']
|
part = PagePart.find(front['part_id']) if front['part_id']
|
||||||
ret << eval("\"#{front['path']}\"") rescue ''
|
ret << eval("\"#{front['path']}\"") rescue ''
|
||||||
ar = args.to_param
|
args.each do |index,arg|
|
||||||
ar = URI.unescape(ar)
|
if index=="tag_id" || index=="category_id"
|
||||||
ret << (ret.include?("?") ? "&#{ar}" : "?#{ar}") if args.present?
|
ret << (ret.include?("?") ? "&#{index}[]=#{arg}": "?#{index}[]=#{arg}" )
|
||||||
|
else
|
||||||
|
ret << (ret.include?("?") ? "&#{index}=#{arg}": "?#{index}=#{arg}" )
|
||||||
|
end
|
||||||
|
end if args
|
||||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
|
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
|
||||||
end
|
end
|
||||||
front.swap(fragment)
|
front.swap(fragment)
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
namespace :gallery do
|
|
||||||
task :migrate_albums => :environment do
|
|
||||||
@albums = GalleryAlbum.all
|
|
||||||
@albums.each do |album|
|
|
||||||
newalbum = Album.new
|
|
||||||
newalbum.name = album.name
|
|
||||||
newalbum.description = album.description
|
|
||||||
newalbum.cover = album.cover
|
|
||||||
newalbum.cover_path = album.cover_path
|
|
||||||
newalbum.tag_names = album.tag_names
|
|
||||||
newalbum.category_id = album.category_id
|
|
||||||
newalbum.save!
|
|
||||||
@images = album.gallery_images
|
|
||||||
@images.each do |image|
|
|
||||||
img = newalbum.album_images.new
|
|
||||||
img.title = image.title
|
|
||||||
img.description = image.description
|
|
||||||
img.file = image.file
|
|
||||||
img.save!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -122,7 +122,7 @@ namespace :migrate do
|
|||||||
a.widgets = {}
|
a.widgets = {}
|
||||||
a.widgets[:widget1] = []
|
a.widgets[:widget1] = []
|
||||||
a.widget_options_fields_i18n = {"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}}
|
a.widget_options_fields_i18n = {"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}}
|
||||||
a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"Album.all", "value"=>:id, "label"=>:name}}}
|
a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
|
||||||
a.save
|
a.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ def unzip_design(file, zip_name)
|
|||||||
site.design = design
|
site.design = design
|
||||||
site.save
|
site.save
|
||||||
theme = design.themes.first
|
theme = design.themes.first
|
||||||
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => nil, :menu_enabled_for => {"zh_tw"=>"true", "en"=>"true"} )
|
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => theme.id, :menu_enabled_for => [] )
|
||||||
|
|
||||||
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
||||||
home.save
|
home.save
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace :new_ui do
|
|||||||
%w(ask ask_question ask_category),
|
%w(ask ask_question ask_category),
|
||||||
%w(asset asset),
|
%w(asset asset),
|
||||||
%w(faq qa),
|
%w(faq qa),
|
||||||
%w(gallery album gallery_category),
|
%w(gallery gallery_album gallery_category),
|
||||||
%w(location location),
|
%w(location location),
|
||||||
%w(personal_book writing_book),
|
%w(personal_book writing_book),
|
||||||
%w(personal_conference writing_conference),
|
%w(personal_conference writing_conference),
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace :site do
|
|||||||
site.design = design
|
site.design = design
|
||||||
site.save
|
site.save
|
||||||
theme = design.themes.first
|
theme = design.themes.first
|
||||||
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => nil, :menu_enabled_for => {"zh_tw"=>"true", "en"=>"true"} )
|
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => theme.id, :menu_enabled_for => [] )
|
||||||
|
|
||||||
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
||||||
home.save
|
home.save
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
/**
|
|
||||||
* JustGage - a handy JavaScript plugin for generating and animating nice & clean dashboard gauges.
|
|
||||||
* Copyright (c) 2012 Bojan Djuricic - pindjur(at)gmail(dot)com | http://www.madcog.com
|
|
||||||
* Licensed under MIT.
|
|
||||||
* Date: 31/07/2012
|
|
||||||
* @author Bojan Djuricic (@Toorshia)
|
|
||||||
* @version 1.0
|
|
||||||
*
|
|
||||||
* http://www.justgage.com
|
|
||||||
*/
|
|
||||||
|
|
||||||
JustGage=function(x){if(!x.id){alert("Missing id parameter for gauge!");return false}if(!document.getElementById(x.id)){alert('No element with id: "'+x.id+'" found!');return false}this.config={id:x.id,title:(x.title)?x.title:"Title",titleFontColor:(x.titleFontColor)?x.titleFontColor:"#999999",value:(x.value)?x.value:0,valueFontColor:(x.valueFontColor)?x.valueFontColor:"#010101",min:(x.min)?x.min:0,max:(x.max)?x.max:100,showMinMax:(x.showMinMax!=null)?x.showMinMax:true,gaugeWidthScale:(x.gaugeWidthScale)?x.gaugeWidthScale:1,gaugeColor:(x.gaugeColor)?x.gaugeColor:"#edebeb",label:(x.label)?x.label:"",showInnerShadow:(x.showInnerShadow!=null)?x.showInnerShadow:true,shadowOpacity:(x.shadowOpacity)?x.shadowOpacity:0.2,shadowSize:(x.shadowSize)?x.shadowSize:5,shadowVerticalOffset:(x.shadowVerticalOffset)?x.shadowVerticalOffset:3,levelColors:(x.levelColors)?x.levelColors:percentColors,levelColorsGradient:(x.levelColorsGradient!=null)?x.levelColorsGradient:true,labelFontColor:(x.labelFontColor)?x.labelFontColor:"#b3b3b3",startAnimationTime:(x.startAnimationTime)?x.startAnimationTime:700,startAnimationType:(x.startAnimationType)?x.startAnimationType:">",refreshAnimationTime:(x.refreshAnimationTime)?x.refreshAnimationTime:700,refreshAnimationType:(x.refreshAnimationType)?x.refreshAnimationType:">"};if(x.value>this.config.max){this.config.value=this.config.max}if(x.value<this.config.min){this.config.value=this.config.min}this.originalValue=x.value;this.canvas=Raphael(this.config.id,"100%","100%");var d=getStyle(document.getElementById(this.config.id),"width").slice(0,-2)*1;var q=getStyle(document.getElementById(this.config.id),"height").slice(0,-2)*1;var c,l;if((d/q)>1.25){c=1.25*q;l=q}else{c=d;l=d/1.25}var i=(d-c)/2;var g=(q-l)/2;var s=((l/8)>10)?(l/10):10;var n=i+c/2;var m=g+l/6.5;var k=((l/6.4)>16)?(l/6.4):16;var r=i+c/2;var p=g+l/1.4;var b=((l/16)>10)?(l/16):10;var f=i+c/2;var e=p+k/2+6;var j=((l/16)>10)?(l/16):10;var w=i+(c/10)+(c/6.666666666666667*this.config.gaugeWidthScale)/2;var v=g+l/1.126760563380282;var h=((l/16)>10)?(l/16):10;var u=i+c-(c/10)-(c/6.666666666666667*this.config.gaugeWidthScale)/2;var t=g+l/1.126760563380282;this.params={canvasW:d,canvasH:q,widgetW:c,widgetH:l,dx:i,dy:g,titleFontSize:s,titleX:n,titleY:m,valueFontSize:k,valueX:r,valueY:p,labelFontSize:b,labelX:f,labelY:e,minFontSize:j,minX:w,minY:v,maxFontSize:h,maxX:u,maxY:t};this.canvas.customAttributes.pki=function(K,L,N,E,O,F,D,y){var B=(1-(K-L)/(N-L))*Math.PI,G=E/2-E/10,J=G-E/6.666666666666667*y,C=E/2+F,A=O/1.25+D,H=E/2+F+G*Math.cos(B),P=O-(O-A)+D-G*Math.sin(B),M=E/2+F+J*Math.cos(B),z=O-(O-A)+D-J*Math.sin(B),I;I+="M"+(C-J)+","+A+" ";I+="L"+(C-G)+","+A+" ";I+="A"+G+","+G+" 0 0,1 "+H+","+P+" ";I+="L"+M+","+z+" ";I+="A"+J+","+J+" 0 0,0 "+(C-J)+","+A+" ";I+="z ";return{path:I}};this.gauge=this.canvas.path().attr({stroke:"none",fill:this.config.gaugeColor,pki:[this.config.max,this.config.min,this.config.max,this.params.widgetW,this.params.widgetH,this.params.dx,this.params.dy,this.config.gaugeWidthScale]});this.gauge.id=this.config.id+"-gauge";this.level=this.canvas.path().attr({stroke:"none",fill:getColorForPercentage((this.config.value-this.config.min)/(this.config.max-this.config.min),this.config.levelColors,this.config.levelColorsGradient),pki:[this.config.min,this.config.min,this.config.max,this.params.widgetW,this.params.widgetH,this.params.dx,this.params.dy,this.config.gaugeWidthScale]});this.level.id=this.config.id+"-level";this.txtTitle=this.canvas.text(this.params.titleX,this.params.titleY,this.config.title);this.txtTitle.attr({"font-size":this.params.titleFontSize,"font-weight":"bold","font-family":"Arial",fill:this.config.titleFontColor,"fill-opacity":"1"});this.txtTitle.id=this.config.id+"-txttitle";this.txtValue=this.canvas.text(this.params.valueX,this.params.valueY,this.originalValue);this.txtValue.attr({"font-size":this.params.valueFontSize,"font-weight":"bold","font-family":"Arial",fill:this.config.valueFontColor,"fill-opacity":"0"});this.txtValue.id=this.config.id+"-txtvalue";this.txtLabel=this.canvas.text(this.params.labelX,this.params.labelY,this.config.label);this.txtLabel.attr({"font-size":this.params.labelFontSize,"font-weight":"normal","font-family":"Arial",fill:this.config.labelFontColor,"fill-opacity":"0"});this.txtLabel.id=this.config.id+"-txtlabel";this.txtMin=this.canvas.text(this.params.minX,this.params.minY,this.config.min);this.txtMin.attr({"font-size":this.params.minFontSize,"font-weight":"normal","font-family":"Arial",fill:this.config.labelFontColor,"fill-opacity":(this.config.showMinMax==true)?"1":"0"});this.txtMin.id=this.config.id+"-txtmin";this.txtMax=this.canvas.text(this.params.maxX,this.params.maxY,this.config.max);this.txtMax.attr({"font-size":this.params.maxFontSize,"font-weight":"normal","font-family":"Arial",fill:this.config.labelFontColor,"fill-opacity":(this.config.showMinMax==true)?"1":"0"});this.txtMax.id=this.config.id+"-txtmax";var a=this.canvas.canvas.childNodes[1];var o="http://www.w3.org/20
Line truncated
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
// +--------------------------------------------------------------------+ \\
|
|
||||||
// ¦ Raphaël 2.1.0 - JavaScript Vector Library ¦ \\
|
|
||||||
// +--------------------------------------------------------------------¦ \\
|
|
||||||
// ¦ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) ¦ \\
|
|
||||||
// ¦ Copyright © 2008-2012 Sencha Labs (http://sencha.com) ¦ \\
|
|
||||||
// +--------------------------------------------------------------------¦ \\
|
|
||||||
// ¦ Licensed under the MIT (http://raphaeljs.com/license.html) license.¦ \\
|
|
||||||
// +--------------------------------------------------------------------+ \\
|
|
||||||
|
|
||||||
(function(a){var b="0.3.4",c="hasOwnProperty",d=/[\.\/]/,e="*",f=function(){},g=function(a,b){return a-b},h,i,j={n:{}},k=function(a,b){var c=j,d=i,e=Array.prototype.slice.call(arguments,2),f=k.listeners(a),l=0,m=!1,n,o=[],p={},q=[],r=h,s=[];h=a,i=0;for(var t=0,u=f.length;t<u;t++)"zIndex"in f[t]&&(o.push(f[t].zIndex),f[t].zIndex<0&&(p[f[t].zIndex]=f[t]));o.sort(g);while(o[l]<0){n=p[o[l++]],q.push(n.apply(b,e));if(i){i=d;return q}}for(t=0;t<u;t++){n=f[t];if("zIndex"in n)if(n.zIndex==o[l]){q.push(n.apply(b,e));if(i)break;do{l++,n=p[o[l]],n&&q.push(n.apply(b,e));if(i)break}while(n)}else p[n.zIndex]=n;else{q.push(n.apply(b,e));if(i)break}}i=d,h=r;return q.length?q:null};k.listeners=function(a){var b=a.split(d),c=j,f,g,h,i,k,l,m,n,o=[c],p=[];for(i=0,k=b.length;i<k;i++){n=[];for(l=0,m=o.length;l<m;l++){c=o[l].n,g=[c[b[i]],c[e]],h=2;while(h--)f=g[h],f&&(n.push(f),p=p.concat(f.f||[]))}o=n}return p},k.on=function(a,b){var c=a.split(d),e=j;for(var g=0,h=c.length;g<h;g++)e=e.n,!e[c[g]]&&(e[c[g]]={n:{}}),e=e[c[g]];e.f=e.f||[];for(g=0,h=e.f.length;g<h;g++)if(e.f[g]==b)return f;e.f.push(b);return function(a){+a==+a&&(b.zIndex=+a)}},k.stop=function(){i=1},k.nt=function(a){if(a)return(new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)")).test(h);return h},k.off=k.unbind=function(a,b){var f=a.split(d),g,h,i,k,l,m,n,o=[j];for(k=0,l=f.length;k<l;k++)for(m=0;m<o.length;m+=i.length-2){i=[m,1],g=o[m].n;if(f[k]!=e)g[f[k]]&&i.push(g[f[k]]);else for(h in g)g[c](h)&&i.push(g[h]);o.splice.apply(o,i)}for(k=0,l=o.length;k<l;k++){g=o[k];while(g.n){if(b){if(g.f){for(m=0,n=g.f.length;m<n;m++)if(g.f[m]==b){g.f.splice(m,1);break}!g.f.length&&delete g.f}for(h in g.n)if(g.n[c](h)&&g.n[h].f){var p=g.n[h].f;for(m=0,n=p.length;m<n;m++)if(p[m]==b){p.splice(m,1);break}!p.length&&delete g.n[h].f}}else{delete g.f;for(h in g.n)g.n[c](h)&&g.n[h].f&&delete g.n[h].f}g=g.n}}},k.once=function(a,b){var c=function(){var d=b.apply(this,arguments);k.unbind(a,c);return d};return k.on(a,c)},k.version=b,k.toString=function(){return"You are running Eve "+b},typeof module!="undefined"&&module.exports?module.exports=k:typeof define!="undefined"?define("eve",[],function(){return k}):a.eve=k})(this),function(){function cF(a){for(var b=0;b<cy.length;b++)cy[b].el.paper==a&&cy.splice(b--,1)}function cE(b,d,e,f,h,i){e=Q(e);var j,k,l,m=[],o,p,q,t=b.ms,u={},v={},w={};if(f)for(y=0,z=cy.length;y<z;y++){var x=cy[y];if(x.el.id==d.id&&x.anim==b){x.percent!=e?(cy.splice(y,1),l=1):k=x,d.attr(x.totalOrigin);break}}else f=+v;for(var y=0,z=b.percents.length;y<z;y++){if(b.percents[y]==e||b.percents[y]>f*b.top){e=b.percents[y],p=b.percents[y-1]||0,t=t/b.top*(e-p),o=b.percents[y+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[y]])}if(!!j){if(!k){for(var A in j)if(j[g](A))if(U[g](A)||d.paper.customAttributes[g](A)){u[A]=d.attr(A),u[A]==null&&(u[A]=T[A]),v[A]=j[A];switch(U[A]){case C:w[A]=(v[A]-u[A])/t;break;case"colour":u[A]=a.getRGB(u[A]);var B=a.getRGB(v[A]);w[A]={r:(B.r-u[A].r)/t,g:(B.g-u[A].g)/t,b:(B.b-u[A].b)/t};break;case"path":var D=bR(u[A],v[A]),E=D[1];u[A]=D[0],w[A]=[];for(y=0,z=u[A].length;y<z;y++){w[A][y]=[0];for(var F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(E[y][F]-u[A][y][F])/t}break;case"transform":var H=d._,I=ca(H[A],v[A]);if(I){u[A]=I.from,v[A]=I.to,w[A]=[],w[A].real=!0;for(y=0,z=u[A].length;y<z;y++){w[A][y]=[u[A][y][0]];for(F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(v[A][y][F]-u[A][y][F])/t}}else{var J=d.matrix||new cb,K={_:{transform:H.transform},getBBox:function(){return d.getBBox(1)}};u[A]=[J.a,J.b,J.c,J.d,J.e,J.f],b$(K,v[A]),v[A]=K._.transform,w[A]=[(K.matrix.a-J.a)/t,(K.matrix.b-J.b)/t,(K.matrix.c-J.c)/t,(K.matrix.d-J.d)/t,(K.matrix.e-J.e)/t,(K.matrix.f-J.f)/t]}break;case"csv":var L=r(j[A])[s](c),M=r(u[A])[s](c);if(A=="clip-rect"){u[A]=M,w[A]=[],y=M.length;while(y--)w[A][y]=(L[y]-u[A][y])/t}v[A]=L;break;default:L=[][n](j[A]),M=[][n](u[A]),w[A]=[],y=d.paper.customAttributes[A].length;while(y--)w[A][y]=((L[y]||0)-(M[y]||0))/t}}var O=j.easing,P=a.easing_formulas[O];if(!P){P=r(O).match(N);if(P&&P.length==5){var R=P;P=function(a){return cC(a,+R[1],+R[2],+R[3],+R[4],t)}}else P=bf}q=j.start||b.start||+(new Date),x={anim:b,percent:e,timestamp:q,start:q+(b.del||0),status:0,initstatus:f||0,stop:!1,ms:t,easing:P,from:u,diff:w,to:v,el:d,callback:j.callback,prev:p,next:o,repeat:i||b.times,origin:d.attr(),totalOrigin:h},cy.push(x);if(f&&!k&&!l){x.stop=!0,x.start=new Date-t*f;if(cy.length==1)return cA()}l&&(x.start=new Date-x.ms*f),cy.length==1&&cz(cA)}else k.initstatus=f,k.start=new Date-k.ms*f;eve("raphael.anim.start."+d.id,d,b)}}function cD(a,b){var c=[],d={};this.ms=b,this.times=1;if(a){for(var e in a)a[g](e)&&(d[Q(e)]=a[e],c.push(Q(e)));c.sort(bd)}this.anim=d,this.top=c[c.length-1],this.percents=c}function cC(a,b,c,d,e,f){function o(a,b){var c,d,e,f,j,k;for(e=a,k=0;k<8;k++){f=m(e)-a;if(z(f)<b)return e;j=(3*i*e+2*h)*e+g;if(z(j)<1e-6)break;e=e-f/j}c=0,d=1,e=a;if(e<c)return c;if(e>d)return d;while(c<d){f=m(e);if(z(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(Line truncated
|
|
||||||
@@ -9,30 +9,19 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def search_result
|
def search_result
|
||||||
if params[:search_query] == ""
|
|
||||||
@bulletins = get_bulletins_for_index
|
|
||||||
|
|
||||||
else
|
|
||||||
@search = Bulletin.solr_search do
|
@search = Bulletin.solr_search do
|
||||||
fulltext params[:search_query]
|
fulltext params[:search_query]
|
||||||
with(:frontend_search,true)
|
with(:frontend_search,true)
|
||||||
with(:available_lang).any_of([I18n.locale.to_s])
|
with(:available_lang).any_of([I18n.locale.to_s])
|
||||||
end
|
end
|
||||||
# @bulletins = Bulletin.where(:category_id.in => params[:category_id]).and(:is_rejected=>false).and(:is_pending=>false)
|
|
||||||
search_result = @search.results.collect{|result| result.id}
|
search_result = @search.results.collect{|result| result.id}
|
||||||
|
|
||||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@bulletins = get_bulletins_for_index
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
end
|
|
||||||
|
|
||||||
def get_bulletins_for_index
|
|
||||||
|
|
||||||
@item = Page.find(params[:page_id]) rescue nil
|
|
||||||
|
|
||||||
if @item
|
if @item
|
||||||
if @item.frontend_data_count
|
if @item.frontend_data_count
|
||||||
@page_num = @item.frontend_data_count
|
@page_num = @item.frontend_data_count
|
||||||
@@ -41,23 +30,33 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
|||||||
end
|
end
|
||||||
@frontend_style = @item.frontend_style
|
@frontend_style = @item.frontend_style
|
||||||
end
|
end
|
||||||
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
|
if !params[:search_query].blank?
|
||||||
|
@search = Bulletin.solr_search do
|
||||||
|
fulltext params[:search_query]
|
||||||
|
with(:frontend_search,true)
|
||||||
|
with(:available_lang).any_of([I18n.locale.to_s])
|
||||||
|
end
|
||||||
|
search_result = @search.results.collect{|result| result.id}
|
||||||
|
|
||||||
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
||||||
|
else
|
||||||
date_now = Time.now
|
date_now = Time.now
|
||||||
if !params[:category_id].blank? && !params[:tag_id].blank?
|
if !params[:category_id].blank? && !params[:tag_id].blank?
|
||||||
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id => params[:category_id], :tagged_ids => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||||
# @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in=>params[:category_id],:tagged_ids.in=>params[:tag_id])
|
|
||||||
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
|
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
|
||||||
elsif !params[:category_id].blank?
|
elsif !params[:category_id].blank?
|
||||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||||
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
|
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
|
||||||
elsif !params[:tag_id].blank?
|
elsif !params[:tag_id].blank?
|
||||||
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||||
else
|
else
|
||||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||||
end
|
end
|
||||||
# delayed_impressionist(@tag) if @tag
|
# delayed_impressionist(@tag) if @tag
|
||||||
@bulletins
|
end
|
||||||
end
|
|
||||||
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@item = Page.find(params[:page_id]) rescue nil
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
|||||||
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num)
|
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num)
|
||||||
end
|
end
|
||||||
|
|
||||||
@categories = @module_app.categories.enabled
|
@categories = get_categories_for_index
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
|||||||
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(@page_num )
|
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(@page_num )
|
||||||
end
|
end
|
||||||
|
|
||||||
@categories = @module_app.categories.enabled
|
@categories = get_categories_for_index
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
|||||||
|
|
||||||
def bulletins_side_bar
|
def bulletins_side_bar
|
||||||
@tags_and_class = @module_app.sorted_tags_for_cloud
|
@tags_and_class = @module_app.sorted_tags_for_cloud
|
||||||
@categories = @module_app.categories.enabled
|
@categories = get_categories_for_index
|
||||||
end
|
end
|
||||||
|
|
||||||
def bulletins_search_block
|
def bulletins_search_block
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<% # encoding: utf-8 %>
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
<%= flash_messages %>
|
<%= flash_messages %>
|
||||||
|
|
||||||
<h1 class="h1"><%= @page.title rescue nil %></h1>
|
<h1 class="h1"><%= @page.title rescue nil %></h1>
|
||||||
|
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<% # encoding: utf-8 %>
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
<%= flash_messages %>
|
<%= flash_messages %>
|
||||||
|
|
||||||
<h1 class="h1"><%= @page.title rescue nil %></h1>
|
<h1 class="h1"><%= @page.title rescue nil %></h1>
|
||||||
|
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
<% @bulletins.each do |post| %>
|
<% @bulletins.each do |post| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= post.bulletin_category.title rescue nil %></td>
|
<td><%= post.bulletin_category.title rescue nil %></td>
|
||||||
<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.category_id) %>
|
<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
||||||
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= display_date_time(post.postdate) %></td>
|
<td><%= display_date_time(post.postdate) %></td>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<% if !@category_id.blank? %>
|
<% if !@category_id.blank? %>
|
||||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<% if !@category_id.blank? %>
|
<% if !@category_id.blank? %>
|
||||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -149,6 +149,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<% if !@category_id.blank? %>
|
<% if !@category_id.blank? %>
|
||||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -197,7 +198,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<% if !@category_id.blank? %>
|
<% if !@category_id.blank? %>
|
||||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -244,6 +246,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<% if !@category_id.blank? %>
|
<% if !@category_id.blank? %>
|
||||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%= stylesheet_link_tag "default_widget" %>
|
<%= stylesheet_link_tag "default_widget" %>
|
||||||
<script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.js'></script>
|
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
|
||||||
<!-- <script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.degsin.js'></script> -->
|
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
|
||||||
|
|
||||||
<div id="bulletin_widget">
|
<div id="bulletin_widget">
|
||||||
<%= render 'index' %>
|
<%= render 'index' %>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ module Announcement
|
|||||||
image :image
|
image :image
|
||||||
field :postdate
|
field :postdate
|
||||||
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
|
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
|
||||||
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:category,:id]}}
|
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:bulletin_category,:id]}}
|
||||||
field :subtitle
|
field :subtitle
|
||||||
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ class ArchiveFile
|
|||||||
field :title, localize: true
|
field :title, localize: true
|
||||||
field :create_user_id
|
field :create_user_id
|
||||||
field :update_user_id, :class_name => "User"
|
field :update_user_id, :class_name => "User"
|
||||||
|
|
||||||
scope :can_display,where(is_hidden: false)
|
|
||||||
|
|
||||||
# belongs_to :archive_file_category
|
# belongs_to :archive_file_category
|
||||||
|
|
||||||
|
|||||||
@@ -4,22 +4,78 @@ class Panel::CalendarNew::BackEnd::EventCategoriesController < OrbitBackendContr
|
|||||||
# GET /events
|
# GET /events
|
||||||
# GET /events.json
|
# GET /events.json
|
||||||
def index
|
def index
|
||||||
@module_app_id = @module_app.id rescue nil
|
@event_categories = EventCategory.all
|
||||||
|
|
||||||
@categories = get_categories_for_index
|
|
||||||
@categories = @categories.page(params[:page]).per(10)
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
format.json { render json: @categories }
|
format.json { render json: @event_categories }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def list
|
# GET /events/1
|
||||||
@module_app_id = @module_app.id rescue nil
|
# GET /events/1.json
|
||||||
|
def show
|
||||||
|
@event_category = EventCategory.find(params[:id])
|
||||||
|
|
||||||
@categories = get_categories_for_index
|
respond_to do |format|
|
||||||
@categories = @categories.page(params[:page]).per(10)
|
format.html # show.html.erb
|
||||||
render :layout => false
|
format.json { render json: @event_category }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /events/new
|
||||||
|
# GET /events/new.json
|
||||||
|
def new
|
||||||
|
@event_category = EventCategory.new
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # new.html.erb
|
||||||
|
format.json { render json: @event_category }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /events/1/edit
|
||||||
|
def edit
|
||||||
|
@event_category = EventCategory.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@event_category = EventCategory.new(params[:event_category])
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
if @event_category.save
|
||||||
|
format.html { redirect_to panel_calendar_new_back_end_event_categories_path, notice: 'Category was successfully created.' }
|
||||||
|
format.json { render json: @event_category, status: :created, location: @event_category }
|
||||||
|
else
|
||||||
|
format.html { render action: "new" }
|
||||||
|
format.json { render json: @event_category.errors, status: :unprocessable_entity }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@event_category = EventCategory.find(params[:id])
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
if @event_category.update_attributes(params[:event_category])
|
||||||
|
format.html { redirect_to panel_calendar_new_back_end_event_categories_path, notice: 'Category was successfully updated.' }
|
||||||
|
format.json { head :no_content }
|
||||||
|
#format.js
|
||||||
|
else
|
||||||
|
format.html { render action: "edit" }
|
||||||
|
format.json { render json: @event_category.errors, status: :unprocessable_entity }
|
||||||
|
#format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@event_category = EventCategory.find(params[:id])
|
||||||
|
@event_category.destroy
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html { redirect_to panel_calendar_new_back_end_event_categories_path }
|
||||||
|
format.json { head :no_content }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||