Merge branch 'ldap' of https://github.com/Rulingcom/orbit into ldap

This commit is contained in:
Matthew K. Fu JuYuan 2012-05-08 11:55:21 +08:00
commit b22a275360
736 changed files with 8367 additions and 59787 deletions

3
.gitignore vendored
View File

@ -10,8 +10,7 @@ uploads/**/*
*.swp *.swp
public/javascripts public/assets
public/stylesheets
config/application.rb config/application.rb
.rvmrc .rvmrc

View File

@ -21,6 +21,9 @@ gem 'mysql2'
gem 'nokogiri' gem 'nokogiri'
gem 'radius' gem 'radius'
gem 'rake' gem 'rake'
gem 'resque' # background jobs
gem 'resque-scheduler' # job scheduling
gem 'resque-restriction'
gem 'ruby-debug19' gem 'ruby-debug19'
gem 'rubyzip' gem 'rubyzip'
gem 'therubyracer' gem 'therubyracer'

View File

@ -97,7 +97,6 @@ GEM
railties (~> 3.0) railties (~> 3.0)
thor (~> 0.14) thor (~> 0.14)
json (1.6.5) json (1.6.5)
libv8 (3.3.10.4)
linecache19 (0.5.12) linecache19 (0.5.12)
ruby_core_source (>= 0.1.4) ruby_core_source (>= 0.1.4)
mail (2.3.3) mail (2.3.3)
@ -155,6 +154,20 @@ GEM
rake (0.9.2.2) rake (0.9.2.2)
rdoc (3.12) rdoc (3.12)
json (~> 1.4) 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 (2.8.0)
rspec-core (~> 2.8.0) rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0) rspec-expectations (~> 2.8.0)
@ -184,6 +197,8 @@ GEM
ruby_parser (2.3.1) ruby_parser (2.3.1)
sexp_processor (~> 3.0) sexp_processor (~> 3.0)
rubyzip (0.9.6.1) rubyzip (0.9.6.1)
rufus-scheduler (2.0.16)
tzinfo (>= 0.3.23)
ruport (1.6.3) ruport (1.6.3)
fastercsv fastercsv
pdf-writer (= 1.1.8) pdf-writer (= 1.1.8)
@ -211,8 +226,6 @@ GEM
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
subexec (0.2.1) subexec (0.2.1)
therubyracer (0.9.10)
libv8 (~> 3.3.10)
thor (0.14.6) thor (0.14.6)
tilt (1.3.3) tilt (1.3.3)
tinymce-rails (3.4.8) tinymce-rails (3.4.8)
@ -226,6 +239,8 @@ GEM
uglifier (1.2.3) uglifier (1.2.3)
execjs (>= 0.3.0) execjs (>= 0.3.0)
multi_json (>= 1.0.2) multi_json (>= 1.0.2)
vegas (0.1.11)
rack (>= 1.0.0)
warden (1.1.1) warden (1.1.1)
rack (>= 1.0) rack (>= 1.0)
watchr (0.7) watchr (0.7)
@ -265,6 +280,9 @@ DEPENDENCIES
radius radius
rails (>= 3.1.0, < 3.2.0) rails (>= 3.1.0, < 3.2.0)
rake rake
resque
resque-restriction
resque-scheduler
rspec (~> 2.0) rspec (~> 2.0)
rspec-rails (~> 2.0) rspec-rails (~> 2.0)
ruby-debug19 ruby-debug19
@ -275,7 +293,6 @@ DEPENDENCIES
sinatra sinatra
spork spork
sprockets sprockets
therubyracer
tinymce-rails tinymce-rails
uglifier uglifier
watchr watchr

View File

@ -1,7 +1,9 @@
# /usr/bin/ruby -Ku
# Add your own tasks in files placed in lib/tasks ending in .rake, # 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. # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__) require File.expand_path('../config/application', __FILE__)
require 'resque/tasks'
require 'rake/dsl_definition' require 'rake/dsl_definition'
require 'rake' require 'rake'

View File

@ -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
}

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,4 +1,4 @@
$('#submit_button').live('click', function(){ $(document).on('click', '#ajax_form_submit', function(){
$('#ajaxForm').ajaxSubmit({ $('#ajaxForm').ajaxSubmit({
beforeSubmit: function(a,f,o) { beforeSubmit: function(a,f,o) {
o.dataType = 'script'; o.dataType = 'script';

View File

@ -6,23 +6,14 @@ $('.bulletin_files_block a.delete').live('click', function(){
$(this).parents('.list_item').remove(); $(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); $(this).next('.should_destroy').attr('value', 1);
//$("#bulletin_" + $(this).prev().attr('value')).hide(); $("tr #" + $(this).prev().attr('value')).hide();
$("tr#bulletin_" + $(this).prev().attr('value')).hide();
}); });
$('.quick_edit_cancel').live('click', function(){ $(document).on('click', '.quick_edit_cancel', function(){
tr = $(this).attr('rel'); tr = $(this).attr('rel');
$('#' + tr).hide(); $('#' + tr).hide();
$("tr#bulletin_file_" + $(this).prev().attr('value')).hide(); $("tr#bulletin_file_" + $(this).prev().attr('value')).hide();
$("tr#bulletin_link_" + $(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);
});

View File

@ -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);
});
});
});
});

View File

@ -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("<span id='show_preview'></span>");
$.ajax({
type: 'PUT',
url:$(this).attr("href"),
data:$(this).parents("form").serialize(),
success: function (msg) {
$("#"+start_modal_with_id).modal('show'); },
error: function(){
alert("ERROR");
}
});
return false;
});
});

View File

@ -1,4 +1,7 @@
$(document).ready(function() { $(document).ready(function() {
permissionCheckbox();
});
function permissionCheckbox(){
$('.check[checked="checked"]').parents(".checkbox").addClass("checked") $('.check[checked="checked"]').parents(".checkbox").addClass("checked")
$(".checkbox").click(function(){ $(".checkbox").click(function(){
if($(this).children(".check").attr("checked")){ if($(this).children(".check").attr("checked")){
@ -16,4 +19,4 @@ $(document).ready(function() {
placement: 'bottom', placement: 'bottom',
delay: { show: 100, hide: 300 }, delay: { show: 100, hide: 300 },
}); });
}); };

View File

@ -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) (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)

View File

@ -6,6 +6,7 @@
// //
//= require jquery //= require jquery
//= require jquery_ujs //= require jquery_ujs
//= require jquery.form
//= require bootstrap //= require bootstrap
//= require jquery.isotope.min //= require jquery.isotope.min
//= require jquery.tinyscrollbar.min //= require jquery.tinyscrollbar.min
@ -14,3 +15,4 @@
//= require tinymce_orbit //= require tinymce_orbit
//= require orbit-bar-search //= require orbit-bar-search
//= require side_bar_history //= require side_bar_history
//= require ajax_form

View File

@ -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();
});

View File

@ -14,9 +14,9 @@ $(document).ready(function(){
placement: "left" placement: "left"
}); });
$(document).on('click', '.privacy', function() { $(document).on('click', '.privacy', function() {
console.log($(this).val());
switch ($(this).val()) { switch ($(this).val()) {
case 'true': case 'true':
$(this).parents('.controls').children('.select-role').slideUp(300); $(this).parents('.controls').children('.select-role').slideUp(300);
@ -47,14 +47,19 @@ $(document).ready(function(){
/*tinyscrollbar&windows-Size*/ /*tinyscrollbar&windows-Size*/
resize(); resize();
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2; var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2,
$('#main-sidebar').css("height", viewportheight-30); $subWiget = $('#sub-wiget').width()+18;
$('#main-sidebar .viewport').css("height", viewportheight-30); $orbitBar = $('#orbit-bar').height(),
$('.post-title').css("width", viewportwidth-495); $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-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(); $('.detal-list').tinyscrollbar();
$('#main-sidebar').tinyscrollbar({size:(viewportheight-34)});
mainTablePosition(); mainTablePosition();
/*isotope*/ /*isotope*/
@ -68,12 +73,18 @@ $(document).ready(function(){
}); });
$(window).resize(function(){ $(window).resize(function(){
resize(); resize();
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2; var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2,
$('#main-sidebar').css("height", viewportheight-30); $subWiget = $('#sub-wiget').width()+18;
$('#main-sidebar .viewport').css("height", viewportheight-30); $orbitBar = $('#orbit-bar').height(),
$('.post-title').css("width", viewportwidth-495); $mainSidebar = $('#main-sidebar').width()+5,
$('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft) $formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right"));
$('#main-sidebar').tinyscrollbar({size:(viewportheight-34)}); $('#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(); mainTablePosition();
}); });
/*main-table position*/ /*main-table position*/
@ -101,5 +112,4 @@ $(window).scroll(function () {
$(".table-label").css({left:$winLeft*-1} ); $(".table-label").css({left:$winLeft*-1} );
//$(".table-label").css({left:$mainWrapMarginLeft+($winLeft*-1)} ); //$(".table-label").css({left:$mainWrapMarginLeft+($winLeft*-1)} );
//$("#main-wrap > .subnav").css({width:$subnavWidth+($winLeft)} ); //$("#main-wrap > .subnav").css({width:$subnavWidth+($winLeft)} );
//console.log($mainWrapMarginLeft+($winLeft*-1)+5);
}); });

View File

@ -1,3 +1,9 @@
$(document).ready(function(){
$('.search').tooltip({
placement: "bottom"
});
});
$(document).on('click', '.orbit-bar-search', function (){ $(document).on('click', '.orbit-bar-search', function (){
if ($(this).parents('.search').hasClass('visible')){ if ($(this).parents('.search').hasClass('visible')){
$(this).parents('.search').stop().animate({ $(this).parents('.search').stop().animate({

View File

@ -24,6 +24,10 @@ $("#module_app_list select").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_widgets'); $.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').live('click', function() {
$('.part_kind_partial').hide(); $('.part_kind_partial').hide();
$('#part_' + $(this).attr('value')).show(); $('#part_' + $(this).attr('value')).show();

View File

@ -1,28 +1,28 @@
var history_edited = false; var history_edited = false;
// $('#back_sidebar a, #back_main a.nav').live('click', $('#back_sidebar a, #back_main a.nav').live('click',
// function () { function () {
// $.getScript(this.href); $.getScript(this.href);
// history.pushState(null, document.title, this.href); history.pushState(null, document.title, this.href);
// history_edited = true; history_edited = true;
// return false; return false;
// } }
// ); );
// $('#back_main a.reload').live('click', $('#back_main a.reload').live('click',
// function () { function () {
// $.getScript(this.href); $.getScript(this.href);
// history.replaceState(null, document.title, this.href); history.replaceState(null, document.title, this.href);
// history_edited = true; history_edited = true;
// return false; return false;
// } }
// ); );
// $('.form').live('submit', function () { $('#back_main .form').live('submit', function () {
// $.post(this.action, $(this).serialize(), null, 'script'); $.post(this.action, $(this).serialize(), null, 'script');
// history_edited = true; history_edited = true;
// return false; return false;
// }); });
$(document).on('click', '.js_history', $(document).on('click', '.js_history',
function () { function () {

View File

@ -6,6 +6,10 @@
// //
//= require jquery //= require jquery
//= require jquery_ujs //= 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 side_bar_history
//= require new_admin //= require page_edit

View File

@ -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);
});

View File

@ -1,3 +1,5 @@
/*bootstrap-orbit*/
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
font-weight:normal ; font-weight:normal ;
} }
@ -110,6 +112,18 @@ table .span1-3 {
.qe-block .form-horizontal .form-actions { .qe-block .form-horizontal .form-actions {
text-align:right; text-align:right;
} }
.form-actions form {
margin-bottom: 0;
}
.form-actions form input {
margin-bottom: 0;
}
.modal.fade { .modal.fade {
top: -50%; top: -50%;
} }
.form-search button {
margin-bottom: 0;
}
.modal form {
margin-bottom: 0;
}

View File

@ -1,3 +1,4 @@
/*bootstrap*/
/*! /*!
* Bootstrap v2.0.0 * Bootstrap v2.0.0
* *
@ -65,6 +66,7 @@ textarea {
margin: 0; margin: 0;
font-size: 100%; font-size: 100%;
vertical-align: middle; vertical-align: middle;
margin-bottom: 10px;
} }
button, input { button, input {
*overflow: visible; *overflow: visible;
@ -538,7 +540,7 @@ select,
width: 210px; width: 210px;
height: 18px; height: 18px;
padding: 4px; padding: 4px;
margin-bottom: 9px; /*margin-bottom: 9px;*/
font-size: 13px; font-size: 13px;
line-height: 18px; line-height: 18px;
color: #555555; color: #555555;
@ -2664,18 +2666,23 @@ button.btn.small, input[type="submit"].btn.small {
display: inline; display: inline;
} }
.pagination .page{ /*.pagination .page{
float: left; float: left;
padding: 0 14px; padding: 0 14px;
line-height: 34px; line-height: 34px;
text-decoration: none; text-decoration: none;
border: 1px solid #ddd; border: 1px solid #ddd;
border-left-width: 0; border-left-width: 0;
} }*/
.pagination a { .pagination a {
float: left; 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; float: left;
padding: 0 14px; padding: 0 14px;
line-height: 34px; line-height: 34px;
@ -2690,12 +2697,15 @@ button.btn.small, input[type="submit"].btn.small {
text-decoration: none; text-decoration: none;
border: 1px solid #ddd; border: 1px solid #ddd;
border-left-width: 0; border-left-width: 0;
} }*/
.pagination .current{ .pagination .current{
border-left-width: 1px; border-left-width: 1px;
} }
.pagination a {
background-color: #FFFFFF;
}
.pagination a:hover, .pagination .active a { .pagination a:hover, .pagination .active a {
background-color: #f5f5f5; background-color: #e8e8e8;
} }
.pagination .active a { .pagination .active a {
color: #999999; color: #999999;

View File

@ -1,3 +1,5 @@
/*permission-checkbox*/
.checkblock { .checkblock {
display: inline-block; display: inline-block;
float: left; float: left;
@ -8,37 +10,40 @@
} }
.checkbox{ .checkbox{
padding: 5px; padding: 5px;
margin: 5px 5px 10px; margin: 0;
display: inline-block; display: inline-block;
color:#777777; color:#777777;
text-shadow: 0 1px 0px rgba(255,255,255,.4); text-shadow: 0 1px 0px rgba(255,255,255,.4);
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
height: 30px; height: 30px;
position: relative; position: relative;
cursor: pointer; 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% ); background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf'); 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); -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); -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); 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 { .checkbox .check-icon {
display: none; display: none;
position: absolute; position: absolute;
width: 26px; width: 32px;
height: 26px; height: 32px;
background: url('img/check.png') no-repeat left top; background: url(<%= asset_path 'check.png' %>) no-repeat left top;
right: -10px; right: -10px;
top: -5px; top: 15px;
} }
.checkbox .member-name { .checkbox .member-name {
cursor: pointer; cursor: pointer;
font-family: helvetica; font-family: helvetica;
font-size: 12px; font-size: 12px;
line-height: 30px; line-height: 15px;
padding: 0 10px 0 40px; padding: 0 10px 0 40px;
color: #333333; color: #333333;
display: inline-block; display: inline-block;

View File

@ -1,16 +1,11 @@
/*isotope*/
#isotope { #isotope {
margin-top: 2px; margin-top: 2px;
background-color:#f4f4f4;
} }
.isotope-item { .isotope-item {
z-index: 2; z-index: 2;
} }
.isotope-hidden.isotope-item {
pointer-events: none;
z-index: 1;
}
/**** Isotope CSS3 transitions ****/ /**** Isotope CSS3 transitions ****/
.isotope, .isotope,
@ -46,28 +41,27 @@
transition-duration: 0s; transition-duration: 0s;
} }
.w-a { .w-a {
width: 388px; width: 398px;
} }
.w-b { .w-b {
width: 802px; width: 812px;
} }
.h-a { .h-a {
height: 315px; height: 315px;
} }
.h-b { .h-b {
height: 699px; height: 703px;
} }
.item { .item {
margin: 5px 0 15px 15px; margin: 5px 0 15px 15px;
} }
.item h3 { .item h3 {
margin: 5px 0; margin: 20px 0 5px;
} }
.item h3 [class^="icons-"] { .item h3 [class^="icons-"] {
margin: 3px 5px 0 3px; margin: 1px 5px 0 3px;
} }
.item .detail { .item .detail {
padding: 5px;
border: 1px solid rgba(0, 0, 0, 0.1); border: 1px solid rgba(0, 0, 0, 0.1);
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 5px; border-radius: 5px;
@ -75,12 +69,11 @@
-moz-border-radius: 5px; -moz-border-radius: 5px;
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1); box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
-webkit-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 { .item .detail .totle {
font-size: 50px; font-size: 50px;
padding:10px 5px 20px 0; padding:10px 5px 30px 0;
margin: 0px; margin: 0;
text-align: right; text-align: right;
border-bottom:1px solid #d9d9d9; border-bottom:1px solid #d9d9d9;
} }
@ -90,20 +83,60 @@
color: #333; color: #333;
padding-left: 5px; padding-left: 5px;
text-align:left; text-align:left;
margin-bottom: -7px;
}
.item .detail .table {
margin-bottom: 0;
} }
.item .detail .table th, .item .detail .table td { .item .detail .table th, .item .detail .table td {
border-top: none; border-top: none;
border-bottom: 1px solid #DDDDDD; 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 { .item .detail .table tr td:first-child {
color: #666;; 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; text-align:right;
padding-right: 15px;
} }
.item .h-a .my_scroll .viewport { .item .h-a .my_scroll .viewport {
height: 248px; height: 210px;
} }
.item .h-b .my_scroll .viewport { .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;
} }

View File

@ -1,8 +1,5 @@
.list-remove { /*list*/
position: relative;
top: 2px;
left: 2px;
}
.table th.select { .table th.select {
border-bottom:2px solid #0088CC; border-bottom:2px solid #0088CC;
} }
@ -25,7 +22,7 @@
.main-list .nav-pills > li > a { .main-list .nav-pills > li > a {
border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px;
margin: 2px; margin: 2px;
padding:5px padding:5px;
} }
.main-list tbody .quick-edit { .main-list tbody .quick-edit {
position:relative; position:relative;
@ -38,6 +35,9 @@
width: 350px; width: 350px;
left: -8px; left: -8px;
} }
.main-list tr:first-child td {
border-top: 1px solid #DDDDDD;
}
.main-list td { .main-list td {
background-color: #FFFFFF; background-color: #FFFFFF;
border-bottom: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD;
@ -54,6 +54,11 @@
position: relative; position: relative;
height: 40px; height: 40px;
} }
.main-list .label-group .label {
margin-bottom: 1px;
display: inline-block;
padding: 0 3px;
}
.main-list .label-td { .main-list .label-td {
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
height: 40px; height: 40px;
@ -65,9 +70,8 @@
} }
.main-list .label-td:hover { .main-list .label-td:hover {
height: auto; height: auto;
text-align: center;
padding: 5px 5px 8px; padding: 5px 5px 8px;
left: -6px; left: -40px;
top: -6px; top: -6px;
border: 1px solid rgba(0, 0, 0, 0.2); border: 1px solid rgba(0, 0, 0, 0.2);
box-shadow: 0px 5px 10px 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; -webkit-border-radius: 3px;
-moz-border-radius: 3px; -moz-border-radius: 3px;
z-index: 5; z-index: 5;
width: 200px;
}
.qe-edit-div .table-condensed {
background-color: #F2F2F2;
} }
.table-label { .table-label {
background-color: #F2F2F2; background-color: #F2F2F2;
@ -96,6 +104,19 @@
.qe-block td { .qe-block td {
height:auto; height:auto;
padding: 0; 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 { .qe-block .table td, .qe-block .table th {
padding: 8px; padding: 8px;
@ -112,9 +133,6 @@ legend {
margin-bottom: 15px; margin-bottom: 15px;
padding-bottom: 5px; padding-bottom: 5px;
} }
.upload-picture {
margin-left: 20px;
}
.subnav { .subnav {
-moz-border-radius: 0; -moz-border-radius: 0;
-webkit-border-radius: 0; -webkit-border-radius: 0;
@ -149,3 +167,37 @@ legend {
display: block; display: block;
text-align:center; 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;
}

View File

@ -1,3 +1,5 @@
/*message*/
.error{ .error{
color:red; color:red;
} }

View File

@ -6,10 +6,10 @@
*= require_self *= require_self
*= require message *= require message
*= require bootstrap *= require bootstrap
*= require style
*= require bootstrap-orbit *= require bootstrap-orbit
*= require list *= require list
*= require style *= require widgets
*= widget
*= require scroll_style *= require scroll_style
*= require isotope *= require isotope
*/ */

View File

@ -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 { 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; -webkit-text-size-adjust:none;
} }

View File

@ -1,3 +1,5 @@
/*scroll_style*/
@charset "UTF-8"; @charset "UTF-8";
/* CSS Document */ /* CSS Document */
.my_scroll { .my_scroll {

View File

@ -1,11 +1,23 @@
/*sidebar*/
#back_sidebar { .nav-list {
left: 0; padding: 0px 0px 100px 5px;
position: fixed;
top: 0;
width: 160px;
} }
.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 { #back_sidebar h1 {
background: url(<%= asset_path "h1_bg.png" %>) repeat-x scroll left top transparent; background: url(<%= asset_path "h1_bg.png" %>) repeat-x scroll left top transparent;
border-bottom: 1px solid #1B1B1B; border-bottom: 1px solid #1B1B1B;
@ -105,36 +117,35 @@
} }
#main-sidebar ul ul li a{ #main-sidebar ul ul li a{
padding: 10px 0 10px 20px; padding: 10px 0 10px 20px;
} }*/
#main-sidebar li:hover .quick-edit{ .with_action:hover .hide {
display: block; display: block;
} }
#main-sidebar .quick-edit { #main-sidebar .quick-edit {
background: none repeat scroll 0 0 #FFFFFF; background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #DDDDDD; border: 1px solid #DDDDDD;
border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px;
display: none; margin: 0 0 0 3px;
margin:-3px 0 0 3px; padding: 0;
padding: 3px;
z-index:1; z-index:1;
} position: absolute;
#main-sidebar .quick-edit:after{ left: -3px;
content: "."; width: 70px;
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-bottom: medium none;
border-radius: 5px 5px 5px 5px;
font-size:12px; font-size:12px;
float: left; margin: 0;
margin: 0 3px 0 0; padding: 3px 5px;
padding: 3px; }
#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 { #main-sidebar .quick-edit a:hover {
background: none repeat scroll 0 0 #EEEEEE; background-color: #DDDDDD;
border-bottom:none;
} }

View File

@ -1,3 +1,5 @@
/*site_assets*/
.assets_setup{ .assets_setup{
padding:42px 0 0 0; padding:42px 0 0 0;
} }

View File

@ -1,3 +1,5 @@
/*site_designs*/
.designs_setup{ .designs_setup{
padding:42px 0 0 0; padding:42px 0 0 0;
} }

View File

@ -5,6 +5,10 @@
*= require reset *= require reset
*= require_self *= require_self
*= require message *= require message
*= require bootstrap
*= require style
*= require bootstrap-orbit
*= require scroll_style
*= require site_items *= require site_items
*= require sidebar *= require sidebar
*/ */

View File

@ -1,3 +1,5 @@
/*site_items*/
html, body{ html, body{
height: 100%; height: 100%;
margin: 0; margin: 0;

View File

@ -1,3 +1,5 @@
/*style*/
@font-face{ @font-face{
font-family: 'WebSymbolsRegular'; font-family: 'WebSymbolsRegular';
src: url(<%= asset_path 'websymbols-regular-webfont.eot' %>); src: url(<%= asset_path 'websymbols-regular-webfont.eot' %>);
@ -8,7 +10,7 @@
} }
.login-logo { .login-logo {
text-indent: -9999px; 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; padding-top: 40px;
height: 160px; height: 160px;
} }
@ -59,8 +61,8 @@
margin-right: -20px; margin-right: -20px;
} }
#orbit-bar .search-query { #orbit-bar .search-query {
padding: 4px 9px; padding: 7px 9px 5px;
height: 12px; height: 10px;
margin-top: 3px; margin-top: 3px;
border: 1px solid #333333; border: 1px solid #333333;
font-size: 11px; font-size: 11px;
@ -108,6 +110,7 @@
padding:6px; padding:6px;
} }
#orbit-bar .nav > li.search { #orbit-bar .nav > li.search {
background-image: none;
overflow: hidden; overflow: hidden;
width: 28px; width: 28px;
position: relative; position: relative;
@ -116,7 +119,8 @@
background-position: -10px -10px; background-position: -10px -10px;
} }
#orbit-bar .nav > li > a.orbit-bar-desktop { #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 { #orbit-bar .nav > li > a.orbit-bar-member {
background-position: -4px -37px; background-position: -4px -37px;
@ -240,7 +244,7 @@
padding-right: 4px; padding-right: 4px;
border-right: 1px solid rgba(0,0,0,.2); border-right: 1px solid rgba(0,0,0,.2);
position:fixed; position:fixed;
top: 32px; top: 31px;
z-index: 88; z-index: 88;
} }
#main-sidebar .nav { #main-sidebar .nav {
@ -283,17 +287,18 @@
background-color: #FFF; background-color: #FFF;
margin-left:160px; margin-left:160px;
padding-top: 32px; padding-top: 32px;
padding-bottom: 18px; /*padding-bottom: 18px;*/
position: relative; position: relative;
min-height: 100%; padding-bottom: 45px;
/*min-height: 100%;*/
} }
#main-wrap > .form-actions { /*#main-wrap > .form-actions {
background-color: #FFF; background-color: #FFF;
text-align: center; text-align: center;
padding: 17px 20px 0; padding: 17px 20px 0;
margin: 0; margin: 0;
border-top: none; border-top: none;
} }*/
#main-wrap .subnav { #main-wrap .subnav {
height: auto; height: auto;
min-height: 36px; min-height: 36px;
@ -321,6 +326,9 @@
font-size: 12px; font-size: 12px;
color: #999; color: #999;
} }
.form-actions .btn {
margin-bottom: 0;
}
#sub-wiget { #sub-wiget {
clear: right; clear: right;
float: right; float: right;
@ -339,7 +347,7 @@
text-align: right; text-align: right;
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
margin-bottom: 0; margin-bottom: -50px;
clear: both; clear: both;
} }
#poststuff form { #poststuff form {
@ -371,7 +379,7 @@
#post-body .editor { #post-body .editor {
} }
#post-body-content { #post-body-content {
margin-right: 320px; /*margin-right: 320px;*/
padding: 8px 0 8px 6px; padding: 8px 0 8px 6px;
} }
.filter .accordion-heading > a:hover { .filter .accordion-heading > a:hover {
@ -563,7 +571,9 @@
padding: 5px; padding: 5px;
} }
.popover-content { .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; padding: 5px;
} }
.popover-title { .popover-title {
@ -605,6 +615,43 @@
.text-green { .text-green {
color: #39b54a !important; 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-"] { [class^="icons-"] {
display: inline-block; display: inline-block;
width: 16px; width: 16px;
@ -893,5 +940,5 @@
} }
/*21*/ /*21*/
.icons- { .icons- {
background-position: -0px -640px; background-position: -0px -640px
} }

View File

@ -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;
}

View File

@ -1,3 +1,6 @@
/*Widget*/
.widget-size-300 { .widget-size-300 {
width:298px; width:298px;
} }
@ -81,7 +84,7 @@
border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0;
text-align: left; text-align: left;
margin: 0; margin: 0;
width: 182px; width: 193px;
} }
.file-upload .upload { .file-upload .upload {
margin:0; margin:0;
@ -92,12 +95,24 @@
opacity:.0; opacity:.0;
font-size: 60px; font-size: 60px;
left: -595px/9; left: -595px/9;
filter: alpha(opacity: 0); filter: alpha(opacity= 0);
outline: none; outline: none;
} }
.file-upload .upload:focus { .file-upload .upload:focus {
position:absolute; 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 { .upload-picture {
margin-bottom: 5px; margin-bottom: 5px;
text-align: center; text-align: center;
@ -117,12 +132,6 @@
margin : 0px 0 5px; margin : 0px 0 5px;
padding: 5px 10px; padding: 5px 10px;
} }
.file-upload .input-medium {
border-radius: 3px 3px 3px 3px !important;
width: 267px;
position: relative;
z-index: 5;
}
#widget-link table { #widget-link table {
margin-bottom:0 margin-bottom:0
} }

View File

@ -1,7 +1,7 @@
class Admin::AdBannersController < ApplicationController class Admin::AdBannersController < OrbitBackendController
layout "new_admin" layout "new_admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :for_app_manager
def destroy def destroy
@ad_banner = AdBanner.find(params[:id]) @ad_banner = AdBanner.find(params[:id])
@ -22,9 +22,14 @@ class Admin::AdBannersController < ApplicationController
def create def create
@ad_banner = AdBanner.new(params[:ad_banner]) @ad_banner = AdBanner.new(params[:ad_banner])
@ad_banner.save if @ad_banner.save
redirect_to admin_ad_banners_url @active = @ad_banner
respond_to do |format|
format.js {render 'new_created_node'}
end
else
render 'create_error_msg'
end
end end
def edit def edit
@ -39,8 +44,9 @@ class Admin::AdBannersController < ApplicationController
redirect_to admin_ad_banners_url redirect_to admin_ad_banners_url
end 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 end
def index def index

View File

@ -19,6 +19,8 @@ class Admin::AdImagesController < ApplicationController
def new def new
@ad_image =AdImage.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} #render :action => 'new',:url=> {:ad_banner_id => params.has_key?(:ad_banner_id)? params[:ad_banner_id],nil}
end end

View File

@ -2,7 +2,7 @@ class Admin::DashboardsController < ApplicationController
layout "new_admin" layout "new_admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? # before_filter :is_admin?
def index def index
end end

View File

@ -1,4 +1,4 @@
class Admin::DesignsController < ApplicationController class Admin::DesignsController < OrbitBackendController
require "net/http" require "net/http"
require "uri" require "uri"
require 'zip/zip' require 'zip/zip'
@ -6,6 +6,7 @@ class Admin::DesignsController < ApplicationController
layout "new_admin" layout "new_admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :is_admin?
before_filter :for_admin_only
def upload_package def upload_package
if !params[:design].nil? if !params[:design].nil?
@ -24,7 +25,7 @@ class Admin::DesignsController < ApplicationController
end end
def index def index
@designs = Design.all.entries @designs = params[:sort] ? get_sorted_and_filtered("designs") : Design.all
end end
def new def new
@ -84,6 +85,13 @@ class Admin::DesignsController < ApplicationController
end end
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 protected
def unzip_design(file, zip_name) def unzip_design(file, zip_name)

View File

@ -2,7 +2,7 @@ class Admin::ModuleAppsController < ApplicationController
before_filter :user_has_manager_privilege?, :only => [ :assign_manager, :remove_manager ] 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 ] before_filter :user_has_sub_manager_privilege?, :only => [ :assign_sub_manager, :remove_sub_manager ]
layout "admin" layout "new_admin"
def index def index
@module_apps = ModuleApp.all.entries @module_apps = ModuleApp.all.entries

View File

@ -1,6 +1,6 @@
class Admin::ObjectAuthsController < ApplicationController class Admin::ObjectAuthsController < ApplicationController
include OrbitCoreLib::PermissionUnility include OrbitCoreLib::PermissionUnility
layout "admin" layout "new_admin"
before_filter :force_order before_filter :force_order
# before_filter :is_admin? ,:only => :index # before_filter :is_admin? ,:only => :index

View File

@ -25,10 +25,12 @@ class Admin::PagePartsController < ApplicationController
@module_apps = ModuleApp.all(:conditions => {:enable_frontend => true}) @module_apps = ModuleApp.all(:conditions => {:enable_frontend => true})
@module_app = @part.module_app ? @part.module_app : @module_apps[0] @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 @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 case @module_app.key
when 'bulletin' when 'announcement'
@categories = BulletinCategory.all @categories = BulletinCategory.all
when 'news'
@categories = NewsBulletinCategory.all
when 'web_resource' when 'web_resource'
@categories = WebLinkCategory.all @categories = WebLinkCategory.all
end end
@ -66,11 +68,13 @@ class Admin::PagePartsController < ApplicationController
@categories =[] @categories =[]
@module_app = ModuleApp.find(params[:id]) @module_app = ModuleApp.find(params[:id])
unless (@module_app.category.nil? rescue true) case @module_app.key
@module_app.category.each do |category| when 'announcement'
@categories << eval(category).all.entries @categories = BulletinCategory.all
end when 'news'
@categories.flatten! @categories = NewsBulletinCategory.all
when 'web_resource'
@categories = WebLinkCategory.all
end end
respond_to do |format| respond_to do |format|
@ -78,4 +82,12 @@ class Admin::PagePartsController < ApplicationController
end end
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 end

View File

@ -31,7 +31,18 @@ class Admin::PagesController < ApplicationController
@designs = Design.all.entries @designs = Design.all.entries
@design = @item.design ? @item.design : @designs.first @design = @item.design ? @item.design : @designs.first
@app_frontend_urls = @item.module_app.app_pages if @item.module_app @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 end
def create def create

View File

@ -1,16 +1,48 @@
class Admin::SitesController < ApplicationController class Admin::SitesController < ApplicationController
layout "admin" layout "new_admin"
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :is_admin? before_filter :is_admin?
before_filter :get_site
def index # def index
@site = Site.first # @site = Site.first
redirect_to :action => :new unless @site # # redirect_to :action => :new unless @site
# end
# def new
# @site = Site.new
# end
def update
@site.update_attributes(params[:site])
redirect_to :back
end end
def new def site_info
@site = Site.new
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
end end

View File

@ -39,15 +39,65 @@ class ApplicationController < ActionController::Base
@parent_item = Item.first(:conditions => { :id => BSON::ObjectId(params[:parent_id]) }) rescue nil @parent_item = Item.first(:conditions => { :id => BSON::ObjectId(params[:parent_id]) }) rescue nil
end end
def auth_failed_in_backend
#redirect_to admin_dashboards_url
redirect_to root_path
end
# Check if the current_user is admin # Check if the current_user is admin
def 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 end
# Render the page # Render the page
def render_page(id = nil) def render_page(param={})
if @item if @item
render :text => process_page(@item, id), :layout => 'page_layout' render :text => process_page(@item, param[:id], param), :layout => 'page_layout'
else else
render :text => '404 Not Found' render :text => '404 Not Found'
end end
@ -78,8 +128,8 @@ class ApplicationController < ActionController::Base
# set site if exist or create site # set site if exist or create site
@site = Site.first || Site.create({:valid_locales => [], :in_use_locales => []}) @site = Site.first || Site.create({:valid_locales => [], :in_use_locales => []})
session[:site] = @site.id session[:site] = @site.id
@site_in_use_locales = @site.in_use_locales @site_in_use_locales = site_locales_default_head(@site.in_use_locales)
@site_valid_locales = @site.valid_locales @site_valid_locales = site_locales_default_head(@site.valid_locales)
end end
def set_current_item def set_current_item
@ -114,4 +164,14 @@ class ApplicationController < ActionController::Base
end end
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 end

View File

@ -22,8 +22,136 @@ class OrbitBackendController< ApplicationController
def check_user_can_use def check_user_can_use
unless check_permission 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
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 end

View File

@ -16,10 +16,10 @@ class PagesController < ApplicationController
def show def show
#begin #begin
@item = Item.first(:conditions => {:full_name => params[:page_name]}) @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 case @item._type
when 'Page' when 'Page'
render_page(params[:id]) render_page(params)
when 'Link' when 'Link'
redirect_to "http://#{@item[:url]}" redirect_to "http://#{@item[:url]}"
end end
@ -33,14 +33,16 @@ class PagesController < ApplicationController
def index_from_link def index_from_link
if params[:page] 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 else
redirect_to "/#{@item.full_name}" redirect_to "/#{@item.full_name}?category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}"
end end
end end
def show_from_link 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 end
def load_orbit_bar def load_orbit_bar
@ -51,11 +53,11 @@ class PagesController < ApplicationController
def get_item def get_item
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]}) module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
if params[:category_id] # if params[:category_id]
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id]}) # @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id]})
else # else
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]}) @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]})
end # end
end end
end end

View File

@ -1,7 +1,3 @@
module Admin::AdImagesHelper module Admin::AdImagesHelper
def active_when_default_locale_eq locale
locale.to_sym == I18n.default_locale ? 'active': ''
end
end end

View File

@ -9,29 +9,34 @@ module Admin::ItemHelper
when 'Link' when 'Link'
dest = admin_link_path(node) dest = admin_link_path(node)
end end
ret << "<ul class='list'>" ret << "<ul>" unless node.parent.nil?
ret << "<li>" ret << "<li>"
ret << "<div class='with_action'>"
ret << (link_to node.i18n_variable[I18n.locale], dest) ret << (link_to node.i18n_variable[I18n.locale], dest)
ret << "<div class='quick-edit'>" ret << "<div class='quick-edit hide'>"
ret << (link_to t('admin.edit'), eval("edit_admin_#{node._type.downcase}_path(node)")) if node._type.eql?('Page') ret << (link_to t('admin.edit'), eval("edit_admin_#{node._type.downcase}_path(node)")) if node._type.eql?('Page')
ret << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page') if node._type.eql?('Page') ret << (link_to t('admin.new_page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page') if node._type.eql?('Page')
ret << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link') if node._type.eql?('Page') ret << (link_to t('admin.new_link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link') if node._type.eql?('Page')
ret << (link_to t(:delete), eval("delete_admin_#{node._type.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete') ret << (link_to t(:delete), eval("delete_admin_#{node._type.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete')
ret << "</div>" ret << "</div>"
ret << "</li>" ret << "</div>"
ret << render_children(node) ret << render_children(node)
ret << "</ul>" ret << "</li>"
ret << "</ul>" unless node.parent.nil?
end end
ret.html_safe ret.html_safe
end end
def render_children(parent) def render_children(parent)
if children = parent.children children = parent.ordered_children
if !children.entries.blank?
ret = '' ret = ''
children.each do |child| children.each do |child|
ret << render_node_and_children(child) ret << render_node_and_children(child)
end end
ret ret
else
''
end end
end end

View File

@ -14,6 +14,7 @@ module Admin::ModuleAppHelper
end end
def get_auth_by(manager_obj) 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
end end

View File

@ -2,12 +2,6 @@ module ApplicationHelper
FLASH_NOTICE_KEYS = [:error, :notice, :warning] 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) def colorize_in_use_locale(locale)
@site_in_use_locales.include?(locale)? 'green' : 'red' @site_in_use_locales.include?(locale)? 'green' : 'red'
end end
@ -74,78 +68,90 @@ module ApplicationHelper
end end
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) 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 end
def visible_for_controllers(*controller_names) 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 end
def active_for_action(controller_name, action_name) 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 ((controller.controller_name.eql?(controller_name) || request.fullpath.eql?(controller_name)) && controller.action_name.eql?(action_name)) ? 'active' : nil
end end
def sortable(column) def process_page(page, id, params)
direction = (column == params[:sort] && params[:direction] == "asc") ? "desc" : "asc" parse_page_noko(page, id, params)
{: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)
end end
def page_metas(page) def page_metas(page)
tmp_meta = {}
metas = '' metas = ''
@site.page_metas.each do |meta| @site.site_metas.each do |meta|
name, content = meta.get_name_content name, content = meta.get_name_content
metas << "<meta name=#{name} content=#{content} />\n" tmp_meta.merge!(name => content)
end rescue nil 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 << "<meta name='#{name}' content='#{content}' />\n"
} if !tmp_meta.blank?
metas
end end
def page_title(page) def page_title(page)
"<title>#{page.title ? page.title[I18n.locale] : page.i18n_variable[I18n.locale]}</title>\n" res = "<title>"
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 << "</title>\n"
end end
def page_stylesheets(page) def page_stylesheets(page, edit=nil)
stylesheets = '' stylesheets = ''
stylesheets << "<link href='/assets/bootstrap.css.erb' rel='stylesheet' type='text/css' />\n" unless edit
stylesheets << "<link href='/assets/bootstrap.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='/assets/bootstrap-orbit.css' rel='stylesheet' type='text/css' />\n" stylesheets << "<link href='/assets/bootstrap-orbit.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='/assets/style.css.erb' rel='stylesheet' type='text/css' />\n" stylesheets << "<link href='/assets/style.css' rel='stylesheet' type='text/css' />\n"
end
stylesheets << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.reset_css stylesheets << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.reset_css
# stylesheets << "<link href='/assets/menu.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.default_css stylesheets << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.default_css
theme = page.design.themes.detect{ |d| d.id == page.theme_id } theme = page.design.themes.detect{ |d| d.id == page.theme_id }
stylesheets << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />\n" if theme stylesheets << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />\n" if theme
stylesheets stylesheets
end end
def page_javascripts(page) def page_javascripts(page, edit=nil)
javascripts = '' javascripts = ''
unless edit
javascripts << "<script type='text/javascript' src='/static/jquery.js'></script>\n" javascripts << "<script type='text/javascript' src='/static/jquery.js'></script>\n"
javascripts << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>\n"
javascripts << "<script type='text/javascript' src='/static/kernel.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/bootstrap.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/bootstrap.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/jquery.tinyscrollbar.min.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/jquery.tinyscrollbar.min.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/jquery.isotope.min.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/jquery.isotope.min.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-member.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/orbit-bar-member.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"
end
javascripts << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>\n"
javascripts << "<script type='text/javascript' src='/static/kernel.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/event.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/event.js'></script>\n"
page.design.javascripts.each do |js| page.design.javascripts.each do |js|
# javascripts << "<script type='text/javascript' src='#{js.file.url}'></script>" # javascripts << "<script type='text/javascript' src='#{js.file.url}'></script>"
@ -153,4 +159,8 @@ module ApplicationHelper
javascripts javascripts
end end
def active_when_current_locale_eq(locale)
locale.to_sym == I18n.locale ? 'active in': ''
end
end end

View File

@ -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

15
app/jobs/fetch_time.rb Normal file
View File

@ -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

View File

@ -0,0 +1,8 @@
class NccuCalendar
@queue = :high
def self.perform()
# sleep 10
puts "NccuCalendar Sync"
end
end

9
app/jobs/sync_db.rb Normal file
View File

@ -0,0 +1,9 @@
class SyncDb
@queue = :high
def self.perform()
# sleep 10
puts "DB Sync"
end
end

8
app/mailer/cron_mail.rb Normal file
View File

@ -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 <matt@rulingcom.com>", :subject => msg)
end
end

View File

@ -4,16 +4,29 @@ class AdBanner
include Mongoid::MultiParameterAttributes include Mongoid::MultiParameterAttributes
field :title field :title
field :transition_sec,type: Integer field :transition_msec,type: Integer
field :ad_fx #TODO Design should explain field :ad_fx #TODO Design should explain
before_save :save_or_destroy before_save :save_or_destroy
validates_uniqueness_of :title validates_uniqueness_of :title
validates :title , :length => { :minimum => 2 }
has_many :ad_images , dependent: :delete 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"] 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) # def new_ad_images(*attrs)
# debugger # debugger
# a=1 # a=1

View File

@ -24,16 +24,15 @@ class AdImage
# validates_numericality_of :weight, greater_than_or_equal_to: 1,less_than_or_equal_to: 10 # 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_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 attr_reader :parse_post_date,:parse_unpost_date
def parse_post_date=(att) def parse_post_date=(att)
self.post_date = (Date.parse att rescue nil) self.post_date = (Date.parse att.gsub(/\s+/, "") rescue nil)
end end
def parse_unpost_date=(att) def parse_unpost_date=(att)
self.unpost_date = (Date.parse att rescue nil) self.unpost_date = (Date.parse att.gsub(/\s+/, "") rescue nil)
end end
def display? def display?

View File

@ -3,10 +3,10 @@ class Design
include Mongoid::Timestamps include Mongoid::Timestamps
include ParserLayout include ParserLayout
field :title field :title, :type => String
field :author field :author, :type => String
field :intro field :intro, :type => String
field :version field :version, :type => String
has_many :pages has_many :pages

View File

@ -7,6 +7,8 @@ class Item
field :full_name, :index => true field :full_name, :index => true
field :position, :type => Integer field :position, :type => Integer
field :is_published, :type => Boolean, :default => false, :index => true 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_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
validates :name, :exclusion => { :in => LIST[:forbidden_item_names] } validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
@ -36,6 +38,21 @@ class Item
urls.join("/") urls.join("/")
end 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 protected
def setup_default_value def setup_default_value

View File

@ -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

View File

@ -8,4 +8,12 @@ class Meta
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy 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 end

View File

@ -7,7 +7,7 @@ class PagePart
field :content field :content
field :kind field :kind
field :public_r_tag 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 field :widget_path
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy

View File

@ -1,5 +1,7 @@
class Site class Site
METAS = ['description', 'keywords']
include Mongoid::Document include Mongoid::Document
include Mongoid::Timestamps include Mongoid::Timestamps
@ -9,12 +11,17 @@ class Site
field :roaming_id field :roaming_id
field :private_key, :type => Binary field :private_key, :type => Binary
field :public_key, :type => Binary field :public_key, :type => Binary
field :title_always_on, :type => Boolean, :default => false
field :school field :school
field :department 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 has_many :site_metas, :autosave => true, :dependent => :destroy
before_save :set_key
def generate_keys def generate_keys
private_key = OpenSSL::PKey::RSA.generate(2048) private_key = OpenSSL::PKey::RSA.generate(2048)
self.public_key = private_key.public_key.to_s self.public_key = private_key.public_key.to_s
@ -31,4 +38,34 @@ class Site
res.eql?('local out of date') ? false : true res.eql?('local out of date') ? false : true
end 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 end

View File

@ -1,19 +1,27 @@
<script type="text/javascript" src="/static/jquery.cycle.all.latest.js"></script> <div class="tab-pane fade <%= "active in" if ad_banner_tab==@active%>" id=<%= ad_banner_tab.title.dehumanize %>>
<div class="tab-pane <%= "active" if ad_banner_tab==@active %>" id=<%= ad_banner_tab.title %>>
<p>尺寸:</p>
<%= form_for ad_banner_tab,:url=> admin_ad_banner_path(ad_banner_tab),:method => :put,:class=>"input-medium" do |f| -%> <%= form_for ad_banner_tab,:url=> admin_ad_banner_path(ad_banner_tab),:method => :put,:class=>"input-medium" do |f| -%>
<div class="adbanner-setup well">
<!--<p><%#= t("admin.ad.banner_best_size") %></p>-->
<%= f.label :ad_fx, t('admin.ad.ab_fx') %> <%= f.label :ad_fx, t('admin.ad.ab_fx') %>
<%= f.select :ad_fx ,AdBanner::FX_TYPES %> <%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<%= f.label :transition_sec, t('admin.ad.transition_sec') %> <%= 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.text_field :transition_sec,:placeholder=>t('admin.ad.sec_place_holder'),:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %>
<%= f.submit %> <br>
<%= f.submit 'Cancel',:type=>'reset' %> <%= f.submit t("admin.ad.update_banner"), :class => 'btn' %>
<div> <%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %>
</div>
<h3>圖片列表</h3>
<div class="adbanner-list">
<div class="adbanner-action">
<%= 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'%>
</div>
<ul class="clear">
<%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %> <%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %>
</ul>
<%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %> <%#= 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) %>
</div> </div>
<% end -%> <% end -%>
<%= render :partial => 'preview_block',:locals=> {:ad_banner =>ad_banner_tab} %> <%#= render :partial => 'preview_block',:locals=> {:ad_banner =>ad_banner_tab} %>
</div> </div>

View File

@ -1,12 +1,11 @@
<li class="span3"> <li class="span3">
<%= image_tag ad_image.file rescue nil%> <%= image_tag ad_image.file rescue nil%>
<p> <p>
<%= 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'}" %> <%= "#{ad_image.post_date ||'NeedReset' }~#{ad_image.unpost_date || 'NeedReset'}" %>
</p> </p>
<p> <p>
<%= link_to 'Edit',edit_admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn btn-primary' %> <%= link_to t('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('delete'),admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn',:method => :delete,:confirm => t('sure?') %>
</p> </p>
</li> </li>

View File

@ -1,10 +1,10 @@
<div id="new-a-banner" class="modal fade in tab-pane <%= 'active' if @active.nil? %>"> <div id="new-a-banner" class="modal fade <%= 'active' if @active.nil? %>">
<%= form_for(:ad_banner,:remote => true, :url => admin_ad_banners_path) do |f| %> <%= form_for(:ad_banner,:remote => true, :url => admin_ad_banners_path) do |f| %>
<div class="modal-header"> <div class="modal-header">
<a class="close" data-dismiss="modal">×</a> <a class="close" data-dismiss="modal">×</a>
<h3>Add AdBanner</h3> <h3><%= t("admin.ad.new_banner") %></h3>
</div> </div>
<div class="modal-body form-horizontal"> <div class="modal-body form-horizontal">
@ -28,28 +28,11 @@
<%= f.select :ad_fx ,AdBanner::FX_TYPES %> <%= f.select :ad_fx ,AdBanner::FX_TYPES %>
</div> </div>
</div> </div>
</div>
<div class="modal-footer"> <div class="modal-footer">
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), :class=>'btn btn-primary',:remote=>true %>
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a> <a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
</div> </div>
<% end %> <% end %>
</div> </div>
<script type="text/javascript" charset="utf-8">
if(window.location.pathname == "/admin/ad_banners/new"){
$('#new-a-banner').modal({show: true});
}
$('#new_ad_banner_tab_but').on('shown', function (e) {
$('#new-a-banner').modal({show: true});
})
$('#new-a-banner').on('shown', function (e) {
alert('show!');
})
$('#new-a-banner').on('hidden', function (e) {
$(".nav.nav-tabs a[id!='new_ad_banner_tab_but']:last").tab('show');
})
</script>

View File

@ -0,0 +1,36 @@
<% if ad_banner -%>
<div class="modal hide fade in banner-preview" id="slideshow-<%=ad_banner.title.dehumanize%>">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3><%= t("modal.preview") %></h3>
</div>
<div class="modal-body">
<p class="ad_banner_slideshow">
<% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%>
<%= image_tag ad_image.file,:alt => (ad_image.title[locale] || " "),:time_to_next => ad_banner.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || " ")) %>
<% end -%>
</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal"><%= t("modal.close") %></a>
</div>
<div>
<script type="text/javascript" src="/static/kernel.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#slideshow-<%=ad_banner.title.dehumanize%>").on("show", function () {
$("#slideshow-<%=ad_banner.title.dehumanize%>").find(".ad_banner_slideshow").cycle({delay: -1000, fx: "<%= ad_banner.ad_fx.nil?? "fade": ad_banner.ad_fx %>", timeoutFn: getTimeout });
});
$(".modal").on("hidden", function () {
$("#show_preview").remove();
});
});
</script>
</div>
</div>
<% end -%>

View File

@ -9,7 +9,7 @@
<div class="modal-body"> <div class="modal-body">
<p class="ad_banner_slideshow"> <p class="ad_banner_slideshow">
<% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%> <% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%>
<%= image_tag ad_image.file,:alt => (ad_image.title[locale] || ' '),:time_to_next => ad_banner.transition_sec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || ' ')) %> <%= image_tag ad_image.file,:alt => (ad_image.title[locale] || ' '),:time_to_next => ad_banner.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || ' ')) %>
<% end -%> <% end -%>
</p> </p>
</div> </div>
@ -23,7 +23,7 @@
<script type='text/javascript' src='/static/kernel.js'></script> <script type='text/javascript' src='/static/kernel.js'></script>
<script type='text/javascript'> <script type='text/javascript'>
$('#slideshow-<%=ad_banner.title.dehumanize%>').on('show', function () { $('#slideshow-<%=ad_banner.title.dehumanize%>').on('show', function () {
$('#slideshow-banner_1').find(".ad_banner_slideshow").cycle({delay: -1000, fx: '<%= ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx %>', timeoutFn: getTimeout }); $('#slideshow-<%=ad_banner.title.dehumanize%>').find(".ad_banner_slideshow").cycle({delay: -1000, fx: '<%= ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx %>', timeoutFn: getTimeout });
}); });
</script> </script>

View File

@ -0,0 +1 @@
alert("Error occures:<%= @ad_banner.errors.full_messages%>");

View File

@ -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 -%>
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<ul class="nav nav-tabs"> <ul id="banner_tab" class="nav nav-tabs">
<% @ad_banners.each do |ab| %> <% @ad_banners.each do |ab| %>
<%= content_tag :li,link_to(ab.title,"##{ab.title}",:data=>{:toggle=>"tab"}),:class => (ab == @active ? 'active' : nil ) %> <%= content_tag :li,link_to(ab.title,"##{ab.title.dehumanize}",:data=>{:toggle=>"tab"}),:class => (ab == @active ? 'active' : nil ) %>
<% end -%> <% end -%>
<%= content_tag :li,link_to('New',"#new-a-banner",:data=>{:toggle=>"tab"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) %> <%= content_tag :li,link_to(t("admin.ad.new_banner"),"#new-a-banner",:data=>{:toggle=>"modal"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) %>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<%= render :partial => 'ad_banner_tab',:collection => @ad_banners %> <%= render :partial => 'ad_banner_tab',:collection => @ad_banners %>
<%= render :partial => "modal_ad_banner_form"%>
</div> </div>
<%= render :partial => "modal_ad_banner_form"%>
</div> </div>

View File

@ -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");

View File

@ -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%>"

View File

@ -3,7 +3,11 @@
<% end %> <% end %>
<% content_for :page_specific_javascript do %> <% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/datepicker" %> <%= 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 %> <% end %>
@ -20,8 +24,8 @@
<div id="calendarRange"> <div id="calendarRange">
<div class="input-append"> <div class="input-append">
<span class="showDate"></span><span class="add-on btn">▼</span> <span class="showDate"></span><span class="add-on btn">▼</span>
<%= f.hidden_field :parse_post_date %> <%= f.hidden_field :parse_post_date,:value => @ad_image.post_date.strftime('%Y / %m / %d') %>
<%= f.hidden_field :parse_unpost_date%> <%= f.hidden_field :parse_unpost_date,:value => @ad_image.unpost_date.strftime('%Y / %m / %d')%>
</div> </div>
<div id="widgetCalendar"> <div id="widgetCalendar">
@ -74,41 +78,16 @@
<div class="control-group"> <div class="control-group">
<div class="upload-picture"> <div class="upload-picture">
<!--請程式務必將圖片尺寸加入到行內裡--> <!--請程式務必將圖片尺寸加入到行內裡-->
<%= image_tag @ad_image.file,:width=> "456",:height=>'700' rescue ''%> <%= image_tag @ad_image.file rescue ''%>
<script type="text/javascript">
var picH = $('.upload-picture').width()/$('.upload-picture').find('img').attr("width")*$('.upload-picture').find('img').attr("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);
});
});
</script>
</div> </div>
<span class="alert widgetInfo">此區塊圖片尺寸請使用580px × 225px</span> <span class="alert widgetInfo">此區塊圖片尺寸請使用580px × 225px</span>
<div class="controls file-upload input-prepend"> <div class="controls file-upload input-prepend">
<label class="control-label add-on btn" for="input-upload"> <label class="control-label add-on btn" for="input-upload">
Choose file <%= t(:browse) %>
<%= f.file_field :file,:id=>"input-upload",:class => "upload", :onchange=> "document.getElementById('fu1').innerHTML = this.form.fu1.value = this.value;" %> <%= f.file_field :file,:id=>"input-upload",:class => "upload", :onchange=> "document.getElementById('fu1').innerHTML = this.form.fu1.value = this.value;" %>
</label> </label>
<span id="fu1" class="file-name"></span> <span id="fu1" class="file-name"></span>
<br> <br>
<input name="fu1" class="input-medium" type="text"> <input name="fu1" class="input-medium" type="text">
</div> </div>
</div> </div>
@ -151,14 +130,14 @@
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<% site_valid_locales_default_head.each do |locale|%> <% @site_valid_locales.each do |locale|%>
<%= content_tag :li,link_to(I18nVariable.from_locale(locale),"##{locale}",:data=>{:toggle => "tab"}),:class=> (active_when_default_locale_eq locale) %> <%= content_tag :li,link_to(I18nVariable.from_locale(locale),"##{locale}",:data=>{:toggle => "tab"}),:class=> (active_when_current_locale_eq locale) %>
<% end %> <% end %>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title",params[:ad_banner_id]) , :class=>"input-medium", %> <%= 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|%> <% @site_valid_locales.each do |locale|%>
<%= content_tag :div,:class => "tab-pane #{active_when_default_locale_eq locale}",:id=>"#{locale}" do%> <%= content_tag :div,:class => "tab-pane #{active_when_current_locale_eq locale}",:id=>"#{locale}" do%>
<div class="title"> <div class="title">
<%= f.fields_for :title,@ad_image.title do |f| %> <%= f.fields_for :title,@ad_image.title do |f| %>
<%= f.text_field locale,:class=>"ad_image-title post-title",:placeholder => "輸入標題"%> <%= f.text_field locale,:class=>"ad_image-title post-title",:placeholder => "輸入標題"%>
@ -167,7 +146,7 @@
<br/> <br/>
<div class="context editor"> <div class="context editor">
<%= f.fields_for :context, @ad_image.context do |f| %> <%= 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 %> <% end %>
</div> </div>
@ -178,9 +157,9 @@
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
<button class="btn btn-success" type="submit">Preview/預覽</button> <%#= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(@ad_image.ad_banner.title) ,:class=>"preview_trigger btn btn-success" rescue nil%>
<button class="btn btn-primary" type="submit">Submit/送出</button> <%= f.submit t("submit"),:class=>"btn btn-primary" %>
<button class="btn" type="reset">Cancel/取消</button> <%= f.submit t("cancel"),:class=>"btn ",:type => 'reset' %>
</div> </div>
</div> </div>
<!--Post End--> <!--Post End-->

View File

@ -9,7 +9,7 @@
<%= link_back %> <%= link_back %>
<%= f.submit t(:edit) %> <%= f.submit t(:edit) %>
<% else %> <% else %>
<a id='submit_button'><%= t(:edit) %></a> <a id='ajax_form_submit'><%= t(:edit) %></a>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>

View File

@ -9,7 +9,7 @@
<%= link_back %> <%= link_back %>
<%= f.submit t(:create) %> <%= f.submit t(:create) %>
<% else %> <% else %>
<a id='submit_button' class="new"><%= t(:create) %></a> <a id='ajax_form_submit' class="new"><%= t(:create) %></a>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>

View File

@ -1,21 +1,21 @@
<div id="open_for_all_user"> <div id="open_for_all_user">
<h1>All User</h1> <h1><%= t("admin.user_role.auth.all_member") %></h1>
<%= form_tag(submit_url) do %> <%= form_tag(submit_url) do %>
<%= check_box_tag 'auth_all',true,(auth.all rescue true) %><%= submit_tag 'Add Role' %><br/> <%= check_box_tag 'auth_all',true,(auth.all rescue true) %><%= submit_tag t("admin.user_role.auth.all_member") %><br/>
<% end %> <% end %>
</div> </div>
<div id="user_role_management"> <div id="user_role_management">
<h1>User Role</h1> <h1><%= t("admin.user_role.auth.user") %></h1>
<%= form_tag(submit_url) do %> <%= form_tag(submit_url) do %>
<%= collection_select(:new,:role, Role.all, :id, :key, :prompt => true) %> <%= collection_select(:new,:role, Role.all, :id, :key, :prompt => true) %>
<%= submit_tag 'Add Role' %><br/> <%= submit_tag t("admin.user_role.auth.by_role") %><br/>
<%= collection_select(:new,:sub_role, SubRole.all, :id, :key, :prompt => true) %> <%= collection_select(:new,:sub_role, SubRole.all, :id, :key, :prompt => true) %>
<%= submit_tag 'Add SubRole' %><br/> <%= submit_tag t("admin.user_role.auth.by_sub_role") %><br/>
<%= collection_select(:new,:privilege_user, User.all, :id, :name, :prompt => true) %> <%= collection_select(:new,:privilege_user, User.all, :id, :name, :prompt => true) %>
<%= submit_tag 'Add PrivilegeList' %><br/> <%= submit_tag t("admin.user_role.auth.add_to_privilege_list") %><br/>
<%= collection_select(:new,:blocked_user, User.all, :id, :name, :prompt => true) %> <%= collection_select(:new,:blocked_user, User.all, :id, :name, :prompt => true) %>
<%= submit_tag 'Add BlockedList' %><br/> <%= submit_tag t("admin.user_role.auth.add_to_block_list") %><br/>
<% end %> <% end %>
<% unless auth.nil? %> <% unless auth.nil? %>
<% auth.roles.each do |role| %> <% auth.roles.each do |role| %>

View File

@ -1,197 +1,16 @@
<div id="isotope"> <div id="isotope">
<div class="item element"> <div class="item element">
<h3><i class="icons-member"></i><a href="">Member</a></h3> <h3><i class="icons-content"></i><a href=""><%= t(:content) %></a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-content"></i><a href="">Content</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-asset"></i><a href="">Asset</a></h3>
<div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href="">Traffic</a></h3>
<div class="detail w-a h-b"> <div class="detail w-a h-b">
<p class="totle"><span>Quantity</span>9,517</p> <p class="totle"><span><%= t(:all_content) %></span>9,517</p>
<table class="table table-striped">
<thead>
<tr>
<th><%= t(:module) %></th>
<th class="span2"><%= t(:quantity) %></th>
</tr>
</thead>
</table>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">
<div class="track"> <div class="track">
@ -205,128 +24,44 @@
<table class="table table-striped"> <table class="table table-striped">
<tbody> <tbody>
<tr> <tr>
<td>University</td> <td>公告</td>
<td>2,304</td> <td class="span2">2,304</td>
</tr> </tr>
<tr> <tr>
<td>Master</td> <td>新聞</td>
<td>783</td> <td class="span2">783</td>
</tr> </tr>
<tr> <tr>
<td>Doctor</td> <td>連結</td>
<td>45</td> <td class="span2">45</td>
</tr> </tr>
<tr> <tr>
<td>Staff</td> <td>連結</td>
<td>62</td> <td class="span2">62</td>
</tr> </tr>
<tr> <tr>
<td>Teacher</td> <td>連結</td>
<td>52</td> <td class="span2">52</td>
</tr> </tr>
<tr> <tr>
<td>Professor</td> <td>新聞</td>
<td>20</td> <td class="span2">20</td>
</tr> </tr>
<tr> <tr>
<td>Assistant Professor</td> <td>公告</td>
<td>41</td> <td class="span2">41</td>
</tr> </tr>
<tr> <tr>
<td>Substitute teacher</td> <td>公告</td>
<td>37</td> <td class="span2">37</td>
</tr> </tr>
<tr> <tr>
<td>Lecturer</td> <td>公告</td>
<td>41</td> <td class="span2">41</td>
</tr> </tr>
<tr> <tr>
<td>Part-time teacher</td> <td>公告</td>
<td>20</td> <td class="span2">20</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -336,72 +71,17 @@
</div> </div>
</div> </div>
<div class="item element"> <div class="item element">
<h3><i class="icons-"></i><a href="">Site info</a></h3> <h3><i class="icons-member"></i><a href=""><%= t(:member) %></a></h3>
<div class="detail w-b h-a">
<p class="totle"><span>Quantity</span>9,517</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>University</td>
<td>2,304</td>
</tr>
<tr>
<td>Master</td>
<td>783</td>
</tr>
<tr>
<td>Doctor</td>
<td>45</td>
</tr>
<tr>
<td>Staff</td>
<td>62</td>
</tr>
<tr>
<td>Teacher</td>
<td>52</td>
</tr>
<tr>
<td>Professor</td>
<td>20</td>
</tr>
<tr>
<td>Assistant Professor</td>
<td>41</td>
</tr>
<tr>
<td>Substitute teacher</td>
<td>37</td>
</tr>
<tr>
<td>Lecturer</td>
<td>41</td>
</tr>
<tr>
<td>Part-time teacher</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href="">Connection</a></h3>
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"><span>Quantity</span>9,517</p> <p class="totle"><span><%= t(:all_member) %></span>2,217</p>
<table class="table table-striped">
<thead>
<tr>
<th><%= t(:role) %></th>
<th class="span2"><%= t(:quantity) %></th>
</tr>
</thead>
</table>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">
<div class="track"> <div class="track">
@ -461,4 +141,450 @@
</div> </div>
</div> </div>
</div> </div>
<div class="item element">
<h3><i class="icons-asset"></i><a href=""><%= t(:file) %></a></a></h3>
<div class="detail w-a h-a">
<p class="totle"><span><%= t(:all_file) %></span>3,422</p>
<table class="table table-striped">
<thead>
<tr>
<th><%= t(:file_type) %></th>
<th class="span2"><%= t(:quantity) %></th>
</tr>
</thead>
</table>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>Word</td>
<td>304</td>
</tr>
<tr>
<td>PDF</td>
<td>783</td>
</tr>
<tr>
<td>PowerPoint</td>
<td>45</td>
</tr>
<tr>
<td>Excel</td>
<td>62</td>
</tr>
<tr>
<td>Jpeg</td>
<td>52</td>
</tr>
<tr>
<td>Gif</td>
<td>20</td>
</tr>
<tr>
<td>Png</td>
<td>41</td>
</tr>
<tr>
<td>Avi</td>
<td>37</td>
</tr>
<tr>
<td>Txt</td>
<td>41</td>
</tr>
<tr>
<td>Zip</td>
<td>20</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:referral_in_links) %></a></h3>
<div class="detail w-a h-a">
<p class="totle"><span><%= t(:statistics) %></span>517</p>
<table class="table table-striped">
<thead>
<tr>
<th><%= t(:site_name) %></th>
<th class="span2"><%= t(:statistics) %></th>
</tr>
</thead>
</table>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>Ruling</td>
<td class="span2">36</td>
</tr>
<tr>
<td>Yahoo</td>
<td class="span2">31</td>
</tr>
<tr>
<td>Google</td>
<td class="span2">3,187</td>
</tr>
<tr>
<td>facebook</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title5</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title6</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title7</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title8</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title9</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title10</td>
<td class="span2">公告</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:most_visited_page) %></a></h3>
<div class="detail noStatistics w-b h-a">
<table class="table table-striped">
<thead>
<tr>
<th><%= t(:title) %></th>
<th class="span2"><%= t(:module) %></th>
<th class="span2"><%= t(:hits) %></th>
</tr>
</thead>
</table>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>Title1</td>
<td class="span2">公告</td>
<td class="span2">2,549</td>
</tr>
<tr>
<td>Title2</td>
<td class="span2">頁面</td>
<td class="span2">1,022</td>
</tr>
<tr>
<td>Title3</td>
<td class="span2">頁面</td>
<td class="span2">928</td>
</tr>
<tr>
<td>Title4</td>
<td class="span2">公告</td>
<td class="span2">904</td>
</tr>
<tr>
<td>Title5</td>
<td class="span2">公告</td>
<td class="span2">867</td>
</tr>
<tr>
<td>Title6</td>
<td class="span2">頁面</td>
<td class="span2">830</td>
</tr>
<tr>
<td>Title7</td>
<td class="span2">頁面</td>
<td class="span2">749</td>
</tr>
<tr>
<td>Title8</td>
<td class="span2">公告</td>
<td class="span2">702</td>
</tr>
<tr>
<td>Title9</td>
<td class="span2">頁面</td>
<td class="span2">639</td>
</tr>
<tr>
<td>Title10</td>
<td class="span2">公告</td>
<td class="span2">549</td>
</tr>
<tr>
<td>Title1</td>
<td class="span2">公告</td>
<td class="span2">2,549</td>
</tr>
<tr>
<td>Title2</td>
<td class="span2">頁面</td>
<td class="span2">1,022</td>
</tr>
<tr>
<td>Title3</td>
<td class="span2">頁面</td>
<td class="span2">928</td>
</tr>
<tr>
<td>Title4</td>
<td class="span2">公告</td>
<td class="span2">904</td>
</tr>
<tr>
<td>Title5</td>
<td class="span2">公告</td>
<td class="span2">867</td>
</tr>
<tr>
<td>Title6</td>
<td class="span2">頁面</td>
<td class="span2">830</td>
</tr>
<tr>
<td>Title7</td>
<td class="span2">頁面</td>
<td class="span2">749</td>
</tr>
<tr>
<td>Title8</td>
<td class="span2">公告</td>
<td class="span2">702</td>
</tr>
<tr>
<td>Title9</td>
<td class="span2">頁面</td>
<td class="span2">639</td>
</tr>
<tr>
<td>Title10</td>
<td class="span2">公告</td>
<td class="span2">549</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:traffic) %></a></h3>
<div class="detail w-a h-a">
<p class="totle"><span><%= t(:total_visitors) %></span>438,913</p>
<table class="table table-striped">
<thead>
<tr>
<th><%= t(:item) %></th>
<th class="span2"><%= t(:data) %></th>
</tr>
</thead>
</table>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>Visitors Today</td>
<td>2,304</td>
</tr>
<tr>
<td>Visitors This Month</td>
<td>783</td>
</tr>
<tr>
<td>Visitor This Tear</td>
<td>45</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:site_info) %></a></h3>
<div class="detail noStatistics w-b h-a">
<!--<p class="totle"><span><%= t(:statistics) %></span>9,517</p>-->
<table class="table table-striped">
<thead>
<tr>
<th><%= t(:item) %></th>
<th class="span6"><%= t(:content) %></th>
</tr>
</thead>
</table>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>Title:</td>
<td class="span6">National Chengchi University</td>
</tr>
<tr>
<td>Description:</td>
<td class="span6">......</td>
</tr>
<tr>
<td>Keywords</td>
<td class="span6">.....</td>
</tr>
<tr>
<td>Online Date:</td>
<td class="span6">2012/04/30</td>
</tr>
<tr>
<td>WedID:</td>
<td class="span6">nccu</td>
</tr>
<tr>
<td>Softwave Version:</td>
<td class="span6">R4 beta</td>
</tr>
<tr>
<td>Warranty:</td>
<td class="span6">Valid</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:recent_update) %></a></h3>
<div class="detail noStatistics w-a h-a">
<!--<p class="totle"><span><%= t(:statistics) %></span>9,517</p>-->
<table class="table table-striped">
<thead>
<tr>
<th><%= t(:title) %></th>
<th class="span2"><%= t(:module) %></th>
</tr>
</thead>
</table>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>Title1</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title2</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title3</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title4</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title5</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title6</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title7</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title8</td>
<td class="span2">公告</td>
</tr>
<tr>
<td>Title9</td>
<td class="span2">頁面</td>
</tr>
<tr>
<td>Title10</td>
<td class="span2">公告</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div> </div>

View File

@ -0,0 +1,14 @@
<tr class="with_action">
<td><%= check_box_tag 'to_delete[]', design.id, false, :class => "checkbox_in_list" %></td>
<td>
<%= design.title %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<li><%= link_to t(:edit), edit_admin_design_path(design), :class => 'edit' %></li>
<li class="dropdown"><%= link_to t(:delete), admin_design_path(design), :confirm => t('sure?'), :method => :delete, :class => 'delete' %></li>
</ul>
</div>
</td>
<td><%= design.author %></td>
<td><%= design.intro %></td>
</tr>

View File

@ -0,0 +1,12 @@
<thead>
<tr>
<th class="span1 strong"></th>
<th class="span7"></th>
<th class="span2"></th>
<th class="span2"></th>
</tr>
</thead>
<tbody>
<tbody id="tbody_designs" class="sort-holder">
<%= render :partial => 'design', :collection => @designs %>
</tbody>

View File

@ -0,0 +1,11 @@
<div id='filter' class="subnav">
<div class="filters">
<div id="sort_headers" class="table-label">
<%= render 'sort_headers' %>
</div>
</div>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "sort_header" %>
<% end %>

View File

@ -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 %>

View File

@ -1,35 +1,10 @@
<%= flash_messages %> <%= 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' %>
<table class="table main-list"> <table class="table main-list">
<thead> <%= render 'designs' %>
<tr>
<th class="span1 strong">
<input type="checkbox">
<a href class="list-remove"><i class="icon-trash"></i></a>
</th>
<th class="span7 select"><%= t('admin.title') %></th>
<th class="span1-2"><%= t('admin.author') %></th>
<th class="span1-2"><%= t('admin.intro') %></th>
</tr>
</thead>
<tbody>
<% @designs.each do |design| %>
<tr>
<td><input type="checkbox"></td>
<td>
<%= design.title %>
<div class="quick-edit">
<ul class="nav nav-pills">
<li><%= link_to t(:edit), edit_admin_design_path(design), :class => 'edit' %></li>
<li class="dropdown"><%= link_to t(:delete), admin_design_path(design), :confirm => t('sure?'), :method => :delete, :class => 'delete' %></li>
</ul>
</div>
</td>
<td><%= design.author %></td>
<td><%= design.intro %></td>
</tr>
<% end %>
</tbody>
</table> </table>
<div class="form-actions"> <% end %>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_admin_design_path, :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_admin_design_path, :class => 'btn btn-primary' %>
</div> </div>

View File

@ -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 %>");

View File

@ -1,3 +1 @@
<div id="viewport">
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %> <%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
</div>

View File

@ -1,40 +1,33 @@
<% content_for :secondary do %> <% content_for :secondary do %>
<% end %> <% end %>
<!-- Remove if CSS done-->
<br />
<br />
<br />
<!-- Remove if CSS done-->
<h3><%= @module_app.title%></h3> <h3><%= @module_app.title%></h3>
<div id="manager_management"> <div id="manager_management">
<h1>Manager</h1>
<dl id="manager"> <dl id="manager">
<dt>Manager</ht> <dt><%= t("admin.user_role.auth.manager") %></ht>
<% @module_app.managers.each do |manager| %> <% @module_app.managers.each do |manager| %>
<dd><%= 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 %> </dd> <dd><%= 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 %> </dd>
<% end %> <% end %>
<dd>Add: <dd>
<%= form_tag(assign_manager_admin_module_app_path) do %> <%= 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))%> <%= 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 %> <% end %>
</dd> </dd>
</dl> </dl>
<dl id="sub_manager"> <dl id="sub_manager">
<dt>Sub Manager</ht> <dt><%#= t("admin.user_role.auth.sub_manager") %></ht>
<% @module_app.sub_managers.each do |manager| %> <%# @module_app.sub_managers.each do |manager| %>
<dd><%= 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 %> </dd> <dd><%#= 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 %> </dd>
<% end %> <%# end %>
<dd>Add: <dd>
<%= form_tag(assign_sub_manager_admin_module_app_path) do %> <%#= 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))%> <%#= collection_select(:sub_manager,:id, User.all, :id, :name, :prompt => true,:disabled => !if_permit_to_assign(:sub_manager))%>
<%= submit_tag 'Add Sub Manager' %> <%#= submit_tag t("admin.user_role.auth.add_sub_manager") %>
<% end %> <%# end %>
</dd> </dd>
</dl> </dl>
</div> </div>
<%= 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] } %>

View File

@ -1,11 +1,6 @@
<% content_for :secondary do %> <% content_for :secondary do %>
<% end %> <% end %>
<!-- Remove if CSS done-->
<br />
<br />
<br />
<!-- Remove if CSS done-->
<h3><%= @object_auth.title %></h3> <h3><%= @object_auth.title %></h3>
<%= render :partial => "admin/components/user_role_management", :locals => { <%= render :partial => "admin/components/user_role_management", :locals => {

View File

@ -1,7 +1,11 @@
<span id='tag_list'> <span id='tag_list'>
<%= 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} %>
</span> </span>
<span id='name_list'> <span id='name_list'>
<% 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) %> <%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, :selected => @part.public_r_tag_object_id) %>
<% end %>
</span> </span>

View File

@ -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 %> <%= 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 %>

View File

@ -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 %>

View File

@ -27,10 +27,26 @@
<%= t('admin.module_app') %> <%= t('admin.module_app') %>
<%= render :partial => "app_selector", :locals => { :f => f } %> <%= render :partial => "app_selector", :locals => { :f => f } %>
<span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> </span> <span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> </span>
<span id="app_page_category"><%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category] ) rescue ''%> </span> <span id="app_page_category"><%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category], :include_blank => true ) rescue ''%> </span>
</p> </p>
<p> <p>
<%= f.label :is_published, "#{t('admin.is_published')} ?" %> <%= f.label :is_published, "#{t('admin.is_published')} ?" %>
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No <%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
</p> </p>
<p>
<%= 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][]', '' %>
</p>
<p>
<%= 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][]', '' %>
</p>

View File

@ -1,7 +1,7 @@
<%= flash_messages %> <%= flash_messages %>
<%= page_stylesheets(@item).html_safe %> <%= page_stylesheets(@item, true).html_safe %>
<%= page_javascripts(@item).html_safe %> <%= page_javascripts(@item, true).html_safe %>
<%= parse_page_edit_noko(@item).html_safe %> <%= parse_page_edit_noko(@item).html_safe %>

View File

@ -1,5 +1 @@
<% content_for :sidebar do %>
<%= render 'admin/items/site_map_left_bar' %>
<% end -%>
<%= render 'show' %> <%= render 'show' %>

View File

@ -0,0 +1 @@
language.html.erb

View File

@ -0,0 +1 @@
mail_setting.html.erb

Some files were not shown because too many files have changed in this diff Show More