Compare commits

..
Author SHA1 Message Date
Manson Wang f744bf266c Working on dashboard 2013-11-01 18:45:12 +08:00
162 changed files with 1242 additions and 2227 deletions

No files matched your search

+2 -1
View File
@@ -71,7 +71,8 @@ gem 'redis-search'
gem 'syslog-logger'
gem "recaptcha", :require => "recaptcha/rails"
gem "chartkick"
gem 'puma'
gem 'request-log-analyzer'
gem 'usagewatch'
# Gems used only for assets and not required
@@ -12,7 +12,6 @@ $(function() {
}
else {
setForm(item.data('form'));
if( $( ".color-picker" ).length ) $(".color-picker").miniColors("value",item.data("form").color);
pageslide.find('form').attr('action', '/admin/module_apps/' + item.data('module') + '/categories/' + item.data('id'));
pageslide.find('form').attr('method', 'put');
}
+4 -36
View File
@@ -38,8 +38,8 @@ if($.support.touch) {
$checked.each(function() {
if(!$(this).closest('div').hasClass('togglebox')) {
$(this).wrap('<div class="toggle-control"/>');
if($(this).attr('type') == "hidden" && $(this).attr('value') == 'true') {
$(this).wrap('<div class="togglebox disable" />');
if($(this).attr('type') == "hidden" && $(this).attr('value')) {
$(this).wrap('<div class="togglebox disabled" />');
} else {
$(this).wrap('<div class="togglebox" />');
}
@@ -71,6 +71,7 @@ if($.support.touch) {
$(this).parent('.togglebox').removeClass('disable').closest('li').removeClass('disabled');
};
} else {
console.log($(this))
if($(this).prop('checked')) {
$(this).parent('.togglebox').addClass('disable').closest('li').addClass('disabled');
};
@@ -540,8 +541,6 @@ function changeStatusHidden() {
// Document Ready
$(function() {
showFiltersOnPageRefresh();
new ini();
$('#main-wrap').on('click', '.delete', function() {
api.modal($(this).attr('rel'));
@@ -590,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;
}
});
+2 -2
View File
@@ -4,7 +4,7 @@ var banner_index = 0;
$(document).ready(function() {
$.each($(".dymanic_load"),function(){
if($(this).attr("path")==''){
$(this).html("");
$(this).html("App setting Failed");
}else{
ajax_load_proc($(this),$(this).attr("path"));
}
@@ -16,7 +16,7 @@ $(document).ready(function() {
function ajax_load_proc(wapper,url,isBanner){
$.get(encodeURI(url), {}, function(respText,textSta,XML){
if (textSta == 'success') {
if (respText.indexOf("<title>") == -1) wapper.html(respText);
wapper.html(respText);
};
if(textSta == 'error')
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
+48 -82
View File
@@ -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);
}
});
$iFrame.pageslide({
@@ -111,32 +111,31 @@ function customOpenSlide() {
.closest('.navbar-inner')
.addClass('active');
pageslide.find('.content').css('padding', 0);
// iFrameContent()
iFrameContent()
}
});
}
// function iFrameContent() {
// function iFrameFunction(iContents, pc) {
// pc.each(function(index, el) {
// if($(this).siblings('*').length == 0) {
// var _parentH = $(this).parent('*').outerHeight();
// $(this).css('min-height', _parentH);
// }
// });
// iContents.find('#orbit-bar').hide();
// iContents.find('.main_wrap').css('margin-top', 0);
// iContents.find('a').not('.edit_link a').on('click', function(event) {
// event.preventDefault();
// }).css('cursor', 'default');
// }
// $('#pageslide_iframe').load(function() {
// var $iContents = $(this).contents(),
// $pc = $iContents.find('.page_content');
// iFrameFunction($iContents, $pc);
// });
// }
function pageSetting(id, edit, ps) {
function iFrameContent() {
function iFrameFunction(iContents, pc) {
pc.each(function(index, el) {
if($(this).siblings('*').length == 0) {
var _parentH = $(this).parent('*').outerHeight();
$(this).css('height', _parentH);
}
});
iContents.find('#orbit-bar').hide();
iContents.find('.main_wrap').css('margin-top', 0);
iContents.find('a').not('.edit_link a').on('click', function(event) {
event.preventDefault();
}).css('cursor', 'default');
}
$('#pageslide_iframe').load(function() {
var $iContents = $(this).contents(),
$pc = $iContents.find('.page_content');
$(this).get(0).contentWindow.externalFunction(iFrameFunction, $iContents, $pc);
});
}
function pageSetting(id, edit) {
$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();
}
@@ -244,8 +237,8 @@ function pageSetting(id, edit, ps) {
};
};
function linkSetting(id, edit, ps) {
$linkPublishedTrue = ps.find('#link_is_published_true');
function linkSetting(id, edit) {
$linkPublishedTrue = $('#link_is_published_true');
_status = edit;
if(_status) {
$.ajax({
@@ -257,7 +250,6 @@ function linkSetting(id, edit, ps) {
})
.done(function(data) {
_linkData = data;
console.log($linkPublishedTrue)
data.public ? $linkPublishedTrue.prop('checked', true) : $linkPublishedTrue.prop('checked', false);
$linkPublishedTrue.prop('checked') ? $('.link-options').slideDown(300) : $('.link-options').slideUp(300);
$.each(_linkData.link, function(index, val) {
@@ -294,6 +286,7 @@ function getView(module_id, id) {
cache: false,
});
}
$(function() {
$pageModule = null,
$pageF2E = null,
@@ -334,11 +327,7 @@ $(function() {
} else {
position = $(ui.item).index();
};
var next_sibling = $(ui.item).next(),
next_sibling_id = null;
if( next_sibling )
next_sibling_id = next_sibling.attr("id");
$.post("<%= Rails.application.routes.url_helpers.update_position_admin_items_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: position, "next_sibling_id" : next_sibling_id } );
$.post("<%= Rails.application.routes.url_helpers.update_position_admin_items_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: position } );
}
});
$(".sortable").delegate(".brand, .delete", clickEvent, function(e){
@@ -401,44 +390,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');
_boolean && _val == _select.main && _select.category.length ? $hiddenInputA.removeAttr('name') : $hiddenInputA.attr('name', 'page[category][]');
_boolean && _val == _select.main && _select.category.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
_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');
_boolean && _val == _select.main && _select.tags.length ? $hiddenInputB.removeAttr('name') : $hiddenInputB.attr('name', 'page[tag][]');
_boolean && _val == _select.main && _select.tags.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false);
_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 +447,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 +466,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,18 +0,0 @@
$(function() {
// for toggle-check
$('.role_filter_checked').on({
change: function() {
var _path = $(this).data('path');
// var path = <%= @path %>
$.ajax({
url: _path,
type: 'POST',
dataType: 'json',
data: {remote: true},
})
.done(function() {})
.fail(function() {})
.always(function() {});
},
});
});
@@ -222,7 +222,7 @@ $(function() {
});
$('#user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
if($(this).hasClass('togglebox')) {
if($(this).hasClass('disable')) {
if($(this).hasClass('disabled')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.closest('.attributes')
@@ -237,7 +237,7 @@ $(function() {
.children('.attributes-body')
.fadeOut(300);
}
$(this).toggleClass('disable');
$(this).toggleClass('disabled');
};
if($(this).hasClass('remove-input')) {
$(this).closest('.input-append').fadeOut(300, function() {
@@ -382,7 +382,7 @@ $(function() {
});
$('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
if($(this).hasClass('togglebox')) {
if($(this).hasClass('disable')) {
if($(this).hasClass('disabled')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.closest('.attributes')
@@ -411,7 +411,7 @@ $(function() {
$(this).parent('.field-type').removeClass('in');
});
}
$(this).toggleClass('disable');
$(this).toggleClass('disabled');
};
if($(this).hasClass('delete')) {
$(this).closest('.attributes').fadeOut(300, function() {
+89 -62
View File
@@ -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;
// // }
// }
// })
});
+1 -1
View File
@@ -51,7 +51,7 @@ $(function() {
}
if($('.set-sidebar-state').length) {
if(window.localStorage.getItem('sidebarState') == 1) {
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disable');
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disabled');
}
$('.set-sidebar-state').on({
change: function() {
+1 -2
View File
@@ -3,5 +3,4 @@
//= require lib/all-list
//= require lib/jquery.fastLiveFilter.js
//= require lib/checkbox.card.js
//= require lib/jquery.form.js
//= require lib/member/member-role.js
//= require lib/jquery.form.js
@@ -56,10 +56,4 @@
width: 26px;
height: 3px;
background: url(miniColors/line.gif) center no-repeat;
}
.miniColors-trigger.btn {
background-image: none;
height: 16px;
width: 0px;
}
@@ -50,16 +50,6 @@ class Admin::DashboardsController < OrbitBackendController
render :json => @usw.uw_diskused_perc.to_s
end
def get_month_traffic
result = []
(0..31).each do |i|
the_day = i.day.ago
visits = Impression.where( created_at: {'$gte' => the_day.beginning_of_day, '$lte' => the_day.end_of_day}).count
result.push({the_day.strftime("%b-%d")=>visits})
end
render :js => result.to_json
end
protected
def get_module_app_count(*args)
+2 -1
View File
@@ -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
@@ -1,573 +0,0 @@
# encoding: utf-8
require 'net/http'
require 'open-uri'
class Admin::ImportDataController < OrbitBackendController
helper Admin::PagePartsHelper
include Admin::FrontendWidgetInterface
def get_teacher_data
uri = URI("https://localhost:8000/teachers.xml")
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
#uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
@teacher_data = Hash.from_xml(res.body)
@teachers = @teacher_data["objects"]
@i = 5000
@teachers.each do |hash|
# @roles = Role.skip(1).first
@roles = Role.all
@teacher = User.new
I18n.locale = :zh_tw
if !hash['teacher_zh_tw'].blank?
@teacher.first_name = hash['teacher_zh_tw']
elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank?
@teacher.first_name = hash['teacher_en']
elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
@teacher.first_name = "Please Fill the Name"
end
I18n.locale = :en
if !hash['teacher_en'].blank?
@teacher.first_name = hash['teacher_en']
elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank?
@teacher.first_name = hash['teacher_zh_tw']
elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank?
@teacher.first_name = "Please Fill the Name"
end
#@teacher.first_name = hash['teacher_en']
@teacher.ntu_seq = hash['ntu_seq']
@teacher.sid = hash['ntu_seq']
@teacher.role_ids = ["#{@roles.skip(1).first.id}"]
@teacher.password = "testpass"
@i += 10
if !hash['email'].blank?
@user = User.where(email: "#{hash['email']}")
if @user.length == 0
@teacher.email = hash['email']
elsif @user.length > 0
@teacher.email = "#{@i}duplicate@ntu.edu.tw"
end
else
@teacher.email = "#{@i}@ntu.edu.tw"
end
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
@teacher.user_id = "defaultuser"
elsif hash['teacher_en'].blank?
@teacher.user_id = hash['teacher_zh_tw']
elsif hash['teacher_zh_tw']
@teacher.user_id = hash['teacher_en']
end
@teacher.save!
end
end
def get_book_data
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
teachers = User.all
teachers.each do |hash|
if hash.sid.present?
ntu_seq = hash.sid
books_xml = Nokogiri::XML( \
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
@books = books_xml.xpath("//Book").map do |book_node|
{
author: (book_node>"Authors").text,
year: (book_node>"PublishYear").text,
title: (book_node>"DocTitle").text,
remarks: (book_node>"Remarks").text,
publisher: (book_node>"Publisher").text,
book_title: (book_node>"BookTitle").text
}
end
if @books.present?
@books.each do |b|
@book = WritingBook.new
I18n.locale = :zh_tw
@book.authors = b[:author]
@book.paper_title = b[:title]
@book.book_title = b[:book_title]
@book.note = b[:remarks]
@book.publisher = b[:publisher]
I18n.locale = :en
@book.authors = b[:author]
@book.paper_title = b[:title]
@book.book_title = b[:book_title]
@book.note = b[:remarks]
@book.publisher = b[:publisher]
@book.year = b[:year]
@book.create_user_id = hash.id
@book.save
end
else
puts "No books by Teacher"
end
end
end
end
def get_conference_data
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
teachers = User.all
teachers.each do |hash|
if hash.sid.present?
ntu_seq = hash.sid
conference_xml = Nokogiri::XML( \
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
{
author: (cp_node>"Authors").text,
year: (cp_node>"PublishYear").text,
title: (cp_node>"PaperTitle").text,
conference: (cp_node>"PublishOn").text,
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
conference_title: (cp_node>"PublishOn").text,
remarks: (cp_node>"Remarks").text
}
end
if @conference_papers.present?
@conference_papers.each do |b|
@conference_paper = WritingConference.new
I18n.locale = :zh_tw
@conference_paper.authors = b[:author]
if b[:title].blank?
@conference_paper.paper_title = "No Title Present"
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
I18n.locale = :en
@conference_paper.authors = b[:author]
if b[:title].blank?
@conference_paper.paper_title = "No Title Present"
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
@conference_paper.location = b[:location]
@conference_paper.year = b[:year]
@conference_paper.create_user_id = hash.id
@conference_paper.save!
end
else
puts "No conference by Teacher"
end
end
end
end
def get_journal_paper_data
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
teachers = User.all
teachers.each do |hash|
if hash.sid.present?
ntu_seq = hash.sid
paper_xml = Nokogiri::XML( \
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
{
author: (paper_node>"Authors").text,
year: (paper_node>"PublishYear").text,
title: (paper_node>"PaperTitle").text,
journal: (paper_node>"PublishOn").text,
volume:(paper_node>"Volume").text,
volumeno:(paper_node>"VolumeNo").text,
beginpage:(paper_node>"BeginPage").text,
endpage:(paper_node>"EndPage").text,
subgroup:(paper_node>"subgroup").text,
remarks: (paper_node>"Remarks").text,
cate: ((paper_node>"subgroup")>"Group").text
}
end
if @journal_papers.present?
@journal_papers.each do |b|
@journal_paper = WritingJournal.new
I18n.locale = :zh_tw
@journal_paper.authors = b[:author]
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
I18n.locale = :en
@journal_paper.authors = b[:author]
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
@journal_paper.year = b[:year]
@journal_paper.vol_no = b[:volumeno]
@journal_paper.form_to_start = b[:beginpage]
@journal_paper.form_to_end = b[:endpage]
if !b[:cate].blank?
@level_type = JournalLevelType.where(:key => b[:cate])
if @level_type.present?
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
end
end
@journal_paper.create_user_id = hash.id
@journal_paper.save!
end
else
puts "No journal paper by Teacher"
end
end
end
end
def sync_conference_data
@conference_data = WritingConference.where(create_user_id: "#{params[:user_id]}")
@conference_data.delete_all
@user = User.find("#{params[:user_id]}")
# teachers.each do |hash|
if @user.sid.present?
ntu_seq = @user.sid
conference_xml = Nokogiri::XML( \
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
{
author: (cp_node>"Authors").text,
year: (cp_node>"PublishYear").text,
title: (cp_node>"PaperTitle").text,
conference: (cp_node>"PublishOn").text,
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
conference_title: (cp_node>"PublishOn").text,
remarks: (cp_node>"Remarks").text
}
end
if @conference_papers.present?
@conference_papers.each do |b|
@conference_paper = WritingConference.new
I18n.locale = :zh_tw
@conference_paper.authors = b[:author]
if b[:title].blank?
@conference_paper.paper_title = "No Title Present"
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
I18n.locale = :en
@conference_paper.authors = b[:author]
if b[:title].blank?
@conference_paper.paper_title = "No Title Present"
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
@conference_paper.location = b[:location]
@conference_paper.year = b[:year]
@conference_paper.create_user_id = @user.id
@conference_paper.save!
end
else
puts "No conference by Teacher"
end
end
respond_to do |format|
format.html
format.json { render json: {"success"=>true}.to_json}
end
end
def sync_journal_paper_data
@journal_data = WritingJournal.where(create_user_id: "#{params[:user_id]}")
@journal_data.delete_all
@user = User.find("#{params[:user_id]}")
# teachers.each do |hash|
if @user.sid.present?
ntu_seq = @user.sid
paper_xml = Nokogiri::XML( \
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
{
author: (paper_node>"Authors").text,
year: (paper_node>"PublishYear").text,
title: (paper_node>"PaperTitle").text,
journal: (paper_node>"PublishOn").text,
volume:(paper_node>"Volume").text,
volumeno:(paper_node>"VolumeNo").text,
beginpage:(paper_node>"BeginPage").text,
endpage:(paper_node>"EndPage").text,
subgroup:(paper_node>"subgroup").text,
remarks: (paper_node>"Remarks").text,
cate: ((paper_node>"subgroup")>"Group").text
}
end
if @journal_papers.present?
@journal_papers.each do |b|
@journal_paper = WritingJournal.new
I18n.locale = :zh_tw
@journal_paper.authors = b[:author]
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
I18n.locale = :en
@journal_paper.authors = b[:author]
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
@journal_paper.year = b[:year]
@journal_paper.vol_no = b[:volumeno]
@journal_paper.form_to_start = b[:beginpage]
@journal_paper.form_to_end = b[:endpage]
if !b[:cate].blank?
@level_type = JournalLevelType.where(:key => b[:cate])
if @level_type.present?
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
end
end
@journal_paper.create_user_id = @user.id
@journal_paper.save!
end
end
end
respond_to do |format|
format.html
format.json { render json: {"success"=>true}.to_json}
end
end
def sync_book_data
@books_data = WritingBook.where(create_user_id: "#{params[:user_id]}")
@books_data.delete_all
@user = User.find("#{params[:user_id]}")
# teachers.each do |hash|
if @user.sid.present?
ntu_seq = @user.sid
books_xml = Nokogiri::XML( \
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
@books = books_xml.xpath("//Book").map do |book_node|
{
author: (book_node>"Authors").text,
year: (book_node>"PublishYear").text,
title: (book_node>"DocTitle").text,
remarks: (book_node>"Remarks").text,
publisher: (book_node>"Publisher").text,
book_title: (book_node>"BookTitle").text
}
end
if @books.present?
@books.each do |b|
@book = WritingBook.new
I18n.locale = :zh_tw
@book.authors = b[:author]
@book.paper_title = b[:title]
@book.book_title = b[:book_title]
@book.note = b[:remarks]
@book.publisher = b[:publisher]
I18n.locale = :en
@book.authors = b[:author]
@book.paper_title = b[:title]
@book.book_title = b[:book_title]
@book.note = b[:remarks]
@book.publisher = b[:publisher]
@book.year = b[:year]
@book.create_user_id = @user.id
@book.save
end
end
end
respond_to do |format|
format.html
format.json { render json: {"success"=>true}.to_json}
end
end
def get_announcement_data
uri = URI("https://localhost:8000/announcements.xml")
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
#uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
@announcement_data = Hash.from_xml(res.body)
@announcements = @announcement_data["objects"]
@announcements.each do |hash|
@bulletin = Bulletin.new
I18n.locale = :zh_tw
if hash['announcement_title_zh_tw'].blank?
@bulletin.title = hash['announcement_title_en']
@bulletin.text = hash['announcement_content_zh_tw']
elsif hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
@bulletin.title = "Please Fill the Name"
@bulletin.text = hash['announcement_content_zh_tw']
else
@bulletin.title = hash['announcement_title_zh_tw']
@bulletin.text = hash['announcement_content_zh_tw']
end
I18n.locale = :en
if hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
@bulletin.title = "Please Fill the Name"
@bulletin.text = hash['announcement_content_en']
elsif hash['announcement_title_en'].blank?
@bulletin.title = hash['announcement_zh_tw']
@bulletin.text = hash['announcement_content_en']
elsif hash['announcement_title_zh_tw'].blank?
@bulletin.title = hash['announcement_title_en']
@bulletin.text = hash['announcement_content_en']
end
@bulletin.category_id = "51d2a16438178423c2000001"
@bulletin.is_pending = true
@bulletin.save!
end
end
def get_page_data
f = File.open("/home/rwub/orbit-db/ntu_mb/pages/management_pages.xml")
page_xml = Nokogiri::XML(f)
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
@pages = page_xml.xpath("//management-page").map do |cp_node|
{
menu_title: (cp_node>"menu-title").text,
content: (cp_node>"content").text
}
end
if @pages.present?
@i=0
@pages.each do |b|
get_variables_for_new
@page = Page.new
@page.parent = "4f45f3b9e9d02c5db900005d"
@page.design = "50ac424983e75219d2000021"
@page.theme_id = "50ac424a83e75219d2000025"
@page.menu_enabled_for= ["en", "zh_tw", ""]
@page.enabled_for= ["en", "zh_tw", ""]
@page.is_published = false
if b[:menu_title].blank?
@page.title = 'No Title Present'
@i += 1
@page.name = "#{@i}Page"
else
@i += 1
@page.title = b[:menu_title]
@page.name = "#{@i}Page"
end
if b[:content].blank?
@page.content = "No Content Present"
else
@page.content = b[:content]
end
@page.save!
end
else
puts "No Page Data"
end
end
def get_variables_for_new
@designs = Design.all.entries
@themes = Design.first.themes
@module_apps = ModuleApp.for_frontend_select
@app_frontend_urls = nil
@categories = nil
@tags = nil
@page_frontend_data_counts = nil
@frontend_styles = nil
@selected={
:design => @designs.first,
:theme=> @themes.first,
:module_app=>nil,#@module_apps.first
:app_frontend_url=> nil, #@module_apps.first
:category=>nil,
:tag=>nil,
:page_frontend_data_count=>nil,
:frontend_style => nil
}
end
end
+3 -13
View File
@@ -24,7 +24,7 @@ class Admin::ItemsController < OrbitBackendController
def update_position
item = Item.find(params[:id])
item.shift_to(params[:parent_id], params[:position].to_i, params[:next_sibling_id])
item.shift_to(params[:parent_id], params[:position].to_i)
render :nothing => true, status: 200
end
@@ -40,18 +40,8 @@ class Admin::ItemsController < OrbitBackendController
m["main"] = [module_app.label, module_app.id.to_s]
m["sub"] = module_app.app_pages.map{|name, data| [t(data["i18n"]), name]} rescue []
m["sub"] << [I18n.t('default_widget.default_widget'),'default_widget'] if module_app.has_default_widget?
if module_app.key == 'member'
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
elsif module_app.key == 'member_staff'
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
else
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
end
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
m["count"] = module_app.get_registration.get_data_count.to_a
module_apps << m
end
+6 -17
View File
@@ -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
@@ -63,19 +61,8 @@ class Admin::PagePartsController < OrbitBackendController
m = {}
m["main"] = [module_app.label, module_app.id.to_s]
m["sub"] = module_app.widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
if module_app.key == 'member'
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
elsif module_app.key == 'member_staff'
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
else
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
end
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
m["count"] = module_app.get_registration.get_data_count.to_a
module_apps << m
end
@@ -108,7 +95,9 @@ class Admin::PagePartsController < OrbitBackendController
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
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]
+2 -12
View File
@@ -21,16 +21,6 @@ class Admin::PagesController < Admin::ItemsController
end
def update
if params[:page][:category]
if params[:page][:category][0] == ""
params[:page][:category] = []
end
end
if params[:page][:tag]
if params[:page][:tag][0] == ""
params[:page][:tag] = []
end
end
@item = Page.find(params[:id])
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
@@ -70,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]
+1 -10
View File
@@ -18,7 +18,7 @@ class ApplicationController < ActionController::Base
helper_attr :site_valid_locales
def check_backend_openness
if !Site.first.backend_openness_on
if Site.first.backend_openness_on
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
end
end
@@ -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
+1 -1
View File
@@ -344,7 +344,7 @@ class DesktopController< ApplicationController
def check_desktop_open
@site = Site.first
if !@site.desktop_closed #Need to be change
if @site.desktop_closed #Need to be change
redirect_to '/admin/dashboards'
end
end
+1 -1
View File
@@ -14,7 +14,7 @@ class OrbitBackendController < ApplicationController
status << 'is_top'
status << 'is_hot'
status << 'is_hidden' unless is_guest?
if @module_app.is_approvable && (is_manager? || is_sub_manager?)
if @module_app.is_approvable && is_manager?
status << 'is_pending'
status << 'is_checked'
status << 'is_rejected'
+1 -1
View File
@@ -14,7 +14,7 @@ class OrbitMemberController < ApplicationController
status << 'is_top'
status << 'is_hot'
status << 'is_hidden' unless is_guest?
if @module_app.is_approvable && (is_manager? || is_sub_manager?)
if @module_app.is_approvable && is_manager?
status << 'is_pending'
status << 'is_checked'
status << 'is_rejected'
+1 -1
View File
@@ -130,7 +130,7 @@ class PagesController < ApplicationController
end
def check_frontend_open
if !Site.first.frontend_open && current_user.nil? #Need to be change
if Site.first.frontend_open && current_user.nil? #Need to be change
redirect_to '/admin/dashboards'
end
end
+12 -25
View File
@@ -1,5 +1,5 @@
module ApplicationHelper
Time.zone = ActiveSupport::TimeZone[+8.hours]
FLASH_NOTICE_KEYS = [:error, :notice, :warning]
@@ -223,49 +223,36 @@ module ApplicationHelper
end
def display_visitors(options={})
Impression.where(options).count
Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
end
def display_visitors_today
display_visitors(created_at: {'$gte' => Time.now.beginning_of_day, '$lte' => Time.now})
display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
end
def display_visitors_this_week
display_visitors(created_at: {'$gte' => Time.now-7.days, '$lte' => Time.now})
display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
end
def display_visitors_this_month
display_visitors(created_at: {'$gte' => Time.now-30.days, '$lte' => Time.now})
display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
end
def display_visitors_this_year
display_visitors(created_at: {'$gte' => Time.now-365.days, '$lte' => Time.now})
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
end
def get_month_traffic
result = []
result = [['Date','Visits']]
(0..30).each do |i|
visits = Impression.where( created_at: {
'$gte' => Time.now.beginning_of_day-i.days,
'$lte' => Time.now.end_of_day-i.days}
).count
result.push([ Time.now.beginning_of_day-i.days, visits])
the_day = i.day.ago
visits = Impression.where( created_at: {'$gte' => the_day.beginning_of_day, '$lte' => the_day.end_of_day}).count
result.push([ the_day.strftime("%b-%d"), visits])
# result.push({'x'=> i, 'y'=> visits})
end
[:name=> t(:visitors_count),:data=>result]
result.to_json
end
# def get_today_traffic
# result = []
# (0..30).each do |i|
# the_day = i.day.ago
# visits = Impression.where( created_at: {'$gte' => the_day.beginning_of_day, '$lte' => the_day.end_of_day}).count
# # result.push([ the_day.to_time.to_i, visits])
# result.push([ the_day.strftime("%m %d"), visits])
# # result.push({'x'=> i, 'y'=> visits})
# end
# result
# end
def display_date_time(object)
object.strftime("%Y-%m-%d %H:%M")
end
+2 -2
View File
@@ -12,13 +12,13 @@ module OrbitBackendHelper
def show_form_status_field(object)
#by_object = (!object.is_expired? and object.is_pending?)
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin?)
by_user
end
def show_approval_link(object)
by_object = (!object.is_expired? and object.is_pending?)
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin?)
by_object and by_user
end
-10
View File
@@ -1,10 +0,0 @@
class UserMailer < Devise::Mailer
default :from => "noreply@rulingcom.com"
def password_reset(user, password)
@user = user
@password = password
mail(:to => user.email,
:subject => 'Password Reset Notification')
end
end
+13 -15
View File
@@ -44,23 +44,17 @@ class Item
a
end
def find_by_parent_and_position(parent, position)
parent.children.detect{|child| child.position == position}
end
def shift_to(new_parent, position, next_sibling_id)
def shift_to(new_parent, position)
position = position.to_i
new_parent = Item.find(new_parent)
if next_sibling_id
next_sibling = Item.find(next_sibling_id)
self.move_above(next_sibling)
else
self.move_to_bottom
end
if self.parent != new_parent
current_position_sibling = find_by_parent_and_position(new_parent, position)
if current_position_sibling
if self.position > current_position_sibling.position
self.move_above(current_position_sibling)
else
self.move_below(current_position_sibling)
end
elsif self.parent != new_parent
self.parent = new_parent
save
end
@@ -92,6 +86,10 @@ class Item
end
end
def find_by_parent_and_position(parent, position)
parent.children.detect{|child| child.position == position}
end
# Enable the validation for parent_id
def validates_presence_of_parent_id?
true
-2
View File
@@ -3,8 +3,6 @@ class RoleCategory < RoleFilter
has_and_belongs_to_many :users
belongs_to :role
scope :can_display,where(disable: false)
def self.get_role_data(role_key)
@role = Role.where(:key =>role_key).first
+8 -9
View File
@@ -186,21 +186,20 @@ class User
}.uniq!
end
def self.get_member_list_attribute_field(role_type,field_key)
def self.get_member_list_attribute_field_name(role_type,field_key)
@attribute = ::Attribute.where(:key => role_type).first
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first.title
end
def self.get_member_list_attribute_value(user_id,field_id)
# @attribute = ::Attribute.where(:key => role_type).first
# @AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
return ::AttributeValue.where(attribute_field_id: field_id, :user_id => user_id).first
def self.get_member_list_attribute_value(user_id,role_type,field_key)
@attribute = ::Attribute.where(:key => role_type).first
@AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first
end
def self.get_role_member_data_by_sort(role, field_key, role_status_id)
def self.get_role_member_data_by_sort(role_status_id)
a = Array.new
attribute_field_data = get_member_list_attribute_field(role,field_key)
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,attribute_field_data.id)['val'].to_i, t ] }
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,"staff","job_title")['val'].to_i, t ] }
member_data = a.sort
member_data_tmp = member_data.collect {|v| v[1] }
end
@@ -18,7 +18,7 @@
<td class="action span3">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= attribute.disabled ? 'disabled' : '' %>">
<%= check_box_tag 'accept', attribute.disabled ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@attribute_type}_toggle_path(attribute)")}, :checked=> attribute.disabled} %>
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@attribute_type}_toggle_path(attribute)"), method: :post, remote: true, class: "switch" %>
<label><b></b></label>
</div>
</div>
+1 -2
View File
@@ -1,4 +1,3 @@
// $("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
location.reload();
$("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
$.pageslide.close();
openSlide();
+387 -52
View File
@@ -2,64 +2,399 @@
<h2>
<i class="icons-book-2"></i>
<span class="break"></span>
<%= t(:server_usage) %>
Server Status
</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="min-width: 230px; max-width: 220px; height: 220px; display: inline-block; margin-left: -5px;"></span>
<span id="mem_usage" style="min-width: 230px; max-width: 220px; height: 220px; display: inline-block; margin-left: -5px;"></span>
<span id="disk_usage" style="min-width: 230px; max-width: 220px; height: 220px; display: inline-block; margin-left: -5px;"></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
}
};
$(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
});
update_usage(Gage);
});
// get_cpu_usage();
// get_mem_usage();
// get_disk_usage();
});
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 get_cpu_usage(){
// $('#cpu_usage').highcharts({
// chart: {
// type: 'gauge',
// plotBackgroundColor: null,
// plotBackgroundImage: null,
// plotBorderWidth: 0,
// plotShadow: false
// },
// title: {
// text: 'CPU Usage'
// },
// pane: {
// startAngle: -150,
// endAngle: 150,
// background: [{
// backgroundColor: {
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
// stops: [
// [0, '#FFF'],
// [1, '#333']
// ]
// },
// borderWidth: 0,
// outerRadius: '109%'
// }, {
// backgroundColor: {
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
// stops: [
// [0, '#333'],
// [1, '#FFF']
// ]
// },
// borderWidth: 1,
// outerRadius: '107%'
// }, {
// // default background
// }, {
// backgroundColor: '#DDD',
// borderWidth: 0,
// outerRadius: '105%',
// innerRadius: '103%'
// }]
// },
// // the value axis
// yAxis: {
// min: 0,
// max: 100,
// minorTickInterval: 'auto',
// minorTickWidth: 1,
// minorTickLength: 10,
// minorTickPosition: 'inside',
// minorTickColor: '#666',
// tickPixelInterval: 30,
// tickWidth: 2,
// tickPosition: 'inside',
// tickLength: 10,
// tickColor: '#666',
// labels: {
// step: 2,
// rotation: 'auto'
// },
// title: {
// text: ''
// },
// plotBands: [{
// from: 0,
// to: 60,
// color: '#55BF3B' // green
// }, {
// from: 60,
// to: 80,
// color: '#DDDF0D' // yellow
// }, {
// from: 80,
// to: 100,
// color: '#DF5353' // red
// }]
// },
// series: [{
// name: 'CPU Usage',
// data: [0],
// dataLabels: {
// formatter: function () {
// var usage = this.y;
// return '<span style="color:#339">'+ usage + ' %</span><br/>';
// },
// backgroundColor: {
// linearGradient: {
// x1: 0,
// y1: 0,
// x2: 0,
// y2: 1
// },
// stops: [
// [0, '#DDD'],
// [1, '#FFF']
// ]
// }
// },
// tooltip: {
// valueSuffix: ' %'
// }
// }]
// },
// function(chart) {
// update_cpu_usage(chart);
// setInterval(function() {
// update_cpu_usage(chart);
// }, 2000);
// });
// }
// function update_cpu_usage(chart){
// $.get('/admin/dashboards/get_cpu_usage',function(usage){
// var point = chart.series[0].points[0],
// newVal = Math.round(usage);
// point.update(newVal);
// });
// }
// function get_mem_usage(){
// $('#mem_usage').highcharts({
// chart: {
// type: 'gauge',
// plotBackgroundColor: null,
// plotBackgroundImage: null,
// plotBorderWidth: 0,
// plotShadow: false
// },
// title: {
// text: 'Memory Usage'
// },
// pane: {
// startAngle: -150,
// endAngle: 150,
// background: [{
// backgroundColor: {
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
// stops: [
// [0, '#FFF'],
// [1, '#333']
// ]
// },
// borderWidth: 0,
// outerRadius: '109%'
// }, {
// backgroundColor: {
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
// stops: [
// [0, '#333'],
// [1, '#FFF']
// ]
// },
// borderWidth: 1,
// outerRadius: '107%'
// }, {
// // default background
// }, {
// backgroundColor: '#DDD',
// borderWidth: 0,
// outerRadius: '105%',
// innerRadius: '103%'
// }]
// },
// // the value axis
// yAxis: {
// min: 0,
// max: 100,
// minorTickInterval: 'auto',
// minorTickWidth: 1,
// minorTickLength: 10,
// minorTickPosition: 'inside',
// minorTickColor: '#666',
// tickPixelInterval: 30,
// tickWidth: 2,
// tickPosition: 'inside',
// tickLength: 10,
// tickColor: '#666',
// labels: {
// step: 2,
// rotation: 'auto'
// },
// title: {
// text: ''
// },
// plotBands: [{
// from: 0,
// to: 60,
// color: '#55BF3B' // green
// }, {
// from: 60,
// to: 80,
// color: '#DDDF0D' // yellow
// }, {
// from: 80,
// to: 100,
// color: '#DF5353' // red
// }]
// },
// series: [{
// name: 'Memory Usage',
// data: [0],
// dataLabels: {
// formatter: function () {
// var usage = this.y;
// return '<span style="color:#339">'+ usage + ' %</span><br/>';
// },
// backgroundColor: {
// linearGradient: {
// x1: 0,
// y1: 0,
// x2: 0,
// y2: 1
// },
// stops: [
// [0, '#DDD'],
// [1, '#FFF']
// ]
// }
// },
// tooltip: {
// valueSuffix: ' %'
// }
// }]
// },
// function(chart) {
// update_mem_usage(chart)
// setInterval(function() {
// update_mem_usage(chart);
// }, 5000);
// });
// }
// function update_mem_usage(chart){
// $.get('/admin/dashboards/get_mem_usage',function(usage){
// var point = chart.series[0].points[0],
// newVal = Math.round(usage);
// point.update(newVal);
// });
// }
// function get_disk_usage(){
// $('#disk_usage').highcharts({
// chart: {
// type: 'gauge',
// plotBackgroundColor: null,
// plotBackgroundImage: null,
// plotBorderWidth: 0,
// plotShadow: false
// },
// title: {
// text: 'Disk Usage'
// },
// pane: {
// startAngle: -150,
// endAngle: 150,
// background: [{
// backgroundColor: {
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
// stops: [
// [0, '#FFF'],
// [1, '#333']
// ]
// },
// borderWidth: 0,
// outerRadius: '109%'
// }, {
// backgroundColor: {
// linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
// stops: [
// [0, '#333'],
// [1, '#FFF']
// ]
// },
// borderWidth: 1,
// outerRadius: '107%'
// }, {
// // default background
// }, {
// backgroundColor: '#DDD',
// borderWidth: 0,
// outerRadius: '105%',
// innerRadius: '103%'
// }]
// },
// // the value axis
// yAxis: {
// min: 0,
// max: 100,
// minorTickInterval: 'auto',
// minorTickWidth: 1,
// minorTickLength: 10,
// minorTickPosition: 'inside',
// minorTickColor: '#666',
// tickPixelInterval: 30,
// tickWidth: 2,
// tickPosition: 'inside',
// tickLength: 10,
// tickColor: '#666',
// labels: {
// step: 2,
// rotation: 'auto'
// },
// title: {
// text: ''
// },
// plotBands: [{
// from: 0,
// to: 60,
// color: '#55BF3B' // green
// }, {
// from: 60,
// to: 80,
// color: '#DDDF0D' // yellow
// }, {
// from: 80,
// to: 100,
// color: '#DF5353' // red
// }]
// },
// series: [{
// name: 'Disk Usage',
// data: [0],
// dataLabels: {
// formatter: function () {
// var usage = this.y;
// return '<span style="color:#339">'+ usage + ' %</span><br/>';
// },
// backgroundColor: {
// linearGradient: {
// x1: 0,
// y1: 0,
// x2: 0,
// y2: 1
// },
// stops: [
// [0, '#DDD'],
// [1, '#FFF']
// ]
// }
// },
// tooltip: {
// valueSuffix: ' %'
// }
// }]
// },
// function(chart) {
// update_disk_usage(chart);
// setInterval(function() {
// update_disk_usage(chart);
// }, 60000);
// });
// }
// function update_disk_usage(chart){
// $.get('/admin/dashboards/get_disk_usage',function(usage){
// var point = chart.series[0].points[0],
// newVal = Math.round(usage);
// point.update(newVal);
// });
// }
</script>
+52 -11
View File
@@ -2,17 +2,58 @@
<h2>
<i class="icons-book-2"></i>
<span class="break"></span>
<%= t(:monthly_traffic)%>
Monthly Traffic
</h2>
</div>
<div class="box-content">
<div id="month_traffic" style="min-width: 310px; margin: 0 auto">
<%= line_chart get_month_traffic, :height => "200px", :name => 'Visit',
:library => {
legend: 'none',
chartArea:{ width: '95%', left: 50, right: 0},
hAxis:{format:'MMM-d',gridlines:{color: '#CCC', count: 31}},
vAxis:{minValue:-100,viewWindowMode: 'maximized'}
} %>
</div>
</div>
<div id="month_traffic"></div>
</div>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
var chart;
var datas =<%= raw(get_month_traffic) %>;
var initData;
google.setOnLoadCallback(init);
window.onresize = drawChart;
function init() {
initData = new google.visualization.DataTable();
$.each(datas,function(idx,data){
initData.setValue(idx,1,[data[0],0]);
});
var options = {
title: 'Monthly Visits',
titlePosition: 'in',
fontSize: 10,
curveType: 'function',
hAxis:{
slantedText: true,
slantedTextAngle: 35
},
chartArea:{
width: '90%',
left: 50,
right: 0
},
animation:{
duration: 1000,
easing: 'out',
}
};
drawChart();
}
function drawChart() {
chart = new google.visualization.AreaChart(document.getElementById('month_traffic'));
chart.draw(google.visualization.arrayToDataTable(initData), options);
// $.each(datas,function(idx,data){
// initData.push([data[0],0]);
// });
}
</script>
+7 -11
View File
@@ -1,22 +1,13 @@
<%= 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" %>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<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 id='traffic'>
<%= render 'traffic' %>
</div>
</div>
</div>
<div class="row-fluid">
<div class="box span">
@@ -45,6 +36,11 @@
<%= render 'most_visited' %>
</div>
</div>
<div class="box span4">
<div id='traffic'>
<%= render 'traffic' %>
</div>
</div>
</div>
</div>
</section>
+1 -33
View File
@@ -64,10 +64,6 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">CSS <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="active"><a href="#html_0" data-toggle="tab"><%= @design.layout.name %></a></li>
<% @design.themes.each do |theme| %>
<li><a href="#<%= dom_id theme %>" data-toggle="tab"><%= theme.name %></a></li>
<%end%>
<li><a href="#css_0" data-toggle="tab"><%= @design.css_default.name %></a></li>
<li><a href="#css_1" data-toggle="tab"><%= @design.css_reset.name %></a></li>
</ul>
@@ -80,26 +76,6 @@
<% end %>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Theme <b class="caret"></b></a>
<ul class="dropdown-menu">
<% @design.themes.each do |theme| %>
<li><a href="#<%= dom_id theme %>" data-toggle="tab"><%= theme.name %></a></li>
<% end %>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Images <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#images" data-toggle="tab">Images</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Template Info<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#info" data-toggle="tab">Template Info</a></li>
</ul>
</li>
</ul>
<div id="code-groups" class="tab-content">
<div class="clearfix tab-pane fade active in" id="html_0">
@@ -117,16 +93,8 @@
<%= render :partial => 'tab_form', :locals => {:type => :css_reset, :object => @design.css_reset} %>
</div>
<div class="clearfix tab-pane fade active in" id="images">
<%= render :partial => 'images' %>
</div>
<div class="clearfix tab-pane fade active in" id="info">
<%= render :partial => 'form' %>
</div>
<% @design.javascripts.each do |js| %>
<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 %>
@@ -1 +0,0 @@
<p>Successfully Imported Announcement Data!</p>
@@ -1 +0,0 @@
<p>Successfully Book Data!</p>
@@ -1 +0,0 @@
<p>Successfully Conference Data!</p>
@@ -1 +0,0 @@
<p>Successfully Journal Paper Data!</p>
@@ -1 +0,0 @@
<p>Successfully Imported Page Data!</p>
@@ -1 +0,0 @@
<p>Successfully Imported Teacher Data!</p>
@@ -1 +0,0 @@
<p>Book Data Synced Successfully!</p>
@@ -1 +0,0 @@
<p>Conference Paper Data Synced Successfully!</p>
@@ -1 +0,0 @@
<p>Journal Paper Data Synced Successfully!</p>
+2 -4
View File
@@ -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>
+1 -2
View File
@@ -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 %>
+7 -13
View File
@@ -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
View File
@@ -1 +0,0 @@
window.location.href="<%= admin_page_url(@part.page, edit: true) %>"
@@ -1,5 +1,5 @@
<tr id="<%= dom_id role_filter %>" class="<%= role_filter.disable ? 'disable' : '' %>">
<tr id="<%= dom_id role_filter %>" class="<% role_filter.disable ? 'disable' : '' %>">
<td><span class="label label-info"><%= role_filter.key %></span></td>
<% if @types.is_localized?(:title) %>
<% @site_valid_locales.each_with_index do |locale, i| %>
@@ -18,7 +18,15 @@
<td><%= role_filter.title %></td>
<% end %>
<td class="action dsrgsdgsdg">
<%= check_box_tag 'accept', role_filter.disable ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)")}, :checked=> role_filter.disable} %>
<td class="action">
<%#= link_to role_filter.disable ? t(:disable) : t(:enable), polymorphic_path([:admin, role_filter]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"btn btn-mini btn-success", :type=>"button" %>
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= role_filter.disable ? 'disabled' : '' %>">
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)"), method: :post, remote: true, class: "switch" %>
<label><b></b></label>
</div>
</div>
</td>
</tr>
+9 -2
View File
@@ -1,4 +1,3 @@
<% content_for :side_bar do %>
<%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %>
@@ -10,6 +9,14 @@
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%>
<div id="filter" class="topnav clearfix">
<ul class="breadcrumb text-info pull-left">
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
</ul>
</div>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), eval("new_admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_path(:role_id=>params[:role_id])"), class: "btn btn-primary open-slide" %>
@@ -20,4 +27,4 @@
<%= render 'index' %>
</div>
<% @path = "/admin/#{@app_type == 'role_category' ? 'role_categorys' : @app_type }/" %>
+1 -2
View File
@@ -1,4 +1,3 @@
// $("#role_filters_index").html("<%= j render 'index' %>")
location.reload();
$("#role_filters_index").html("<%= j render 'index' %>")
$.pageslide.close();
openSlide();
+8
View File
@@ -2,6 +2,7 @@
<%= render :partial => 'admin/users_new_interface/side_bar' %>
<% end %>
<% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "lib/pageslide.css" %>
@@ -9,6 +10,13 @@
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%>
<div id="filter" class="topnav clearfix">
<ul class="breadcrumb text-info pull-left">
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
<li class="active"><%= @attribute.title %></a></li>
</ul>
</div>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary open-slide"%>
+1 -1
View File
@@ -164,7 +164,7 @@
<label class="control-label muted">Default Language</label>
<div class="controls">
<% @site_in_use_locales.each do |locale| %>
<%= radio_button_tag "site[default_locale]", locale, @locale == locale,:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}", disabled: true } %>
<%= radio_button_tag "site[default_locale]", locale, @locale == locale , @site.in_use_locales.include?(locale),:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}", disabled: true } %>
<% end %>
</div>
</div>
@@ -5,7 +5,12 @@
<div class="attributes <%= role_disable ? 'disabled' : '' %>">
<div class="attributes-header clearfix">
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= role_disable ? 'disabled' : '' %>">
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,"data-deploy"=>"right",:class=>"toggle-check",:value=>role_disable)%>
<label><b></b></label>
</div>
</div>
<h4><%= role.title %><%= t(:role_info)%></h4>
</div>
@@ -1 +1 @@
<%=render :partial=>"role",:collection=>Role.where(:disabled=>false).asc("_id")%>
<%=render :partial=>"role",:collection=>Role.all.asc("_id")%>
@@ -6,7 +6,7 @@
<div id="sidebar-menu">
<div class="scroller">
<%= content_tag :ul, :class => "sidebar-nav" do -%>
<%= content_tag :li, :class => active_for_controllers('users_new_interface','roles') do -%>
<%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%>
<%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-user'))), admin_users_new_interface_index_path) %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
@@ -30,7 +30,7 @@
<%= content_tag :li, link_to((content_tag(:span, t(:add_member))), new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_authorization))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_registration))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_role))),admin_roles_path ), :class => active_for_action('roles', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_role))),admin_roles_path ), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_info))), edit_admin_info_path(Info.first.id.to_s)), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) and Info.first %>
<% end -%>
</div>
@@ -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"%>
+21 -35
View File
@@ -1,36 +1,22 @@
<section id="main-wrap">
<div class="sign-in have-other-sign-in">
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
-->
<div class="form">
<h3 class="login-logo">Reset Your Password</h3>
<div>
<input name="utf8" type="hidden" value="" />
<input name="authenticity_token" type="hidden" value="" />
</div>
<!-- <div class="other-sign-in">
<a class="btn btn-primary" type="submit">Other Sign In</a>
<p>or</p>
</div> -->
<div class="form-block">
<div class="form-list clearfix">
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :class => 'user_new form-horizontal' }) do |f| %>
<%= devise_error_messages! %>
<div class="control-group clear">
<label for="user_email">
<i class="icons-mail "></i>
</label>
<%= f.text_field :email, :placeholder => t(:email), :id=>"user_email" %>
</div>
<%= content_tag :button, "Reset Password", :type => :submit, :class => 'btn btn-primary' %>
</form>
</div>
</div>
<% end %>
</div>
</div>
</section>
<h1 class="login-logo"><%= t(:ruling_site) %></h1>
<div id="signin-header">
<h3><%= t(:forgot_password) %></h3>
</div>
<div id="container" class="sign-in">
<%= form_for :user, :url => user_password_path, :html => {:class => 'user_new form-horizontal'} do |f| %>
<%= devise_error_messages! %>
<div class="content">
<div class="main">
<div class="control-group clear">
<%= f.label :email %>
<%= f.email_field :email, :placeholder => t(:email), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
</div>
</div>
</div>
<div class="form-actions clear">
<%= content_tag :button, "Send me reset password instructions", :type => :submit, :class => 'btn btn-primary pull-right' %>
</div>
<% end %>
</div>
+18 -13
View File
@@ -1,3 +1,5 @@
<!-- Orbit Bar -->
<!--#include virtual="include/orbit_bar.html"-->
<section id="main-wrap">
<div class="sign-in have-other-sign-in">
<!-- <p class="alert alert-error in fade">You need to sign in.</p>
@@ -33,22 +35,25 @@
</label>
<%= f.password_field :password, :placeholder => t(:dots), :id=>"user_password" %>
</div>
<br/>
<label class="checkbox">
<% if devise_mapping.rememberable? -%>
<%= f.check_box :remember_me %> <small><%= f.label :remember_me %></small>
<% end -%>
</label>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
</form>
<form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
<div class="control-group clear">
<label for="user_email">
<i class="icon-user"></i>
</label>
<input type="text" id="user_id" name="user[id]" placeholder="帳號" />
</div>
<div class="control-group clear">
<label for="user_password">
<i class="icons-mail"></i>
</label>
<input type="text" id="user_email" name="user[email]" placeholder="電子郵件" />
</div>
</form>
</div>
</div>
<div class="pull-right">
<%= link_to content_tag(:small, t(:forgot_password)), new_user_password_path %>
</div>
<br/>
<!-- <div class="register">
<button class="btn btn-inverse" type="submit">Register</button>
</div> -->
+1 -7
View File
@@ -1,5 +1,5 @@
<div style='position:relative'>
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class="orbit-cycle-slideshow" data-cycle-timeout="<%= @ad_banner.timeout_millisecond %>" data-cycle-fx="<%= @ad_banner.ad_fx %>" data-cycle-pager=".banner_nav_<%= @ad_banner.title.dehumanize %>" data-cycle-pager-template="<li class='needed'><a href='#'></a></li>" data-cycle-pager-active-class="activeSlide" data-cycle-random='true' style="z-index: 0">
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class="orbit-cycle-slideshow" data-cycle-timeout="<%= @ad_banner.timeout_millisecond %>" data-cycle-fx="<%= @ad_banner.ad_fx %>" data-cycle-pager=".banner_nav_<%= @ad_banner.title.dehumanize %>" data-cycle-pager-template="<li><a href='#'></a></li>" data-cycle-pager-active-class="activeSlide" data-cycle-random='true' style="z-index: 0">
<% @ad_banner.ad_images.can_display.each do |ad_image| %>
<% link = ad_image_link(ad_image) %>
<%= image_tag ad_image.file, width: @ad_banner.width, height: @ad_banner.height, link_open: ad_image.link_open, link_url: link, style: "display:none; #{'cursor:pointer;' if link.present?}" %>
@@ -17,12 +17,6 @@
<% end %>
$.preload(a, 2, function(){
$('.orbit-cycle-slideshow').cycle();
var lis = $("ul.banner_nav_<%= @ad_banner.title.dehumanize %> li");
if( lis.length > a.length ){
for( i = lis.length - 1; i > a.length - 1; i-- ){
lis[i].remove();
}
}
});
}
else{
+2 -10
View File
@@ -1,20 +1,12 @@
<% if @menu_page %>
<% if @menu_page && @menu_page.visible_children.size > 0 %>
<div class='category_list'>
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
<ul class='list'>
<% @menu_page.visible_children.each do |child| %>
<% if @menu_page.visible_children.nil?%>
<p>Test</p>
<li class="<%= @page_id.eql?(child.parent.id) ? 'active' : nil %>">
<a href="<%= (child.parent.class.to_s.eql?('Page') ? '/' + child.parent.path : child.parent.url) %>"><%= child.parent.title %></a>
</li>
<% else %>
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
</li>
<% end %>
<% end %>
</ul>
</div>
<% end %>
<% end %>
+1 -1
View File
@@ -21,7 +21,7 @@
</li>
<!-- Desktop -->
<% if @site.desktop_closed%>
<% if !@site.desktop_closed%>
<li id="orbit-desktop">
<a href="<%= desktop_path %>" role="button">
<i class="icons-screen"></i> <span class="hide"><%= t(:desktop) %></span>
+4 -4
View File
@@ -33,7 +33,7 @@
<ul class="dropdown-menu" role="menu" aria-labelledby="orbit-user">
<li><%= link_to content_tag(:i, nil, class: 'icons-tools') + ' ' + t("users.change_passwd"), admin_users_new_interface_setting_account_path(current_user), tabindex: '-1' %></li>
<li><%= link_to content_tag(:i, nil, class: 'icons-vcard') + ' ' + t("users.user_basic_data"), admin_users_new_interface_edit_user_data_path(current_user), tabindex: '-1' %></li>
<% if @site.desktop_closed %>
<% if @site.desktop_closed.blank? %>
<li><%= link_to content_tag(:i, nil, class: 'icons-screen') + ' ' + t(:desktop), desktop_path, tabindex: '-1' %></li>
<% end %>
<li><%= link_to content_tag(:i, nil, class: 'icons-logout') + ' ' + t(:logout), destroy_user_session_path, tabindex: '-1' %></li>
@@ -69,10 +69,10 @@
<%= f.password_field :password, class: "input-xlarge", placeholder: t(:password) %>
</div>
<div class="pull-left" style="width: 150px;">
<label class="checkbox">
<input type="checkbox" name="user[remember_me]" value="1" checked="checked" />
<!-- <label class="checkbox">
<input type="checkbox" value="">
<small>Remember me</small>
</label>
</label> -->
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
</div>
<div class="pull-right">
-8
View File
@@ -24,16 +24,8 @@
<div class="wrap-inner">
<div id="filter" class="topnav clearfix">
<ul class="breadcrumb text-info pull-left">
<% if !@role.blank? %>
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
<% elsif !@attribute.blank? %>
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
<li class="active"><%= @attribute.title %></a></li>
<% else %>
<li><a href="<%= admin_users_new_interface_index_path %>">Member</a> <span class="divider">/</span></li>
<li class="active">All</li>
<% end %>
</ul>
<%= yield :right_nav %>
</div>
@@ -13,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>
+1 -2
View File
@@ -1,7 +1,6 @@
defaults: &defaults
main_public_key: 'lib/main_public_key.pem'
# store_ip: 'redmine.rulingcom.com:3001'
store_ip: 'tp.rulingcom.com:33335'
store_ip: 'redmine.rulingcom.com:3001'
orbit: 'Orbit'
ruling_digital: 'RulingDigital'
+1 -1
View File
@@ -15,7 +15,7 @@ Orbit::Application.configure do
config.action_controller.perform_caching = true
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
+3 -3
View File
@@ -3,10 +3,10 @@
Devise.setup do |config|
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in DeviseMailer.
config.mailer_sender = "UserMailer"
config.mailer_sender = "please-change-me@config-initializers-devise.com"
# Configure the class responsible to send e-mails.
config.mailer = "Devise::Mailer"
# config.mailer = "Devise::Mailer"
# ==> ORM configuration
# Load and configure the ORM. Supports :active_record (default) and
@@ -61,7 +61,7 @@ Devise.setup do |config|
# ==> Configuration for :rememberable
# The time the user will be remembered without asking for credentials again.
config.remember_for = 2.weeks
# config.remember_for = 2.weeks
# If true, a valid remember token can be re-used between multiple browsers.
# config.remember_across_browsers = true
-3
View File
@@ -289,7 +289,6 @@ en:
menu_enabled_for: Menu enabled for
module: Module
module_authorization: Module Authorization
monthly_traffic: Monthly Traffic
more_plus: more+
most_visited_page: Most Visited Page
multilingual: Multilingual
@@ -378,7 +377,6 @@ en:
search_: Search
search_google: Search Google
setup_member: Member setup
server_usage: Server Usage
show: Show
show_mode:
index: Index
@@ -518,7 +516,6 @@ en:
vertical: Vertical
view: View
view_count: View count
visitors_count: Visits
visitors_this_month: This month's visitors
visitors_this_week: This week's visitors
visitors_this_year: This year's visitors
-3
View File
@@ -290,7 +290,6 @@ zh_tw:
menu_enabled_for: 選單啟用
module: 模組
module_authorization: 模組授權
monthly_traffic: 本月流量
more_plus: 更多+
most_visited_page: 最多瀏覽頁面
multilingual: 多語系
@@ -379,7 +378,6 @@ zh_tw:
search_: 搜尋
search_google: 搜尋Google
setup_member: 會員設定
server_usage: 主機負載
show: 顯示
show_mode:
index: 檢索
@@ -519,7 +517,6 @@ zh_tw:
vertical: 垂直的
view: 檢視
view_count: 查看次數
visitors_count: 造訪人次
visitors_this_month: 本月造訪人次
visitors_this_week: 本星期造訪人次
visitors_this_year: 今年造訪人次
+2
View File
@@ -10,6 +10,8 @@ development:
<<: *defaults
database: test_site
test:
<<: *defaults
database: test_site
+1 -11
View File
@@ -70,7 +70,7 @@ Orbit::Application.routes.draw do
get 'get_cpu_usage'
get 'get_mem_usage'
get 'get_disk_usage'
get 'get_month_traffic'
# get 'get_month_traffic'
end
end
resources :designs do
@@ -207,16 +207,6 @@ Orbit::Application.routes.draw do
get 'preference'
end
get "import_data/get_teacher_data"
get "import_data/get_book_data"
get "import_data/get_conference_data"
get "import_data/get_journal_paper_data"
get "import_data/get_announcement_data"
get "import_data/get_page_data"
get "import_data/sync_book_data"
get "import_data/sync_journal_paper_data"
get "import_data/sync_conference_data"
resources :tags do
collection do
post 'add_to_default'
+2 -2
View File
@@ -279,8 +279,8 @@ module OrbitCoreLib
end
def check_user_can_use
unless current_or_guest_user.admin? || (@module_app.is_manager?(current_or_guest_user) if @module_app.present?) || (@module_app.is_sub_manager?(current_or_guest_user) if @module_app.present?) || (@module_app.can_approve?(current_or_guest_user) if @module_app.present?)
redirect_to admin_dashboards_url
unless current_or_guest_user.admin? || @module_app.is_manager?(current_or_guest_user) || @module_app.is_sub_manager?(current_or_guest_user) || @module_app.can_approve?(current_or_guest_user)
redirect_to root_url
end
end
+8 -1
View File
@@ -23,6 +23,7 @@ module ParserFrontEnd
args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if !args["tag_id"].blank? and args["tag_id"].is_a? String
# tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
# category = params[:category_id].blank? ? page[:category] : params[:category_id]
body = Nokogiri::HTML(page.content)
if @edit
@@ -47,7 +48,13 @@ module ParserFrontEnd
ret = ''
part = PagePart.find(front['part_id']) if front['part_id']
ret << eval("\"#{front['path']}\"") rescue ''
ret << (ret.include?("?") ? "&#{args.to_param}" : "?#{args.to_param}") if args.present?
args.each do |index,arg|
if index=="tag_id" || index=="category_id"
ret << (ret.include?("?") ? "&#{index}[]=#{arg}": "?#{index}[]=#{arg}" )
else
ret << (ret.include?("?") ? "&#{index}=#{arg}": "?#{index}=#{arg}" )
end
end if args
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load widget' path='#{ret}'></div>")
end
front.swap(fragment)
+1 -1
View File
@@ -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
View File
@@ -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
-12
View File
@@ -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
-10
View File
@@ -1,10 +0,0 @@
// +--------------------------------------------------------------------+ \\
// ¦ Raphaël 2.1.0 - JavaScript Vector Library ¦ \\
// +--------------------------------------------------------------------¦ \\
// ¦ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) ¦ \\
// ¦ Copyright © 2008-2012 Sencha Labs (http://sencha.com) ¦ \\
// +--------------------------------------------------------------------¦ \\
// ¦ Licensed under the MIT (http://raphaeljs.com/license.html) license.¦ \\
// +--------------------------------------------------------------------+ \\
(function(a){var b="0.3.4",c="hasOwnProperty",d=/[\.\/]/,e="*",f=function(){},g=function(a,b){return a-b},h,i,j={n:{}},k=function(a,b){var c=j,d=i,e=Array.prototype.slice.call(arguments,2),f=k.listeners(a),l=0,m=!1,n,o=[],p={},q=[],r=h,s=[];h=a,i=0;for(var t=0,u=f.length;t<u;t++)"zIndex"in f[t]&&(o.push(f[t].zIndex),f[t].zIndex<0&&(p[f[t].zIndex]=f[t]));o.sort(g);while(o[l]<0){n=p[o[l++]],q.push(n.apply(b,e));if(i){i=d;return q}}for(t=0;t<u;t++){n=f[t];if("zIndex"in n)if(n.zIndex==o[l]){q.push(n.apply(b,e));if(i)break;do{l++,n=p[o[l]],n&&q.push(n.apply(b,e));if(i)break}while(n)}else p[n.zIndex]=n;else{q.push(n.apply(b,e));if(i)break}}i=d,h=r;return q.length?q:null};k.listeners=function(a){var b=a.split(d),c=j,f,g,h,i,k,l,m,n,o=[c],p=[];for(i=0,k=b.length;i<k;i++){n=[];for(l=0,m=o.length;l<m;l++){c=o[l].n,g=[c[b[i]],c[e]],h=2;while(h--)f=g[h],f&&(n.push(f),p=p.concat(f.f||[]))}o=n}return p},k.on=function(a,b){var c=a.split(d),e=j;for(var g=0,h=c.length;g<h;g++)e=e.n,!e[c[g]]&&(e[c[g]]={n:{}}),e=e[c[g]];e.f=e.f||[];for(g=0,h=e.f.length;g<h;g++)if(e.f[g]==b)return f;e.f.push(b);return function(a){+a==+a&&(b.zIndex=+a)}},k.stop=function(){i=1},k.nt=function(a){if(a)return(new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)")).test(h);return h},k.off=k.unbind=function(a,b){var f=a.split(d),g,h,i,k,l,m,n,o=[j];for(k=0,l=f.length;k<l;k++)for(m=0;m<o.length;m+=i.length-2){i=[m,1],g=o[m].n;if(f[k]!=e)g[f[k]]&&i.push(g[f[k]]);else for(h in g)g[c](h)&&i.push(g[h]);o.splice.apply(o,i)}for(k=0,l=o.length;k<l;k++){g=o[k];while(g.n){if(b){if(g.f){for(m=0,n=g.f.length;m<n;m++)if(g.f[m]==b){g.f.splice(m,1);break}!g.f.length&&delete g.f}for(h in g.n)if(g.n[c](h)&&g.n[h].f){var p=g.n[h].f;for(m=0,n=p.length;m<n;m++)if(p[m]==b){p.splice(m,1);break}!p.length&&delete g.n[h].f}}else{delete g.f;for(h in g.n)g.n[c](h)&&g.n[h].f&&delete g.n[h].f}g=g.n}}},k.once=function(a,b){var c=function(){var d=b.apply(this,arguments);k.unbind(a,c);return d};return k.on(a,c)},k.version=b,k.toString=function(){return"You are running Eve "+b},typeof module!="undefined"&&module.exports?module.exports=k:typeof define!="undefined"?define("eve",[],function(){return k}):a.eve=k})(this),function(){function cF(a){for(var b=0;b<cy.length;b++)cy[b].el.paper==a&&cy.splice(b--,1)}function cE(b,d,e,f,h,i){e=Q(e);var j,k,l,m=[],o,p,q,t=b.ms,u={},v={},w={};if(f)for(y=0,z=cy.length;y<z;y++){var x=cy[y];if(x.el.id==d.id&&x.anim==b){x.percent!=e?(cy.splice(y,1),l=1):k=x,d.attr(x.totalOrigin);break}}else f=+v;for(var y=0,z=b.percents.length;y<z;y++){if(b.percents[y]==e||b.percents[y]>f*b.top){e=b.percents[y],p=b.percents[y-1]||0,t=t/b.top*(e-p),o=b.percents[y+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[y]])}if(!!j){if(!k){for(var A in j)if(j[g](A))if(U[g](A)||d.paper.customAttributes[g](A)){u[A]=d.attr(A),u[A]==null&&(u[A]=T[A]),v[A]=j[A];switch(U[A]){case C:w[A]=(v[A]-u[A])/t;break;case"colour":u[A]=a.getRGB(u[A]);var B=a.getRGB(v[A]);w[A]={r:(B.r-u[A].r)/t,g:(B.g-u[A].g)/t,b:(B.b-u[A].b)/t};break;case"path":var D=bR(u[A],v[A]),E=D[1];u[A]=D[0],w[A]=[];for(y=0,z=u[A].length;y<z;y++){w[A][y]=[0];for(var F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(E[y][F]-u[A][y][F])/t}break;case"transform":var H=d._,I=ca(H[A],v[A]);if(I){u[A]=I.from,v[A]=I.to,w[A]=[],w[A].real=!0;for(y=0,z=u[A].length;y<z;y++){w[A][y]=[u[A][y][0]];for(F=1,G=u[A][y].length;F<G;F++)w[A][y][F]=(v[A][y][F]-u[A][y][F])/t}}else{var J=d.matrix||new cb,K={_:{transform:H.transform},getBBox:function(){return d.getBBox(1)}};u[A]=[J.a,J.b,J.c,J.d,J.e,J.f],b$(K,v[A]),v[A]=K._.transform,w[A]=[(K.matrix.a-J.a)/t,(K.matrix.b-J.b)/t,(K.matrix.c-J.c)/t,(K.matrix.d-J.d)/t,(K.matrix.e-J.e)/t,(K.matrix.f-J.f)/t]}break;case"csv":var L=r(j[A])[s](c),M=r(u[A])[s](c);if(A=="clip-rect"){u[A]=M,w[A]=[],y=M.length;while(y--)w[A][y]=(L[y]-u[A][y])/t}v[A]=L;break;default:L=[][n](j[A]),M=[][n](u[A]),w[A]=[],y=d.paper.customAttributes[A].length;while(y--)w[A][y]=((L[y]||0)-(M[y]||0))/t}}var O=j.easing,P=a.easing_formulas[O];if(!P){P=r(O).match(N);if(P&&P.length==5){var R=P;P=function(a){return cC(a,+R[1],+R[2],+R[3],+R[4],t)}}else P=bf}q=j.start||b.start||+(new Date),x={anim:b,percent:e,timestamp:q,start:q+(b.del||0),status:0,initstatus:f||0,stop:!1,ms:t,easing:P,from:u,diff:w,to:v,el:d,callback:j.callback,prev:p,next:o,repeat:i||b.times,origin:d.attr(),totalOrigin:h},cy.push(x);if(f&&!k&&!l){x.stop=!0,x.start=new Date-t*f;if(cy.length==1)return cA()}l&&(x.start=new Date-x.ms*f),cy.length==1&&cz(cA)}else k.initstatus=f,k.start=new Date-k.ms*f;eve("raphael.anim.start."+d.id,d,b)}}function cD(a,b){var c=[],d={};this.ms=b,this.times=1;if(a){for(var e in a)a[g](e)&&(d[Q(e)]=a[e],c.push(Q(e)));c.sort(bd)}this.anim=d,this.top=c[c.length-1],this.percents=c}function cC(a,b,c,d,e,f){function o(a,b){var c,d,e,f,j,k;for(e=a,k=0;k<8;k++){f=m(e)-a;if(z(f)<b)return e;j=(3*i*e+2*h)*e+g;if(z(j)<1e-6)break;e=e-f/j}c=0,d=1,e=a;if(e<c)return c;if(e>d)return d;while(c<d){f=m(e);if(z(f-a)<b)return e;a>f?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(Line truncated
@@ -9,30 +9,19 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
end
def search_result
if params[:search_query] == ""
@bulletins = get_bulletins_for_index
else
@search = Bulletin.solr_search do
fulltext params[:search_query]
with(:frontend_search,true)
with(:available_lang).any_of([I18n.locale.to_s])
end
# @bulletins = Bulletin.where(:category_id.in => params[:category_id]).and(:is_rejected=>false).and(:is_pending=>false)
search_result = @search.results.collect{|result| result.id}
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
end
end
def index
@bulletins = get_bulletins_for_index
end
def get_bulletins_for_index
@item = Page.find(params[:page_id]) rescue nil
@item = Page.find(params[:page_id]) rescue nil
if @item
if @item.frontend_data_count
@page_num = @item.frontend_data_count
@@ -41,23 +30,33 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
end
@frontend_style = @item.frontend_style
end
@item = Page.find(params[:page_id]) rescue nil
if !params[:search_query].blank?
@search = Bulletin.solr_search do
fulltext params[:search_query]
with(:frontend_search,true)
with(:available_lang).any_of([I18n.locale.to_s])
end
search_result = @search.results.collect{|result| result.id}
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
else
date_now = Time.now
if !params[:category_id].blank? && !params[:tag_id].blank?
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
# @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in=>params[:category_id],:tagged_ids.in=>params[:tag_id])
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id => params[:category_id], :tagged_ids => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
elsif !params[:category_id].blank?
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
elsif !params[:tag_id].blank?
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
else
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
end
# delayed_impressionist(@tag) if @tag
@bulletins
end
end
end
def show
@item = Page.find(params[:page_id]) rescue nil
@@ -39,7 +39,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page] ).per(@page_num)
end
@categories = @module_app.categories.enabled
@categories = get_categories_for_index
end
@@ -62,7 +62,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(@page_num )
end
@categories = @module_app.categories.enabled
@categories = get_categories_for_index
end
@@ -139,7 +139,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
def bulletins_side_bar
@tags_and_class = @module_app.sorted_tags_for_cloud
@categories = @module_app.categories.enabled
@categories = get_categories_for_index
end
def bulletins_search_block
@@ -1,6 +1,7 @@
<% # encoding: utf-8 %>
<%= flash_messages %>
<h1 class="h1"><%= @page.title rescue nil %></h1>
<table class="table table-bordered">
@@ -1,6 +1,7 @@
<% # encoding: utf-8 %>
<%= flash_messages %>
<h1 class="h1"><%= @page.title rescue nil %></h1>
<table class="table table-bordered">
@@ -22,7 +23,7 @@
<% @bulletins.each do |post| %>
<tr>
<td><%= post.bulletin_category.title rescue nil %></td>
<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.category_id) %>
<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
</td>
<td><%= display_date_time(post.postdate) %></td>
@@ -53,7 +53,7 @@
</tr>
<% end %>
</table>
<% if !@category_id.blank? %>
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
<% else %>
@@ -100,7 +100,7 @@
</li>
<% end %>
</ul>
<% if !@category_id.blank? %>
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
<% else %>
@@ -149,6 +149,7 @@
</li>
<% end %>
</ul>
<% if !@category_id.blank? %>
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
<% else %>
@@ -197,7 +198,8 @@
</div>
</li>
<% end %>
</ul>
</ul>
<% if !@category_id.blank? %>
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
<% else %>
@@ -244,6 +246,7 @@
</li>
<% end %>
</ul>
<% if !@category_id.blank? %>
<div class="more"><%= link_to t('more'), panel_announcement_front_end_bulletins_path( :category_id => @category_id ) %></div>
<% else %>
@@ -1,6 +1,6 @@
<%= stylesheet_link_tag "default_widget" %>
<script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.js'></script>
<!-- <script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.degsin.js'></script> -->
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
<div id="bulletin_widget">
<%= render 'index' %>
+1 -1
View File
@@ -37,7 +37,7 @@ module Announcement
image :image
field :postdate
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:category,:id]}}
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:bulletin_category,:id]}}
field :subtitle
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
end
@@ -20,8 +20,6 @@ class ArchiveFile
field :title, localize: true
field :create_user_id
field :update_user_id, :class_name => "User"
scope :can_display,where(is_hidden: false)
# belongs_to :archive_file_category
@@ -4,22 +4,78 @@ class Panel::CalendarNew::BackEnd::EventCategoriesController < OrbitBackendContr
# GET /events
# GET /events.json
def index
@module_app_id = @module_app.id rescue nil
@event_categories = EventCategory.all
@categories = get_categories_for_index
@categories = @categories.page(params[:page]).per(10)
respond_to do |format|
format.html # index.html.erb
format.json { render json: @categories }
format.json { render json: @event_categories }
end
end
def list
@module_app_id = @module_app.id rescue nil
# GET /events/1
# GET /events/1.json
def show
@event_category = EventCategory.find(params[:id])
@categories = get_categories_for_index
@categories = @categories.page(params[:page]).per(10)
render :layout => false
respond_to do |format|
format.html # show.html.erb
format.json { render json: @event_category }
end
end
# GET /events/new
# GET /events/new.json
def new
@event_category = EventCategory.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @event_category }
end
end
# GET /events/1/edit
def edit
@event_category = EventCategory.find(params[:id])
end
def create
@event_category = EventCategory.new(params[:event_category])
respond_to do |format|
if @event_category.save
format.html { redirect_to panel_calendar_new_back_end_event_categories_path, notice: 'Category was successfully created.' }
format.json { render json: @event_category, status: :created, location: @event_category }
else
format.html { render action: "new" }
format.json { render json: @event_category.errors, status: :unprocessable_entity }
end
end
end
def update
@event_category = EventCategory.find(params[:id])
respond_to do |format|
if @event_category.update_attributes(params[:event_category])
format.html { redirect_to panel_calendar_new_back_end_event_categories_path, notice: 'Category was successfully updated.' }
format.json { head :no_content }
#format.js
else
format.html { render action: "edit" }
format.json { render json: @event_category.errors, status: :unprocessable_entity }
#format.js
end
end
end
def destroy
@event_category = EventCategory.find(params[:id])
@event_category.destroy
respond_to do |format|
format.html { redirect_to panel_calendar_new_back_end_event_categories_path }
format.json { head :no_content }
end
end
end
@@ -40,7 +40,6 @@ class Panel::CalendarNew::BackEnd::EventsController < OrbitBackendController
# GET /events/new.json
def new
@event = Event.new
@categories = get_categories_for_index
@end_d_t = ""
@start_d_t = ""
@all_day = false;
@@ -62,13 +61,15 @@ class Panel::CalendarNew::BackEnd::EventsController < OrbitBackendController
@start_d_t = params[:startDate]
end
render :layout => false
#respond_to do |format|
# format.html # new.html.erb
# format.json { render json: @event }
#end
end
# GET /events/1/edit
def edit
@event = Event.find(params[:id])
@categories = get_categories_for_index
@end_d_t = @event.end.strftime("%Y/%m/%d %H:%M").to_s
@start_d_t = @event.start.strftime("%Y/%m/%d %H:%M").to_s
@all_day = @event.all_day
@@ -79,8 +80,12 @@ class Panel::CalendarNew::BackEnd::EventsController < OrbitBackendController
# POST /events
# POST /events.json
def create
@event = Event.new(params[:event])
@event = Event.new(params[:event])
# if params[:event][:period] == "Does not repeat"
#else
# @event_recurring = EventRecurring.new(params[:event])
#end
if @event.present? && @event.save
render json: @event.to_json
else
@@ -1,45 +0,0 @@
class Panel::CalendarNew::FrontEnd::EventsController < OrbitWidgetController
# GET /events
# GET /events.json
def initialize
super
@app_title = 'calendar'
end
def index
@item = Page.find(params[:page_id])
@title = @item.title
if !@item.frontend_data_count.blank?
@page_num = @item.frontend_data_count
else
@page_num = 10
end
if params[:start].present? && params[:end].present?
sdt = Time.at(params[:start].to_i)
edt = Time.at(params[:end].to_i)
@monthly_events = Event.monthly_event(sdt,edt)
@re = Event.recurring_event(sdt,edt)
@events = @monthly_events.inject(@re, :<<)
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @events }
end
end
def show
@event = Event.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @event }
end
end
def agenda
agenda_start = Date.parse(params[:agenda_start])
agenda_end = Date.parse(params[:agenda_end])
@events = Event.agenda_events(agenda_start,agenda_end)
render :json=>@events.to_json
end
end
+9 -8
View File
@@ -4,7 +4,6 @@ require 'date'
class Event
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCategory::Categorizable
include Mongoid::MultiParameterAttributes
field :title
@@ -13,11 +12,13 @@ class Event
field :end, type: DateTime
field :all_day, type: Boolean
field :recurring, type: Boolean
field :event_category_id
field :frequency
field :period
attr_accessor :agenda_start, :agenda_end, :get_agenda_events
belongs_to :event_category
validates_presence_of :title, :message => "Please fill the title of the Event"
@@ -41,8 +42,8 @@ class Event
:end => self.end.rfc822,
:allDay => self.all_day,
:recurring => self.recurring,
:calendar => self.category_id,
:color => Category.find(self.category_id).custom_value,
:calendar => self.event_category_id,
:color => EventCategory.find(self.event_category_id).color,
:edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(self.id),
:delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(self.id)
}
@@ -63,13 +64,13 @@ class Event
@i = TimeDifference.between(re.start,end_date).in_days.to_i
(1..@i).each do |i|
@start_date = re.start + i
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @start_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @start_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
elsif re.start < start_date
@i = TimeDifference.between(start_date,end_date).in_days.to_i
(0..@i-1).each do |i|
@start_date = start_date.to_date + i
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @start_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @start_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
end
when "Weekly"
@@ -80,7 +81,7 @@ class Event
@start_date += (7*re.frequency.to_i)
@end_date += (7*re.frequency.to_i)
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @end_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @end_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
when "Monthly"
if !(start_date..end_date).cover?(re.start)
@@ -90,7 +91,7 @@ class Event
@start_date = sd
sd = sd >> @i*re.frequency.to_i
ed = ed >> @i*re.frequency.to_i
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>sd, :end => ed, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>sd, :end => ed, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
when "Yearly"
if !(start_date..end_date).cover?(re.start)
@@ -100,7 +101,7 @@ class Event
@start_date = sd
sd = sd >> 12 * @i*re.frequency.to_i
ed = ed >> 12 * @i*re.frequency.to_i
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>sd, :end => ed, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>sd, :end => ed, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
end
end
@@ -1,21 +0,0 @@
<tr class="<%= 'disable' if category.disable %>">
<% @site_valid_locales.each_with_index do |locale, i| %>
<td>
<%= category.title_translations[locale] %>
<% if i == 0 %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if is_admin?%>
<li><%= link_to t(:edit), '#', class: "open-slide", data: {title: t(:edit_category), id: category.id.to_s, module: @module_app_id.to_s, form: category.title_translations.merge(color: category.custom_value)} %></li>
<li><%= link_to show_toggle_archive_btn(category), toggle_admin_module_app_category_path(@module_app_id, category), method: :post, remote: true, class: "archive_toggle" %></li>
<% end %>
<% if is_manager? || is_admin? %>
<li><%= link_to t(:category_auth), admin_authorizations_path(@module_app.key, 'category_authorization', category.id) %></li>
<% end %>
</ul>
</div>
<% end %>
</td>
<% end %>
<td><span class="badge" style="background-color: <%= category.custom_value %>;"><%= category.custom_value %></span></td>
</tr>
@@ -1,12 +0,0 @@
<%= flash_messages %>
<%= f.error_messages %>
<%= label_tag("color", t("calendar.color")) %>
<div class="input-append">
<%= f.text_field :custom_value, id: "color", :class => "color-picker miniColors input-small", :size => "7", :maxlength => "7", :autocomplete=>"off",:value=>"9100FF" %>
</div>
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= label_tag "name-#{locale}", "#{t(:name)} (#{I18nVariable.from_locale(locale)})" %>
<%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name), id: locale %>
<% end %>
<% end %>
@@ -1,65 +1,28 @@
<%= stylesheet_link_tag "jquery.miniColors" %>
<%= javascript_include_tag "jquery.miniColors.min" %>
<%= javascript_include_tag "admin/categories" %>
<div id="categories_index">
<table class="table main-list">
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @site_valid_locales.each_with_index do |locale, i| %>
<th class="<%= 'span5' if i <= 1 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th>
<tr>
<th class="span1"><%= t('event_category.name') %></th>
<th class="span1"><%= t('event_category.color') %></th>
<%if is_manager? %>
<th class="span1"><%= t('event_category.edit') %></th>
<th class="span1"><%= t('event_category.delete') %></th>
<% end %>
<th class="span2"><a href="#"><%= t('event_category.color') %></a></th>
</tr>
</thead>
<tbody>
<%= render partial: 'category', collection: @categories %>
<tbody id="tbody_locations" class="sort-holder">
<% @event_categories.each do |event_category| %>
<tr class="with_action">
<td><%= event_category.name %></td>
<td><%= event_category.color%></td>
<%if is_manager? %>
<td><%= link_to 'Edit', edit_panel_calendar_new_back_end_event_category_path(event_category) %></td>
<td><%= link_to 'Destroy', panel_calendar_new_back_end_event_category_path(event_category), method: :delete , :confirm => t(:sure?) %></td>
<%end%>
</tr>
<% end %>
</tbody>
</table>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
</div>
<div class="pagination pagination-centered">
<%= paginate @categories unless @categories.blank? %>
</div>
</div>
</div>
<div id="pageslide">
<div class="page-title clearfix">
<a class="pull-right" href="javascript:$.pageslide.close()">
<i class="icons-arrow-left-2"></i>
</a>
<span></span>
</div>
<div class="view-page">
<div class="nano">
<div class="content">
<%= form_for :category, url: nil, html:{:id=>"color"}, remote: true do |f| %>
<fieldset>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>
</div>
</div>
</div>
</div>
<script type="text/javascript">
if($('.color-picker').length > 0){
$('.color-picker').miniColors(); // just in category view
$('.miniColors-trigger').addClass('btn');
}
$("form#color").bind("ajax:complete",function(){
$.get("<%= panel_calendar_new_back_end_event_categories_list_path %>",function(data){
$("#categories_index").html(data);
openSlide();
})
})
</script>
<%= link_to "Add", new_panel_calendar_new_back_end_event_category_path, :class => "btn btn-primary pull-right", :id=>"create_event_btn", :ref=>"add-btn" %>
</p>
@@ -1,21 +0,0 @@
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @site_valid_locales.each_with_index do |locale, i| %>
<th class="<%= 'span5' if i <= 1 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th>
<% end %>
<th class="span2"><a href="#"><%= t('event_category.color') %></a></th>
</tr>
</thead>
<tbody>
<%= render partial: 'category', collection: @categories %>
</tbody>
</table>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
</div>
<div class="pagination pagination-centered">
<%= paginate @categories unless @categories.blank? %>
</div>
</div>
@@ -52,7 +52,7 @@
</div>
<div class="row-fluid">
<%= f.label "Calendar", :class=>"control-label span3" %>
<%= f.select :category_id, @categories.collect{|t| [ t.title, t.id ]} %>
<%= f.collection_select :event_category_id, EventCategory.all, :id, :name%>
</div>
<div class="row-fluid">
<label class="checkbox inline"><%= f.check_box :recurring,:id=>"recurring_checkbox", :checked => @recurring %> Recurring</label>
+4 -6
View File
@@ -2,16 +2,14 @@ Rails.application.routes.draw do
namespace :panel do
namespace :calendar_new do
namespace :back_end do
match 'event_categories/list' => "event_categories#list"
resources :event_categories
match 'events/agenda' => 'events#agenda', :as => :agenda
resources :events
end
namespace :front_end do
match 'events/agenda' => 'events#agenda', :as => :agenda
resources :events, except: [:new, :edit, :update, :destroy]
end
namespace :front_end do
match 'events/agenda' => 'events#agenda', :as => :agenda
resources :events
end
end
end
end
+9 -9
View File
@@ -16,33 +16,33 @@ module CalendarNew
front_end do
app_page 'events' do
frontend_i18n "calendar_new.frontend.events"
frontend_i18n "calendar_new.frontend.events"
end
end
side_bar do
head_label_i18n 'calendar.calendar',:icon_class=>"icons-calendar"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:private=>['events','event_categories'],:public=>['panel/calendar_new/back_end/tags']})
active_for_controllers ({:private=>['events'],:public=>['panel/calendar_new/back_end/tags']})
head_link_path "panel_calendar_new_back_end_events_path"
# context_link 'calendar.categories',
# :link_path=>"admin_module_app_categories_path(get_module_app)" ,
# :priority=>2,
# :active_for_category => 'CalendarNew',
# :available_for => [:manager]
context_link 'calendar.categories',
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
:priority=>2,
:active_for_category => 'CalendarNew',
:available_for => [:manager]
context_link 'tags',
:link_path=>"admin_module_tags_path(module_app_id: get_module_app)" ,
:priority=>4,
:active_for_tag => 'CalendarNew',
:available_for => [:manager]
context_link 'calendar.categories',
context_link 'calendar.color',
:link_path=>"panel_calendar_new_back_end_event_categories_path" ,
:priority=>3,
:active_for_category => 'CalendarNew',
:active_for_tag => 'CalendarNew',
:available_for => [:manager]
end
end
Loaded 100 of 162 files, more files were not shown because too many files have changed in this diff. Show more