Compare commits
37
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42075d2552 | ||
|
|
50b12c6546 | ||
|
|
f91c08ce4b | ||
|
|
528f7d28b9 | ||
|
|
5f3f27fe9a | ||
|
|
c575dbd33a | ||
|
|
405c2c5a12 | ||
|
|
5e0696890a | ||
|
|
afff07ec89 | ||
|
|
82ce516d7a | ||
|
|
989002a5ae | ||
|
|
72a37afddb | ||
|
|
ed569601c3 | ||
|
|
9e432a5a93 | ||
|
|
2f61f55be2 | ||
|
|
0db28d9ab4 | ||
|
|
4f3f074573 | ||
|
|
c51dd81d2b | ||
|
|
d17953ab86 | ||
|
|
4353b481c7 | ||
|
|
4e706fab0c | ||
|
|
8c532e7241 | ||
|
|
49217d4705 | ||
|
|
591a3e0bc4 | ||
|
|
3744e1c3e7 | ||
|
|
5df8ff2e52 | ||
|
|
f191029279 | ||
|
|
c158108576 | ||
|
|
9760100b69 | ||
|
|
ff6eb5d674 | ||
|
|
2d0fd1d2e4 | ||
|
|
ef67941ba5 | ||
|
|
18d0657321 | ||
|
|
3c4f22234b | ||
|
|
bae1c0da7d | ||
|
|
7401a6ae59 | ||
|
|
9d7af2ccac |
No files matched your search
@@ -38,9 +38,11 @@ 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')) {
|
if($(this).attr('type') == "hidden" && $(this).attr('value') == 'true') {
|
||||||
$(this).wrap('<div class="togglebox disabled" />');
|
console.log('true')
|
||||||
|
$(this).wrap('<div class="togglebox disable" />');
|
||||||
} else {
|
} else {
|
||||||
|
console.log('false')
|
||||||
$(this).wrap('<div class="togglebox" />');
|
$(this).wrap('<div class="togglebox" />');
|
||||||
}
|
}
|
||||||
$('<label><b></b></label>').insertAfter($(this));
|
$('<label><b></b></label>').insertAfter($(this));
|
||||||
@@ -541,6 +543,9 @@ function changeStatusHidden() {
|
|||||||
|
|
||||||
// Document Ready
|
// Document Ready
|
||||||
$(function() {
|
$(function() {
|
||||||
|
console.log('true')
|
||||||
|
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'));
|
||||||
@@ -589,4 +594,35 @@ $(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;
|
||||||
|
}
|
||||||
@@ -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) : linkSetting(element.data('id'), _edit);
|
_type == 'page' ? pageSetting(element.data('id'), _edit, pageslide) : linkSetting(element.data('id'), _edit, pageslide);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$iFrame.pageslide({
|
$iFrame.pageslide({
|
||||||
@@ -130,12 +130,13 @@ function iFrameContent() {
|
|||||||
}).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');
|
||||||
$(this).get(0).contentWindow.externalFunction(iFrameFunction, $iContents, $pc);
|
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');
|
||||||
@@ -183,23 +184,29 @@ function pageSetting(id, edit) {
|
|||||||
|
|
||||||
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[1]);
|
var _arr = $.inArray($(this)[1], _selectData.module.category);
|
||||||
$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(!_selectData.module.category[0] && _arr !== -1) {
|
if(_arr !== -1) {
|
||||||
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||||
}
|
}
|
||||||
_selectData.module.category[0] ? $pageCategory.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
var $all = $pageCategory.siblings('.checkbox').children('.select_all'),
|
||||||
|
$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[1]);
|
var _arr = $.inArray($(this)[1], _selectData.module.tags);
|
||||||
$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(!_selectData.module.tags[0] && _arr !== -1) {
|
if(_arr !== -1) {
|
||||||
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||||
}
|
}
|
||||||
_selectData.module.tags[0] ? $pageTags.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
var $all = $pageTags.siblings('.checkbox').children('.select_all'),
|
||||||
|
$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();
|
||||||
}
|
}
|
||||||
@@ -237,8 +244,8 @@ function pageSetting(id, edit) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
function linkSetting(id, edit) {
|
function linkSetting(id, edit, ps) {
|
||||||
$linkPublishedTrue = $('#link_is_published_true');
|
$linkPublishedTrue = ps.find('#link_is_published_true');
|
||||||
_status = edit;
|
_status = edit;
|
||||||
if(_status) {
|
if(_status) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -250,6 +257,7 @@ function linkSetting(id, edit) {
|
|||||||
})
|
})
|
||||||
.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) {
|
||||||
@@ -393,36 +401,44 @@ $(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[1]) : '';
|
var _arr = _select ? $.inArray($(this)[1], _select.category) : '';
|
||||||
$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(_select && !_select.category[0] && _arr !== -1) {
|
if(_boolean && _arr !== -1) {
|
||||||
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||||
}
|
}
|
||||||
_select && _val == _select.main && _select.category[0] ? $pageCategory.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
var $all = $pageCategory.siblings('.checkbox').children('.select_all');
|
||||||
|
_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.show();
|
$pageCategoryGroup.slideDown(300);
|
||||||
} else {
|
} else {
|
||||||
$pageCategoryGroup.hide();
|
$pageCategoryGroup.slideUp(300);
|
||||||
|
$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[1]) : '';
|
var _arr = _select ? $.inArray($(this)[1], _select.tags) : '';
|
||||||
$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(_select && !_select.tags[0] && _arr !== -1) {
|
if(_boolean && _arr !== -1) {
|
||||||
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||||
}
|
}
|
||||||
_select && _val == _select.main && _select.tags[0] ? $pageTags.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
var $all = $pageTags.siblings('.checkbox').children('.select_all');
|
||||||
|
_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.show();
|
$pageTagsGroup.slideDown(300);
|
||||||
} else {
|
} else {
|
||||||
$pageTagsGroup.hide();
|
$pageTagsGroup.slideUp(300);
|
||||||
|
$hiddenInputB.removeAttr('name');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -450,12 +466,18 @@ $(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') && $checked.prop('checked')) {
|
if($checked.hasClass('select_all')) {
|
||||||
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
|
if($checked.prop('checked')) {
|
||||||
} else if($checked.prop('checked') && !$checked.hasClass('lang-enable')) {
|
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', true);
|
||||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
|
$checked.closest('.checkbox').siblings('input[type="hidden"]').removeAttr('name');
|
||||||
} 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) {
|
||||||
@@ -469,6 +491,15 @@ $(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')) {
|
||||||
|
|||||||
@@ -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('disabled')) {
|
if($(this).hasClass('disable')) {
|
||||||
$(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('disabled');
|
$(this).toggleClass('disable');
|
||||||
};
|
};
|
||||||
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('disabled')) {
|
if($(this).hasClass('disable')) {
|
||||||
$(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('disabled');
|
$(this).toggleClass('disable');
|
||||||
};
|
};
|
||||||
if($(this).hasClass('delete')) {
|
if($(this).hasClass('delete')) {
|
||||||
$(this).closest('.attributes').fadeOut(300, function() {
|
$(this).closest('.attributes').fadeOut(300, function() {
|
||||||
|
|||||||
@@ -1,93 +1,66 @@
|
|||||||
//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(e){
|
$(".post_preview").click(function(){
|
||||||
// $("#main-wrap").after("<span id='show_preview'></span>");
|
|
||||||
// e.preventDefault();
|
|
||||||
// var form = $(this).parents("form").first()
|
|
||||||
// //var cont = form["content"].value;
|
|
||||||
// // $.ajax({
|
|
||||||
// // type: 'POST',
|
|
||||||
// // url: $(this).attr("href")+'?preview=true',
|
|
||||||
// // data: form.serialize(),
|
|
||||||
// // dataType: "script",
|
|
||||||
// // success: function (msg) {
|
|
||||||
// // $("#"+start_modal_with_id).modal('show'); },
|
|
||||||
// // error: function(){
|
|
||||||
// // alert("ERROR");
|
|
||||||
// // }
|
|
||||||
// // });
|
|
||||||
// url = "/panel/news/back_end/news_bulletins/preview?preview=true"
|
|
||||||
// // alert(url)
|
|
||||||
// form.attr("action",url);
|
|
||||||
// form.submit();
|
|
||||||
// //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>");
|
$("#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;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$.post($(this).attr('url'), $(".previewable").serialize() ,function(data){
|
||||||
|
$('#show_preview .modal').modal();
|
||||||
|
$('#show_preview .modal').height(function() {
|
||||||
|
return $(window).height() * 0.7;
|
||||||
});
|
});
|
||||||
} else if($(this).hasClass('preview_trigger')) {
|
},'script');
|
||||||
$.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(){
|
$(".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>");
|
||||||
// $.ajax({
|
// if($(this).hasClass('post_preview')) {
|
||||||
// type: 'PUT',
|
// var attrs = e.target.attributes;
|
||||||
// url:$(this).attr("href"),
|
// var url = attrs['url'];
|
||||||
// data:$(this).parents("form").serialize(),
|
// $("form.previewable").ajaxSubmit({
|
||||||
// success: function (msg) {
|
// beforeSubmit: function(a,f,o){
|
||||||
// $("#"+start_modal_with_id).modal('show'); },
|
// o.dataType = 'script';
|
||||||
// error: function(){
|
// o.url = url.nodeValue;
|
||||||
// alert("ERROR");
|
// 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;
|
// 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('disabled');
|
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disable');
|
||||||
}
|
}
|
||||||
$('.set-sidebar-state').on({
|
$('.set-sidebar-state').on({
|
||||||
change: function() {
|
change: function() {
|
||||||
|
|||||||
@@ -54,10 +54,9 @@ 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[:file][:content].force_encoding('UTF-8'))
|
temp_file.write(params[:html_code].force_encoding('UTF-8'))
|
||||||
@object.remove_file!
|
@object.remove_file!
|
||||||
@object.file = temp_file
|
@object.file = temp_file
|
||||||
@object.save
|
@object.save
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ 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
|
||||||
@@ -95,9 +97,7 @@ 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.html {
|
format.js
|
||||||
redirect_to admin_page_url(@part.page, edit: true)
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@id = params[:id]
|
@id = params[:id]
|
||||||
|
|||||||
@@ -21,6 +21,16 @@ 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 )
|
||||||
@@ -60,8 +70,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? ? [0, page.category.map{|c| c.to_s}] : [1]
|
m["category"] = page.category.present? ? page.category.map{|c| c.to_s} : []
|
||||||
m["tags"] = page.tag.present? ? [0, page.tag.map{|c| c.to_s}] : [1]
|
m["tags"] = page.tag.present? ? page.tag.map{|c| c.to_s} : []
|
||||||
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]
|
||||||
|
|||||||
@@ -341,9 +341,18 @@ class ApplicationController < ActionController::Base
|
|||||||
else
|
else
|
||||||
objects = get_viewable(object_class, query)
|
objects = get_viewable(object_class, query)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (!user_signed_in? && object_class == "bulletin")
|
||||||
|
objects = get_bulletins_for_open_backend(objects)
|
||||||
|
end
|
||||||
|
|
||||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_bulletins_for_open_backend(objects)
|
||||||
|
objects.select{|object| object.is_rejected == false && object.is_pending == false}
|
||||||
|
end
|
||||||
|
|
||||||
def get_string_value_from_object(object)
|
def get_string_value_from_object(object)
|
||||||
s = object.name_translations[I18n.locale.to_s] unless s rescue nil
|
s = object.name_translations[I18n.locale.to_s] unless s rescue nil
|
||||||
s = object.title_translations[I18n.locale.to_s] unless s rescue nil
|
s = object.title_translations[I18n.locale.to_s] unless s rescue nil
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
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
|
||||||
@@ -5,42 +5,61 @@
|
|||||||
<%= t(:server_usage) %>
|
<%= t(:server_usage) %>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-content" style='overflow: hidden;'>
|
<div class="box-content" style='overflow: hidden; text-align:center;'>
|
||||||
<span id="cpu_usage" style="display:inline-block;margin: 0 auto"></span>
|
<div id="cpu_usage" class="pull-left" style="width:200px; height:160px; display: inline-block;"></div>
|
||||||
<span id="mem_usage" style="display:inline-block;margin: 0 auto"></span>
|
<div id="mem_usage" style="width:200px; height:160px; display: inline-block;"></div>
|
||||||
<span id="disk_usage" style="display:inline-block;margin: 0 auto"></span>
|
<div id="disk_usage" class="pull-right" style="width:200px; height:160px; display: inline-block;"></div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
google.load('visualization', '1', {packages:['gauge']});
|
var Gages = { 'CPU':{
|
||||||
|
'JustGage': null,
|
||||||
var UsageTpye = {'CPU':{'fn':'get_cpu_usage','chart':null,'id':'cpu_usage','interval':2000},
|
'container': 'cpu_usage',
|
||||||
'Mem':{'fn':'get_mem_usage','chart':null,'id':'mem_usage','interval':5000},
|
'title': 'CPU Usage',
|
||||||
'Disk':{'fn':'get_disk_usage','chart':null,'id':'disk_usage','interval':30000}};
|
'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(UsageTpye,function(type,option){
|
$.each(Gages,function(id,Gage){
|
||||||
option['chart'] = new google.visualization.Gauge(document.getElementById(option['id']));
|
Gage['JustGage'] = new JustGage({
|
||||||
update_usage(type,option);
|
id: Gage['container'],
|
||||||
|
value: 0,
|
||||||
|
min: 0,
|
||||||
|
max: 100,
|
||||||
|
title: Gage['title'],
|
||||||
|
shadowVerticalOffset: 10,
|
||||||
|
levelColors: ['#39D824','#FFC33F','#F51F1F'],
|
||||||
|
titleFontColor: '#666',
|
||||||
|
valueFontColor: '#666',
|
||||||
|
labelFontColor: '#666',
|
||||||
|
label: '%',
|
||||||
|
refreshAnimationTime: 800
|
||||||
|
});
|
||||||
|
|
||||||
setInterval(function() { update_usage(type,option); }, option['interval']);
|
update_usage(Gage);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function update_usage(type,option){
|
function update_usage(Gage){
|
||||||
$.get('/admin/dashboards/'+option['fn'],function(usage){
|
$.get('/admin/dashboards/'+Gage['fn'],function(usage){
|
||||||
var data = google.visualization.arrayToDataTable([
|
Gage['JustGage'].refresh(parseInt(usage));
|
||||||
['Label', 'Value'],
|
setTimeout(function(){update_usage(Gage);},Gage['update_interval']);
|
||||||
[type, parseInt(usage)]
|
});
|
||||||
]);
|
|
||||||
|
|
||||||
var options = {
|
|
||||||
width: 400, height: 180,
|
|
||||||
redFrom: 80, redTo: 100,
|
|
||||||
yellowFrom:60, yellowTo: 80,
|
|
||||||
minorTicks: 5
|
|
||||||
};
|
|
||||||
|
|
||||||
option['chart'].draw(data, options);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -15,20 +15,4 @@
|
|||||||
vAxis:{minValue:-100,viewWindowMode: 'maximized'}
|
vAxis:{minValue:-100,viewWindowMode: 'maximized'}
|
||||||
} %>
|
} %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
renderLineChart = function (element, series, opts) {
|
|
||||||
waitForLoaded(function () {
|
|
||||||
var options = jsOptions(series, opts);
|
|
||||||
var data = createDataTable(series, "datetime");
|
|
||||||
var formatter = new google.visualization.DateFormat({
|
|
||||||
pattern: options.pattern
|
|
||||||
});
|
|
||||||
formatter.format(data, 0);
|
|
||||||
var chart = new google.visualization.LineChart(element);
|
|
||||||
resize(function () {
|
|
||||||
chart.draw(data, options);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,15 +1,18 @@
|
|||||||
<%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>
|
<%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>
|
||||||
|
<%= 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? %>
|
<% 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 %>
|
<% end %>
|
||||||
<div class="box span6">
|
<div class="box span5">
|
||||||
<div id='traffic'>
|
<div id='traffic'>
|
||||||
<%= render 'traffic' %>
|
<%= render 'traffic' %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
</div>
|
</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,20 +28,22 @@
|
|||||||
<%= 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">
|
<div class="checkbox-groups hide" id="page-category-groups" data-for="category">
|
||||||
<%= 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">
|
<div class="checkbox-groups hide" id="page-tags-groups" data-for="tag">
|
||||||
<%= 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,8 +16,9 @@
|
|||||||
<% 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"), "/#{node.path}?edit=true", 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"), 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') %>
|
||||||
<% 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,4 +3,25 @@
|
|||||||
<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>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<% 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,8 +3,7 @@
|
|||||||
<% 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">
|
||||||
@@ -81,7 +80,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 %>
|
<%= 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) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -102,13 +101,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, true, class: "select_all" %> <%= t(:all) %>
|
<%= check_box_tag nil, nil, false, 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[tag][]", category.id, (@part.category.include?(category.id) rescue false) ) %>
|
<%= check_box_tag("page_part[category][]", category.id, (@part.category.include?(category.id.to_s) rescue false) ) %>
|
||||||
<%= category.title %>
|
<%= category.title %>
|
||||||
<% end if @module_app_tags %>
|
<% end if @module_app_categories %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -120,7 +119,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) rescue false) ) %>
|
<%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id.to_s) rescue false) ) %>
|
||||||
<%= tag.name %>
|
<%= tag.name %>
|
||||||
<% end if @module_app_tags %>
|
<% end if @module_app_tags %>
|
||||||
</div>
|
</div>
|
||||||
@@ -161,3 +160,10 @@
|
|||||||
$.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>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
window.location.href="<%= admin_page_url(@part.page, edit: true) %>"
|
||||||
@@ -5,12 +5,7 @@
|
|||||||
|
|
||||||
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
|
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
|
||||||
<div class="attributes-header clearfix">
|
<div class="attributes-header clearfix">
|
||||||
<div class="toggle-control" style="float: right;">
|
<%= 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="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>
|
||||||
|
|
||||||
|
|||||||
@@ -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-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
<a href="#collapse-role" 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-status">
|
<div class="accordion-body collapse" id="collapse-role">
|
||||||
|
|
||||||
<%= 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-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
<a href="#collapse-role" 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-status">
|
<div class="accordion-body collapse" id="collapse-role">
|
||||||
|
|
||||||
<%= 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-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
<a href="#collapse-role" 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-status">
|
<div class="accordion-body collapse" id="collapse-role">
|
||||||
|
|
||||||
<%= render :partial => "filter"%>
|
<%= render :partial => "filter"%>
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,36 @@
|
|||||||
|
<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>
|
||||||
|
-->
|
||||||
|
|
||||||
<h1 class="login-logo"><%= t(:ruling_site) %></h1>
|
<div class="form">
|
||||||
<div id="signin-header">
|
<h3 class="login-logo">Reset Your Password</h3>
|
||||||
<h3><%= t(:forgot_password) %></h3>
|
<div>
|
||||||
</div>
|
<input name="utf8" type="hidden" value="" />
|
||||||
<div id="container" class="sign-in">
|
<input name="authenticity_token" type="hidden" value="" />
|
||||||
<%= form_for :user, :url => user_password_path, :html => {:class => 'user_new form-horizontal'} do |f| %>
|
</div>
|
||||||
<%= devise_error_messages! %>
|
<!-- <div class="other-sign-in">
|
||||||
<div class="content">
|
<a class="btn btn-primary" type="submit">Other Sign In</a>
|
||||||
<div class="main">
|
<p>or</p>
|
||||||
<div class="control-group clear">
|
</div> -->
|
||||||
<%= f.label :email %>
|
<div class="form-block">
|
||||||
<%= f.email_field :email, :placeholder => t(:email), :style => "width: 330px;" %>
|
<div class="form-list clearfix">
|
||||||
<span class="help-inline">Please correct the error</span>
|
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
||||||
</div>
|
<%= 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 class="form-actions clear">
|
<div class="control-group clear">
|
||||||
<%= content_tag :button, "Send me reset password instructions", :type => :submit, :class => 'btn btn-primary pull-right' %>
|
<label for="user_email">
|
||||||
</div>
|
<i class="icons-mail "></i>
|
||||||
<% end %>
|
</label>
|
||||||
</div>
|
<%= f.text_field :email, :placeholder => t(:email), :id=>"user_email" %>
|
||||||
|
</div>
|
||||||
|
<%= content_tag :button, "Reset Password", :type => :submit, :class => 'btn btn-primary' %>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
<!-- 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>
|
||||||
@@ -35,25 +33,22 @@
|
|||||||
</label>
|
</label>
|
||||||
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
|
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
|
||||||
</div>
|
</div>
|
||||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
<br/>
|
||||||
</form>
|
<label class="checkbox">
|
||||||
|
<% if devise_mapping.rememberable? -%>
|
||||||
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
<%= f.check_box :remember_me %> <small><%= f.label :remember_me %></small>
|
||||||
<div class="control-group clear">
|
<% end -%>
|
||||||
<label for="user_email">
|
</label>
|
||||||
<i class="icon-user"></i>
|
|
||||||
</label>
|
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||||
<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><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 class='needed'><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,6 +17,12 @@
|
|||||||
<% 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{
|
||||||
|
|||||||
@@ -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.blank? %>
|
<% if @site.desktop_closed %>
|
||||||
<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" value="">
|
<input type="checkbox" name="user[remember_me]" value="1" checked="checked" />
|
||||||
<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">
|
||||||
|
|||||||
@@ -13,13 +13,21 @@
|
|||||||
<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();
|
||||||
@@ -30,6 +38,14 @@
|
|||||||
$("#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>
|
||||||
@@ -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 = false
|
config.action_mailer.raise_delivery_errors = true
|
||||||
|
|
||||||
# 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 = "please-change-me@config-initializers-devise.com"
|
config.mailer_sender = "UserMailer"
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
+1
-1
@@ -24,4 +24,4 @@ production:
|
|||||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: test_site
|
database: orbit_site_new
|
||||||
@@ -23,7 +23,6 @@ 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
|
||||||
@@ -48,13 +47,7 @@ module ParserFrontEnd
|
|||||||
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 ''
|
||||||
args.each do |index,arg|
|
ret << (ret.include?("?") ? "&#{args.to_param}" : "?#{args.to_param}") if args
|
||||||
if index=="tag_id" || index=="category_id"
|
|
||||||
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)
|
||||||
|
|||||||
@@ -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 => theme.id, :menu_enabled_for => [] )
|
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => nil, :menu_enabled_for => {"zh_tw"=>"true", "en"=>"true"} )
|
||||||
|
|
||||||
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
||||||
home.save
|
home.save
|
||||||
|
|||||||
+1
-1
@@ -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 => theme.id, :menu_enabled_for => [] )
|
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => nil, :menu_enabled_for => {"zh_tw"=>"true", "en"=>"true"} )
|
||||||
|
|
||||||
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
||||||
home.save
|
home.save
|
||||||
|
|||||||
Vendored
+12
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* 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
|
||||||
Vendored
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// +--------------------------------------------------------------------+ \\
|
||||||
|
// ¦ 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
|
||||||
+20
-19
@@ -9,19 +9,30 @@ 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
|
||||||
@item = Page.find(params[:page_id]) rescue nil
|
@bulletins = get_bulletins_for_index
|
||||||
|
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
|
||||||
@@ -30,33 +41,23 @@ 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 => 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]).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 => 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.in => 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 => 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.in => 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
|
||||||
end
|
@bulletins
|
||||||
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@item = Page.find(params[:page_id]) rescue nil
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
|
|||||||
+3
-3
@@ -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 = get_categories_for_index
|
@categories = @module_app.categories.enabled
|
||||||
|
|
||||||
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 = get_categories_for_index
|
@categories = @module_app.categories.enabled
|
||||||
|
|
||||||
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 = get_categories_for_index
|
@categories = @module_app.categories.enabled
|
||||||
end
|
end
|
||||||
|
|
||||||
def bulletins_search_block
|
def bulletins_search_block
|
||||||
|
|||||||
vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
Vendored
-1
@@ -1,7 +1,6 @@
|
|||||||
<% # 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
-2
@@ -1,7 +1,6 @@
|
|||||||
<% # 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">
|
||||||
@@ -23,7 +22,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.bulletin_category_id) %>
|
<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.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>
|
||||||
|
|||||||
Vendored
+3
-6
@@ -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,7 +149,6 @@
|
|||||||
</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 %>
|
||||||
@@ -198,8 +197,7 @@
|
|||||||
</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 %>
|
||||||
@@ -246,7 +244,6 @@
|
|||||||
</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 %>
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
<%= stylesheet_link_tag "default_widget" %>
|
<%= stylesheet_link_tag "default_widget" %>
|
||||||
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
|
<script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.js'></script>
|
||||||
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
|
<!-- <script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.degsin.js'></script> -->
|
||||||
|
|
||||||
<div id="bulletin_widget">
|
<div id="bulletin_widget">
|
||||||
<%= render 'index' %>
|
<%= render 'index' %>
|
||||||
|
|||||||
+1
-1
@@ -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 => [:bulletin_category,:id]}}
|
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [: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
|
||||||
|
|||||||
+9
-1
@@ -10,4 +10,12 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<%= render partial: 'category', collection: @categories %>
|
<%= render partial: 'category', collection: @categories %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div class="bottomnav clearfix">
|
||||||
|
<div class="action pull-right">
|
||||||
|
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
|
||||||
|
</div>
|
||||||
|
<div class="pagination pagination-centered">
|
||||||
|
<%= paginate @categories unless @categories.blank? %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
+2
-2
@@ -37,14 +37,14 @@ class Panel::Faq::FrontEnd::QasController < OrbitWidgetController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@qa = Qa.find(params[:id])
|
@qa = Qa.find(params[:id])
|
||||||
get_categorys
|
# get_categorys
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def get_categorys
|
def get_categorys
|
||||||
@qa_categorys = QaCategory.excludes('disable' => true)
|
# @qa_categorys = QaCategory.excludes('disable' => true)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
+1
-1
@@ -22,7 +22,7 @@ class Qa
|
|||||||
accepts_nested_attributes_for :qa_files, :allow_destroy => true
|
accepts_nested_attributes_for :qa_files, :allow_destroy => true
|
||||||
accepts_nested_attributes_for :qa_links, :allow_destroy => true
|
accepts_nested_attributes_for :qa_links, :allow_destroy => true
|
||||||
|
|
||||||
belongs_to :qa_category
|
# belongs_to :qa_category
|
||||||
|
|
||||||
before_save :clean_values
|
before_save :clean_values
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
<h1 class="h1"><%= @qa.title %></h1>
|
<h1 class="h1"><%= @qa.title %></h1>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="info1">
|
<div class="info1">
|
||||||
<span><%= t(:category) %>:<%= @qa.qa_category.title rescue nil %></span>
|
<span><%= t(:category) %>:<%= @qa.category.title rescue nil %></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="news_paragraph">
|
<div class="news_paragraph">
|
||||||
|
|||||||
Vendored
+7
-8
@@ -16,7 +16,7 @@ module Faq
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
category ["QaCategory"]
|
# category ["QaCategory"]
|
||||||
data_count 1..20
|
data_count 1..20
|
||||||
|
|
||||||
taggable
|
taggable
|
||||||
@@ -25,9 +25,9 @@ module Faq
|
|||||||
|
|
||||||
widgets do
|
widgets do
|
||||||
default_widget do
|
default_widget do
|
||||||
query 'Qa.all'
|
query 'Qa'
|
||||||
# enable ['typeA']
|
enable ['typeA']
|
||||||
link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [:qa_category,:id]}}
|
link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [:category,:id]}}
|
||||||
link_field :title, {:method => 'panel_faq_front_end_qa_path',:args=>:self}
|
link_field :title, {:method => 'panel_faq_front_end_qa_path',:args=>:self}
|
||||||
link_to_more 'panel_faq_front_end_qas_path',:title_i18n=> 'faq.default_widget.to_more'
|
link_to_more 'panel_faq_front_end_qas_path',:title_i18n=> 'faq.default_widget.to_more'
|
||||||
end
|
end
|
||||||
@@ -45,7 +45,7 @@ module Faq
|
|||||||
side_bar do
|
side_bar do
|
||||||
head_label_i18n 'faq.faq',:icon_class=>"icons-help"
|
head_label_i18n 'faq.faq',:icon_class=>"icons-help"
|
||||||
available_for [:admin,:guest,:manager,:sub_manager]
|
available_for [:admin,:guest,:manager,:sub_manager]
|
||||||
active_for_controllers ({:private=>['qas', 'qa_categorys']})
|
active_for_controllers ({:private=>['qas', 'qa_categorys','module_tags', 'categories']})
|
||||||
active_for_object_auth ['QaCategory']
|
active_for_object_auth ['QaCategory']
|
||||||
|
|
||||||
head_link_path "panel_faq_back_end_qas_path"
|
head_link_path "panel_faq_back_end_qas_path"
|
||||||
@@ -65,11 +65,10 @@ module Faq
|
|||||||
context_link 'categories',
|
context_link 'categories',
|
||||||
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
|
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
|
||||||
:priority=>3,
|
:priority=>3,
|
||||||
:active_for_category => 'Qa',
|
:active_for_category => 'Faq',
|
||||||
:available_for => [:manager]
|
:available_for => [:manager]
|
||||||
|
|
||||||
context_link 'tags',
|
context_link 'tags',
|
||||||
:link_path=>"admin_module_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Faq'}))" ,
|
:link_path=>"admin_module_tags_path(module_app_id: get_module_app)" ,
|
||||||
:priority=>4,
|
:priority=>4,
|
||||||
:active_for_tag => 'Faq',
|
:active_for_tag => 'Faq',
|
||||||
:available_for => [:manager]
|
:available_for => [:manager]
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
var fetchNewImages = function(){
|
var fetchNewImages = function(){
|
||||||
var lastid = $("li.rgalbum:last").data("image-id"),
|
var lastid = ( $("li.rgalbum:last").length ? $("li.rgalbum:last").data("image-id") : null),
|
||||||
albumid = $("#fileupload_aid").val();
|
albumid = $("#fileupload_aid").val();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ var galleryAPI = function(){
|
|||||||
this.loading = $("#loading");
|
this.loading = $("#loading");
|
||||||
|
|
||||||
this.loadTheater = function(id){
|
this.loadTheater = function(id){
|
||||||
|
$( ".breadcrumb li:eq(1) a" ).attr("href","/panel/gallery/back_end/albums");
|
||||||
g.loadstart();
|
g.loadstart();
|
||||||
var imageArray;
|
var imageArray;
|
||||||
var imagecount = 0;
|
var imagecount = 0;
|
||||||
|
|||||||
+3
-68
@@ -32,73 +32,8 @@ var galleryAPI = function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
}
|
||||||
//bindHandlers();
|
|
||||||
})
|
|
||||||
var bindHandlers = function(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loadAlbums = function(id){
|
|
||||||
g.albumArea.find(".rghead .rgfn a").click(function(){g.makeNewAlbum($(this).attr("href"))});
|
|
||||||
g.albumArea.addClass('o_gallery');
|
|
||||||
g.albumArea.find("#imgholder").empty();
|
|
||||||
if(id!="all"){
|
|
||||||
var cids = [];
|
|
||||||
var tids = [];
|
|
||||||
var href = null;
|
|
||||||
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
|
||||||
for(var i = 0; i < hashes.length; i++){
|
|
||||||
hash = hashes[i].split('=');
|
|
||||||
if(hash[0]=="cat"){
|
|
||||||
cids.push(hash[1]);
|
|
||||||
href = "cat="+hash[1];
|
|
||||||
}else if(hash[0]=="tag"){
|
|
||||||
tids.push(hash[1]);
|
|
||||||
href = "tag="+hash[1];
|
|
||||||
}
|
|
||||||
$("#filter .filter_btns a[href='"+href+"']").addClass("active");
|
|
||||||
}
|
|
||||||
if(cids.length == 0)
|
|
||||||
cids = "all";
|
|
||||||
}else{
|
|
||||||
var cids = "all";
|
|
||||||
}
|
|
||||||
$.getJSON("/panel/gallery/front_end/get_albums",{"cid":cids,"tid":tids,"inner":true},function(categories){
|
|
||||||
$.each(categories,function(x,category){
|
|
||||||
$.each(category,function(i,album){
|
|
||||||
album.description = (album.description?album.description:"<%= I18n.t('gallery.no_description') %>")
|
|
||||||
if(album.cover == "default")
|
|
||||||
var $img = $("<div class='rgalbum'><a title='"+album.description+"' href='"+album.show_path+"'><img src='../../../assets/gallery/default.jpg'/></a><span class='albumname'><a title='"+album.description+"' href='?album="+album._id+"'>"+album.name+"</a></span><span class='categoryname'><i class='icon-folder-close'></i> "+album.category_name+"</span><span class='tagnames'></span></div>");
|
|
||||||
else
|
|
||||||
var $img = $("<div class='rgalbum'><a title='"+album.description+"' href='"+album.show_path+"'><img src='"+album.cover_path+"'/></a><span class='albumname'><a title='"+album.description+"' href='?album="+album._id+"'>"+album.name+"</a></span><span class='categoryname'><i class='icon-folder-close'></i> "+album.category_name+"</span><span class='tagnames'></span></div>");
|
|
||||||
var tag_string = "";
|
|
||||||
for(tag in album.tag_names){
|
|
||||||
if(tag == album.tag_names.length-1)
|
|
||||||
tag_string+= '<span class="tags">' + album.tag_names[tag] + '</span>';
|
|
||||||
else
|
|
||||||
tag_string+= '<span class="tags">' + album.tag_names[tag] + ', </span>';
|
|
||||||
}
|
|
||||||
$img.find(".tagnames").html(tag_string);
|
|
||||||
g.albumArea.find("#imgholder").append($img);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.loadImages = function(id){
|
|
||||||
g.albumArea.addClass('o_album');
|
|
||||||
g.albumArea.find("#imgholder").empty();
|
|
||||||
$.getJSON("panel/gallery/front_end/albums/"+id+"/imgs",{inner:true},function(album){
|
|
||||||
$.each(album.images,function(i,image){
|
|
||||||
var thumb = image.file.thumb.url;
|
|
||||||
image.description = (image.description?image.description:"<%= I18n.t('gallery.no_description') %>")
|
|
||||||
var $img = $("<div class='rgphoto'><a title='"+image.description+"' href='"+image.theater_link+"'><img src='"+thumb+"'/></a></div>");
|
|
||||||
g.albumArea.find("#imgholder").append($img);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.loadTheater = function(id){
|
this.loadTheater = function(id){
|
||||||
var imageArray;
|
var imageArray;
|
||||||
var imagecount = 0;
|
var imagecount = 0;
|
||||||
@@ -241,7 +176,7 @@ var galleryAPI = function(){
|
|||||||
if(rcom.getInternetExplorerVersion() == -1){
|
if(rcom.getInternetExplorerVersion() == -1){
|
||||||
|
|
||||||
if(pageurl!=window.location){
|
if(pageurl!=window.location){
|
||||||
pageurl = window.location.pathname.replace("/","")+"?id="+pageurl+"&controller_action=theater";
|
pageurl = window.location.pathname+"?id="+pageurl+"&controller_action=theater";
|
||||||
window.history.pushState({path:pageurl},'',pageurl);
|
window.history.pushState({path:pageurl},'',pageurl);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@@ -278,7 +213,7 @@ var galleryAPI = function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
var preparestage = function(albumid){
|
var preparestage = function(albumid){
|
||||||
$.getJSON("panel/gallery/front_end/albums/"+albumid+"/imgs",{"inner":true},function(album){
|
$.getJSON("/panel/gallery/front_end/albums/"+albumid+"/imgs",{"inner":true},function(album){
|
||||||
imageArray = eval(album.images);
|
imageArray = eval(album.images);
|
||||||
$.each(album.images,function(i,image){
|
$.each(album.images,function(i,image){
|
||||||
if(image._id == id)
|
if(image._id == id)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#orbit_gallery .rgalbum:hover {
|
#orbit_gallery .rgalbum:hover {
|
||||||
box-shadow: 0px 0px 5px rgba(0,0,0,.2);
|
box-shadow: 0px 0px 5px rgba(0,0,0,.2);
|
||||||
}
|
}
|
||||||
#orbit_gallery .rgalbum a {
|
#orbit_gallery .rgalbum > a {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: block;
|
display: block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
#orbit_gallery .rgalbum:hover a img {
|
#orbit_gallery .rgalbum:hover a img {
|
||||||
-webkit-filter: blur(2px);
|
-webkit-filter: blur(2px);
|
||||||
}
|
}
|
||||||
#orbit_gallery .rgalbum a:after {
|
#orbit_gallery .rgalbum > a:after {
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -95,15 +95,24 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
float: left;
|
float: left;
|
||||||
color: #777777;
|
color: #777777;
|
||||||
font-size: 11px;
|
font-size: 1.2em;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
#orbit_gallery .rgalbum .gallery_info li > a {
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 5px;
|
||||||
|
color: #777777;
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum .gallery_info li:hover > a {
|
||||||
|
color: #E41B2B;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
#orbit_gallery .rgalbum .gallery_info li:hover {
|
#orbit_gallery .rgalbum .gallery_info li:hover {
|
||||||
color: #0088CC;
|
color: #0088CC;
|
||||||
}
|
}
|
||||||
#orbit_gallery .rgalbum .gallery_info li .icons-tag {
|
#orbit_gallery .rgalbum .gallery_info li .icons-tag {
|
||||||
margin-left: 10px;
|
margin-left: 3px;
|
||||||
}
|
}
|
||||||
#orbit_gallery .rgalbum .gallery_info li.albumcateg {
|
#orbit_gallery .rgalbum .gallery_info li.albumcateg {
|
||||||
float: right;
|
float: right;
|
||||||
@@ -230,6 +239,7 @@
|
|||||||
#imgholder .rgalbum a img {
|
#imgholder .rgalbum a img {
|
||||||
max-width: none;
|
max-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#imgholder .rgalbum .check {
|
#imgholder .rgalbum .check {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
@@ -557,8 +557,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#loading{
|
#loading{
|
||||||
background: #fff 0 center url("../../../assets/gallery/ajax-loader.gif") no-repeat;
|
background: #fff 0 center url("../../../assets/loading.gif") no-repeat;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
width: 32px;
|
width: 220px;
|
||||||
}
|
}
|
||||||
Vendored
+14
-7
@@ -155,10 +155,15 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
render :json=>{"files"=>a}.to_json
|
render :json=>{"files"=>a}.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_images
|
def new_images
|
||||||
@lastimage = GalleryImage.find(params[:last_image_id])
|
if params[:last_image_id] != ""
|
||||||
@album = GalleryAlbum.find(params[:album_id])
|
@lastimage = GalleryImage.find(params[:last_image_id])
|
||||||
@newimages = @album.gallery_images.where(:created_at.gt => @lastimage.created_at)
|
@album = GalleryAlbum.find(params[:album_id])
|
||||||
|
@newimages = @album.gallery_images.where(:created_at.gt => @lastimage.created_at)
|
||||||
|
else
|
||||||
|
@album = GalleryAlbum.find(params[:album_id])
|
||||||
|
@newimages = @album.gallery_images
|
||||||
|
end
|
||||||
render :layout=>false
|
render :layout=>false
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -184,9 +189,11 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
|||||||
tagsToDestroy << tag
|
tagsToDestroy << tag
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
new_tags.each do |tag|
|
if new_tags != nil
|
||||||
if !old_tags.include?(tag)
|
new_tags.each do |tag|
|
||||||
tagsToAdd << tag
|
if !old_tags.include?(tag)
|
||||||
|
tagsToAdd << tag
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||||
|
|||||||
Vendored
+2
-47
@@ -1,56 +1,11 @@
|
|||||||
class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||||
def index
|
def index
|
||||||
|
@albums = GalleryAlbum.where(:category_id.in => params[:category_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@album = GalleryAlbum.find(params[:id])
|
@album = GalleryAlbum.find(params[:id])
|
||||||
@tags = Tag.find(@album.tagged_ids).map{|t| t.name}
|
@images = @album.gallery_images
|
||||||
end
|
|
||||||
|
|
||||||
def get_albums
|
|
||||||
@categoryids = params["cid"]
|
|
||||||
@tags = params["tid"]
|
|
||||||
@albums = Array.new
|
|
||||||
if @categoryids == "all"
|
|
||||||
if @tags
|
|
||||||
if @tags.kind_of?(Array)
|
|
||||||
@tags.each do |tag|
|
|
||||||
@albums << GalleryAlbum.where(tagged_ids: tag)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@albums << GalleryAlbum.where(tagged_ids: @tags)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@albums << GalleryAlbum.all
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@categoryids.each do |id|
|
|
||||||
category = Category.find(id)
|
|
||||||
if @tags
|
|
||||||
if @tags.kind_of?(Array)
|
|
||||||
@tags.each do |tag|
|
|
||||||
@albums << category.gallery_albums.where(tagged_ids: tag)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@albums << category.gallery_albums.where(tagged_ids: @tags)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@albums << category.gallery_albums.all
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@output = Array.new
|
|
||||||
@albums.each do |album|
|
|
||||||
@albs = Array.new
|
|
||||||
album.each do |values|
|
|
||||||
tags = Tag.find(values.tagged_ids).map{|t| t.name}
|
|
||||||
category = Category.find(values.category_id).title
|
|
||||||
|
|
||||||
@albs << {"_id"=>values.id,"show_path"=>panel_gallery_front_end_album_path(values),"cover"=>values.cover,"cover_path"=>values.cover_path,"description"=>values.description,"category_name"=>category,"gallery_category_id" => values.category_id,"name"=>values.name,"tag_ids"=>values.tag_ids,"tag_names"=>tags}
|
|
||||||
end
|
|
||||||
@output << @albs
|
|
||||||
end
|
|
||||||
render :json=>@output.to_json
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def imgs
|
def imgs
|
||||||
|
|||||||
+3
-2
@@ -8,9 +8,10 @@
|
|||||||
<p class="albumname"><%= album.name %></p>
|
<p class="albumname"><%= album.name %></p>
|
||||||
</a>
|
</a>
|
||||||
<ul class="gallery_info clearfix">
|
<ul class="gallery_info clearfix">
|
||||||
<li class="view"><i class="icons-eye"></i> 321</li>
|
<!-- <li class="view"><i class="icons-eye"></i> 321</li> -->
|
||||||
<li><i class="icons-tag"></i></li>
|
<li><i class="icons-tag"></i></li>
|
||||||
<li class="albumcateg"></li>
|
<li><%= link_to (content_tag(:i,"",:class=>"icon-trash danger")), panel_gallery_back_end_album_path(album), :confirm => "Are you sure?", :method=>:delete %></li>
|
||||||
|
<li class="albumcateg"><%= Category.find(album.category_id).title %></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="albumtag">
|
<ul class="albumtag">
|
||||||
<% album.tagged_ids.each do |tag| %>
|
<% album.tagged_ids.each do |tag| %>
|
||||||
|
|||||||
+4
-13
@@ -63,15 +63,9 @@
|
|||||||
<div class="nav-name"><strong>Language</strong></div>
|
<div class="nav-name"><strong>Language</strong></div>
|
||||||
<ul class="nav nav-pills language-nav">
|
<ul class="nav nav-pills language-nav">
|
||||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||||
<% if i == 0 %>
|
<li <%= (i == 0 ? 'class=active' : '') %>>
|
||||||
<li class="active">
|
<a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
|
||||||
<a href=".en" data-toggle="tab">English</a>
|
|
||||||
</li>
|
</li>
|
||||||
<% else %>
|
|
||||||
<li>
|
|
||||||
<a href=".tw_zh" data-toggle="tab">Chinese</a>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content language-area">
|
<div class="tab-content language-area">
|
||||||
@@ -79,11 +73,8 @@
|
|||||||
|
|
||||||
|
|
||||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||||
<% if i == 0 %>
|
|
||||||
<div class="tab-pane fade in active en">
|
<div class="tab-pane fade in <%= (i == 0 ? 'active' : '') %> <%= locale %>">
|
||||||
<% else %>
|
|
||||||
<div class="tab-pane fade tw_zh">
|
|
||||||
<% end %>
|
|
||||||
<div class="control-group input-title">
|
<div class="control-group input-title">
|
||||||
<%= f.fields_for :name_translations do |name| %>
|
<%= f.fields_for :name_translations do |name| %>
|
||||||
<%= label_tag(locale, t("gallery.album_name"),:class=>"control-label muted") %>
|
<%= label_tag(locale, t("gallery.album_name"),:class=>"control-label muted") %>
|
||||||
|
|||||||
+6
@@ -4,6 +4,12 @@
|
|||||||
values: @tags,
|
values: @tags,
|
||||||
translation: 'tags',
|
translation: 'tags',
|
||||||
object_field: 'name'
|
object_field: 'name'
|
||||||
|
|
||||||
|
filter_field type: 'objects',
|
||||||
|
values: @categories,
|
||||||
|
translation: 'category',
|
||||||
|
object_field: 'title'
|
||||||
|
|
||||||
footer link: 'new_panel_gallery_back_end_album_path',
|
footer link: 'new_panel_gallery_back_end_album_path',
|
||||||
paginate: false
|
paginate: false
|
||||||
end %>
|
end %>
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
<a href="#view-photo-tags" class="btn btn-primary btn-small addtags open hide" for="batch"><i class="icons-tag"></i> Add Tags</a>
|
<a href="#view-photo-tags" class="btn btn-primary btn-small addtags open hide" for="batch"><i class="icons-tag"></i> Add Tags</a>
|
||||||
<a href="<%= edit_panel_gallery_back_end_album_path(@album) %>" class="btn btn-small btn-success"><i class="icon-edit"></i> Edit</a>
|
<a href="<%= edit_panel_gallery_back_end_album_path(@album) %>" class="btn btn-small btn-success"><i class="icon-edit"></i> Edit</a>
|
||||||
<b class="divider"></b>
|
<b class="divider"></b>
|
||||||
<%= link_to (content_tag(:i,"",:class=>"icon-trash")), panel_gallery_back_end_album_path(@album), :class=>"btn btn-small btn-danger", :confirm => "Are you sure?", :method=>:delete %>
|
|
||||||
<a href="#" class="add-imgs btn btn-small btn-primary"><i class="icons-plus"></i> Add Image</a>
|
<a href="#" class="add-imgs btn btn-small btn-primary"><i class="icons-plus"></i> Add Image</a>
|
||||||
</div>
|
</div>
|
||||||
<form action="<%= panel_gallery_back_end_upload_image_path %>", id='fileupload'>
|
<form action="<%= panel_gallery_back_end_upload_image_path %>", id='fileupload'>
|
||||||
|
|||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
<div class='rgalbum'>
|
||||||
|
<a title='<%= album.name %>' href='<%= panel_gallery_front_end_album_path(album) %>'>
|
||||||
|
<% if album.cover == "default" %>
|
||||||
|
<%= image_tag "gallery/default.jpg" %>
|
||||||
|
<% else %>
|
||||||
|
<img src="<%= album.cover_path %>">
|
||||||
|
<% end %>
|
||||||
|
</a>
|
||||||
|
<span class='albumname'>
|
||||||
|
<a title='<%= album.description %>' href='<%= panel_gallery_front_end_album_path(album) %>'><%= album.name %></a>
|
||||||
|
</span>
|
||||||
|
<span class='categoryname'><i class='icon-folder-close'></i><%= Category.find(album.category_id).title %></span>
|
||||||
|
<span class='tagnames'></span>
|
||||||
|
</div>
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
<div class='rgphoto'>
|
||||||
|
<a title='<%= image.description %>' href='<%= theater_panel_gallery_front_end_album_path(image) %>'>
|
||||||
|
<img src='<%= image.file.thumb.url %>'/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
+4
-32
@@ -1,42 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<%= stylesheet_link_tag "gallery_frontend" %>
|
<%= stylesheet_link_tag "gallery_frontend" %>
|
||||||
|
|
||||||
<%#= stylesheet_link_tag "gallery" %>
|
|
||||||
<div id="orbit_gallery" class="rg">
|
<div id="orbit_gallery" class="rg">
|
||||||
|
|
||||||
<div class="rgbody">
|
<div class="rgbody">
|
||||||
<div id="imgholder">
|
<div id="imgholder">
|
||||||
|
<% @albums.each do |album| %>
|
||||||
|
<%= render :partial => "album", :object => album %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="rghead">
|
|
||||||
<div class="rgfn">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
</script>
|
|
||||||
<% content_for :page_specific_javascript do %>
|
|
||||||
<%= javascript_include_tag "galleryAPI_frontend" %>
|
|
||||||
<%#= javascript_include_tag "jquery.tinyscrollbar" %>
|
|
||||||
<%= javascript_include_tag "rss" %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
|
||||||
var gallery = new galleryAPI();
|
|
||||||
gallery.initialize();
|
|
||||||
if(typeof gallery.urlVars['cat']!= "undefined"){
|
|
||||||
gallery.loadArea = "albums";
|
|
||||||
gallery.loadAlbums(gallery.urlVars['cat']);
|
|
||||||
}else if(typeof gallery.urlVars['tag']!= "undefined"){
|
|
||||||
gallery.loadArea = "albums";
|
|
||||||
gallery.loadAlbums(gallery.urlVars['tag']);
|
|
||||||
}else{
|
|
||||||
gallery.loadArea = "albums";
|
|
||||||
gallery.loadAlbums("all");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
+3
-36
@@ -1,45 +1,12 @@
|
|||||||
|
|
||||||
<%= stylesheet_link_tag "gallery_frontend" %>
|
<%= stylesheet_link_tag "gallery_frontend" %>
|
||||||
|
|
||||||
<div id="orbit_gallery" class="rg">
|
<div id="orbit_gallery" class="rg">
|
||||||
<div class="rgbody">
|
<div class="rgbody">
|
||||||
<div id="imgholder">
|
<div id="imgholder">
|
||||||
|
<% @images.each do |image| %>
|
||||||
|
<%= render :partial => "image", :object => image %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- tag part -->
|
|
||||||
<!-- add "album_tags" or "photo_tags" class to .taglist -->
|
|
||||||
<div class="taglist">
|
|
||||||
<h3 class="taglist_title"><%= t('gallery.album_tag') %></h3>
|
|
||||||
<ul>
|
|
||||||
<% @tags.each do |tag|%>
|
|
||||||
<li><%= tag %></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<!-- tag end -->
|
|
||||||
<div class="form-actions form-fixed pagination-right rghead">
|
|
||||||
<div class="rgfn">
|
|
||||||
<a class="bt-back rgbt" title="<%= I18n.t("gallery.back_to_albums") %>" href="<%= panel_gallery_front_end_albums_path %>"><i class="icon-arrow-left"></i> <%= I18n.t("gallery.back_to_albums") %></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% content_for :page_specific_javascript do %>
|
|
||||||
<%= javascript_include_tag "galleryAPI_frontend" %>
|
|
||||||
<%#= javascript_include_tag "jquery.tinyscrollbar" %>
|
|
||||||
<%= javascript_include_tag "rss" %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
|
||||||
var gallery = new galleryAPI();
|
|
||||||
gallery.initialize();
|
|
||||||
gallery.loadArea = "images";
|
|
||||||
gallery.loadImages("<%= params[:id] %>");
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+1
-1
@@ -34,7 +34,7 @@ module Gallery
|
|||||||
|
|
||||||
customize_widget "widget1" do
|
customize_widget "widget1" do
|
||||||
widget_i18n "gallery.widget.widget1"
|
widget_i18n "gallery.widget.widget1"
|
||||||
style []
|
style ["1","2"]
|
||||||
options "vertical",:i18n => "gallery.widget_option.vertical",:options_item=>[1, 2]
|
options "vertical",:i18n => "gallery.widget_option.vertical",:options_item=>[1, 2]
|
||||||
options "horizontal",:i18n => "gallery.widget_option.horizontal",:options_item=>[1, 2,3,4,5,6]
|
options "horizontal",:i18n => "gallery.widget_option.horizontal",:options_item=>[1, 2,3,4,5,6]
|
||||||
options "album_id",:i18n =>"gallery.album",:options_item => {"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}
|
options "album_id",:i18n =>"gallery.album",:options_item => {"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}
|
||||||
|
|||||||
Whitespace-only changes.
@@ -0,0 +1,132 @@
|
|||||||
|
var Locations = function(ls){
|
||||||
|
|
||||||
|
l = this;
|
||||||
|
this.locations = ls;
|
||||||
|
this.markerCounts = 0;
|
||||||
|
var map = null,
|
||||||
|
infowindow = new google.maps.InfoWindow(),
|
||||||
|
default_location = new google.maps.LatLng( 24.8043107, 121.03042159999995 ),
|
||||||
|
infowindow_template = "<div class='title'></div><div class='image'><img class='thumbnail' src='' /></div>",
|
||||||
|
markers = [];
|
||||||
|
|
||||||
|
|
||||||
|
var initialize = function() {
|
||||||
|
|
||||||
|
google.maps.visualRefresh = true;
|
||||||
|
var location = ( l.locations.length ? new google.maps.LatLng( l.locations[0].latitude, l.locations[0].longitude ) : default_location ),
|
||||||
|
mapOptions = {
|
||||||
|
zoom: 16,
|
||||||
|
center: location,
|
||||||
|
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||||
|
};
|
||||||
|
|
||||||
|
map = new google.maps.Map( document.getElementById('map'), mapOptions );
|
||||||
|
|
||||||
|
for( i = 0; i < l.locations.length; i++ ){
|
||||||
|
markers.push( addMarker( new google.maps.LatLng(l.locations[i].latitude, l.locations[i].longitude), l.locations[i].color, i, function( index ){
|
||||||
|
|
||||||
|
}) );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var addMarker = function( location, pinColor, index, markerCallback ){
|
||||||
|
|
||||||
|
var pin = getPin(( pinColor.substr( 0, 1 ) == "#" ? pinColor.replace("#","") : pinColor )),
|
||||||
|
marker = new google.maps.Marker({
|
||||||
|
map: map,
|
||||||
|
icon: pin.image,
|
||||||
|
shadow: pin.shadow,
|
||||||
|
position: location,
|
||||||
|
zIndex: 10
|
||||||
|
});
|
||||||
|
|
||||||
|
google.maps.event.addListener( marker, 'click', function() {
|
||||||
|
|
||||||
|
infowindow.setContent( getTemplate( index ) );
|
||||||
|
infowindow.open( map, marker );
|
||||||
|
if( typeof markerCallback == "function" )
|
||||||
|
markerCallback.call( this, index );
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
l.markerCounts++;
|
||||||
|
return {"marker" : marker, "category_id" : l.locations[index].category_id};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var getTemplate = function( obj ){
|
||||||
|
|
||||||
|
var object = ( typeof obj == "number" ? l.locations[obj] : ( typeof obj == "object" ? obj : null ) );
|
||||||
|
|
||||||
|
if ( object ){
|
||||||
|
|
||||||
|
var template = $( "<div></div>" );
|
||||||
|
template.html( infowindow_template );
|
||||||
|
template.find( '.title' ).text( object.name );
|
||||||
|
template.find( "img.thumbnail" ).attr( "src", object.file.thumb.url );
|
||||||
|
return template.html();
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
throw new InvalidObjectError();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var getPin = function( color ){
|
||||||
|
|
||||||
|
var pinImage = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + color,
|
||||||
|
new google.maps.Size(21, 34),
|
||||||
|
new google.maps.Point(0,0),
|
||||||
|
new google.maps.Point(10, 34));
|
||||||
|
|
||||||
|
var pinShadow = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow",
|
||||||
|
new google.maps.Size(40, 37),
|
||||||
|
new google.maps.Point(0, 0),
|
||||||
|
new google.maps.Point(12, 35));
|
||||||
|
|
||||||
|
return {"image":pinImage,"shadow":pinShadow};
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getMarker = function( index ){
|
||||||
|
return markers[index];
|
||||||
|
}
|
||||||
|
this.getAllMarkers = function( ){
|
||||||
|
return markers;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.clearFilter = function(){
|
||||||
|
var m = l.getAllMarkers();
|
||||||
|
for( i = 0; i < m.length; i++ ){
|
||||||
|
m[i].marker.setVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.filterMarkers = function( categories ){
|
||||||
|
var filtered = [],
|
||||||
|
m = l.getAllMarkers();
|
||||||
|
|
||||||
|
for( i = 0; i < m.length; i++ ){
|
||||||
|
m[i].marker.setVisible(false);
|
||||||
|
}
|
||||||
|
for( i = 0; i < categories.length; i++ ){
|
||||||
|
filtered = filtered.concat(m.filter(function(a){return a.category_id == categories[i]}));
|
||||||
|
}
|
||||||
|
for( i = 0; i < filtered.length; i++ ){
|
||||||
|
filtered[i].marker.setVisible(true);
|
||||||
|
}
|
||||||
|
return filtered;
|
||||||
|
}
|
||||||
|
|
||||||
|
google.maps.event.addDomListener(window, 'load', initialize);
|
||||||
|
|
||||||
|
}
|
||||||
|
var InvalidObjectError = function(){
|
||||||
|
this.name = "InvalidObjectError";
|
||||||
|
this.message = "Object not valid";
|
||||||
|
}
|
||||||
|
|
||||||
|
InvalidObjectError.prototype = new Error();
|
||||||
|
InvalidObjectError.prototype.constructor = InvalidObjectError;
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
// Place all the behaviors and hooks related to the matching controller here.
|
|
||||||
// All this logic will automatically be available in application.js.
|
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
class Panel::Location::BackEnd::LocationCategoriesController < OrbitBackendController
|
||||||
|
def index
|
||||||
|
@module_app_id = @module_app.id rescue nil
|
||||||
|
@categories = get_categories_for_index
|
||||||
|
@categories = @categories.page(params[:page]).per(10)
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # index.html.erb
|
||||||
|
format.json { render json: @categories }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def list
|
||||||
|
@module_app_id = @module_app.id rescue nil
|
||||||
|
@categories = get_categories_for_index
|
||||||
|
@categories = @categories.page(params[:page]).per(10)
|
||||||
|
render :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Vendored
+9
-1
@@ -2,8 +2,13 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
|||||||
include AdminHelper
|
include AdminHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@location_infos = LocationInfo.all
|
@locations = LocationInfo.all
|
||||||
@categories = get_categories_for_index
|
@categories = get_categories_for_index
|
||||||
|
@location_infos = [];
|
||||||
|
@locations.each do |loc|
|
||||||
|
loc['color'] = Category.find(loc.category_id).custom_value
|
||||||
|
@location_infos << loc
|
||||||
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # new.html.erb
|
format.html # new.html.erb
|
||||||
format.json { render json: @locations }
|
format.json { render json: @locations }
|
||||||
@@ -22,6 +27,8 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
|||||||
|
|
||||||
def edit
|
def edit
|
||||||
@location_info = LocationInfo.find(params[:id])
|
@location_info = LocationInfo.find(params[:id])
|
||||||
|
@categories = get_categories_for_index
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@@ -34,6 +41,7 @@ class Panel::Location::BackEnd::LocationsController < OrbitBackendController
|
|||||||
|
|
||||||
def create
|
def create
|
||||||
@location_info = LocationInfo.new(params[:location_info])
|
@location_info = LocationInfo.new(params[:location_info])
|
||||||
|
@categories = get_categories_for_index
|
||||||
if @location_info.save
|
if @location_info.save
|
||||||
flash[:success] = "Success!!"
|
flash[:success] = "Success!!"
|
||||||
redirect_to panel_location_back_end_locations_url
|
redirect_to panel_location_back_end_locations_url
|
||||||
|
|||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
<tr class="<%= 'disable' if category.disable %>">
|
||||||
|
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||||
|
<td>
|
||||||
|
<%= category.title_translations[locale] %>
|
||||||
|
<% if i == 0 %>
|
||||||
|
<div class="quick-edit">
|
||||||
|
<ul class="nav nav-pills">
|
||||||
|
<% if is_admin?%>
|
||||||
|
<li><%= link_to t(:edit), '#', class: "open-slide", data: {title: t(:edit_category), id: category.id.to_s, module: @module_app_id.to_s, form: category.title_translations.merge(color: category.custom_value)} %></li>
|
||||||
|
<li><%= link_to show_toggle_archive_btn(category), toggle_admin_module_app_category_path(@module_app_id, category), method: :post, remote: true, class: "archive_toggle" %></li>
|
||||||
|
<% end %>
|
||||||
|
<% if is_manager? || is_admin? %>
|
||||||
|
<li><%= link_to t(:category_auth), admin_authorizations_path(@module_app.key, 'category_authorization', category.id) %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<% end %>
|
||||||
|
<td><span class="badge" style="background-color: <%= category.custom_value %>;"><%= category.custom_value %></span></td>
|
||||||
|
</tr>
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<%= flash_messages %>
|
||||||
|
<%= f.error_messages %>
|
||||||
|
<%= label_tag("color", t("location.color")) %>
|
||||||
|
<div class="input-append">
|
||||||
|
<%= f.text_field :custom_value, id: "color", :class => "color-picker miniColors input-small", :size => "7", :maxlength => "7", :autocomplete=>"off",:value=>"9100FF" %>
|
||||||
|
</div>
|
||||||
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
|
<% @site_valid_locales.each do |locale| %>
|
||||||
|
<%= label_tag "name-#{locale}", "#{t(:name)} (#{I18nVariable.from_locale(locale)})" %>
|
||||||
|
<%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name), id: locale %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
+66
@@ -0,0 +1,66 @@
|
|||||||
|
<%= stylesheet_link_tag "jquery.miniColors" %>
|
||||||
|
|
||||||
|
<%= javascript_include_tag "jquery.miniColors.min" %>
|
||||||
|
|
||||||
|
<%= javascript_include_tag "admin/categories" %>
|
||||||
|
|
||||||
|
<div id="categories_index">
|
||||||
|
<table class="table main-list">
|
||||||
|
<thead>
|
||||||
|
<tr class="sort-header">
|
||||||
|
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||||
|
<th class="<%= 'span5' if i <= 1 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th>
|
||||||
|
<% end %>
|
||||||
|
<th class="span2"><a href="#"><%= t('event_category.color') %></a></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<%= render partial: 'category', collection: @categories %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="bottomnav clearfix">
|
||||||
|
<div class="action pull-right">
|
||||||
|
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
|
||||||
|
</div>
|
||||||
|
<div class="pagination pagination-centered">
|
||||||
|
<%= paginate @categories unless @categories.blank? %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="pageslide">
|
||||||
|
<div class="page-title clearfix">
|
||||||
|
<a class="pull-right" href="javascript:$.pageslide.close()">
|
||||||
|
<i class="icons-arrow-left-2"></i>
|
||||||
|
</a>
|
||||||
|
<span></span>
|
||||||
|
</div>
|
||||||
|
<div class="view-page">
|
||||||
|
<div class="nano">
|
||||||
|
<div class="content">
|
||||||
|
<%= form_for :category, url: nil, html:{:id=>"color"}, remote: true do |f| %>
|
||||||
|
<fieldset>
|
||||||
|
<%= render :partial => "form", :locals => { :f => f } %>
|
||||||
|
<div class="form-actions">
|
||||||
|
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
|
||||||
|
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
if($('.color-picker').length > 0){
|
||||||
|
$('.color-picker').miniColors(); // just in category view
|
||||||
|
$('.miniColors-trigger').addClass('btn');
|
||||||
|
}
|
||||||
|
$("form#color").bind("ajax:complete",function(){
|
||||||
|
$.get("<%= panel_location_back_end_location_categories_list_path %>",function(data){
|
||||||
|
$("#categories_index").html(data);
|
||||||
|
openSlide();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
vendor/built_in_modules/location/app/views/panel/location/back_end/location_categories/list.html.erb
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
<table class="table main-list">
|
||||||
|
<thead>
|
||||||
|
<tr class="sort-header">
|
||||||
|
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||||
|
<th class="<%= 'span5' if i <= 1 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th>
|
||||||
|
<% end %>
|
||||||
|
<th class="span2"><a href="#"><%= t('location_category.color') %></a></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<%= render partial: 'category', collection: @categories %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="bottomnav clearfix">
|
||||||
|
<div class="action pull-right">
|
||||||
|
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
|
||||||
|
</div>
|
||||||
|
<div class="pagination pagination-centered">
|
||||||
|
<%= paginate @categories unless @categories.blank? %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Vendored
+1
-1
@@ -19,8 +19,8 @@
|
|||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for=""><%= t 'coordinates' %></label>
|
<label class="control-label" for=""><%= t 'coordinates' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
<%= f.text_field :latitude, :class=>"span2", :placeholder => "Latitude" %>
|
||||||
<%= f.text_field :longitude, :class=>"span2", :placeholder => "Longitude" %>
|
<%= f.text_field :longitude, :class=>"span2", :placeholder => "Longitude" %>
|
||||||
<%= f.text_field :latitude, :class=>"span2", :placeholder => "Langitude" %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Vendored
+40
@@ -1,3 +1,5 @@
|
|||||||
|
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
|
||||||
|
<%= javascript_include_tag "location" %>
|
||||||
<table class="table main-list">
|
<table class="table main-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -28,6 +30,44 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div>
|
||||||
|
Categories :
|
||||||
|
</div>
|
||||||
|
<div class="btn-group">
|
||||||
|
<% @categories.each do |category| %>
|
||||||
|
<button class="btn cat-filter" data-category='<%= category.id %>'><%= category.title %></button>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" id="clear_filter">Clear Filter</a>
|
||||||
|
<div id="map" style="width: 100%; height: 500px;"></div>
|
||||||
<%if is_manager? %>
|
<%if is_manager? %>
|
||||||
<td><%= link_to 'Add', new_panel_location_back_end_location_path, :class => "btn btn-primary pull-right", :id=>"create_event_btn", :ref=>"add-btn"%></td>
|
<td><%= link_to 'Add', new_panel_location_back_end_location_path, :class => "btn btn-primary pull-right", :id=>"create_event_btn", :ref=>"add-btn"%></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
var loc = new Locations(<%= @location_infos.to_json.html_safe %>);
|
||||||
|
jQuery(document).ready(function($) {
|
||||||
|
var filterCategories = [];
|
||||||
|
$("button.cat-filter").bind( clickEvent,function(){
|
||||||
|
var catid = $( this ).data('category');
|
||||||
|
|
||||||
|
if ( $( this ).hasClass('active') ){
|
||||||
|
$( this ).removeClass('active');
|
||||||
|
var index = filterCategories.indexOf(filterCategories.filter(function(a,i){ return a == catid })[0]);
|
||||||
|
filterCategories.splice( index, 1 );
|
||||||
|
}else{
|
||||||
|
$( this ).addClass('active');
|
||||||
|
filterCategories.push( catid );
|
||||||
|
}
|
||||||
|
loc.filterMarkers(filterCategories);
|
||||||
|
})
|
||||||
|
|
||||||
|
$("a#clear_filter").bind( clickEvent, function(){
|
||||||
|
filterCategories = [];
|
||||||
|
$("button.cat-filter").removeClass('active');
|
||||||
|
loc.clearFilter();
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
+2
-1
@@ -2,7 +2,8 @@ Rails.application.routes.draw do
|
|||||||
namespace :panel do
|
namespace :panel do
|
||||||
namespace :location do
|
namespace :location do
|
||||||
namespace :back_end do
|
namespace :back_end do
|
||||||
|
match 'location_categories/list' => "location_categories#list"
|
||||||
|
resources :location_categories
|
||||||
match "locations/get_locations" => "locations#get_locations"
|
match "locations/get_locations" => "locations#get_locations"
|
||||||
match "locations/get_categories" => "locations#get_categories"
|
match "locations/get_categories" => "locations#get_categories"
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -37,27 +37,27 @@ module Location
|
|||||||
side_bar do
|
side_bar do
|
||||||
head_label_i18n 'location.location',:icon_class=>"icons-location"
|
head_label_i18n 'location.location',:icon_class=>"icons-location"
|
||||||
available_for [:admin,:guest,:manager,:sub_manager]
|
available_for [:admin,:guest,:manager,:sub_manager]
|
||||||
active_for_controllers ({:private=>['locations']})
|
active_for_controllers ({:private=>['locations','location_categories']})
|
||||||
|
|
||||||
head_link_path "panel_location_back_end_locations_path"
|
head_link_path "panel_location_back_end_locations_path"
|
||||||
|
|
||||||
context_link 'location.all_locations',
|
context_link 'location.all_locations',
|
||||||
:link_path=>"panel_location_back_end_locations_path" ,
|
:link_path=>"panel_location_back_end_locations_path" ,
|
||||||
:priority=>1,
|
:priority=>1,
|
||||||
:active_for_action=>{:localtions=>:index},
|
:active_for_action=>{:locations=>:index},
|
||||||
:available_for => [:manager]
|
:available_for => [:manager]
|
||||||
|
|
||||||
context_link 'location.add_location',
|
context_link 'location.add_location',
|
||||||
:link_path=>"new_panel_location_back_end_location_path" ,
|
:link_path=>"new_panel_location_back_end_location_path" ,
|
||||||
:priority=>1,
|
:priority=>1,
|
||||||
:active_for_action=>{:localtions=>:new},
|
:active_for_action=>{:locations=>:new},
|
||||||
:available_for => [:manager]
|
:available_for => [:manager]
|
||||||
|
|
||||||
|
|
||||||
context_link 'location.categories',
|
context_link 'location.categories',
|
||||||
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
|
:link_path=>"panel_location_back_end_location_categories_path" ,
|
||||||
:priority=>1,
|
:priority=>1,
|
||||||
:active_for_action=>{:localtion_categories=>:index},
|
:active_for_category => 'Location',
|
||||||
:available_for => [:manager]
|
:available_for => [:manager]
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
+1
@@ -50,6 +50,7 @@ module Videos
|
|||||||
#* customize_widget_options_fields_i18n({"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}} )
|
#* customize_widget_options_fields_i18n({"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}} )
|
||||||
customize_widget "channel_videos" do
|
customize_widget "channel_videos" do
|
||||||
widget_i18n "videos.widget.channel_videos"
|
widget_i18n "videos.widget.channel_videos"
|
||||||
|
style ["1","2"]
|
||||||
options "channel_videos",:i18n =>"videos.channel_videos",:options_item => {"query"=>"ChannelVideo.all", "value"=>:id, "label"=>:channel_name}
|
options "channel_videos",:i18n =>"videos.channel_videos",:options_item => {"query"=>"ChannelVideo.all", "value"=>:id, "label"=>:channel_name}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user