diff --git a/.gitignore b/.gitignore index 71494e306..b57fdb65e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,7 @@ uploads/**/* *.swp -public/javascripts -public/stylesheets +public/assets config/application.rb .rvmrc diff --git a/Gemfile b/Gemfile index a1ed5fb01..5c9b15e7e 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,9 @@ gem 'mysql2' gem 'nokogiri' gem 'radius' gem 'rake' +gem 'resque' # background jobs +gem 'resque-scheduler' # job scheduling +gem 'resque-restriction' gem 'ruby-debug19' gem 'rubyzip' gem 'therubyracer' diff --git a/Gemfile.lock b/Gemfile.lock index 5089191c3..a12a663b5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -97,7 +97,6 @@ GEM railties (~> 3.0) thor (~> 0.14) json (1.6.5) - libv8 (3.3.10.4) linecache19 (0.5.12) ruby_core_source (>= 0.1.4) mail (2.3.3) @@ -155,6 +154,20 @@ GEM rake (0.9.2.2) rdoc (3.12) json (~> 1.4) + redis (2.2.2) + redis-namespace (1.0.3) + redis (< 3.0.0) + resque (1.20.0) + multi_json (~> 1.0) + redis-namespace (~> 1.0.2) + sinatra (>= 0.9.2) + vegas (~> 0.1.2) + resque-restriction (0.3.0) + resque (>= 1.7.0) + resque-scheduler (1.9.9) + redis (>= 2.0.1) + resque (>= 1.8.0) + rufus-scheduler rspec (2.8.0) rspec-core (~> 2.8.0) rspec-expectations (~> 2.8.0) @@ -184,6 +197,8 @@ GEM ruby_parser (2.3.1) sexp_processor (~> 3.0) rubyzip (0.9.6.1) + rufus-scheduler (2.0.16) + tzinfo (>= 0.3.23) ruport (1.6.3) fastercsv pdf-writer (= 1.1.8) @@ -211,8 +226,6 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) subexec (0.2.1) - therubyracer (0.9.10) - libv8 (~> 3.3.10) thor (0.14.6) tilt (1.3.3) tinymce-rails (3.4.8) @@ -226,6 +239,8 @@ GEM uglifier (1.2.3) execjs (>= 0.3.0) multi_json (>= 1.0.2) + vegas (0.1.11) + rack (>= 1.0.0) warden (1.1.1) rack (>= 1.0) watchr (0.7) @@ -265,6 +280,9 @@ DEPENDENCIES radius rails (>= 3.1.0, < 3.2.0) rake + resque + resque-restriction + resque-scheduler rspec (~> 2.0) rspec-rails (~> 2.0) ruby-debug19 @@ -275,7 +293,6 @@ DEPENDENCIES sinatra spork sprockets - therubyracer tinymce-rails uglifier watchr diff --git a/Rakefile b/Rakefile index 9a495de7b..e0dc9c5b8 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,9 @@ +# /usr/bin/ruby -Ku # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) +require 'resque/tasks' require 'rake/dsl_definition' require 'rake' diff --git a/app/assets/fonts/widget.css b/app/assets/fonts/widget.css deleted file mode 100644 index fe83b22d4..000000000 --- a/app/assets/fonts/widget.css +++ /dev/null @@ -1,79 +0,0 @@ -.widget-size-300 { - width:298px; -} -.widget-box { - background-color: #FFF; - overflow: hidden; - min-width: 300px; - border: 1px solid #DDD; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - margin: 0 0 5px 5px; - position:relative; -} -.widget-box .widget-title { - background: #999; - color: #FFF; - padding-left: 5px; - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px 5px 0 0; -} -.widget-box .widget-content { - padding: 10px; -} -.widget-box .form-horizontal .control-group > label { - width: 50px; -} -.widget-box .form-horizontal .controls { - margin-left: 60px; -} -.widget-action { - position:absolute; - right:1px; - top:6px; -} -.action { - float: left; - display:inline-block; - margin-right: 5px; - opacity: 0.8; - filter: alpha(opacity=80); -} -.action:hover { - opacity: 1; - filter: alpha(opacity=100); - cursor: pointer; -} -.select-role { - display:none; - padding: 10px 0 0; -} -.file-upload { - position:relative; -} -.file-upload .file-name { - display: inline-block; - margin: 0 0 5px 5px; - white-space: nowrap; - width: 140px; -} -.file-upload .upload { - margin:0; - padding:0; - position:absolute; - top:0; - left:0; - opacity:.0; - filter: alpha(opacity=100); -} -.file-upload .upload:focus { - position:absolute; -} -.upload-picture { - margin-right: 5px; -} -#widget-link table { - margin-bottom:0 -} \ No newline at end of file diff --git a/public/assets/sign-in-logo-96872662bbb7d39f593224ee38f4cd9b.png b/app/assets/images/-sign-in-logo.png similarity index 100% rename from public/assets/sign-in-logo-96872662bbb7d39f593224ee38f4cd9b.png rename to app/assets/images/-sign-in-logo.png diff --git a/app/assets/images/check.png b/app/assets/images/check.png index e415c89b5..0972e33a4 100644 Binary files a/app/assets/images/check.png and b/app/assets/images/check.png differ diff --git a/app/assets/images/orbit-bar.png b/app/assets/images/orbit-bar.png index 160b9d781..4b2a55852 100644 Binary files a/app/assets/images/orbit-bar.png and b/app/assets/images/orbit-bar.png differ diff --git a/app/assets/images/sign-in-logo.png b/app/assets/images/sign-in-logo.png index 53756c7c3..a3148babd 100644 Binary files a/app/assets/images/sign-in-logo.png and b/app/assets/images/sign-in-logo.png differ diff --git a/app/assets/javascripts/ajax_form.js b/app/assets/javascripts/ajax_form.js index c026e518e..d9b5abfec 100644 --- a/app/assets/javascripts/ajax_form.js +++ b/app/assets/javascripts/ajax_form.js @@ -1,4 +1,4 @@ -$('#submit_button').live('click', function(){ +$(document).on('click', '#ajax_form_submit', function(){ $('#ajaxForm').ajaxSubmit({ beforeSubmit: function(a,f,o) { o.dataType = 'script'; diff --git a/app/assets/javascripts/bulletin_form.js.erb b/app/assets/javascripts/bulletin_form.js.erb index abb908b4e..cf2dfd69c 100644 --- a/app/assets/javascripts/bulletin_form.js.erb +++ b/app/assets/javascripts/bulletin_form.js.erb @@ -6,23 +6,14 @@ $('.bulletin_files_block a.delete').live('click', function(){ $(this).parents('.list_item').remove(); }); -$('.action a.remove_existing_record').live('click', function(){ +$(document).on('click', '.action a.remove_existing_record', function(){ $(this).next('.should_destroy').attr('value', 1); - //$("#bulletin_" + $(this).prev().attr('value')).hide(); - $("tr#bulletin_" + $(this).prev().attr('value')).hide(); + $("tr #" + $(this).prev().attr('value')).hide(); }); -$('.quick_edit_cancel').live('click', function(){ +$(document).on('click', '.quick_edit_cancel', function(){ tr = $(this).attr('rel'); $('#' + tr).hide(); $("tr#bulletin_file_" + $(this).prev().attr('value')).hide(); $("tr#bulletin_link_" + $(this).prev().attr('value')).hide(); -}); - -$(document).on('click', '.list-remove', function(){ - $('#delete_bulletins').submit(); -}); - -$(document).on('click', '#check_all_bulletins', function(){ - $('.checkbox_in_list').attr("checked", this.checked); }); \ No newline at end of file diff --git a/app/assets/javascripts/inc/jquery.imagesloaded.js b/app/assets/javascripts/inc/jquery.imagesloaded.js new file mode 100644 index 000000000..5b35bb9c4 --- /dev/null +++ b/app/assets/javascripts/inc/jquery.imagesloaded.js @@ -0,0 +1,137 @@ +/*! + * jQuery imagesLoaded plugin v2.0.1 + * http://github.com/desandro/imagesloaded + * + * MIT License. by Paul Irish et al. + */ + +/*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */ +/*global jQuery: false */ + +;(function($, undefined) { +'use strict'; + +// blank image data-uri bypasses webkit log warning (thx doug jones) +var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=='; + +$.fn.imagesLoaded = function( callback ) { + var $this = this, + deferred = $.isFunction($.Deferred) ? $.Deferred() : 0, + hasNotify = $.isFunction(deferred.notify), + $images = $this.find('img').add( $this.filter('img') ), + loaded = [], + proper = [], + broken = []; + + function doneLoading() { + var $proper = $(proper), + $broken = $(broken); + + if ( deferred ) { + if ( broken.length ) { + deferred.reject( $images, $proper, $broken ); + } else { + deferred.resolve( $images ); + } + } + + if ( $.isFunction( callback ) ) { + callback.call( $this, $images, $proper, $broken ); + } + } + + function imgLoaded( img, isBroken ) { + // don't proceed if BLANK image, or image is already loaded + if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) { + return; + } + + // store element in loaded images array + loaded.push( img ); + + // keep track of broken and properly loaded images + if ( isBroken ) { + broken.push( img ); + } else { + proper.push( img ); + } + + // cache image and its state for future calls + $.data( img, 'imagesLoaded', { isBroken: isBroken, src: img.src } ); + + // trigger deferred progress method if present + if ( hasNotify ) { + deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] ); + } + + // call doneLoading and clean listeners if all images are loaded + if ( $images.length === loaded.length ){ + setTimeout( doneLoading ); + $images.unbind( '.imagesLoaded' ); + } + } + + // if no images, trigger immediately + if ( !$images.length ) { + doneLoading(); + } else { + $images.bind( 'load.imagesLoaded error.imagesLoaded', function( event ){ + // trigger imgLoaded + imgLoaded( event.target, event.type === 'error' ); + }).each( function( i, el ) { + var src = el.src; + + // find out if this image has been already checked for status + // if it was, and src has not changed, call imgLoaded on it + var cached = $.data( el, 'imagesLoaded' ); + if ( cached && cached.src === src ) { + imgLoaded( el, cached.isBroken ); + return; + } + + // if complete is true and browser supports natural sizes, try + // to check for image status manually + if ( el.complete && el.naturalWidth !== undefined ) { + imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 ); + return; + } + + // cached images don't fire load sometimes, so we reset src, but only when + // dealing with IE, or image is complete (loaded) and failed manual check + // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f + if ( el.readyState || el.complete ) { + el.src = BLANK; + el.src = src; + } + }); + } + + return deferred ? deferred.promise( $this ) : $this; +}; + +})(jQuery); + +$(document).ready(function() { + $('.upload-picture').find('img').imagesLoaded(function(){ + var picH = $('.upload-picture').width()/$('.upload-picture').find('img').width()*$('.upload-picture').find('img').height(); + var imgMarginTop = ($('.upload-picture').height()-picH)/2; + var d = $('.upload-picture').height(); + if(imgMarginTop>0){ + imgMarginTop = 0; + d = picH; + $('.upload-picture').css({height:d}) + } + $('.upload-picture').find('img').css({marginTop:imgMarginTop}) + $('.upload-picture').each(function (i){ + $(this).mouseenter(function(){ + var h= picH; + $(this).stop().animate({height:h}, 500); + $(this).find('img').stop().animate({marginTop:0}, 500); + }); + $(this).mouseleave(function(){ + $(this).stop().animate({height:d}, 500); + $(this).find('img').stop().animate({marginTop:imgMarginTop}, 500); + }); + }); + }); +}); \ No newline at end of file diff --git a/app/assets/javascripts/inc/modal-preview.js b/app/assets/javascripts/inc/modal-preview.js new file mode 100644 index 000000000..959f04b2c --- /dev/null +++ b/app/assets/javascripts/inc/modal-preview.js @@ -0,0 +1,20 @@ +//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'%> + +$(document).ready(function() { + $("a.preview_trigger").click(function(){ + $("#main-wrap").after(""); + $.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; + }); +}); \ No newline at end of file diff --git a/app/assets/javascripts/inc/permission-checkbox.js b/app/assets/javascripts/inc/permission-checkbox.js index fc91b8579..23716f682 100644 --- a/app/assets/javascripts/inc/permission-checkbox.js +++ b/app/assets/javascripts/inc/permission-checkbox.js @@ -1,4 +1,7 @@ $(document).ready(function() { + permissionCheckbox(); +}); +function permissionCheckbox(){ $('.check[checked="checked"]').parents(".checkbox").addClass("checked") $(".checkbox").click(function(){ if($(this).children(".check").attr("checked")){ @@ -16,4 +19,4 @@ $(document).ready(function() { placement: 'bottom', delay: { show: 100, hide: 300 }, }); -}); \ No newline at end of file +}; \ No newline at end of file diff --git a/app/assets/javascripts/jquery.tinyscrollbar.min.js b/app/assets/javascripts/jquery.tinyscrollbar.min.js index 98786a770..e385ff8ed 100644 --- a/app/assets/javascripts/jquery.tinyscrollbar.min.js +++ b/app/assets/javascripts/jquery.tinyscrollbar.min.js @@ -1 +1,118 @@ -(function(a){function b(b,c){function w(a){if(!(g.ratio>=1)){o.now=Math.min(i[c.axis]-j[c.axis],Math.max(0,o.start+((k?a.pageX:a.pageY)-p.start)));n=o.now*h.ratio;g.obj.css(l,-n);j.obj.css(l,o.now)}return false}function v(b){a(document).unbind("mousemove",w);a(document).unbind("mouseup",v);j.obj.unbind("mouseup",v);document.ontouchmove=j.obj[0].ontouchend=document.ontouchend=null;return false}function u(b){if(!(g.ratio>=1)){var b=b||window.event;var d=b.wheelDelta?b.wheelDelta/120:-b.detail/3;n-=d*c.wheel;n=Math.min(g[c.axis]-f[c.axis],Math.max(0,n));j.obj.css(l,n/h.ratio);g.obj.css(l,-n);b=a.event.fix(b);b.preventDefault()}}function t(b){p.start=k?b.pageX:b.pageY;var c=parseInt(j.obj.css(l));o.start=c=="auto"?0:c;a(document).bind("mousemove",w);document.ontouchmove=function(b){a(document).unbind("mousemove");w(b.touches[0])};a(document).bind("mouseup",v);j.obj.bind("mouseup",v);j.obj[0].ontouchend=document.ontouchend=function(b){a(document).unbind("mouseup");j.obj.unbind("mouseup");v(b.touches[0])};return false}function s(){j.obj.bind("mousedown",t);j.obj[0].ontouchstart=function(a){a.preventDefault();j.obj.unbind("mousedown");t(a.touches[0]);return false};i.obj.bind("mouseup",w);if(c.scroll&&this.addEventListener){e[0].addEventListener("DOMMouseScroll",u,false);e[0].addEventListener("mousewheel",u,false)}else if(c.scroll){e[0].onmousewheel=u}}function r(){j.obj.css(l,n/h.ratio);g.obj.css(l,-n);p["start"]=j.obj.offset()[l];var a=m.toLowerCase();h.obj.css(a,i[c.axis]);i.obj.css(a,i[c.axis]);j.obj.css(a,j[c.axis])}function q(){d.update();s();return d}var d=this;var e=b;var f={obj:a(".viewport",b)};var g={obj:a(".overview",b)};var h={obj:a(".scrollbar",b)};var i={obj:a(".track",h.obj)};var j={obj:a(".thumb",h.obj)};var k=c.axis=="x",l=k?"left":"top",m=k?"Width":"Height";var n,o={start:0,now:0},p={};this.update=function(a){f[c.axis]=f.obj[0]["offset"+m];g[c.axis]=g.obj[0]["scroll"+m];g.ratio=f[c.axis]/g[c.axis];h.obj.toggleClass("disable",g.ratio>=1);i[c.axis]=c.size=="auto"?f[c.axis]:c.size;j[c.axis]=Math.min(i[c.axis],Math.max(0,c.sizethumb=="auto"?i[c.axis]*g.ratio:c.sizethumb));h.ratio=c.sizethumb=="auto"?g[c.axis]/i[c.axis]:(g[c.axis]-f[c.axis])/(i[c.axis]-j[c.axis]);n=a=="relative"&&g.ratio<=1?Math.min(g[c.axis]-f[c.axis],Math.max(0,n)):0;n=a=="bottom"&&g.ratio<=1?g[c.axis]-f[c.axis]:isNaN(parseInt(a))?n:parseInt(a);r()};return q()}a.tiny=a.tiny||{};a.tiny.scrollbar={options:{axis:"y",wheel:40,scroll:true,size:"auto",sizethumb:"auto"}};a.fn.tinyscrollbar=function(c){var c=a.extend({},a.tiny.scrollbar.options,c);this.each(function(){a(this).data("tsb",new b(a(this),c))});return this};a.fn.tinyscrollbar_update=function(b){return a(this).data("tsb").update(b)};})(jQuery) \ No newline at end of file +(function(a){ + function b(b,c){ + function w(a){ + if(!(g.ratio>=1)){ + o.now=Math.min(i[c.axis]-j[c.axis],Math.max(0,o.start+((k?a.pageX:a.pageY)-p.start))); + n=o.now*h.ratio;g.obj.css(l,-n); + j.obj.css(l,o.now) + } + return false + } + function v(b){ + a(document).unbind("mousemove",w); + a(document).unbind("mouseup",v); + j.obj.unbind("mouseup",v); + document.ontouchmove=j.obj[0].ontouchend=document.ontouchend=null; + return false + } + function u(b){ + if(!(g.ratio>=1)){ + var b=b||window.event; + var d=b.wheelDelta?b.wheelDelta/120:-b.detail/3; + n-=d*c.wheel; + n=Math.min(g[c.axis]-f[c.axis],Math.max(0,n)); + j.obj.css(l,n/h.ratio); + g.obj.css(l,-n); + b=a.event.fix(b); + b.preventDefault() + } + } + function t(b){ + p.start=k?b.pageX:b.pageY; + var c=parseInt(j.obj.css(l)); + o.start=c=="auto"?0:c; + a(document).bind("mousemove",w); + document.ontouchmove=function(b){ + a(document).unbind("mousemove"); + w(b.touches[0]) + }; + a(document).bind("mouseup",v); + j.obj.bind("mouseup",v); + j.obj[0].ontouchend=document.ontouchend=function(b){ + a(document).unbind("mouseup"); + j.obj.unbind("mouseup"); + v(b.touches[0]) + }; + return false + } + function s(){ + j.obj.bind("mousedown",t); + j.obj[0].ontouchstart=function(a){ + a.preventDefault(); + j.obj.unbind("mousedown"); + t(a.touches[0]); + return false + }; + i.obj.bind("mouseup",w); + if(c.scroll&&this.addEventListener){ + e[0].addEventListener("DOMMouseScroll",u,false); + e[0].addEventListener("mousewheel",u,false) + }else if(c.scroll){ + e[0].onmousewheel=u + } + } + function r(){ + j.obj.css(l,n/h.ratio); + g.obj.css(l,-n); + p["start"]=j.obj.offset()[l]; + var a=m.toLowerCase(); + h.obj.css(a,i[c.axis]); + i.obj.css(a,i[c.axis]); + j.obj.css(a,j[c.axis]) + } + function q(){ + d.update(); + s(); + return d + } + var d=this; + var e=b; + var f={obj:a(".viewport",b)}; + var g={obj:a(".overview",b)}; + var h={obj:a(".scrollbar",b)}; + var i={obj:a(".track",h.obj)}; + var j={obj:a(".thumb",h.obj)}; + var k=c.axis=="x", + l=k?"left":"top", + m=k?"Width":"Height"; + var n, + o={start:0,now:0}, + p={}; + this.update=function(a){ + f[c.axis]=f.obj[0]["offset"+m]; + g[c.axis]=g.obj[0]["scroll"+m]; + g.ratio=f[c.axis]/g[c.axis]; + h.obj.toggleClass("disable",g.ratio>=1); + i[c.axis]=c.size=="auto"?f[c.axis]:c.size; + j[c.axis]=Math.min(i[c.axis],Math.max(0,c.sizethumb=="auto"?i[c.axis]*g.ratio:c.sizethumb)); + h.ratio=c.sizethumb=="auto"?g[c.axis]/i[c.axis]:(g[c.axis]-f[c.axis])/(i[c.axis]-j[c.axis]); + n=a=="relative"&&g.ratio<=1?Math.min(g[c.axis]-f[c.axis],Math.max(0,n)):0; + n=a=="bottom"&&g.ratio<=1?g[c.axis]-f[c.axis]:isNaN(parseInt(a))?n:parseInt(a); + r() + }; + return q() + } + a.tiny=a.tiny||{}; + a.tiny.scrollbar={options:{axis:"y",wheel:40,scroll:true,size:"auto",sizethumb:"auto"}}; + a.fn.tinyscrollbar=function(c){ + var c=a.extend({},a.tiny.scrollbar.options,c); + this.each(function(){ + a(this).data("tsb",new b(a(this),c)) + }); + return this + }; + a.fn.tinyscrollbar_update=function(b){ + return a(this).data("tsb").update(b) + }; +}) +(jQuery) \ No newline at end of file diff --git a/app/assets/javascripts/new_admin.js b/app/assets/javascripts/new_admin.js index 45bfcbbc1..f20267cd9 100644 --- a/app/assets/javascripts/new_admin.js +++ b/app/assets/javascripts/new_admin.js @@ -6,6 +6,7 @@ // //= require jquery //= require jquery_ujs +//= require jquery.form //= require bootstrap //= require jquery.isotope.min //= require jquery.tinyscrollbar.min @@ -13,4 +14,5 @@ //= require tinymce-jquery //= require tinymce_orbit //= require orbit-bar-search -//= require side_bar_history \ No newline at end of file +//= require side_bar_history +//= require ajax_form \ No newline at end of file diff --git a/app/assets/javascripts/news_bulletin_form.js b/app/assets/javascripts/news_bulletin_form.js new file mode 100644 index 000000000..6f0f9ac56 --- /dev/null +++ b/app/assets/javascripts/news_bulletin_form.js @@ -0,0 +1,19 @@ +$('.news_bulletin_links_block a.delete').live('click', function(){ + $(this).parents('.list_item').remove(); +}); + +$('.news_bulletin_files_block a.delete').live('click', function(){ + $(this).parents('.list_item').remove(); +}); + +$(document).on('click', '.action a.remove_existing_record', function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr #" + $(this).prev().attr('value')).hide(); +}); + +$(document).on('click', '.quick_edit_cancel', function(){ + tr = $(this).attr('rel'); + $('#' + tr).hide(); + $("tr#news_bulletin_file_" + $(this).prev().attr('value')).hide(); + $("tr#news_bulletin_link_" + $(this).prev().attr('value')).hide(); +}); \ No newline at end of file diff --git a/app/assets/javascripts/orbit-1.0.js b/app/assets/javascripts/orbit-1.0.js index 5f69b297e..b1ac99937 100644 --- a/app/assets/javascripts/orbit-1.0.js +++ b/app/assets/javascripts/orbit-1.0.js @@ -14,9 +14,9 @@ $(document).ready(function(){ placement: "left" }); + $(document).on('click', '.privacy', function() { - console.log($(this).val()); switch ($(this).val()) { case 'true': $(this).parents('.controls').children('.select-role').slideUp(300); @@ -47,14 +47,19 @@ $(document).ready(function(){ /*tinyscrollbar&windows-Size*/ resize(); - var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2; - $('#main-sidebar').css("height", viewportheight-30); - $('#main-sidebar .viewport').css("height", viewportheight-30); - $('.post-title').css("width", viewportwidth-495); + var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2, + $subWiget = $('#sub-wiget').width()+18; + $orbitBar = $('#orbit-bar').height(), + $mainSidebar = $('#main-sidebar').width()+5, + $formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right")); + $('#main-sidebar').css("height", viewportheight-$orbitBar); + $('#main-sidebar .viewport').css("height", viewportheight-$orbitBar); + $('#post-body').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget); + $('.post-title').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget-16); $('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft); - $('#main-sidebar').tinyscrollbar(); + $('.form-fixed').css("width", viewportwidth-$mainWrapMarginLeft-$formActionPadding); + $('#main-sidebar').tinyscrollbar({size:(viewportheight-$orbitBar-4)}); $('.detal-list').tinyscrollbar(); - $('#main-sidebar').tinyscrollbar({size:(viewportheight-34)}); mainTablePosition(); /*isotope*/ @@ -68,12 +73,18 @@ $(document).ready(function(){ }); $(window).resize(function(){ resize(); - var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2; - $('#main-sidebar').css("height", viewportheight-30); - $('#main-sidebar .viewport').css("height", viewportheight-30); - $('.post-title').css("width", viewportwidth-495); - $('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft) - $('#main-sidebar').tinyscrollbar({size:(viewportheight-34)}); + var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2, + $subWiget = $('#sub-wiget').width()+18; + $orbitBar = $('#orbit-bar').height(), + $mainSidebar = $('#main-sidebar').width()+5, + $formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right")); + $('#main-sidebar').css("height", viewportheight-$orbitBar); + $('#main-sidebar .viewport').css("height", viewportheight-$orbitBar); + $('#post-body').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget); + $('.post-title').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget-16); + $('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft); + $('.form-fixed').css("width", viewportwidth-$mainWrapMarginLeft-$formActionPadding); + $('#main-sidebar').tinyscrollbar({size:(viewportheight-$orbitBar-4)}); mainTablePosition(); }); /*main-table position*/ @@ -101,5 +112,4 @@ $(window).scroll(function () { $(".table-label").css({left:$winLeft*-1} ); //$(".table-label").css({left:$mainWrapMarginLeft+($winLeft*-1)} ); //$("#main-wrap > .subnav").css({width:$subnavWidth+($winLeft)} ); - //console.log($mainWrapMarginLeft+($winLeft*-1)+5); }); diff --git a/app/assets/javascripts/orbit-bar-search.js b/app/assets/javascripts/orbit-bar-search.js index 26f44d843..7ef1dd055 100644 --- a/app/assets/javascripts/orbit-bar-search.js +++ b/app/assets/javascripts/orbit-bar-search.js @@ -1,3 +1,9 @@ + +$(document).ready(function(){ + $('.search').tooltip({ + placement: "bottom" + }); +}); $(document).on('click', '.orbit-bar-search', function (){ if ($(this).parents('.search').hasClass('visible')){ $(this).parents('.search').stop().animate({ diff --git a/app/assets/javascripts/orbit_bar.js b/app/assets/javascripts/orbit_bar.js index 06c3113dc..e9b1b4ea2 100644 --- a/app/assets/javascripts/orbit_bar.js +++ b/app/assets/javascripts/orbit_bar.js @@ -4,4 +4,4 @@ $(document).ready(function() { $('body').prepend($(this).html()); $(this).remove(); }); -}); \ No newline at end of file +}); diff --git a/app/assets/javascripts/page_edit.js b/app/assets/javascripts/page_edit.js index 31a7d600d..a889f5b23 100644 --- a/app/assets/javascripts/page_edit.js +++ b/app/assets/javascripts/page_edit.js @@ -24,6 +24,10 @@ $("#module_app_list select").live('change', function() { $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_widgets'); }); +$("#tag_list select").live('change', function() { + $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_r_tag_options'); +}); + $('.part_kind').live('click', function() { $('.part_kind_partial').hide(); $('#part_' + $(this).attr('value')).show(); diff --git a/app/assets/javascripts/side_bar_history.js b/app/assets/javascripts/side_bar_history.js index 4b5da1d4c..ad29b4970 100644 --- a/app/assets/javascripts/side_bar_history.js +++ b/app/assets/javascripts/side_bar_history.js @@ -1,28 +1,28 @@ var history_edited = false; -// $('#back_sidebar a, #back_main a.nav').live('click', -// function () { -// $.getScript(this.href); -// history.pushState(null, document.title, this.href); -// history_edited = true; -// return false; -// } -// ); +$('#back_sidebar a, #back_main a.nav').live('click', + function () { + $.getScript(this.href); + history.pushState(null, document.title, this.href); + history_edited = true; + return false; + } +); -// $('#back_main a.reload').live('click', -// function () { -// $.getScript(this.href); -// history.replaceState(null, document.title, this.href); -// history_edited = true; -// return false; -// } -// ); +$('#back_main a.reload').live('click', + function () { + $.getScript(this.href); + history.replaceState(null, document.title, this.href); + history_edited = true; + return false; + } +); -// $('.form').live('submit', function () { -// $.post(this.action, $(this).serialize(), null, 'script'); -// history_edited = true; -// return false; -// }); +$('#back_main .form').live('submit', function () { + $.post(this.action, $(this).serialize(), null, 'script'); + history_edited = true; + return false; +}); $(document).on('click', '.js_history', function () { diff --git a/app/assets/javascripts/site_editor.js b/app/assets/javascripts/site_editor.js index 1eb5e3f1e..4451accba 100644 --- a/app/assets/javascripts/site_editor.js +++ b/app/assets/javascripts/site_editor.js @@ -6,6 +6,10 @@ // //= require jquery //= require jquery_ujs -//= require page_edit +//= require bootstrap +//= require jquery.isotope.min +//= require jquery.tinyscrollbar.min +//= require orbit-1.0 +//= require orbit-bar-search //= require side_bar_history -//= require new_admin \ No newline at end of file +//= require page_edit \ No newline at end of file diff --git a/app/assets/javascripts/sort_header.js b/app/assets/javascripts/sort_header.js new file mode 100644 index 000000000..25a163449 --- /dev/null +++ b/app/assets/javascripts/sort_header.js @@ -0,0 +1,7 @@ +$(document).on('click', '.list-remove', function(){ + $('#delete_all').submit(); +}); + +$(document).on('click', '#check_all', function(){ + $('.checkbox_in_list').attr("checked", this.checked); +}); \ No newline at end of file diff --git a/app/assets/stylesheets/bootstrap-orbit.css b/app/assets/stylesheets/bootstrap-orbit.css index 34425d500..2ce9bc9cb 100644 --- a/app/assets/stylesheets/bootstrap-orbit.css +++ b/app/assets/stylesheets/bootstrap-orbit.css @@ -1,3 +1,5 @@ +/*bootstrap-orbit*/ + h1, h2, h3, h4, h5, h6 { font-weight:normal ; } @@ -110,6 +112,18 @@ table .span1-3 { .qe-block .form-horizontal .form-actions { text-align:right; } +.form-actions form { + margin-bottom: 0; +} +.form-actions form input { + margin-bottom: 0; +} .modal.fade { top: -50%; +} +.form-search button { + margin-bottom: 0; +} +.modal form { + margin-bottom: 0; } \ No newline at end of file diff --git a/app/assets/stylesheets/bootstrap.css.erb b/app/assets/stylesheets/bootstrap.css.erb index ee2ae5a48..62a0afe8e 100644 --- a/app/assets/stylesheets/bootstrap.css.erb +++ b/app/assets/stylesheets/bootstrap.css.erb @@ -1,3 +1,4 @@ +/*bootstrap*/ /*! * Bootstrap v2.0.0 * @@ -65,6 +66,7 @@ textarea { margin: 0; font-size: 100%; vertical-align: middle; + margin-bottom: 10px; } button, input { *overflow: visible; @@ -538,7 +540,7 @@ select, width: 210px; height: 18px; padding: 4px; - margin-bottom: 9px; + /*margin-bottom: 9px;*/ font-size: 13px; line-height: 18px; color: #555555; @@ -2664,18 +2666,23 @@ button.btn.small, input[type="submit"].btn.small { display: inline; } -.pagination .page{ +/*.pagination .page{ float: left; padding: 0 14px; line-height: 34px; text-decoration: none; border: 1px solid #ddd; border-left-width: 0; -} +}*/ .pagination a { float: left; + padding: 0 14px; + line-height: 34px; + text-decoration: none; + border: 1px solid #DDD; + border-left-width: 0; } -.pagination .next{ +/*.pagination .next{ float: left; padding: 0 14px; line-height: 34px; @@ -2690,12 +2697,15 @@ button.btn.small, input[type="submit"].btn.small { text-decoration: none; border: 1px solid #ddd; border-left-width: 0; -} +}*/ .pagination .current{ border-left-width: 1px; } +.pagination a { + background-color: #FFFFFF; +} .pagination a:hover, .pagination .active a { - background-color: #f5f5f5; + background-color: #e8e8e8; } .pagination .active a { color: #999999; diff --git a/app/assets/stylesheets/inc/permission-checkbox.css b/app/assets/stylesheets/inc/permission-checkbox.css.erb similarity index 79% rename from app/assets/stylesheets/inc/permission-checkbox.css rename to app/assets/stylesheets/inc/permission-checkbox.css.erb index 0adf72259..7e3f5bffa 100644 --- a/app/assets/stylesheets/inc/permission-checkbox.css +++ b/app/assets/stylesheets/inc/permission-checkbox.css.erb @@ -1,3 +1,5 @@ +/*permission-checkbox*/ + .checkblock { display: inline-block; float: left; @@ -8,37 +10,40 @@ } .checkbox{ padding: 5px; - margin: 5px 5px 10px; + margin: 0; display: inline-block; color:#777777; text-shadow: 0 1px 0px rgba(255,255,255,.4); - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; height: 30px; position: relative; cursor: pointer; - background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) ); + border-style: solid; + border-width: 0px 1px 1px 0; + border-color: #dfdfdf; + /*background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) ); background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% ); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf'); -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px;*/ } .checkbox .check-icon { display: none; position: absolute; - width: 26px; - height: 26px; - background: url('img/check.png') no-repeat left top; + width: 32px; + height: 32px; + background: url(<%= asset_path 'check.png' %>) no-repeat left top; right: -10px; - top: -5px; + top: 15px; } .checkbox .member-name { cursor: pointer; font-family: helvetica; font-size: 12px; - line-height: 30px; + line-height: 15px; padding: 0 10px 0 40px; color: #333333; display: inline-block; diff --git a/app/assets/stylesheets/isotope.css b/app/assets/stylesheets/isotope.css index 1d659c5ef..3e7bf739c 100644 --- a/app/assets/stylesheets/isotope.css +++ b/app/assets/stylesheets/isotope.css @@ -1,16 +1,11 @@ +/*isotope*/ + #isotope { margin-top: 2px; - background-color:#f4f4f4; } .isotope-item { z-index: 2; } - -.isotope-hidden.isotope-item { - pointer-events: none; - z-index: 1; -} - /**** Isotope CSS3 transitions ****/ .isotope, @@ -46,28 +41,27 @@ transition-duration: 0s; } .w-a { - width: 388px; + width: 398px; } .w-b { - width: 802px; + width: 812px; } .h-a { height: 315px; } .h-b { - height: 699px; + height: 703px; } .item { margin: 5px 0 15px 15px; } .item h3 { - margin: 5px 0; + margin: 20px 0 5px; } .item h3 [class^="icons-"] { - margin: 3px 5px 0 3px; + margin: 1px 5px 0 3px; } .item .detail { - padding: 5px; border: 1px solid rgba(0, 0, 0, 0.1); background-color: #FFFFFF; border-radius: 5px; @@ -75,12 +69,11 @@ -moz-border-radius: 5px; box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1); } .item .detail .totle { font-size: 50px; - padding:10px 5px 20px 0; - margin: 0px; + padding:10px 5px 30px 0; + margin: 0; text-align: right; border-bottom:1px solid #d9d9d9; } @@ -90,20 +83,60 @@ color: #333; padding-left: 5px; text-align:left; + margin-bottom: -7px; +} +.item .detail .table { + margin-bottom: 0; } .item .detail .table th, .item .detail .table td { border-top: none; border-bottom: 1px solid #DDDDDD; } +.item .detail .table tr th { + background-color: #F2F2F2; + border-bottom: 1px solid #AAAAAA; +} .item .detail .table tr td:first-child { color: #666;; } -.item .detail .table tr td:last-child { +.item .detail .table tr td:last-child, .item .detail .table tr th:last-child { text-align:right; + padding-right: 15px; } .item .h-a .my_scroll .viewport { - height: 248px; + height: 210px; } .item .h-b .my_scroll .viewport { - height: 632px; + height: 594px; +} +.item .isotope-hidden.isotope-item { + pointer-events: none; + z-index: 1; +} +.item .my_scroll { + position: relative; +} +.item .my_scroll .scrollbar { + right: 3px; + top: 0; + position: absolute; + z-index: 10; +} +.item .my_scroll .track { + background-color: transparent; +} +.detail.noStatistics { + overflow: hidden; +} +.detail.noStatistics.h-a { + height: 315px; +} +.detail.noStatistics.h-a .my_scroll .viewport { + height: 280px; +} +.detail.noStatistics.h-b { + height: 704px; +} +.detail.noStatistics.h-b .my_scroll .viewport { + height: 670px; } \ No newline at end of file diff --git a/app/assets/stylesheets/list.css b/app/assets/stylesheets/list.css index c7785778e..4d7c11b1f 100644 --- a/app/assets/stylesheets/list.css +++ b/app/assets/stylesheets/list.css @@ -1,8 +1,5 @@ -.list-remove { - position: relative; - top: 2px; - left: 2px; -} +/*list*/ + .table th.select { border-bottom:2px solid #0088CC; } @@ -25,7 +22,7 @@ .main-list .nav-pills > li > a { border-radius: 5px 5px 5px 5px; margin: 2px; - padding:5px + padding:5px; } .main-list tbody .quick-edit { position:relative; @@ -38,6 +35,9 @@ width: 350px; left: -8px; } +.main-list tr:first-child td { + border-top: 1px solid #DDDDDD; +} .main-list td { background-color: #FFFFFF; border-bottom: 1px solid #DDDDDD; @@ -54,6 +54,11 @@ position: relative; height: 40px; } +.main-list .label-group .label { + margin-bottom: 1px; + display: inline-block; + padding: 0 3px; +} .main-list .label-td { background-color: rgba(255, 255, 255, 1); height: 40px; @@ -65,9 +70,8 @@ } .main-list .label-td:hover { height: auto; - text-align: center; padding: 5px 5px 8px; - left: -6px; + left: -40px; top: -6px; border: 1px solid rgba(0, 0, 0, 0.2); box-shadow: 0px 5px 10px rgba(0,0,0,0.2); @@ -77,6 +81,10 @@ -webkit-border-radius: 3px; -moz-border-radius: 3px; z-index: 5; + width: 200px; +} +.qe-edit-div .table-condensed { + background-color: #F2F2F2; } .table-label { background-color: #F2F2F2; @@ -96,6 +104,19 @@ .qe-block td { height:auto; padding: 0; + /*background-color: #dedede;*/ +} +.qe-block legend { + padding-left: 8px; + margin-bottom: 0; + padding-bottom: 0; +} +.qe-block .control-group { + margin-bottom: 0; +} +.qe-block .controls, .qe-block .control-label { + margin-top: 10px; + margin-bottom: 10px; } .qe-block .table td, .qe-block .table th { padding: 8px; @@ -112,9 +133,6 @@ legend { margin-bottom: 15px; padding-bottom: 5px; } -.upload-picture { - margin-left: 20px; -} .subnav { -moz-border-radius: 0; -webkit-border-radius: 0; @@ -148,4 +166,38 @@ legend { .dropdown-menu.tags li:last-child a { display: block; text-align:center; +} +.sort-header th { + padding: 0 8px; + vertical-align: inherit; + position: relative; +} +.sort-header th a { + display: block; + padding: 10px 0; + white-space: nowrap; +} +.sort-header th a:hover { + text-decoration: none; +} +.list-remove { + position: absolute; + top: 0; + padding-top: 9px !important; + left: 25px; +} +.form-fixed { + position: fixed; + margin: 0; + padding: 10px; + bottom: 0; + z-index: 2; +} +.form-fixed .btn { + margin-top: 4px; +} +.paginationFixed { +} +.paginationFixed .pagination { + margin-top: 0 !important; } \ No newline at end of file diff --git a/app/assets/stylesheets/message.css b/app/assets/stylesheets/message.css index ad67f31a7..9ee1d45da 100644 --- a/app/assets/stylesheets/message.css +++ b/app/assets/stylesheets/message.css @@ -1,3 +1,5 @@ +/*message*/ + .error{ color:red; } diff --git a/app/assets/stylesheets/new_admin.css.erb b/app/assets/stylesheets/new_admin.css.erb index d336a2deb..995421010 100644 --- a/app/assets/stylesheets/new_admin.css.erb +++ b/app/assets/stylesheets/new_admin.css.erb @@ -6,10 +6,10 @@ *= require_self *= require message *= require bootstrap + *= require style *= require bootstrap-orbit *= require list - *= require style - *= widget + *= require widgets *= require scroll_style *= require isotope -*/ +*/ diff --git a/app/assets/stylesheets/reset.css.erb b/app/assets/stylesheets/reset.css.erb index 5c0a9cd57..f0a027a30 100644 --- a/app/assets/stylesheets/reset.css.erb +++ b/app/assets/stylesheets/reset.css.erb @@ -1,3 +1,6 @@ +/*reset*/ + + html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { -webkit-text-size-adjust:none; } diff --git a/app/assets/stylesheets/scroll_style.css b/app/assets/stylesheets/scroll_style.css index 2f79f62bf..849fbc13e 100644 --- a/app/assets/stylesheets/scroll_style.css +++ b/app/assets/stylesheets/scroll_style.css @@ -1,3 +1,5 @@ +/*scroll_style*/ + @charset "UTF-8"; /* CSS Document */ .my_scroll { diff --git a/app/assets/stylesheets/sidebar.css.erb b/app/assets/stylesheets/sidebar.css.erb index 79022cacc..4231d0bf0 100644 --- a/app/assets/stylesheets/sidebar.css.erb +++ b/app/assets/stylesheets/sidebar.css.erb @@ -1,11 +1,23 @@ +/*sidebar*/ -#back_sidebar { - left: 0; - position: fixed; - top: 0; - width: 160px; +.nav-list { + padding: 0px 0px 100px 5px; } - +.nav-list li { + position: relative; +} +.nav-list ul { + margin-left: 10px; +} +.nav-list ul li { + padding: 5px 0; +} +.nav-list ul li a { + font-size: 13px; + padding: 3px 0px; + display: block; +} +/* #back_sidebar h1 { background: url(<%= asset_path "h1_bg.png" %>) repeat-x scroll left top transparent; border-bottom: 1px solid #1B1B1B; @@ -105,36 +117,35 @@ } #main-sidebar ul ul li a{ padding: 10px 0 10px 20px; +}*/ +.with_action:hover .hide { + display: block; } -#main-sidebar li:hover .quick-edit{ - display:block; -} -#main-sidebar .quick-edit{ +#main-sidebar .quick-edit { background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #DDDDDD; border-radius: 5px 5px 5px 5px; - display: none; - margin:-3px 0 0 3px; - padding: 3px; + margin: 0 0 0 3px; + padding: 0; z-index:1; + position: absolute; + left: -3px; + width: 70px; } -#main-sidebar .quick-edit:after{ - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} -#main-sidebar .quick-edit a{ +#main-sidebar .quick-edit a { + display: block; + line-height: 22px; border-bottom: medium none; - border-radius: 5px 5px 5px 5px; font-size:12px; - float: left; - margin: 0 3px 0 0; - padding: 3px; + margin: 0; + padding: 3px 5px; } - -#main-sidebar .quick-edit a:hover{ - background: none repeat scroll 0 0 #EEEEEE; - border-bottom:none; +#main-sidebar .quick-edit a:first-child { + border-radius: 5px 5px 0px 0px; +} +#main-sidebar .quick-edit a:last-child { + border-radius: 0px 0px 5px 5px; +} +#main-sidebar .quick-edit a:hover { + background-color: #DDDDDD; } \ No newline at end of file diff --git a/app/assets/stylesheets/site_assets.css.erb b/app/assets/stylesheets/site_assets.css.erb index cd5e882d5..41c14933b 100644 --- a/app/assets/stylesheets/site_assets.css.erb +++ b/app/assets/stylesheets/site_assets.css.erb @@ -1,3 +1,5 @@ +/*site_assets*/ + .assets_setup{ padding:42px 0 0 0; } \ No newline at end of file diff --git a/app/assets/stylesheets/site_designs.css.erb b/app/assets/stylesheets/site_designs.css.erb index cf8442d0c..805468cc4 100644 --- a/app/assets/stylesheets/site_designs.css.erb +++ b/app/assets/stylesheets/site_designs.css.erb @@ -1,3 +1,5 @@ +/*site_designs*/ + .designs_setup{ padding:42px 0 0 0; } diff --git a/app/assets/stylesheets/site_editor.css.erb b/app/assets/stylesheets/site_editor.css.erb index 1e16ea3f4..e36d0b7bb 100644 --- a/app/assets/stylesheets/site_editor.css.erb +++ b/app/assets/stylesheets/site_editor.css.erb @@ -5,6 +5,10 @@ *= require reset *= require_self *= require message + *= require bootstrap + *= require style + *= require bootstrap-orbit + *= require scroll_style *= require site_items *= require sidebar */ \ No newline at end of file diff --git a/app/assets/stylesheets/site_items.css.erb b/app/assets/stylesheets/site_items.css.erb index 922bfe563..6fcef6bdf 100644 --- a/app/assets/stylesheets/site_items.css.erb +++ b/app/assets/stylesheets/site_items.css.erb @@ -1,3 +1,5 @@ +/*site_items*/ + html, body{ height: 100%; margin: 0; diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index 39beaec94..b4410a47f 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -1,3 +1,5 @@ +/*style*/ + @font-face{ font-family: 'WebSymbolsRegular'; src: url(<%= asset_path 'websymbols-regular-webfont.eot' %>); @@ -8,7 +10,7 @@ } .login-logo { text-indent: -9999px; - background: url(<%= asset_path 'sign-in-logo.png' %>) no-repeat center 40px; + background: url(<%= asset_path 'sign-in-logo.png' %>) no-repeat center 80px; padding-top: 40px; height: 160px; } @@ -59,8 +61,8 @@ margin-right: -20px; } #orbit-bar .search-query { - padding: 4px 9px; - height: 12px; + padding: 7px 9px 5px; + height: 10px; margin-top: 3px; border: 1px solid #333333; font-size: 11px; @@ -108,6 +110,7 @@ padding:6px; } #orbit-bar .nav > li.search { + background-image: none; overflow: hidden; width: 28px; position: relative; @@ -116,7 +119,8 @@ background-position: -10px -10px; } #orbit-bar .nav > li > a.orbit-bar-desktop { - background-position: -106px -9px; + background-position: -73px -42px; + width: 48px; } #orbit-bar .nav > li > a.orbit-bar-member { background-position: -4px -37px; @@ -240,7 +244,7 @@ padding-right: 4px; border-right: 1px solid rgba(0,0,0,.2); position:fixed; - top: 32px; + top: 31px; z-index: 88; } #main-sidebar .nav { @@ -283,17 +287,18 @@ background-color: #FFF; margin-left:160px; padding-top: 32px; - padding-bottom: 18px; + /*padding-bottom: 18px;*/ position: relative; - min-height: 100%; + padding-bottom: 45px; + /*min-height: 100%;*/ } -#main-wrap > .form-actions { +/*#main-wrap > .form-actions { background-color: #FFF; text-align: center; padding: 17px 20px 0; margin: 0; border-top: none; -} +}*/ #main-wrap .subnav { height: auto; min-height: 36px; @@ -321,6 +326,9 @@ font-size: 12px; color: #999; } +.form-actions .btn { + margin-bottom: 0; +} #sub-wiget { clear: right; float: right; @@ -339,7 +347,7 @@ text-align: right; padding-left: 10px; padding-right: 10px; - margin-bottom: 0; + margin-bottom: -50px; clear: both; } #poststuff form { @@ -371,7 +379,7 @@ #post-body .editor { } #post-body-content { - margin-right: 320px; + /*margin-right: 320px;*/ padding: 8px 0 8px 6px; } .filter .accordion-heading > a:hover { @@ -563,7 +571,9 @@ padding: 5px; } .popover-content { - border-radius: 3px; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; padding: 5px; } .popover-title { @@ -605,6 +615,43 @@ .text-green { color: #39b54a !important; } +.adbanner-setup { + margin-right: 10px; + margin-bottom: 30px !important; +} +.adbanner-list { + border-top: 1px solid #AAA; + margin-right: 10px; + padding-top: 10px; + position: relative; +} +.adbanner-list ul { + margin: 0px; +} +.adbanner-list ul li { + list-style: none; + margin-left: 0; + margin-right: 20px; +} +.adbanner-action { + margin-bottom: 20px; +} +.textarea-height-s { + resize: none; + max-height: 150px; +} +.textarea-height-m { + resize: none; + max-height: 250px; +} +.textarea-height-l { + resize: none; + max-height: 350px; +} +.textarea-height-xl { + resize: none; + max-height: 500px; +} [class^="icons-"] { display: inline-block; width: 16px; @@ -893,5 +940,5 @@ } /*21*/ .icons- { - background-position: -0px -640px; -} \ No newline at end of file + background-position: -0px -640px +} diff --git a/app/assets/stylesheets/widget.css b/app/assets/stylesheets/widget.css deleted file mode 100644 index 2a9f430dd..000000000 --- a/app/assets/stylesheets/widget.css +++ /dev/null @@ -1,148 +0,0 @@ -.widget-size-300 { - width:298px; -} -.widget-box { - background-color: #FFF; - overflow: hidden; - min-width: 300px; - margin: 0 0 5px 5px; - position:relative; -} -.widget-box .widget-title { - color: #FFF; - padding-left: 5px; - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px 5px 0 0; - background-image: -moz-linear-gradient(top, #B7B7B7, #9d9d9d); - background-image: -ms-linear-gradient(top, #B7B7B7, #9d9d9d); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#B7B7B7), to(#9d9d9d)); - background-image: -webkit-linear-gradient(top, #B7B7B7, #9d9d9d); - background-image: -o-linear-gradient(top, #B7B7B7, #9d9d9d); - background-image: linear-gradient(top, #B7B7B7, #9d9d9d); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#B7B7B7', endColorstr='#9d9d9d', GradientType=0); -} -.widget-box .widget-title [class^="icons-"] { - margin: 3px 5px 0 2px; -} -.widget-box .widget-content { - padding: 10px; - border-width: 0 1px 1px; - border-style: solid; - border-color: #CCCCCC; - border-radius: 0 0 5px 5px; - -moz-border-radius: 0 0 5px 5px; - -webkit-border-radius: 0 0 5px 5px; -} -.widget-box .form-horizontal .control-group > label { - width: 50px; -} -.widget-box .form-horizontal .controls { - margin-left: 60px; -} -.widget-action { - position:absolute; - right:1px; - top:6px; -} -.action { - float: left; - display:inline-block; - margin-right: 5px; - opacity: 0.8; - filter: alpha(opacity=80); -} -.action:hover { - opacity: 1; - filter: alpha(opacity=100); - cursor: pointer; -} -.select-role { - display:none; - padding: 10px 0; -} -.file-upload { - position:relative; - overflow: hidden; -} -.file-upload .file-name { - white-space: nowrap; - overflow: hidden; - border-style: solid; - border-width: 1px 1px 1px 0; - border-color: #CCC; - display: inline-block; - float: left; - padding: 4px 10px; - height: 18px; - line-height: 18px; - -webkit-border-radius: 0 3px 3px 0; - -moz-border-radius: 0 3px 3px 0; - border-radius: 0 3px 3px 0; - text-align: left; - margin: 0; - width: 182px; -} -.file-upload .upload { - margin:0; - padding:0; - position:absolute; - top: 0; - left:0; - opacity:.0; - font-size: 60px; - left: -595px/9; - filter: alpha(opacity: 0); - outline: none; -} -.file-upload .upload:focus { - position:absolute; -} -.upload-picture { - margin-bottom: 5px; - text-align: center; - width: 276px; - overflow: hidden; - height: 90px; -} -.upload-picture img { - left: 0; - margin-top: -15%; - width: 100%; -} -.widget-box .widgetInfo { - display: inline-block; - text-align: center; - width: 255px; - margin : 0px 0 5px; - padding: 5px 10px; -} -.file-upload .input-medium { - border-radius: 3px 3px 3px 3px !important; - width: 267px; - position: relative; - z-index: 5; -} -#widget-link table { - margin-bottom:0 -} -/*Date*/ -.showDate { - border-style: solid; - border-width: 1px 0 1px 1px; - border-color: #CCC; - display: inline-block; - float: left; - padding: 4px 10px; - height: 18px; - line-height: 18px; - -webkit-border-radius: 3px 0 0 3px; - -moz-border-radius: 3px 0 0 3px; - border-radius: 3px 0 0 3px; - text-align: center; -} -.calendarInput { - position: absolute; - visibility: hidden; - left: 11px; -} diff --git a/app/assets/stylesheets/widgets.css b/app/assets/stylesheets/widgets.css index 175a303a6..eb66b33be 100644 --- a/app/assets/stylesheets/widgets.css +++ b/app/assets/stylesheets/widgets.css @@ -1,3 +1,6 @@ +/*Widget*/ + + .widget-size-300 { width:298px; } @@ -81,7 +84,7 @@ border-radius: 0 3px 3px 0; text-align: left; margin: 0; - width: 182px; + width: 193px; } .file-upload .upload { margin:0; @@ -92,12 +95,24 @@ opacity:.0; font-size: 60px; left: -595px/9; - filter: alpha(opacity: 0); + filter: alpha(opacity= 0); outline: none; } .file-upload .upload:focus { position:absolute; } +.file-upload .input-medium { + border-radius: 3px 3px 3px 3px !important; + width: 267px; + position: relative; + z-index: 5; + display: block; + clear: both; +} +.file-upload .control-label { + margin-top: 0; + margin-bottom: 5px; +} .upload-picture { margin-bottom: 5px; text-align: center; @@ -117,12 +132,6 @@ margin : 0px 0 5px; padding: 5px 10px; } -.file-upload .input-medium { - border-radius: 3px 3px 3px 3px !important; - width: 267px; - position: relative; - z-index: 5; -} #widget-link table { margin-bottom:0 } diff --git a/app/controllers/admin/ad_banners_controller.rb b/app/controllers/admin/ad_banners_controller.rb index 95ce7e7c3..47d3d3555 100644 --- a/app/controllers/admin/ad_banners_controller.rb +++ b/app/controllers/admin/ad_banners_controller.rb @@ -1,7 +1,7 @@ -class Admin::AdBannersController < ApplicationController +class Admin::AdBannersController < OrbitBackendController layout "new_admin" before_filter :authenticate_user! - before_filter :is_admin? + before_filter :for_app_manager def destroy @ad_banner = AdBanner.find(params[:id]) @@ -22,9 +22,14 @@ class Admin::AdBannersController < ApplicationController def create @ad_banner = AdBanner.new(params[:ad_banner]) - @ad_banner.save - redirect_to admin_ad_banners_url - + if @ad_banner.save + @active = @ad_banner + respond_to do |format| + format.js {render 'new_created_node'} + end + else + render 'create_error_msg' + end end def edit @@ -39,13 +44,14 @@ class Admin::AdBannersController < ApplicationController redirect_to admin_ad_banners_url end - def destroy_ad_image - + def realtime_preview + @ad_banner = AdBanner.find( params[:id] ).preview_clone + @ad_banner.update_attributes(params[:ad_banner])#.update_attributes(params[:ad_images]) end def index @ad_banners = AdBanner.all - @active = @ad_banners.first + @active = @ad_banners.first end end \ No newline at end of file diff --git a/app/controllers/admin/ad_images_controller.rb b/app/controllers/admin/ad_images_controller.rb index 3fb681dab..d2039ab58 100644 --- a/app/controllers/admin/ad_images_controller.rb +++ b/app/controllers/admin/ad_images_controller.rb @@ -19,6 +19,8 @@ class Admin::AdImagesController < ApplicationController def new @ad_image =AdImage.new + @ad_image.post_date = Date.today + @ad_image.unpost_date = Date.today + 30 #render :action => 'new',:url=> {:ad_banner_id => params.has_key?(:ad_banner_id)? params[:ad_banner_id],nil} end diff --git a/app/controllers/admin/dashboards_controller.rb b/app/controllers/admin/dashboards_controller.rb index 7b7613611..b7f377d3b 100644 --- a/app/controllers/admin/dashboards_controller.rb +++ b/app/controllers/admin/dashboards_controller.rb @@ -2,7 +2,7 @@ class Admin::DashboardsController < ApplicationController layout "new_admin" before_filter :authenticate_user! - before_filter :is_admin? +# before_filter :is_admin? def index end diff --git a/app/controllers/admin/designs_controller.rb b/app/controllers/admin/designs_controller.rb index 519b36a59..84f2b770a 100644 --- a/app/controllers/admin/designs_controller.rb +++ b/app/controllers/admin/designs_controller.rb @@ -1,11 +1,12 @@ -class Admin::DesignsController < ApplicationController +class Admin::DesignsController < OrbitBackendController require "net/http" require "uri" require 'zip/zip' layout "new_admin" before_filter :authenticate_user! - before_filter :is_admin? + before_filter :is_admin? + before_filter :for_admin_only def upload_package if !params[:design].nil? @@ -24,7 +25,7 @@ class Admin::DesignsController < ApplicationController end def index - @designs = Design.all.entries + @designs = params[:sort] ? get_sorted_and_filtered("designs") : Design.all end def new @@ -83,6 +84,13 @@ class Admin::DesignsController < ApplicationController render :action => 'new' end end + + def delete + if params[:to_delete] + designs = Design.any_in(:_id => params[:to_delete]).delete_all + end + redirect_to admin_designs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) + end protected diff --git a/app/controllers/admin/module_apps_controller.rb b/app/controllers/admin/module_apps_controller.rb index e93fb521a..4f373f141 100644 --- a/app/controllers/admin/module_apps_controller.rb +++ b/app/controllers/admin/module_apps_controller.rb @@ -2,7 +2,7 @@ class Admin::ModuleAppsController < ApplicationController before_filter :user_has_manager_privilege?, :only => [ :assign_manager, :remove_manager ] before_filter :user_has_sub_manager_privilege?, :only => [ :assign_sub_manager, :remove_sub_manager ] - layout "admin" + layout "new_admin" def index @module_apps = ModuleApp.all.entries diff --git a/app/controllers/admin/object_auths_controller.rb b/app/controllers/admin/object_auths_controller.rb index e8779dc4c..ab343360d 100644 --- a/app/controllers/admin/object_auths_controller.rb +++ b/app/controllers/admin/object_auths_controller.rb @@ -1,6 +1,6 @@ class Admin::ObjectAuthsController < ApplicationController include OrbitCoreLib::PermissionUnility - layout "admin" + layout "new_admin" before_filter :force_order # before_filter :is_admin? ,:only => :index diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index 1fb6752a4..86bc674e3 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -25,10 +25,12 @@ class Admin::PagePartsController < ApplicationController @module_apps = ModuleApp.all(:conditions => {:enable_frontend => true}) @module_app = @part.module_app ? @part.module_app : @module_apps[0] @r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag - @tag_objects = @r_tag.classify.constantize.all + @tag_objects = @r_tag.classify.constantize.all rescue nil case @module_app.key - when 'bulletin' + when 'announcement' @categories = BulletinCategory.all + when 'news' + @categories = NewsBulletinCategory.all when 'web_resource' @categories = WebLinkCategory.all end @@ -65,17 +67,27 @@ class Admin::PagePartsController < ApplicationController def reload_widgets @categories =[] @module_app = ModuleApp.find(params[:id]) - - unless (@module_app.category.nil? rescue true) - @module_app.category.each do |category| - @categories << eval(category).all.entries - end - @categories.flatten! + + case @module_app.key + when 'announcement' + @categories = BulletinCategory.all + when 'news' + @categories = NewsBulletinCategory.all + when 'web_resource' + @categories = WebLinkCategory.all end respond_to do |format| format.js {} end end + + def reload_r_tag_options + @r_tag = (ModuleApp.find(params[:id]) rescue nil) || params[:id] + @tag_objects = @r_tag.classify.constantize.all rescue nil + respond_to do |format| + format.js {} + end + end end diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index 411297ce9..657543191 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -31,7 +31,18 @@ class Admin::PagesController < ApplicationController @designs = Design.all.entries @design = @item.design ? @item.design : @designs.first @app_frontend_urls = @item.module_app.app_pages if @item.module_app - @categories = BulletinCategory.all if @item.module_app && @item.module_app.key.eql?('announcement') + if @item.module_app + case @item.module_app.key + when 'announcement' + @categories = BulletinCategory.all + when 'news' + @categories = NewsBulletinCategory.all + when 'web_resource' + @categories = WebLinkCategory.all + end + else + @categories = nil + end end def create diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index 9475e7084..1a19aebd9 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -1,16 +1,48 @@ class Admin::SitesController < ApplicationController - layout "admin" + layout "new_admin" before_filter :authenticate_user! before_filter :is_admin? + before_filter :get_site - def index - @site = Site.first - redirect_to :action => :new unless @site + # def index + # @site = Site.first + # # redirect_to :action => :new unless @site + # end + + # def new + # @site = Site.new + # end + + def update + @site.update_attributes(params[:site]) + redirect_to :back end - - def new - @site = Site.new + + def site_info + + end + + def system_info + + end + + def language + + end + + def mail_setting + + end + + def ui_theme + + end + + private + + def get_site + @site ||= Site.first end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fb82774ef..494b497ea 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -39,15 +39,65 @@ class ApplicationController < ActionController::Base @parent_item = Item.first(:conditions => { :id => BSON::ObjectId(params[:parent_id]) }) rescue nil end + def auth_failed_in_backend + #redirect_to admin_dashboards_url + redirect_to root_path + end + # Check if the current_user is admin def is_admin? - redirect_to root_url unless current_user.admin? + current_user.admin? ? true : auth_failed_in_backend + end + + def is_manager? + @module_app.managing_users.include?(current_user) || is_admin? + end + + def for_admin_only + if is_admin? + true + else + flash[:error] = t("admin.access.denied.not_admin") + auth_failed_in_backend + end + end + + def for_app_manager + if is_manager? + true + else + flash[:error] = t("admin.access.denied.app.not_manager") + auth_failed_in_backend + end + end + + def for_app_sub_manager + if (@module_app.sub_managing_users.include?(current_user) || is_manager?) + true + else + flash[:error] = t("admin.access.denied.app.not_sub_manager") + auth_failed_in_backend + end + end + + def for_app_user + if (@module_app.app_auth.auth_users.include?(current_user) || for_app_sub_manager ) + true + else + flash[:error] = t("admin.access.denied.app.not_authed_user") + auth_failed_in_backend + end + end + + def check_object_premission(obj,title) + flash[:error] = t("admin.access.denied.object") + auth_failed_in_backend unless (obj.get_object_auth_by_title(title).auth_users.include?(current_user) || is_manager? || is_admin? ) end # Render the page - def render_page(id = nil) + def render_page(param={}) if @item - render :text => process_page(@item, id), :layout => 'page_layout' + render :text => process_page(@item, param[:id], param), :layout => 'page_layout' else render :text => '404 Not Found' end @@ -78,8 +128,8 @@ class ApplicationController < ActionController::Base # set site if exist or create site @site = Site.first || Site.create({:valid_locales => [], :in_use_locales => []}) session[:site] = @site.id - @site_in_use_locales = @site.in_use_locales - @site_valid_locales = @site.valid_locales + @site_in_use_locales = site_locales_default_head(@site.in_use_locales) + @site_valid_locales = site_locales_default_head(@site.valid_locales) end def set_current_item @@ -114,4 +164,14 @@ class ApplicationController < ActionController::Base end end + def site_locales_default_head(locales) + if locales[0].eql? I18n.locale.to_s + locales + else + a = Array.new(locales) + shift_out = a.delete(I18n.locale.to_s) + [shift_out] + a + end + end + end diff --git a/app/controllers/orbit_backend_controller.rb b/app/controllers/orbit_backend_controller.rb index fe37db82f..a03a1f6c0 100644 --- a/app/controllers/orbit_backend_controller.rb +++ b/app/controllers/orbit_backend_controller.rb @@ -12,7 +12,7 @@ class OrbitBackendController< ApplicationController @app_title = request.fullpath.split('/')[2] @module_app = ModuleApp.first(conditions: {:key => @app_title} ) end - + private def force_order @@ -22,8 +22,136 @@ class OrbitBackendController< ApplicationController def check_user_can_use unless check_permission - redirect_to polymorphic_path(['panel',@app_title,'back_end','public']) + #redirect_to polymorphic_path(['panel',@app_title,'back_end','public']) + render :text => '403 Forbidden' end end + + def get_sorted_and_filtered(object_class, query=nil) + object_class = object_class.classify.constantize + if query + objects = object_class.all.where(query) + else + objects = object_class.all + end + + if !params[:sort].blank? + options = params[:sort_options] + options = [options] if !options.class.eql?(Array) + options.each do |option| + if object_class.fields.include?(option) + case object_class.fields[option].type.to_s + when 'BigDecimal', 'Boolean', 'Date', 'DateTime', 'Float', 'Integer', 'String', 'Symbol', 'Time' + (objects = objects.order_by(option, params[:direction])) rescue nil + when 'Object' + objects = get_objects_from_referenced_objects(object_class.fields[option].options[:class_name].constantize, objects, option) + end + elsif object_class.relations.include?(option) + case object_class.relations[option].macro + when :references_one + a = Array.new + objects.each { |object| a << [get_string_value_from_object(object), object] } + sorted = params[:direction].eql?('asc') ? a.sort : a.sort.reverse! + objects = sorted.collect {|x| x[1] } + when :references_many, :references_and_referenced_in_many + objects = get_objects_from_self(object_class, objects, option) + when :referenced_in + objects = get_objects_from_referenced_objects(object_class.relations[option].class_name.constantize, objects, "#{option}_id") + end + end + end + end + if @filter + @filter.each do |key, value| + case key + when 'status' + a = Array.new + objects.each do |object| + value.each do |v| + a << object if object[v] + end + end + objects = a.uniq + when 'categories' + a = Array.new + objects.each do |object| + a << object if value.include?(object.send("#{object.class.to_s.underscore}_category").id.to_s) + end + objects = a.uniq + when 'tags' + a = Array.new + objects.each do |object| + object.tags.each do |tag| + a << object if value.include?(tag.id.to_s) + end + end + objects = a.uniq + end if value.size > 0 + end + end + Kaminari.paginate_array(objects).page(params[:page]).per(10) + end + + def get_string_value_from_object(object) + s = object[I18n.locale] rescue nil + s = object.i18n_variable unless s rescue nil + s = object.name unless s rescue nil + s = object.title unless s rescue nil + if s + case s.class.to_s + when "String" + s.downcase + when "I18nVariable" + s[I18n.locale].downcase + else + nil + end + end + end + + def get_objects_from_referenced_objects(object_class, objects, option) + referer_ids = objects.distinct(option) + referenced_objects = object_class.find(referer_ids) rescue nil + if referenced_objects + a = Array.new + referenced_objects.each { |referer| a << [get_string_value_from_object(referer), referer.id] } + sorted = params[:direction].eql?('asc') ? a.sort : a.sort.reverse! + sorted_objects = sorted.collect {|x| objects.where(option => x[1]).entries } + sorted_objects.flatten! + sorted_objects.uniq! + get_with_nil(objects, option, sorted_objects) + else + objects + end + end + + def get_objects_from_self(object_class, objects, option) + referenced_class = object_class.relations[option].class_name.constantize + referenced_objects = referenced_class.all rescue nil + if referenced_objects + reverse_relation = nil + referenced_class.relations.each { |relation| reverse_relation = relation[1].name.to_s if relation[1].class_name.eql?(object_class.to_s) } + a = Array.new + referenced_objects.each { |referenced_object| a << [get_string_value_from_object(referenced_object), referenced_object] } + a.compact! + sorted = params[:direction].eql?('asc') ? a.sort : a.sort.reverse! + sorted_objects = Array.new + sorted.each {|x| sorted_objects << x[1].send(reverse_relation) } + sorted_objects.flatten! + sorted_objects.uniq! + get_with_nil(objects, option, sorted_objects) + else + objects + end + end + + def get_with_nil(objects, option, sorted_objects) + tmp = Array.new + objects.each { |object| tmp << [get_string_value_from_object(object), object] if (object.send(option).blank? || (object.send(option).size == 0 rescue nil)) } + sorted = params[:direction].eql?('asc') ? tmp.sort : tmp.sort.reverse! + sorted_tmp = sorted.collect {|a| a[1] } + a = params[:direction].eql?('asc') ? (sorted_tmp + sorted_objects) : (sorted_objects + sorted_tmp) + a.flatten + end end \ No newline at end of file diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 4860ea2e8..c4e00aa25 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -16,10 +16,10 @@ class PagesController < ApplicationController def show #begin @item = Item.first(:conditions => {:full_name => params[:page_name]}) - if @item && @item.is_published + if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s)) case @item._type when 'Page' - render_page(params[:id]) + render_page(params) when 'Link' redirect_to "http://#{@item[:url]}" end @@ -33,14 +33,16 @@ class PagesController < ApplicationController def index_from_link if params[:page] - redirect_to "/#{@item.full_name}?page=#{params[:page]}" + redirect_to "/#{@item.full_name}?page=#{params[:page]}&category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}" else - redirect_to "/#{@item.full_name}" + redirect_to "/#{@item.full_name}?category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}" end end def show_from_link - redirect_to "/#{@item.full_name}?id=#{params[:id]}" + # debugger + # a=1 + redirect_to "/#{@item.full_name}?id=#{params[:id]}&preview=#{params[:preview]}" end def load_orbit_bar @@ -51,11 +53,11 @@ class PagesController < ApplicationController def get_item module_app = ModuleApp.first(:conditions => {:key => params[:app_name]}) - if params[:category_id] - @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id]}) - else + # if params[:category_id] + # @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id]}) + # else @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]}) - end + # end end end diff --git a/app/helpers/admin/ad_images_helper.rb b/app/helpers/admin/ad_images_helper.rb index 1f2422fc0..b09bd2633 100644 --- a/app/helpers/admin/ad_images_helper.rb +++ b/app/helpers/admin/ad_images_helper.rb @@ -1,7 +1,3 @@ module Admin::AdImagesHelper - def active_when_default_locale_eq locale - locale.to_sym == I18n.default_locale ? 'active': '' - end - end diff --git a/app/helpers/admin/item_helper.rb b/app/helpers/admin/item_helper.rb index c9715a717..8af4db341 100644 --- a/app/helpers/admin/item_helper.rb +++ b/app/helpers/admin/item_helper.rb @@ -9,29 +9,34 @@ module Admin::ItemHelper when 'Link' dest = admin_link_path(node) end - ret << "" unless node.parent.nil? end ret.html_safe end def render_children(parent) - if children = parent.children + children = parent.ordered_children + if !children.entries.blank? ret = '' children.each do |child| ret << render_node_and_children(child) end ret + else + '' end end diff --git a/app/helpers/admin/module_app_helper.rb b/app/helpers/admin/module_app_helper.rb index 0a636e9cd..3ac82364f 100644 --- a/app/helpers/admin/module_app_helper.rb +++ b/app/helpers/admin/module_app_helper.rb @@ -14,6 +14,7 @@ module Admin::ModuleAppHelper end def get_auth_by(manager_obj) - "-AuthBy: " +( manager_obj.rule_creator==current_user ? t('me') : manager_obj.rule_creator.name) + showing_name = manager_obj.rule_creator==current_user ? t('me') : manager_obj.rule_creator.name + t("admin.user_role.auth.auth_by",:user_display_name => showing_name) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e45fa4d67..e72b2b82f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,12 +2,6 @@ module ApplicationHelper FLASH_NOTICE_KEYS = [:error, :notice, :warning] - def site_valid_locales_default_head - index = @site_valid_locales.rindex I18n.default_locale.to_s - shift_out = @site_valid_locales.shift(index) - @site_valid_locales += shift_out - end - def colorize_in_use_locale(locale) @site_in_use_locales.include?(locale)? 'green' : 'red' end @@ -74,78 +68,90 @@ module ApplicationHelper end end + def active_sys_call_for_app(controller_name,action_name,app_title) + unless active_for_action(controller_name,action_name).nil? + app = ModuleApp.find params[:id] + app.title == app_title ? 'active' : nil + else + nil + end + end + def active_for_controllers(*controller_names) - controller_names.include?(controller.controller_name) ? 'active' : nil + (controller_names.include?(controller.controller_name) || controller_names.include?(request.fullpath)) ? 'active' : nil end def visible_for_controllers(*controller_names) - controller_names.include?(controller.controller_name) ? '' : 'hide' + puts controller_names + (controller_names.include?(controller.controller_name) || controller_names.include?(request.fullpath)) ? '' : 'hide' end def active_for_action(controller_name, action_name) ((controller.controller_name.eql?(controller_name) || request.fullpath.eql?(controller_name)) && controller.action_name.eql?(action_name)) ? 'active' : nil end - def sortable(column) - direction = (column == params[:sort] && params[:direction] == "asc") ? "desc" : "asc" - {:sort => column, :direction => direction} - end - - def is_sort_active?(name) - res = '' - res << ' select' if params[:sort].eql?(name) - res << ' active' if params[:sort].eql?(name) && params[:direction].eql?('asc') - res - end - - def is_sort?(name) - ' web-symbol' if params[:sort].eql?(name) - end - - def is_filter_active?(type, id) - ' active' if (@filter[type].include?(id.to_s) rescue nil) - end - - def process_page(page, id) - parse_page_noko(page, id) + def process_page(page, id, params) + parse_page_noko(page, id, params) end def page_metas(page) + tmp_meta = {} metas = '' - @site.page_metas.each do |meta| + @site.site_metas.each do |meta| name, content = meta.get_name_content - metas << "\n" + tmp_meta.merge!(name => content) end rescue nil - return metas + page.page_metas.each do |meta| + name, content = meta.get_name_content + tmp_meta.merge!(name => content) + end rescue nil + tmp_meta.each_pair{|name, content| + metas << "\n" + } if !tmp_meta.blank? + metas end def page_title(page) - "#{page.title ? page.title[I18n.locale] : page.i18n_variable[I18n.locale]}\n" + res = "" + page_title = page.title ? page.title[I18n.locale] : page.i18n_variable[I18n.locale] + if page.is_home? && @site.title + res << @site.title[I18n.locale] + elsif @site.title && @site.title_always_on + res << @site.title[I18n.locale] + ' - ' + page_title + else + res << page_title + end + res << "\n" end - def page_stylesheets(page) + def page_stylesheets(page, edit=nil) stylesheets = '' - stylesheets << "\n" - stylesheets << "\n" - stylesheets << "\n" + unless edit + stylesheets << "\n" + stylesheets << "\n" + stylesheets << "\n" + end stylesheets << "\n" if page.design.reset_css + # stylesheets << "\n" stylesheets << "\n" if page.design.default_css theme = page.design.themes.detect{ |d| d.id == page.theme_id } stylesheets << "\n" if theme stylesheets end - def page_javascripts(page) + def page_javascripts(page, edit=nil) javascripts = '' - javascripts << "\n" + unless edit + javascripts << "\n" + javascripts << "\n" + javascripts << "\n" + javascripts << "\n" + javascripts << "\n" + javascripts << "\n" + javascripts << "\n" + end javascripts << "\n" javascripts << "\n" - javascripts << "\n" - javascripts << "\n" - javascripts << "\n" - javascripts << "\n" - javascripts << "\n" - javascripts << "\n" javascripts << "\n" page.design.javascripts.each do |js| # javascripts << "" @@ -153,4 +159,8 @@ module ApplicationHelper javascripts end + def active_when_current_locale_eq(locale) + locale.to_sym == I18n.locale ? 'active in': '' + end + end diff --git a/app/helpers/orbit_backend_helper.rb b/app/helpers/orbit_backend_helper.rb new file mode 100644 index 000000000..5d47e414a --- /dev/null +++ b/app/helpers/orbit_backend_helper.rb @@ -0,0 +1,45 @@ +module OrbitBackendHelper + + def sortable(column) + direction = (column == params[:sort] && params[:direction] == "asc") ? "desc" : "asc" + {:sort => column, :direction => direction} + end + + def is_sort_active?(name) + res = '' + res << ' select' if params[:sort].eql?(name) + res << ' active' if params[:sort].eql?(name) && params[:direction].eql?('asc') + res + end + + def is_sort?(name) + ' web-symbol' if params[:sort].eql?(name) + end + + def is_filter_active?(type, id) + ' active' if (@filter[type].include?(id.to_s) rescue nil) + end + + def render_sort_bar(delete_all, *titles) + content_tag :table, :class => "table main-list" do + content_tag :thead do + content_tag :tr, :class => "sort-header" do + concat (content_tag :th, :class => "span1 strong" do + concat check_box_tag :check_all + concat link_to content_tag(:i, nil, :class => "icon-trash"), '#', :class => "list-remove" + end) if (delete_all && (is_admin? || (is_manager? rescue nil))) + titles.each do |title| + concat render_title(title[0], title[1], title[2], title[3]) + end + end + end + end + end + + def render_title(title, fields, span, translation) + content_tag :th, :class => "sort #{span} #{is_sort_active?(title)}" do + link_to (t(translation) + content_tag(:b, nil, :class => is_sort?(title))).html_safe, url_for({:filter => @filter}.merge(sortable(title).merge(:sort_options => fields))), :class => 'js_history' + end + end + +end \ No newline at end of file diff --git a/app/jobs/fetch_time.rb b/app/jobs/fetch_time.rb new file mode 100644 index 000000000..5fce3036c --- /dev/null +++ b/app/jobs/fetch_time.rb @@ -0,0 +1,15 @@ +# require 'open-uri' +# require 'nokogiri' +class FetchTime < Resque::Plugins::RestrictionJob + restrict :per_300 => 10 + + @queue = :low + + def self.perform() +# sleep 10 + doc = Nokogiri::HTML(open('http://www.timeanddate.com/worldclock/city.html?n=241')) + CronMail.time_check(doc.at('#ct').children.first.text).deliver + puts "Mail Sent" + true + end +end diff --git a/app/jobs/nccu_calendar.rb b/app/jobs/nccu_calendar.rb new file mode 100644 index 000000000..724804d4f --- /dev/null +++ b/app/jobs/nccu_calendar.rb @@ -0,0 +1,8 @@ +class NccuCalendar + @queue = :high + + def self.perform() +# sleep 10 + puts "NccuCalendar Sync" + end +end diff --git a/app/jobs/sync_db.rb b/app/jobs/sync_db.rb new file mode 100644 index 000000000..f6458204f --- /dev/null +++ b/app/jobs/sync_db.rb @@ -0,0 +1,9 @@ +class SyncDb + + @queue = :high + + def self.perform() +# sleep 10 + puts "DB Sync" + end +end diff --git a/app/mailer/cron_mail.rb b/app/mailer/cron_mail.rb new file mode 100644 index 000000000..8a4c97009 --- /dev/null +++ b/app/mailer/cron_mail.rb @@ -0,0 +1,8 @@ +class CronMail < ActionMailer::Base + default :from => "orbit_test@rulingcom.com" + + def time_check(msg) + #attachments["rails.png"] = File.read("#{Rails.root}/public/images/rails.png") + mail(:to => "Matt ", :subject => msg) + end +end \ No newline at end of file diff --git a/app/models/ad_banner.rb b/app/models/ad_banner.rb index 3e09280fa..39112960f 100644 --- a/app/models/ad_banner.rb +++ b/app/models/ad_banner.rb @@ -4,16 +4,29 @@ class AdBanner include Mongoid::MultiParameterAttributes field :title - field :transition_sec,type: Integer + field :transition_msec,type: Integer field :ad_fx #TODO Design should explain before_save :save_or_destroy validates_uniqueness_of :title + validates :title , :length => { :minimum => 2 } has_many :ad_images , dependent: :delete FX_TYPES = ["blindX","blindY","blindZ","cover","curtainX","curtainY","fade","fadeZoom","growX","growY","scrollUp","scrollDown","scrollLeft","scrollRight","scrollHorz","scrollVert","shuffle","slideX","slideY","toss","turnUp","turnDown","turnLeft","turnRight","uncover","wipe","zoom"] +attr_writer :transition_sec + def transition_sec + self.transition_msec/1000 rescue nil + end - + def transition_sec=(sec) + self.transition_msec = sec.to_i*1000 + end + + def preview_clone + preview_banner = self.clone + preview_banner.ad_images = self.ad_images + preview_banner + end # def new_ad_images(*attrs) # debugger # a=1 diff --git a/app/models/ad_image.rb b/app/models/ad_image.rb index 3eb635112..9d7fe55b7 100644 --- a/app/models/ad_image.rb +++ b/app/models/ad_image.rb @@ -24,16 +24,15 @@ class AdImage # validates_numericality_of :weight, greater_than_or_equal_to: 1,less_than_or_equal_to: 10 # validates_format_of :out_link, with: /(http:\/\/.*|)/ ,:message => 'Need a valid URL' - # validates_presence_of :post_date,:message => 'Need a valid post date' attr_reader :parse_post_date,:parse_unpost_date def parse_post_date=(att) - self.post_date = (Date.parse att rescue nil) + self.post_date = (Date.parse att.gsub(/\s+/, "") rescue nil) end def parse_unpost_date=(att) - self.unpost_date = (Date.parse att rescue nil) + self.unpost_date = (Date.parse att.gsub(/\s+/, "") rescue nil) end def display? diff --git a/app/models/design/design.rb b/app/models/design/design.rb index 2a25dd110..58f95bd48 100644 --- a/app/models/design/design.rb +++ b/app/models/design/design.rb @@ -3,10 +3,10 @@ class Design include Mongoid::Timestamps include ParserLayout - field :title - field :author - field :intro - field :version + field :title, :type => String + field :author, :type => String + field :intro, :type => String + field :version, :type => String has_many :pages diff --git a/app/models/item.rb b/app/models/item.rb index 44c6762d6..c8b7812c6 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -7,6 +7,8 @@ class Item field :full_name, :index => true field :position, :type => Integer field :is_published, :type => Boolean, :default => false, :index => true + field :enabled_for, :type => Array, :default => nil + field :menu_enabled_for, :type => Array, :default => nil validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/ validates :name, :exclusion => { :in => LIST[:forbidden_item_names] } @@ -35,6 +37,21 @@ class Item urls = ancestors.map{ |a| a.name } << self.name urls.join("/") end + + def ordered_children + self.children.asc(:position) + end + + def ordered_and_visible_children + objects = ordered_children + a = [] + if objects + objects.each do |object| + a << object if object.menu_enabled_for.nil? ? true : object.menu_enabled_for.include?(I18n.locale.to_s) + end + end + a + end protected diff --git a/app/models/meta.rb b/app/models/meta.rb deleted file mode 100644 index dbeac167f..000000000 --- a/app/models/meta.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Meta - - include Mongoid::Document - include Mongoid::Timestamps - - field :key - field :value, :default => nil - - has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy - - def get_name_content - [self.key, self.value ? self.value : self.i18n_variable[I18n.locale]] - end - -end diff --git a/app/models/meta/meta.rb b/app/models/meta/meta.rb index 411a4f0c5..cd713d83f 100644 --- a/app/models/meta/meta.rb +++ b/app/models/meta/meta.rb @@ -7,5 +7,13 @@ class Meta field :value, :default => nil has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy + + def get_name_content + [self.key, get_content] + end + + def get_content + self.value ? self.value : self.i18n_variable[I18n.locale] + end end diff --git a/app/models/page_part.rb b/app/models/page_part.rb index 9fe91e861..42f8b775a 100644 --- a/app/models/page_part.rb +++ b/app/models/page_part.rb @@ -7,7 +7,7 @@ class PagePart field :content field :kind field :public_r_tag - field :public_r_tag_object_id, :type => BSON::ObjectId, :default => nil + field :public_r_tag_object_id, :default => nil field :widget_path has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy diff --git a/app/models/site.rb b/app/models/site.rb index 8f367c0a2..a3e0513d3 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -1,5 +1,7 @@ class Site + METAS = ['description', 'keywords'] + include Mongoid::Document include Mongoid::Timestamps @@ -9,12 +11,17 @@ class Site field :roaming_id field :private_key, :type => Binary field :public_key, :type => Binary + field :title_always_on, :type => Boolean, :default => false field :school field :department + has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy + has_one :footer, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy has_many :site_metas, :autosave => true, :dependent => :destroy + before_save :set_key + def generate_keys private_key = OpenSSL::PKey::RSA.generate(2048) self.public_key = private_key.public_key.to_s @@ -30,5 +37,35 @@ class Site res = res.split('rails_3_1').pop.gsub('(', '').gsub(')','').strip rescue nil res.eql?('local out of date') ? false : true end + + def title + @title ||= I18nVariable.first(:conditions => {:key => 'title', :language_value_id => self.id, :language_value_type => self.class}) rescue nil + end + + def footer + @footer ||= I18nVariable.first(:conditions => {:key => 'footer', :language_value_id => self.id, :language_value_type => self.class}) rescue nil + end + + METAS.each do |meta| + define_method meta do + fetch_meta = self.site_metas.where(key: meta).limit(1) + fetch_meta.blank? ? nil : fetch_meta[0].i18n_variable + end + define_method "#{meta}=" do |values| + if a = self.send(meta) + a.update_attributes(values) + else + a = self.site_metas.build(key: meta) + a.build_i18n_variable(values) + end + end + end + + protected + + def set_key + title.key = 'title' if title && (title.key.blank? rescue true) + footer.key = 'footer' if footer && (footer.key.blank? rescue true) + end end diff --git a/app/views/admin/ad_banners/_ad_banner_tab.html.erb b/app/views/admin/ad_banners/_ad_banner_tab.html.erb index d9b1b9025..797624ff1 100644 --- a/app/views/admin/ad_banners/_ad_banner_tab.html.erb +++ b/app/views/admin/ad_banners/_ad_banner_tab.html.erb @@ -1,19 +1,27 @@ - -
" id=<%= ad_banner_tab.title %>> -

尺寸:

+
" id=<%= ad_banner_tab.title.dehumanize %>> <%= form_for ad_banner_tab,:url=> admin_ad_banner_path(ad_banner_tab),:method => :put,:class=>"input-medium" do |f| -%> - <%= f.label :ad_fx, t('admin.ad.ab_fx') %> - <%= f.select :ad_fx ,AdBanner::FX_TYPES %> - <%= f.label :transition_sec, t('admin.ad.transition_sec') %> - <%= f.text_field :transition_sec,:placeholder=>"3秒請輸入3000",:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %> - <%= f.submit %> - <%= f.submit 'Cancel',:type=>'reset' %> -
- <%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %> - <%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %> - <%= link_to 'Add AdImage',new_admin_ad_banner_ad_image_path(ad_banner_tab) %> -
+
+ + <%= f.label :ad_fx, t('admin.ad.ab_fx') %> + <%= f.select :ad_fx ,AdBanner::FX_TYPES %> + <%= f.label :transition_sec, t('admin.ad.transition_sec') %> + <%= f.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %> +
+ <%= f.submit t("admin.ad.update_banner"), :class => 'btn' %> + <%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %> +
+

圖片列表

+
+
+ <%= link_to t("admin.ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%> + <%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.id) , :class=>'preview_trigger btn btn-success'%> +
+
    + <%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %> +
+ <%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %> +
<% end -%> - <%= render :partial => 'preview_block',:locals=> {:ad_banner =>ad_banner_tab} %> + <%#= render :partial => 'preview_block',:locals=> {:ad_banner =>ad_banner_tab} %>
diff --git a/app/views/admin/ad_banners/_ad_image_update.html.erb b/app/views/admin/ad_banners/_ad_image_update.html.erb index 34723b7eb..c055a8c96 100644 --- a/app/views/admin/ad_banners/_ad_image_update.html.erb +++ b/app/views/admin/ad_banners/_ad_image_update.html.erb @@ -1,12 +1,11 @@
  • <%= image_tag ad_image.file rescue nil%>

    - <%= ad_image.display? ? '[Showing]' : '[NotShawing]' %> + <%= ad_image.display? ? "[#{t('admin.ad.showing')}]" : "[#{t('admin.ad.not_showing')}]" %> <%= "#{ad_image.post_date ||'NeedReset' }~#{ad_image.unpost_date || 'NeedReset'}" %>

    - <%= link_to 'Edit',edit_admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn btn-primary' %> - <%= link_to 'Del',admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn',:method => :delete,:confirm => t('sure?') %> + <%= link_to t('edit'),edit_admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn btn-primary' %> + <%= link_to t('delete'),admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn',:method => :delete,:confirm => t('sure?') %>

    -
  • - + \ No newline at end of file diff --git a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb index 8e8de1d9a..4a3f2db44 100644 --- a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb +++ b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb @@ -1,10 +1,10 @@ - + <% end %>
    - diff --git a/app/views/admin/ad_banners/_modal_preview.html.erb b/app/views/admin/ad_banners/_modal_preview.html.erb new file mode 100644 index 000000000..ffc841074 --- /dev/null +++ b/app/views/admin/ad_banners/_modal_preview.html.erb @@ -0,0 +1,36 @@ +<% if ad_banner -%> + + + + + +<% end -%> diff --git a/app/views/admin/ad_banners/_preview_block.html.erb b/app/views/admin/ad_banners/_preview_block.html.erb index c2185d049..47646f6f1 100644 --- a/app/views/admin/ad_banners/_preview_block.html.erb +++ b/app/views/admin/ad_banners/_preview_block.html.erb @@ -9,7 +9,7 @@ @@ -23,7 +23,7 @@ diff --git a/app/views/admin/ad_banners/create_error_msg.js.erb b/app/views/admin/ad_banners/create_error_msg.js.erb new file mode 100644 index 000000000..60f1d261e --- /dev/null +++ b/app/views/admin/ad_banners/create_error_msg.js.erb @@ -0,0 +1 @@ +alert("Error occures:<%= @ad_banner.errors.full_messages%>"); \ No newline at end of file diff --git a/app/views/admin/ad_banners/index.html.erb b/app/views/admin/ad_banners/index.html.erb index e6ebfd5d9..47a9ec4d3 100644 --- a/app/views/admin/ad_banners/index.html.erb +++ b/app/views/admin/ad_banners/index.html.erb @@ -1,17 +1,24 @@ -<%= stylesheet_link_tag "admin/ad_banner_preview" %> +<% content_for :page_specific_css do -%> + <%#= stylesheet_link_tag "admin/ad_banner_preview" %> +<% end -%> +<% content_for :page_specific_javascript do -%> + <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> + <%= javascript_include_tag "inc/modal-preview" %> +<% end -%> +
    -
    diff --git a/app/views/admin/ad_banners/new_created_node.js.erb b/app/views/admin/ad_banners/new_created_node.js.erb new file mode 100644 index 000000000..86970e6a3 --- /dev/null +++ b/app/views/admin/ad_banners/new_created_node.js.erb @@ -0,0 +1,8 @@ +$('<%= escape_javascript(content_tag(:li,link_to(@ad_banner.title,"##{@ad_banner.title}",:data=>{:toggle=>"tab"}))) %>').insertBefore("#new_ad_banner_tab_but"); +$('<%= escape_javascript(render(:partial => "ad_banner_tab",:locals => {:ad_banner_tab => @ad_banner})) %>').insertBefore($("#new-a-banner")); + +$('.modal').modal('hide'); +$('#new-a-banner').unbind(); +$('#post-body-content').find(".nav.nav-tabs").children('li.active').removeClass("active"); +$('#post-body-content').find(".nav.nav-tabs").children('li[id!="new_ad_banner_tab_but"]').last().addClass("active"); + diff --git a/app/views/admin/ad_banners/realtime_preview.js.erb b/app/views/admin/ad_banners/realtime_preview.js.erb new file mode 100644 index 000000000..1ab728f25 --- /dev/null +++ b/app/views/admin/ad_banners/realtime_preview.js.erb @@ -0,0 +1,2 @@ +$('#show_preview').html("<%= escape_javascript(render(:partial => 'modal_preview',:locals => {:ad_banner => @ad_banner})) %>"); +var start_modal_with_id = "slideshow-<%=@ad_banner.title.dehumanize%>" \ No newline at end of file diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index 8e7f18df9..be5f2b477 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -3,7 +3,11 @@ <% end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "lib/datepicker" %> - <%= javascript_include_tag "lib/date.format" %> + <%= javascript_include_tag "lib/date.format.js" %> + <%= javascript_include_tag "inc/modal-preview" %> + <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> + <%= javascript_include_tag "inc/jquery.imagesloaded.js" %> + <% end %> @@ -20,8 +24,8 @@
    - <%= f.hidden_field :parse_post_date %> - <%= f.hidden_field :parse_unpost_date%> + <%= f.hidden_field :parse_post_date,:value => @ad_image.post_date.strftime('%Y / %m / %d') %> + <%= f.hidden_field :parse_unpost_date,:value => @ad_image.unpost_date.strftime('%Y / %m / %d')%>
    @@ -71,49 +75,24 @@

    Picture

    -
    -
    - - <%= image_tag @ad_image.file,:width=> "456",:height=>'700' rescue ''%> - -
    - 此區塊圖片尺寸請使用580px × 225px -
    - - -
    - - - -
    +
    +
    + + <%= image_tag @ad_image.file rescue ''%> +
    + 此區塊圖片尺寸請使用580px × 225px +
    + + +
    +
    +
    @@ -151,14 +130,14 @@
    <%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title",params[:ad_banner_id]) , :class=>"input-medium", %> - <% site_valid_locales_default_head.each do |locale|%> - <%= content_tag :div,:class => "tab-pane #{active_when_default_locale_eq locale}",:id=>"#{locale}" do%> + <% @site_valid_locales.each do |locale|%> + <%= content_tag :div,:class => "tab-pane #{active_when_current_locale_eq locale}",:id=>"#{locale}" do%>
    <%= f.fields_for :title,@ad_image.title do |f| %> <%= f.text_field locale,:class=>"ad_image-title post-title",:placeholder => "輸入標題"%> @@ -167,7 +146,7 @@
    <%= f.fields_for :context, @ad_image.context do |f| %> - <%= f.text_area locale,:style => "width:100%", :class => "asd_tinymce_textarea post-title" %> + <%= f.text_area locale,:style => "width:100%", :class => "tinymce_textarea post-title" %> <% end %>
    @@ -178,9 +157,9 @@
    - - - + <%#= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(@ad_image.ad_banner.title) ,:class=>"preview_trigger btn btn-success" rescue nil%> + <%= f.submit t("submit"),:class=>"btn btn-primary" %> + <%= f.submit t("cancel"),:class=>"btn ",:type => 'reset' %>
    diff --git a/app/views/admin/assets/_edit.html.erb b/app/views/admin/assets/_edit.html.erb index 33f8131cb..a747d4f24 100644 --- a/app/views/admin/assets/_edit.html.erb +++ b/app/views/admin/assets/_edit.html.erb @@ -9,7 +9,7 @@ <%= link_back %> <%= f.submit t(:edit) %> <% else %> - <%= t(:edit) %> + <%= t(:edit) %> <% end %>
    <% end %> diff --git a/app/views/admin/assets/_new.html.erb b/app/views/admin/assets/_new.html.erb index 49e638c8c..85d3c2e55 100644 --- a/app/views/admin/assets/_new.html.erb +++ b/app/views/admin/assets/_new.html.erb @@ -9,7 +9,7 @@ <%= link_back %> <%= f.submit t(:create) %> <% else %> - <%= t(:create) %> + <%= t(:create) %> <% end %>
    <% end %> diff --git a/app/views/admin/components/_user_role_management.html.erb b/app/views/admin/components/_user_role_management.html.erb index cd9ca8ae7..6c8e06361 100644 --- a/app/views/admin/components/_user_role_management.html.erb +++ b/app/views/admin/components/_user_role_management.html.erb @@ -1,21 +1,21 @@
    -

    All User

    +

    <%= t("admin.user_role.auth.all_member") %>

    <%= form_tag(submit_url) do %> - <%= check_box_tag 'auth_all',true,(auth.all rescue true) %><%= submit_tag 'Add Role' %>
    + <%= check_box_tag 'auth_all',true,(auth.all rescue true) %><%= submit_tag t("admin.user_role.auth.all_member") %>
    <% end %>
    -

    User Role

    +

    <%= t("admin.user_role.auth.user") %>

    <%= form_tag(submit_url) do %> <%= collection_select(:new,:role, Role.all, :id, :key, :prompt => true) %> - <%= submit_tag 'Add Role' %>
    + <%= submit_tag t("admin.user_role.auth.by_role") %>
    <%= collection_select(:new,:sub_role, SubRole.all, :id, :key, :prompt => true) %> - <%= submit_tag 'Add SubRole' %>
    + <%= submit_tag t("admin.user_role.auth.by_sub_role") %>
    <%= collection_select(:new,:privilege_user, User.all, :id, :name, :prompt => true) %> - <%= submit_tag 'Add PrivilegeList' %>
    + <%= submit_tag t("admin.user_role.auth.add_to_privilege_list") %>
    <%= collection_select(:new,:blocked_user, User.all, :id, :name, :prompt => true) %> - <%= submit_tag 'Add BlockedList' %>
    + <%= submit_tag t("admin.user_role.auth.add_to_block_list") %>
    <% end %> <% unless auth.nil? %> <% auth.roles.each do |role| %> diff --git a/app/views/admin/dashboards/index.html.erb b/app/views/admin/dashboards/index.html.erb index d038b63d4..e22d7dac8 100644 --- a/app/views/admin/dashboards/index.html.erb +++ b/app/views/admin/dashboards/index.html.erb @@ -1,197 +1,16 @@
    -

    Member

    -
    -

    Quantity9,517

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    University2,304
    Master783
    Doctor45
    Staff62
    Teacher52
    Professor20
    Assistant Professor41
    Substitute teacher37
    Lecturer41
    Part-time teacher20
    -
    -
    -
    -
    -
    -
    -

    Content

    -
    -

    Quantity9,517

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    University2,304
    Master783
    Doctor45
    Staff62
    Teacher52
    Professor20
    Assistant Professor41
    Substitute teacher37
    Lecturer41
    Part-time teacher20
    -
    -
    -
    -
    -
    -
    -

    Asset

    -
    -

    Quantity9,517

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    University2,304
    Master783
    Doctor45
    Staff62
    Teacher52
    Professor20
    Assistant Professor41
    Substitute teacher37
    Lecturer41
    Part-time teacher20
    -
    -
    -
    -
    -
    -
    -

    Traffic

    +

    <%= t(:content) %>

    -

    Quantity9,517

    +

    <%= t(:all_content) %>9,517

    + + + + + + + +
    <%= t(:module) %><%= t(:quantity) %>
    @@ -205,128 +24,44 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
    University2,304公告2,304
    Master783新聞783
    Doctor45連結45
    Staff62連結62
    Teacher52連結52
    Professor20新聞20
    Assistant Professor41公告41
    Substitute teacher37公告37
    Lecturer41公告41
    Part-time teacher20
    Staff62
    Teacher52
    Professor20
    Assistant Professor41
    Substitute teacher37
    Lecturer41
    Part-time teacher20
    Staff62
    Teacher52
    Professor20
    Assistant Professor41
    Substitute teacher37
    Lecturer41
    Part-time teacher20
    Staff62
    Teacher52
    Professor20
    Assistant Professor41
    Substitute teacher37
    Lecturer41
    Part-time teacher20公告20
    @@ -336,72 +71,17 @@
    -

    Site info

    -
    -

    Quantity9,517

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    University2,304
    Master783
    Doctor45
    Staff62
    Teacher52
    Professor20
    Assistant Professor41
    Substitute teacher37
    Lecturer41
    Part-time teacher20
    -
    -
    -
    -
    -
    -
    -

    Connection

    +

    <%= t(:member) %>

    -

    Quantity9,517

    +

    <%= t(:all_member) %>2,217

    + + + + + + + +
    <%= t(:role) %><%= t(:quantity) %>
    @@ -461,4 +141,450 @@
    +
    +

    <%= t(:file) %>

    +
    +

    <%= t(:all_file) %>3,422

    + + + + + + + +
    <%= t(:file_type) %><%= t(:quantity) %>
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Word304
    PDF783
    PowerPoint45
    Excel62
    Jpeg52
    Gif20
    Png41
    Avi37
    Txt41
    Zip20
    +
    +
    +
    +
    +
    +
    +

    <%= t(:referral_in_links) %>

    +
    +

    <%= t(:statistics) %>517

    + + + + + + + +
    <%= t(:site_name) %><%= t(:statistics) %>
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Ruling36
    Yahoo31
    Google3,187
    facebook公告
    Title5公告
    Title6頁面
    Title7頁面
    Title8公告
    Title9頁面
    Title10公告
    +
    +
    +
    +
    +
    +
    +

    <%= t(:most_visited_page) %>

    +
    + + + + + + + + +
    <%= t(:title) %><%= t(:module) %><%= t(:hits) %>
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Title1公告2,549
    Title2頁面1,022
    Title3頁面928
    Title4公告904
    Title5公告867
    Title6頁面830
    Title7頁面749
    Title8公告702
    Title9頁面639
    Title10公告549
    Title1公告2,549
    Title2頁面1,022
    Title3頁面928
    Title4公告904
    Title5公告867
    Title6頁面830
    Title7頁面749
    Title8公告702
    Title9頁面639
    Title10公告549
    +
    +
    +
    +
    +
    +
    +

    <%= t(:traffic) %>

    +
    +

    <%= t(:total_visitors) %>438,913

    + + + + + + + +
    <%= t(:item) %><%= t(:data) %>
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + +
    Visitors Today2,304
    Visitors This Month783
    Visitor This Tear45
    +
    +
    +
    +
    +
    +
    +

    <%= t(:site_info) %>

    +
    + + + + + + + + +
    <%= t(:item) %><%= t(:content) %>
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Title:National Chengchi University
    Description:......
    Keywords.....
    Online Date:2012/04/30
    WedID:nccu
    Softwave Version:R4 beta
    Warranty:Valid
    +
    +
    +
    +
    +
    +
    +

    <%= t(:recent_update) %>

    +
    + + + + + + + + +
    <%= t(:title) %><%= t(:module) %>
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Title1公告
    Title2頁面
    Title3頁面
    Title4公告
    Title5公告
    Title6頁面
    Title7頁面
    Title8公告
    Title9頁面
    Title10公告
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/admin/designs/_design.html.erb b/app/views/admin/designs/_design.html.erb new file mode 100644 index 000000000..e7aec0ba1 --- /dev/null +++ b/app/views/admin/designs/_design.html.erb @@ -0,0 +1,14 @@ + + <%= check_box_tag 'to_delete[]', design.id, false, :class => "checkbox_in_list" %> + + <%= design.title %> +
    + +
    + + <%= design.author %> + <%= design.intro %> + \ No newline at end of file diff --git a/app/views/admin/designs/_designs.html.erb b/app/views/admin/designs/_designs.html.erb new file mode 100644 index 000000000..838057f22 --- /dev/null +++ b/app/views/admin/designs/_designs.html.erb @@ -0,0 +1,12 @@ + + + + + + + + + + + <%= render :partial => 'design', :collection => @designs %> + \ No newline at end of file diff --git a/app/views/admin/designs/_filter.html.erb b/app/views/admin/designs/_filter.html.erb new file mode 100644 index 000000000..02ba839b1 --- /dev/null +++ b/app/views/admin/designs/_filter.html.erb @@ -0,0 +1,11 @@ + + +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "sort_header" %> +<% end %> \ No newline at end of file diff --git a/app/views/admin/designs/_sort_headers.html.erb b/app/views/admin/designs/_sort_headers.html.erb new file mode 100644 index 000000000..15f5481f6 --- /dev/null +++ b/app/views/admin/designs/_sort_headers.html.erb @@ -0,0 +1,3 @@ +<%= render_sort_bar(true, ['title', 'title','span7', 'admin.title'], + ['author', 'author', 'span2', 'admin.author'], + ['intro', 'intro', 'span2', 'admin.intro']).html_safe %> diff --git a/app/views/admin/designs/index.html.erb b/app/views/admin/designs/index.html.erb index 6195afd55..8c4608d85 100644 --- a/app/views/admin/designs/index.html.erb +++ b/app/views/admin/designs/index.html.erb @@ -1,35 +1,10 @@ -<%= flash_messages %> - - - - - - - - - - - <% @designs.each do |design| %> - - - - - - - <% end %> - -
    - - - <%= t('admin.title') %><%= t('admin.author') %><%= t('admin.intro') %>
    - <%= design.title %> -
    - -
    -
    <%= design.author %><%= design.intro %>
    -
    +<%= form_for :news_bulletins, :url => delete_admin_designs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), :html => {:id => 'delete_all'}, :remote => true do %> + <%= render 'filter' %> + + <%= render 'designs' %> +
    +<% end %> + +
    <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_admin_design_path, :class => 'btn btn-primary' %>
    \ No newline at end of file diff --git a/app/views/admin/designs/index.js.erb b/app/views/admin/designs/index.js.erb new file mode 100644 index 000000000..5c61066b7 --- /dev/null +++ b/app/views/admin/designs/index.js.erb @@ -0,0 +1,3 @@ +$("#delete_all").attr("action", "<%= delete_admin_designs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) %>"); +$("#sort_headers").html("<%= j render 'sort_headers' %>"); +$("#tbody_designs").html("<%= j render :partial => 'design', :collection => @designs %>"); \ No newline at end of file diff --git a/app/views/admin/items/_site_map_left_bar.html.erb b/app/views/admin/items/_site_map_left_bar.html.erb index b2a48a198..e82b4988f 100644 --- a/app/views/admin/items/_site_map_left_bar.html.erb +++ b/app/views/admin/items/_site_map_left_bar.html.erb @@ -1,3 +1 @@ -
    - <%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %> -
    \ No newline at end of file +<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %> \ No newline at end of file diff --git a/app/views/admin/module_apps/edit.html.erb b/app/views/admin/module_apps/edit.html.erb index 23745806b..7fb64d170 100644 --- a/app/views/admin/module_apps/edit.html.erb +++ b/app/views/admin/module_apps/edit.html.erb @@ -1,40 +1,33 @@ <% content_for :secondary do %> <% end %> - -
    -
    -
    - -

    <%= @module_app.title %>

    +

    <%= @module_app.title%>

    -

    Manager

    -
    -
    Manager +
    <%= t("admin.user_role.auth.manager") %> <% @module_app.managers.each do |manager| %>
    <%= manager.user.name %> <%= get_auth_by(manager) %> <%= link_to '[X]',remove_manager_admin_module_app_path(@module_app,manager),:method => :delete if if_permit_to_delete(:manager) && manager.user != current_user %>
    <% end %> -
    Add: +
    <%= form_tag(assign_manager_admin_module_app_path) do %> <%= collection_select(:manager,:id, User.all, :id, :name, :prompt => true,:disabled => !if_permit_to_assign(:manager))%> - <%= submit_tag 'Add Manager' %> + <%= submit_tag t("admin.user_role.auth.add_manager") %> <% end %>
    -
    Sub Manager - <% @module_app.sub_managers.each do |manager| %> -
    <%= manager.user.name %> -AuthBy:<%= manager.rule_creator.name %> <%= link_to '[X]',remove_sub_manager_admin_module_app_path(@module_app,manager),:method => :delete if if_permit_to_delete(:sub_manager) && manager.user != current_user %>
    - <% end %> -
    Add: - <%= form_tag(assign_sub_manager_admin_module_app_path) do %> - <%= collection_select(:sub_manager,:id, User.all, :id, :name, :prompt => true,:disabled => !if_permit_to_assign(:sub_manager))%> - <%= submit_tag 'Add Sub Manager' %> - <% end %> +
    <%#= t("admin.user_role.auth.sub_manager") %> + <%# @module_app.sub_managers.each do |manager| %> +
    <%#= manager.user.name %> <%#= get_auth_by(manager) %><%#= link_to '[X]',remove_sub_manager_admin_module_app_path(@module_app,manager),:method => :delete if if_permit_to_delete(:sub_manager) && manager.user != current_user %>
    + <%# end %> +
    + <%#= form_tag(assign_sub_manager_admin_module_app_path) do %> + <%#= collection_select(:sub_manager,:id, User.all, :id, :name, :prompt => true,:disabled => !if_permit_to_assign(:sub_manager))%> + <%#= submit_tag t("admin.user_role.auth.add_sub_manager") %> + <%# end %>
    -<%= render :partial => "admin/components/user_role_management", :locals => { :object => @module_app ,:auth=> @module_app.app_auth ,:submit_url=> admin_module_app_app_auths_path(@module_app),:ploy_route_ary=>['remove',:admin,@module_app,@module_app.app_auth] } %> +<%#= render :partial => "admin/components/user_role_management", :locals => { :object => @module_app ,:auth=> @module_app.app_auth ,:submit_url=> admin_module_app_app_auths_path(@module_app),:ploy_route_ary=>['remove',:admin,@module_app,@module_app.app_auth] } %> diff --git a/app/views/admin/object_auths/edit.html.erb b/app/views/admin/object_auths/edit.html.erb index fc824a649..3c391ef9f 100644 --- a/app/views/admin/object_auths/edit.html.erb +++ b/app/views/admin/object_auths/edit.html.erb @@ -1,11 +1,6 @@ <% content_for :secondary do %> <% end %> - -
    -
    -
    -

    <%= @object_auth.title %>

    <%= render :partial => "admin/components/user_role_management", :locals => { diff --git a/app/views/admin/page_parts/_public_r_tag.html.erb b/app/views/admin/page_parts/_public_r_tag.html.erb index 3f8170d74..d8422e9d1 100644 --- a/app/views/admin/page_parts/_public_r_tag.html.erb +++ b/app/views/admin/page_parts/_public_r_tag.html.erb @@ -1,7 +1,11 @@ - <%= f.select :public_r_tag, LIST[:public_r_tags].collect{|tag| [t(tag), tag]}, :selected => @r_tag %> + <%= f.select :public_r_tag, LIST[:public_r_tags].collect{|tag| [t(tag), tag]}, {:selected => @r_tag}, {:rel => admin_page_parts_path} %> - <%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, :selected => @part.public_r_tag_object_id) %> + <% if @r_tag.eql?('sub_menu') %> + <%= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %> + <% else %> + <%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, :selected => @part.public_r_tag_object_id) %> + <% end %> \ No newline at end of file diff --git a/app/views/admin/page_parts/_widget_categories.html.erb b/app/views/admin/page_parts/_widget_categories.html.erb index ce037d395..60659036b 100644 --- a/app/views/admin/page_parts/_widget_categories.html.erb +++ b/app/views/admin/page_parts/_widget_categories.html.erb @@ -1 +1 @@ - <%= select 'page_part', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => (@part ? @part[:category] : nil) if @categories && @categories.size > 0 %> \ No newline at end of file + <%= select 'page_part', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => (@part ? @part[:category] : nil), :include_blank => true if @categories && @categories.size > 0 %> \ No newline at end of file diff --git a/app/views/admin/page_parts/reload_r_tag_options.js.erb b/app/views/admin/page_parts/reload_r_tag_options.js.erb new file mode 100644 index 000000000..a2eaf4839 --- /dev/null +++ b/app/views/admin/page_parts/reload_r_tag_options.js.erb @@ -0,0 +1,5 @@ +<% if @r_tag.eql?('sub_menu') %> + $('#name_list select').html("<%= j options_for_select(t(:horizontal) => :horizontal, t(:vertical) => :vertical) %>") +<% else %> + $('#name_list select').html("<%= j options_from_collection_for_select(@tag_objects, :id, :title) %>") +<% end %> \ No newline at end of file diff --git a/app/views/admin/pages/_form.html.erb b/app/views/admin/pages/_form.html.erb index 6c211d011..7aae7c008 100644 --- a/app/views/admin/pages/_form.html.erb +++ b/app/views/admin/pages/_form.html.erb @@ -27,10 +27,26 @@ <%= t('admin.module_app') %> <%= render :partial => "app_selector", :locals => { :f => f } %> <%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> - <%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category] ) rescue ''%> + <%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category], :include_blank => true ) rescue ''%>

    -<%= f.label :is_published, "#{t('admin.is_published')} ?" %> -<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No + <%= f.label :is_published, "#{t('admin.is_published')} ?" %> + <%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No +

    +

    + <%= f.label :menu_enabled_for, "#{t('admin.menu_enabled_for')}:" %> + <% @site_valid_locales.each do |valid_locale| %> + <%= check_box_tag 'page[menu_enabled_for][]', valid_locale, (@item.menu_enabled_for.nil? ? true : @item.menu_enabled_for.include?(valid_locale)) %> + <%= I18nVariable.from_locale(valid_locale) %> + <% end %> + <%= hidden_field_tag 'page[menu_enabled_for][]', '' %> +

    +

    + <%= f.label :enabled_for, "#{t('admin.enabled_for')}:" %> + <% @site_valid_locales.each do |valid_locale| %> + <%= check_box_tag 'page[enabled_for][]', valid_locale, (@item.enabled_for.nil? ? true : @item.enabled_for.include?(valid_locale)) %> + <%= I18nVariable.from_locale(valid_locale) %> + <% end %> + <%= hidden_field_tag 'page[enabled_for][]', '' %>

    diff --git a/app/views/admin/pages/_show.html.erb b/app/views/admin/pages/_show.html.erb index ba9bcf48a..29d532fb4 100644 --- a/app/views/admin/pages/_show.html.erb +++ b/app/views/admin/pages/_show.html.erb @@ -1,7 +1,7 @@ <%= flash_messages %> -<%= page_stylesheets(@item).html_safe %> -<%= page_javascripts(@item).html_safe %> +<%= page_stylesheets(@item, true).html_safe %> +<%= page_javascripts(@item, true).html_safe %> <%= parse_page_edit_noko(@item).html_safe %> \ No newline at end of file diff --git a/app/views/admin/pages/show.html.erb b/app/views/admin/pages/show.html.erb index d6b6a8a2c..3e1160c7a 100644 --- a/app/views/admin/pages/show.html.erb +++ b/app/views/admin/pages/show.html.erb @@ -1,5 +1 @@ -<% content_for :sidebar do %> - <%= render 'admin/items/site_map_left_bar' %> -<% end -%> - <%= render 'show' %> \ No newline at end of file diff --git a/app/views/admin/sites/language.html.erb b/app/views/admin/sites/language.html.erb new file mode 100644 index 000000000..ceb9b0124 --- /dev/null +++ b/app/views/admin/sites/language.html.erb @@ -0,0 +1 @@ +language.html.erb \ No newline at end of file diff --git a/app/views/admin/sites/mail_setting.html.erb b/app/views/admin/sites/mail_setting.html.erb new file mode 100644 index 000000000..3a52ede2b --- /dev/null +++ b/app/views/admin/sites/mail_setting.html.erb @@ -0,0 +1 @@ +mail_setting.html.erb \ No newline at end of file diff --git a/app/views/admin/sites/site_info.html.erb b/app/views/admin/sites/site_info.html.erb new file mode 100644 index 000000000..64916d4da --- /dev/null +++ b/app/views/admin/sites/site_info.html.erb @@ -0,0 +1,68 @@ +
    +<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "clear"} do |f| %> +
    +
    + +
    +
    + +
    + <%= f.check_box :title_always_on %> <%= t 'admin.always_display_title' %> +
    +
    + <% @site_valid_locales.each do |locale|%> + <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %> +
    +
    + <%= f.fields_for :title, @site.title do |f| %> + <%= f.text_field locale, :class => "input-xxlarge" %> + <% end %> +

    In addition to freeform text, any HTML5 text-based input appears like so.

    +
    +
    + <% end %> + <% end %> + <% @site_valid_locales.each do |locale|%> + <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %> +
    + +
    + <%= f.fields_for :keywords, @site.keywords do |f| %> + <%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %> + <% end %> +

    In addition to freeform text, any HTML5 text-based input appears like so.

    +
    +
    +
    + +
    + <%= f.fields_for :description, @site.description do |f| %> + <%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %> + <% end %> +

    In addition to freeform text, any HTML5 text-based input appears like so.

    +
    +
    +
    + +
    + <%= f.fields_for :footer, @site.footer do |f| %> + <%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %> + <% end %> +
    +
    + <% end %> + <% end %> +
    +
    +
    +
    + <%= f.submit t("submit"), :class => "btn btn-primary" %> + <%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %> +
    +<% end %> +
    diff --git a/app/views/admin/sites/system_info.html.erb b/app/views/admin/sites/system_info.html.erb new file mode 100644 index 000000000..45535dacf --- /dev/null +++ b/app/views/admin/sites/system_info.html.erb @@ -0,0 +1 @@ +system_info.html.erb \ No newline at end of file diff --git a/app/views/admin/sites/ui_theme.html.erb b/app/views/admin/sites/ui_theme.html.erb new file mode 100644 index 000000000..222f59695 --- /dev/null +++ b/app/views/admin/sites/ui_theme.html.erb @@ -0,0 +1 @@ +ui_theme.html.erb \ No newline at end of file diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index cca4b6afc..2056bdd88 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -1,4 +1,4 @@ - <% end %> diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index 38380984b..c38388271 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -1,53 +1,80 @@ -<%= content_tag :li, :class => active_for_controllers('purchases') do -%> - <%= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %> -<% end -%> +<%#= content_tag :li, :class => active_for_controllers('purchases') do -%> + <%#= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %> +<%# end -%> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "/static/kernel.js" %> +<% end %> -<%= content_tag :li, :class => active_for_controllers('bulletins', 'tags', 'bulletin_categorys', 'fact_checks') do -%> +<%= content_tag :li, :class => active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals') || active_sys_call_for_app('module_apps','edit','Announcement') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %> - <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', 'tags', 'bulletin_categorys', 'fact_checks')) do -%> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')) do -%> <%= content_tag :li, link_to(t('announcement.all_articles'), panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %> <%= content_tag :li, link_to(t('announcement.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %> <%= content_tag :li, link_to(t('announcement.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %> - <%= content_tag :li, link_to(t('announcement.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('panel/bulletin/back_end/tags', 'index') %> - <%= content_tag :li, link_to(t('announcement.bulletin.fact_check_setting'), panel_announcement_back_end_fact_checks_setting_path), :class => active_for_action('fact_checks', 'setting') if (is_manager? rescue nil) %> + <%= content_tag :li, link_to(t('announcement.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('/panel/announcement/back_end/tags', 'index') %> + <%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_announcement_back_end_approval_setting_path), :class => active_for_action('approvals', 'setting') if (is_manager? rescue nil) %> + <%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {title: "Announcement"}))), :class => active_sys_call_for_app('module_apps','edit','Announcement') if (is_admin? rescue nil) %> + <% end -%> <% end -%> -<%= content_tag :li, :class => active_for_controllers('users') do -%> - <%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %> +<%= content_tag :li, :class => active_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals') do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.news'), panel_news_back_end_news_bulletins_path %> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')) do -%> + <%= content_tag :li, link_to(t('announcement.all_articles'), panel_news_back_end_news_bulletins_path), :class => active_for_action('news_bulletins', 'index') %> + <%= content_tag :li, link_to(t('announcement.add_new'), new_panel_news_back_end_news_bulletin_path), :class => active_for_action('news_bulletins', 'new') %> + <%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') %> + <%= content_tag :li, link_to(t('announcement.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %> + <%= content_tag :li, link_to(t('announcement.news_bulletin.approval_setting'), panel_news_back_end_news_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %> + <%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_sys_call_for_app('module_apps','edit','news') if (is_admin? rescue nil) %> + <% end -%> + <% end -%> +<%#= content_tag :li, :class => active_for_controllers('users') do -%> + <%#= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %> +<%# end -%> + <%= content_tag :li, :class => active_for_controllers('page_contexts') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.page'), panel_page_content_back_end_page_contexts_path %> - <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('page_contexts')) do -%> - <%= content_tag :li, link_to(t('admin.all_articles'), panel_page_content_back_end_page_contexts_path), :class => active_for_action('page_context', 'index') %> - <% end -%> + <%#= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('page_contexts')) do -%> + <%#= content_tag :li, link_to(t('admin.all_articles'), panel_page_content_back_end_page_contexts_path), :class => active_for_action('page_context', 'index') %> + <%# end -%> <% end -%> <%= content_tag :li, :class => active_for_controllers('designs') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %> <% end -%> -<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') do -%> +<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') || active_sys_call_for_app('module_apps','edit','ad_banners') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.ad_banner'), admin_ad_banners_path %> - <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('ad_banners', 'ad_images')) do -%> - <%= content_tag :li, link_to(t('admin.all_ad_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %> - <%= content_tag :li, link_to(t('admin.new_ad_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %> - <%= content_tag :li, link_to(t('admin.new_ad_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %> - <% end %> + + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('ad_banners', 'ad_images') ) do -%> + <%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %> + <%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %> + <%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %> + <%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {title: "ad_banners"}))), :class => active_sys_call_for_app('module_apps','edit','ad_banners') if (is_admin? rescue nil) %> + <% end -%> <% end %> -<%= content_tag :li, :class => active_for_controllers('web_links', 'tags', 'web_link_categorys') do -%> +<%= content_tag :li, :class => active_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), panel_web_resource_back_end_web_links_path %> - <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', 'tags', 'web_link_categorys')) do -%> - <%= content_tag :li, link_to(t('admin.announcement.all_articles'), panel_web_resource_back_end_web_links_path), :class => active_for_action('web_link', 'index') %> - <%= content_tag :li, link_to(t('admin.announcement.add_new'), new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_link', 'new') %> - <%= content_tag :li, link_to(t('admin.announcement.categories'), panel_web_resource_back_end_web_link_categorys_path), :class => active_for_action('web_link_categorys', 'index') %> - <%= content_tag :li, link_to(t('admin.announcement.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('panel/web_resource/back_end/tags', 'index') %> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys')) do -%> + <%= content_tag :li, link_to(t('admin.all_articles'), panel_web_resource_back_end_web_links_path), :class => active_for_action('web_links', 'index') %> + <%= content_tag :li, link_to(t('announcement.add_new'), new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_links', 'new') %> + <%= content_tag :li, link_to(t('announcement.categories'), panel_web_resource_back_end_web_link_categorys_path), :class => active_for_action('web_link_categorys', 'index') %> + <%= content_tag :li, link_to(t('announcement.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') %> <% end -%> <% end -%> -<%= content_tag :li, :class => active_for_controllers(nil) do -%> - <%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), nil %> +<%= content_tag :li, :class => active_for_controllers('sites') do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), admin_site_site_info_path(@site) %> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('sites')) do -%> + <%= content_tag :li, link_to(t('admin.site_info'), admin_site_site_info_path(@site)), :class => active_for_action('sites', 'site_info') %> + <%= content_tag :li, link_to(t('admin.system_info'), admin_site_system_info_path(@site)), :class => active_for_action('sites', 'system_info') %> + <%= content_tag :li, link_to(t('admin.language'), admin_site_language_path(@site)), :class => active_for_action('sites', 'language') %> + <%= content_tag :li, link_to(t('admin.mail_setting'), admin_site_mail_setting_path(@site)), :class => active_for_action('sites', 'mail_setting') %> + <%= content_tag :li, link_to(t('admin.ui_theme'), admin_site_ui_theme_path(@site)), :class => active_for_action('sites', 'ui_theme') %> + <% end -%> <% end -%> diff --git a/app/views/layouts/new_admin.html.erb b/app/views/layouts/new_admin.html.erb index b6156c5d3..4686545ec 100644 --- a/app/views/layouts/new_admin.html.erb +++ b/app/views/layouts/new_admin.html.erb @@ -14,7 +14,7 @@ <%= render 'layouts/orbit_bar' %> - +
    <%= yield %>
    diff --git a/app/views/layouts/page_layout.html.erb b/app/views/layouts/page_layout.html.erb index 8fb884b07..dd9aa94ad 100644 --- a/app/views/layouts/page_layout.html.erb +++ b/app/views/layouts/page_layout.html.erb @@ -4,7 +4,6 @@ <%= page_title(@item).html_safe %> <%= page_metas(@item).html_safe %> - <%= @metas %> diff --git a/app/views/layouts/site_editor.html.erb b/app/views/layouts/site_editor.html.erb index e5ed9bb9a..158c9f80e 100644 --- a/app/views/layouts/site_editor.html.erb +++ b/app/views/layouts/site_editor.html.erb @@ -9,31 +9,30 @@ <%= stylesheet_link_tag "site_editor" %> <%= javascript_include_tag "site_editor" %> - <%= yield :page_specific_css %> - <%= yield :page_specific_javascript %> <%= csrf_meta_tag %> - +
    +
    + +
    +
    +
    -
    <%= yield :sidebar %>
    -
    +
    <%= yield %> -
    -
    <%= yield :tertiary %>
    - +
    - diff --git a/config/application.rb b/config/application.rb index 222b38563..4eb40b2c7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -61,6 +61,8 @@ module Orbit # Enable the asset pipeline config.assets.enabled = true + #config.time_zone = 'Taipei' + ENV['TZ'] = 'Asia/Taipei' end end Orbit_Apps = [] diff --git a/config/environments/development.rb b/config/environments/development.rb index afcf736eb..7435fcfc4 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -28,17 +28,16 @@ Orbit::Application.configure do # :email_prefix => "[R4_error]", # :sender_address => %{"notifier" }, # :exception_recipients => %w{chris@rulingcom.com} - - # config.action_mailer.delivery_method = :smtp - # config.action_mailer.smtp_settings = { - # :tls => true, - # :enable_starttls_auto => true, - # :address => "smtp.gmail.com", - # :port => '587', - # :domain => "smtp.gmail.com", - # :authentication => "plain", - # :user_name => "redmine@rulingcom.com", - # :password => "rulingredmine" } - + + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { + :tls => true, + :enable_starttls_auto => true, + :address => "smtp.gmail.com", + :port => '587', + :domain => "smtp.gmail.com", + :authentication => "plain", + :user_name => "redmine@rulingcom.com", + :password => "rulingredmine" } end diff --git a/config/initializers/resque.rb b/config/initializers/resque.rb new file mode 100644 index 000000000..f6f084061 --- /dev/null +++ b/config/initializers/resque.rb @@ -0,0 +1,20 @@ +require 'resque_scheduler' +# require 'resque_scheduler/server' +# require 'yaml' + +Resque.redis = 'localhost:6379' +#Resque.redis.namespace = "resque:SchedulerExample" + +# If you want to be able to dynamically change the schedule, +# uncomment this line. A dynamic schedule can be updated via the +# Resque::Scheduler.set_schedule (and remove_schedule) methods. +# When dynamic is set to true, the scheduler process looks for +# schedule changes and applies them on the fly. +# Note: This feature is only available in >=2.0.0. +#Resque::Scheduler.dynamic = true + +Dir["#{Rails.root}/app/jobs/*.rb"].each { |file| require file } + +# The schedule doesn't need to be stored in a YAML, it just needs to +# be a hash. YAML is usually the easiest. +Resque.schedule = YAML.load_file(Rails.root.join('config', 'resque_schedule.yml')) \ No newline at end of file diff --git a/config/list.yml b/config/list.yml index 9b3a1a961..ef95ba314 100644 --- a/config/list.yml +++ b/config/list.yml @@ -9,6 +9,7 @@ markups: public_r_tags: - ad_banner + - sub_menu page_part_kinds: - text diff --git a/config/locales/en.yml b/config/locales/en.yml index 5a52d42ea..4713415f7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -9,6 +9,7 @@ en: account_settings: Account settings add: Add back: Back + browse: Browse cancel: Cancel create: Create delete: Delete @@ -40,17 +41,64 @@ en: submit: Submit sure?: Are you sure? update: Update + view: View yes_: "Yes" - + + all_content: All Content + all_file: All File + all_member: All Member + content: Content + data: Data + file: File + file_type: File Type + hits: Hits + item: Item + member: Member + module: Module + most_visited_page: Most Visited Page + quantity: Quantity + recent_update: Recent Update + referral_in_links: Referral in Links + role: Role + site_info: Site Info + site_name: Site Name + statistics: Statistics + title: Title + total_visitors: Total Visitors + traffic: Traffic + admin: + access: + denied: + app: + not_sub_manager: Access Denied for you are not SubManager for this app + not_manager: Access Denied for you are not SubManager for this app + not_authed_user: Access Denied for you are not User for this app + not_admin: Access Denied for you are not Admin + object: "Access Denied for you don't have permission for this object" action: Action ad_banner: AD Banner + ad: + sec_place_holder: Enter 3 if 3 sec + ab_fx: FX + all_banners: AdBanner list + banner_best_size: Banner Best Size + new_banner: New banner + new_image: New image + showing: Showing + not_showing: NotShowing + title: Title + transition_sec: Transition time + trans_unit_sec: sec + update_banner: Update Banner add: Add add_item: Add item add_language: Add language add_drop_down_item: +Add Menu Item admin: Admin action: Action + all_articles: List + always_display_title: Always displayed in the title bar announcement: Announcement asset: Asset assets: @@ -78,7 +126,7 @@ en: dashboard: Dashboard delete_language: Delete language description: Description - design: Design + design: Template disable_language: Disable language editing_home: Editing homepage editing_layout: Editing layout @@ -89,6 +137,7 @@ en: editing_role: Editing user role email: Email enable_language: Enable language + enabled_for: Enabled for file_name: Filename file_size: File size format: Format @@ -99,10 +148,12 @@ en: is_published: Is published item: Item key: Key + keywords: Keywords language: Language layout: Layout layout_name: Layout name links: Links + link: Links list_assets: Assets list list_designs: Designs list list_items: Items list @@ -112,6 +163,9 @@ en: list_infos: User information list list_roles: User roles list member: Member + menu_enabled_for: Menu enabled for + module: + authorization: Module Authorization move_down: Move down move_up: Move up multilingual: Multilingual @@ -133,6 +187,7 @@ en: new_user: New user new_info: New user information new_role: New user role + news: News non_multilingual: Non multilingual options: Options orig_upload_file: Original filename @@ -147,7 +202,10 @@ en: setup_translations: Translations setup setup_designs: Designs setup site: Site - site_setting: Site Setting + site_description: Site description + site_footer: Site footer + site_settings: Site Setting + site_title: Site title super_pages: Super pages structure: Structure title: Title @@ -166,8 +224,27 @@ en: upload_design: Upload design url: URL user: User + user_role: + auth: + all_member: All Member + manager: Manager + sub_mamanger: SubManager + by_role: By Role + by_sub_role: By SubRole + block_list: Block List + privilege_list: Privilege List + add_manager: Add Manager + add_sub_manager: Add SubManager + add_to_block_list: Add to block List + add_to_privilege_list: Add to privilege List + auth_by: -AuthBy %{user_display_name} info: User information panel: User panel role: User role panel: + + modal: + close: Close + preview: Preview + diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index c7230c80a..dc9e0cb8f 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -6,13 +6,14 @@ zh_tw: account_settings: 帳號設定 add: 新增 back: 回上一步 + browse: 選擇檔案 cancel: 取消 - create: 創建 + create: 新增 delete: 刪除 desktop: 桌面 disable: 禁用 dots: … - downloaded: 已經下載 + downloaded: 已下載 download: 下載 edit: 編輯 email: 電子郵件 @@ -37,25 +38,64 @@ zh_tw: submit: 送出 sure?: 您肯定嗎? update: 更新 + view: 檢視 yes_: "Yes" - + + all_content: 全部內容有: + all_file: 全部檔案有: + all_member: 成員總數: + content: 內容 + data: 數據 + file: 檔案 + file_type: 檔案類型 + hits: 點擊率 + item: 項目 + member: 會員 + module: 模組 + most_visited_page: 熱門頁面 + quantity: 數量 + recent_update: 近期更新 + referral_in_links: 外部推薦連結 + role: 角色 + site_info: 網站資訊 + site_name: 網站名稱 + statistics: 統計 + title: 標題 + total_visitors: 造訪次數: + traffic: 流量 + admin: + access: + denied: + app: + not_sub_manager: 拒絕存取因你不是此應用程式次管理員 + not_manager: 拒絕存取因你不是此應用程式管理員 + not_authed_user: 拒絕存取因你不是此應用程式授權使用者 + not_admin: 拒絕存取因你不是此應用程式次管理員 + object: 拒絕存取因你不是網站管理者 action: 操作 ad_banner: 廣告輪播 ad: + sec_place_holder: 3秒請輸入3 ab_fx: 轉場特效 all_banners: 輪播清單 + banner_best_size: Banner 尺寸 new_banner: 新增輪播 new_image: 新增橫幅 + showing: 顯示中 + not_showing: 沒有顯示 title: 標題 transition_sec: 轉場單位時間 trans_unit_sec: 秒 + update_banner: 更新輪播 add: 新增 add_item: 新增項目 add_language: 新增語言 add_drop_down_item: +增加Orbit選單 - admin: 管理 - announcement: 公告系統 + admin: 網站管理者 + all_articles: 列表 + always_display_title: 永遠顯示於標題列 + announcement: 公告管理 asset: 資產 assets: file: 檔案 @@ -66,27 +106,27 @@ zh_tw: author: 作者 calendar: 行事曆 cant_delete_self: 您不可以刪除自己。 - cant_revoke_self_admin: 您不可以撤銷自己的管理作用。 + cant_revoke_self_admin: 您不可以撤銷自己的管理身份。 choose_file: 請選擇一個文件... class: 階級 content: 內容 - create_error_link: 創建連接時出錯。 - create_error_page: 創建頁面時出錯。 - create_success_home: 首頁已成功創建。 - create_success_layout: 樣板已成功創建。 - create_success_link: 連結已成功創建。 - create_success_page: 頁面已成功創建。 - create_success_home: 首頁已成功創建。 - create_success_layout: 佈局已成功創建。 - create_success_link: 連結已成功創建。 - create_success_page: 頁面已成功創建。 - create_success_snippet: 片段已成功創建。 - create_success_user: 用戶已成功創建。。 + create_error_link: 新增連接時出錯。 + create_error_page: 新增頁面時出錯。 + create_success_home: 首頁已成功新增。 + create_success_layout: 樣板已成功新增。 + create_success_link: 連結已成功新增。 + create_success_page: 頁面已成功新增。 + create_success_home: 首頁已成功新增。 + create_success_layout: 佈局已成功新增。 + create_success_link: 連結已成功新增。 + create_success_page: 頁面已成功新增。 + create_success_snippet: 片段已成功新增。 + create_success_user: 用戶已成功新增。。 dashboard: 儀表板 data: 資料數據 delete_language: 刪除語言 description: 描述 - design: 網站版型 + design: 版型管理 disable_language: 禁用語言 edit: 編輯 editing_home: 編輯首頁 @@ -95,9 +135,10 @@ zh_tw: editing_page: 編輯頁面 editing_snippet: 編輯片段 editing_info: 編輯用戶資料 - editing_role: 編輯用戶角色 + editing_role: 編輯用戶身份 email: Email enable_language: 啟用語言 + enabled_for: 啟用 file_name: 檔名 file_size: 檔案大小 format: 格式 @@ -107,10 +148,12 @@ zh_tw: intro: 簡介 is_published: 被出版 item: 網站架構 - key: 鍵值 + key: 關鍵 + keywords: 關鍵字 language: 語言 layout: 佈局 layout_name: 佈局名字 + link: 連結管理 links: 網路資源 list_assets: 資產列表 list_designs: 設計列表 @@ -119,8 +162,11 @@ zh_tw: list_snippets: 斷片列表 list_users: 使用列表 list_infos: 用戶資料列表 - list_roles: 用戶角色列表 + list_roles: 用戶身份列表 member: 會員 + menu_enabled_for: 選單啟用 + module: + authorization: 模組授權 move_down: 往下移 move_up: 往上移 multilingual: 多種語言 @@ -141,16 +187,21 @@ zh_tw: new_snippet: 新增片段 new_user: 新增使用 new_info: 新增用戶資料 - new_role: 新增用戶角色 + new_role: 新增用戶身份 + news: 新聞 non_multilingual: 非多種語言 options: 選項 orig_upload_file: 原上傳檔名 - page: Page + page: 頁面管理 position: 位置 published?: 發布? purchase: 購買 - role: 角色 - roles: 角色 + role: 身份 + roles: 身份 + site_description: 網站描述 + site_footer: 網站頁尾 + site_settings: 基本設定 + site_title: 網站標題 setup_member: 成員設置 setup_translations: 語系設定 setup_designs: 版型設定 @@ -174,9 +225,23 @@ zh_tw: upload_design: 上傳設計 url: URL user: 用戶 + user_role: + auth: + all_member: 所有會員 + manager: 管理員 + sub_manager: 次管理員 + by_role: 根據身份 + by_sub_role: 根據次身份 + block_list: 封鎖名單 + add_manager: 增加到管理員 + add_sub_manager: 增加到次管理員 + add_to_block_list: 封鎖名單 + add_to_privilege_list: 特許名單 + auth_by: -由%{user_display_name}授權 + user: 使用會員 info: 用戶資料 panel: 用戶面板 - role: 用戶角色 + role: 用戶身份 panel: @@ -392,3 +457,6 @@ zh_tw: create: "新增%{model}" update: "更新%{model}" submit: "儲存%{model}" + modal: + close: "關閉" + preview: "預覽" diff --git a/config/resque.god b/config/resque.god new file mode 100644 index 000000000..6c4e4bded --- /dev/null +++ b/config/resque.god @@ -0,0 +1,55 @@ +rails_env = 'development' #ENV['RAILS_ENV'] || "production" +rails_root = ENV['RAILS_ROOT'] || "/Users/kaito/Documents/MyWorkspeace/orbit/orbit" +num_workers = rails_env == 'production' ? 5 : 2 + +num_workers.times do |num| + God.watch do |w| + w.dir = "#{rails_root}" + w.name = "resque-#{num}" + w.group = 'resque' + w.interval = 30.seconds + p "/usr/bin/rake -f #{rails_root}/Rakefile resque:work QUEUE=* RAILS_ENV=#{rails_env}" +# w.env = {"QUEUE"=>"critical,high,low", "RAILS_ENV"=>rails_env} + w.start = "rake -f #{rails_root}/Rakefile resque:work QUEUE=* RAILS_ENV=#{rails_env}" + + w.uid = 'kaito' + w.gid = 'staff' + + # restart if memory gets too high + w.transition(:up, :restart) do |on| + on.condition(:memory_usage) do |c| + c.above = 350.megabytes + c.times = 2 + end + end + + # determine the state on startup + w.transition(:init, { true => :up, false => :start }) do |on| + on.condition(:process_running) do |c| + c.running = true + end + end + + # determine when process has finished starting + w.transition([:start, :restart], :up) do |on| + on.condition(:process_running) do |c| + c.running = true + c.interval = 5.seconds + end + + # failsafe + on.condition(:tries) do |c| + c.times = 5 + c.transition = :start + c.interval = 5.seconds + end + end + + # start if process is not running + w.transition(:up, :start) do |on| + on.condition(:process_running) do |c| + c.running = false + end + end + end +end \ No newline at end of file diff --git a/config/resque_schedule.yml b/config/resque_schedule.yml new file mode 100644 index 000000000..10f97f5f4 --- /dev/null +++ b/config/resque_schedule.yml @@ -0,0 +1,17 @@ +do_mail_matt: + every: 10s + class: FetchTime + args: + description: Runs the perform method in FetchTime + +nccu_daily_ldap_sync: + cron: 30 * * * * * + class: SyncDb + args: + description: Runs the perform method in SnycDB + +nccu_claender_sync: + every: 1m + class: NccuCalendar + args: + description: Runs the perform method in NccuCalendar \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index a86f61182..f7afa9004 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,7 @@ Orbit::Application.routes.draw do devise_for :users,:controllers => {:sessions => 'sessions'} + mount Resque::Server, :at => "/admin/resque" # routes for sinatra app match '/site/set_registered', :to => CentralServerExchangeApp @@ -12,6 +13,7 @@ Orbit::Application.routes.draw do # routes for admin namespace :admin do + mount Resque::Server.new, :at => "/resque" resources :assets resources :app_auths resources :object_auths do @@ -24,7 +26,8 @@ Orbit::Application.routes.draw do end end - + + match 'ad_banners/:id/preview' => 'ad_banners#realtime_preview',:as => :realtime_preview_ad_banner,:via => :put resources :ad_banners do collection do match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get @@ -36,6 +39,7 @@ Orbit::Application.routes.draw do resources :designs do collection do get 'upload_package' + post 'delete' post 'upload_package' end member do @@ -76,6 +80,7 @@ Orbit::Application.routes.draw do resources :page_parts do member do get 'reload_widgets' + get 'reload_r_tag_options' end end resources :purchases do @@ -90,7 +95,13 @@ Orbit::Application.routes.draw do get 'add_sub_role' get 'add_attribute_field' end - resources :sites + resources :sites do + get 'site_info' + get 'system_info' + get 'language' + get 'mail_setting' + get 'ui_theme' + end resources :snippets resources :tags resources :translations diff --git a/dump.rdb b/dump.rdb new file mode 100644 index 000000000..e5b34fe1d Binary files /dev/null and b/dump.rdb differ diff --git a/lib/orbit_core_lib.rb b/lib/orbit_core_lib.rb index bcde17e0c..b92f4eca5 100644 --- a/lib/orbit_core_lib.rb +++ b/lib/orbit_core_lib.rb @@ -19,6 +19,10 @@ module OrbitCoreLib end + def get_object_auth_by_title(title) + self.object_auths.where({title: title }).first + end + def authed_users(title=nil) users = [] users = case title @@ -33,7 +37,7 @@ module OrbitCoreLib [] end else - self.object_auths.where(title: title).first.auth_users rescue [] + get_object_auth_by_title(title).auth_users rescue [] end users end diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb index 24b6c59f4..0ebaf90be 100644 --- a/lib/parsers/parser_back_end.rb +++ b/lib/parsers/parser_back_end.rb @@ -28,6 +28,7 @@ module ParserBackEnd parse_menu(body, page, true) public_r_tags = parse_content_edits(body, page, id) parse_images(body, page) + parse_footer(body, page, true) public_r_tags.each do |tag| send("parse_#{tag}s", body, page,id) diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 93ea26085..41d57cbb6 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -1,46 +1,36 @@ module ParserCommon - + include ActionView::Helpers::TagHelper + def menu_level(page, current, menu, edit = false) res = '' - if menu.levels > 0 && current <= menu.levels - if current != 0 - res << "
    " - item = rand(100000) - res << "#{page.i18n_variable[I18n.locale]}" - if page.children.size > 0 - res << "
    " - res << "
      " - i = nil - i = 1 if menu.values["li_incremental_#{current}"] - page.children.each do |child| - res << menu_li(child, current, menu, i, edit) - i += 1 if i - end - res << "
    " - res << "
    " - end - res << "
    " - else - res << '' + if page.ordered_and_visible_children.size > 0 + res << "" end + res end def menu_li(page, current, menu, i, edit) res = "" end @@ -66,7 +56,7 @@ module ParserCommon printable_ad_images.each do |ad_image| #TODO Need Reflact res << "" + res << "

    #{page.i18n_variable[I18n.locale]}

    " + res << "" + res << "" + res << "
    " + fragment = Nokogiri::HTML::DocumentFragment.new(body, res) + sub_menu.swap(fragment) + end + end + + # page_menu + def parse_footer(body, page, edit=nil) + page_footer = body.css('.page_footer').first + res = "" + res << @site.footer[I18n.locale] + res << "
    " + fragment = Nokogiri::HTML::DocumentFragment.new(body ,res) + page_footer.swap(fragment) rescue nil + end + end diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index dfec0dd9a..d37eba303 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -21,11 +21,12 @@ module ParserFrontEnd require 'nokogiri' - def parse_page_noko(page, id = nil) + def parse_page_noko(page, id = nil,params) body = Nokogiri::HTML(page.design.layout.body) parse_menu(body, page) - public_r_tags = parse_contents(body, page, id) + public_r_tags = parse_contents(body, page, id,params[:preview]) parse_images(body, page) + parse_footer(body, page, true) public_r_tags.each do |tag| send("parse_#{tag}s", body, page,id) @@ -35,7 +36,7 @@ module ParserFrontEnd end # page_contents - def parse_contents(body, page, id) + def parse_contents(body, page, id,preview = false) public_r_tags = [] body.css('.page_content').each do |content| ret = '' @@ -43,7 +44,10 @@ module ParserFrontEnd ret << "
    " else part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil @@ -51,8 +55,15 @@ module ParserFrontEnd when 'text' ret << part.i18n_variable[I18n.locale] rescue '' when 'module_widget' - if part[:category] - ret << "
    " + # if part[:category] + # ret << "
    " + # else + # ret << "
    " + # end + if !params[:category_id].blank? + ret << "
    " + elsif !params[:tag_id].blank? + ret << "
    " else ret << "
    " end diff --git a/lib/tasks/anc_tasks.rake b/lib/tasks/anc_tasks.rake index cd534b939..a97e1830e 100644 --- a/lib/tasks/anc_tasks.rake +++ b/lib/tasks/anc_tasks.rake @@ -1,3 +1,4 @@ +require 'resque_scheduler/tasks' # encoding: utf-8 namespace :anc do diff --git a/lib/tasks/resque.rake b/lib/tasks/resque.rake new file mode 100644 index 000000000..66841c724 --- /dev/null +++ b/lib/tasks/resque.rake @@ -0,0 +1,39 @@ +# require "resque/tasks" +# require 'resque/scheduler' +# require 'resque/scheduler' + +# +# task "resque:setup" => :environment +# Resque tasks +require 'resque/tasks' +require 'resque_scheduler/tasks' + +namespace :resque do + task :setup => :environment do + require 'resque' + require 'resque_scheduler' + require 'resque/scheduler' + + # you probably already have this somewhere + Resque.redis = 'localhost:6379' + + # If you want to be able to dynamically change the schedule, + # uncomment this line. A dynamic schedule can be updated via the + # Resque::Scheduler.set_schedule (and remove_schedule) methods. + # When dynamic is set to true, the scheduler process looks for + # schedule changes and applies them on the fly. + # Note: This feature is only available in >=2.0.0. + #Resque::Scheduler.dynamic = true + + # The schedule doesn't need to be stored in a YAML, it just needs to + # be a hash. YAML is usually the easiest. + Resque.schedule = YAML.load_file('config/resque_schedule.yml') + + # If your schedule already has +queue+ set for each job, you don't + # need to require your jobs. This can be an advantage since it's + # less code that resque-scheduler needs to know about. But in a small + # project, it's usually easier to just include you job classes here. + # So, someting like this: + #require 'jobs' + end +end \ No newline at end of file diff --git a/public/assets/75-9e78fdbcb9cc33a7c4ff3acd9912ead5.png b/public/assets/75-9e78fdbcb9cc33a7c4ff3acd9912ead5.png deleted file mode 100644 index ff8aef6e9..000000000 Binary files a/public/assets/75-9e78fdbcb9cc33a7c4ff3acd9912ead5.png and /dev/null differ diff --git a/public/assets/75.png b/public/assets/75.png deleted file mode 100644 index ff8aef6e9..000000000 Binary files a/public/assets/75.png and /dev/null differ diff --git a/public/assets/Jobs-25fa5d89cd615962bd84da941390ed1c.jpg b/public/assets/Jobs-25fa5d89cd615962bd84da941390ed1c.jpg deleted file mode 100644 index 6d6627e40..000000000 Binary files a/public/assets/Jobs-25fa5d89cd615962bd84da941390ed1c.jpg and /dev/null differ diff --git a/public/assets/Jobs.jpg b/public/assets/Jobs.jpg deleted file mode 100644 index 6d6627e40..000000000 Binary files a/public/assets/Jobs.jpg and /dev/null differ diff --git a/public/assets/PIE-212456f5b192ae4c335600b2db30bf37.htc b/public/assets/PIE-212456f5b192ae4c335600b2db30bf37.htc deleted file mode 100644 index 00b63838a..000000000 --- a/public/assets/PIE-212456f5b192ae4c335600b2db30bf37.htc +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - diff --git a/public/assets/PIE.htc b/public/assets/PIE.htc deleted file mode 100644 index 00b63838a..000000000 --- a/public/assets/PIE.htc +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - diff --git a/public/assets/Thumbs-f35679bb600d7b11dd0811a704e50d42.db b/public/assets/Thumbs-f35679bb600d7b11dd0811a704e50d42.db deleted file mode 100644 index f9d32b5f6..000000000 Binary files a/public/assets/Thumbs-f35679bb600d7b11dd0811a704e50d42.db and /dev/null differ diff --git a/public/assets/Thumbs.db b/public/assets/Thumbs.db deleted file mode 100644 index f9d32b5f6..000000000 Binary files a/public/assets/Thumbs.db and /dev/null differ diff --git a/public/assets/add_mamber-e0bf1c09e7fcccd57b5552246298bb97.png b/public/assets/add_mamber-e0bf1c09e7fcccd57b5552246298bb97.png deleted file mode 100644 index 1af415902..000000000 Binary files a/public/assets/add_mamber-e0bf1c09e7fcccd57b5552246298bb97.png and /dev/null differ diff --git a/public/assets/add_mamber.png b/public/assets/add_mamber.png deleted file mode 100644 index 1af415902..000000000 Binary files a/public/assets/add_mamber.png and /dev/null differ diff --git a/public/assets/application-d22b654c29be380f94da4393299af1e2.js b/public/assets/application-d22b654c29be380f94da4393299af1e2.js deleted file mode 100644 index 945097688..000000000 --- a/public/assets/application-d22b654c29be380f94da4393299af1e2.js +++ /dev/null @@ -1,27 +0,0 @@ -/*! - * jQuery JavaScript Library v1.7.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Mon Nov 21 21:11:03 2011 -0500 - */ -function r_editor(a,b,c,d){d||(d=new Array),d.width||(d.width=400),d.height||(d.height=300);var e=this;e.filename=c,e.getUrl=a,e.postUrl=b,e.nodeToBeChanged="",e.width=d.width,e.height=d.height;var f="";e.init=function(){return code="",f=$(code),f.children("textarea").load(e.getUrl),f.children("input.discard").click(function(){e.destroy()}),f.children("input.send").click(function(){e.send()}),f},e.reload=function(){$.get(e.getUrl,function(a){f.children("textarea").text(a)})},e.send=function(){$.post(e.postUrl,{filename:e.filename,context:f.children("textarea").val(),authenticity_token:$("meta[name=csrf-token]").attr("content")},null,"script")},e.destroy=function(){f.remove()}}function resize(){viewportheight=$(window).height(),viewportwidth=$(window).width(),window.navigator.userAgent.indexOf("MSIE")>0&&(windH=document.clientHeight,windW=document.clientWidht)}function mainTablePosition(){var a=$("#main-wrap > .subnav").height(),b=$("#main-wrap > .table");b.stop().animate({marginTop:a},500)}function dropmenu(){if(!$(".rc_dm").length)return;$(".rc_dm").each(function(){$(this).find(".dm_ctrl").click(function(){var a=$(this).attr("rel"),b=$(this).outerWidth(),c=$(this).outerHeight(),d=$(this).position();return $(".dm_list").not("#"+a).hide(),$("#"+a).css({width:b,zIndex:999,left:d.left,top:d.top+c}).toggle(),!1})}),$(document).click(function(){$(".dm_list").hide()})}function tab(){if(!$(".rc_tab").length)return;$(".rc_tab").each(function(){$(this).find(".tab_ctrl:first").addClass("recent"),$(this).find(".tab_content:not(:first)").hide(),$(this).find(".tab_ctrl").click(function(){var a=$(this).attr("href");return $(this).parents(".rc_tab").find(".tab_content").hide().end().find(".tab_ctrl").removeClass("recent"),$(this).addClass("recent"),$(a).show(),!1})})}function tooltip(){if(!$(".rc_tip").length)return;$(".rc_tip").each(function(){$(this).css({position:"relative"});var a=$(this).data("tip");$(this).mouseover(function(){var b=$(this).find(".td").outerHeight(),c=$(this).offset();$(this).append(''+a+""),$(this).find(".td").show().css("display","inline-block"),$(document).mousemove(function(a){$(this).find(".td").css({left:a.pageX-c.left+16,top:a.pageY-c.top-b-20})})}).mouseout(function(){$(this).find(".td").hide().detach()})})}function accordion(){if(!$(".rc_accor").length)return;$(".rc_accor").each(function(){$(this).find(".ac_ctrl:first").addClass("recent"),$(this).find(".ac_content:not(:first)").hide();if($(this).hasClass("av"))$(this).find(".ac_ctrl").click(function(){var a=$(this).parents(".av").find(".ac_ctrl").index(this);return $(this).siblings(".ac_ctrl").removeClass("recent"),$(this).addClass("recent"),$(this).parents(".rc_accor").find(".ac_content:not(:eq("+a+"))").stop().slideUp(),$(this).parents(".rc_accor").find(".ac_content:eq("+a+")").stop().slideToggle(),!1});else if($(this).hasClass("ah")){var a=$(this).find(".ac_content").css("width");$(this).find(".ac_content:not(:eq(0))").css({width:0}),$(this).find(".ac_ctrl").click(function(){var b=$(this).parents(".ah").find(".ac_ctrl").index(this);return $(this).siblings(".ac_ctrl").removeClass("recent"),$(this).addClass("recent"),$(this).parents(".rc_accor").find(".ac_content:not(:eq("+b+"))").stop().animate({width:0}),$(this).parents(".rc_accor").find(".ac_content:eq("+b+")").stop().show().animate({width:a}),!1})}})}(function(a,b){function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c=0===c})}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function bj(a,b){if(b.nodeType!==1||!f.hasData(a))return;var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d0){if(c!=="border")for(;g").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(e.isReady)return;try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};return e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(a==="body"&&!d&&c.body)return this.context=c,this[0]=c.body,this.selector=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?g=[null,a,null]:g=i.exec(a);if(g&&(g[1]||!d)){if(g[1])return d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes),e.merge(this,a);h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}return this.context=c,this.selector=a,this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}return e.isFunction(a)?f.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),e.makeArray(a,this))},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();return e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return e.each(this,a,b)},ready:function(a){return e.bindReady(),A.add(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(A)return;A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}var b=i.call(arguments,0),c=0,d=b.length,e=new Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;return k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];if(!r)return;j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
    "+""+"
    ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
    t
    ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
    ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i)}),b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?f.cache[a[f.expando]]:a[f.expando],!!a&&!m(a)},data:function(a,c,d,e){if(!f.acceptData(a))return;var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);return g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d),o&&!h[c]?g.events:(k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h,i)},removeData:function(a,b,c){if(!f.acceptData(a))return;var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];if(!arguments.length){if(g)return c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type],c&&"get"in c&&(d=c.get(g,"value"))!==b?d:(d=g.value,typeof d=="string"?d.replace(q,""):d==null?"":d);return}return e=f.isFunction(a),this.each(function(d){var g=f(this),h;if(this.nodeType!==1)return;e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!a||j===3||j===8||j===2)return;if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}return h&&"set"in h&&i&&(g=h.set(a,d,c))!==b?g:(a.setAttribute(c,""+d),d)}return h&&"get"in h&&i&&(g=h.get(a,c))!==null?g:(g=a.getAttribute(c),g===null?b:g)},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1 -){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);return b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)")),b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))return;d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f=="undefined"||!!a&&f.event.triggered===a.type?b:f.event.dispatch.apply(i.elem,arguments)},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function w(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){return i=!1,0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length!==1||w[0]!=="~"&&w[0]!=="+"||!d.parentNode?d:d.parentNode,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);return l&&(m(l,h,e,f),m.uniqueSort(e)),e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);return a[0]=e++,a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");return!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" "),a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if(!((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))){var g=m.filter(b[3],c,d,!0^f);return d||e.push.apply(e,g),!1}b[3]=m(b[3],null,null,c)}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){return a.unshift(!0),a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){return a=Array.prototype.slice.call(a,0),b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(b.querySelectorAll&&b.querySelectorAll(".TEST").length===0)return;m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!a.getElementsByClassName||a.getElementsByClassName("e").length===0)return;a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}return c=c.length>1?f.unique(c):c,this.pushStack(c,"closest",a)},index:function(a){return a?typeof a=="string"?f.inArray(this[0],f(a)):f.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);return L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this -.length>1||N.test(d))&&M.test(a)&&(e=e.reverse()),this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){return f.isFunction(a)?this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))}):typeof a!="object"&&a!==b?this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a)):f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return f.isFunction(a)?this.each(function(b){f(this).wrapInner(a.call(this,b))}):this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);return a.push.apply(a,this.toArray()),this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);return a.push.apply(a,f.clean(arguments)),a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}return d=e=null,h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;return f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight}),c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;return b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;return f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d)),f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;return f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}}),this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){return f.isFunction(d)&&(g=g||e,e=d,d=b),f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b),a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s===2)return;s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return s||(d.mimeType=a),this},abort:function(a){return a=a||"abort",p&&p.abort(a),w(0,a),this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(!d.beforeSend||d.beforeSend.call(e,v,d)!==!1&&s!==2){for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(!(s<2))throw z;w(-1,z)}}return v}return v.abort(),!1},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";return b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){return g||f.error(h+" was not called"),g[0]},b.dataTypes[0]="json","script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return f.globalEval(a),a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}return i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;return c===b?(e=this[0],e?(g=cy(e),g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]):null):this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window),function(a,b){var c;a.rails=c={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])" -,fileInputSelector:"input:file",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(b){var c=a('meta[name="csrf-token"]').attr("content");c&&b.setRequestHeader("X-CSRF-Token",c)},fire:function(b,c,d){var e=a.Event(c);return b.trigger(e,d),e.result!==!1},confirm:function(a){return confirm(a)},ajax:function(b){return a.ajax(b)},handleRemote:function(d){var e,f,g,h=d.data("cross-domain")||null,i=d.data("type")||a.ajaxSettings&&a.ajaxSettings.dataType,j;if(c.fire(d,"ajax:before")){if(d.is("form")){e=d.attr("method"),f=d.attr("action"),g=d.serializeArray();var k=d.data("ujs:submit-button");k&&(g.push(k),d.data("ujs:submit-button",null))}else d.is(c.inputChangeSelector)?(e=d.data("method"),f=d.data("url"),g=d.serialize(),d.data("params")&&(g=g+"&"+d.data("params"))):(e=d.data("method"),f=d.attr("href"),g=d.data("params")||null);return j={type:e||"GET",data:g,dataType:i,crossDomain:h,beforeSend:function(a,e){return e.dataType===b&&a.setRequestHeader("accept","*/*;q=0.5, "+e.accepts.script),c.fire(d,"ajax:beforeSend",[a,e])},success:function(a,b,c){d.trigger("ajax:success",[a,b,c])},complete:function(a,b){d.trigger("ajax:complete",[a,b])},error:function(a,b,c){d.trigger("ajax:error",[a,b,c])}},f&&(j.url=f),c.ajax(j)}return!1},handleMethod:function(c){var d=c.attr("href"),e=c.data("method"),f=c.attr("target"),g=a("meta[name=csrf-token]").attr("content"),h=a("meta[name=csrf-param]").attr("content"),i=a(''),j='';h!==b&&g!==b&&(j+=''),f&&i.attr("target",f),i.hide().append(j).appendTo("body"),i.submit()},disableFormElements:function(b){b.find(c.disableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with",b[c]()),b[c](b.data("disable-with")),b.prop("disabled",!0)})},enableFormElements:function(b){b.find(c.enableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with")&&b[c](b.data("ujs:enable-with")),b.prop("disabled",!1)})},allowAction:function(a){var b=a.data("confirm"),d=!1,e;return b?(c.fire(a,"confirm")&&(d=c.confirm(b),e=c.fire(a,"confirm:complete",[d])),d&&e):!0},blankInputs:function(b,c,d){var e=a(),f,g=c||"input,textarea";return b.find(g).each(function(){f=a(this);if(d?f.val():!f.val())e=e.add(f)}),e.length?e:!1},nonBlankInputs:function(a,b){return c.blankInputs(a,b,!0)},stopEverything:function(b){return a(b.target).trigger("ujs:everythingStopped"),b.stopImmediatePropagation(),!1},callFormSubmitBindings:function(c,d){var e=c.data("events"),f=!0;return e!==b&&e.submit!==b&&a.each(e.submit,function(a,b){if(typeof b.handler=="function")return f=b.handler(d)}),f},disableElement:function(a){a.data("ujs:enable-with",a.html()),a.html(a.data("disable-with")),a.bind("click.railsDisable",function(a){return c.stopEverything(a)})},enableElement:function(a){a.data("ujs:enable-with")!==b&&(a.html(a.data("ujs:enable-with")),a.data("ujs:enable-with",!1)),a.unbind("click.railsDisable")}},a.ajaxPrefilter(function(a,b,d){a.crossDomain||c.CSRFProtection(d)}),a(document).delegate(c.linkDisableSelector,"ajax:complete",function(){c.enableElement(a(this))}),a(document).delegate(c.linkClickSelector,"click.rails",function(d){var e=a(this),f=e.data("method"),g=e.data("params");if(!c.allowAction(e))return c.stopEverything(d);e.is(c.linkDisableSelector)&&c.disableElement(e);if(e.data("remote")!==b)return(d.metaKey||d.ctrlKey)&&(!f||f==="GET")&&!g?!0:(c.handleRemote(e)===!1&&c.enableElement(e),!1);if(e.data("method"))return c.handleMethod(e),!1}),a(document).delegate(c.inputChangeSelector,"change.rails",function(b){var d=a(this);return c.allowAction(d)?(c.handleRemote(d),!1):c.stopEverything(b)}),a(document).delegate(c.formSubmitSelector,"submit.rails",function(d){var e=a(this),f=e.data("remote")!==b,g=c.blankInputs(e,c.requiredInputSelector),h=c.nonBlankInputs(e,c.fileInputSelector);if(!c.allowAction(e))return c.stopEverything(d);if(g&&e.attr("novalidate")==b&&c.fire(e,"ajax:aborted:required",[g]))return c.stopEverything(d);if(f)return h?c.fire(e,"ajax:aborted:file",[h]):!a.support.submitBubbles&&a().jquery<"1.7"&&c.callFormSubmitBindings(e,d)===!1?c.stopEverything(d):(c.handleRemote(e),!1);setTimeout(function(){c.disableFormElements(e)},13)}),a(document).delegate(c.formInputClickSelector,"click.rails",function(b){var d=a(this);if(!c.allowAction(d))return c.stopEverything(b);var e=d.attr("name"),f=e?{name:e,value:d.val()}:null;d.closest("form").data("ujs:submit-button",f)}),a(document).delegate(c.formSubmitSelector,"ajax:beforeSend.rails",function(b){this==b.target&&c.disableFormElements(a(this))}),a(document).delegate(c.formSubmitSelector,"ajax:complete.rails",function(b){this==b.target&&c.enableFormElements(a(this))})}(jQuery),$("button.multi_files").live("click",function(){return $("#new_add_banner_file_holder").append("
  • "+$(this).val()+"Time:"+$(this).siblings(".ad_time").val()+"Link:"+$(this).siblings(".ad_out_link").val()+"
  • "),new_node=$(this).parent().clone(),$(this).parent().css("display","none"),new_node.children("input.multi_files").val(""),$(this).parent().before(new_node),!1}),$("a.remove_mark").live("click",function(){return $(this).prev("input").val("true"),$(this).parent().css("text-decoration","line-through"),$(this).parent().removeClass("r_snapshot"),$(this).next().remove(),$(this).remove(),!1}),function(a){function b(){if(!a.fn.ajaxSubmit.debug)return;var b="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(b):window.opera&&window.opera.postError&&window.opera.postError(b)}a.fn.ajaxSubmit=function(c){function w(b){var d=new FormData;for(var e=0;e').attr("value",j.extraData[k]).appendTo(f)[0]);j.iframeTarget||(m.appendTo("body"),n.attachEvent?n.attachEvent("onload",E):n.addEventListener("load",E,!1)),setTimeout(h,15),f.submit()}finally{f.setAttribute("action",e),c?f.setAttribute("target",c):g.removeAttr("target"),a(i).remove()}}function E(c){if(o.aborted||D)return;try{B=w(n)}catch(d){b("cannot access response document: ",d),c=v}if(c===u&&o){o.abort("timeout");return}if(c==v&&o){o.abort("server abort");return}if(!B||B.location.href==j.iframeSrc)if(!r)return;n.detachEvent?n.detachEvent("onload",E):n.removeEventListener("load",E,!1);var e="success",f;try{if(r)throw"timeout";var g=j.dataType=="xml"||B.XMLDocument||a.isXMLDoc(B);b("isXml="+g);if(!g&&window.opera&&(B.body==null||B.body.innerHTML=="")&&--C){b("requeing onLoad callback, DOM not available"),setTimeout(E,250);return}var h=B.body?B.body:B.documentElement;o.responseText=h?h.innerHTML:null,o.responseXML=B.XMLDocument?B.XMLDocument:B,g&&(j.dataType="xml"),o.getResponseHeader=function(a){var b={"content-type":j.dataType};return b[a]},h&&(o.status=Number(h.getAttribute("status"))||o.status,o.statusText=h.getAttribute("statusText")||o.statusText);var i=(j.dataType||"").toLowerCase(),l=/(json|script|text)/.test(i);if(l||j.textarea){var p=B.getElementsByTagName("textarea")[0];if(p)o.responseText=p.value,o.status=Number(p.getAttribute("status"))||o.status,o.statusText=p.getAttribute("statusText")||o.statusText;else if(l){var q=B.getElementsByTagName("pre")[0],t=B.getElementsByTagName("body")[0];q?o.responseText=q.textContent?q.textContent:q.innerText:t&&(o.responseText=t.textContent?t.textContent:t.innerText)}}else i=="xml"&&!o.responseXML&&o.responseText!=null&&(o.responseXML=F(o.responseText));try{A=H(o,i,j)}catch(c){e="parsererror",o.error=f=c||e}}catch(c){b("error caught: ",c),e="error",o.error=f=c||e}o.aborted&&(b("upload aborted"),e=null),o.status&&(e=o.status>=200&&o.status<300||o.status===304?"success":"error"),e==="success"?(j.success&&j.success.call(j.context,A,"success",o),k&&a.event.trigger("ajaxSuccess",[o,j])):e&&(f==undefined&&(f=o.statusText),j.error&&j.error.call(j.context,o,e,f),k&&a.event.trigger("ajaxError",[o,j,f])),k&&a.event.trigger("ajaxComplete",[o,j]),k&&!--a.active&&a.event.trigger("ajaxStop"),j.complete&&j.complete.call(j.context,o,e),D=!0,j.timeout&&clearTimeout(s),setTimeout(function(){j.iframeTarget||m.remove(),o.responseXML=null},100)}var f=g[0],h,i,j,k,l,m,n,o,p,q,r,s,t=!!a.fn.prop;if(e)if(t)for(i=0;i'),m.css({position:"absolute",top:"-1000px",left:"-1000px"})),n=m[0],o={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(c){var d=c==="timeout"?"timeout":"aborted";b("aborting upload... "+d),this.aborted=1,m.attr("src",j.iframeSrc),o.error=d,j.error&&j.error.call(j.context,o,d,c),k&&a.event.trigger("ajaxError",[o,j,d]),j.complete&&j.complete.call(j.context,o,d)}},k=j.global,k&&!(a.active++)&&a.event.trigger("ajaxStart"),k&&a.event.trigger("ajaxSend",[o,j]);if(j.beforeSend&&j.beforeSend.call(j.context,o,j)===!1){j.global&&a.active--;return}if(o.aborted)return;p=f.clk,p&&(q=p.name,q&&!p.disabled&&(j.extraData=j.extraData||{},j.extraData[q]=p.value,p.type=="image"&&(j.extraData[q+".x"]=f.clk_x,j.extraData[q+".y"]=f.clk_y)));var u=1,v=2,x=a("meta[name=csrf-token]").attr("content"),y=a("meta[name=csrf-param]").attr("content");y&&x&&(j.extraData=j.extraData||{},j.extraData[y]=x),j.forceSync?z():setTimeout(z,10);var A,B,C=50,D,F=a.parseXML||function(a,b){return window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml"),b&&b.documentElement&&b.documentElement.nodeName!="parsererror"?b:null},G=a.parseJSON||function(a){return window.eval("("+a+")")},H=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f=c==="xml"||!c&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;return f&&g.documentElement.nodeName==="parsererror"&&a.error&&a.error("parsererror"),d&&d.dataFilter&&(g=d.dataFilter(g,c)),typeof g=="string"&&(c==="json"||!c&&e.indexOf("json")>=0?g=G(g):(c==="script"||!c&&e.indexOf("javascript")>=0)&&a.globalEval(g)),g}}if(!this.length)return b("ajaxSubmit: skipping submit process - no element selected"),this;var d,e,f,g=this;typeof c=="function"&&(c={success:c}),d=this.attr("method"),e=this.attr("action"),f=typeof e=="string"?a.trim(e):"",f=f||window.location.href||"",f&&(f=(f.match(/^([^#]+)/)||[])[1]),c=a.extend(!0,{url:f,success:a.ajaxSettings.success,type:d||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},c);var h={};this.trigger("form-pre-serialize",[this,c,h]);if(h.veto)return b("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(c.beforeSerialize&&c.beforeSerialize(this,c)===!1)return b("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var i=c.traditional;i===undefined&&(i=a.ajaxSettings.traditional);var j,k,l,m=this.formToArray(c.semantic);c.data&&(c.extraData=c.data,j=a.param(c.data,i));if(c.beforeSubmit&&c.beforeSubmit(m,this,c)===!1)return b("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[m,this,c,h]);if(h.veto)return b("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var n=a.param(m,i);j&&(n=n?n+"&"+j:j),c.type.toUpperCase()=="GET"?(c.url+=(c.url.indexOf("?")>=0?"&":"?")+n,c.data=null):c.data=n;var o=[];c.resetForm&&o.push(function(){g.resetForm()}),c.clearForm&&o.push(function(){g.clearForm(c.includeHidden)});if(!c.dataType&&c.target){var p=c.success||function(){};o.push(function(b){var d=c.replaceTarget?"replaceWith":"html";a(c.target)[d](b).each(p,arguments)})}else c.success&&o.push(c.success);c.success=function(a,b,d){var e=c.context||c;for(var f=0,h=o.length;f0,s="multipart/form-data",t=g.attr("enctype")==s||g.attr("encoding")==s,u=!!(r&&q.get(0).files&&window.FormData);b("fileAPI :"+u);var v=(r||t)&&!u;return c.iframe!==!1&&(c.iframe||v)?c.closeKeepAlive?a.get(c.closeKeepAlive,function(){x(m)}):x(m):(r||t)&&u?(c.progress=c.progress||a.noop,w(m)):a.ajax(c),this.trigger("form-submit-notify",[this,c]),this},a.fn.ajaxForm=function(c){if(this.length===0){var d={s:this.selector,c:this.context};return!a.isReady&&d.s?(b("DOM not ready, queuing ajaxForm"),a(function(){a(d.s,d.c).ajaxForm(c)}),this):(b("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)")),this)}return this.ajaxFormUnbind().bind("submit.form-plugin",function(b){b.isDefaultPrevented()||(b.preventDefault(),a(this).ajaxSubmit(c))}).bind("click.form-plugin",function(b){var c=b.target,d=a(c);if(!d.is(":submit,input:image")){var e=d.closest(":submit");if(e.length==0)return;c=e[0]}var f=this;f.clk=c;if(c.type=="image")if(b.offsetX!=undefined)f.clk_x=b.offsetX,f.clk_y=b.offsetY;else if(typeof a.fn.offset=="function"){var g=d.offset();f.clk_x=b.pageX-g.left,f.clk_y=b.pageY-g.top}else f.clk_x=b.pageX-c.offsetLeft,f.clk_y=b.pageY-c.offsetTop;setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)})},a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},a.fn.formToArray=function(b){var c=[];if(this.length===0)return c;var d=this[0],e=b?d.getElementsByTagName("*"):d.elements;if(!e)return c;var f,g,h,i,j,k,l;for(f=0,k=e.length;f";for(i=current_year;i>=b;i--)d+="";d+=" Date: Month: ",a.html(d)},loadingWrapper:function(a,b){b?(a.prepend("
    "),$rss("#loading_wrapper").height(a.height()),$rss("#loading_wrapper").width(a.width())):(domId=a.attr("id"),$rss("#"+domId+" #loading_wrapper").remove())},validate:function(a,b,c){var d=a.val(),e=!1,f="",g="";switch(b){case"required":d==""&&(e=!0),g="Cannot be empty.";break;case"email":f=/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/,g="Invalid Email Address.";break;case"number":f=/^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/,g="Only numbers are accepted.";break;case"alphanumeric":f=/^\s*[a-zA-Z0-9,\s]+\s*$/,g="Only numbers, alphabets and spaces are allowed."}return domId=a.attr("name"),c==""&&(c=g),f!=""&&(f.test(d)||(e=!0)),e?($rss("#"+domId+"_error").remove(),a.after(""+c+""),!1):($rss("#"+domId+"_error").remove(),!0)},bindToSpinner:function(a,b,c){var d=a.attr("id"),e="",f=Array(),g=Array();$rss.each(b,function(a,c){$rss.each(b[a],function(a,b){f.push(b)})}),e="",a.html(e),typeof c=="function"&&c.call(this,e)},bindToTable:function(a,b,c,d,e,f){e||(e="");var g="
    ",h=a.attr("id");if(d){var i=Array(),j=Array();$rss.each(d,function(a,b){i.push(a),j.push(b)}),rcom.translate(i,function(d){i=d.slice(),rcom.translate(c,function(d){c=d;if(!b)return;$rss.each(c,function(a,b){g+=""}),g+="",b.length==0&&(g+=""),$rss.each(b,function(a,b){var c="";a%2!=0&&(c="even"),g+="",$rss.each(b,function(a,b){a!="id"&&(b==null&&(b="Not Set"),g+="")}),g+="",g+=""}),g+="
    "+b+"
    No Data
    "+b+"";for(x=0;x"+i[x]+"";g+="
    ",a.html(g)})})}else rcom.translate(c,function(d){c=d;if(!b)return;c.length>0&&$rss.each(c,function(a,b){g+=""+b+""}),g+="",b.length==0&&(g+="No Data"),$rss.each(b,function(a,b){var c="";a%2!=0&&(c="even"),g+="",$rss.each(b,function(a,b){a!="id"&&(b==null&&(b="Not Set"),g+=""+b+"")}),g+=""}),g+="",a.html(g)});typeof f=="function"&&f.call(this,g)},convertToInsertableDate:function(a,b,c,d){var e="";b<10&&(b="0"+b),c<10&&(c="0"+c);switch(d){case"yyyy-mm-dd":e=a+"-"+b+"-"+c;break;case"dd-mm-yyyy":e=c+"-"+b+"-"+a;break;case"mm-dd-yyyy":e=b+"-"+c+"-"+a;break;default:e=a+"-"+b+"-"+c}return e},showDoms:function(a){$rss("body").find("div").each(function(){$rss(this).hide()}),$rss.each(a,function(a,b){b.show()})},translate:function(a,b){var c="",d=!0;a||(typeof b=="function"&&b.call(this,c),d=!1),a==""&&(typeof b=="function"&&b.call(this,c),d=!1),d&&$rss.getJSON("../../classes/translate.php",{fn:"translateThis",tData:a},function(a){typeof b=="function"&&b.call(this,a)})},bindToList:function(a,b,c){var d=a.attr("id"),e="",f=Array(),g=Array();$rss.each(b,function(a,c){$rss.each(b[a],function(a,b){f.push(b)})}),e="
      ";for(i=0,y=1,z=0;i"+f[y]+"";e+="
    ",a.html(e),typeof c=="function"&&c.call(this,e)},makeDraggable:function(a,b){a.css("position","absolute"),b.css("position","absolute");var c=0,d=0,e=0,f=0,g="",h=b.css("z-index");a.mousedown(function(a){c=a.clientX,e=a.clientY,g=b.offset(),$rss(this).mousemove(function(a){d=a.clientX-c,d+=g.left,f=a.clientY-e,f+=g.top,b.css({left:d+"px",top:f+"px","z-index":"9999"})})}).mouseup(function(){$rss(this).unbind("mousemove"),b.css("z-index",h)})},scrollToBottom:function(a){var b=a.attr("id"),c=document.getElementById(b);c.scrollTop+100>=c.scrollHeight-c.offsetHeight&&a.scrollTop(c.scrollHeight)},loadImages:function(settings,callbackFn){var dom=settings.dom,domid=dom.attr("id"),temp_array=Array(),starting=$rss("#"+domid+" img:last").attr("id");typeof starting!="undefined"?starting=starting.substr(4,starting.length-1):starting=0;var temp_var="",json="",dhtml="",extraparam="";typeof settings.extraParam!="undefined"&&(extraparam=settings.extraParam),$rss.getJSON(settings.url,{fn:settings.fn,id:settings.whereId,limit:settings.limit,start:starting,extra:extraparam},function(images){json=eval(images),$rss.each(images,function(a,b){var c=Array(),d=Array(),e="",f="";$rss.each(b,function(a,b){c.push(b)}),c.length>=4&&(e=""+c[3]+"
    "),c[2]==null?f="":f=c[2],typeof settings.bindTo!="undefined"?(d[1]="onclick='"+settings.bindTo+"("+c[0]+");return false;'",d[0]=""):(d[0]="?"+settings.urlKey+"="+c[0],d[1]=""),dhtml="
    "+e,dom.delay(100).append(dhtml),$rss("#pic_"+b.id).delay(100).fadeIn(200)}),typeof callbackFn=="function"&&callbackFn.call(this,json)})},getUrlVars:function(){var a=[],b,c=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(var d=0;dj&&(h=j),l=(f-h)/2),i!="auto"?m=(g-i)/2:(i=$rss("#rgWindow").width(),i>k&&(i=k),m=(g-i)/2),i=parseInt(i)+25,$rss("#rgWindow").empty().show();var a="";e&&(a='X'),$rss("#rgWindow").animate({width:i+"px",height:h+"px",top:l+"px",left:m+"px"},500,function(){$rss("#rgWindow").html(a+"
    "+d+"
    "),$rss("#close_modal").mouseover(function(){$rss(this).css("color","#999")}).mouseout(function(){$rss(this).css("color","#666")}),$rss("#close_modal").click(function(){$rss("#rgWindow").empty();var a=(f-20)/2,b=(g-20)/2;return $rss("#rgWindow").animate({top:a+"px",left:b+"px",width:"50px",height:"50px"},300,function(){$rss(this).fadeOut(100).remove(),$rss("#rgsheath").fadeOut(500).remove()}),!1}),c&&$rss("#rgsheath").click(function(){$rss("#rgWindow").empty();var a=(f-20)/2,b=(g-20)/2;$rss("#rgWindow").animate({top:a+"px",left:b+"px",width:"50px",height:"50px"},300,function(){$rss(this).fadeOut(100).remove(),$rss("#rgsheath").fadeOut(500).remove()})}),typeof b=="function"&&b.call(this,d)})}var c=a.envClose,d="";typeof c=="undefined"&&(c=!0);var e=a.closeBtn;typeof e=="undefined"&&(e=!0);var f=$rss(window).height(),g=$rss(window).width(),h=a.height,i=a.width,j=f*85/100,k=g*85/100;typeof h!="undefined"?(h.charAt(h.length-1)=="%"&&(h=f*parseInt(h.substr(0,h.length))/100),h>j&&(h=j)):h="auto",typeof i!="undefined"?(i.charAt(i.length-1)=="%"&&(i=g*parseInt(i.substr(0,i.length))/100),i>k&&(i=k)):i="auto",$rss("body").append('
    '),$rss("#rgsheath").css({background:"#000",width:"100%",position:"fixed",top:0,left:0,opacity:.5,"z-index":199}),$rss("body").append('
    '),$rss("#rgWindow").css({position:"fixed","z-index":"999",background:"#fff",border:"solid 1px #ccc",padding:"10px","border-radius":"5px","-webkit-border-radius":"5px","-moz-border-radius":"5px","-ms-border-radius":"5px","box-shadow":"0 0 20px rgba(0,0,0,0.7)","-webkit-box-shadow":"0 0 20px rgba(0,0,0,0.7)","-moz-box-shadow":"0 0 20px rgba(0,0,0,0.7)","-ms-box-shadow":"0 0 20px rgba(0,0,0,0.7)"});var l=(f-20)/2,m=(g-20)/2;$rss("#rgWindow").css({top:l+"px",left:m+"px"}),typeof a.loadDiv!="undefined"&&(d=$rss("#"+a.loadDiv).html(),$rss("#rgWindow").html(d).hide(),n()),typeof a.loadHtml!="undefined"&&(d=a.loadHtml,$rss("#rgWindow").html(d).hide(),n()),typeof a.loadPage!="undefined"&&$rss("#rgWindow").load(a.loadPage,function(){$rss(this).hide(),d=$rss(this).html(),n()})},modalWindowUpdate:function(a,b){function j(){e!="auto"?rgWTop=(c-e)/2:(e=$rss("#rgwindow_temp_div").height(),e>h&&(e=h),rgWTop=(c-e)/2),f!="auto"?rgWLeft=(d-f)/2:(f=$rss("#rgwindow_temp_div").width(),f>i&&(f=i),rgWLeft=(d-f)/2),f=parseInt(f)+25,$rss("#rgContent").empty(),$rss("#rgWindow").animate({width:f+"px",height:e+"px",top:rgWTop+"px",left:rgWLeft+"px"},500,function(){$rss("#rgContent").css("height",e+"px").html(g)}),$rss("#rgwindow_temp_div").remove()}var c=$rss(window).height(),d=$rss(window).width(),e=a.height,f=a.width,g="",h=c*85/100,i=d*85/100;typeof e!="undefined"?(e.charAt(e.length-1)=="%"&&(e=c*parseInt(e.substr(0,e.length))/100),e>h&&(e=h)):e="auto",typeof f!="undefined"?(f.charAt(f.length-1)=="%"&&(f=d*parseInt(f.substr(0,f.length))/100),f>i&&(f=i)):f="auto",$rss("body").append("
    "),typeof a.loadDiv!="undefined"&&(g=$rss("#"+a.loadDiv).html(),$rss("#rgwindow_temp_div").html(g).hide(),j()),typeof a.loadHtml!="undefined"&&(g=a.loadHtml,$rss("#rgwindow_temp_div").html(g).hide(),j()),typeof a.loadPage!="undefined"&&$rss("#rgwindow_temp_div").load(a.loadPage,function(){$rss(this).hide(),g=$rss(this).html(),j()})},modalWindowClose:function(a){if($rss("#rgWindow").length>0){$rss("#rgWindow").empty();var b=$rss(window).height(),c=$rss(window).width(),d=(b-20)/2,e=(c-20)/2;$rss("#rgWindow").animate({top:d+"px",left:e+"px",width:"50px",height:"50px"},300,function(){$rss(this).fadeOut(100).remove(),$rss("#rgsheath").fadeOut(500).remove()})}typeof a=="function"&&a.call(this,"harry")},bindDomToHead:function(a){var b=a.css("background"),c=a.offset(),d=a.width();$rss(window).scroll(function(){var e=$rss(window).scrollTop();if(e>c.top){var f={position:"fixed",top:0,width:d,background:b,"box-shadow":"0 1px 0 rgba(0,0,0,0.2)","z-index":99};a.css(f)}else a.attr("style","")})},progressBar:function(a,b){var c=a.prop("id");$rss("#rss_progressbar_div_"+c).length==0&&(typeof b.top=="undefined"&&(b.value=1),typeof b.top=="undefined"&&(b.top=(a.height()-12)/2),a.append(""),$rss("#rss_progressbar_div_"+c).fadeIn(500))},progressBarValue:function(a,b){var c=a.prop("id");$rss("#rss_progressbar_div_"+c).length==1&&$rss("#rss_progressbar_"+c).animate({width:b+"%"},100)},progressBarClose:function(a){var b=a.prop("id");$rss("#rss_progressbar_div_"+b).fadeOut(500,function(){$(this).remove()})},getInternetExplorerVersion:function(){var a=-1;if(navigator.appName=="Microsoft Internet Explorer"){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");c.exec(b)!=null&&(a=parseFloat(RegExp.$1))}return a}};$=jQuery.noConflict(),$("#submit_button").live("click",function(){$("#ajaxForm").ajaxSubmit({beforeSubmit:function(a,b,c){c.dataType="script"}})}),$(".attributes_block a.delete").live("click",function(){$(this).parents(".list_item").remove()}),$(".action a.remove_existing_record").live("click",function(){$(this).next(".should_destroy").attr("value",1),$("#attribute_"+$(this).prev().attr("value")).hide()}),$(".action a.switch").live("click",function(){$(this).parent().toggleClass("disable");var a=$(this).next(".built_in_state");a.attr("value",a.attr("value")=="false"?"true":"false")}),$(".select_type select").live("change",function(){this.value=="select"?$(this).next().show():$(this).next().hide()}),!function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('