Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ee5879db9 |
No files matched your search
@@ -541,8 +541,6 @@ function changeStatusHidden() {
|
||||
|
||||
// Document Ready
|
||||
$(function() {
|
||||
showFiltersOnPageRefresh();
|
||||
|
||||
new ini();
|
||||
$('#main-wrap').on('click', '.delete', function() {
|
||||
api.modal($(this).attr('rel'));
|
||||
@@ -591,35 +589,4 @@ $(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;
|
||||
}
|
||||
});
|
||||
@@ -81,7 +81,7 @@ function customOpenSlide() {
|
||||
} else {
|
||||
$('#pageslide form').prop('method', 'post')
|
||||
};
|
||||
_type == 'page' ? pageSetting(element.data('id'), _edit, pageslide) : linkSetting(element.data('id'), _edit, pageslide);
|
||||
_type == 'page' ? pageSetting(element.data('id'), _edit) : linkSetting(element.data('id'), _edit, pageslide);
|
||||
}
|
||||
});
|
||||
$iFrame.pageslide({
|
||||
@@ -130,13 +130,12 @@ function iFrameContent() {
|
||||
}).css('cursor', 'default');
|
||||
}
|
||||
$('#pageslide_iframe').load(function() {
|
||||
var $iContents = $(this).contents(),
|
||||
$pc = $iContents.find('.page_content');
|
||||
iFrameFunction($iContents, $pc);
|
||||
var $iContents = $(this).contents(),
|
||||
$pc = $iContents.find('.page_content');
|
||||
$(this).get(0).contentWindow.externalFunction(iFrameFunction, $iContents, $pc);
|
||||
});
|
||||
}
|
||||
|
||||
function pageSetting(id, edit, ps) {
|
||||
function pageSetting(id, edit) {
|
||||
$pageModule = $('#pageslide #page_module_app_id');
|
||||
$pageF2E = $('#pageslide #page_app_frontend_url');
|
||||
$pageDivF2E = $('#pageslide #front_url');
|
||||
@@ -184,29 +183,23 @@ function pageSetting(id, edit, ps) {
|
||||
|
||||
if(val.category.length > 0) {
|
||||
$.each(val.category, function(index, val) {
|
||||
var _arr = $.inArray($(this)[1], _selectData.module.category);
|
||||
var _arr = $.inArray($(this)[1], _selectData.module.category[1]);
|
||||
$pageCategory.append('<label class="checkbox"><input type="checkbox" name="page[category][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
||||
if(_arr !== -1) {
|
||||
if(!_selectData.module.category[0] && _arr !== -1) {
|
||||
$pageCategory.find('input[type="checkbox"]').eq(index).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);
|
||||
_selectData.module.category[0] ? $pageCategory.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
||||
});
|
||||
$pageCategoryGroup.show();
|
||||
}
|
||||
if(val.tags.length > 0) {
|
||||
$.each(val.tags, function(index, val) {
|
||||
var _arr = $.inArray($(this)[1], _selectData.module.tags);
|
||||
var _arr = $.inArray($(this)[1], _selectData.module.tags[1]);
|
||||
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
||||
if(_arr !== -1) {
|
||||
if(!_selectData.module.tags[0] && _arr !== -1) {
|
||||
$pageTags.find('input[type="checkbox"]').eq(index).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);
|
||||
_selectData.module.tags[0] ? $pageTags.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
||||
});
|
||||
$pageTagsGroup.show();
|
||||
}
|
||||
@@ -401,44 +394,36 @@ $(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) : '';
|
||||
var _arr = _select ? $.inArray($(this)[1], _select.category[1]) : '';
|
||||
$pageCategory.append('<label class="checkbox"><input type="checkbox" name="page[category][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
||||
if(_boolean && _arr !== -1) {
|
||||
if(_select && !_select.category[0] && _arr !== -1) {
|
||||
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||
}
|
||||
var $all = $pageCategory.siblings('.checkbox').children('.select_all');
|
||||
_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);
|
||||
_select && _val == _select.main && _select.category[0] ? $pageCategory.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
||||
}
|
||||
});
|
||||
$pageCategoryGroup.slideDown(300);
|
||||
$pageCategoryGroup.show();
|
||||
} else {
|
||||
$pageCategoryGroup.slideUp(300);
|
||||
$hiddenInputA.removeAttr('name');
|
||||
$pageCategoryGroup.hide();
|
||||
}
|
||||
$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) : '';
|
||||
var _arr = _select ? $.inArray($(this)[1], _select.tags[1]) : '';
|
||||
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
|
||||
if(_boolean && _arr !== -1) {
|
||||
if(_select && !_select.tags[0] && _arr !== -1) {
|
||||
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
|
||||
}
|
||||
var $all = $pageTags.siblings('.checkbox').children('.select_all');
|
||||
_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);
|
||||
_select && _val == _select.main && _select.tags[0] ? $pageTags.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
|
||||
}
|
||||
});
|
||||
$pageTagsGroup.slideDown(300);
|
||||
$pageTagsGroup.show();
|
||||
} else {
|
||||
$pageTagsGroup.slideUp(300);
|
||||
$hiddenInputB.removeAttr('name');
|
||||
$pageTagsGroup.hide();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -466,18 +451,12 @@ $(function() {
|
||||
|
||||
$('#pageslide').on('change', '.checkbox-groups input', function(event) {
|
||||
var $checked = $(this);
|
||||
|
||||
if($checked.attr('type') == 'checkbox') {
|
||||
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.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.prop('checked')) {
|
||||
$checked.closest('.active-link').addClass('active').siblings('active-link').removeClass('active').end().find('.active-mune').slideDown(300);
|
||||
if(_status) {
|
||||
@@ -491,15 +470,6 @@ $(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')) {
|
||||
|
||||
@@ -1,66 +1,93 @@
|
||||
//Preview need a link in form as Ex and a corresponding PUT action in controller
|
||||
//Ex preview trigger:
|
||||
// <%= link_to "NewPreview", realtime_preview_admin_ad_banner_path(ad_banner_tab) , :class=>'preview_trigger'%>
|
||||
|
||||
$(function() {
|
||||
$(".post_preview").click(function(){
|
||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||
|
||||
$.post($(this).attr('url'), $(".previewable").serialize() ,function(data){
|
||||
$('#show_preview .modal').modal();
|
||||
$('#show_preview .modal').height(function() {
|
||||
return $(window).height() * 0.7;
|
||||
});
|
||||
},'script');
|
||||
});
|
||||
$(".preview_trigger").click(function(){
|
||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||
$.ajax({
|
||||
type: 'PUT',
|
||||
url: $(this).attr("href"),
|
||||
data: $(this).parents("form").serialize(),
|
||||
success: function (msg) {
|
||||
$('#show_preview .modal').modal();
|
||||
$('#show_preview .modal').height(function() {
|
||||
return $(window).height() * 0.7;
|
||||
});
|
||||
},
|
||||
error: function(){
|
||||
alert("ERROR");
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
// $('#main-wrap').on(clickEvent, '.post_preview, .preview_trigger', function(e) {
|
||||
// $(".post_preview").click(function(e){
|
||||
// $("#main-wrap").after("<span id='show_preview'></span>");
|
||||
// if($(this).hasClass('post_preview')) {
|
||||
// var attrs = e.target.attributes;
|
||||
// var url = attrs['url'];
|
||||
// $("form.previewable").ajaxSubmit({
|
||||
// beforeSubmit: function(a,f,o){
|
||||
// o.dataType = 'script';
|
||||
// o.url = url.nodeValue;
|
||||
// o.type = 'post';
|
||||
// },success: function(msg) {
|
||||
// $('#show_preview .modal').modal()
|
||||
// $('#show_preview .modal').height(function() {
|
||||
// return $(window).height() * 0.7;
|
||||
// });
|
||||
// }
|
||||
|
||||
// });
|
||||
// } else if($(this).hasClass('preview_trigger')) {
|
||||
// $.ajax({
|
||||
// type: 'PUT',
|
||||
// url: $(this).attr("href"),
|
||||
// data: $(this).parents("form").serialize(),
|
||||
// success: function (msg) {
|
||||
// $('#show_preview .modal').modal();
|
||||
// $('#show_preview .modal').height(function() {
|
||||
// return $(window).height() * 0.7;
|
||||
// });
|
||||
// },
|
||||
// error: function(){
|
||||
// alert("ERROR");
|
||||
// }
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
// e.preventDefault();
|
||||
// var form = $(this).parents("form").first()
|
||||
// //var cont = form["content"].value;
|
||||
// // $.ajax({
|
||||
// // type: 'POST',
|
||||
// // url: $(this).attr("href")+'?preview=true',
|
||||
// // data: form.serialize(),
|
||||
// // dataType: "script",
|
||||
// // success: function (msg) {
|
||||
// // $("#"+start_modal_with_id).modal('show'); },
|
||||
// // error: function(){
|
||||
// // alert("ERROR");
|
||||
// // }
|
||||
// // });
|
||||
// url = "/panel/news/back_end/news_bulletins/preview?preview=true"
|
||||
// // alert(url)
|
||||
// form.attr("action",url);
|
||||
// form.submit();
|
||||
// //return false;
|
||||
// });
|
||||
// /panel/announcement/back_end/bulletins/preview
|
||||
$('#main-wrap').on(clickEvent, '.post_preview, .preview_trigger', function(e) {
|
||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||
if($(this).hasClass('post_preview')) {
|
||||
var attrs = e.target.attributes;
|
||||
var url = attrs['url'];
|
||||
$("form.previewable").ajaxSubmit({
|
||||
beforeSubmit: function(a,f,o){
|
||||
o.dataType = 'script';
|
||||
o.url = url.nodeValue;
|
||||
o.type = 'post';
|
||||
},success: function(msg) {
|
||||
$('#show_preview .modal').modal()
|
||||
$('#show_preview .modal').height(function() {
|
||||
return $(window).height() * 0.7;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
} else if($(this).hasClass('preview_trigger')) {
|
||||
$.ajax({
|
||||
type: 'PUT',
|
||||
url: $(this).attr("href"),
|
||||
data: $(this).parents("form").serialize(),
|
||||
success: function (msg) {
|
||||
$('#show_preview .modal').modal();
|
||||
$('#show_preview .modal').height(function() {
|
||||
return $(window).height() * 0.7;
|
||||
});
|
||||
},
|
||||
error: function(){
|
||||
alert("ERROR");
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
// $("a.preview_trigger").on('click',function(){
|
||||
// $("#main-wrap").after("<span id='show_preview'></span>");
|
||||
// $.ajax({
|
||||
// type: 'PUT',
|
||||
// url:$(this).attr("href"),
|
||||
// data:$(this).parents("form").serialize(),
|
||||
// success: function (msg) {
|
||||
// $("#"+start_modal_with_id).modal('show'); },
|
||||
// error: function(){
|
||||
// alert("ERROR");
|
||||
// }
|
||||
// });
|
||||
// return false;
|
||||
// });
|
||||
// $("form.nccu_ajax_form").ajaxForm({
|
||||
// beforeSubmit: function(a,f,o) {
|
||||
// // if(clicked_what.hasClass("post_preview")){
|
||||
// // $("#main-wrap").after("<span id='show_preview'></span>");
|
||||
// // o.dataType = 'script';
|
||||
// // o.url = clicked_what.attr("url");
|
||||
// // }
|
||||
// },
|
||||
// success: function(data) {
|
||||
// // if(!clicked_what.hasClass("post_preview")){
|
||||
// // window.location = data.redirect_url;
|
||||
// // }
|
||||
// }
|
||||
// })
|
||||
});
|
||||
@@ -54,9 +54,10 @@ class Admin::DesignsController < OrbitBackendController
|
||||
when 'javascripts', 'themes'#, 'images'
|
||||
@object = @design.send(params[:type]).find(params[:object_id])
|
||||
end
|
||||
|
||||
Dir.mktmpdir('f_path') { |dir|
|
||||
temp_file = File.new(dir + '/' + File.basename(@object.file.url), 'w+')
|
||||
temp_file.write(params[:html_code].force_encoding('UTF-8'))
|
||||
temp_file.write(params[:file][:content].force_encoding('UTF-8'))
|
||||
@object.remove_file!
|
||||
@object.file = temp_file
|
||||
@object.save
|
||||
|
||||
@@ -23,9 +23,7 @@ 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[@part.widget_path]["style"] rescue nil
|
||||
@frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil
|
||||
@partial = 'custom_widget' if @frontend_styles.present?
|
||||
end
|
||||
end
|
||||
@@ -97,7 +95,9 @@ 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.js
|
||||
format.html {
|
||||
redirect_to admin_page_url(@part.page, edit: true)
|
||||
}
|
||||
end
|
||||
else
|
||||
@id = params[:id]
|
||||
|
||||
@@ -21,12 +21,6 @@ class Admin::PagesController < Admin::ItemsController
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:page][:category][0] == ""
|
||||
params[:page][:category] = []
|
||||
end
|
||||
if params[:page][:tag][0] == ""
|
||||
params[:page][:tag] = []
|
||||
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 )
|
||||
@@ -66,8 +60,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? ? page.category.map{|c| c.to_s} : []
|
||||
m["tags"] = page.tag.present? ? page.tag.map{|c| c.to_s} : []
|
||||
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["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]
|
||||
|
||||
@@ -341,18 +341,9 @@ class ApplicationController < ActionController::Base
|
||||
else
|
||||
objects = get_viewable(object_class, query)
|
||||
end
|
||||
|
||||
if (!user_signed_in? && object_class == "bulletin")
|
||||
objects = get_bulletins_for_open_backend(objects)
|
||||
end
|
||||
|
||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
def get_bulletins_for_open_backend(objects)
|
||||
objects.select{|object| object.is_rejected == false && object.is_pending == false}
|
||||
end
|
||||
|
||||
def get_string_value_from_object(object)
|
||||
s = object.name_translations[I18n.locale.to_s] unless s rescue nil
|
||||
s = object.title_translations[I18n.locale.to_s] unless s rescue nil
|
||||
|
||||
@@ -5,61 +5,42 @@
|
||||
<%= t(:server_usage) %>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="box-content" style='overflow: hidden; text-align:center;'>
|
||||
<div id="cpu_usage" class="pull-left" style="width:200px; height:160px; display: inline-block;"></div>
|
||||
<div id="mem_usage" style="width:200px; height:160px; display: inline-block;"></div>
|
||||
<div id="disk_usage" class="pull-right" style="width:200px; height:160px; display: inline-block;"></div>
|
||||
<div class="box-content" style='overflow: hidden;'>
|
||||
<span id="cpu_usage" style="display:inline-block;margin: 0 auto"></span>
|
||||
<span id="mem_usage" style="display:inline-block;margin: 0 auto"></span>
|
||||
<span id="disk_usage" style="display:inline-block;margin: 0 auto"></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var Gages = { 'CPU':{
|
||||
'JustGage': null,
|
||||
'container': 'cpu_usage',
|
||||
'title': 'CPU Usage',
|
||||
'fn': 'get_cpu_usage',
|
||||
'update_interval': 2000
|
||||
},
|
||||
'Mem':{
|
||||
'JustGage': null,
|
||||
'container': 'mem_usage',
|
||||
'title': 'Memory Usage',
|
||||
'fn': 'get_mem_usage',
|
||||
'update_interval': 10000
|
||||
},
|
||||
'Disk':{
|
||||
'JustGage': null,
|
||||
'container': 'disk_usage',
|
||||
'title': 'Disk Usage',
|
||||
'fn': 'get_disk_usage',
|
||||
'update_interval': 30000
|
||||
}
|
||||
};
|
||||
google.load('visualization', '1', {packages:['gauge']});
|
||||
|
||||
var UsageTpye = {'CPU':{'fn':'get_cpu_usage','chart':null,'id':'cpu_usage','interval':2000},
|
||||
'Mem':{'fn':'get_mem_usage','chart':null,'id':'mem_usage','interval':5000},
|
||||
'Disk':{'fn':'get_disk_usage','chart':null,'id':'disk_usage','interval':30000}};
|
||||
|
||||
$(function () {
|
||||
$.each(Gages,function(id,Gage){
|
||||
Gage['JustGage'] = new JustGage({
|
||||
id: Gage['container'],
|
||||
value: 0,
|
||||
min: 0,
|
||||
max: 100,
|
||||
title: Gage['title'],
|
||||
shadowVerticalOffset: 10,
|
||||
levelColors: ['#39D824','#FFC33F','#F51F1F'],
|
||||
titleFontColor: '#666',
|
||||
valueFontColor: '#666',
|
||||
labelFontColor: '#666',
|
||||
label: '%',
|
||||
refreshAnimationTime: 800
|
||||
});
|
||||
$.each(UsageTpye,function(type,option){
|
||||
option['chart'] = new google.visualization.Gauge(document.getElementById(option['id']));
|
||||
update_usage(type,option);
|
||||
|
||||
update_usage(Gage);
|
||||
setInterval(function() { update_usage(type,option); }, option['interval']);
|
||||
});
|
||||
});
|
||||
|
||||
function update_usage(Gage){
|
||||
$.get('/admin/dashboards/'+Gage['fn'],function(usage){
|
||||
Gage['JustGage'].refresh(parseInt(usage));
|
||||
setTimeout(function(){update_usage(Gage);},Gage['update_interval']);
|
||||
});
|
||||
}
|
||||
function update_usage(type,option){
|
||||
$.get('/admin/dashboards/'+option['fn'],function(usage){
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Label', 'Value'],
|
||||
[type, parseInt(usage)]
|
||||
]);
|
||||
|
||||
var options = {
|
||||
width: 400, height: 180,
|
||||
redFrom: 80, redTo: 100,
|
||||
yellowFrom:60, yellowTo: 80,
|
||||
minorTicks: 5
|
||||
};
|
||||
|
||||
option['chart'].draw(data, options);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -15,4 +15,20 @@
|
||||
vAxis:{minValue:-100,viewWindowMode: 'maximized'}
|
||||
} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
renderLineChart = function (element, series, opts) {
|
||||
waitForLoaded(function () {
|
||||
var options = jsOptions(series, opts);
|
||||
var data = createDataTable(series, "datetime");
|
||||
var formatter = new google.visualization.DateFormat({
|
||||
pattern: options.pattern
|
||||
});
|
||||
formatter.format(data, 0);
|
||||
var chart = new google.visualization.LineChart(element);
|
||||
resize(function () {
|
||||
chart.draw(data, options);
|
||||
});
|
||||
});
|
||||
};
|
||||
</script>
|
||||
@@ -1,18 +1,15 @@
|
||||
<%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>
|
||||
<%= javascript_include_tag "/static/justgage.1.0.1.min.js" %>
|
||||
<%= javascript_include_tag "/static/raphael.2.1.0.min.js" %>
|
||||
|
||||
<section id="main-wrap">
|
||||
<div class="wrap-inner initial">
|
||||
<div class="row-fluid">
|
||||
<% if is_admin? %>
|
||||
<div class="box span7">
|
||||
<div class="box span6">
|
||||
<div id='server_loading'>
|
||||
<%= render 'server_loading' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="box span5">
|
||||
<div class="box span6">
|
||||
<div id='traffic'>
|
||||
<%= render 'traffic' %>
|
||||
</div>
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
</div>
|
||||
|
||||
<% @design.javascripts.each do |js| %>
|
||||
<div class="clearfix tab-pane fade active in" id="<%= dom_id js %>">
|
||||
<div class="clearfix tab-pane fade active in" id="#<%= dom_id js %>">
|
||||
<%= render :partial => 'tab_form', :locals => {:type => :javascripts, :object => js} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -28,22 +28,20 @@
|
||||
<%= select_tag "page[app_frontend_url]", nil, class: "input-xlarge change" %>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-groups hide" id="page-category-groups" data-for="category">
|
||||
<div class="checkbox-groups hide" id="page-category-groups">
|
||||
<%= f.label :categories, t(:categories) %>
|
||||
<%= 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" data-for="tag">
|
||||
<div class="checkbox-groups hide" id="page-tags-groups">
|
||||
<%= 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,9 +16,8 @@
|
||||
<% else %>
|
||||
<%= link_to node.title, node.url %>
|
||||
<% end %>
|
||||
|
||||
<div class="item-menu">
|
||||
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), eval("admin_#{node.class.to_s.downcase}_path(node)"), class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
|
||||
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), "/#{node.path}?edit=true", class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
|
||||
<% if node.class.to_s.downcase.eql?("page") %>
|
||||
<%= 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,25 +3,4 @@
|
||||
<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>
|
||||
@@ -1,18 +0,0 @@
|
||||
<% if (not(@selected[:module_app].widget_options(@selected[:app_frontend_url]).blank?) and @selected[:app_frontend_url]!='default_widget')%>
|
||||
|
||||
|
||||
<% @selected[:module_app].widget_options(@selected[:app_frontend_url]).get_options.each do |key,settings| %>
|
||||
<% options = settings[:opts] %>
|
||||
<%= label_tag(t(settings[:label_i18n]))%>
|
||||
<% case options%>
|
||||
<% when Hash%>
|
||||
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)) %>
|
||||
<% else%>
|
||||
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)) %>
|
||||
<!-- (@part[:widget_field][i][0] if (@part && !@part[:widget_field].blank? && !@part[:widget_field][i].blank?)) ) -->
|
||||
<% end %>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
@@ -3,7 +3,8 @@
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "lib/items/page_part" %>
|
||||
<% end %>
|
||||
<%= form_for @part, url: {action: "update"}, :remote=>true, html: { class: "form-horizontal main-forms"} do |f| %>
|
||||
|
||||
<%= form_for @part, url: admin_page_part_path(@part), html: { class: "form-horizontal main-forms"} do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<label href="#none" class="btn btn-large" data-toggle="tab">
|
||||
@@ -80,7 +81,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, :value => (@part.title_translations[locale] rescue nil) %>
|
||||
<%= f.text_field locale, class: 'input-xlarge page_title', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -101,13 +102,13 @@
|
||||
<%= f.label :categories, t(:categories), class: "control-label muted" %>
|
||||
<div class="controls">
|
||||
<%= content_tag :label, class: "checkbox" do %>
|
||||
<%= check_box_tag nil, nil, false, class: "select_all" %> <%= t(:all) %>
|
||||
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||
<% end %>
|
||||
<div class="groups" id="page-category">
|
||||
<%= content_tag_for(:label, @module_app_categories, class: "checkbox inline") do |category|%>
|
||||
<%= check_box_tag("page_part[category][]", category.id, (@part.category.include?(category.id.to_s) rescue false) ) %>
|
||||
<%= check_box_tag("page_part[tag][]", category.id, (@part.category.include?(category.id) rescue false) ) %>
|
||||
<%= category.title %>
|
||||
<% end if @module_app_categories %>
|
||||
<% end if @module_app_tags %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -119,7 +120,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.to_s) rescue false) ) %>
|
||||
<%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id) rescue false) ) %>
|
||||
<%= tag.name %>
|
||||
<% end if @module_app_tags %>
|
||||
</div>
|
||||
@@ -160,10 +161,3 @@
|
||||
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + "&id=" + "<%= @part.id %>" );
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function toggleChecked(status) {
|
||||
$(".checkbox").each( function() {
|
||||
$(this).attr("checked",status);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -1 +0,0 @@
|
||||
window.location.href="<%= admin_page_url(@part.page, edit: true) %>"
|
||||
@@ -24,12 +24,12 @@
|
||||
<ul class="nav nav-pills filter-nav pull-right">
|
||||
<li class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a href="#collapse-role" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="filter-group accordion-group">
|
||||
<div class="accordion-body collapse" id="collapse-role">
|
||||
<div class="accordion-body collapse" id="collapse-status">
|
||||
|
||||
<%= render :partial => "filter"%>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<ul class="nav nav-pills filter-nav pull-right">
|
||||
<li class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a href="#collapse-role" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="filter-group accordion-group">
|
||||
<div class="accordion-body collapse" id="collapse-role">
|
||||
<div class="accordion-body collapse" id="collapse-status">
|
||||
|
||||
<%= render :partial => "filter"%>
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<ul class="nav nav-pills filter-nav pull-right">
|
||||
<li class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a href="#collapse-role" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Roles</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="filter-group accordion-group">
|
||||
<div class="accordion-body collapse" id="collapse-role">
|
||||
<div class="accordion-body collapse" id="collapse-status">
|
||||
|
||||
<%= render :partial => "filter"%>
|
||||
|
||||
|
||||
@@ -13,21 +13,13 @@
|
||||
<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();
|
||||
@@ -38,14 +30,6 @@
|
||||
$("#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>
|
||||
@@ -93,7 +93,7 @@ def unzip_design(file, zip_name)
|
||||
site.design = design
|
||||
site.save
|
||||
theme = design.themes.first
|
||||
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => nil, :menu_enabled_for => {"zh_tw"=>"true", "en"=>"true"} )
|
||||
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => theme.id, :menu_enabled_for => [] )
|
||||
|
||||
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
||||
home.save
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ namespace :site do
|
||||
site.design = design
|
||||
site.save
|
||||
theme = design.themes.first
|
||||
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => nil, :menu_enabled_for => {"zh_tw"=>"true", "en"=>"true"} )
|
||||
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => theme.id, :menu_enabled_for => [] )
|
||||
|
||||
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
||||
home.save
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
/**
|
||||
* JustGage - a handy JavaScript plugin for generating and animating nice & clean dashboard gauges.
|
||||
* Copyright (c) 2012 Bojan Djuricic - pindjur(at)gmail(dot)com | http://www.madcog.com
|
||||
* Licensed under MIT.
|
||||
* Date: 31/07/2012
|
||||
* @author Bojan Djuricic (@Toorshia)
|
||||
* @version 1.0
|
||||
*
|
||||
* http://www.justgage.com
|
||||
*/
|
||||
|
||||
JustGage=function(x){if(!x.id){alert("Missing id parameter for gauge!");return false}if(!document.getElementById(x.id)){alert('No element with id: "'+x.id+'" found!');return false}this.config={id:x.id,title:(x.title)?x.title:"Title",titleFontColor:(x.titleFontColor)?x.titleFontColor:"#999999",value:(x.value)?x.value:0,valueFontColor:(x.valueFontColor)?x.valueFontColor:"#010101",min:(x.min)?x.min:0,max:(x.max)?x.max:100,showMinMax:(x.showMinMax!=null)?x.showMinMax:true,gaugeWidthScale:(x.gaugeWidthScale)?x.gaugeWidthScale:1,gaugeColor:(x.gaugeColor)?x.gaugeColor:"#edebeb",label:(x.label)?x.label:"",showInnerShadow:(x.showInnerShadow!=null)?x.showInnerShadow:true,shadowOpacity:(x.shadowOpacity)?x.shadowOpacity:0.2,shadowSize:(x.shadowSize)?x.shadowSize:5,shadowVerticalOffset:(x.shadowVerticalOffset)?x.shadowVerticalOffset:3,levelColors:(x.levelColors)?x.levelColors:percentColors,levelColorsGradient:(x.levelColorsGradient!=null)?x.levelColorsGradient:true,labelFontColor:(x.labelFontColor)?x.labelFontColor:"#b3b3b3",startAnimationTime:(x.startAnimationTime)?x.startAnimationTime:700,startAnimationType:(x.startAnimationType)?x.startAnimationType:">",refreshAnimationTime:(x.refreshAnimationTime)?x.refreshAnimationTime:700,refreshAnimationType:(x.refreshAnimationType)?x.refreshAnimationType:">"};if(x.value>this.config.max){this.config.value=this.config.max}if(x.value<this.config.min){this.config.value=this.config.min}this.originalValue=x.value;this.canvas=Raphael(this.config.id,"100%","100%");var d=getStyle(document.getElementById(this.config.id),"width").slice(0,-2)*1;var q=getStyle(document.getElementById(this.config.id),"height").slice(0,-2)*1;var c,l;if((d/q)>1.25){c=1.25*q;l=q}else{c=d;l=d/1.25}var i=(d-c)/2;var g=(q-l)/2;var s=((l/8)>10)?(l/10):10;var n=i+c/2;var m=g+l/6.5;var k=((l/6.4)>16)?(l/6.4):16;var r=i+c/2;var p=g+l/1.4;var b=((l/16)>10)?(l/16):10;var f=i+c/2;var e=p+k/2+6;var j=((l/16)>10)?(l/16):10;var w=i+(c/10)+(c/6.666666666666667*this.config.gaugeWidthScale)/2;var v=g+l/1.126760563380282;var h=((l/16)>10)?(l/16):10;var u=i+c-(c/10)-(c/6.666666666666667*this.config.gaugeWidthScale)/2;var t=g+l/1.126760563380282;this.params={canvasW:d,canvasH:q,widgetW:c,widgetH:l,dx:i,dy:g,titleFontSize:s,titleX:n,titleY:m,valueFontSize:k,valueX:r,valueY:p,labelFontSize:b,labelX:f,labelY:e,minFontSize:j,minX:w,minY:v,maxFontSize:h,maxX:u,maxY:t};this.canvas.customAttributes.pki=function(K,L,N,E,O,F,D,y){var B=(1-(K-L)/(N-L))*Math.PI,G=E/2-E/10,J=G-E/6.666666666666667*y,C=E/2+F,A=O/1.25+D,H=E/2+F+G*Math.cos(B),P=O-(O-A)+D-G*Math.sin(B),M=E/2+F+J*Math.cos(B),z=O-(O-A)+D-J*Math.sin(B),I;I+="M"+(C-J)+","+A+" ";I+="L"+(C-G)+","+A+" ";I+="A"+G+","+G+" 0 0,1 "+H+","+P+" ";I+="L"+M+","+z+" ";I+="A"+J+","+J+" 0 0,0 "+(C-J)+","+A+" ";I+="z ";return{path:I}};this.gauge=this.canvas.path().attr({stroke:"none",fill:this.config.gaugeColor,pki:[this.config.max,this.config.min,this.config.max,this.params.widgetW,this.params.widgetH,this.params.dx,this.params.dy,this.config.gaugeWidthScale]});this.gauge.id=this.config.id+"-gauge";this.level=this.canvas.path().attr({stroke:"none",fill:getColorForPercentage((this.config.value-this.config.min)/(this.config.max-this.config.min),this.config.levelColors,this.config.levelColorsGradient),pki:[this.config.min,this.config.min,this.config.max,this.params.widgetW,this.params.widgetH,this.params.dx,this.params.dy,this.config.gaugeWidthScale]});this.level.id=this.config.id+"-level";this.txtTitle=this.canvas.text(this.params.titleX,this.params.titleY,this.config.title);this.txtTitle.attr({"font-size":this.params.titleFontSize,"font-weight":"bold","font-family":"Arial",fill:this.config.titleFontColor,"fill-opacity":"1"});this.txtTitle.id=this.config.id+"-txttitle";this.txtValue=this.canvas.text(this.params.valueX,this.params.valueY,this.originalValue);this.txtValue.attr({"font-size":this.params.valueFontSize,"font-weight":"bold","font-family":"Arial",fill:this.config.valueFontColor,"fill-opacity":"0"});this.txtValue.id=this.config.id+"-txtvalue";this.txtLabel=this.canvas.text(this.params.labelX,this.params.labelY,this.config.label);this.txtLabel.attr({"font-size":this.params.labelFontSize,"font-weight":"normal","font-family":"Arial",fill:this.config.labelFontColor,"fill-opacity":"0"});this.txtLabel.id=this.config.id+"-txtlabel";this.txtMin=this.canvas.text(this.params.minX,this.params.minY,this.config.min);this.txtMin.attr({"font-size":this.params.minFontSize,"font-weight":"normal","font-family":"Arial",fill:this.config.labelFontColor,"fill-opacity":(this.config.showMinMax==true)?"1":"0"});this.txtMin.id=this.config.id+"-txtmin";this.txtMax=this.canvas.text(this.params.maxX,this.params.maxY,this.config.max);this.txtMax.attr({"font-size":this.params.maxFontSize,"font-weight":"normal","font-family":"Arial",fill:this.config.labelFontColor,"fill-opacity":(this.config.showMinMax==true)?"1":"0"});this.txtMax.id=this.config.id+"-txtmax";var a=this.canvas.canvas.childNodes[1];var o="http://www.w3.org/20
Line truncated
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
// +--------------------------------------------------------------------+ \\
|
||||
// ¦ Raphaël 2.1.0 - JavaScript Vector Library ¦ \\
|
||||
// +--------------------------------------------------------------------¦ \\
|
||||
// ¦ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) ¦ \\
|
||||
// ¦ Copyright © 2008-2012 Sencha Labs (http://sencha.com) ¦ \\
|
||||
// +--------------------------------------------------------------------¦ \\
|
||||
// ¦ Licensed under the MIT (http://raphaeljs.com/license.html) license.¦ \\
|
||||
// +--------------------------------------------------------------------+ \\
|
||||
|
||||
(function(a){var b="0.3.4",c="hasOwnProperty",d=/[\.\/]/,e="*",f=function(){},g=function(a,b){return a-b},h,i,j={n:{}},k=function(a,b){var c=j,d=i,e=Array.prototype.slice.call(arguments,2),f=k.listeners(a),l=0,m=!1,n,o=[],p={},q=[],r=h,s=[];h=a,i=0;for(var t=0,u=f.length;t<u;t++)"zIndex"in f[t]&&(o.push(f[t].zIndex),f[t].zIndex<0&&(p[f[t].zIndex]=f[t]));o.sort(g);while(o[l]<0){n=p[o[l++]],q.push(n.apply(b,e));if(i){i=d;return q}}for(t=0;t<u;t++){n=f[t];if("zIndex"in n)if(n.zIndex==o[l]){q.push(n.apply(b,e));if(i)break;do{l++,n=p[o[l]],n&&q.push(n.apply(b,e));if(i)break}while(n)}else p[n.zIndex]=n;else{q.push(n.apply(b,e));if(i)break}}i=d,h=r;return q.length?q:null};k.listeners=function(a){var b=a.split(d),c=j,f,g,h,i,k,l,m,n,o=[c],p=[];for(i=0,k=b.length;i<k;i++){n=[];for(l=0,m=o.length;l<m;l++){c=o[l].n,g=[c[b[i]],c[e]],h=2;while(h--)f=g[h],f&&(n.push(f),p=p.concat(f.f||[]))}o=n}return p},k.on=function(a,b){var c=a.split(d),e=j;for(var g=0,h=c.length;g<h;g++)e=e.n,!e[c[g]]&&(e[c[g]]={n:{}}),e=e[c[g]];e.f=e.f||[];for(g=0,h=e.f.length;g<h;g++)if(e.f[g]==b)return f;e.f.push(b);return function(a){+a==+a&&(b.zIndex=+a)}},k.stop=function(){i=1},k.nt=function(a){if(a)return(new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)")).test(h);return h},k.off=k.unbind=function(a,b){var f=a.split(d),g,h,i,k,l,m,n,o=[j];for(k=0,l=f.length;k<l;k++)for(m=0;m<o.length;m+=i.length-2){i=[m,1],g=o[m].n;if(f[k]!=e)g[f[k]]&&i.push(g[f[k]]);else for(h in g)g[c](h)&&i.push(g[h]);o.splice.apply(o,i)}for(k=0,l=o.length;k<l;k++){g=o[k];while(g.n){if(b){if(g.f){for(m=0,n=g.f.length;m<n;m++)if(g.f[m]==b){g.f.splice(m,1);break}!g.f.length&&delete g.f}for(h in g.n)if(g.n[c](h)&&g.n[h].f){var p=g.n[h].f;for(m=0,n=p.length;m<n;m++)if(p[m]==b){p.splice(m,1);break}!p.length&&delete g.n[h].f}}else{delete g.f;for(h in g.n)g.n[c](h)&&g.n[h].f&&delete g.n[h].f}g=g.n}}},k.once=function(a,b){var c=function(){var d=b.apply(this,arguments);k.unbind(a,c);return d};return k.on(a,c)},k.version=b,k.toString=function(){return"You are running Eve "+b},typeof module!="undefined"&&module.exports?module.exports=k:typeof define!="undefined"?define("eve",[],function(){return k}):a.eve=k})(this),function(){function cF(a){for(var b=0;b<cy.length;b++)cy[b].el.paper==a&&cy.splice(b--,1)}function cE(b,d,e,f,h,i){e=Q(e);var j,k,l,m=[],o,p,q,t=b.ms,u={},v={},w={};if(f)for(y=0,z=cy.length;y<z;y++){var x=cy[y];if(x.el.id==d.id&&x.anim==b){x.percent!=e?(cy.splice(y,1),l=1):k=x,d.attr(x.totalOrigin);break}}else f=+v;for(var y=0,z=b.percents.length;y<z;y++){if(b.percents[y]==e||b.percents[y]>f*b.top){e=b.percents[y],p=b.percents[y-1]||0,t=t/b.top*(e-p),o=b.percents[y+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[y]])}if(!!j){if(!k){for(var A in j)if(j[g](A))if(U[g](A)||d.paper.customAttributes[g](A)){u[A]=d.attr(A),u[A]==null&&(u[A]=T[A]),v[A]=j[A];switch(U[A]){case C:w[A]=(v[A]-u[A])/t;break;case"colour":u[A]=a.getRGB(u[A]);var B=a.getRGB(v[A]);w[A]={r:(B.r-u[A].r)/t,g:(B.g-u[A].g)/t,b:(B.b-u[A].b)/t};break;case"path":var D=bR(u[A],v[A]),E=D[1];u[A]=D[0],w[A]=[];for(y=0,z=u[A].length;y<z;y++){w[A][y]=[0];for(var F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(E[y][F]-u[A][y][F])/t}break;case"transform":var H=d._,I=ca(H[A],v[A]);if(I){u[A]=I.from,v[A]=I.to,w[A]=[],w[A].real=!0;for(y=0,z=u[A].length;y<z;y++){w[A][y]=[u[A][y][0]];for(F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(v[A][y][F]-u[A][y][F])/t}}else{var J=d.matrix||new cb,K={_:{transform:H.transform},getBBox:function(){return d.getBBox(1)}};u[A]=[J.a,J.b,J.c,J.d,J.e,J.f],b$(K,v[A]),v[A]=K._.transform,w[A]=[(K.matrix.a-J.a)/t,(K.matrix.b-J.b)/t,(K.matrix.c-J.c)/t,(K.matrix.d-J.d)/t,(K.matrix.e-J.e)/t,(K.matrix.f-J.f)/t]}break;case"csv":var L=r(j[A])[s](c),M=r(u[A])[s](c);if(A=="clip-rect"){u[A]=M,w[A]=[],y=M.length;while(y--)w[A][y]=(L[y]-u[A][y])/t}v[A]=L;break;default:L=[][n](j[A]),M=[][n](u[A]),w[A]=[],y=d.paper.customAttributes[A].length;while(y--)w[A][y]=((L[y]||0)-(M[y]||0))/t}}var O=j.easing,P=a.easing_formulas[O];if(!P){P=r(O).match(N);if(P&&P.length==5){var R=P;P=function(a){return cC(a,+R[1],+R[2],+R[3],+R[4],t)}}else P=bf}q=j.start||b.start||+(new Date),x={anim:b,percent:e,timestamp:q,start:q+(b.del||0),status:0,initstatus:f||0,stop:!1,ms:t,easing:P,from:u,diff:w,to:v,el:d,callback:j.callback,prev:p,next:o,repeat:i||b.times,origin:d.attr(),totalOrigin:h},cy.push(x);if(f&&!k&&!l){x.stop=!0,x.start=new Date-t*f;if(cy.length==1)return cA()}l&&(x.start=new Date-x.ms*f),cy.length==1&&cz(cA)}else k.initstatus=f,k.start=new Date-k.ms*f;eve("raphael.anim.start."+d.id,d,b)}}function cD(a,b){var c=[],d={};this.ms=b,this.times=1;if(a){for(var e in a)a[g](e)&&(d[Q(e)]=a[e],c.push(Q(e)));c.sort(bd)}this.anim=d,this.top=c[c.length-1],this.percents=c}function cC(a,b,c,d,e,f){function o(a,b){var c,d,e,f,j,k;for(e=a,k=0;k<8;k++){f=m(e)-a;if(z(f)<b)return e;j=(3*i*e+2*h)*e+g;if(z(j)<1e-6)break;e=e-f/j}c=0,d=1,e=a;if(e<c)return c;if(e>d)return d;while(c<d){f=m(e);if(z(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(Line truncated
|
||||
@@ -239,7 +239,7 @@ $(function() {
|
||||
}
|
||||
});
|
||||
var fetchNewImages = function(){
|
||||
var lastid = ( $("li.rgalbum:last").length ? $("li.rgalbum:last").data("image-id") : null),
|
||||
var lastid = $("li.rgalbum:last").data("image-id"),
|
||||
albumid = $("#fileupload_aid").val();
|
||||
|
||||
$.ajax({
|
||||
|
||||
@@ -13,7 +13,6 @@ 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;
|
||||
|
||||
+67
-2
@@ -32,8 +32,73 @@ 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){
|
||||
var imageArray;
|
||||
var imagecount = 0;
|
||||
@@ -213,7 +278,7 @@ var galleryAPI = function(){
|
||||
}
|
||||
|
||||
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,24 +95,15 @@
|
||||
display: inline-block;
|
||||
float: left;
|
||||
color: #777777;
|
||||
font-size: 1.2em;
|
||||
font-size: 11px;
|
||||
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: 3px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
#orbit_gallery .rgalbum .gallery_info li.albumcateg {
|
||||
float: right;
|
||||
@@ -239,7 +230,6 @@
|
||||
#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/loading.gif") no-repeat;
|
||||
background: #fff 0 center url("../../../assets/gallery/ajax-loader.gif") no-repeat;
|
||||
height: 16px;
|
||||
margin: auto;
|
||||
width: 220px;
|
||||
width: 32px;
|
||||
}
|
||||
Vendored
+7
-14
@@ -155,15 +155,10 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
render :json=>{"files"=>a}.to_json
|
||||
end
|
||||
|
||||
def new_images
|
||||
if params[:last_image_id] != ""
|
||||
@lastimage = GalleryImage.find(params[:last_image_id])
|
||||
@album = GalleryAlbum.find(params[:album_id])
|
||||
@newimages = @album.gallery_images.where(:created_at.gt => @lastimage.created_at)
|
||||
else
|
||||
@album = GalleryAlbum.find(params[:album_id])
|
||||
@newimages = @album.gallery_images
|
||||
end
|
||||
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)
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
@@ -189,11 +184,9 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||
tagsToDestroy << tag
|
||||
end
|
||||
end
|
||||
if new_tags != nil
|
||||
new_tags.each do |tag|
|
||||
if !old_tags.include?(tag)
|
||||
tagsToAdd << tag
|
||||
end
|
||||
new_tags.each do |tag|
|
||||
if !old_tags.include?(tag)
|
||||
tagsToAdd << tag
|
||||
end
|
||||
end
|
||||
update_children_image_tag(tagsToDestroy,tagsToAdd)
|
||||
|
||||
Vendored
+47
-2
@@ -1,11 +1,56 @@
|
||||
class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
|
||||
def index
|
||||
@albums = GalleryAlbum.where(:category_id.in => params[:category_id])
|
||||
end
|
||||
|
||||
def show
|
||||
@album = GalleryAlbum.find(params[:id])
|
||||
@images = @album.gallery_images
|
||||
@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
|
||||
end
|
||||
|
||||
def imgs
|
||||
|
||||
+2
-3
@@ -8,10 +8,9 @@
|
||||
<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><%= 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>
|
||||
<li class="albumcateg"></li>
|
||||
</ul>
|
||||
<ul class="albumtag">
|
||||
<% album.tagged_ids.each do |tag| %>
|
||||
|
||||
+13
-4
@@ -63,9 +63,15 @@
|
||||
<div class="nav-name"><strong>Language</strong></div>
|
||||
<ul class="nav nav-pills language-nav">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= (i == 0 ? 'class=active' : '') %>>
|
||||
<a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
|
||||
<% if i == 0 %>
|
||||
<li class="active">
|
||||
<a href=".en" data-toggle="tab">English</a>
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<a href=".tw_zh" data-toggle="tab">Chinese</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab-content language-area">
|
||||
@@ -73,8 +79,11 @@
|
||||
|
||||
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<div class="tab-pane fade in <%= (i == 0 ? 'active' : '') %> <%= locale %>">
|
||||
<% if i == 0 %>
|
||||
<div class="tab-pane fade in active en">
|
||||
<% else %>
|
||||
<div class="tab-pane fade tw_zh">
|
||||
<% end %>
|
||||
<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,12 +4,6 @@
|
||||
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
@@ -1,14 +0,0 @@
|
||||
<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
@@ -1,5 +0,0 @@
|
||||
<div class='rgphoto'>
|
||||
<a title='<%= image.description %>' href='<%= theater_panel_gallery_front_end_album_path(image) %>'>
|
||||
<img src='<%= image.file.thumb.url %>'/>
|
||||
</a>
|
||||
</div>
|
||||
+32
-4
@@ -1,14 +1,42 @@
|
||||
|
||||
|
||||
<%= 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>
|
||||
|
||||
+36
-3
@@ -1,12 +1,45 @@
|
||||
|
||||
<%= 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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ module Gallery
|
||||
|
||||
customize_widget "widget1" do
|
||||
widget_i18n "gallery.widget.widget1"
|
||||
style ["1","2"]
|
||||
style []
|
||||
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}
|
||||
|
||||
-1
@@ -50,7 +50,6 @@ module Videos
|
||||
#* customize_widget_options_fields_i18n({"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.album"}} )
|
||||
customize_widget "channel_videos" do
|
||||
widget_i18n "videos.widget.channel_videos"
|
||||
style ["1","2"]
|
||||
options "channel_videos",:i18n =>"videos.channel_videos",:options_item => {"query"=>"ChannelVideo.all", "value"=>:id, "label"=>:channel_name}
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user