let user can set the amount of album limit for one page
This commit is contained in:
parent
3e0a8cff4d
commit
0dba57c48e
|
@ -1,495 +1,510 @@
|
||||||
function rotate(){
|
function rotate(){
|
||||||
$("#crop_div").dialog("open");
|
$("#crop_div").dialog("open");
|
||||||
}
|
}
|
||||||
function change_degree(degree_change){
|
function change_degree(degree_change){
|
||||||
var degree_org = parseInt($('#show_degree').text())
|
var degree_org = parseInt($('#show_degree').text())
|
||||||
degree_org+=degree_change
|
degree_org+=degree_change
|
||||||
if (degree_org==360 || degree_org==-360){
|
if (degree_org==360 || degree_org==-360){
|
||||||
degree_org = 0
|
degree_org = 0
|
||||||
}
|
}
|
||||||
$('#show_degree').text(degree_org)
|
$('#show_degree').text(degree_org)
|
||||||
}
|
}
|
||||||
function init_upload(temp_length){
|
function init_upload(temp_length){
|
||||||
var value = $("input[name='all_upload_length']")
|
var value = $("input[name='all_upload_length']")
|
||||||
if (value.val()==''){
|
if (value.val()==''){
|
||||||
value.val(temp_length)
|
value.val(temp_length)
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : "post",
|
type : "post",
|
||||||
url : "/admin/galleries/init_upload",
|
url : "/admin/galleries/init_upload",
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
data:{all_length: value.val()},
|
data:{all_length: value.val()},
|
||||||
async: false,
|
async: false,
|
||||||
global:false,
|
global:false,
|
||||||
success: function()
|
success: function()
|
||||||
{
|
{
|
||||||
},
|
},
|
||||||
error : function(data){
|
error : function(data){
|
||||||
alert('init upload process failed, please try again later.')
|
alert('init upload process failed, please try again later.')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (value.val()=='1'){
|
if (value.val()=='1'){
|
||||||
value.val('')
|
value.val('')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function form_submit() {
|
function form_submit() {
|
||||||
var temp_length = $('#file-list').find('li.template-upload').length
|
var temp_length = $('#file-list').find('li.template-upload').length
|
||||||
init_upload(temp_length)
|
init_upload(temp_length)
|
||||||
var length_upload
|
var length_upload
|
||||||
var count_upload
|
var count_upload
|
||||||
var send_start
|
var send_start
|
||||||
if (temp_length>1){
|
if (temp_length>1){
|
||||||
$( 'form#fileupload' ).ajaxSuccess(function() {
|
$( 'form#fileupload' ).ajaxSuccess(function() {
|
||||||
if (typeof length_upload == "undefined"){
|
if (typeof length_upload == "undefined"){
|
||||||
count_upload = 1
|
count_upload = 1
|
||||||
length_upload = $('#file-list').find('li.template-upload').length
|
length_upload = $('#file-list').find('li.template-upload').length
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
count_upload ++
|
count_upload ++
|
||||||
}
|
}
|
||||||
if (count_upload === length_upload){
|
if (count_upload === length_upload){
|
||||||
send_start = undefined
|
send_start = undefined
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "/admin/galleries/start_upload_process",
|
url : "/admin/galleries/start_upload_process",
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
type : "post",
|
type : "post",
|
||||||
error: function(){
|
error: function(){
|
||||||
alert('init upload process failed, please try again later.')
|
alert('init upload process failed, please try again later.')
|
||||||
},
|
},
|
||||||
success: function(){
|
success: function(){
|
||||||
window.location.href = '/admin/galleries/upload_process'
|
window.location.href = '/admin/galleries/upload_process'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "/admin/galleries/start_upload_process",
|
url : "/admin/galleries/start_upload_process",
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
type : "post",
|
type : "post",
|
||||||
error: function(){
|
error: function(){
|
||||||
alert('init upload process failed, please try again later.')
|
alert('init upload process failed, please try again later.')
|
||||||
},
|
},
|
||||||
success: function(){
|
success: function(){
|
||||||
window.location.href = '/admin/galleries/upload_process'
|
window.location.href = '/admin/galleries/upload_process'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function form_only_one_submit() {
|
function form_only_one_submit() {
|
||||||
var temp_length = 1
|
var temp_length = 1
|
||||||
init_upload(temp_length)
|
init_upload(temp_length)
|
||||||
}
|
}
|
||||||
!function ($) {
|
!function ($) {
|
||||||
$.fn.checkListLength = function (param){
|
$.fn.checkListLength = function (param){
|
||||||
_defaultSettings = {
|
_defaultSettings = {
|
||||||
onlyOne: null,
|
onlyOne: null,
|
||||||
};
|
};
|
||||||
_set = $.extend(_defaultSettings, param);
|
_set = $.extend(_defaultSettings, param);
|
||||||
$this = this;
|
$this = this;
|
||||||
$li = this.children('li');
|
$li = this.children('li');
|
||||||
$dropzone = $('#dropzone');
|
$dropzone = $('#dropzone');
|
||||||
if(($li.length - _set.onlyOne) === 0) {
|
if(($li.length - _set.onlyOne) === 0) {
|
||||||
$('#dropzone').fadeIn(300);
|
$('#dropzone').fadeIn(300);
|
||||||
} else {
|
} else {
|
||||||
$('#dropzone').fadeOut(300);
|
$('#dropzone').fadeOut(300);
|
||||||
}
|
}
|
||||||
$('#file-list').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
|
$('#file-list').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
|
||||||
};
|
};
|
||||||
}(window.jQuery);
|
}(window.jQuery);
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
// Initialize the jQuery File Upload widget:
|
// Initialize the jQuery File Upload widget:
|
||||||
if($('#fileupload').length){
|
if($('#fileupload').length){
|
||||||
$('#fileupload').fileupload({
|
$('#fileupload').fileupload({
|
||||||
//maxFileSize: 5000000,=
|
//maxFileSize: 5000000,=
|
||||||
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
||||||
dropZone: $('#dropzone'),
|
dropZone: $('#dropzone'),
|
||||||
headers:{
|
headers:{
|
||||||
'X-CSRF-Token': $('meta[name="csrf-token"]').attr("content")
|
'X-CSRF-Token': $('meta[name="csrf-token"]').attr("content")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Array.prototype.uniq = function(){
|
Array.prototype.uniq = function(){
|
||||||
var attr = this
|
var attr = this
|
||||||
attr = $.grep(attr, function(v, k){
|
attr = $.grep(attr, function(v, k){
|
||||||
return $.inArray(v ,attr) === k;
|
return $.inArray(v ,attr) === k;
|
||||||
});
|
});
|
||||||
return attr;
|
return attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function batch_crop(){
|
function batch_crop(){
|
||||||
var check_li = $('#imgholder').find("input[type='checkbox']:checked").parents('li');
|
var check_li = $('#imgholder').find("input[type='checkbox']:checked").parents('li');
|
||||||
var image_ids =[];
|
var image_ids =[];
|
||||||
if (check_li.length>0){
|
if (check_li.length>0){
|
||||||
check_li.each(function(){
|
check_li.each(function(){
|
||||||
image_ids.push($(this).data('image-id'));
|
image_ids.push($(this).data('image-id'));
|
||||||
});
|
});
|
||||||
if (navigator.onLine) {
|
if (navigator.onLine) {
|
||||||
window.location.href = '/admin/galleries/batch_crop?image_ids=' + image_ids.join(',')
|
window.location.href = '/admin/galleries/batch_crop?image_ids=' + image_ids.join(',')
|
||||||
} else {
|
} else {
|
||||||
alert('Please connect the network and try again later!')
|
alert('Please connect the network and try again later!')
|
||||||
}
|
|
||||||
}else{
|
|
||||||
alert('Please select at least one')
|
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
alert('Please select at least one')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function select_all() {
|
function select_all() {
|
||||||
$('#imgholder').find("input[type='checkbox']:not(:checked)").trigger('click')
|
$('#imgholder').find("input[type='checkbox']:not(:checked)").trigger('click')
|
||||||
}
|
}
|
||||||
function translate(ele,pretext,text,return_flag){
|
function translate(ele,pretext,text,return_flag){
|
||||||
var return_value
|
var return_value
|
||||||
if (navigator.onLine) {
|
if (navigator.onLine) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "/admin/galleries/translate",
|
url : "/admin/galleries/translate",
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
type : "post",
|
type : "post",
|
||||||
async: false,
|
async: false,
|
||||||
data:{text:text},
|
data:{text:text},
|
||||||
success:function(data){
|
success:function(data){
|
||||||
if (return_flag){
|
if (return_flag){
|
||||||
return_value = data.translate
|
return_value = data.translate
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
ele.html(pretext + data.translate)
|
ele.html(pretext + data.translate)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error:function(){
|
error:function(){
|
||||||
var back = text.split('.')[1].split('_')
|
|
||||||
var result = []
|
|
||||||
for (i=0;i<back.length;i++){
|
|
||||||
result.push(back[i].charAt(0).toUpperCase() + back[i].slice(1))
|
|
||||||
}
|
|
||||||
if (return_flag){
|
|
||||||
return_value = result.join(' ')
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
ele.html(pretext + result.join(' '))
|
|
||||||
}
|
|
||||||
alert('Your server has some problem, please try again later!')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
} else {
|
|
||||||
var back = text.split('.')[1].split('_')
|
var back = text.split('.')[1].split('_')
|
||||||
var result = []
|
var result = []
|
||||||
for (i=0;i<back.length;i++){
|
for (i=0;i<back.length;i++){
|
||||||
result.push(back[i].charAt(0).toUpperCase() + back[i].slice(1))
|
result.push(back[i].charAt(0).toUpperCase() + back[i].slice(1))
|
||||||
}
|
}
|
||||||
if (return_flag){
|
if (return_flag){
|
||||||
return_value = result.join(' ')
|
return_value = result.join(' ')
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
ele.html(pretext + result.join(' '))
|
ele.html(pretext + result.join(' '))
|
||||||
}
|
}
|
||||||
alert('Please connect the network and try again later!')
|
alert('Your server has some problem, please try again later!')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
var back = text.split('.')[1].split('_')
|
||||||
|
var result = []
|
||||||
|
for (i=0;i<back.length;i++){
|
||||||
|
result.push(back[i].charAt(0).toUpperCase() + back[i].slice(1))
|
||||||
}
|
}
|
||||||
if (return_flag){
|
if (return_flag){
|
||||||
return return_value
|
return_value = result.join(' ')
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
ele.html(pretext + result.join(' '))
|
||||||
|
}
|
||||||
|
alert('Please connect the network and try again later!')
|
||||||
|
}
|
||||||
|
if (return_flag){
|
||||||
|
return return_value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
var $container = $('.gallery'),
|
var $container = $('.gallery'),
|
||||||
$containerData = $container.data();
|
$containerData = $container.data();
|
||||||
$container.data("order-edit","0");
|
$container.data("order-edit","0");
|
||||||
$container.sortable({
|
$container.sortable({
|
||||||
disabled: true
|
disabled: true
|
||||||
});
|
});
|
||||||
$container.imagesLoaded(function(){
|
$container.imagesLoaded(function(){
|
||||||
var $albumname = $('.albumname'),
|
var $albumname = $('.albumname'),
|
||||||
$img = $('.rgalbum img');
|
$img = $('.rgalbum img');
|
||||||
$('.rgalbum > a').rsImg();
|
$('.rgalbum > a').rsImg();
|
||||||
if($containerData.galleryId == 'gallery') {
|
if($containerData.galleryId == 'gallery') {
|
||||||
// $container.masonry({
|
// $container.masonry({
|
||||||
// itemSelector : '.rgalbum',
|
// itemSelector : '.rgalbum',
|
||||||
// isAnimated: true,
|
// isAnimated: true,
|
||||||
// });
|
// });
|
||||||
$albumname.each(function(i) {
|
$albumname.each(function(i) {
|
||||||
var $albumblock = $(this).closest('a').height(),
|
var $albumblock = $(this).closest('a').height(),
|
||||||
$H = $(this).outerHeight(true);
|
$H = $(this).outerHeight(true);
|
||||||
if($H > $albumblock) {
|
if($H > $albumblock) {
|
||||||
$(this).css({
|
$(this).css({
|
||||||
'bottom': "auto",
|
'bottom': "auto",
|
||||||
'top': 0,
|
'top': 0,
|
||||||
});
|
});
|
||||||
$(this).hover(function() {
|
$(this).hover(function() {
|
||||||
$(this).stop(true, true).delay(500).animate({
|
$(this).stop(true, true).delay(500).animate({
|
||||||
'top': '-='+($H-$albumblock),
|
'top': '-='+($H-$albumblock),
|
||||||
},($H-$albumblock)*10)
|
},($H-$albumblock)*10)
|
||||||
},function() {
|
},function() {
|
||||||
$(this).stop(true, true);
|
$(this).stop(true, true);
|
||||||
$(this).css({
|
$(this).css({
|
||||||
'bottom': "auto",
|
'bottom': "auto",
|
||||||
'top': 0,
|
'top': 0,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
$('#orbit_gallery').delegate('.icons-tag', clickEvent, function(){
|
$('#orbit_gallery').delegate('.icons-tag', clickEvent, function(){
|
||||||
$(this).parents('.gallery_info').nextAll('.albumtag').slideToggle(300);
|
var tmp = $(this).parents('.rgalbum').eq(0)
|
||||||
});
|
var now_this = $(this)
|
||||||
};
|
if (tmp.find('.albumtag').eq(0).find('li.label').length == 0){
|
||||||
});
|
var ele_id = tmp.attr('data-image-id')
|
||||||
|
$.ajax({
|
||||||
|
type : "post",
|
||||||
|
url : "/admin/galleries/get_tag",
|
||||||
|
dataType : "text",
|
||||||
|
data:{ele_id: ele_id},
|
||||||
|
global:false,
|
||||||
|
success: function(data)
|
||||||
|
{
|
||||||
|
tmp.find('.albumtag').eq(0).html(data)
|
||||||
|
now_this.parents('.gallery_info').nextAll('.albumtag').slideToggle(300);
|
||||||
|
},
|
||||||
|
error : function(data){
|
||||||
|
alert('init process failed, please try again later.')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
$(this).parents('.gallery_info').nextAll('.albumtag').slideToggle(300);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
var bindEvent = function(instance,elem){
|
var bindEvent = function(instance,elem){
|
||||||
var $e = elem,
|
var $e = elem,
|
||||||
image_id = $e.closest(".rgalbum").data("image-id");
|
image_id = $e.closest(".rgalbum").data("image-id");
|
||||||
obj = photosData.galleries.filter(function(a) {
|
obj = photosData.galleries.filter(function(a) {
|
||||||
return a.id == image_id;
|
return a.id == image_id;
|
||||||
})[0];
|
})[0];
|
||||||
switch($e.attr("for")){
|
switch($e.attr("for")){
|
||||||
case "description":
|
case "description":
|
||||||
if(obj.description){
|
if(obj.description){
|
||||||
instance.find("textarea").each(function(){
|
instance.find("textarea").each(function(){
|
||||||
if(obj.description[$(this).attr("for")])
|
if(obj.description[$(this).attr("for")])
|
||||||
$(this).val(obj.description[$(this).attr("for")]);
|
$(this).val(obj.description[$(this).attr("for")]);
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
instance.find("input[type=hidden]").val(image_id);
|
||||||
|
instance.find("form").bind("ajax:success",function(evt, data, status){
|
||||||
|
$.pageslide.close();
|
||||||
|
photosData = data;
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case "tags":
|
||||||
|
instance.find('.tags-groups').cardCheck({
|
||||||
|
item: '.card'
|
||||||
|
});
|
||||||
|
for(i = 0; i < obj.tags.length; i++){
|
||||||
|
instance.find("input[value="+obj.tags[i]+"]").parent().addClass('active');
|
||||||
|
instance.find("input[value="+obj.tags[i]+"]").prop("checked","checked");
|
||||||
|
}
|
||||||
|
instance.find("form").submit(function(event) {
|
||||||
|
var checkboxes = $(this).find("input[type=checkbox]:checked"),
|
||||||
|
tag_ids = [],
|
||||||
|
image_ids =[image_id];
|
||||||
|
|
||||||
}
|
checkboxes.each(function(){
|
||||||
instance.find("input[type=hidden]").val(image_id);
|
tag_ids.push($(this).val());
|
||||||
instance.find("form").bind("ajax:success",function(evt, data, status){
|
})
|
||||||
$.pageslide.close();
|
$.post("/admin/galleries/image_tagging",{"image_ids":image_ids,"tag_ids":tag_ids},function(json){
|
||||||
photosData = data;
|
$.pageslide.close();
|
||||||
})
|
photosData = json;
|
||||||
break;
|
})
|
||||||
case "tags":
|
return false;
|
||||||
instance.find('.tags-groups').cardCheck({
|
});
|
||||||
item: '.card'
|
break;
|
||||||
});
|
case "batch":
|
||||||
for(i = 0; i < obj.tags.length; i++){
|
instance.find('.tags-groups').cardCheck({
|
||||||
instance.find("input[value="+obj.tags[i]+"]").parent().addClass('active');
|
item: '.card'
|
||||||
instance.find("input[value="+obj.tags[i]+"]").prop("checked","checked");
|
});
|
||||||
}
|
instance.find("form").submit(function(event) {
|
||||||
instance.find("form").submit(function(event) {
|
var checkboxes = $(this).find("input[type=checkbox]:checked"),
|
||||||
var checkboxes = $(this).find("input[type=checkbox]:checked"),
|
tag_ids = [],
|
||||||
tag_ids = [],
|
image_ids =[],
|
||||||
image_ids =[image_id];
|
images = $("#imgholder .rgalbum.active");
|
||||||
|
checkboxes.each(function(){
|
||||||
|
tag_ids.push($(this).val());
|
||||||
|
})
|
||||||
|
images.each(function(){
|
||||||
|
image_ids.push($(this).data("image-id"));
|
||||||
|
})
|
||||||
|
$.post("/admin/galleries/image_tagging",{"image_ids":image_ids,"tag_ids":tag_ids},function(json){
|
||||||
|
$.pageslide.close();
|
||||||
|
photosData = json;
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
checkboxes.each(function(){
|
if($("#imgholder").length){
|
||||||
tag_ids.push($(this).val());
|
$('.open').pageslide({
|
||||||
})
|
loadComplete: function(instance,elem) {
|
||||||
|
bindEvent(instance,elem);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
$("#imgholder").on(clickEvent, '.photo_cover', function(event) {
|
||||||
|
var image_id = $(this).closest(".rgalbum").data("image-id"),
|
||||||
|
album_id = $("#imgholder").data("gallery-id"),
|
||||||
|
set_cover = true;
|
||||||
|
if($(this).children().hasClass("icons-star-2")){
|
||||||
|
$(".icons-star").removeClass("icons-star").addClass('icons-star-2');
|
||||||
|
$(this).children().removeClass("icons-star-2").addClass("icons-star");
|
||||||
|
}else{
|
||||||
|
$(this).children().removeClass("icons-star").addClass("icons-star-2");
|
||||||
|
set_cover = false;
|
||||||
|
}
|
||||||
|
$.post("/admin/galleries/set_cover",{"album_id":album_id,"image_id":image_id,"set_cover":set_cover});
|
||||||
|
|
||||||
$.post("/admin/galleries/image_tagging",{"image_ids":image_ids,"tag_ids":tag_ids},function(json){
|
});
|
||||||
$.pageslide.close();
|
|
||||||
photosData = json;
|
|
||||||
})
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "batch":
|
|
||||||
instance.find('.tags-groups').cardCheck({
|
|
||||||
item: '.card'
|
|
||||||
});
|
|
||||||
instance.find("form").submit(function(event) {
|
|
||||||
var checkboxes = $(this).find("input[type=checkbox]:checked"),
|
|
||||||
tag_ids = [],
|
|
||||||
image_ids =[],
|
|
||||||
images = $("#imgholder .rgalbum.active");
|
|
||||||
checkboxes.each(function(){
|
|
||||||
tag_ids.push($(this).val());
|
|
||||||
})
|
|
||||||
images.each(function(){
|
|
||||||
image_ids.push($(this).data("image-id"));
|
|
||||||
})
|
|
||||||
$.post("/admin/galleries/image_tagging",{"image_ids":image_ids,"tag_ids":tag_ids},function(json){
|
|
||||||
$.pageslide.close();
|
|
||||||
photosData = json;
|
|
||||||
})
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($("#imgholder").length){
|
$("#delete_selected_photos_btn").click(function(){
|
||||||
$('.open').pageslide({
|
var photos_to_delete = [],
|
||||||
loadComplete: function(instance,elem) {
|
delete_cover = false,
|
||||||
bindEvent(instance,elem);
|
$photos = $(".rgalbum.active"),
|
||||||
}
|
album_id = $("#imgholder").data("gallery-id");
|
||||||
})
|
$('.modal-body .spinning').fadeIn('fast');
|
||||||
}
|
$('.modal-body .text-warning').hide(0);
|
||||||
|
$photos.each(function(){
|
||||||
|
photos_to_delete.push($(this).data('image-id'));
|
||||||
|
if ($(this).find(".icons-star").length) {
|
||||||
|
delete_cover = true;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
url : "/admin/galleries/delete_photos",
|
||||||
|
type : "POST",
|
||||||
|
data : {"images":photos_to_delete,"delete_cover":delete_cover,"album_id":album_id},
|
||||||
|
success : function(){
|
||||||
|
$photos.slideUp(300,function() {
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
$('#dialog').modal('hide');
|
||||||
|
$('.modal-body .spinning').hide();
|
||||||
|
$('.modal-body .text-warning').show();
|
||||||
|
$('.deletephoto, .deselect, .addtags').addClass('hide')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#imgholder').on(clickEvent, '.checkbox', function() {
|
||||||
|
$(this).prop('checked') ? $(this).closest('.rgalbum').addClass('active') : $(this).closest('.rgalbum').removeClass('active');
|
||||||
$("#imgholder").on(clickEvent, '.photo_cover', function(event) {
|
var checkLength = $("#imgholder .rgalbum.active");
|
||||||
var image_id = $(this).closest(".rgalbum").data("image-id"),
|
checkLength.length ? $('.deletephoto, .deselect, .addtags, .crop').removeClass('hide') : $('.deletephoto, .deselect, .addtags, .crop').addClass('hide');
|
||||||
album_id = $("#imgholder").data("gallery-id"),
|
});
|
||||||
set_cover = true;
|
$('.deselect').on(clickEvent, function(event) {
|
||||||
if($(this).children().hasClass("icons-star-2")){
|
$('.rgalbum').removeClass('active');
|
||||||
$(".icons-star").removeClass("icons-star").addClass('icons-star-2');
|
$('.checkbox').prop('checked', false)
|
||||||
$(this).children().removeClass("icons-star-2").addClass("icons-star");
|
$('.deletephoto, .deselect, .addtags').addClass('hide')
|
||||||
}else{
|
event.preventDefault();
|
||||||
$(this).children().removeClass("icons-star").addClass("icons-star-2");
|
});
|
||||||
set_cover = false;
|
$('.phtot-action').delegate('li', clickEvent, function(event) {
|
||||||
}
|
$('.checkbox').prop('checked', false)
|
||||||
$.post("/admin/galleries/set_cover",{"album_id":album_id,"image_id":image_id,"set_cover":set_cover});
|
$('.rgalbum').removeClass('active');
|
||||||
|
$('.deletephoto, .deselect, .addtags').removeClass('hide')
|
||||||
});
|
});
|
||||||
|
var images_order = [];
|
||||||
$("#delete_selected_photos_btn").click(function(){
|
$("#edit-order-btn").on("click",function(){
|
||||||
var photos_to_delete = [],
|
var el = $(this);
|
||||||
delete_cover = false,
|
if($container.data("order-edit") == "0"){
|
||||||
$photos = $(".rgalbum.active"),
|
$container.sortable("enable");
|
||||||
album_id = $("#imgholder").data("gallery-id");
|
$(".order-edit-notification").slideDown();
|
||||||
$('.modal-body .spinning').fadeIn('fast');
|
images_order = $container.sortable( "toArray", { attribute: "data-image-id" });
|
||||||
$('.modal-body .text-warning').hide(0);
|
images_order = images_order.uniq();
|
||||||
$photos.each(function(){
|
$container.data("order-edit","1");
|
||||||
photos_to_delete.push($(this).data('image-id'));
|
translate(el,'','gallery.save_order',false)
|
||||||
if ($(this).find(".icons-star").length) {
|
}else{
|
||||||
delete_cover = true;
|
var temp = $container.sortable( "toArray", { attribute: "data-image-id" }),
|
||||||
};
|
type = $container.attr("id");
|
||||||
});
|
temp = temp.uniq()
|
||||||
$.ajax({
|
if(images_order.toString() != temp.toString()){
|
||||||
url : "/admin/galleries/delete_photos",
|
$.ajax({
|
||||||
type : "POST",
|
url : "/admin/galleries/order",
|
||||||
data : {"images":photos_to_delete,"delete_cover":delete_cover,"album_id":album_id},
|
data : {"imageids" : temp, "type" : type},
|
||||||
success : function(){
|
type : "post",
|
||||||
$photos.slideUp(300,function() {
|
dataType : "json"
|
||||||
$(this).remove();
|
})
|
||||||
});
|
}
|
||||||
$('#dialog').modal('hide');
|
$(".order-edit-notification").slideUp();
|
||||||
$('.modal-body .spinning').hide();
|
$container.sortable("disable");
|
||||||
$('.modal-body .text-warning').show();
|
$container.data("order-edit","0");
|
||||||
$('.deletephoto, .deselect, .addtags').addClass('hide')
|
translate(el,'','gallery.edit_order',false)
|
||||||
}
|
}
|
||||||
});
|
return false;
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#imgholder').on(clickEvent, '.checkbox', function() {
|
|
||||||
$(this).prop('checked') ? $(this).closest('.rgalbum').addClass('active') : $(this).closest('.rgalbum').removeClass('active');
|
|
||||||
var checkLength = $("#imgholder .rgalbum.active");
|
|
||||||
checkLength.length ? $('.deletephoto, .deselect, .addtags, .crop').removeClass('hide') : $('.deletephoto, .deselect, .addtags, .crop').addClass('hide');
|
|
||||||
});
|
|
||||||
$('.deselect').on(clickEvent, function(event) {
|
|
||||||
$('.rgalbum').removeClass('active');
|
|
||||||
$('.checkbox').prop('checked', false)
|
|
||||||
$('.deletephoto, .deselect, .addtags').addClass('hide')
|
|
||||||
event.preventDefault();
|
|
||||||
});
|
|
||||||
$('.phtot-action').delegate('li', clickEvent, function(event) {
|
|
||||||
$('.checkbox').prop('checked', false)
|
|
||||||
$('.rgalbum').removeClass('active');
|
|
||||||
$('.deletephoto, .deselect, .addtags').removeClass('hide')
|
|
||||||
});
|
|
||||||
var images_order = [];
|
|
||||||
$("#edit-order-btn").on("click",function(){
|
|
||||||
var el = $(this);
|
|
||||||
if($container.data("order-edit") == "0"){
|
|
||||||
$container.sortable("enable");
|
|
||||||
$(".order-edit-notification").slideDown();
|
|
||||||
images_order = $container.sortable( "toArray", { attribute: "data-image-id" });
|
|
||||||
images_order = images_order.uniq();
|
|
||||||
$container.data("order-edit","1");
|
|
||||||
translate(el,'','gallery.save_order',false)
|
|
||||||
}else{
|
|
||||||
var temp = $container.sortable( "toArray", { attribute: "data-image-id" }),
|
|
||||||
type = $container.attr("id");
|
|
||||||
temp = temp.uniq()
|
|
||||||
if(images_order.toString() != temp.toString()){
|
|
||||||
$.ajax({
|
|
||||||
url : "/admin/galleries/order",
|
|
||||||
data : {"imageids" : temp, "type" : type},
|
|
||||||
type : "post",
|
|
||||||
dataType : "json"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
$(".order-edit-notification").slideUp();
|
|
||||||
$container.sortable("disable");
|
|
||||||
$container.data("order-edit","0");
|
|
||||||
translate(el,'','gallery.edit_order',false)
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
var last_image_id = null;
|
var last_image_id = null;
|
||||||
$('.add-imgs').on({
|
$('.add-imgs').on({
|
||||||
click: function() {
|
click: function() {
|
||||||
$('#fileupload').slideToggle(300, function() {
|
$('#fileupload').slideToggle(300, function() {
|
||||||
if(!$(this).is(':hidden')) {
|
if(!$(this).is(':hidden')) {
|
||||||
translate($('.add-imgs'),'<i class="icons-cross-2"></i> ','gallery.close_panel',false)
|
translate($('.add-imgs'),'<i class="icons-cross-2"></i> ','gallery.close_panel',false)
|
||||||
$('.rgbody').stop(true, false).animate({'padding-bottom': 280}, 300);
|
$('.rgbody').stop(true, false).animate({'padding-bottom': 280}, 300);
|
||||||
$("#edit-order-btn").hide();
|
$("#edit-order-btn").hide();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "/admin/galleries/last_image_id",
|
url : "/admin/galleries/last_image_id",
|
||||||
data : {"albumid" : $("#fileupload_aid").val()},
|
data : {"albumid" : $("#fileupload_aid").val()},
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
type : "get"
|
type : "get"
|
||||||
}).done(function(d){
|
}).done(function(d){
|
||||||
last_image_id = d.last_image_id;
|
last_image_id = d.last_image_id;
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
translate($('.add-imgs'),'<i class="icons-plus"></i> ','gallery.add_image',false)
|
translate($('.add-imgs'),'<i class="icons-plus"></i> ','gallery.add_image',false)
|
||||||
$('.files').empty()
|
$('.files').empty()
|
||||||
$('#file-list').checkListLength();
|
$('#file-list').checkListLength();
|
||||||
$('.rgbody').stop(true, false).animate({'padding-bottom': 0}, 300);
|
$('.rgbody').stop(true, false).animate({'padding-bottom': 0}, 300);
|
||||||
$("#edit-order-btn").show();
|
$("#edit-order-btn").show();
|
||||||
fetchNewImages();
|
fetchNewImages();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var fetchNewImages = function(){
|
var fetchNewImages = function(){
|
||||||
var albumid = $("#fileupload_aid").val();
|
var albumid = $("#fileupload_aid").val();
|
||||||
|
|
||||||
$.getJSON('/admin/galleries/get_photoData_json?id='+albumid, function(json, textStatus) {
|
$.getJSON('/admin/galleries/get_photoData_json?id='+albumid, function(json, textStatus) {
|
||||||
photosData = json;
|
photosData = json;
|
||||||
});
|
});
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "/admin/galleries/new_images",
|
url : "/admin/galleries/new_images",
|
||||||
data : {"last_image_id" : last_image_id, "album_id" : albumid},
|
data : {"last_image_id" : last_image_id, "album_id" : albumid},
|
||||||
success : function(data){
|
success : function(data){
|
||||||
var $e = $(data);
|
var $e = $(data);
|
||||||
$imgs = $e.find("img");
|
$imgs = $e.find("img");
|
||||||
$("#imgholder").prepend($e);
|
$("#imgholder").prepend($e);
|
||||||
$os = $e.find("a.open");
|
$os = $e.find("a.open");
|
||||||
$os.pageslide({
|
$os.pageslide({
|
||||||
loadComplete: function(instance,elem) {
|
loadComplete: function(instance,elem) {
|
||||||
bindEvent(instance,elem);
|
bindEvent(instance,elem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
var buttons_option={}
|
var buttons_option={}
|
||||||
var op_fn1 = function() {
|
var op_fn1 = function() {
|
||||||
var check_img = $('#imgholder').find("input[type='checkbox']:checked").parents('li').find('img');
|
var check_img = $('#imgholder').find("input[type='checkbox']:checked").parents('li').find('img');
|
||||||
check_img.each(function(){
|
check_img.each(function(){
|
||||||
check_img.css('transform','rotate('+$('#show_degree').text()+'deg)');
|
check_img.css('transform','rotate('+$('#show_degree').text()+'deg)');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var op_fn2 = function() {
|
var op_fn2 = function() {
|
||||||
var confirm_msg = translate('','','gallery.confirm_msg',true)
|
var confirm_msg = translate('','','gallery.confirm_msg',true)
|
||||||
if ( confirm (confirm_msg) ){
|
if ( confirm (confirm_msg) ){
|
||||||
var check_li = $('#imgholder').find("input[type='checkbox']:checked").parents('li');
|
var check_li = $('#imgholder').find("input[type='checkbox']:checked").parents('li');
|
||||||
var image_ids =[];
|
var image_ids =[];
|
||||||
check_li.each(function(){
|
check_li.each(function(){
|
||||||
image_ids.push($(this).data('image-id'));
|
image_ids.push($(this).data('image-id'));
|
||||||
});
|
});
|
||||||
if (navigator.onLine) {
|
if (navigator.onLine) {
|
||||||
window.location.href = '/admin/galleries/rotate_images?image_ids=' + image_ids.join(',') +'&rotate_angle=' + $('#show_degree').text()
|
window.location.href = '/admin/galleries/rotate_images?image_ids=' + image_ids.join(',') +'&rotate_angle=' + $('#show_degree').text()
|
||||||
} else {
|
} else {
|
||||||
alert('Please connect the network and try again later!')
|
alert('Please connect the network and try again later!')
|
||||||
}
|
}
|
||||||
console.log(image_ids)
|
console.log(image_ids)
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
var op_fn3 = function() { $(this).dialog("close"); }
|
var op_fn3 = function() { $(this).dialog("close"); }
|
||||||
var op1 = translate('','','gallery.review',true)
|
var op1 = translate('','','gallery.review',true)
|
||||||
var op2 = translate('','','gallery.rotate',true)
|
var op2 = translate('','','gallery.rotate',true)
|
||||||
var op3 = translate('','','gallery.close_panel',true)
|
var op3 = translate('','','gallery.close_panel',true)
|
||||||
buttons_option[op1] = op_fn1
|
buttons_option[op1] = op_fn1
|
||||||
buttons_option[op2] = op_fn2
|
buttons_option[op2] = op_fn2
|
||||||
buttons_option[op3] = op_fn3
|
buttons_option[op3] = op_fn3
|
||||||
$("#crop_div").dialog({
|
$("#crop_div").dialog({
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
show: "blind",
|
show: "blind",
|
||||||
hide: "explode",
|
hide: "explode",
|
||||||
|
|
|
@ -46,6 +46,17 @@ class Admin::GalleriesController < OrbitAdminController
|
||||||
'back_end'
|
'back_end'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
def get_tag
|
||||||
|
album = Album.find(params['ele_id']) rescue nil
|
||||||
|
if !album.nil?
|
||||||
|
text = album.tags.collect do |tag|
|
||||||
|
"<li class=\"label\"> #{tag.name}</li>"
|
||||||
|
end.join
|
||||||
|
render :text => text
|
||||||
|
else
|
||||||
|
render :text => ''
|
||||||
|
end
|
||||||
|
end
|
||||||
def rotate_images
|
def rotate_images
|
||||||
begin
|
begin
|
||||||
image_ids = params['image_ids'].split(',')
|
image_ids = params['image_ids'].split(',')
|
||||||
|
@ -268,6 +279,12 @@ class Admin::GalleriesController < OrbitAdminController
|
||||||
albums2 = search_data(albums2,[:name])
|
albums2 = search_data(albums2,[:name])
|
||||||
@fiter_albums = albums1.concat(albums2)
|
@fiter_albums = albums1.concat(albums2)
|
||||||
end
|
end
|
||||||
|
def update_album_setting
|
||||||
|
AlbumSetting.first.update_attributes(limit: params['album_setting_limit'])
|
||||||
|
redirect_to '/admin/galleries'
|
||||||
|
end
|
||||||
|
def setting
|
||||||
|
end
|
||||||
def index
|
def index
|
||||||
album_length = Album.all.count
|
album_length = Album.all.count
|
||||||
album_sort = Album.all.asc(:created_at)
|
album_sort = Album.all.asc(:created_at)
|
||||||
|
@ -279,13 +296,22 @@ class Admin::GalleriesController < OrbitAdminController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@url = request.original_fullpath
|
@url = request.original_fullpath
|
||||||
|
if AlbumSetting.first.nil?
|
||||||
|
AlbumSetting.create()
|
||||||
|
elsif AlbumSetting.count > 1
|
||||||
|
AlbumSetting.all.to_a[1..-1].each do |album_setting|
|
||||||
|
album_setting.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@limit_count = AlbumSetting.first.limit.to_i
|
||||||
|
@limit_count = album_length if @limit_count == 0
|
||||||
if params['page_no'].nil?
|
if params['page_no'].nil?
|
||||||
@show_script = true
|
@show_script = true
|
||||||
@albums = filter_album.take 50
|
@albums = filter_album.take @limit_count
|
||||||
else
|
else
|
||||||
@show_script = false
|
@show_script = false
|
||||||
start = (params['page_no'].to_i - 1)*50
|
start = (params['page_no'].to_i - 1)*@limit_count
|
||||||
@albums = filter_album[start...start+50]
|
@albums = filter_album[start...start+@limit_count]
|
||||||
end
|
end
|
||||||
if AlbumColor.count!=0
|
if AlbumColor.count!=0
|
||||||
if AlbumColor.all.desc('updated_at').first[:color] == 'transparent'
|
if AlbumColor.all.desc('updated_at').first[:color] == 'transparent'
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AlbumSetting
|
||||||
|
include Mongoid::Document
|
||||||
|
include Mongoid::Timestamps
|
||||||
|
field :limit
|
||||||
|
end
|
|
@ -19,9 +19,11 @@
|
||||||
<li class="albumcateg"><%= (Category.find(album.category_id).title rescue album.category_id) %></li>
|
<li class="albumcateg"><%= (Category.find(album.category_id).title rescue album.category_id) %></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="albumtag">
|
<ul class="albumtag">
|
||||||
<% album.tags.each do |tag| %>
|
<!--
|
||||||
<% r = @tags.select { |k| k.id.to_s == tag.id.to_s } %>
|
<%# album.tags.each do |tag| %>
|
||||||
<li class="label"><%= r.map {|t| t.name}[0]%></li>
|
<%# r = @tags.select { |k| k.id.to_s == tag.id.to_s } %>
|
||||||
<%end%>
|
<li class="label"><%# r.map {|t| t.name}[0]%></li>
|
||||||
|
<%# end%>
|
||||||
|
-->
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
|
@ -9,7 +9,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var page_no = 2
|
var page_no = 2
|
||||||
var catch_flag = true
|
var catch_flag = true
|
||||||
var max_page = <%= (@fiter_albums.length/50).ceil %>
|
var max_page = <%= (@fiter_albums.length/@limit_count).ceil %>
|
||||||
$('.bottomnav').ready(function(){
|
$('.bottomnav').ready(function(){
|
||||||
function load_html_func(){
|
function load_html_func(){
|
||||||
$('#load_html').text("<%= t('gallery.wait_time') %>")
|
$('#load_html').text("<%= t('gallery.wait_time') %>")
|
||||||
|
@ -46,6 +46,18 @@
|
||||||
<%= render_filter @filter_fields, "orbit_gallery" %>
|
<%= render_filter @filter_fields, "orbit_gallery" %>
|
||||||
<div class="order-edit-notification">Albums re-ordering enabled.</div>
|
<div class="order-edit-notification">Albums re-ordering enabled.</div>
|
||||||
<%= render 'recreate_thumb' %>
|
<%= render 'recreate_thumb' %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('form.update_album_setting_form').submit(function(){
|
||||||
|
window.setTimeout(function(){alert('success')},500)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<%= form_tag '/admin/galleries/update_album_setting',remote: true,:class=>'update_album_setting_form' do %>
|
||||||
|
<%= t('gallery.album_limit_for_one_page') %>:
|
||||||
|
<%= text_field_tag :album_setting_limit, AlbumSetting.first.limit,:placeholder => t('gallery.blank_for_nil') %>
|
||||||
|
<input type="submit" value="<%= t('submit') %>">
|
||||||
|
<% end %>
|
||||||
<div class="rgbody" style='float: left;'>
|
<div class="rgbody" style='float: left;'>
|
||||||
<ul id="orbit_gallery" class="gallery clearfix" data-gallery-id="gallery"
|
<ul id="orbit_gallery" class="gallery clearfix" data-gallery-id="gallery"
|
||||||
style='display: inline-flex;flex-wrap: wrap;'>
|
style='display: inline-flex;flex-wrap: wrap;'>
|
||||||
|
@ -57,7 +69,7 @@
|
||||||
<% if can_edit_or_delete?(nil) %>
|
<% if can_edit_or_delete?(nil) %>
|
||||||
<a href="#" class="btn btn-small btn-info order-btn-class" id="edit-order-btn"><%= t('gallery.edit_order') %></a>
|
<a href="#" class="btn btn-small btn-info order-btn-class" id="edit-order-btn"><%= t('gallery.edit_order') %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @fiter_albums.length > 50 %>
|
<% if @fiter_albums.length > @limit_count %>
|
||||||
<button class="btn btn-small btn-info" id="load_html"><%= t('gallery.load_html') %></button>
|
<button class="btn btn-small btn-info" id="load_html"><%= t('gallery.load_html') %></button>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('form.update_album_setting_form').submit(function(){
|
||||||
|
window.setTimeout(function(){alert('success')},500)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<%= form_tag '/admin/galleries/update_album_setting',remote: true,:class=>'update_album_setting_form' do %>
|
||||||
|
<%= t('gallery.album_limit_for_one_page') %>:
|
||||||
|
<%= text_field_tag :album_setting_limit, AlbumSetting.first.limit,:placeholder => t('gallery.blank_for_nil') %>
|
||||||
|
<input type="submit" value="<%= t('submit') %>">
|
||||||
|
<% end %>
|
|
@ -1,6 +1,8 @@
|
||||||
en:
|
en:
|
||||||
|
|
||||||
gallery:
|
gallery:
|
||||||
|
album_limit_for_one_page: Amount of limit for album in one page
|
||||||
|
blank_for_nil: blank present no limit
|
||||||
load_html: Load next 50 data
|
load_html: Load next 50 data
|
||||||
wait_time: please wait a minute
|
wait_time: please wait a minute
|
||||||
show_desc: Show the album description
|
show_desc: Show the album description
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
zh_tw:
|
zh_tw:
|
||||||
|
|
||||||
gallery:
|
gallery:
|
||||||
|
album_limit_for_one_page: 一頁呈現的相簿數量
|
||||||
|
blank_for_nil: 留白表示無限制
|
||||||
load_html: 存取下50筆
|
load_html: 存取下50筆
|
||||||
wait_time: 請稍等
|
wait_time: 請稍等
|
||||||
show_desc: 顯示相簿描述
|
show_desc: 顯示相簿描述
|
||||||
|
|
|
@ -1,43 +1,41 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
|
||||||
locales = Site.first.in_use_locales rescue I18n.available_locales
|
locales = Site.first.in_use_locales rescue I18n.available_locales
|
||||||
|
|
||||||
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
||||||
get "/xhr/galleries/theater/:id" => "galleries#theater"
|
get "/xhr/galleries/theater/:id" => "galleries#theater"
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
get "galleries/get_photoData_json" => "galleries#get_photoData_json"
|
get "galleries/get_photoData_json" => "galleries#get_photoData_json"
|
||||||
get "galleries/recreate_image" => "galleries#recreate_image"
|
get "galleries/recreate_image" => "galleries#recreate_image"
|
||||||
get "galleries/crop_process" => "images#crop_process"
|
get "galleries/crop_process" => "images#crop_process"
|
||||||
post "galleries/recreate_image/recreate_progress" => "galleries#recreate_progress"
|
post "galleries/recreate_image/recreate_progress" => "galleries#recreate_progress"
|
||||||
get "galleries/recreate_image/finish_recreate" => "galleries#finish_recreate"
|
get "galleries/recreate_image/finish_recreate" => "galleries#finish_recreate"
|
||||||
get "galleries/batch_crop" => "images#batch_crop"
|
get "galleries/batch_crop" => "images#batch_crop"
|
||||||
get "galleries/new_images" => "galleries#new_images"
|
get "galleries/new_images" => "galleries#new_images"
|
||||||
get "galleries/last_image_id" => "galleries#last_image_id"
|
get "galleries/last_image_id" => "galleries#last_image_id"
|
||||||
post "galleries/set_cover" => "galleries#set_cover"
|
post "galleries/set_cover" => "galleries#set_cover"
|
||||||
post "galleries/delete_photos" => "images#delete_photos"
|
post "galleries/delete_photos" => "images#delete_photos"
|
||||||
post "galleries/update_image" => "images#update_image"
|
post "galleries/update_image" => "images#update_image"
|
||||||
post "galleries/image_tagging" => "images#image_tagging"
|
post "galleries/image_tagging" => "images#image_tagging"
|
||||||
post "galleries/order" => "images#changeorder"
|
post "galleries/order" => "images#changeorder"
|
||||||
post "galleries/translate" => "galleries#call_translate"
|
post "galleries/translate" => "galleries#call_translate"
|
||||||
post "galleries/save_crop" => "galleries#save_crop"
|
post "galleries/save_crop" => "galleries#save_crop"
|
||||||
get "galleries/rotate_images" => "galleries#rotate_images"
|
get "galleries/rotate_images" => "galleries#rotate_images"
|
||||||
get "galleries/upload_process" => "galleries#upload_process"
|
get "galleries/upload_process" => "galleries#upload_process"
|
||||||
post "galleries/start_upload_process" => "galleries#start_upload_process"
|
post "galleries/start_upload_process" => "galleries#start_upload_process"
|
||||||
post "galleries/init_upload" => "galleries#init_upload"
|
post "galleries/init_upload" => "galleries#init_upload"
|
||||||
resources :galleries do
|
post "galleries/get_tag" => "galleries#get_tag"
|
||||||
get "imgs" => "galleries#imgs"
|
post "galleries/update_album_setting" => "galleries#update_album_setting"
|
||||||
member do
|
get "galleries/setting" => "galleries#setting"
|
||||||
get "import"
|
resources :galleries do
|
||||||
get "excel_format"
|
get "imgs" => "galleries#imgs"
|
||||||
post "importimages"
|
member do
|
||||||
end
|
get "import"
|
||||||
|
get "excel_format"
|
||||||
|
post "importimages"
|
||||||
end
|
end
|
||||||
resources :images
|
end
|
||||||
post "galleries/upload_image" => "galleries#upload_image"
|
resources :images
|
||||||
|
post "galleries/upload_image" => "galleries#upload_image"
|
||||||
|
# match "image_tagging" => "album_images#image_tagging"
|
||||||
# match "image_tagging" => "album_images#image_tagging"
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
module Gallery
|
module Gallery
|
||||||
class Engine < ::Rails::Engine
|
class Engine < ::Rails::Engine
|
||||||
initializer "gallery" do
|
initializer "gallery" do
|
||||||
OrbitApp.registration "Gallery", :type => "ModuleApp" do
|
OrbitApp.registration "Gallery", :type => "ModuleApp" do
|
||||||
module_label "gallery.gallery"
|
module_label "gallery.gallery"
|
||||||
base_url File.expand_path File.dirname(__FILE__)
|
base_url File.expand_path File.dirname(__FILE__)
|
||||||
widget_methods ["widget"]
|
widget_methods ["widget"]
|
||||||
# widget_settings []
|
# widget_settings []
|
||||||
widget_settings [{"data_count"=>10}]
|
widget_settings [{"data_count"=>10}]
|
||||||
|
@ -13,41 +13,46 @@ module Gallery
|
||||||
authorizable
|
authorizable
|
||||||
frontend_enabled
|
frontend_enabled
|
||||||
data_count 1..30
|
data_count 1..30
|
||||||
side_bar do
|
side_bar do
|
||||||
head_label_i18n 'gallery.gallery', icon_class: "icons-pictures"
|
head_label_i18n 'gallery.gallery', icon_class: "icons-pictures"
|
||||||
available_for "users"
|
available_for "users"
|
||||||
active_for_controllers (['admin/galleries','admin/images'])
|
active_for_controllers (['admin/galleries','admin/images'])
|
||||||
head_link_path "admin_galleries_path"
|
head_link_path "admin_galleries_path"
|
||||||
|
|
||||||
context_link 'gallery.all',
|
context_link 'gallery.all',
|
||||||
:link_path=>"admin_galleries_path" ,
|
:link_path=>"admin_galleries_path" ,
|
||||||
:priority=>1,
|
:priority=>1,
|
||||||
:active_for_action=>{'admin/galleries'=>"index"},
|
:active_for_action=>{'admin/galleries'=>"index"},
|
||||||
:available_for => 'users'
|
:available_for => 'users'
|
||||||
|
|
||||||
context_link 'gallery.new',
|
context_link 'gallery.new',
|
||||||
:link_path=>"new_admin_gallery_path" ,
|
:link_path=>"new_admin_gallery_path" ,
|
||||||
:priority=>2,
|
:priority=>2,
|
||||||
:active_for_action=>{'admin/galleries'=>"new"},
|
:active_for_action=>{'admin/galleries'=>"new"},
|
||||||
:available_for => 'sub_managers'
|
:available_for => 'sub_managers'
|
||||||
|
|
||||||
context_link 'categories',
|
context_link 'categories',
|
||||||
:link_path=>"admin_module_app_categories_path" ,
|
:link_path=>"admin_module_app_categories_path" ,
|
||||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'gallery').id}",
|
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'gallery').id}",
|
||||||
:priority=>3,
|
:priority=>3,
|
||||||
:active_for_action=>{'admin/galleries'=>'categories'},
|
:active_for_action=>{'admin/galleries'=>'categories'},
|
||||||
:active_for_category => 'Gallery',
|
:active_for_category => 'Gallery',
|
||||||
:available_for => 'managers'
|
:available_for => 'managers'
|
||||||
|
|
||||||
context_link 'tags',
|
context_link 'tags',
|
||||||
:link_path=>"admin_module_app_tags_path" ,
|
:link_path=>"admin_module_app_tags_path" ,
|
||||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'gallery').id}",
|
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'gallery').id}",
|
||||||
:priority=>4,
|
:priority=>4,
|
||||||
:active_for_action=>{'admin/galleries'=>'tags'},
|
:active_for_action=>{'admin/galleries'=>'tags'},
|
||||||
:active_for_tag => 'Gallery',
|
:active_for_tag => 'Gallery',
|
||||||
:available_for => 'managers'
|
:available_for => 'managers'
|
||||||
end
|
context_link 'setting',
|
||||||
end
|
:link_path=>"admin_galleries_setting_path" ,
|
||||||
end
|
:priority=>5,
|
||||||
|
:active_for_action=>{'admin/galleries'=>'setting'},
|
||||||
|
:available_for => 'managers'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue