Compare commits
60
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
316692d1c3 | ||
|
|
6d2043ddaf | ||
|
|
44c93c2dde | ||
|
|
82ffc7c3fd | ||
|
|
91d5ab6352 | ||
|
|
16b695200a | ||
|
|
5e584f7575 | ||
|
|
abb818c154 | ||
|
|
369bbe4d72 | ||
|
|
441e4ef63a | ||
|
|
17dbc747ba | ||
|
|
4888195566 | ||
|
|
a38cf6304e | ||
|
|
20e2f07b26 | ||
|
|
c291f15e23 | ||
|
|
ce8e9c0a5f | ||
|
|
dc5ef21516 | ||
|
|
ea3f9c8163 | ||
|
|
e129b25554 | ||
|
|
7028390248 | ||
|
|
8f3a68b3d7 | ||
|
|
eeb7f72876 | ||
|
|
a49562e341 | ||
|
|
a3d921c47a | ||
|
|
6d5b3a35e9 | ||
|
|
2e5b3e8ef7 | ||
|
|
635f82db2f | ||
|
|
182729a7fe | ||
|
|
a1840c86de | ||
|
|
3d091b692d | ||
|
|
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 |
No files matched your search
@@ -38,8 +38,8 @@ if($.support.touch) {
|
||||
$checked.each(function() {
|
||||
if(!$(this).closest('div').hasClass('togglebox')) {
|
||||
$(this).wrap('<div class="toggle-control"/>');
|
||||
if($(this).attr('type') == "hidden" && $(this).attr('value')) {
|
||||
$(this).wrap('<div class="togglebox disabled" />');
|
||||
if($(this).attr('type') == "hidden" && $(this).attr('value') == 'true') {
|
||||
$(this).wrap('<div class="togglebox disable" />');
|
||||
} else {
|
||||
$(this).wrap('<div class="togglebox" />');
|
||||
}
|
||||
@@ -71,7 +71,6 @@ if($.support.touch) {
|
||||
$(this).parent('.togglebox').removeClass('disable').closest('li').removeClass('disabled');
|
||||
};
|
||||
} else {
|
||||
console.log($(this))
|
||||
if($(this).prop('checked')) {
|
||||
$(this).parent('.togglebox').addClass('disable').closest('li').addClass('disabled');
|
||||
};
|
||||
@@ -541,6 +540,8 @@ function changeStatusHidden() {
|
||||
|
||||
// Document Ready
|
||||
$(function() {
|
||||
showFiltersOnPageRefresh();
|
||||
|
||||
new ini();
|
||||
$('#main-wrap').on('click', '.delete', function() {
|
||||
api.modal($(this).attr('rel'));
|
||||
@@ -589,4 +590,35 @@ $(function() {
|
||||
}
|
||||
formTip()
|
||||
sidebarNav();
|
||||
});
|
||||
});
|
||||
|
||||
var showFiltersOnPageRefresh = function(){
|
||||
var params = getUrlVars(),
|
||||
paramfilter = params['new_filter[type]'];
|
||||
|
||||
// switch (paramfilter){
|
||||
// case "role":
|
||||
// paramfilter = "status";
|
||||
// break;
|
||||
// }
|
||||
|
||||
if( paramfilter ){
|
||||
$( "#filter" ).addClass('open');
|
||||
$( '#filter a[href="#collapse-' + paramfilter + '"]').parent().parent().addClass('active');
|
||||
$( '#filter #collapse-' + paramfilter ).addClass('in');
|
||||
}
|
||||
}
|
||||
|
||||
var getUrlVars = function(){
|
||||
var vars = [], hash;
|
||||
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
||||
for(var i = 0; i < hashes.length; i++){
|
||||
hash = hashes[i].split('=');
|
||||
vars.push(decodeURIComponent(hash[0]));
|
||||
vars[decodeURIComponent(hash[0])] = decodeURIComponent(hash[1]);
|
||||
}
|
||||
if(vars[0] == window.location.href){
|
||||
vars =[];
|
||||
}
|
||||
return vars;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ var banner_index = 0;
|
||||
$(document).ready(function() {
|
||||
$.each($(".dymanic_load"),function(){
|
||||
if($(this).attr("path")==''){
|
||||
$(this).html("App setting Failed");
|
||||
$(this).html("");
|
||||
}else{
|
||||
ajax_load_proc($(this),$(this).attr("path"));
|
||||
}
|
||||
@@ -16,7 +16,7 @@ $(document).ready(function() {
|
||||
function ajax_load_proc(wapper,url,isBanner){
|
||||
$.get(encodeURI(url), {}, function(respText,textSta,XML){
|
||||
if (textSta == 'success') {
|
||||
wapper.html(respText);
|
||||
if (respText.indexOf("<title>") == -1) wapper.html(respText);
|
||||
};
|
||||
if(textSta == 'error')
|
||||
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
|
||||
|
||||
@@ -81,7 +81,7 @@ function customOpenSlide() {
|
||||
} else {
|
||||
$('#pageslide form').prop('method', 'post')
|
||||
};
|
||||
_type == 'page' ? pageSetting(element.data('id'), _edit) : linkSetting(element.data('id'), _edit, pageslide);
|
||||
_type == 'page' ? pageSetting(element.data('id'), _edit, pageslide) : linkSetting(element.data('id'), _edit, pageslide);
|
||||
}
|
||||
});
|
||||
$iFrame.pageslide({
|
||||
@@ -111,31 +111,32 @@ function customOpenSlide() {
|
||||
.closest('.navbar-inner')
|
||||
.addClass('active');
|
||||
pageslide.find('.content').css('padding', 0);
|
||||
iFrameContent()
|
||||
// iFrameContent()
|
||||
}
|
||||
});
|
||||
}
|
||||
function iFrameContent() {
|
||||
function iFrameFunction(iContents, pc) {
|
||||
pc.each(function(index, el) {
|
||||
if($(this).siblings('*').length == 0) {
|
||||
var _parentH = $(this).parent('*').outerHeight();
|
||||
$(this).css('height', _parentH);
|
||||
}
|
||||
});
|
||||
iContents.find('#orbit-bar').hide();
|
||||
iContents.find('.main_wrap').css('margin-top', 0);
|
||||
iContents.find('a').not('.edit_link a').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
}).css('cursor', 'default');
|
||||
}
|
||||
$('#pageslide_iframe').load(function() {
|
||||
var $iContents = $(this).contents(),
|
||||
$pc = $iContents.find('.page_content');
|
||||
$(this).get(0).contentWindow.externalFunction(iFrameFunction, $iContents, $pc);
|
||||
});
|
||||
}
|
||||
function pageSetting(id, edit) {
|
||||
// function iFrameContent() {
|
||||
// function iFrameFunction(iContents, pc) {
|
||||
// pc.each(function(index, el) {
|
||||
// if($(this).siblings('*').length == 0) {
|
||||
// var _parentH = $(this).parent('*').outerHeight();
|
||||
// $(this).css('min-height', _parentH);
|
||||
// }
|
||||
// });
|
||||
// iContents.find('#orbit-bar').hide();
|
||||
// iContents.find('.main_wrap').css('margin-top', 0);
|
||||
// iContents.find('a').not('.edit_link a').on('click', function(event) {
|
||||
// event.preventDefault();
|
||||
// }).css('cursor', 'default');
|
||||
// }
|
||||
// $('#pageslide_iframe').load(function() {
|
||||
// var $iContents = $(this).contents(),
|
||||
// $pc = $iContents.find('.page_content');
|
||||
// iFrameFunction($iContents, $pc);
|
||||
// });
|
||||
// }
|
||||
|
||||
function pageSetting(id, edit, ps) {
|
||||
$pageModule = $('#pageslide #page_module_app_id');
|
||||
$pageF2E = $('#pageslide #page_app_frontend_url');
|
||||
$pageDivF2E = $('#pageslide #front_url');
|
||||
@@ -183,23 +184,29 @@ function pageSetting(id, edit) {
|
||||
|
||||
if(val.category.length > 0) {
|
||||
$.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>');
|
||||
if(!_selectData.module.category[0] && _arr !== -1) {
|
||||
if(_arr !== -1) {
|
||||
$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();
|
||||
}
|
||||
if(val.tags.length > 0) {
|
||||
$.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>');
|
||||
if(!_selectData.module.tags[0] && _arr !== -1) {
|
||||
if(_arr !== -1) {
|
||||
$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();
|
||||
}
|
||||
@@ -394,36 +401,44 @@ $(function() {
|
||||
|
||||
if(event.target.id == 'page_module_app_id') {
|
||||
$pageCategory.empty();
|
||||
var $hiddenInputA = $pageCategory.siblings('input[type="hidden"]');
|
||||
if(val.category.length > 0) {
|
||||
$.each(val.category, function(index, val) {
|
||||
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>');
|
||||
if(_select && !_select.category[0] && _arr !== -1) {
|
||||
if(_boolean && _arr !== -1) {
|
||||
$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 {
|
||||
$pageCategoryGroup.hide();
|
||||
$pageCategoryGroup.slideUp(300);
|
||||
$hiddenInputA.removeAttr('name');
|
||||
}
|
||||
$pageTags.empty();
|
||||
var $hiddenInputB = $pageTags.siblings('input[type="hidden"]');
|
||||
if(val.tags.length > 0) {
|
||||
$.each(val.tags, function(index, val) {
|
||||
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>');
|
||||
if(_select && !_select.tags[0] && _arr !== -1) {
|
||||
if(_boolean && _arr !== -1) {
|
||||
$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 {
|
||||
$pageTagsGroup.hide();
|
||||
$pageTagsGroup.slideUp(300);
|
||||
$hiddenInputB.removeAttr('name');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -451,12 +466,18 @@ $(function() {
|
||||
|
||||
$('#pageslide').on('change', '.checkbox-groups input', function(event) {
|
||||
var $checked = $(this);
|
||||
|
||||
if($checked.attr('type') == 'checkbox') {
|
||||
if($checked.hasClass('select_all') && $checked.prop('checked')) {
|
||||
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
|
||||
} else if($checked.prop('checked') && !$checked.hasClass('lang-enable')) {
|
||||
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
|
||||
} else {
|
||||
if($checked.hasClass('select_all')) {
|
||||
if($checked.prop('checked')) {
|
||||
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', true);
|
||||
$checked.closest('.checkbox').siblings('input[type="hidden"]').removeAttr('name');
|
||||
} 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')) {
|
||||
$checked.closest('.active-link').addClass('active').siblings('active-link').removeClass('active').end().find('.active-mune').slideDown(300);
|
||||
if(_status) {
|
||||
@@ -470,6 +491,15 @@ $(function() {
|
||||
$(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;
|
||||
} else if($checked.attr('type') == 'radio' && !$(this).closest('div').hasClass('active-mune')) {
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
$(function() {
|
||||
// for toggle-check
|
||||
$('.role_filter_checked').on({
|
||||
change: function() {
|
||||
var _path = $(this).data('path');
|
||||
// var path = <%= @path %>
|
||||
$.ajax({
|
||||
url: _path,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {remote: true},
|
||||
})
|
||||
.done(function() {})
|
||||
.fail(function() {})
|
||||
.always(function() {});
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -222,7 +222,7 @@ $(function() {
|
||||
});
|
||||
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
||||
if($(this).hasClass('togglebox')) {
|
||||
if($(this).hasClass('disabled')) {
|
||||
if($(this).hasClass('disable')) {
|
||||
$(this).find('.toggle-check')
|
||||
.attr('value', 'false')
|
||||
.closest('.attributes')
|
||||
@@ -237,7 +237,7 @@ $(function() {
|
||||
.children('.attributes-body')
|
||||
.fadeOut(300);
|
||||
}
|
||||
$(this).toggleClass('disabled');
|
||||
$(this).toggleClass('disable');
|
||||
};
|
||||
if($(this).hasClass('remove-input')) {
|
||||
$(this).closest('.input-append').fadeOut(300, function() {
|
||||
@@ -382,7 +382,7 @@ $(function() {
|
||||
});
|
||||
$('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
|
||||
if($(this).hasClass('togglebox')) {
|
||||
if($(this).hasClass('disabled')) {
|
||||
if($(this).hasClass('disable')) {
|
||||
$(this).find('.toggle-check')
|
||||
.attr('value', 'false')
|
||||
.closest('.attributes')
|
||||
@@ -411,7 +411,7 @@ $(function() {
|
||||
$(this).parent('.field-type').removeClass('in');
|
||||
});
|
||||
}
|
||||
$(this).toggleClass('disabled');
|
||||
$(this).toggleClass('disable');
|
||||
};
|
||||
if($(this).hasClass('delete')) {
|
||||
$(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() {
|
||||
// $(".post_preview").click(function(e){
|
||||
// $("#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) {
|
||||
$(".post_preview").click(function(){
|
||||
$("#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')) {
|
||||
$.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;
|
||||
}
|
||||
},'script');
|
||||
});
|
||||
// $("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>");
|
||||
// $.ajax({
|
||||
// type: 'PUT',
|
||||
// url:$(this).attr("href"),
|
||||
// data:$(this).parents("form").serialize(),
|
||||
// success: function (msg) {
|
||||
// $("#"+start_modal_with_id).modal('show'); },
|
||||
// error: function(){
|
||||
// alert("ERROR");
|
||||
// if($(this).hasClass('post_preview')) {
|
||||
// var attrs = e.target.attributes;
|
||||
// var url = attrs['url'];
|
||||
// $("form.previewable").ajaxSubmit({
|
||||
// beforeSubmit: function(a,f,o){
|
||||
// o.dataType = 'script';
|
||||
// o.url = url.nodeValue;
|
||||
// o.type = 'post';
|
||||
// },success: function(msg) {
|
||||
// $('#show_preview .modal').modal()
|
||||
// $('#show_preview .modal').height(function() {
|
||||
// return $(window).height() * 0.7;
|
||||
// });
|
||||
// }
|
||||
|
||||
// });
|
||||
// } else if($(this).hasClass('preview_trigger')) {
|
||||
// $.ajax({
|
||||
// type: 'PUT',
|
||||
// url: $(this).attr("href"),
|
||||
// data: $(this).parents("form").serialize(),
|
||||
// success: function (msg) {
|
||||
// $('#show_preview .modal').modal();
|
||||
// $('#show_preview .modal').height(function() {
|
||||
// return $(window).height() * 0.7;
|
||||
// });
|
||||
// },
|
||||
// error: function(){
|
||||
// alert("ERROR");
|
||||
// }
|
||||
// });
|
||||
// return false;
|
||||
// });
|
||||
// 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(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({
|
||||
change: function() {
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
//= require lib/all-list
|
||||
//= require lib/jquery.fastLiveFilter.js
|
||||
//= require lib/checkbox.card.js
|
||||
//= require lib/jquery.form.js
|
||||
//= require lib/jquery.form.js
|
||||
//= require lib/member/member-role.js
|
||||
@@ -4,7 +4,7 @@
|
||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||
// the compiled file.
|
||||
//
|
||||
//= require jquery
|
||||
//= require mobile/jquery-1.7.1
|
||||
//= require lib/jquery.preload.min.js
|
||||
//= require cycle2
|
||||
//= require mobile/jquery.mu.image.resize
|
||||
|
||||
+9266
File diff suppressed because it is too large.
Load diff
@@ -24,10 +24,10 @@ $('#index').live('pageinit',function(){
|
||||
});
|
||||
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
||||
$(this).find(".newpic img").muImageResize({width: 280, height: 200});
|
||||
$('.slideshow').cycle({
|
||||
fx: $effect,
|
||||
timeout: $timeout
|
||||
});
|
||||
// $('.slideshow').cycle({
|
||||
// fx: $effect,
|
||||
// timeout: $timeout
|
||||
// });
|
||||
$(".newlist").css({
|
||||
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
||||
})
|
||||
@@ -113,10 +113,10 @@ $(window).bind("orientationchange", function(){
|
||||
});
|
||||
|
||||
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
|
||||
$('.slideshow').cycle({
|
||||
fx: $effect,
|
||||
timeout: $timeout
|
||||
});
|
||||
// $('.slideshow').cycle({
|
||||
// fx: $effect,
|
||||
// timeout: $timeout
|
||||
// });
|
||||
|
||||
$(".newlist").css({
|
||||
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
|
||||
|
||||
@@ -171,12 +171,19 @@ div[data-role="page"] {
|
||||
float: left;
|
||||
width: 280px;
|
||||
min-height: 490px;
|
||||
max-height: 490px;
|
||||
/*max-height: 490px;*/
|
||||
background-color: #FFFFFF;
|
||||
padding: 10px;
|
||||
margin: 0 10px 10px 0;
|
||||
box-shadow: 0px 3px 5px rgba(0,0,0,.1);
|
||||
}
|
||||
.content .orbit-cycle-slideshow {
|
||||
height: 300px;
|
||||
}
|
||||
.content .orbit-cycle-slideshow img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
#index .content .newpic {
|
||||
width: 280px;
|
||||
height: 200px;
|
||||
|
||||
@@ -40,8 +40,18 @@ class Admin::ItemsController < OrbitBackendController
|
||||
m["main"] = [module_app.label, module_app.id.to_s]
|
||||
m["sub"] = module_app.app_pages.map{|name, data| [t(data["i18n"]), name]} rescue []
|
||||
m["sub"] << [I18n.t('default_widget.default_widget'),'default_widget'] if module_app.has_default_widget?
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
|
||||
if module_app.key == 'member'
|
||||
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
elsif module_app.key == 'member_staff'
|
||||
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
else
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
end
|
||||
|
||||
m["count"] = module_app.get_registration.get_data_count.to_a
|
||||
module_apps << m
|
||||
end
|
||||
|
||||
@@ -23,7 +23,9 @@ class Admin::PagePartsController < OrbitBackendController
|
||||
@class_options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
|
||||
@partial = 'default_widget'
|
||||
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?
|
||||
end
|
||||
end
|
||||
@@ -61,8 +63,19 @@ class Admin::PagePartsController < OrbitBackendController
|
||||
m = {}
|
||||
m["main"] = [module_app.label, module_app.id.to_s]
|
||||
m["sub"] = module_app.widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
|
||||
|
||||
if module_app.key == 'member'
|
||||
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
elsif module_app.key == 'member_staff'
|
||||
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
else
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
end
|
||||
|
||||
m["count"] = module_app.get_registration.get_data_count.to_a
|
||||
module_apps << m
|
||||
end
|
||||
@@ -95,9 +108,7 @@ class Admin::PagePartsController < OrbitBackendController
|
||||
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
|
||||
flash.now[:notice] = t('update.success.content')
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_page_url(@part.page, edit: true)
|
||||
}
|
||||
format.js
|
||||
end
|
||||
else
|
||||
@id = params[:id]
|
||||
|
||||
@@ -21,6 +21,16 @@ class Admin::PagesController < Admin::ItemsController
|
||||
end
|
||||
|
||||
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])
|
||||
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 )
|
||||
@@ -60,8 +70,8 @@ class Admin::PagesController < Admin::ItemsController
|
||||
m = {}
|
||||
m["main"] = page.module_app_id.to_s
|
||||
m["sub"] = page.app_frontend_url
|
||||
m["category"] = page.category.present? ? [0, page.category.map{|c| c.to_s}] : [1]
|
||||
m["tags"] = page.tag.present? ? [0, page.tag.map{|c| c.to_s}] : [1]
|
||||
m["category"] = page.category.present? ? page.category.map{|c| c.to_s} : []
|
||||
m["tags"] = page.tag.present? ? page.tag.map{|c| c.to_s} : []
|
||||
m["public"] = page.is_published ? 1 : 0
|
||||
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]
|
||||
|
||||
@@ -238,7 +238,7 @@ class ApplicationController < ActionController::Base
|
||||
redirect_to ret
|
||||
end
|
||||
|
||||
def get_sorted_and_filtered(object_class, query = nil, objects = nil)
|
||||
def get_sorted_and_filtered(object_class, query = nil, objects = nil, pagination = true)
|
||||
if params[:filter] || params[:sort] || params[:new_filter]
|
||||
@filter = params[:filter]
|
||||
new_filter = params[:new_filter]
|
||||
@@ -346,7 +346,11 @@ class ApplicationController < ActionController::Base
|
||||
objects = get_bulletins_for_open_backend(objects)
|
||||
end
|
||||
|
||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||
if pagination
|
||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||
else
|
||||
filter_authorized_objects(objects)
|
||||
end
|
||||
end
|
||||
|
||||
def get_bulletins_for_open_backend(objects)
|
||||
|
||||
@@ -40,6 +40,7 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
|
||||
def default_widget
|
||||
@search = params["search_query"].blank? ? false : true
|
||||
|
||||
if !params[:id].blank? and !params["clicked_field_name"].blank?
|
||||
clicked_field_name = params["clicked_field_name"].to_sym
|
||||
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||
@@ -69,7 +70,10 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
||||
end
|
||||
|
||||
if @paginate || @search
|
||||
if params[:filter_category_id] and !params[:filter_category_id].blank?
|
||||
@data = get_filter_data.page(params[:page_main]).per(@data_limit)
|
||||
|
||||
elsif @paginate || @search
|
||||
if @search
|
||||
@data = search_result.page(params[:page_main]).per(@data_limit) rescue []
|
||||
else #regular listing
|
||||
@@ -93,6 +97,18 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def get_filter_data
|
||||
model = @default_widget["query"].classify.constantize
|
||||
if params[:filter_category_id].is_a? Array
|
||||
data = model.where(:category_id.in => params[:filter_category_id])
|
||||
elsif params[:filter_category_id].is_a? String
|
||||
data = model.where(:category_id => params[:filter_category_id])
|
||||
end
|
||||
data.available_for_lang(I18n.locale).can_display.desc(:is_top, :postdate)
|
||||
end
|
||||
|
||||
|
||||
|
||||
def get_category_field_name
|
||||
@ori_class_name = @ori_class_name.constantize
|
||||
|
||||
@@ -344,7 +344,7 @@ class DesktopController< ApplicationController
|
||||
|
||||
def check_desktop_open
|
||||
@site = Site.first
|
||||
if @site.desktop_closed #Need to be change
|
||||
if !@site.desktop_closed #Need to be change
|
||||
redirect_to '/admin/dashboards'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ class MobileController < ApplicationController
|
||||
def index
|
||||
date_now = Time.now
|
||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page(params[:page_main]).per(15)
|
||||
@ad_banner = AdBanner.where(title: "Banner")[0]
|
||||
@ad_banner = AdBanner.find(:all, :conditions => {:title => /Home/i})[0]
|
||||
end
|
||||
|
||||
def announcement
|
||||
|
||||
@@ -14,7 +14,7 @@ class OrbitBackendController < ApplicationController
|
||||
status << 'is_top'
|
||||
status << 'is_hot'
|
||||
status << 'is_hidden' unless is_guest?
|
||||
if @module_app.is_approvable && is_manager?
|
||||
if @module_app.is_approvable && (is_manager? || is_sub_manager?)
|
||||
status << 'is_pending'
|
||||
status << 'is_checked'
|
||||
status << 'is_rejected'
|
||||
|
||||
@@ -14,7 +14,7 @@ class OrbitMemberController < ApplicationController
|
||||
status << 'is_top'
|
||||
status << 'is_hot'
|
||||
status << 'is_hidden' unless is_guest?
|
||||
if @module_app.is_approvable && is_manager?
|
||||
if @module_app.is_approvable && (is_manager? || is_sub_manager?)
|
||||
status << 'is_pending'
|
||||
status << 'is_checked'
|
||||
status << 'is_rejected'
|
||||
|
||||
@@ -64,23 +64,25 @@ class PagesController < ApplicationController
|
||||
url = "/#{@item.path}"
|
||||
options = ''
|
||||
options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}click=#{params[:click]}" unless params[:click].blank?
|
||||
# options << "#{options.blank? ? '?' : '&'}part_id=#{params[:page_part_id]}" unless params[:page_part_id].blank?
|
||||
|
||||
if params[:category_id].is_a? Array
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('category_id',params[:category_id])}" unless params[:category_id].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('filter_category_id',params[:category_id])}" unless params[:category_id].blank?
|
||||
elsif params[:category_id].is_a? String
|
||||
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}filter_category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
||||
end
|
||||
|
||||
if params[:tag_id].is_a? Array
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('filter_tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
||||
elsif params[:category_id].is_a? String
|
||||
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}filter_tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
||||
end
|
||||
|
||||
|
||||
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank?
|
||||
uri = URI::escape(url + options)
|
||||
# uri = URI::escape(url + options)
|
||||
uri = url + options
|
||||
#uri = URI::escape("#{url}?" + params.collect{|k,v| "#{k}=#{v}"}.join('&'))
|
||||
redirect_to(uri)unless save_from_no_lang_for_page
|
||||
end
|
||||
@@ -94,6 +96,7 @@ class PagesController < ApplicationController
|
||||
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}image_id=#{params[:image_id]}" unless params[:image_id].blank?
|
||||
redirect_to(url + options) unless save_from_no_lang_for_page
|
||||
end
|
||||
|
||||
@@ -105,26 +108,93 @@ class PagesController < ApplicationController
|
||||
protected
|
||||
|
||||
def get_item
|
||||
# if params[:page_id]
|
||||
# @item = Item.find(params[:page_id])
|
||||
# elsif params[:same_page_id]
|
||||
# @item = Item.find(params[:same_page_id])
|
||||
# else
|
||||
# category_ids = Array(params[:category_id]) unless params[:category_id].nil?
|
||||
# tag_ids = Array(params[:tag_id]) unless params[:tag_id].nil?
|
||||
# module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
|
||||
# default_query = { is_published: true, module_app_id: module_app.id, :app_frontend_url.in => [params[:app_action], 'default_widget'] }
|
||||
# specific_categories = { :category => category_ids }
|
||||
# in_categories = { :category.in => category_ids }
|
||||
# nil_categories = { :category.in => [nil, []] }
|
||||
# specific_tags = { :tag => tag_ids }
|
||||
# in_tags = { :tag.in => tag_ids }
|
||||
# nil_tags = { :tag.in => [nil, []] }
|
||||
|
||||
# if !category_ids.blank? && !tag_ids.blank?
|
||||
# @item = Item.where(default_query.merge(specific_categories).merge(specific_tags)).first
|
||||
# @item = Item.where(default_query.merge(specific_categories).merge(in_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(specific_tags).merge(in_categories)).first unless @item
|
||||
# @item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_categories).merge(in_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
||||
# elsif !category_ids.blank?
|
||||
# @item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first
|
||||
# @item = Item.where(default_query.merge(specific_categories)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_categories)).first unless @item
|
||||
# elsif !tag_ids.blank?
|
||||
# @item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first
|
||||
# @item = Item.where(default_query.merge(specific_tags)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
||||
# @item = Item.where(default_query.merge(in_tags)).first unless @item
|
||||
# end
|
||||
# @item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||
# @item = Item.where(default_query.merge(nil_categories).merge(nil_tags)).first unless @item
|
||||
# @item = Item.where(default_query).first unless @item
|
||||
# end
|
||||
# raise PageError, 'Missing Frontend Page' if @item.nil?
|
||||
|
||||
# if params[:page_id]
|
||||
# @item = Item.find(params[:page_id])
|
||||
# elsif params[:same_page_id]
|
||||
# @item = Item.find(params[:same_page_id])
|
||||
# else
|
||||
# category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
||||
# tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
||||
# module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
# if !category_ids.blank? && !tag_ids.blank?
|
||||
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => tag_ids})
|
||||
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => [nil, []]}) unless @item
|
||||
# elsif !category_ids.blank?
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :category.in => category_ids).any_in(tag: [nil, []]).first
|
||||
# elsif !tag_ids.blank?
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :tag.in => tag_ids).any_in(category: [nil, []]).first
|
||||
# end
|
||||
# @item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil, []]},"category" => { "$in" => [nil, []]}).first unless @item
|
||||
# # @item = Item.root.children.where(:module_app_id => module_app.id).first
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
||||
# @item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
||||
# end
|
||||
# raise PageError,'Missing Frontend Page' if @item.nil?
|
||||
|
||||
if params[:page_id]
|
||||
@item = Item.find(params[:page_id])
|
||||
elsif params[:same_page_id]
|
||||
@item = Item.find(params[:same_page_id])
|
||||
else
|
||||
category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
||||
tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
if !category_ids.blank? && !tag_ids.blank?
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => tag_ids})
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => [nil, []]}) unless @item
|
||||
elsif !category_ids.blank?
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :category.in => category_ids).any_in(tag: [nil, []]).first
|
||||
elsif !tag_ids.blank?
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :tag.in => tag_ids).any_in(category: [nil, []]).first
|
||||
category_ids = params[:category_id] ? (params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]) : []
|
||||
tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
||||
|
||||
if !category_ids.blank?
|
||||
@item = Item.where(:category => category_ids).first
|
||||
else
|
||||
if params[:action] && params[:action] == "show_from_link"
|
||||
model = params[:app_action].classify.constantize
|
||||
item = model.find(params[:id])
|
||||
@item = Item.where(:category => [item.category_id.to_s]).first
|
||||
end
|
||||
end
|
||||
@item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil, []]},"category" => { "$in" => [nil, []]}).first unless @item
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
||||
|
||||
@item = Item.root.children.where(:module_app_id => module_app.id).first unless @item
|
||||
end
|
||||
raise PageError,'Missing Frontend Page' if @item.nil?
|
||||
end
|
||||
|
||||
@@ -12,13 +12,13 @@ module OrbitBackendHelper
|
||||
|
||||
def show_form_status_field(object)
|
||||
#by_object = (!object.is_expired? and object.is_pending?)
|
||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin?)
|
||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
||||
by_user
|
||||
end
|
||||
|
||||
def show_approval_link(object)
|
||||
by_object = (!object.is_expired? and object.is_pending?)
|
||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin?)
|
||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
||||
by_object and by_user
|
||||
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
|
||||
@@ -3,6 +3,8 @@ class RoleCategory < RoleFilter
|
||||
has_and_belongs_to_many :users
|
||||
belongs_to :role
|
||||
|
||||
scope :can_display,where(disable: false)
|
||||
|
||||
def self.get_role_data(role_key)
|
||||
|
||||
@role = Role.where(:key =>role_key).first
|
||||
|
||||
@@ -186,20 +186,21 @@ class User
|
||||
}.uniq!
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_field_name(role_type,field_key)
|
||||
def self.get_member_list_attribute_field(role_type,field_key)
|
||||
@attribute = ::Attribute.where(:key => role_type).first
|
||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first.title
|
||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_value(user_id,role_type,field_key)
|
||||
@attribute = ::Attribute.where(:key => role_type).first
|
||||
@AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first
|
||||
def self.get_member_list_attribute_value(user_id,field_id)
|
||||
# @attribute = ::Attribute.where(:key => role_type).first
|
||||
# @AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
return ::AttributeValue.where(attribute_field_id: field_id, :user_id => user_id).first
|
||||
end
|
||||
|
||||
def self.get_role_member_data_by_sort(role_status_id)
|
||||
def self.get_role_member_data_by_sort(role, field_key, role_status_id)
|
||||
a = Array.new
|
||||
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,"staff","job_title")['val'].to_i, t ] }
|
||||
attribute_field_data = get_member_list_attribute_field(role,field_key)
|
||||
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,attribute_field_data.id)['val'].to_i, t ] }
|
||||
member_data = a.sort
|
||||
member_data_tmp = member_data.collect {|v| v[1] }
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<td class="action span3">
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= attribute.disabled ? 'disabled' : '' %>">
|
||||
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@attribute_type}_toggle_path(attribute)"), method: :post, remote: true, class: "switch" %>
|
||||
<%= check_box_tag 'accept', attribute.disabled ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@attribute_type}_toggle_path(attribute)")}, :checked=> attribute.disabled} %>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
$("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
||||
// $("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
||||
location.reload();
|
||||
$.pageslide.close();
|
||||
openSlide();
|
||||
@@ -28,20 +28,22 @@
|
||||
<%= select_tag "page[app_frontend_url]", nil, class: "input-xlarge change" %>
|
||||
</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) %>
|
||||
<%= content_tag :label, class: "checkbox" do %>
|
||||
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||
<% end %>
|
||||
<div class="groups" id="page-category"></div>
|
||||
<input type="hidden">
|
||||
</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) %>
|
||||
<%= content_tag :label, class: "checkbox" do %>
|
||||
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||
<% end %>
|
||||
<div class="groups" id="page-tags"></div>
|
||||
<input type="hidden">
|
||||
</div>
|
||||
|
||||
<div class="display-mode"></div>
|
||||
|
||||
@@ -16,8 +16,9 @@
|
||||
<% else %>
|
||||
<%= link_to node.title, node.url %>
|
||||
<% end %>
|
||||
|
||||
<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") %>
|
||||
<%= 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") %>
|
||||
|
||||
@@ -3,4 +3,25 @@
|
||||
<div class="controls">
|
||||
<%= select 'page_part', 'widget_style', @frontend_styles, {:selected => (@part && @part[:widget_style])}, class: "input-xlarge" %>
|
||||
</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>
|
||||
@@ -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 %>
|
||||
<%= javascript_include_tag "lib/items/page_part" %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @part, url: admin_page_part_path(@part), html: { class: "form-horizontal main-forms"} do |f| %>
|
||||
<%= form_for @part, url: {action: "update"}, :remote=>true, html: { class: "form-horizontal main-forms"} do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<label href="#none" class="btn btn-large" data-toggle="tab">
|
||||
@@ -81,7 +80,7 @@
|
||||
<div class="control-group input-content">
|
||||
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}", class: "control-label muted" %>
|
||||
<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>
|
||||
<% end %>
|
||||
@@ -102,13 +101,13 @@
|
||||
<%= f.label :categories, t(:categories), class: "control-label muted" %>
|
||||
<div class="controls">
|
||||
<%= 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 %>
|
||||
<div class="groups" id="page-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 %>
|
||||
<% end if @module_app_tags %>
|
||||
<% end if @module_app_categories %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -120,7 +119,7 @@
|
||||
<% end %>
|
||||
<div class="groups" id="page-tags">
|
||||
<%= 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 %>
|
||||
<% end if @module_app_tags %>
|
||||
</div>
|
||||
@@ -161,3 +160,10 @@
|
||||
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + "&id=" + "<%= @part.id %>" );
|
||||
});
|
||||
</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) %>"
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
<tr id="<%= dom_id role_filter %>" class="<% role_filter.disable ? 'disable' : '' %>">
|
||||
<tr id="<%= dom_id role_filter %>" class="<%= role_filter.disable ? 'disable' : '' %>">
|
||||
<td><span class="label label-info"><%= role_filter.key %></span></td>
|
||||
<% if @types.is_localized?(:title) %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
@@ -18,15 +18,7 @@
|
||||
<td><%= role_filter.title %></td>
|
||||
<% end %>
|
||||
|
||||
<td class="action">
|
||||
<%#= link_to role_filter.disable ? t(:disable) : t(:enable), polymorphic_path([:admin, role_filter]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"btn btn-mini btn-success", :type=>"button" %>
|
||||
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= role_filter.disable ? 'disabled' : '' %>">
|
||||
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)"), method: :post, remote: true, class: "switch" %>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<td class="action dsrgsdgsdg">
|
||||
<%= check_box_tag 'accept', role_filter.disable ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)")}, :checked=> role_filter.disable} %>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
@@ -9,14 +10,6 @@
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), eval("new_admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_path(:role_id=>params[:role_id])"), class: "btn btn-primary open-slide" %>
|
||||
@@ -27,4 +20,4 @@
|
||||
<%= render 'index' %>
|
||||
</div>
|
||||
|
||||
|
||||
<% @path = "/admin/#{@app_type == 'role_category' ? 'role_categorys' : @app_type }/" %>
|
||||
@@ -1,3 +1,4 @@
|
||||
$("#role_filters_index").html("<%= j render 'index' %>")
|
||||
// $("#role_filters_index").html("<%= j render 'index' %>")
|
||||
location.reload();
|
||||
$.pageslide.close();
|
||||
openSlide();
|
||||
@@ -2,7 +2,6 @@
|
||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
@@ -10,13 +9,6 @@
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
|
||||
<li class="active"><%= @attribute.title %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary open-slide"%>
|
||||
|
||||
@@ -5,12 +5,7 @@
|
||||
|
||||
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
|
||||
<div class="attributes-header clearfix">
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= role_disable ? 'disabled' : '' %>">
|
||||
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
|
||||
<h4><%= role.title %><%= t(:role_info)%></h4>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<%=render :partial=>"role",:collection=>Role.all.asc("_id")%>
|
||||
<%=render :partial=>"role",:collection=>Role.where(:disabled=>false).asc("_id")%>
|
||||
@@ -24,12 +24,12 @@
|
||||
<ul class="nav nav-pills filter-nav pull-right">
|
||||
<li class="accordion-group">
|
||||
<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>
|
||||
</li>
|
||||
</ul>
|
||||
<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"%>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<ul class="nav nav-pills filter-nav pull-right">
|
||||
<li class="accordion-group">
|
||||
<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>
|
||||
</li>
|
||||
</ul>
|
||||
<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"%>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<ul class="nav nav-pills filter-nav pull-right">
|
||||
<li class="accordion-group">
|
||||
<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>
|
||||
</li>
|
||||
</ul>
|
||||
<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"%>
|
||||
|
||||
|
||||
@@ -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 id="signin-header">
|
||||
<h3><%= t(:forgot_password) %></h3>
|
||||
</div>
|
||||
<div id="container" class="sign-in">
|
||||
<%= form_for :user, :url => user_password_path, :html => {:class => 'user_new form-horizontal'} do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
<div class="content">
|
||||
<div class="main">
|
||||
<div class="control-group clear">
|
||||
<%= f.label :email %>
|
||||
<%= f.email_field :email, :placeholder => t(:email), :style => "width: 330px;" %>
|
||||
<span class="help-inline">Please correct the error</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions clear">
|
||||
<%= content_tag :button, "Send me reset password instructions", :type => :submit, :class => 'btn btn-primary pull-right' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form">
|
||||
<h3 class="login-logo">Reset Your Password</h3>
|
||||
<div>
|
||||
<input name="utf8" type="hidden" value="" />
|
||||
<input name="authenticity_token" type="hidden" value="" />
|
||||
</div>
|
||||
<!-- <div class="other-sign-in">
|
||||
<a class="btn btn-primary" type="submit">Other Sign In</a>
|
||||
<p>or</p>
|
||||
</div> -->
|
||||
<div class="form-block">
|
||||
<div class="form-list clearfix">
|
||||
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
||||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :class => 'user_new form-horizontal' }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div class="control-group clear">
|
||||
<label for="user_email">
|
||||
<i class="icons-mail "></i>
|
||||
</label>
|
||||
<%= 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">
|
||||
<div class="sign-in have-other-sign-in">
|
||||
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
|
||||
@@ -35,25 +33,22 @@
|
||||
</label>
|
||||
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
|
||||
</div>
|
||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||
</form>
|
||||
|
||||
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
|
||||
<div class="control-group clear">
|
||||
<label for="user_email">
|
||||
<i class="icon-user"></i>
|
||||
</label>
|
||||
<input type="text" id="user_id" name="user[id]" placeholder="帳號" />
|
||||
</div>
|
||||
<div class="control-group clear">
|
||||
<label for="user_password">
|
||||
<i class="icons-mail"></i>
|
||||
</label>
|
||||
<input type="text" id="user_email" name="user[email]" placeholder="電子郵件" />
|
||||
</div>
|
||||
<br/>
|
||||
<label class="checkbox">
|
||||
<% if devise_mapping.rememberable? -%>
|
||||
<%= f.check_box :remember_me %> <small><%= f.label :remember_me %></small>
|
||||
<% end -%>
|
||||
</label>
|
||||
|
||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<%= link_to content_tag(:small, t(:forgot_password)), new_user_password_path %>
|
||||
</div>
|
||||
<br/>
|
||||
<!-- <div class="register">
|
||||
<button class="btn btn-inverse" type="submit">Register</button>
|
||||
</div> -->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<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| %>
|
||||
<% 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?}" %>
|
||||
@@ -17,6 +17,12 @@
|
||||
<% end %>
|
||||
$.preload(a, 2, function(){
|
||||
$('.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{
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
<% if @menu_page && @menu_page.visible_children.size > 0 %>
|
||||
<% if @menu_page %>
|
||||
<div class='category_list'>
|
||||
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
|
||||
<ul class='list'>
|
||||
|
||||
<% @menu_page.visible_children.each do |child| %>
|
||||
<% if @menu_page.visible_children.nil?%>
|
||||
<p>Test</p>
|
||||
<li class="<%= @page_id.eql?(child.parent.id) ? 'active' : nil %>">
|
||||
<a href="<%= (child.parent.class.to_s.eql?('Page') ? '/' + child.parent.path : child.parent.url) %>"><%= child.parent.title %></a>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
|
||||
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -33,7 +33,7 @@
|
||||
<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-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>
|
||||
<% end %>
|
||||
<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) %>
|
||||
</div>
|
||||
<div class="pull-left" style="width: 150px;">
|
||||
<!-- <label class="checkbox">
|
||||
<input type="checkbox" value="">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="user[remember_me]" value="1" checked="checked" />
|
||||
<small>Remember me</small>
|
||||
</label> -->
|
||||
</label>
|
||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
|
||||
@@ -24,8 +24,16 @@
|
||||
<div class="wrap-inner">
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<% if !@role.blank? %>
|
||||
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
|
||||
<% elsif !@attribute.blank? %>
|
||||
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
|
||||
<li class="active"><%= @attribute.title %></a></li>
|
||||
<% else %>
|
||||
<li><a href="<%= admin_users_new_interface_index_path %>">Member</a> <span class="divider">/</span></li>
|
||||
<li class="active">All</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= yield :right_nav %>
|
||||
</div>
|
||||
|
||||
@@ -13,13 +13,21 @@
|
||||
<div>
|
||||
<script type="text/javascript" src="/assets/kernel.js"></script>
|
||||
<script type="text/javascript">
|
||||
var preview_img;
|
||||
|
||||
$(function() {
|
||||
$("iframe").load(function() {
|
||||
// Get the body element
|
||||
var frameBody = $("iframe").contents().find('body');
|
||||
// Get all links inside the BODY tag
|
||||
$("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){
|
||||
//Disable all default actions
|
||||
e.preventDefault();
|
||||
@@ -30,6 +38,14 @@
|
||||
$("#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>
|
||||
</div>
|
||||
</div>
|
||||
@@ -15,7 +15,7 @@ Orbit::Application.configure do
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# 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
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
Devise.setup do |config|
|
||||
# ==> Mailer Configuration
|
||||
# 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.
|
||||
# config.mailer = "Devise::Mailer"
|
||||
config.mailer = "Devise::Mailer"
|
||||
|
||||
# ==> ORM configuration
|
||||
# Load and configure the ORM. Supports :active_record (default) and
|
||||
@@ -61,7 +61,7 @@ Devise.setup do |config|
|
||||
|
||||
# ==> Configuration for :rememberable
|
||||
# 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.
|
||||
# config.remember_across_browsers = true
|
||||
|
||||
+3
-3
@@ -8,13 +8,13 @@ defaults: &defaults
|
||||
|
||||
development:
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
database: orbit_site_new
|
||||
|
||||
|
||||
|
||||
test:
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
database: orbit_site_new
|
||||
|
||||
# set these environment variables on your prod server
|
||||
production:
|
||||
@@ -24,4 +24,4 @@ production:
|
||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||
<<: *defaults
|
||||
database: test_site
|
||||
database: orbit_site_new
|
||||
@@ -12,9 +12,9 @@ module DefaultWidgetTagHelper
|
||||
if param.is_a?(Array) and !param.blank?
|
||||
params_str << param.collect{|t| "#{index}[]=#{t}"}.join("&")
|
||||
params.delete index
|
||||
params_str = params_str + "&"
|
||||
end
|
||||
end
|
||||
|
||||
params_str = params_str + (params_str.eql?("?") ? params.to_param : "&#{params.to_param}" )
|
||||
content_tag :div,:class=> 'more' do
|
||||
link_to I18n.t(@more_link[:label_i18n]),[eval("#{@more_link[:path_method]}"),params_str].join()
|
||||
|
||||
@@ -23,9 +23,7 @@ module ParserFrontEnd
|
||||
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]
|
||||
# category = params[:category_id].blank? ? page[:category] : params[:category_id]
|
||||
|
||||
body = Nokogiri::HTML(page.content)
|
||||
|
||||
if @edit
|
||||
body.css('.page_part').each do |page_part|
|
||||
part = PagePart.find(page_part['part_id']) rescue nil
|
||||
@@ -42,19 +40,16 @@ module ParserFrontEnd
|
||||
end
|
||||
|
||||
body.css('orbit_front').each do |front|
|
||||
|
||||
if front['value']
|
||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div id='#{front['id']}' class='#{front['class']}'>#{eval(front['value']).to_s}</div>")
|
||||
else
|
||||
ret = ''
|
||||
part = PagePart.find(front['part_id']) if front['part_id']
|
||||
ret << eval("\"#{front['path']}\"") rescue ''
|
||||
args.each do |index,arg|
|
||||
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
|
||||
ar = args.to_param
|
||||
ar = URI.unescape(ar)
|
||||
ret << (ret.include?("?") ? "&#{ar}" : "?#{ar}") if args.present?
|
||||
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
|
||||
end
|
||||
front.swap(fragment)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace :gallery do
|
||||
task :migrate_albums => :environment do
|
||||
@albums = GalleryAlbum.all
|
||||
@albums.each do |album|
|
||||
newalbum = Album.new
|
||||
newalbum.name = album.name
|
||||
newalbum.description = album.description
|
||||
newalbum.cover = album.cover
|
||||
newalbum.cover_path = album.cover_path
|
||||
newalbum.tag_names = album.tag_names
|
||||
newalbum.category_id = album.category_id
|
||||
newalbum.save!
|
||||
@images = album.gallery_images
|
||||
@images.each do |image|
|
||||
img = newalbum.album_images.new
|
||||
img.title = image.title
|
||||
img.description = image.description
|
||||
img.file = image.file
|
||||
img.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -122,7 +122,7 @@ namespace :migrate do
|
||||
a.widgets = {}
|
||||
a.widgets[:widget1] = []
|
||||
a.widget_options_fields_i18n = {"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}}
|
||||
a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
|
||||
a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"Album.all", "value"=>:id, "label"=>:name}}}
|
||||
a.save
|
||||
end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace :new_ui do
|
||||
%w(ask ask_question ask_category),
|
||||
%w(asset asset),
|
||||
%w(faq qa),
|
||||
%w(gallery gallery_album gallery_category),
|
||||
%w(gallery album gallery_category),
|
||||
%w(location location),
|
||||
%w(personal_book writing_book),
|
||||
%w(personal_conference writing_conference),
|
||||
|
||||
+20
-19
@@ -9,19 +9,30 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def search_result
|
||||
if params[:search_query] == ""
|
||||
@bulletins = get_bulletins_for_index
|
||||
|
||||
else
|
||||
@search = Bulletin.solr_search do
|
||||
fulltext params[:search_query]
|
||||
with(:frontend_search,true)
|
||||
with(:available_lang).any_of([I18n.locale.to_s])
|
||||
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}
|
||||
|
||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
||||
end
|
||||
end
|
||||
|
||||
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.frontend_data_count
|
||||
@page_num = @item.frontend_data_count
|
||||
@@ -30,33 +41,23 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
end
|
||||
@frontend_style = @item.frontend_style
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||
end
|
||||
# delayed_impressionist(@tag) if @tag
|
||||
end
|
||||
|
||||
end
|
||||
@bulletins
|
||||
end
|
||||
|
||||
def show
|
||||
@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)
|
||||
end
|
||||
|
||||
@categories = get_categories_for_index
|
||||
@categories = @module_app.categories.enabled
|
||||
|
||||
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 )
|
||||
end
|
||||
|
||||
@categories = get_categories_for_index
|
||||
@categories = @module_app.categories.enabled
|
||||
|
||||
end
|
||||
|
||||
@@ -139,7 +139,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||
|
||||
def bulletins_side_bar
|
||||
@tags_and_class = @module_app.sorted_tags_for_cloud
|
||||
@categories = get_categories_for_index
|
||||
@categories = @module_app.categories.enabled
|
||||
end
|
||||
|
||||
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 %>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<h1 class="h1"><%= @page.title rescue nil %></h1>
|
||||
|
||||
<table class="table table-bordered">
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<h1 class="h1"><%= @page.title rescue nil %></h1>
|
||||
|
||||
<table class="table table-bordered">
|
||||
@@ -23,7 +22,7 @@
|
||||
<% @bulletins.each do |post| %>
|
||||
<tr>
|
||||
<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) %>
|
||||
</td>
|
||||
<td><%= display_date_time(post.postdate) %></td>
|
||||
|
||||
Vendored
+3
-6
@@ -53,7 +53,7 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
@@ -100,7 +100,7 @@
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
@@ -149,7 +149,6 @@
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
@@ -198,8 +197,7 @@
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
@@ -246,7 +244,6 @@
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% if !@category_id.blank? %>
|
||||
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
|
||||
<% else %>
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
<%= stylesheet_link_tag "default_widget" %>
|
||||
<script type='text/javascript' src='/assets/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.js'></script>
|
||||
<!-- <script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.degsin.js'></script> -->
|
||||
|
||||
<div id="bulletin_widget">
|
||||
<%= render 'index' %>
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ module Announcement
|
||||
image :image
|
||||
field :postdate
|
||||
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
|
||||
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
||||
end
|
||||
|
||||
+9
-1
@@ -10,4 +10,12 @@
|
||||
<tbody>
|
||||
<%= render partial: 'category', collection: @categories %>
|
||||
</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
|
||||
@qa = Qa.find(params[:id])
|
||||
get_categorys
|
||||
# get_categorys
|
||||
end
|
||||
|
||||
|
||||
protected
|
||||
|
||||
def get_categorys
|
||||
@qa_categorys = QaCategory.excludes('disable' => true)
|
||||
# @qa_categorys = QaCategory.excludes('disable' => true)
|
||||
end
|
||||
|
||||
end
|
||||
+1
-1
@@ -22,7 +22,7 @@ class Qa
|
||||
accepts_nested_attributes_for :qa_files, :allow_destroy => true
|
||||
accepts_nested_attributes_for :qa_links, :allow_destroy => true
|
||||
|
||||
belongs_to :qa_category
|
||||
# belongs_to :qa_category
|
||||
|
||||
before_save :clean_values
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<h1 class="h1"><%= @qa.title %></h1>
|
||||
<div class="info">
|
||||
<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 class="news_paragraph">
|
||||
|
||||
Vendored
+7
-8
@@ -16,7 +16,7 @@ module Faq
|
||||
end
|
||||
end
|
||||
|
||||
category ["QaCategory"]
|
||||
# category ["QaCategory"]
|
||||
data_count 1..20
|
||||
|
||||
taggable
|
||||
@@ -25,9 +25,9 @@ module Faq
|
||||
|
||||
widgets do
|
||||
default_widget do
|
||||
query 'Qa.all'
|
||||
# enable ['typeA']
|
||||
link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [:qa_category,:id]}}
|
||||
query 'Qa'
|
||||
enable ['typeA']
|
||||
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_to_more 'panel_faq_front_end_qas_path',:title_i18n=> 'faq.default_widget.to_more'
|
||||
end
|
||||
@@ -45,7 +45,7 @@ module Faq
|
||||
side_bar do
|
||||
head_label_i18n 'faq.faq',:icon_class=>"icons-help"
|
||||
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']
|
||||
|
||||
head_link_path "panel_faq_back_end_qas_path"
|
||||
@@ -65,11 +65,10 @@ module Faq
|
||||
context_link 'categories',
|
||||
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
|
||||
:priority=>3,
|
||||
:active_for_category => 'Qa',
|
||||
:active_for_category => 'Faq',
|
||||
:available_for => [:manager]
|
||||
|
||||
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,
|
||||
:active_for_tag => 'Faq',
|
||||
:available_for => [:manager]
|
||||
|
||||
@@ -239,7 +239,7 @@ $(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();
|
||||
|
||||
$.ajax({
|
||||
|
||||
@@ -13,6 +13,7 @@ var galleryAPI = function(){
|
||||
this.loading = $("#loading");
|
||||
|
||||
this.loadTheater = function(id){
|
||||
$( ".breadcrumb li:eq(1) a" ).attr("href","/panel/gallery/back_end/albums");
|
||||
g.loadstart();
|
||||
var imageArray;
|
||||
var imagecount = 0;
|
||||
@@ -227,8 +228,8 @@ var galleryAPI = function(){
|
||||
next = imagecount + 1;
|
||||
prev = imagecount - 1;
|
||||
}
|
||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.url});
|
||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.url});
|
||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.theater.url});
|
||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.theater.url});
|
||||
};
|
||||
if(imageArray.length > 1)
|
||||
updateNavigation();
|
||||
|
||||
+8
-75
@@ -8,7 +8,7 @@ var galleryAPI = function(){
|
||||
g = this;
|
||||
this.urlVars = rcom.getUrlVars();
|
||||
this.albumArea = $("#orbit_gallery");
|
||||
this.loadArea = null;
|
||||
this.loadArea = "theater";
|
||||
this.tagList = $(".taglist ul");
|
||||
this.loading = $("#loading");
|
||||
// this.authenticated = false;
|
||||
@@ -19,7 +19,7 @@ var galleryAPI = function(){
|
||||
if(photo_id){
|
||||
var params = rcom.getUrlVars();
|
||||
var url = window.location.href.split("?")[0];
|
||||
params["id"] = photo_id;
|
||||
params["image_id"] = photo_id;
|
||||
for(i=0;i<params.length;i++){
|
||||
if(i == 0)
|
||||
url+="?"+params[i]+"="+params[params[i]];
|
||||
@@ -32,74 +32,9 @@ 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(albumid,id){
|
||||
var imageArray;
|
||||
var imagecount = 0;
|
||||
// var picHeight = 0;
|
||||
@@ -228,7 +163,6 @@ var galleryAPI = function(){
|
||||
});
|
||||
}else{
|
||||
$img.attr({"src":dom.attr("data-content")}).css("height","auto").load(function(){
|
||||
console.log(dom.attr("data-content"));
|
||||
g.loadcomplete();
|
||||
$img.fadeIn(200);
|
||||
});;
|
||||
@@ -239,9 +173,8 @@ var galleryAPI = function(){
|
||||
$slidelist.stop().animate({'height':'0px'}, 300);
|
||||
$slidelist.find("ul").hide();
|
||||
if(rcom.getInternetExplorerVersion() == -1){
|
||||
|
||||
if(pageurl!=window.location){
|
||||
pageurl = window.location.pathname.replace("/","")+"?id="+pageurl+"&controller_action=theater";
|
||||
pageurl = window.location.pathname+"?id="+albumid+"&controller_action=theater&image_id="+pageurl;
|
||||
window.history.pushState({path:pageurl},'',pageurl);
|
||||
}
|
||||
}else{
|
||||
@@ -270,15 +203,15 @@ var galleryAPI = function(){
|
||||
next = imagecount + 1;
|
||||
prev = imagecount - 1;
|
||||
}
|
||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.url});
|
||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.url});
|
||||
$(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.theater.url});
|
||||
$(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.theater.url});
|
||||
};
|
||||
if(imageArray.length > 1)
|
||||
updateNavigation();
|
||||
}
|
||||
|
||||
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);
|
||||
$.each(album.images,function(i,image){
|
||||
if(image._id == id)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#orbit_gallery .rgalbum:hover {
|
||||
box-shadow: 0px 0px 5px rgba(0,0,0,.2);
|
||||
}
|
||||
#orbit_gallery .rgalbum a {
|
||||
#orbit_gallery .rgalbum > a {
|
||||
position: relative;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
@@ -35,7 +35,7 @@
|
||||
#orbit_gallery .rgalbum:hover a img {
|
||||
-webkit-filter: blur(2px);
|
||||
}
|
||||
#orbit_gallery .rgalbum a:after {
|
||||
#orbit_gallery .rgalbum > a:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -95,15 +95,24 @@
|
||||
display: inline-block;
|
||||
float: left;
|
||||
color: #777777;
|
||||
font-size: 11px;
|
||||
font-size: 1.2em;
|
||||
line-height: 20px;
|
||||
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 {
|
||||
color: #0088CC;
|
||||
}
|
||||
#orbit_gallery .rgalbum .gallery_info li .icons-tag {
|
||||
margin-left: 10px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
#orbit_gallery .rgalbum .gallery_info li.albumcateg {
|
||||
float: right;
|
||||
@@ -230,6 +239,7 @@
|
||||
#imgholder .rgalbum a img {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
#imgholder .rgalbum .check {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
||||
@@ -557,8 +557,8 @@
|
||||
}
|
||||
|
||||
#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;
|
||||
margin: auto;
|
||||
width: 32px;
|
||||
width: 220px;
|
||||
}
|
||||
Vendored
+15
-15
@@ -6,32 +6,32 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
||||
|
||||
def show
|
||||
@tags = get_tags
|
||||
@image = GalleryImage.find(params[:id])
|
||||
@albumid = @image.gallery_album_id
|
||||
@album = GalleryAlbum.find(@albumid)
|
||||
@images = @album.gallery_images.all
|
||||
@image = AlbumImage.find(params[:id])
|
||||
@albumid = @image.album_id
|
||||
@album = Album.find(@albumid)
|
||||
@images = @album.album_images.all
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
images = params['images']
|
||||
images.each do |image|
|
||||
img = GalleryImage.find(image)
|
||||
img = AlbumImage.find(image)
|
||||
img.delete
|
||||
end
|
||||
if params['delete_cover'] == "true"
|
||||
album = GalleryAlbum.find(params['id'])
|
||||
album = Album.find(params['id'])
|
||||
album.update_attributes(:cover=>"default",:cover_path => nil)
|
||||
end
|
||||
render :json =>{"success"=>true}.to_json
|
||||
end
|
||||
|
||||
def update_image
|
||||
image = GalleryImage.find(params[:image_id])
|
||||
image.update_attributes(params[:gallery_image])
|
||||
image = AlbumImage.find(params[:image_id])
|
||||
image.update_attributes(params[:album_image])
|
||||
image.save
|
||||
@album = GalleryAlbum.find(image.gallery_album_id.to_s)
|
||||
@images = @album.gallery_images
|
||||
@album = Album.find(image.album_id.to_s)
|
||||
@images = @album.album_images
|
||||
@image_content = []
|
||||
@images.each do |image|
|
||||
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
||||
@@ -42,11 +42,11 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
||||
def delete_photos
|
||||
images = params['images']
|
||||
images.each do |image|
|
||||
img = GalleryImage.find(image)
|
||||
img = AlbumImage.find(image)
|
||||
img.delete
|
||||
end
|
||||
if params['delete_cover'] == "true"
|
||||
album = GalleryAlbum.find(params['album_id'])
|
||||
album = Album.find(params['album_id'])
|
||||
album.update_attributes(:cover=>"default",:cover_path => nil)
|
||||
end
|
||||
render :json =>{"success"=>true}.to_json
|
||||
@@ -57,13 +57,13 @@ class Panel::Gallery::BackEnd::AlbumImagesController < OrbitBackendController
|
||||
tags = params[:tag_ids]
|
||||
i = nil
|
||||
images.each do |image|
|
||||
img = GalleryImage.find(image)
|
||||
img = AlbumImage.find(image)
|
||||
img.tagged_ids = tags
|
||||
img.save
|
||||
i = img
|
||||
end
|
||||
@album = GalleryAlbum.find(i.gallery_album_id.to_s)
|
||||
@images = @album.gallery_images
|
||||
@album = Album.find(i.album_id.to_s)
|
||||
@images = @album.album_images
|
||||
@image_content = []
|
||||
@images.each do |image|
|
||||
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
||||
|
||||
Vendored
+40
-32
@@ -13,12 +13,13 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
@categories = get_categories_for_index
|
||||
@tags = get_tags
|
||||
category_ids = @categories.collect{|t| t.id}
|
||||
@albums = get_sorted_and_filtered("gallery_album", :category_id.in => category_ids)
|
||||
@albums = get_sorted_and_filtered("album", :category_id.in => category_ids)
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@images = @album.gallery_images
|
||||
@album = Album.find(params[:id])
|
||||
@images = @album.album_images
|
||||
@image_content = []
|
||||
@images.each do |image|
|
||||
@image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tagged_ids}
|
||||
@@ -33,12 +34,12 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
def new
|
||||
@categories = get_categories_for_index
|
||||
@tags = get_tags
|
||||
@album = GalleryAlbum.new
|
||||
@album = Album.new
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
album = GalleryAlbum.new(params[:gallery_album])
|
||||
album = Album.new(params[:album])
|
||||
album.save!
|
||||
redirect_to panel_gallery_back_end_albums_path
|
||||
end
|
||||
@@ -46,31 +47,31 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
|
||||
|
||||
def destroy
|
||||
album = GalleryAlbum.find(params[:id])
|
||||
album = Album.find(params[:id])
|
||||
album.destroy
|
||||
redirect_to panel_gallery_back_end_albums_path
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@album = Album.find(params[:id])
|
||||
@tags = get_tags
|
||||
end
|
||||
|
||||
def set_cover
|
||||
if params[:set_cover] == "true"
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
image = GalleryImage.find(params[:image_id])
|
||||
album = Album.find(params[:album_id])
|
||||
image = AlbumImage.find(params[:image_id])
|
||||
album.update_attributes({:cover_path => image.file.thumb.url, :cover=>params[:image_id]})
|
||||
else
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
album = Album.find(params[:album_id])
|
||||
album.update_attributes({:cover_path => nil, :cover=>"default"})
|
||||
end
|
||||
render :json =>{"success"=>true}.to_json
|
||||
end
|
||||
|
||||
def get_album_json
|
||||
albums = GalleryAlbum.all
|
||||
albums = Album.all
|
||||
output = Array.new
|
||||
|
||||
albums.each do |album|
|
||||
@@ -96,8 +97,8 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def get_imgs_json
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
images = album.gallery_images.all
|
||||
album = Album.find(params[:album_id])
|
||||
images = album.album_images.all
|
||||
output = Array.new
|
||||
|
||||
images.each do |image|
|
||||
@@ -119,9 +120,9 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def imgs
|
||||
@album = GalleryAlbum.find(params[:album_id])
|
||||
@album = Album.find(params[:album_id])
|
||||
@tag_names = Array.new
|
||||
@images = @album.gallery_images.all
|
||||
@images = @album.album_images.all
|
||||
@output = Array.new
|
||||
@images.each do |values|
|
||||
tags = Array.new
|
||||
@@ -133,7 +134,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
description: values.description,
|
||||
title: values.title,
|
||||
file: values.file.as_json[:file],
|
||||
gallery_album_id: values.gallery_album_id,
|
||||
gallery_album_id: values.album_id,
|
||||
tag_ids: values.tag_ids,
|
||||
tag_names: tags}
|
||||
end
|
||||
@@ -143,11 +144,11 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
|
||||
|
||||
def upload_image
|
||||
@album = GalleryAlbum.find(params[:album_id])
|
||||
@album = Album.find(params[:album_id])
|
||||
@files = params['files']
|
||||
a = Array.new
|
||||
@files.each do |file|
|
||||
@image = @album.gallery_images.new
|
||||
@image = @album.album_images.new
|
||||
@image.file = file
|
||||
@image.save!
|
||||
a << {"thumbnail_url"=>@image.file.thumb.url,"url"=>panel_gallery_back_end_album_image_path(@image)}
|
||||
@@ -155,18 +156,23 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
render :json=>{"files"=>a}.to_json
|
||||
end
|
||||
|
||||
def new_images
|
||||
@lastimage = GalleryImage.find(params[:last_image_id])
|
||||
@album = GalleryAlbum.find(params[:album_id])
|
||||
@newimages = @album.gallery_images.where(:created_at.gt => @lastimage.created_at)
|
||||
def new_images
|
||||
if params[:last_image_id] != ""
|
||||
@lastimage = AlbumImage.find(params[:last_image_id])
|
||||
@album = Album.find(params[:album_id])
|
||||
@newimages = @album.album_images.where(:created_at.gt => @lastimage.created_at)
|
||||
else
|
||||
@album = Album.find(params[:album_id])
|
||||
@newimages = @album.album_images
|
||||
end
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
|
||||
def images_tags
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
album = Album.find(params[:album_id])
|
||||
tags = Array.new
|
||||
images = album.gallery_images.all
|
||||
images = album.album_images.all
|
||||
images.each do |image|
|
||||
tags << {"id"=>image.id, "tags" => image.tag_ids}
|
||||
end
|
||||
@@ -174,30 +180,32 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def update
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@album = Album.find(params[:id])
|
||||
tagsToDestroy = []
|
||||
tagsToAdd = []
|
||||
new_tags = params[:gallery_album][:tag_ids]
|
||||
new_tags = params[:album][:tag_ids]
|
||||
old_tags = @album.tagged_ids
|
||||
old_tags.each do |tag|
|
||||
if !new_tags.include?(tag)
|
||||
tagsToDestroy << tag
|
||||
end
|
||||
end
|
||||
new_tags.each do |tag|
|
||||
if !old_tags.include?(tag)
|
||||
tagsToAdd << tag
|
||||
if new_tags != nil
|
||||
new_tags.each do |tag|
|
||||
if !old_tags.include?(tag)
|
||||
tagsToAdd << tag
|
||||
end
|
||||
end
|
||||
end
|
||||
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||
@album.update_attributes(params[:gallery_album])
|
||||
@album.update_attributes(params[:album])
|
||||
redirect_to panel_gallery_back_end_album_path(@album)
|
||||
end
|
||||
|
||||
def update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||
# tagsToDestroy will contain all tag ids which have to be deleted from the galley_images
|
||||
# tagsToAdd will contain all tag ids which ve to be added in tall gallery_images
|
||||
@images = GalleryImage.all
|
||||
# tagsToAdd will contain all tag ids which ve to be added in tall album_images
|
||||
@images = AlbumImage.all
|
||||
@images.each do |image|
|
||||
image.tagged_ids.concat(tagsToAdd)
|
||||
tagsToDestroy.each do |tag|
|
||||
|
||||
Vendored
+12
-57
@@ -1,61 +1,16 @@
|
||||
class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
def index
|
||||
@albums = Album.where(:category_id.in => params[:category_id])
|
||||
end
|
||||
|
||||
def show
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@tags = Tag.find(@album.tagged_ids).map{|t| t.name}
|
||||
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
|
||||
@album = Album.find(params[:id])
|
||||
@images = @album.album_images
|
||||
end
|
||||
|
||||
def imgs
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@images = @album.gallery_images.all
|
||||
@album = Album.find(params[:id])
|
||||
@images = @album.album_images.all
|
||||
@output = Array.new
|
||||
@images.each do |values|
|
||||
tags = Tag.find(values.tagged_ids).map{|t| t.name}
|
||||
@@ -64,7 +19,7 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
:description => values.description,
|
||||
:title => values.title,
|
||||
:file => values.file.as_json[:file],
|
||||
:gallery_album_id => values.gallery_album_id,
|
||||
:gallery_album_id => values.album_id,
|
||||
:tag_ids => values.tag_ids,
|
||||
:tag_names => tags}
|
||||
end
|
||||
@@ -72,9 +27,9 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def images_tags
|
||||
album = GalleryAlbum.find(params[:album_id])
|
||||
album = Album.find(params[:album_id])
|
||||
tags = Array.new
|
||||
images = album.gallery_images.all
|
||||
images = album.album_images.all
|
||||
images.each do |image|
|
||||
tags << {"id"=>image.id, "tags" => image.tag_ids}
|
||||
end
|
||||
@@ -82,10 +37,10 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
end
|
||||
|
||||
def theater
|
||||
@image = GalleryImage.find(params[:id])
|
||||
@albumid = @image.gallery_album_id
|
||||
@album = GalleryAlbum.find(@albumid)
|
||||
@images = @album.gallery_images.all
|
||||
@image = AlbumImage.find(params[:image_id])
|
||||
@albumid = @image.album_id
|
||||
@album = Album.find(@albumid)
|
||||
@images = @album.album_images.all
|
||||
tags = @album.tagged_ids
|
||||
@tagnames = Tag.find(tags).map{|t| t.name}
|
||||
@back_link = panel_gallery_front_end_album_path(@albumid)
|
||||
|
||||
+26
-19
@@ -6,8 +6,8 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
|
||||
vertical = @part.widget_options['vertical'].to_i rescue 0
|
||||
horizontal = @part.widget_options['horizontal'].to_i rescue 0
|
||||
|
||||
@album = GalleryAlbum.find(@part.widget_options['album_id']) rescue nil
|
||||
@album_images = @album.gallery_images if @album
|
||||
@album = Album.find(@part.widget_options['album_id']) rescue nil
|
||||
@album_images = @album.album_images if @album
|
||||
|
||||
|
||||
@settings = {"vertical"=>vertical,"horizontal"=>horizontal} #[note] horizontal has it's limitation from 2 to 6
|
||||
@@ -16,27 +16,34 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
|
||||
@rnd = Random.new
|
||||
@images = []
|
||||
|
||||
if @album_images.count > @total
|
||||
@randoms = []
|
||||
until @randoms.count == @total do
|
||||
r = @rnd.rand(0...@album_images.count)
|
||||
if !@randoms.include?r
|
||||
@randoms << r
|
||||
image = @album_images[r]
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||
if !@album_images.nil?
|
||||
if @album_images.count > @total
|
||||
@randoms = []
|
||||
until @randoms.count == @total do
|
||||
r = @rnd.rand(0...@album_images.count)
|
||||
if !@randoms.include?r
|
||||
@randoms << r
|
||||
image = @album_images[r]
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(@album,:image_id=>image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
end
|
||||
elsif @album_images.count == @total
|
||||
@album_images.each do |image|
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(@album,:image_id=>image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
else
|
||||
@album_images.each do |image|
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(@album,:image_id=>image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
until @images.count == @total do
|
||||
values = {"show_link"=>"javascript:void(0);","thumb"=>"assets/gallery/nodata.jpg"}
|
||||
@images << values
|
||||
end
|
||||
end
|
||||
elsif @album_images.count == @total
|
||||
@album_images.each do |image|
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
else
|
||||
@album_images.each do |image|
|
||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||
@images << values
|
||||
end
|
||||
until @images.count == @total do
|
||||
values = {"show_link"=>"javascript:void(0);","thumb"=>"assets/gallery/nodata.jpg"}
|
||||
@images << values
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
class GalleryAlbum
|
||||
class Album
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
|
||||
@@ -12,7 +12,7 @@ class GalleryAlbum
|
||||
field :tag_names
|
||||
|
||||
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
||||
has_many :gallery_images, :autosave => true, :dependent => :destroy
|
||||
accepts_nested_attributes_for :gallery_images, :allow_destroy => true
|
||||
has_many :album_images, :autosave => true, :dependent => :destroy
|
||||
accepts_nested_attributes_for :album_images, :allow_destroy => true
|
||||
|
||||
end
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
class GalleryImage
|
||||
class AlbumImage
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include OrbitTag::Taggable
|
||||
@@ -10,6 +10,6 @@ class GalleryImage
|
||||
|
||||
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
||||
|
||||
belongs_to :gallery_album
|
||||
belongs_to :album
|
||||
|
||||
end
|
||||
@@ -9,7 +9,7 @@ class GalleryCategory
|
||||
|
||||
field :name, localize: true
|
||||
|
||||
has_many :gallery_albums, :autosave => true, :dependent => :destroy
|
||||
has_many :albums, :autosave => true, :dependent => :destroy
|
||||
|
||||
def title
|
||||
name
|
||||
|
||||
@@ -53,6 +53,10 @@ class GalleryUploader < CarrierWave::Uploader::Base
|
||||
process :resize_to_fill => [200, 200]
|
||||
end
|
||||
|
||||
version :theater do
|
||||
process :resize_to_limit => [1920, 1080]
|
||||
end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
# def extension_white_list
|
||||
|
||||
Vendored
+2
-30
@@ -6,7 +6,7 @@
|
||||
<div id="imgholder">
|
||||
<div class="rslide" style="position:relative; width:100%;">
|
||||
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.gallery_album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.theater.url %>" alt="" /></a></div>
|
||||
<div class="rslidenav">
|
||||
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
||||
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="slidelist">
|
||||
<ul id='galleryimagelist' style="display:none;">
|
||||
<% @images.each_with_index do |image,i| %>
|
||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" onload="gallery.loadcomplete();" /></a></li>
|
||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.theater.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" onload="gallery.loadcomplete();" /></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -30,34 +30,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if is_admin? %>
|
||||
<!-- #TODO or 類別屬於他 -->
|
||||
<!-- tag part -->
|
||||
<div id="tag_panel" class="my_scroll">
|
||||
<div class="scrollbar">
|
||||
<div class="track">
|
||||
<div class="thumb">
|
||||
<div class="end"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
@locales = Array.new
|
||||
@site_valid_locales.each do |locale|
|
||||
@locales << locale
|
||||
end
|
||||
%>
|
||||
|
||||
<%# if @authenticated %>
|
||||
<div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"> <div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
|
||||
<%# end %>
|
||||
|
||||
</div>
|
||||
|
||||
<%end%>
|
||||
|
||||
<!-- tag end -->
|
||||
<div class="form-actions form-fixed pagination-right rghead">
|
||||
<div class="rgfn">
|
||||
<%= link_to (content_tag(:i,I18n.t("gallery.back_to_photos"),:class=>"icon-arrow-left icon-black")),"",:class=>"bt-back btn pull-left btn-primary",:title=>I18n.t("gallery.back_to_photos")%>
|
||||
|
||||
+3
-2
@@ -8,9 +8,10 @@
|
||||
<p class="albumname"><%= album.name %></p>
|
||||
</a>
|
||||
<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 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 class="albumtag">
|
||||
<% album.tagged_ids.each do |tag| %>
|
||||
|
||||
+5
-14
@@ -50,7 +50,7 @@
|
||||
<div class="controls" data-toggle="buttons-checkbox">
|
||||
<%@tags.each do |tag|%>
|
||||
<label class="checkbox inline btn <%= 'active' if @album.tag_ids.include?(tag.id) %>">
|
||||
<%= check_box_tag 'gallery_album[tag_ids][]', tag.id, @album.tag_ids.include?(tag.id)%>
|
||||
<%= check_box_tag 'album[tag_ids][]', tag.id, @album.tag_ids.include?(tag.id)%>
|
||||
<%= tag.name %>
|
||||
</label>
|
||||
<%end %>
|
||||
@@ -63,15 +63,9 @@
|
||||
<div class="nav-name"><strong>Language</strong></div>
|
||||
<ul class="nav nav-pills language-nav">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<% if i == 0 %>
|
||||
<li class="active">
|
||||
<a href=".en" data-toggle="tab">English</a>
|
||||
<li <%= (i == 0 ? 'class=active' : '') %>>
|
||||
<a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<a href=".tw_zh" data-toggle="tab">Chinese</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab-content language-area">
|
||||
@@ -79,11 +73,8 @@
|
||||
|
||||
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<% if i == 0 %>
|
||||
<div class="tab-pane fade in active en">
|
||||
<% else %>
|
||||
<div class="tab-pane fade tw_zh">
|
||||
<% end %>
|
||||
|
||||
<div class="tab-pane fade in <%= (i == 0 ? 'active' : '') %> <%= locale %>">
|
||||
<div class="control-group input-title">
|
||||
<%= f.fields_for :name_translations do |name| %>
|
||||
<%= label_tag(locale, t("gallery.album_name"),:class=>"control-label muted") %>
|
||||
|
||||
+6
@@ -4,6 +4,12 @@
|
||||
values: @tags,
|
||||
translation: 'tags',
|
||||
object_field: 'name'
|
||||
|
||||
filter_field type: 'objects',
|
||||
values: @categories,
|
||||
translation: 'category',
|
||||
object_field: 'title'
|
||||
|
||||
footer link: 'new_panel_gallery_back_end_album_path',
|
||||
paginate: false
|
||||
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="<%= 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>
|
||||
<%= 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>
|
||||
</div>
|
||||
<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(@album,:image_id=>image) %>'>
|
||||
<img src='<%= image.file.thumb.url %>'/>
|
||||
</a>
|
||||
</div>
|
||||
+4
-32
@@ -1,42 +1,14 @@
|
||||
|
||||
|
||||
<%= stylesheet_link_tag "gallery_frontend" %>
|
||||
|
||||
<%#= stylesheet_link_tag "gallery" %>
|
||||
<div id="orbit_gallery" class="rg">
|
||||
|
||||
<div class="rgbody">
|
||||
<div id="imgholder">
|
||||
|
||||
<% @albums.each do |album| %>
|
||||
<%= render :partial => "album", :object => album %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rghead">
|
||||
<div class="rgfn">
|
||||
</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" %>
|
||||
|
||||
<div id="orbit_gallery" class="rg">
|
||||
<div class="rgbody">
|
||||
<div id="imgholder">
|
||||
|
||||
<% @images.each do |image| %>
|
||||
<%= render :partial => "image", :object => image %>
|
||||
<% end %>
|
||||
</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>
|
||||
|
||||
<% 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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+3
-4
@@ -6,7 +6,7 @@
|
||||
<div id="imgholder">
|
||||
<div class="rslide" style="position:relative; width:100%;">
|
||||
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.gallery_album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.theater.url %>" alt="" /></a></div>
|
||||
<div class="rslidenav">
|
||||
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
||||
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="slidelist">
|
||||
<ul id='galleryimagelist' style="display:none;">
|
||||
<% @images.each_with_index do |image,i| %>
|
||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" /></a></li>
|
||||
<li for="<%= i %>"><a href="<%= image.id %>" class="list_element" data-content="<%= image.file.theater.url %>" onclick="return false;"><img src="<%= image.file.thumb.url %>" alt="" /></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -57,8 +57,7 @@
|
||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
||||
var gallery = new galleryAPI();
|
||||
gallery.initialize();
|
||||
gallery.loadArea = "theater";
|
||||
gallery.loadTheater("<%= params[:id] %>");
|
||||
gallery.loadTheater("<%= params[:id] %>","<%= params[:image_id] %>");
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
|
||||
<div class="albumname_edit">
|
||||
<label for=""><%= t("gallery.album_name") %></label>
|
||||
<div class="inputui rginput rgih26 w380"><input type="text" name="gallery_album[name_translations][<%= locale %>]" value="<%= @album_name[locale] %>" class="txtchange" /></div>
|
||||
<div class="inputui rginput rgih26 w380"><input type="text" name="album[name_translations][<%= locale %>]" value="<%= @album_name[locale] %>" class="txtchange" /></div>
|
||||
</div>
|
||||
|
||||
<div class='description_loader'>
|
||||
|
||||
Vendored
+1
-1
@@ -7,7 +7,7 @@
|
||||
</div> -->
|
||||
<div class="rslide" style="position:relative; width:100%;">
|
||||
<div class="rslideinside"><div id="loading" style="display:none;"></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.gallery_album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||
<div class="comp" id='main_pic' data-content='<%= @image.album_id %>'><a href="" id="nextpic" class="navN" title="下一張" onclick="return false;" ><img src="<%= @image.file.url %>" alt="" /></a></div>
|
||||
<div class="rslidenav">
|
||||
<a href="" class="navP" title="上一張" onclick="return false;">Prev</a>
|
||||
<a href="" class="navN" title="下一張" onclick="return false;">Next</a>
|
||||
|
||||
+3
-3
@@ -26,7 +26,7 @@ module Gallery
|
||||
# image :image
|
||||
# end
|
||||
|
||||
categories_query 'GalleryCategory.all'
|
||||
# categories_query 'GalleryCategory.all'
|
||||
# tags_query 'GalleryTag.all'
|
||||
|
||||
#* customize_widget "albums","gallery.widget.albums",:fields=>[],:style=>[],:options=>{"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
|
||||
@@ -34,10 +34,10 @@ module Gallery
|
||||
|
||||
customize_widget "widget1" do
|
||||
widget_i18n "gallery.widget.widget1"
|
||||
style []
|
||||
style ["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 "album_id",:i18n =>"gallery.album",:options_item => {"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}
|
||||
options "album_id",:i18n =>"gallery.album",:options_item => {"query"=>"Album.all", "value"=>:id, "label"=>:name}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Whitespace-only changes.
@@ -0,0 +1,131 @@
|
||||
var Locations = function(ls){
|
||||
l = this;
|
||||
this.name = "Locations";
|
||||
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;
|
||||
}
|
||||
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
|
||||
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user