Merge commit '43ecebf93482cf94c73b78564509d1a352c2bcd2' into app_config

This commit is contained in:
Matthew K. Fu JuYuan 2012-09-18 16:30:34 +08:00
commit 2321116597
601 changed files with 25583 additions and 2547 deletions

3
.gitignore vendored
View File

@ -17,3 +17,6 @@ config/application.rb
.rvmrc .rvmrc
app/assets/javascripts/.DS_Store app/assets/javascripts/.DS_Store
solr
Gemfile.lock

18
Gemfile
View File

@ -12,14 +12,13 @@ gem 'exception_notification' # Send error trace
gem 'execjs' gem 'execjs'
gem 'jquery-rails' gem 'jquery-rails'
gem 'jquery-ui-rails' gem 'jquery-ui-rails'
gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git' gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git'
# gem "memcached", "~> 1.4.3" # gem "memcached", "~> 1.4.3"
# gem "memcache-client" # gem "memcache-client"
gem 'mini_magick' gem 'mini_magick'
gem 'mongoid' gem 'mongoid', '> 2.1', '< 3.0.0'
gem 'mongoid-tree', :require => 'mongoid/tree' gem 'mongoid-tree', :require => 'mongoid/tree'
gem "mongo_session_store-rails3" gem "mongo_session_store-rails3"
gem 'mysql2' gem 'mysql2'
@ -27,11 +26,11 @@ gem 'nokogiri'
gem 'radius' gem 'radius'
gem 'rake' gem 'rake'
# gem 'remotipart' # gem 'remotipart'
gem 'resque' # background jobs gem 'resque', :require => 'resque/server' # background jobs
gem 'resque-scheduler' # job scheduling gem 'resque-scheduler' # job scheduling
gem 'resque-restriction' gem 'resque-restriction'
#gem 'rb-readline' #gem 'rb-readline'
gem 'ruby-debug19' # gem 'ruby-debug19'
gem 'rubyzip' gem 'rubyzip'
gem 'sunspot_mongo' gem 'sunspot_mongo'
@ -50,13 +49,15 @@ gem 'rb-readline' if RUBY_PLATFORM.downcase.include?("linux")
gem "impressionist", :git => 'git://github.com/charlotte-ruby/impressionist.git' gem "impressionist", :git => 'git://github.com/charlotte-ruby/impressionist.git'
#gem 'contacts'
#gem 'event-calendar', :require => 'event_calendar'#, :git => 'git://github.com/elevation/event_calendar.git'
gem 'redis','>= 2.1.1' gem 'redis','>= 2.1.1'
gem 'chinese_pinyin', '0.4.1' gem 'chinese_pinyin', '0.4.1'
# add rmmseg if you need search by segment words # add rmmseg if you need search by segment words
gem 'rmmseg-cpp-huacnlee', '0.2.9' gem 'rmmseg-cpp-huacnlee', '0.2.9'
gem 'redis-namespace','~> 1.0.2' gem 'redis-namespace'
gem 'redis-search', '0.7.1' gem 'redis-search'
# Gems used only for assets and not required # Gems used only for assets and not required
# in production environments by default. # in production environments by default.
@ -68,6 +69,11 @@ end
group :test, :development do group :test, :development do
gem 'pry'
gem 'pry-remote'
gem 'pry-stack_explorer'
gem 'pry-debugger'
gem "sunspot-rails-tester" gem "sunspot-rails-tester"
gem 'spork' gem 'spork'
gem 'database_cleaner' #Strategies for cleaning databases. Can be used to ensure a clean state for testing. gem 'database_cleaner' #Strategies for cleaning databases. Can be used to ensure a clean state for testing.

View File

@ -1,360 +0,0 @@
GIT
remote: git://github.com/amatsuda/kaminari.git
revision: 82a38e07db1ca1598c8daf073a8f6be22ae714d6
specs:
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
GIT
remote: git://github.com/charlotte-ruby/impressionist.git
revision: 7a93fff25568cd3edcc63c1a3c4b60dc6b81d2b7
specs:
impressionist (1.1.1)
httpclient (~> 2.2)
nokogiri (~> 1.5)
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.4)
actionpack (= 3.1.4)
mail (~> 2.3.0)
actionpack (3.1.4)
activemodel (= 3.1.4)
activesupport (= 3.1.4)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.6)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.3)
activemodel (3.1.4)
activesupport (= 3.1.4)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.4)
activemodel (= 3.1.4)
activesupport (= 3.1.4)
arel (~> 2.2.3)
tzinfo (~> 0.3.29)
activeresource (3.1.4)
activemodel (= 3.1.4)
activesupport (= 3.1.4)
activesupport (3.1.4)
multi_json (~> 1.0)
archive-tar-minitar (0.5.2)
arel (2.2.3)
bcrypt-ruby (3.0.1)
bcrypt-ruby (3.0.1-x86-mingw32)
brakeman (1.5.1)
activesupport
erubis (~> 2.6)
haml (~> 3.0)
i18n
ruby2ruby (~> 1.2)
ruport (~> 1.6)
sass (~> 3.0)
bson (1.6.1)
bson_ext (1.6.1)
bson (~> 1.6.1)
builder (3.0.0)
carrierwave (0.5.8)
activesupport (~> 3.0)
carrierwave-mongoid (0.1.3)
carrierwave (>= 0.5.6)
mongoid (~> 2.1)
chinese_pinyin (0.4.1)
chronic (0.6.7)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
color (1.4.1)
columnize (0.3.6)
database_cleaner (0.7.1)
delorean (1.2.0)
chronic
devise (1.5.3)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
warden (~> 1.1)
diff-lcs (1.1.3)
encrypted_strings (0.3.3)
erubis (2.7.0)
exception_notification (2.5.2)
actionmailer (>= 3.0.4)
execjs (1.3.0)
multi_json (~> 1.0)
factory_girl (2.6.3)
activesupport (>= 2.3.9)
factory_girl_rails (1.7.0)
factory_girl (~> 2.6.0)
railties (>= 3.0.0)
fastercsv (1.5.4)
fattr (2.2.1)
haml (3.1.4)
highline (1.6.13)
hike (1.2.1)
hoe (2.16.1)
rake (~> 0.8)
httpclient (2.2.5)
i18n (0.6.0)
jquery-rails (1.0.19)
railties (~> 3.0)
thor (~> 0.14)
jquery-ui-rails (0.4.0)
jquery-rails
railties (>= 3.1.0)
json (1.6.5)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
mail (2.3.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.17.2)
mini_magick (3.4)
subexec (~> 0.2.1)
mongo (1.6.1)
bson (~> 1.6.1)
mongo_session_store-rails3 (3.0.5)
actionpack (>= 3.0)
mongo
mongoid (2.4.6)
activemodel (~> 3.1)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
mongoid-encryptor (0.0.5)
activesupport (~> 3.0)
encrypted_strings (~> 0.3.3)
mongoid (~> 2)
mongoid-tree (0.7.0)
mongoid (~> 2.0)
multi_json (1.1.0)
mysql2 (0.3.11)
mysql2 (0.3.11-x86-mingw32)
net-ldap (0.3.1)
nokogiri (1.5.2)
nokogiri (1.5.2-x86-mingw32)
options (2.3.0)
fattr
orm_adapter (0.0.6)
pdf-writer (1.1.8)
color (>= 1.4.0)
transaction-simple (~> 1.3)
polyglot (0.3.3)
pr_geohash (1.0.0)
progress_bar (0.4.0)
highline (~> 1.6.1)
options (~> 2.3.0)
rack (1.3.6)
rack-cache (1.2)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-protection (1.2.0)
rack
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
radius (0.7.3)
rails (3.1.4)
actionmailer (= 3.1.4)
actionpack (= 3.1.4)
activerecord (= 3.1.4)
activeresource (= 3.1.4)
activesupport (= 3.1.4)
bundler (~> 1.0)
railties (= 3.1.4)
railties (3.1.4)
actionpack (= 3.1.4)
activesupport (= 3.1.4)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
redis (2.2.2)
redis-namespace (1.0.3)
redis (< 3.0.0)
redis-search (0.7.1)
chinese_pinyin (>= 0.3.0)
redis (>= 2.1.1)
redis-namespace (~> 1.0.2)
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
rmmseg-cpp-huacnlee (0.2.9)
rsolr (1.0.8)
builder (>= 2.1.2)
rspec (2.8.0)
rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0)
rspec-mocks (~> 2.8.0)
rspec-core (2.8.0)
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
rspec-rails (2.8.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.8.0)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby2ruby (1.3.1)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
rubyzip (0.9.6.1)
rufus-scheduler (2.0.16)
tzinfo (>= 0.3.23)
ruport (1.6.3)
fastercsv
pdf-writer (= 1.1.8)
sass (3.1.15)
sass-rails (3.1.5)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (~> 3.1.10)
tilt (~> 1.3.2)
sexp_processor (3.1.0)
shoulda-matchers (1.0.0)
simplecov (0.6.1)
multi_json (~> 1.0)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
social-share-button (0.0.6)
spork (0.9.0)
spork (0.9.0-x86-mingw32)
win32-process
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
subexec (0.2.1)
sunspot (1.3.3)
pr_geohash (~> 1.0)
rsolr (~> 1.0.7)
sunspot-rails-tester (0.0.4)
sunspot_rails (~> 1.2)
sunspot_mongo (1.0.1)
sunspot_rails
sunspot_rails (1.3.3)
nokogiri
sunspot (= 1.3.3)
sunspot_solr (1.3.3)
thor (0.14.6)
tilt (1.3.3)
tinymce-rails (3.4.8)
railties (>= 3.1)
transaction-simple (1.4.0)
hoe (>= 1.1.7)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.32)
uglifier (1.2.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
vegas (0.1.11)
rack (>= 1.0.0)
warden (1.1.1)
rack (>= 1.0)
watchr (0.7)
win32-api (1.4.8-x86-mingw32)
win32-process (0.6.5)
windows-pr (>= 1.1.2)
windows-api (0.4.1)
win32-api (>= 1.4.5)
windows-pr (1.2.1)
win32-api (>= 1.4.5)
windows-api (>= 0.3.0)
PLATFORMS
ruby
x86-mingw32
DEPENDENCIES
brakeman
bson_ext
carrierwave
carrierwave-mongoid
chinese_pinyin (= 0.4.1)
coffee-rails
database_cleaner
delorean
devise (= 1.5.3)
exception_notification
execjs
factory_girl_rails
impressionist!
jquery-rails
jquery-ui-rails
kaminari!
mini_magick
mongo_session_store-rails3
mongoid
mongoid-encryptor
mongoid-tree
mysql2
net-ldap (~> 0.3.1)
nokogiri
progress_bar
radius
rails (>= 3.1.0, < 3.2.0)
rake
redis (>= 2.1.1)
redis-namespace (~> 1.0.2)
redis-search (= 0.7.1)
resque
resque-restriction
resque-scheduler
rmmseg-cpp-huacnlee (= 0.2.9)
rspec (~> 2.0)
rspec-rails (~> 2.0)
ruby-debug19
rubyzip
sass-rails
shoulda-matchers
simplecov
sinatra
social-share-button
spork
sprockets
sunspot-rails-tester
sunspot_mongo
sunspot_solr
tinymce-rails
uglifier
watchr

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,9 @@
$('.plugin_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#plugin_file_" + $(this).prev().attr('value')).hide();
});

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,8 @@
function w(a){ function w(a){
if(!(g.ratio>=1)){ 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))); 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); n=o.now*h.ratio;
g.obj.css(l,-n);
j.obj.css(l,o.now) j.obj.css(l,o.now)
} }
return false return false
@ -41,8 +42,7 @@
j.obj[0].ontouchend=document.ontouchend=function(b){ j.obj[0].ontouchend=document.ontouchend=function(b){
a(document).unbind("mouseup"); a(document).unbind("mouseup");
j.obj.unbind("mouseup"); j.obj.unbind("mouseup");
v(b.touches[0]) v(b.touches[0])};
};
return false return false
} }
function s(){ function s(){
@ -103,7 +103,15 @@
return q() return q()
} }
a.tiny=a.tiny||{}; a.tiny=a.tiny||{};
a.tiny.scrollbar={options:{axis:"y",wheel:40,scroll:true,size:"auto",sizethumb:"auto"}}; a.tiny.scrollbar={
options:{
axis:"y",
wheel:40,
scroll:true,
size:"auto",
sizethumb:"auto"
}
};
a.fn.tinyscrollbar=function(c){ a.fn.tinyscrollbar=function(c){
var c=a.extend({},a.tiny.scrollbar.options,c); var c=a.extend({},a.tiny.scrollbar.options,c);
this.each(function(){ this.each(function(){

View File

@ -8,12 +8,14 @@
//= require jquery_ujs //= require jquery_ujs
//= require jquery.form //= require jquery.form
//= require bootstrap //= require bootstrap
//= require jquery.masonry.min
//= require jquery.isotope.min //= require jquery.isotope.min
//= require jquery.tinyscrollbar.min //= require jquery.tinyscrollbar.min
//= require orbit-1.0 //= require orbit-1.0
//= require tinymce-jquery //= require tinymce-jquery
//= require tinymce_orbit //= require tinymce_orbit
//= require orbit-bar-search //= require orbit-bar-search
//= require orbit-bar-member
//= require side_bar_history //= require side_bar_history
//= require rss //= require rss
//= require ajax_form //= require ajax_form

View File

@ -14,7 +14,6 @@ $(document).ready(function(){
placement: "left" placement: "left"
}); });
$(document).on('click', '.privacy', function() { $(document).on('click', '.privacy', function() {
switch ($(this).val()) { switch ($(this).val()) {
@ -47,64 +46,158 @@ $(document).ready(function(){
/*tinyscrollbar&windows-Size*/ /*tinyscrollbar&windows-Size*/
resize(); resize();
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2, mainResize()
$subWiget = $('#sub-wiget').width()+18;
$orbitBar = $('#orbit-bar').height(),
$mainSidebar = $('#main-sidebar').width()+5,
$formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right"));
$('#main-sidebar').css("height", viewportheight-$orbitBar);
$('#main-sidebar .viewport').css("height", viewportheight-$orbitBar);
$('#post-body').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget);
$('.post-title').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget-16);
$('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft);
$('.form-fixed').css("width", viewportwidth-$mainWrapMarginLeft-$formActionPadding);
$('#main-sidebar').tinyscrollbar({size:(viewportheight-$orbitBar-4)});
$('.detal-list').tinyscrollbar();
mainTablePosition(); mainTablePosition();
itemPosition()
$('#collapse-menu').on({
click: function(){
$('body').toggleClass("folded");
if($('#collapse-menu > i').attr("class")=="icon-chevron-right"){
$('#collapse-menu > i').removeClass('icon-chevron-right');
$('#collapse-menu > i').addClass('icon-chevron-left');
} else if($('#collapse-menu > i').attr("class")=="icon-chevron-left"){
$('#collapse-menu > i').removeClass('icon-chevron-left');
$('#collapse-menu > i').addClass('icon-chevron-right');
}
resize();
mainResize();
mainTablePosition();
itemPosition()
}
})
/*isotope*/ $('.with_action').on({
var $container = $('#isotope'); mouseleave: function(){
$container.isotope({ $('.quick-edit').find('.dropdown').removeClass("open");
itemSelector : '.item', }
layoutMode : 'masonry', })
});
});
$(window).resize(function(){ $(window).resize(function(){
resize(); resize();
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2, mainResize();
$subWiget = $('#sub-wiget').width()+18;
$orbitBar = $('#orbit-bar').height(),
$mainSidebar = $('#main-sidebar').width()+5,
$formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right"));
$('#main-sidebar').css("height", viewportheight-$orbitBar);
$('#main-sidebar .viewport').css("height", viewportheight-$orbitBar);
$('#post-body').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget);
$('.post-title').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget-16);
$('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft);
$('.form-fixed').css("width", viewportwidth-$mainWrapMarginLeft-$formActionPadding);
$('#main-sidebar').tinyscrollbar({size:(viewportheight-$orbitBar-4)});
mainTablePosition(); mainTablePosition();
itemPosition()
});
}); });
/*main-table position*/ /*main-table position*/
function mainTablePosition() { function mainTablePosition() {
var $height = $('#main-wrap .subnav').length && $('#main-wrap .subnav').height(); var $height = $('#main-wrap .subnav').length && $('#main-wrap .subnav').height();
var $table = $('.main-list').length && $('.main-list:last'); var $table = $('.main-list').length && $('.main-list:last');
if($table && $table==0){ if($table && $table==0){
$table.css({marginTop:$height}); // $table.css({marginTop:$height});
$table.stop().animate({marginTop:$height}, 500)
} }
else if($table){ else if($table){
if($height>0){ if($height>0){
$height = $height-17; $height = $height-18;
} }
$table.stop().animate({marginTop:$height},500); $table.stop().animate({marginTop:$height}, 500, function(){
resize();
mainResize();
});
} }
else if($('#main-wrap .subnav')){ else if($('#main-wrap .subnav')){
var $object = $('#main-wrap .subnav').next(); var $object = $('#main-wrap .subnav').next();
$object.css({marginTop:$height}); // $object.css({marginTop:$height});
$object.stop().animate({marginTop:$height}, 500)
}; };
}; };
function moduleNav() {
var $moduleNav = $('#module-nav'),
$userDataW = $('.user-data').width();
$moduleNav.css("width", $userDataW);
}
function itemPosition() {
moduleNav();
if($('#isotope').length>0 && $('.user-info').length>0){
if(viewportwidth<=1200){
if($('body').attr("class")=="folded"){
$('#isotope').find('.detail').css("width", 550);
$('#isotope').masonry({
itemSelector: '.item',
isAnimated: true
});
}else{
$('#isotope').find('.detail').css("width", 435);
$('#isotope').masonry({
itemSelector: '.item',
isAnimated: true
});
}
}else if(viewportwidth>=1201 && viewportwidth<=1280){
if($('body').attr("class")=="folded"){
$('#isotope').find('.detail').css("width", 385);
$('#isotope').masonry({
itemSelector: '.item',
isAnimated: true
});
}else{
$('#isotope').find('.detail').css("width", 325);
$('#isotope').masonry({
itemSelector: '.item',
isAnimated: true
});
}
}else if(viewportwidth>=1281 && viewportwidth<=1440){
if($('body').attr("class")=="folded"){
$('#isotope').find('.detail').css("width", 470);
$('#isotope').masonry({
itemSelector: '.item',
isAnimated: true
});
}else{
$('#isotope').find('.detail').css("width", 410);
$('#isotope').masonry({
itemSelector: '.item',
isAnimated: true
});
}
}else if(viewportwidth>=1441){
if($('#isotope').length>0){
$('#isotope').find('.detail').css("width", 500);
$('#isotope').masonry({
itemSelector: '.item',
isAnimated: true
});
}
}
}else if($('#isotope').length>0){
$('#isotope').masonry({
itemSelector: '.item',
isAnimated: true
});
}
}
function mainResize() {
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2,
$subWiget = $('#sub-wiget').width()+18;
$orbitBar = $('#orbit-bar').height(),
$brand = $('#brand').height(),
$collapseMenu = $('#collapse-menu').height()+$('#position').height()+1,
$mainSidebar = $('#main-sidebar').width()+5,
$formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right")),
$scrollContent = $('#main-sidebar .nav-list').height();
$('#main-sidebar').css("height", viewportheight-$orbitBar);
$('#main-sidebar .viewport').css("height", viewportheight-$orbitBar-$collapseMenu);
$('.user-roles .viewport').css("height", viewportheight-$orbitBar-$brand-30);
$('#main-sidebar .viewport').css("top", $collapseMenu);
$('#main-sidebar .scrollbar').css("top", $collapseMenu);
$('#post-body').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget);
$('.post-title').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget-20);
$('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft);
$('#main-wrap .table-label').css("width", viewportwidth-$mainWrapMarginLeft);
$('.form-fixed').css("width", viewportwidth-$mainWrapMarginLeft-$formActionPadding);
$('.user-info').css("height", viewportheight-$orbitBar-30);
$('#main-sidebar').tinyscrollbar();
$('.detal-list').tinyscrollbar();
$('.user-roles').tinyscrollbar();
if((viewportheight-$orbitBar-$collapseMenu)>=$scrollContent){
$('#main-sidebar .overview').css("top", '0px');
}
};
$(window).scroll(function () { $(window).scroll(function () {
//var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-1; //var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-1;
//var $subnavWidth = parseInt($('#main-wrap > .subnav').css("width")); //var $subnavWidth = parseInt($('#main-wrap > .subnav').css("width"));

View File

@ -0,0 +1,115 @@
var viewportwidth,
viewportheight;
function resize() {
viewportheight=$(window).height();
viewportwidth=$(window).width();
if(window.navigator.userAgent.indexOf("MSIE")>0){
windH=document.clientHeight;
windW=document.clientWidht;
}
}
$(document).ready(function(){
$('.tip').tooltip({
placement: "left"
});
$(document).on('click', '.privacy', function() {
switch ($(this).val()) {
case 'true':
$(this).parents('.controls').children('.select-role').slideUp(300);
break;
case 'false':
$(this).parents('.controls').children('.select-role').slideDown(300);
break;
}
});
var $role = $('.select-role');
var method =$('.privacy:eq(1)').attr('checked');
if(method == 'checked'){
$role.slideDown(0);
}
$('.privacy').each(function($i) {
$(this).click(function() {
switch ($i) {
case 0:
$role.slideUp(300);
break;
case 1:
$role.slideDown(300);
break;
}
});
});
/*tinyscrollbar&windows-Size*/
resize();
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2,
$subWiget = $('#sub-wiget').width()+18;
$orbitBar = $('#orbit-bar').height(),
$mainSidebar = $('#main-sidebar').width()+5,
$formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right"));
$('#main-sidebar').css("height", viewportheight-$orbitBar);
$('#main-sidebar .viewport').css("height", viewportheight-$orbitBar);
$('#post-body').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget);
$('.post-title').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget-16);
$('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft);
$('.form-fixed').css("width", viewportwidth-$mainWrapMarginLeft-$formActionPadding);
$('#main-sidebar').tinyscrollbar({size:(viewportheight-$orbitBar-4)});
$('.detal-list').tinyscrollbar();
mainTablePosition();
/*isotope*/
var $container = $('#isotope');
$container.isotope({
itemSelector : '.item',
layoutMode : 'masonry',
});
});
$(window).resize(function(){
resize();
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2,
$subWiget = $('#sub-wiget').width()+18;
$orbitBar = $('#orbit-bar').height(),
$mainSidebar = $('#main-sidebar').width()+5,
$formActionPadding = parseInt($('.form-fixed').css("padding-left"))+parseInt($('.form-fixed').css("padding-right"));
$('#main-sidebar').css("height", viewportheight-$orbitBar);
$('#main-sidebar .viewport').css("height", viewportheight-$orbitBar);
$('#post-body').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget);
$('.post-title').css("width", viewportwidth-$mainWrapMarginLeft-$subWiget-16);
$('#main-wrap .subnav').css("width", viewportwidth-$mainWrapMarginLeft);
$('.form-fixed').css("width", viewportwidth-$mainWrapMarginLeft-$formActionPadding);
$('#main-sidebar').tinyscrollbar({size:(viewportheight-$orbitBar-4)});
mainTablePosition();
});
/*main-table position*/
function mainTablePosition() {
var $height = $('#main-wrap .subnav').length && $('#main-wrap .subnav').height();
var $table = $('.main-list').length && $('.main-list:last');
if($table && $table==0){
$table.css({marginTop:$height});
}
else if($table){
if($height>0){
$height = $height-17;
}
$table.stop().animate({marginTop:$height},500);
}
else if($('#main-wrap .subnav')){
var $object = $('#main-wrap .subnav').next();
$object.css({marginTop:$height});
};
};
$(window).scroll(function () {
//var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-1;
//var $subnavWidth = parseInt($('#main-wrap > .subnav').css("width"));
var $winLeft = $(window).scrollLeft()
$(".table-label").css({left:$winLeft*-1} );
//$(".table-label").css({left:$mainWrapMarginLeft+($winLeft*-1)} );
//$("#main-wrap > .subnav").css({width:$subnavWidth+($winLeft)} );
});

View File

@ -1,14 +1,12 @@
$(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({
'width':'28px', 'width':'28px',
}); },500);
$('.navbar-search').stop().animate({
'left':'30px',
'opacity':'0',
},200);
$(this).parents('.search').css({ $(this).parents('.search').css({
'background-color': 'transparent', 'background-color': 'transparent',
}); });
@ -17,7 +15,11 @@ $(document).on('click', '.orbit-bar-search', function (){
else{ else{
$(this).parents('.search').stop().animate({ $(this).parents('.search').stop().animate({
'width':'265px', 'width':'265px',
}); },200);
$('.navbar-search').stop().animate({
'left':'7px',
'opacity':'1'
},500);
$(this).parents('.search').css({ $(this).parents('.search').css({
'background-color': 'rgba(0, 0, 0, 0.5)', 'background-color': 'rgba(0, 0, 0, 0.5)',
}); });

View File

@ -232,4 +232,12 @@ var orbitTimeline = function(dom){
} }
}) })
} }
this.ajaxEventPull = function(){
if(!t.update){
t.update = true;
$.getJSON("desktop_orbit/ajaxeventpull",{"from":t.fromdate},function(){
})
}
}
} }

View File

@ -44,24 +44,14 @@ h1, h2, h3, h4, h5, h6 {
.subnav { .subnav {
width: 100%; width: 100%;
height: 36px; height: 36px;
background-color: #eeeeee; /* Old browsers */ /*border-top: 1px solid #e5e5e5;*/
background-repeat: repeat-x; /* Repeat the gradient */ background-color: #ffffff;
background-image: -moz-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* FF3.6+ */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f5f5f5), color-stop(100%, #eeeeee)); /* Chrome,Safari4+ */
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* Chrome 10+,Safari 5.1+ */
background-image: -ms-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* IE10+ */
background-image: -o-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* Opera 11.10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#eeeeee', GradientType=0 ); /* IE6-9 */
background-image: linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* W3C */
border: 1px solid #e5e5e5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
} }
.subnav .nav { .subnav .filter {
margin-bottom: 0; margin-bottom: 0;
border-bottom: 1px solid #e5e5e5;
} }
.subnav .nav > li > a { .subnav .filter > li > a {
margin: 0; margin: 0;
padding-top: 11px; padding-top: 11px;
padding-bottom: 11px; padding-bottom: 11px;
@ -71,7 +61,7 @@ h1, h2, h3, h4, h5, h6 {
-moz-border-radius: 0; -moz-border-radius: 0;
border-radius: 0; border-radius: 0;
} }
.subnav .nav > .active > a, .subnav .nav > .active > a:hover { .subnav .filter > .active > a, .subnav .filter > .active > a:hover {
padding-left: 13px; padding-left: 13px;
color: #777; color: #777;
background-color: #e9e9e9; background-color: #e9e9e9;
@ -81,17 +71,17 @@ h1, h2, h3, h4, h5, h6 {
-moz-box-shadow: inset 0 3px 5px rgba(0,0,0,.05); -moz-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
box-shadow: inset 0 3px 5px rgba(0,0,0,.05); box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
} }
.subnav .nav > .active > a .caret, .subnav .nav > .active > a:hover .caret { .subnav .filter > .active > a .caret, .subnav .filter > .active > a:hover .caret {
border-top-color: #777; border-top-color: #777;
} }
.subnav .nav > li:first-child > a, .subnav .nav > li:first-child > a:hover { .subnav .filter > li:first-child > a, .subnav .filter > li:first-child > a:hover {
border-left: 0; border-left: 0;
padding-left: 12px; padding-left: 12px;
-webkit-border-radius: 4px 0 0 4px; -webkit-border-radius: 4px 0 0 4px;
-moz-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px;
} }
.subnav .nav > li:last-child > a { .subnav .filter > li:last-child > a {
border-right: 0; border-right: 0;
} }
.subnav .dropdown-menu { .subnav .dropdown-menu {

View File

@ -0,0 +1,438 @@
/*!
* Bootstrap Responsive v2.1.1
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
display: table;
line-height: 0;
content: "";
}
.clearfix:after {
clear: both;
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.hidden {
display: none;
visibility: hidden;
}
.visible-phone {
display: none !important;
}
.visible-tablet {
display: none !important;
}
.hidden-desktop {
display: none !important;
}
.visible-desktop {
display: inherit !important;
}
@media (min-width: 768px) and (max-width: 979px) {
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important ;
}
.visible-tablet {
display: inherit !important;
}
.hidden-tablet {
display: none !important;
}
}
@media (max-width: 767px) {
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important;
}
.visible-phone {
display: inherit !important;
}
.hidden-phone {
display: none !important;
}
}
.row {
margin-left: -30px;
*zoom: 1;
}
.row:before,
.row:after {
display: table;
line-height: 0;
content: "";
}
.row:after {
clear: both;
}
[class*="span"] {
float: left;
min-height: 1px;
margin-left: 30px;
}
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 1170px;
}
.span12 {
width: 1170px;
}
.span11 {
width: 1070px;
}
.span10 {
width: 970px;
}
.span9 {
width: 870px;
}
.span8 {
width: 770px;
}
.span7 {
width: 670px;
}
.span6 {
width: 570px;
}
.span5 {
width: 470px;
}
.span4 {
width: 370px;
}
.span3 {
width: 270px;
}
.span2 {
width: 170px;
}
.span1 {
width: 70px;
}
.offset12 {
margin-left: 1230px;
}
.offset11 {
margin-left: 1130px;
}
.offset10 {
margin-left: 1030px;
}
.offset9 {
margin-left: 930px;
}
.offset8 {
margin-left: 830px;
}
.offset7 {
margin-left: 730px;
}
.offset6 {
margin-left: 630px;
}
.offset5 {
margin-left: 530px;
}
.offset4 {
margin-left: 430px;
}
.offset3 {
margin-left: 330px;
}
.offset2 {
margin-left: 230px;
}
.offset1 {
margin-left: 130px;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid:before,
.row-fluid:after {
display: table;
line-height: 0;
content: "";
}
.row-fluid:after {
clear: both;
}
.row-fluid [class*="span"] {
display: block;
float: left;
width: 100%;
min-height: 30px;
margin-left: 2.564102564102564%;
*margin-left: 2.5109110747408616%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
.row-fluid .span12 {
width: 100%;
*width: 99.94680851063829%;
}
.row-fluid .span11 {
width: 91.45299145299145%;
*width: 91.39979996362975%;
}
.row-fluid .span10 {
width: 82.90598290598291%;
*width: 82.8527914166212%;
}
.row-fluid .span9 {
width: 74.35897435897436%;
*width: 74.30578286961266%;
}
.row-fluid .span8 {
width: 65.81196581196582%;
*width: 65.75877432260411%;
}
.row-fluid .span7 {
width: 57.26495726495726%;
*width: 57.21176577559556%;
}
.row-fluid .span6 {
width: 48.717948717948715%;
*width: 48.664757228587014%;
}
.row-fluid .span5 {
width: 40.17094017094017%;
*width: 40.11774868157847%;
}
.row-fluid .span4 {
width: 31.623931623931625%;
*width: 31.570740134569924%;
}
.row-fluid .span3 {
width: 23.076923076923077%;
*width: 23.023731587561375%;
}
.row-fluid .span2 {
width: 14.52991452991453%;
*width: 14.476723040552828%;
}
.row-fluid .span1 {
width: 5.982905982905983%;
*width: 5.929714493544281%;
}
.row-fluid .offset12 {
margin-left: 105.12820512820512%;
*margin-left: 105.02182214948171%;
}
.row-fluid .offset12:first-child {
margin-left: 102.56410256410257%;
*margin-left: 102.45771958537915%;
}
.row-fluid .offset11 {
margin-left: 96.58119658119658%;
*margin-left: 96.47481360247316%;
}
.row-fluid .offset11:first-child {
margin-left: 94.01709401709402%;
*margin-left: 93.91071103837061%;
}
.row-fluid .offset10 {
margin-left: 88.03418803418803%;
*margin-left: 87.92780505546462%;
}
.row-fluid .offset10:first-child {
margin-left: 85.47008547008548%;
*margin-left: 85.36370249136206%;
}
.row-fluid .offset9 {
margin-left: 79.48717948717949%;
*margin-left: 79.38079650845607%;
}
.row-fluid .offset9:first-child {
margin-left: 76.92307692307693%;
*margin-left: 76.81669394435352%;
}
.row-fluid .offset8 {
margin-left: 70.94017094017094%;
*margin-left: 70.83378796144753%;
}
.row-fluid .offset8:first-child {
margin-left: 68.37606837606839%;
*margin-left: 68.26968539734497%;
}
.row-fluid .offset7 {
margin-left: 62.393162393162385%;
*margin-left: 62.28677941443899%;
}
.row-fluid .offset7:first-child {
margin-left: 59.82905982905982%;
*margin-left: 59.72267685033642%;
}
.row-fluid .offset6 {
margin-left: 53.84615384615384%;
*margin-left: 53.739770867430444%;
}
.row-fluid .offset6:first-child {
margin-left: 51.28205128205128%;
*margin-left: 51.175668303327875%;
}
.row-fluid .offset5 {
margin-left: 45.299145299145295%;
*margin-left: 45.1927623204219%;
}
.row-fluid .offset5:first-child {
margin-left: 42.73504273504273%;
*margin-left: 42.62865975631933%;
}
.row-fluid .offset4 {
margin-left: 36.75213675213675%;
*margin-left: 36.645753773413354%;
}
.row-fluid .offset4:first-child {
margin-left: 34.18803418803419%;
*margin-left: 34.081651209310785%;
}
.row-fluid .offset3 {
margin-left: 28.205128205128204%;
*margin-left: 28.0987452264048%;
}
.row-fluid .offset3:first-child {
margin-left: 25.641025641025642%;
*margin-left: 25.53464266230224%;
}
.row-fluid .offset2 {
margin-left: 19.65811965811966%;
*margin-left: 19.551736679396257%;
}
.row-fluid .offset2:first-child {
margin-left: 17.094017094017094%;
*margin-left: 16.98763411529369%;
}
.row-fluid .offset1 {
margin-left: 11.11111111111111%;
*margin-left: 11.004728132387708%;
}
.row-fluid .offset1:first-child {
margin-left: 8.547008547008547%;
*margin-left: 8.440625568285142%;
}
input,
textarea,
.uneditable-input {
margin-left: 0;
}
.controls-row [class*="span"] + [class*="span"] {
margin-left: 30px;
}
input.span12,
textarea.span12,
.uneditable-input.span12 {
width: 1156px;
}
input.span11,
textarea.span11,
.uneditable-input.span11 {
width: 1056px;
}
input.span10,
textarea.span10,
.uneditable-input.span10 {
width: 956px;
}
input.span9,
textarea.span9,
.uneditable-input.span9 {
width: 856px;
}
input.span8,
textarea.span8,
.uneditable-input.span8 {
width: 756px;
}
input.span7,
textarea.span7,
.uneditable-input.span7 {
width: 656px;
}
input.span6,
textarea.span6,
.uneditable-input.span6 {
width: 556px;
}
input.span5,
textarea.span5,
.uneditable-input.span5 {
width: 456px;
}
input.span4,
textarea.span4,
.uneditable-input.span4 {
width: 356px;
}
input.span3,
textarea.span3,
.uneditable-input.span3 {
width: 256px;
}
input.span2,
textarea.span2,
.uneditable-input.span2 {
width: 156px;
}
input.span1,
textarea.span1,
.uneditable-input.span1 {
width: 56px;
}
.thumbnails {
margin-left: -30px;
}
.thumbnails > li {
margin-left: 30px;
}
.row-fluid .thumbnails {
margin-left: 0;
}

5774
app/assets/stylesheets/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -277,7 +277,7 @@ a:hover {
} }
p { p {
margin: 0 0 9px; margin: 0 0 9px;
font-family: Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px; font-size: 13px;
line-height: 18px; line-height: 18px;
} }
@ -522,7 +522,7 @@ input,
button, button,
select, select,
textarea { textarea {
font-family: Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px; font-size: 13px;
font-weight: normal; font-weight: normal;
line-height: 18px; line-height: 18px;
@ -540,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;
@ -3039,7 +3039,7 @@ button.btn.small, input[type="submit"].btn.small {
} }
.navbar-search .search-query { .navbar-search .search-query {
padding: 4px 9px; padding: 4px 9px;
font-family: Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px; font-size: 13px;
font-weight: normal; font-weight: normal;
line-height: 1; line-height: 1;
@ -3274,7 +3274,7 @@ button.btn.small, input[type="submit"].btn.small {
background-color: #FFFFFF; background-color: #FFFFFF;
} }
.pagination a:hover, .pagination .active a { .pagination a:hover, .pagination .active a {
background-color: #e8e8e8; background-color: #f5f5f5;
} }
.pagination .active a { .pagination .active a {
color: #999999; color: #999999;

View File

@ -10,4 +10,5 @@
*= require desktopmain *= require desktopmain
*= require desktopmedia *= require desktopmedia
*= require orbitTimeline *= require orbitTimeline
*= require orbit-bar
*/ */

View File

@ -23,8 +23,8 @@
*/ */
@font-face { @font-face {
font-family: "FontAwesome"; font-family: "FontAwesome";
src: url(<%= asset_path "desktop/fontawesome-webfont.eot" %>); src: url(<%= asset_path 'fontawesome-webfont.eot' %>);
src: url(<%= asset_path "desktop/fontawesome-webfont.eot?#iefix" %>) format('eot'), url(<%= asset_path "desktop/fontawesome-webfont.woff" %>) format('woff'), url(<%= asset_path "desktop/fontawesome-webfont.ttf" %>) format('truetype'), url(<%= asset_path "desktop/fontawesome-webfont.svg#FontAwesome" %>) format('svg'); src: url(<%= asset_path 'fontawesome-webfont.eot?#iefix' %>) format('eot'), url(<%= asset_path 'fontawesome-webfont.woff' %>) format('woff'), url(<%= asset_path 'fontawesome-webfont.ttf' %>) format('truetype'), url(<%= asset_path 'fontawesome-webfont.svg#FontAwesome' %>) format('svg');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@ -38,12 +38,6 @@
display: inline-block; display: inline-block;
text-decoration: inherit; text-decoration: inherit;
} }
[class^="icon-"], [class*=" icon-"] {
background: none;
width: auto;
height: auto;
vertical-align: baseline;
}
a [class^="icon-"], a [class*=" icon-"] { a [class^="icon-"], a [class*=" icon-"] {
display: inline-block; display: inline-block;
text-decoration: inherit; text-decoration: inherit;

View File

@ -1,11 +1,15 @@
/*isotope*/
#isotope { #isotope {
margin-top: 2px; margin-top: 2px;
} }
.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,
@ -40,103 +44,3 @@
-o-transition-duration: 0s; -o-transition-duration: 0s;
transition-duration: 0s; transition-duration: 0s;
} }
.w-a {
width: 398px;
}
.w-b {
width: 812px;
}
.h-a {
height: 315px;
}
.h-b {
height: 703px;
}
.item {
margin: 5px 0 15px 15px;
}
.item h3 {
margin: 20px 0 5px;
}
.item h3 [class^="icons-"] {
margin: 1px 5px 0 3px;
}
.item .detail {
border: 1px solid rgba(0, 0, 0, 0.1);
background-color: #FFFFFF;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
}
.item .detail .totle {
font-size: 50px;
padding:10px 5px 30px 0;
margin: 0;
text-align: right;
border-bottom:1px solid #d9d9d9;
}
.item .detail .totle span {
display: block;
font-size:18px;
color: #333;
padding-left: 5px;
text-align:left;
margin-bottom: -7px;
}
.item .detail .table {
margin-bottom: 0;
}
.item .detail .table th, .item .detail .table td {
border-top: none;
border-bottom: 1px solid #DDDDDD;
}
.item .detail .table tr th {
background-color: #F2F2F2;
border-bottom: 1px solid #AAAAAA;
}
.item .detail .table tr td:first-child {
color: #666;;
}
.item .detail .table tr td:last-child, .item .detail .table tr th:last-child {
text-align:right;
padding-right: 15px;
}
.item .h-a .my_scroll .viewport {
height: 210px;
}
.item .h-b .my_scroll .viewport {
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

@ -0,0 +1,79 @@
.w-a {
width: 388px;
}
.w-b {
width: 802px;
}
.h-a {
height: 315px;
}
.h-b {
height: 699px;
}
.item {
margin: 5px 0 15px 15px;
}
.item h3 {
margin: 5px 0;
}
.item h3 [class^="icons-"] {
margin: 3px 5px 0 3px;
}
.item .detail {
border: 1px solid rgba(0, 0, 0, 0.1);
background-color: #FFFFFF;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
}
.item .detail .totle {
font-size: 50px;
padding:10px 5px 20px 0;
margin: 0px;
text-align: right;
border-bottom:1px solid #d9d9d9;
line-height: 18px;
}
.item .detail .totle span {
display: block;
font-size:18px;
color: #333;
padding-left: 5px;
text-align:left;
}
.item .detail .table {
margin-bottom: 0;
}
.item .detail .table tr th {
background-color: #F2F2F2;
border-bottom: 1px solid #AAA;
}
.item .detail .table th, .item .detail .table td {
border-top: none;
border-bottom: 1px solid #DDDDDD;
}
.item .detail .table tr td:first-child {
color: #666;;
}
.item .detail .table tr td:last-child, .item .detail .table tr th:last-child {
text-align:right;
}
.item .h-a .my_scroll .viewport {
height: 248px;
}
.item .h-b .my_scroll .viewport {
height: 632px;
}
.item .my_scroll .track {
opacity: 0.7;
-moz-opacity: 0.7;
filter:alpha(opacity=7);
}
/*user-data*/
.user-data .item {
margin: 5px 8px 15px;
}

View File

@ -1,7 +1,13 @@
/*list*/ /*list*/
.table th.select { .table th.select>span {
border-bottom:2px solid #0088CC; border-bottom:2px solid #0088CC;
display: block;
margin: 0 -8px;
padding: 0 8px;
}
#check_all {
margin-top: -20px;
} }
.main-list { .main-list {
margin-bottom: 0; margin-bottom: 0;
@ -11,7 +17,7 @@
border-right: medium none; border-right: medium none;
} }
.main-list thead th:last-child { .main-list thead th:last-child {
border-right: none; border-right: none !important;
} }
.main-list .span1 { .main-list .span1 {
min-width: 32px; min-width: 32px;
@ -33,14 +39,21 @@
width: 350px; width: 350px;
left: -8px; left: -8px;
} }
.main-list tbody .quick-edit .nav .dropdown-menu {
margin: 0;
}
.main-list tr:first-child td { .main-list tr:first-child td {
border-top: 1px solid #DDDDDD; 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;
border-right: 1px solid #FFFFFF;
border-top: medium none; border-top: medium none;
} }
.main-list td:last-child {
border-right: none;
}
.main-list .nav { .main-list .nav {
margin-top: 0; margin-top: 0;
margin-bottom: 3px; margin-bottom: 3px;
@ -51,10 +64,14 @@
} }
.main-list tr.with_action:hover>td { .main-list tr.with_action:hover>td {
color: #333333; color: #333333;
border-right: 1px solid #E6E6E6;
background-color: #E6E6E6; background-color: #E6E6E6;
-webkit-transition: all 0.2s linear; -webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear; -moz-transition: all 0.2s linear;
} }
.main-list tr.with_action:hover>td:last-child {
border-right: none;
}
.main-list tr.with_action:hover .hide { .main-list tr.with_action:hover .hide {
display:block !important; display:block !important;
} }
@ -95,11 +112,11 @@
.table-label { .table-label {
background-color: #F2F2F2; background-color: #F2F2F2;
position: relative; position: relative;
border-bottom: 1px solid #e5e5e5;
} }
.table-label .main-list thead th { .table-label .main-list thead th {
background-color: #F2F2F2; background-color: #FFFFFF;
border-right: 1px solid #DDDDDD; border-right: 1px solid #e5e5e5;
border-top: 1px solid #DDDDDD !important;
line-height: 20px; line-height: 20px;
} }
.route-group .route { .route-group .route {
@ -150,7 +167,7 @@ legend {
top: 30px; top: 30px;
z-index: 50; z-index: 50;
} }
.subnav .nav > li:first-child > a, .subnav .nav > li:first-child > a:hover { .subnav .filter > li:first-child > a, .subnav .filter > li:first-child > a:hover {
-moz-border-radius: 0; -moz-border-radius: 0;
-webkit-border-radius: 0; -webkit-border-radius: 0;
border-radius: 0; border-radius: 0;
@ -204,10 +221,11 @@ legend {
margin: 0; margin: 0;
padding: 10px; padding: 10px;
bottom: 0; bottom: 0;
z-index: 2; z-index: 10;
} }
.form-fixed .btn { .form-fixed .btn {
margin-top: 4px; margin-top: 4px;
margin-left: 5px;
} }
.paginationFixed { .paginationFixed {
} }

View File

@ -0,0 +1,237 @@
/*list*/
.table th.select>span {
border-bottom:2px solid #0088CC;
display: block;
margin: 0 -8px -8px;
padding: 0 8px 6px;
}
.main-list {
margin-bottom: 0;
}
.main-wrap>.main-list thead th {
background-color: transparent;
border-right: medium none;
}
.main-list thead th:last-child {
border-right: none !important;
}
.main-list .span1 {
min-width: 32px;
}
.main-list .span7 {
min-width: 300px;
}
.main-list .nav-pills > li > a {
border-radius: 5px 5px 5px 5px;
margin: 2px;
padding:5px;
}
.main-list tbody .quick-edit {
position:relative;
height:20px;
}
.main-list tbody .quick-edit .nav {
position: absolute;
width: 350px;
left: -8px;
}
.main-list tbody .quick-edit .nav .dropdown-menu {
margin: 0;
}
.main-list tr:first-child td {
border-top: 1px solid #DDDDDD;
}
.main-list td {
background-color: #FFFFFF;
border-bottom: 1px solid #DDDDDD;
border-right: 1px solid #FFFFFF;
border-top: medium none;
}
.main-list td:last-child {
border-right: none;
}
.main-list .nav {
margin-top: 0;
margin-bottom: 3px;
}
.main-list tr.with_action>td {
-webkit-transition: all 0.1s linear;
-moz-transition: all 0.1s linear;
}
.main-list tr.with_action:hover>td {
color: #333333;
border-right: 1px solid #E6E6E6;
background-color: #E6E6E6;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
}
.main-list tr.with_action:hover>td:last-child {
border-right: none;
}
.main-list tr.with_action:hover .hide {
display:block !important;
}
.main-list .label-group {
position: relative;
height: 40px;
}
.main-list .label-group .label {
margin-bottom: 1px;
display: inline-block;
padding: 0 3px;
}
.main-list .label-td {
height: 40px;
overflow: hidden;
position: absolute;
width: 100%;
left: 0;
z-index: 1;
}
.main-list .label-td:hover {
background-color: #fff;
height: auto;
padding: 7px;
left: -55px;
top: -8px;
border: 1px solid #333;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
z-index: 5;
width: 160px;
min-height: 40px;
}
.qe-edit-div .table-condensed {
background-color: #F2F2F2;
}
.table-label {
background-color: #F2F2F2;
position: relative;
border-bottom: 1px solid #e5e5e5;
}
.table-label .main-list thead th {
background-color: #FFFFFF;
border-right: 1px solid #e5e5e5;
line-height: 20px;
}
.route-group .route {
padding: 0;
}
.route-group .route .breadcrumb {
border-width: 0!important;
}
.qe-block td {
height:auto;
padding: 0;
/*background-color: #dedede;*/
}
.qe-block legend {
padding-left: 8px;
margin-bottom: 0;
padding-bottom: 0;
}
.qe-block .control-group {
margin-bottom: 0;
}
.qe-block .controls, .qe-block .control-label {
margin-top: 10px;
margin-bottom: 10px;
}
.qe-block .table td, .qe-block .table th {
padding: 8px;
}
.qe-block .form-horizontal {
margin-bottom: 0;
}
.qe-block .form-actions {
margin-bottom: 0;
}
legend {
font-size: 15px;
line-height: 30px;
margin-bottom: 15px;
padding-bottom: 5px;
}
.subnav {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
border-left: none;
border-right: none;
position: fixed;
top: 30px;
z-index: 50;
}
.subnav .filter > li:first-child > a, .subnav .filter > li:first-child > a:hover {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.dropdown-menu.tags {
max-width: none;
}
.dropdown-menu.tags .tags-cloud {
width: 300px;
padding:10px;
}
.dropdown-menu.tags .tags-cloud .active {
background-color: #0088CC;
color: #FFFFFF;
}
.dropdown-menu.tags .tags-cloud a {
display: inline-block;
margin-bottom: 3px;
}
.dropdown-menu.tags li:last-child a {
display: block;
text-align:center;
}
.sort-header th {
padding: 0 8px;
vertical-align: inherit;
position: relative;
}
.sort-header th a {
display: block;
padding: 10px 0;
white-space: nowrap;
}
.sort-header th a:hover {
text-decoration: none;
}
.list-remove {
position: absolute;
top: 0;
padding-top: 11px !important;
left: 25px;
font-size: 19px;
color: #333;
}
.list-remove:hover {
color: #333;
text-decoration: none;
}
.form-fixed {
position: fixed;
margin: 0;
padding: 10px;
bottom: 0;
z-index: 10;
}
.form-fixed .btn {
margin-top: 4px;
margin-left: 5px;
}
.paginationFixed {
}
.paginationFixed .pagination {
margin-top: 0 !important;
}
.member-list td:last-child {
position: relative;
}
.member-list td:last-child .gender {
border-radius: 0;
}

View File

@ -0,0 +1,275 @@
.gender {
position: absolute;
border-radius: 0 0 5px 0;
border-width: .5em;
margin: 0;
border-style: solid;
z-index: 10;
bottom: 0;
right: 0;
}
.gender.male {
border-color: transparent #41B1D5 #41B1D5 transparent;
}
.gender.female {
border-color: transparent #DB186E #DB186E transparent;
}
.user-info {
background-color: #FFFFFF;
padding: 30px 10px 0 20px;
top: 31px;
position: relative;
border-right: 1px solid #b8b8b8;
width: 330px;
position: fixed;
z-index: 1;
-webkit-box-shadow: 5px 0px 10px rgba(0,0,0,.15);
-moz-box-shadow: 5px 0px 10px rgba(0,0,0,.15);
box-shadow: 5px 0px 10px rgba(0,0,0,.15);
}
.user-info .gender {
border-color: #41B1D5 transparent transparent #41B1D5;
border-radius: 5px 0 0 0;
bottom: auto;
right: auto;
}
.user-info .brand {
}
.user-info .scrollbar {
right: -9px;
}
.user-info .brand .user-avatar {
margin-bottom: 10px;
margin-right: 10px;
}
.user-roles {
clear: both;
}
.user-roles .roles .table tr:first-child td {
border-top: none;
}
.user-roles .roles .table td:first-child {
text-align: right;
}
.user-roles .label-line {
position: relative;
text-align: center;
}
.user-roles .label-line hr {
position: absolute;
top: 50%;
width: 100%;
height: 4px;
border: none;
margin: -2px 0 0;
}
.user-roles .label-line span {
color: #343434;
font-size: 1.2em;
padding: 0 5px;
background-color: #FFF;
display: inline-block;
position: relative;
}
.user-roles .basic .label-line hr {
background-color: #e0e0e0;
}
.user-roles .teacher .label-line hr {
background-color: #186AB6;
}
.user-roles .student .label-line hr {
background-color: #F38C08;
}
.user-roles .staff .label-line hr {
background-color: #139E2F;
}
.user-avatar {
overflow: hidden;
width: 80px;
height: 80px;
border-radius: 5px;
box-shadow: 0 1px 3px rgba(0,0,0,.8);
margin-right: 10px;
margin-bottom: 10px;
}
.user-avatar .reflective {
background-image: url(img/reflective.png);
background-repeat: no-repeat;
background-position: 0;
height: 80px;
width: 80px;
position: absolute;
}
.user .user-avatar .reflective {
background-image: url(img/reflective.png);
background-repeat: no-repeat;
background-position: 0 -20px;
height: 80px;
width: 80px;
position: absolute;
top: 10px;
left: 10px;
opacity: 0;
-moz-opacity: 0;
filter:alpha(opacity=0);
}
.user:hover .user-avatar .reflective {
background-position: 0 0;
opacity: 1;
-moz-opacity: 1;
filter:alpha(opacity=10);
}
.user-name {
font-size: 1.5em;
color: #2d2d2d;
margin: 0 0 3px;
font-family: Helvetica, "微軟正黑體";
}
.user-mail {
font-size: 1em;
color: #A2A2A2;
margin: 0 0 3px;
}
.user-data {
padding: 70px 20px 0;
margin: 20px 0 0 360px;
}
.user-data #module-nav {
margin-left: -20px;
position: fixed;
z-index: 1;
background-color: #FFFFFF;
top: 31px;
padding: 10px 20px 0;
-webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, .16);
-moz-box-shadow: 0px 5px 10px rgba(0, 0, 0, .16);
box-shadow: 0px 5px 10px rgba(0, 0, 0, .16);
}
.user-data #module-nav ul {
margin-bottom: 10px;
}
.member-abstract, .member-large {
padding: 15px;
}
.member-abstract ul, .member-large ul {
margin: 0;
padding: 0;
list-style: none;
}
.member-abstract>ul>li, .member-large>ul>li {
margin: 5px;
overflow: hidden;
border-radius: 5px;
box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.member-abstract .user *, .member-large .user * {
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
-o-transition: all .3s ease;
transition: all .3s ease;
}
.member-abstract .user, .member-large .user {
background-color: #EDEDED;
padding: 10px;
position: relative;
border-radius: 0 0 5px 5px;
width: 360px;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
-o-transition: all .3s ease;
transition: all .3s ease;
}
.member-abstract .user:hover, .member-large .user:hover {
background-color: #333333;
}
.member-abstract .user:hover .user-name, .member-large .user:hover .user-name {
color: #DDD;
}
.member-abstract .user .user-meta {
margin-left: 90px;
}
.member-abstract .user .user-title span {
color: #5e5e5e;
font-size: 1.3em;
padding-right: 10px;
}
.member-abstract .user:hover .user-title span {
color: #AAA;
}
.member-abstract .user ul.user-itemborder {
margin-top: 8px;
border-top: 1px solid #D5D5D5;
padding: 4px 0 0;
}
.member-abstract .user ul.user-itemborder li, .member-abstract .user ul.user-itemborder li span {
color: #333;
}
.member-abstract .user:hover ul.user-itemborder {
color: #EDEDED;
border-top: 1px solid #666;
}
.member-abstract .user:hover ul.user-itemborder li, .member-abstract .user:hover ul.user-itemborder li span {
color: #EDEDED;
}
.member-abstract .user ul.user-itemborder li {
width: 33%;
font-size: 1.1em;
text-align: center;
}
.member-abstract .user ul.user-itemborder li span {
font-size: 13px;
font-weight: bold;
padding-right: 5px;
}
.member-large .user {
width: 80px;
min-height: 125px;
}
.member-large .user-avatar {
margin-right: 0;
}
.member-large .user-name {
font-weight: bold;
font-size: 1.1em;
width: 80px;
line-height: 18px;
padding-top: 5px;
text-align: center;
}
.rolesTag {
width: 100%;
}
.rolesTag td {
height: 6px;
background-color: #333;
}
.rolesTag td.teacher {
background-color: #186AB6;
}
.rolesTag td.student {
background-color: #F38C08;
}
.rolesTag td.staff {
background-color: #139E2F;
}
.modal.alert-error {
color: #B94A48;
background-color: #F2DEDE;
border-color: #EED3D7;
}
.news_paragraph p {
line-height: 20px;
}
.nav-tabs>li>.edit, .nav-tabs>li>.edit:hover {
background-color: #333;
color: #FFF;
padding-right: 12px;
}
.nav-tabs li .icons-pencil {
float: right;
margin-top: 8px;
}
.nav-tabs li a {
padding-right: 32px;
}

View File

@ -7,6 +7,8 @@
*= require message *= require message
*= require bootstrap *= require bootstrap
*= require style *= require style
*= require font-awesome
*= require orbit-bar
*= require bootstrap-orbit *= require bootstrap-orbit
*= require list *= require list
*= require widgets *= require widgets

View File

@ -0,0 +1,228 @@
#orbit-bar {
margin-bottom: 0;
position:fixed;
width:100%;
z-index: 99;
top: 0;
left: 0;
}
#orbit-bar .navbar-inner {
min-height: 28px;
height: 28px;
border: none;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
padding-top: 2px;
padding-bottom: 1px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset;
background-image: -moz-linear-gradient(top, #545b60, #191a1c);
background-image: -ms-linear-gradient(top, #545b60, #191a1c);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#545b60), to(#191a1c));
background-image: -webkit-linear-gradient(top, #545b60, #191a1c);
background-image: -o-linear-gradient(top, #545b60, #191a1c);
background-image: linear-gradient(top, #545b60, #191a1c);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#545b60', endColorstr='#191a1c', GradientType=0);
}
#orbit-bar .navbar-search {
left: 30px;
margin: 0;
position: absolute;
text-align: right;
top: -1px;
z-index: 0;
opacity: 0;
-moz-opacity: 0;
filter:alpha(opacity=0);
}
#orbit-bar .nav.pull-right {
margin-right: -20px;
}
#orbit-bar .search-query {
padding: 7px 9px 5px;
height: 12px;
margin-top: 3px;
border: none;
line-height: 14px;
border-radius: 3px;
}
#orbit-bar .search-query:focus {
background-position: 5px 2px;
}
#orbit-bar .container {
width:100%;
}
#orbit-bar .orbit-logo .brand {
background: url(<%= asset_path 'orbit-bar.png' %>) no-repeat -162px -5px;
text-indent:-9999px;
padding: 5px 20px 4px;
}
#orbit-bar .orbit-logo .brand:hover {
background-color: rgba(0,157,220,1);
}
#orbit-bar .orbit-logo.open .brand {
background-color: rgba(0,157,220,1);
}
#orbit-bar .orbit-logo .dropdown-menu {
left: -15px;
}
#orbit-bar .nav > li {
height: 28px;
}
#orbit-bar .nav > li > a:hover {
background-color: rgba(0,157,220,1);
}
#orbit-bar .nav > li > a {
background-image: url(<%= asset_path 'orbit-bar.png' %>);
background-repeat:no-repeat;
display: inline-block;
width: 16px;
height: 16px;
text-indent: -9999px;
padding:6px;
}
#orbit-bar .nav > li.search {
overflow: hidden;
width: 28px;
position: relative;
}
#orbit-bar .nav > li > a.orbit-bar-home {
background-position: -10px -10px;
}
#orbit-bar .nav > li > a.orbit-bar-desktop {
background-position: -106px -9px;
}
#orbit-bar .nav > li > a.orbit-bar-member {
background-position: -4px -37px;
}
#orbit-bar .nav > li > a.orbit-bar-member {
background-position: -10px -43px;
}
#orbit-bar .nav > li > a.orbit-bar-language {
background-position: -42px -42px;
}
#orbit-bar .nav > li > a.orbit-bar-search {
background-position: -75px -10px;
overflow: hidden;
position: absolute;
right: 0;
z-index: 1;
}
#orbit-bar .nav > li.language.open > a.orbit-bar-language {
background-color: rgba(0,157,220,1);
}
.language-menu .active {
color: #ffffff;
text-decoration: none;
background-color: #0088cc;
}
#orbit-bar .nav > li > a.orbit-bar-account {
background-image: none;
height: 22px;
padding: 3px;
text-indent: inherit;
min-width: 110px;
width: auto !important;
text-align: left;
color: #FFFFFF;
text-shadow: none;
background-color: rgba(0, 0, 0, 0.5);
}
#orbit-bar .nav > li > a.orbit-bar-account:hover {
background-color: #08C;
}
#orbit-bar .nav span.member-name {
display: inline-block;
line-height: 22px;
padding: 0 10px;
}
#orbit-bar .nav img.member-img {
display: inline-block;
max-width: 24px;
margin-top: -2px;
}
#orbit-bar .clear {
clear: none;
}
#orbit-bar .account-menu {
right: 5px;
}
#orbit-bar .bar-login {
}
#orbit-bar .bar-login .open, #orbit-bar .open .orbit-bar-account {
background-color: #009DDC;
}
#orbit-bar .bar-login .dropdown-menu {
padding: 0 0 10px;
max-width: 260px;
}
#orbit-bar .bar-login .dropdown-menu .log {
margin: 10px 15px 0;
list-style: none outside none;
}
#orbit-bar .bar-login .dropdown-menu .log .title {
background: url(<%= asset_path 'sign-in-logo2.png' %>) no-repeat center center;
height: 70px;
}
#orbit-bar .bar-login .dropdown-menu .log form {
margin: 0 0 8px;
}
#orbit-bar .bar-login .dropdown-menu .log input {
display: inline-block;
margin: 0;
}
#orbit-bar .bar-login .dropdown-menu .log .span2 {
width: 182px;
}
#orbit-bar .bar-login .dropdown-menu .log .forgot {
margin-bottom: 20px;
padding: 3px 0 0;
float: right;
display: inline-block;
color: #0088CC;
}
#orbit-bar .bar-login .dropdown-menu .log .input-prepend {
margin-top: 20px;
}
#orbit-bar .bar-login .dropdown-menu .log .remember {
margin-top: 5px;
}
#orbit-bar .bar-login .dropdown-menu .log .forgot:hover {
padding: 3px 0 0;
float: right;
display: inline-block;
color: #005580;
text-decoration: underline;
background-color: transparent;
}
#orbit-bar .bar-login .dropdown-menu .log .btn {
width: 220px;
}
#orbit-bar .bar-login .dropdown-menu .log .divider {
position:relative;
overflow: inherit;
margin: 20px 0;
}
#orbit-bar .bar-login .dropdown-menu .log .divider span {
position: absolute;
width: 20px;
height: 20px;
background-color: #FFF;
color: #666;
top: -9px;
left: 100px;
font-size: 1.4em;
text-align: center;
}
#orbit-bar .bar-login .dropdown-menu .register {
color: #FFFFFF;
margin: 0 15px;
width: 188px;
}
#orbit-bar .add-on i {
font-size: 12px;
}

View File

@ -0,0 +1,68 @@
.t_scale{
height:516px;
bottom:0;
}
#timline_marker{
width:100px;
height:140px;
opacity:0.4;
cursor: move;
border-style:solid;
border-width:5px;
border-radius:5px;
}
.t_scale{
border-style:solid;
border-width:2px;
border-radius:5px;
}
#t_container{
height:366px;
}
.scale_region{
height:516px;
border-style:solid;
border-width:0 2px 0 2px;
float: left;
margin-right:1px;
font-size:20px;
padding:5px;
}
.scale_region span{
display: block;
}
.month{
}
.year{
background-color: #c0bebe;
width:30px;
}
.bubble{
cursor: pointer;
width:300px;
height:30px;
border-style:solid;
border-width:5px;
float: left;
border-radius:5px;
margin-top: 10px;
margin-bottom:10px;
font-size:15px;
padding:5px;
text-align:justify;
display: none;
}
.month_heading{
text-align: center;
margin-bottom: 10px;
}
.bubble_list ul{
width:350px;
float:left;
}
.bubble_list ul li span.date{
font-weight:bolder;
float:right;
}

View File

@ -1,15 +1,14 @@
/*scroll_style*/
@charset "UTF-8"; @charset "UTF-8";
/* CSS Document */ /* CSS Document */
.my_scroll { .my_scroll {
position: relative;
width: 100%; width: 100%;
clear: both; clear: both;
} }
.my_scroll .viewport { .my_scroll .viewport {
width: 1005;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
top: 0px;
} }
.my_scroll .overview { .my_scroll .overview {
list-style: none; list-style: none;
@ -22,14 +21,15 @@
background-color: #000000; background-color: #000000;
} }
.my_scroll .scrollbar { .my_scroll .scrollbar {
position: relative; position: absolute;
float: right; float: right;
width: 8px; width: 8px;
top:2px; top: 0px;
right:-2px; right: 2px;
z-index: 1;
} }
.my_scroll .track { .my_scroll .track {
background-color: #CFCFCF; /*background-color: #CFCFCF;*/
height: 100%; height: 100%;
width:7px; width:7px;
position: relative; position: relative;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,153 @@
.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 {
margin: 0;
font-size: 1.5em;
line-height: 1.5em;
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:4px;
}
.action {
float: left;
display:inline-block;
margin-right: 5px;
opacity: 0.8;
filter: alpha(opacity:80);
color: #FFF;
}
.action:hover {
opacity: 1;
filter: alpha(opacity:100);
cursor: pointer;
color: #FFF;
text-decoration: none;
}
.select-role {
display:none;
overflow:hidden;
}
.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;
padding: 4px 10px;
height: 20px;
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: 175px;
}
.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: 263px;
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,6 +1,3 @@
/*Widget*/
.widget-size-300 { .widget-size-300 {
width:298px; width:298px;
} }
@ -12,6 +9,9 @@
position:relative; position:relative;
} }
.widget-box .widget-title { .widget-box .widget-title {
margin: 0;
font-size: 1.5em;
line-height: 1.5em;
color: #FFF; color: #FFF;
padding-left: 5px; padding-left: 5px;
border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0;
@ -54,11 +54,14 @@
margin-right: 5px; margin-right: 5px;
opacity: 0.8; opacity: 0.8;
filter: alpha(opacity=80); filter: alpha(opacity=80);
color: #FFF;
} }
.action:hover { .action:hover {
opacity: 1; opacity: 1;
filter: alpha(opacity=80); filter: alpha(opacity=80);
cursor: pointer; cursor: pointer;
color: #FFF;
text-decoration: none;
} }
.select-role { .select-role {
display:none; display:none;

View File

@ -1,8 +1,10 @@
class Admin::AdBannersController < OrbitBackendController class Admin::AdBannersController < OrbitBackendController
layout "new_admin" layout "new_admin"
before_filter :authenticate_user! before_filter :force_order_for_visitor,:only=>[:index]
#before_filter :force_order_for_user,:except => [:index]
before_filter :for_app_sub_manager,:except => [:index]
before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview] before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview]
before_filter :for_app_sub_manager
def rename def rename
@ad_banner = AdBanner.find(params[:id]) @ad_banner = AdBanner.find(params[:id])

View File

@ -1,7 +1,7 @@
class Admin::DashboardsController < ApplicationController class Admin::DashboardsController < OrbitBackendController
layout "new_admin" layout "new_admin"
before_filter :authenticate_user! #before_filter :set_current_user
#before_filter :authenticate_user!, :except => [:index]
# before_filter :is_admin? # before_filter :is_admin?
def index def index

View File

@ -4,6 +4,7 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
def setting def setting
@sys_users = User.all(conditions: {admin: false}).includes(:avatar) @sys_users = User.all(conditions: {admin: false}).includes(:avatar)
@ob_auth = ObjectAuth.find params[:object_auth_id] @ob_auth = ObjectAuth.find params[:object_auth_id]
@options_from_collection_for_select_ob_auth = [@ob_auth].collect{|oa| [oa.auth_obj.pp_object,oa.id] } @options_from_collection_for_select_ob_auth = [@ob_auth].collect{|oa| [oa.auth_obj.pp_object,oa.id] }

View File

@ -0,0 +1,11 @@
class Admin::PluginsController < ApplicationController
layout "new_admin"
def index
@module_apps = ModuleApp.excludes(widgets: nil).where(has_plugin: true).order_by(:title, :asc)
end
end

View File

@ -1,9 +1,13 @@
class Admin::TagsController < ApplicationController class Admin::TagsController < OrbitBackendController
before_filter :force_order_for_visitor,:only=>[:index]
before_filter :force_order_for_user,:except => [:index]
before_filter :for_app_sub_manager,:except => [:index]
layout 'new_admin'
before_filter :authenticate_user! # layout 'new_admin'
before_filter :is_admin? # before_filter :authenticate_user!
before_filter :set_module_app # before_filter :is_admin?
# before_filter :set_module_app
def index def index
get_tags get_tags

View File

@ -5,20 +5,63 @@ class Admin::UsersNewInterfaceController < ApplicationController
before_filter :set_attribute, :only => [:index, :show, :new, :edit] before_filter :set_attribute, :only => [:index, :show, :new, :edit]
def index def index
@users = User.all.entries get_tags
get_sub_roles
page_num = params[:page] || 1
@users = []
render case params[:at] render case params[:at]
when 'summary' when 'summary'
@users=User.page(page_num).per(12).includes('avatar')
"index_summary" "index_summary"
when 'thumbnail' when 'thumbnail'
@users=User.page(page_num).per(36).includes('avatar')
"index_thumbnail" "index_thumbnail"
else else
@users=User.page(page_num).per(10).includes('avatar')
"index" "index"
end end
end end
def show def show
@user = User.find(params[:id]) @user = User.find(params[:id])
@profile_data = []
@teacher_data = []
@student_data = []
@staff_data = []
@user.attribute_values.each{|att_val|
@profile_data.push({:name => att_val.attribute_field.title,:value =>att_val[I18n.locale]}) if att_val.attribute_field.attribute.key=="profile" rescue false
}
@user.attribute_values.each{|att_val|
@teacher_data.push({:name => att_val.attribute_field.title,:value => eval("att_val.#{att_val.key}")}) if att_val.attribute_field.role.key=="teacher"rescue false
}
@user.attribute_values.each{|att_val|
@student_data.push({:name => att_val.attribute_field.title,:value =>eval("att_val.#{att_val.key}")}) if att_val.attribute_field.role.key=="student"rescue false
}
@user.attribute_values.each{|att_val|
@staff_data.push({:name => att_val.attribute_field.title,:value =>eval("att_val.#{att_val.key}")}) if att_val.attribute_field.role.key=="staff_data"rescue false
}
# binding.pry
# @user.attribute_values.each{|att_val|
# @teacher_data.push({:name => att_val.attribute_field.title,:value =>att_val[I18n.locale]})
# }
# @user.attribute_values.each{|att_val|
# @student_data.push({:name => att_val.attribute_field.title,:value =>att_val[I18n.locale]})
# }
# @user.attribute_values.each{|att_val|
# @staff_data.push({:name => att_val.attribute_field.title,:value =>att_val[I18n.locale]})
# }
# [ {:name=> "1",:value =>"Matt"},{:name=> "2",:value =>"Mark"},{:name=> "3",:value =>"Luke"},{:name=> "4",:value =>"John"} ]
get_info_and_roles get_info_and_roles
end end
@ -74,6 +117,13 @@ class Admin::UsersNewInterfaceController < ApplicationController
end end
protected protected
def get_tags
@sub_role_tags = SubRoleTag.all
end
def get_sub_roles
@sub_roles = SubRole.all
end
def get_info_and_roles def get_info_and_roles
@infos = Info.excludes('disabled' => true) @infos = Info.excludes('disabled' => true)

View File

@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base
before_filter :set_locale, :set_site before_filter :set_locale, :set_site
def set_current_user def set_current_user
User.current = current_user User.current = current_or_guest_user
end end
def front_end_available(module_app_title='') def front_end_available(module_app_title='')
@ -48,14 +48,29 @@ class ApplicationController < ActionController::Base
redirect_to root_path redirect_to root_path
end end
# Check if the current_user is admin # Check if the current_user is admin,if not redirect
def is_admin? def is_admin?
current_user.admin? ? true : auth_failed_in_backend current_or_guest_user.admin? ? true : auth_failed_in_backend
end end
def is_manager? # def is_manager?
@module_app.managing_users.include?(current_user) || is_admin? # @module_app.is_manager?(current_or_guest_user) || is_admin?
end # end
# # Check if the current_user is admin
# def is_member?
# if (current_user rescue false)
# return true
# end
# return false
# end
# def is_guest?
# if session[:guest_user_id]
# return true
# end
# return false
# end
def for_admin_only def for_admin_only
if is_admin? if is_admin?
@ -76,7 +91,7 @@ class ApplicationController < ActionController::Base
end end
def for_app_sub_manager def for_app_sub_manager
if (@module_app.sub_managing_users.include?(current_user) || is_manager?) if (@module_app.sub_managing_users.include?(current_or_guest_user) || is_manager?)
true true
else else
flash[:error] = t("admin.access.denied.app.not_sub_manager") flash[:error] = t("admin.access.denied.app.not_sub_manager")
@ -85,7 +100,7 @@ class ApplicationController < ActionController::Base
end end
def for_app_user def for_app_user
if (@module_app.app_auth.auth_users.include?(current_user) || for_app_sub_manager ) if (@module_app.app_auth.auth_users.include?(current_or_guest_user) || for_app_sub_manager )
true true
else else
flash[:error] = t("admin.access.denied.app.not_authed_user") flash[:error] = t("admin.access.denied.app.not_authed_user")
@ -95,7 +110,7 @@ class ApplicationController < ActionController::Base
def check_object_premission(obj,title) def check_object_premission(obj,title)
flash[:error] = t("admin.access.denied.object") 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? ) auth_failed_in_backend unless (obj.get_object_auth_by_title(title).auth_users.include?(current_or_guest_user) || is_manager? || is_admin? )
end end
# Render the page # Render the page
@ -189,6 +204,17 @@ class ApplicationController < ActionController::Base
[shift_out] + a [shift_out] + a
end end
end end
# called (once) when the user logs in, insert any code your application needs
# to hand off from guest_user to current_user.
def logging_in
# For example:
# guest_comments = guest_user.comments.all
# guest_comments.each do |comment|
# comment.user_id = current_user.id
# comment.save
# end
end
def render_main_rss def render_main_rss
ret = '' ret = ''

View File

@ -43,10 +43,10 @@ class DesktopOrbitController< ApplicationController
if(@fromdate[1] == 0) if(@fromdate[1] == 0)
@fromdate[1] = 12 @fromdate[1] = 12
@fromdate[0] = @fromdate[0] - 1 @fromdate[0] = @fromdate[0] - 1
end end
end end
render :json=>@data.to_json render :json=>@data.to_json
end end
end end

View File

@ -67,6 +67,7 @@ class DesktopPublicationsController< ApplicationController
paper.update_attributes(:user_id => current_user.id) paper.update_attributes(:user_id => current_user.id)
end end
b = Array.new b = Array.new
b << {"success"=>"true"} b << {"success"=>"true"}
render :json=>b.to_json render :json=>b.to_json
end end

View File

@ -1,12 +1,12 @@
class OrbitBackendController< ApplicationController class OrbitBackendController< ApplicationController
before_filter :force_order,:except => [:public] #before_filter :setup_vars
before_filter :setup_vars #before_filter :set_current_user
before_filter :set_current_user
# before_filter {|c| c.front_end_available(@app_title)} # before_filter {|c| c.front_end_available(@app_title)}
# before_filter :check_user_can_use # before_filter :check_user_can_use
include OrbitCoreLib::PermissionUnility include OrbitCoreLib::PermissionUnility
include AdminHelper include AdminHelper
include ApplicationHelper
layout 'new_admin' layout 'new_admin'
@ -19,7 +19,15 @@ class OrbitBackendController< ApplicationController
private private
def force_order def force_order_for_visitor
setup_vars
set_current_user
end
def force_order_for_user
setup_vars
set_current_user
authenticate_user! authenticate_user!
check_user_can_use check_user_can_use
end end

View File

@ -37,7 +37,7 @@ class PagesController < ApplicationController
def index_from_link def index_from_link
url = "/#{@item.path}" url = "/#{@item.path}"
options = '' options = ''
options << "?page_main=#{params[:page_main]}" unless params[:page_main].blank? options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].blank?
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank? options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank? options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank? options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
@ -48,11 +48,13 @@ class PagesController < ApplicationController
end end
def show_from_link def show_from_link
url = "/#{@item.path}?id=#{params[:id]}" url = "/#{@item.path}"
options = '' options = ''
options << "#{options.blank? ? '?' : '&'}id=#{params[:id]}" unless params[:id].blank?
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank? options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank? options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
options << "&preview=#{params[:preview]}" unless params[:preview].blank? options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
redirect_to(url + options) unless save_from_no_lang_for_page redirect_to(url + options) unless save_from_no_lang_for_page
end end

View File

@ -7,15 +7,31 @@ module AdminHelper
# Check if the current_user is manager in current module app # Check if the current_user is manager in current module app
def is_manager? def is_manager?
@module_app.is_manager?(current_user) || is_admin? @module_app.is_manager?(current_or_guest_user) || is_admin?
end end
# Check if the current_user is sub manager in current module app # Check if the current_user is sub manager in current module app
def is_sub_manager? def is_sub_manager?
@module_app.is_sub_manager?(current_user)|| is_admin? @module_app.is_sub_manager?(current_or_guest_user)|| is_admin?
end end
def is_admin? def is_admin?
current_user.admin? current_or_guest_user.admin?
end end
def is_member?
if (current_user rescue false)
return true
end
return false
end
def is_guest?
if session[:guest_user_id]
return true
end
return false
end
end end

View File

@ -2,6 +2,36 @@ module ApplicationHelper
FLASH_NOTICE_KEYS = [:error, :notice, :warning] FLASH_NOTICE_KEYS = [:error, :notice, :warning]
def create_guest_user
u = User.create(:name => "guest", :email => "guest_#{Time.now.to_i}#{rand(99)}@example.com")
u.admin = false
u.save(:validate => false)
u
end
# if user is logged in, return current_user, else return guest_user
def current_or_guest_user
if current_user
if session[:guest_user_id]
guest_user.destroy
session[:guest_user_id] = nil
end
current_user
else
guest_user
end
end
# find guest_user object associated with the current session,
# creating one as needed
def guest_user
User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id])
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
@ -136,12 +166,14 @@ module ApplicationHelper
def page_stylesheets(page, edit=nil) def page_stylesheets(page, edit=nil)
stylesheets = '' stylesheets = ''
unless edit 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' rel='stylesheet' type='text/css' />\n" stylesheets << "<link href='/assets/style.css' rel='stylesheet' type='text/css' />\n"
end end
stylesheets << "<link href='/assets/social-share-button.css' rel='stylesheet' type='text/css' />\n"
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/bootstrap.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='/assets/font-awesome.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='/assets/orbit-bar.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='/assets/social-share-button.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='#{asset_path 'banner_nav.css'}' rel='stylesheet' type='text/css' />\n" stylesheets << "<link href='#{asset_path 'banner_nav.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 }
@ -204,10 +236,6 @@ module ApplicationHelper
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year}) display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
end end
def at_least_module_manager
is_manager? || is_admin?
end
def display_date_time(object) def display_date_time(object)
object.strftime("%Y-%m-%d %H:%M") object.strftime("%Y-%m-%d %H:%M")
end end
@ -232,4 +260,13 @@ module ApplicationHelper
wrap_mark = options[:wrap_mark] || "<br />" wrap_mark = options[:wrap_mark] || "<br />"
str.scan((/.{0,#{line_width}}/)).join(wrap_mark) str.scan((/.{0,#{line_width}}/)).join(wrap_mark)
end end
def show_avatar(user)
if (user.avatar? rescue false)
image_tag(user.avatar.thumb.url)
else
image_tag "person.png"
end
end
end end

View File

@ -0,0 +1,24 @@
module CalendarHelper
def month_link(month_date)
link_to(I18n.localize(month_date, :format => "%B"), {:month => month_date.month, :year => month_date.year})
end
# custom options for this calendar
def event_calendar_opts
{
:year => @year,
:month => @month,
:event_strips => @event_strips,
:month_name_text => I18n.localize(@shown_month, :format => "%B %Y"),
:previous_month_text => "<< " + month_link(@shown_month.prev_month),
:next_month_text => month_link(@shown_month.next_month) + " >>" }
end
def event_calendar
# args is an argument hash containing :event, :day, and :options
calendar event_calendar_opts do |args|
event = args[:event]
%(<a href="/events/#{event.id}" title="#{h(event.name)}">#{h(event.name)}</a>)
end
end
end

View File

@ -38,9 +38,11 @@ module OrbitBackendHelper
def render_title(title, fields, span, translation) def render_title(title, fields, span, translation)
content_tag :th, :class => "sort #{span} #{is_sort_active?(title)}" do content_tag :th, :class => "sort #{span} #{is_sort_active?(title)}" do
content_tag :span 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' 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 end
end
def show_toggle_archive_btn(object) def show_toggle_archive_btn(object)
object.disable ? t("object_disable.change_to_false") : t("object_disable.change_to_true") object.disable ? t("object_disable.change_to_false") : t("object_disable.change_to_true")

View File

@ -9,7 +9,4 @@ class Paper
field :coauthors, default: "Allen, Shelly, Eric, Manson, Chris, Clara, Anna, Albee, Vincent, Devin, Chunchi, Ika, Jaoshua, Ray, Matt, Lin, Spen" field :coauthors, default: "Allen, Shelly, Eric, Manson, Chris, Clara, Anna, Albee, Vincent, Devin, Chunchi, Ika, Jaoshua, Ray, Matt, Lin, Spen"
field :created_at, type: Date field :created_at, type: Date
belongs_to :journal belongs_to :journal
end end

40
app/models/proto_tag.rb Normal file
View File

@ -0,0 +1,40 @@
class ProtoTag
include Mongoid::Document
include Mongoid::Timestamps
include Impressionist::Impressionable
is_impressionable :counter_cache => { :column_name => :view_count }
field :key
field :view_count, :type => Integer, :default => 0
#field :cloud_amper,:type: Integer,:default=> 0
def self.sorted_for_cloud
tags = {}
self.all.each{ |tag|
tags.merge!({tag => self.get_impressionist(tag)})
}
if !tags.blank?
sorted_tags = tags.sort{|a,b| a[1]<=>b[1]}.reverse
sorted_tags[0][1] = :hot1
offset = (sorted_tags.size - 1) / 3
i = 1
class_i = 2
sorted_tags[1..-1].collect!{ |x|
x[1] = "hot#{class_i}"
i == offset ? i = 1 : i += 1 if class_i < 4
class_i += 1 if i == offset && class_i < 4
}
sorted_tags
else
[]
end
end
protected
def self.get_impressionist(item_tag = self)
item_tag.impressions.where(:created_at.gte=> 14.days.ago,:created_at.lte => Time.now).count
end
end

View File

@ -12,7 +12,7 @@ class Site
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 :title_always_on, :type => Boolean, :default => false
field :dashbroad_allow_visitor, :type => Boolean, :default => false
field :mail_settings, :type => Hash field :mail_settings, :type => Hash
field :school field :school

View File

@ -0,0 +1,4 @@
class SubRoleTag < ProtoTag
has_and_belongs_to_many :sub_roles
end

View File

@ -1,41 +1,4 @@
class Tag class Tag < ProtoTag
include Mongoid::Document
include Mongoid::Timestamps
include Impressionist::Impressionable
is_impressionable :counter_cache => { :column_name => :view_count }
field :key
field :view_count, :type => Integer, :default => 0
#field :cloud_amper,:type: Integer,:default=> 0
belongs_to :module_app belongs_to :module_app
def self.sorted_for_cloud
tags = {}
self.all.each{ |tag|
tags.merge!({tag => self.get_impressionist(tag)})
}
if !tags.blank?
sorted_tags = tags.sort{|a,b| a[1]<=>b[1]}.reverse
sorted_tags[0][1] = :hot1
offset = (sorted_tags.size - 1) / 3
i = 1
class_i = 2
sorted_tags[1..-1].collect!{ |x|
x[1] = "hot#{class_i}"
i == offset ? i = 1 : i += 1 if class_i < 4
class_i += 1 if i == offset && class_i < 4
}
sorted_tags
else
[]
end
end
protected
def self.get_impressionist(item_tag = self)
item_tag.impressions.where(:created_at.gte=> 14.days.ago,:created_at.lte => Time.now).count
end
end end

View File

@ -4,17 +4,55 @@ class AttributeField
include Mongoid::Timestamps include Mongoid::Timestamps
field :key field :key
field :markup field :markup #[select,text_field,email,date,addr]
field :locale, :type => Boolean, :default => true field :locale, :type => Boolean, :default => true
field :list_options, :type => Array field :list_options, :type => Array
field :built_in, :type => Boolean, :default => false field :built_in, :type => Boolean, :default => false
field :disabled, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false
field :title, localize: true #field :title, localize: true
field :locale_title, localize: true
field :neutral_title
belongs_to :attribute belongs_to :attribute
# belongs_to :role
has_many :attribute_values has_many :attribute_values
# validates_uniqueness_of :key # validates_uniqueness_of :key
def role
self.attribute.role
end
def title_translations
if locale
return locale_title_translations
else
return Hash[VALID_LOCALES.map{|d| [d,neutral_title]}]
end
end
def title_translations=(var)
if locale
self.locale_title_translations = var
end
end
def title
if locale
return self.locale_title
else
return self.neutral_title
end
end
def title=(var)
binding.pry
if locale
self.locale_title = var
else
self.neutral_title = var
end
end
# Convert the string list_options into an array # Convert the string list_options into an array
def select_list_options=(var) def select_list_options=(var)

View File

@ -10,6 +10,8 @@ class Role
has_many :sub_roles, :autosave => true, :dependent => :destroy has_many :sub_roles, :autosave => true, :dependent => :destroy
has_many :users has_many :users
has_many :statuses, :autosave => true, :dependent => :destroy
has_many :attribute_fields, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :sub_roles, :allow_destroy => true accepts_nested_attributes_for :sub_roles, :allow_destroy => true
def is_built_in? def is_built_in?

14
app/models/user/status.rb Normal file
View File

@ -0,0 +1,14 @@
class Status
include Mongoid::Document
include Mongoid::Timestamps
has_and_belongs_to_many :users
belongs_to :role
# has_and_belongs_to_many :sub_roles
field :title, localize: true
end

View File

@ -2,6 +2,8 @@ class SubRole < Attribute
belongs_to :role belongs_to :role
has_and_belongs_to_many :users has_and_belongs_to_many :users
#has_and_belongs_to_many :statuses, :autosave => true, :dependent => :destroy
has_and_belongs_to_many :tags, :class_name => "SubRoleTag", :autosave => true
# Get an sub_role from key # Get an sub_role from key
def self.get_sub_role_from_key(key) def self.get_sub_role_from_key(key)

View File

@ -14,6 +14,7 @@ class User
# field :cache_dept # field :cache_dept
# has_one :cache_dept, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy # has_one :cache_dept, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
field :cache_dept,type: Hash field :cache_dept,type: Hash
field :status_record,type: Hash
has_many :attribute_values, :autosave => true, :dependent => :destroy has_many :attribute_values, :autosave => true, :dependent => :destroy
has_many :app_auths,as: :privilege_apps,:inverse_of => :privilege_lists has_many :app_auths,as: :privilege_apps,:inverse_of => :privilege_lists
@ -25,8 +26,9 @@ class User
has_many :other_accounts, :autosave => true, :dependent => :destroy has_many :other_accounts, :autosave => true, :dependent => :destroy
has_many :journals, :autosave => true, :dependent => :destroy has_many :journals, :autosave => true, :dependent => :destroy
has_many :papers, :autosave => true, :dependent => :destroy has_many :papers, :autosave => true, :dependent => :destroy
has_and_belongs_to_many :sub_role_tags
belongs_to :role has_and_belongs_to_many :statuses
has_and_belongs_to_many :roles has_and_belongs_to_many :roles
has_and_belongs_to_many :sub_roles has_and_belongs_to_many :sub_roles
accepts_nested_attributes_for :attribute_values, :allow_destroy => true accepts_nested_attributes_for :attribute_values, :allow_destroy => true

View File

@ -1,4 +1,19 @@
# encoding: utf-8 # encoding: utf-8
module CarrierWave
module Uploader
module Versions
def recreate_version!(version)
already_cached = cached?
cache_stored_file! if !already_cached
send(version).store!
if !already_cached && @cache_id
tmp_dir = File.expand_path(File.join(cache_dir, cache_id), CarrierWave.root)
FileUtils.rm_rf(tmp_dir)
end
end
end
end
end
class GalleryUploader < CarrierWave::Uploader::Base class GalleryUploader < CarrierWave::Uploader::Base
@ -35,7 +50,7 @@ class GalleryUploader < CarrierWave::Uploader::Base
# end # end
version :thumb do version :thumb do
process :resize_to_fill => [120, 90] process :resize_to_fill => [150, 120]
end end
# Add a white list of extensions which are allowed to be uploaded. # Add a white list of extensions which are allowed to be uploaded.
@ -60,3 +75,4 @@ class GalleryUploader < CarrierWave::Uploader::Base
# end # end
end end

View File

@ -10,8 +10,8 @@
</ul> </ul>
</div> </div>
</td> </td>
<td><%= asset.data.file.content_type %></td> <td><%= asset.data.file.content_type rescue nil %></td>
<td><%= number_to_human_size(asset.data.file.file_length) %></td> <td><%= number_to_human_size(asset.data.file.file_length) rescue nil %></td>
<td><%= asset.description rescue nil %></td> <td><%= asset.description rescue nil %></td>
<td> <td>
<div class="label-group"> <div class="label-group">

View File

@ -9,10 +9,13 @@
<% end %> <% end %>
<% end %> <% end %>
<td class='select_type'> <td class='select_type'>
<%= f.select :markup, LIST[:markups], {}, {:style => "width:90px"} %> <%= f.select :markup, LIST[:markups], {}, {:style => "width:90px"} %>
<div <%= attribute_field[:markup].eql?('select') ? nil : "style='display:none'"%>> <div <%= attribute_field[:markup].eql?('select') ? nil : "style='display:none'"%>>
<%= t('admin.options') %>: <%= t('admin.options') %>:
<%= f.select "select_list_options", attribute_field.select_list_options, :style => "width:130px" %> <%= f.select "select_list_options", {'1'=>"A",'2'=>"B",'3'=>"C"}, :style => "width:130px" %>
<%#= collection_select(:select_list_options, method, collection, value_method, text_method, options = {}, html_options = {}) %>
</div> </div>
</td> </td>
<td class="action"> <td class="action">

View File

@ -1,3 +1,6 @@
<% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "item" %>
<% end -%>
<div id="isotope"> <div id="isotope">
<div class="item element"> <div class="item element">
<h3><i class="icons-content"></i><%= t(:content) %></h3> <h3><i class="icons-content"></i><%= t(:content) %></h3>

View File

@ -0,0 +1,27 @@
<div id="module-nav">
<div class="arrow_next pull-right"><i class="icon-chevron-right"></i></div>
<div class="arrow_prev pull-left"><i class="icon-chevron-left"></i></div>
<div class="module-nav-view">
<ul class="nav nav-pills">
<li class="active">
<a href="#">All</a>
</li>
<li><a href="#">學歷</a></li>
<li><a href="#">經歷</a></li>
<li><a href="#">研究計畫</a></li>
<li><a href="#">期刊論文</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">經歷</a></li>
<li><a href="#">研究計畫</a></li>
<li><a href="#">期刊論文</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">經歷</a></li>
<li><a href="#">研究計畫</a></li>
<li><a href="#">期刊論文</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">經歷</a></li>
<li><a href="#">期刊論文</a></li>
</ul>
</div>
</div>

View File

@ -0,0 +1,4 @@
<div class="subnav">
<%= render :partial => 'plugin', :collection => @plugins %>
</div>

View File

@ -0,0 +1,16 @@
<div class="quick-edit">
<ul class="nav nav-pills hide">
<li><a href="#"><%= t("admin.new_admin.action.edit")%> </a></li>
<li class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t("admin.new_admin.action.quick_edit")%><b class="caret"></b></a>
<ul class="dropdown-menu" id="menu1">
<li><a href="#"># TODO:Basic</a></li>
<li><a href="#"># TODO:Picture</a></li>
<li><a href="#"># TODO:Tags</a></li>
<li><a href="#"># TODO:Link</a></li>
<li><a href="#"># TODO:File</a></li>
</ul>
</li>
<li><a href="#"><%= t("admin.new_admin.action.delete")%></a></li>
</ul>
</div>

View File

@ -37,8 +37,9 @@
</div> </div>
<div class="accordion-body collapse" id="collapse-category"> <div class="accordion-body collapse" id="collapse-category">
<div class="accordion-inner" data-toggle="buttons-checkbox"> <div class="accordion-inner" data-toggle="buttons-checkbox">
<a href="#" class="btn">Category1</a> <% @sub_roles.each do |sr|%>
<a href="#" class="btn">Category2</a> <a href="#" class="btn"><%= sr.title%></a>
<% end -%>
</div> </div>
<div class="filter-clear"> <div class="filter-clear">
<a href="#" class="btn"><i class="icons-brush-large"></i><%= t("admin.new_admin.table_header.clear_filter")%></a> <a href="#" class="btn"><i class="icons-brush-large"></i><%= t("admin.new_admin.table_header.clear_filter")%></a>
@ -46,26 +47,9 @@
</div> </div>
<div class="accordion-body collapse" id="collapse-tags"> <div class="accordion-body collapse" id="collapse-tags">
<div class="accordion-inner" data-toggle="buttons-checkbox"> <div class="accordion-inner" data-toggle="buttons-checkbox">
<a href="#" class="btn">Tag1</a> <% @sub_role_tags.each do |sr_tag|%>
<a href="#" class="btn">Tag2</a> <a href="#" class="btn"><%= sr_tag[I18n.locale] %></a>
<a href="#" class="btn">Tag3</a> <% end -%>
<a href="#" class="btn">Tag4</a>
<a href="#" class="btn">Tag5</a>
<a href="#" class="btn">Tag6</a>
<a href="#" class="btn">Tag7</a>
<a href="#" class="btn">Tag8</a>
<a href="#" class="btn">Tag9</a>
<a href="#" class="btn">Tag10</a>
<a href="#" class="btn">Tag11</a>
<a href="#" class="btn">Tag12</a>
<a href="#" class="btn">Tag13</a>
<a href="#" class="btn">Tag14</a>
<a href="#" class="btn">Tag15</a>
<a href="#" class="btn">Tag16</a>
<a href="#" class="btn">Tag17</a>
<a href="#" class="btn">Tag18</a>
<a href="#" class="btn">Tag19</a>
<a href="#" class="btn">Tag20</a>
</div> </div>
<div class="filter-clear"> <div class="filter-clear">
<a href="#" class="btn"><i class="icons-brush-large"></i><%= t("admin.new_admin.table_header.clear_filter")%></a> <a href="#" class="btn"><i class="icons-brush-large"></i><%= t("admin.new_admin.table_header.clear_filter")%></a>

View File

@ -2,16 +2,7 @@
<%= link_to(new_admin_users_new_interface_path,:class=> "btn btn-primary pull-right") do%> <%= link_to(new_admin_users_new_interface_path,:class=> "btn btn-primary pull-right") do%>
<i class="icon-plus icon-white"></i><%= t("admin.new_admin.action.add")%> <i class="icon-plus icon-white"></i><%= t("admin.new_admin.action.add")%>
<% end -%> <% end -%>
<div class="paginationFixed"> <div class="paginationFixed" id="user_pagination">
<div class="pagination"> <%= paginate @users, :params => {:inner => false}%>
<ul>
<li><a href="#"><%= t("admin.new_admin.action.prev")%></a></li>
<li class="active"><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#"><%= t("admin.new_admin.action.next")%></a></li>
</ul>
</div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,7 @@
<% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %>
<%= stylesheet_link_tag "item"%>
<% end -%>
<% content_for :page_specific_javascript do -%>
<%#= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
<% end -%>

View File

@ -0,0 +1,46 @@
<div class="item element">
<h3><i class="icons-content"></i>Module Name</h3>
<div class="detail w-a h-a">
<table class="table table-striped">
<thead>
<tr>
<th>模組</th>
<th class="span2">數量</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>University</td>
<td class="span2">2,304</td>
</tr>
<tr>
<td>Master</td>
<td class="span2">783</td>
</tr>
<tr>
<td>Doctor</td>
<td class="span2">45</td>
</tr>
<tr>
<td>Staff</td>
<td class="span2">62</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,7 @@
<%#= render_sort_bar(true, delete_admin_assets_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]),
['title', 'title','span4', 'admin.title'],
['description', 'description', 'span1-2', 'admin.data'],
['intro', 'intro', 'span1-2', 'admin.file_type'],
['intro', 'intro', 'span1-2', 'admin.file_length'],
['intro', 'intro', 'span1-2', 'admin.description'],
['intro', 'intro', 'span1-2', 'admin.tags']).html_safe %>

View File

@ -2,36 +2,21 @@
<td class="span1"><input type="checkbox"></td> <td class="span1"><input type="checkbox"></td>
<td class="span3"> <td class="span3">
<div class="label-group"> <div class="label-group">
<div class="label-td"> <div class="label-td"><!--
<span class="label label-teacher"># TODO:Teacher</span> <span class="label label-teacher"># TODO:Teacher</span>
<span class="label label-student"># TODO:Student</span> <span class="label label-student"># TODO:Student</span>
<span class="label label-staff"># TODO:Staff</span> <span class="label label-staff"># TODO:Staff</span> -->
</div> </div>
</div> </div>
</td> </td>
<td class="span1-2"> <td class="span1-2">
<%= user_for_listing.name %> <%= link_to user_for_listing.name,admin_users_new_interface_path(user_for_listing) %>
<div class="quick-edit"> <%#= render "deled_quick_edit"%>
<ul class="nav nav-pills hide">
<li><a href="#"><%= t("admin.new_admin.action.edit")%> </a></li>
<li class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t("admin.new_admin.action.quick_edit")%><b class="caret"></b></a>
<ul class="dropdown-menu" id="menu1">
<li><a href="#"># TODO:Basic</a></li>
<li><a href="#"># TODO:Picture</a></li>
<li><a href="#"># TODO:Tags</a></li>
<li><a href="#"># TODO:Link</a></li>
<li><a href="#"># TODO:File</a></li>
</ul>
</li>
<li><a href="#"><%= t("admin.new_admin.action.delete")%></a></li>
</ul>
</div>
</td> </td>
<td class="span2"># TODO</td> <td class="span2"><%= Random.rand(1000)%></td>
<td class="span2"># TODO</td> <td class="span2"><%= Random.rand(10)%></td>
<td class="span2"> <td class="span2">
10,597 <%= Random.rand(10000)%>
<p class="gender male"></p> <p class="gender male"></p>
</td> </td>
</tr> </tr>

View File

@ -11,11 +11,11 @@
<p class="gender male"></p> <p class="gender male"></p>
<div class="user-avatar pull-left"> <div class="user-avatar pull-left">
<p class="reflective"></p> <p class="reflective"></p>
<%= image_tag(user_for_summary.avatar.thumb.url) %> <%= show_avatar(user_for_summary) %>
</div> </div>
<div class="user-meta"> <div class="user-meta">
<p class="user-name"> <p class="user-name">
<%= user_for_summary.name%> <%= link_to user_for_summary.name,admin_users_new_interface_path(user_for_summary)%>
</p> </p>
<div class="user-title"> <div class="user-title">
<span>#TODO 教授兼系主任</span><span>#TODO 大學部校友</span> <span>#TODO 教授兼系主任</span><span>#TODO 大學部校友</span>

View File

@ -11,11 +11,11 @@
<p class="gender male"></p> <p class="gender male"></p>
<div class="user-avatar"> <div class="user-avatar">
<p class="reflective"></p> <p class="reflective"></p>
<%= image_tag(user_for_thumbnail.avatar.thumb.url) %> <%= show_avatar(user_for_thumbnail) %>
</div> </div>
<div class="user-meta"> <div class="user-meta">
<p class="user-name"> <p class="user-name">
<%= user_for_thumbnail.name%> <%= link_to user_for_thumbnail.name,admin_users_new_interface_path(user_for_thumbnail)%>
</p> </p>
</div> </div>
</div> </div>

View File

@ -0,0 +1,16 @@
<div class="roles <%= role_class %>">
<div class="label-line">
<hr />
<span><%= t(i18n)%></span>
</div>
<table class="table">
<tbody>
<% items.each do |item| %>
<tr>
<td class="span1"><%= item[:name] %></td>
<td><%= item[:value] %></td>
</tr>
<% end -%>
</tbody>
</table>
</div>

View File

@ -1,3 +1,5 @@
<%= render :partial => "js_and_css"%>
<%= render :partial => "filter"%> <%= render :partial => "filter"%>
<table class="table main-list member-list"> <table class="table main-list member-list">
<thead> <thead>
@ -10,8 +12,8 @@
<th class="span2"></th> <th class="span2"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody id="tbody_users">
<%= render :partial => "user_for_listing",:collection=> [@users.first]%> <%= render :partial => "user_for_listing",:collection=> @users%>
</tbody> </tbody>
</table> </table>

View File

@ -0,0 +1,3 @@
$("#sort_headers").html("<%= j render 'sort_headers' %>");
$("#tbody_users").html("<%= j render :partial => 'user_for_listing', :collection => @users %>");
$("#user_pagination").html("<%= j paginate @users, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");

View File

@ -1,9 +1,9 @@
<%= render :partial => "js_and_css"%>
<%= render :partial => "filter"%> <%= render :partial => "filter"%>
<div class="member-abstract"> <div class="member-abstract">
<ul class="clear"> <ul class="clear" id="summary_block_users">
<% 5.times do %> <%= render :partial=>"user_for_summary",:collection=> @users%>
<%= render :partial=>"user_for_summary",:collection=> [@users.first]%>
<% end -%>
</ul> </ul>
</div> </div>
<%= render :partial=> "index_paginator" %> <%= render :partial=> "index_paginator" %>

View File

@ -0,0 +1,3 @@
$("#sort_headers").html("<%= j render 'sort_headers' %>");
$("#summary_block_users").html("<%= j render :partial => 'user_for_summary', :collection => @users %>");
$("#user_pagination").html("<%= j paginate @users, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");

View File

@ -1,8 +1,8 @@
<%= render :partial => "js_and_css"%>
<%= render :partial => "filter"%> <%= render :partial => "filter"%>
<div class="member-large"> <div class="member-large">
<ul class="clear"> <ul class="clear" id="thumbnail_block_users">
<% 5.times do %> <%= render :partial=>"user_for_thumbnail",:collection=> @users%>
<%= render :partial=>"user_for_thumbnail",:collection=> [@users.first]%>
<% end -%>
</div> </div>
<%= render :partial=> "index_paginator" %> <%= render :partial=> "index_paginator" %>

View File

@ -0,0 +1,3 @@
$("#sort_headers").html("<%= j render 'sort_headers' %>");
$("#thumbnail_block_users").html("<%= j render :partial => 'user_for_thumbnail', :collection => @users %>");
$("#user_pagination").html("<%= j paginate @users, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");

View File

@ -1,135 +1,59 @@
<div class="user-info clear"> <%= render :partial => "js_and_css"%>
<div id="isotope" class="user-data">
<div id="module-nav">
<div class="arrow_next pull-right"><i class="icon-chevron-right"></i></div>
<div class="arrow_prev pull-left"><i class="icon-chevron-left"></i></div>
<div class="module-nav-view">
<ul class="nav nav-pills">
<li class="active">
<a href="#"><%= t("admin.new_admin.users.all_plugin_summary")%></a>
</li>
<li><a href="#">學歷</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">學歷</a></li>
<li><a href="#">學歷</a></li>
</ul>
</div>
</div>
<div class="member-plugin">
<% #binding.pry%>
<%= render :partial=> 'plugin_summary'%>
<%= render :partial=> 'plugin_summary'%>
<%= render :partial=> 'plugin_summary'%>
</div>
</div>
<div class="user-info">
<div id="brand" class="clear">
<p class="gender male"></p>
<div class="user-avatar pull-left"> <div class="user-avatar pull-left">
<p class="reflective"></p> <p class="reflective"></p>
<%= image_tag(@user.avatar.url) %> <%= show_avatar(@user) %>
</div> </div>
<div class="user-info-basic clear">
<p class="gender male"></p>
<a class="btn pull-right" href="#"><i class="icon-edit"></i> <%= t("admin.new_admin.action.edit")%></a>
<p class="user-name"> <p class="user-name">
<%= @user.name%> <%= @user.name%>
</p> </p>
<p class="user-mail"> <p class="user-mail">
<%= @user.email %> <%= @user.email %>
</p> </p>
<hr /> <button class="btn btn-small"><i class="icon-pencil"></i> <%= t("admin.edit")%></button>
</div> </div>
</div> <div class="user-roles my_scroll">
<div class="user-data"> <div class="scrollbar">
<ul class="roles-nav"> <div class="track">
<li class="teacher active"> <div class="thumb">
<a href="#teacher" data-toggle="tab"> <div class="end"></div>
Teacher
</a>
</li>
<li class="student">
<a href="#student" data-toggle="tab">
Student
</a>
</li>
<li class="staff">
<a href="#staff" data-toggle="tab">
Staff
</a>
</li>
<li class="data">
<a href="#data" data-toggle="tab">
Data
</a>
</li>
</ul>
<div class="tab-content user-info-roles">
<div class="tab-pane fade in active teacher" id="teacher">
<p>講師</p>
</div>
<div class="tab-pane fade staff" id="staff">
staff
</div>
<div class="tab-pane fade student" id="student">
student
</div>
<div class="tab-pane fade data" id="data">
<div class="data-block information">
<h2>Information</h2>
<hr>
<div class="info_input">
<table>
<thead class="list_head">
<tr>
<td>Key</td>
<td>English</td>
<td>Chinese</td>
</tr>
</thead>
<tbody>
<tr class="list_item">
<td>Last Name</td>
<td>Last Name</td>
<td>姓</td>
</tr>
<tr class="list_item">
<td>First Name</td>
<td>First Name</td>
<td>名</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="data-block teacher">
<h2>Teacher</h2>
<hr>
<div class="info_input">
<table>
<thead class="list_head">
<tr>
<td>Key</td>
<td>English</td>
<td>Chinese</td>
</tr>
</thead>
<tbody>
<tr class="list_item">
<td>Last Name</td>
<td>Last Name</td>
<td>姓</td>
</tr>
<tr class="list_item">
<td>First Name</td>
<td>First Name</td>
<td>名</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="data-block student">
<h2>Student</h2>
<hr>
<div class="info_input">
<table>
<thead class="list_head">
<tr>
<td>Key</td>
<td>English</td>
<td>Chinese</td>
</tr>
</thead>
<tbody>
<tr class="list_item">
<td>Last Name</td>
<td>Last Name</td>
<td>姓</td>
</tr>
<tr class="list_item">
<td>First Name</td>
<td>First Name</td>
<td>名</td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
<div class="viewport">
<div class="overview">
<%= render :partial=> "user_role",:locals=>{:role_class=>"basic",:i18n=>"admin.new_admin.users.profile",:items=>@profile_data} %>
<%= render :partial=> "user_role",:locals=>{:role_class=>"teacher",:i18n=>"admin.new_admin.users.roles.teacher",:items=>@teacher_data} %>
<%= render :partial=> "user_role",:locals=>{:role_class=>"student",:i18n=>"admin.new_admin.users.roles.student",:items=>@student_data}%>
<%= render :partial=> "user_role",:locals=>{:role_class=>"staff",:i18n=>"admin.new_admin.users.roles.staff",:items=>@staff_data} %>
</div>
<div>
</div> </div>
</div> </div>

View File

@ -6,12 +6,16 @@
<a class="brand dropdown-toggle" data-toggle="dropdown" href="#">Orbit</a> <a class="brand dropdown-toggle" data-toggle="dropdown" href="#">Orbit</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><%= link_to content_tag(:i, nil, :class => 'icons-dashboard') + t('admin.dashboard'), admin_dashboards_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-dashboard') + t('admin.dashboard'), admin_dashboards_path %></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.new_admin.user'), admin_users_new_interface_index_path %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-content') + t('admin.content') %></li> <li><%#= link_to content_tag(:i, nil, :class => 'icons-content') + t('admin.content') %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %></li> <li><%#= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-asset') + t('admin.asset'), admin_assets_path %></li> <li><%#= link_to content_tag(:i, nil, :class => 'icons-asset') + t('admin.asset'), admin_assets_path %></li>
<%if (is_admin? rescue false)%>
<li class="divider"></li> <li class="divider"></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-structure') + t('admin.structure'), admin_items_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-structure') + t('admin.structure'), admin_items_path %></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), admin_site_site_info_path(@site) %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), admin_site_site_info_path(@site) %></li>
<% end -%>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-plus-cube') + t('admin.add_item') %></li> <li><%#= link_to content_tag(:i, nil, :class => 'icons-plus-cube') + t('admin.add_item') %></li>
</ul> </ul>
<% else %> <% else %>

View File

@ -6,28 +6,28 @@
<% end %> <% end %>
<%= content_tag :li, :class => (active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals') || active_for_app_auth('Announcement') || active_for_ob_auths_object("BulletinCategory") ) do -%> <%= content_tag :li, :class => (active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals') || active_for_app_auth('Announcement') || active_for_ob_auths_object("BulletinCategory") ) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %> <%= link_to content_tag(:i, nil, :class => 'icons-announcement') + content_tag(:span, t('admin.announcement')), panel_announcement_back_end_bulletins_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')||active_for_ob_auths_object("BulletinCategory"))) do -%> <%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')||active_for_ob_auths_object("BulletinCategory"))) do -%>
<%= content_tag :li, link_to(t('announcement.all_articles'), panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %> <%= content_tag :li, link_to((t('announcement.all_articles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index') %>
<%= content_tag :li, link_to(t('announcement.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %> <%= content_tag :li, link_to((t('announcement.add_new') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') if (is_manager? rescue nil) %>
<%= content_tag :li, link_to(t('announcement.categories'), panel_announcement_back_end_bulletin_categorys_path), :class =>( active_for_action('bulletin_categorys', 'index') || active_for_ob_auths_object("BulletinCategory") ) %> <%= content_tag :li, link_to((t('announcement.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_bulletin_categorys_path), :class =>( active_for_action('bulletin_categorys', 'index') || active_for_ob_auths_object("BulletinCategory") )if (is_manager? rescue nil) %>
<%= content_tag :li, link_to(t('announcement.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('/panel/announcement/back_end/tags', 'index') %> <%= content_tag :li, link_to((t('announcement.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_tags_path), :class => active_for_action('/panel/announcement/back_end/tags', 'index')if (is_manager? rescue nil) %>
<%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_announcement_back_end_approval_setting_path), :class => active_for_action('approvals', 'setting') if (is_manager? rescue true) %> <%= content_tag :li, link_to((t('announcement.bulletin.approval_setting') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_approval_setting_path), :class => active_for_action('approvals', 'setting') if (is_manager? rescue nil) %>
<%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "Announcement"}))), :class => active_for_app_auth('Announcement') if (is_admin? rescue nil) %> <%= content_tag :li, link_to((t('admin.module.authorization') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "Announcement"}))), :class => active_for_app_auth('Announcement') if (is_admin? rescue nil) %>
<% end -%> <% end -%>
<% end -%> <% end -%>
<%= content_tag :li, :class =>( active_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')|| active_for_app_auth('news') || active_for_ob_auths_object("NewsBulletinCategory")) do -%> <%= content_tag :li, :class =>( active_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')|| active_for_app_auth('news') || active_for_ob_auths_object("NewsBulletinCategory")) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.news'), panel_news_back_end_news_bulletins_path %> <%= link_to content_tag(:i, nil, :class => 'icons-announcement') + content_tag(:span, t('admin.news')), panel_news_back_end_news_bulletins_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')) do -%> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')) do -%>
<%= content_tag :li, link_to(t('announcement.all_articles'), panel_news_back_end_news_bulletins_path), :class => active_for_action('news_bulletins', 'index') %> <%= content_tag :li, link_to((t('announcement.all_articles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_news_back_end_news_bulletins_path), :class => active_for_action('news_bulletins', 'index') %>
<%= content_tag :li, link_to(t('announcement.add_new'), new_panel_news_back_end_news_bulletin_path), :class => active_for_action('news_bulletins', 'new') %> <%= content_tag :li, link_to((t('announcement.add_new') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_news_back_end_news_bulletin_path), :class => active_for_action('news_bulletins', 'new') if (is_manager? rescue nil) %>
<%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') || active_for_ob_auths_object("NewsBulletinCategory") %> <%= content_tag :li, link_to((t('announcement.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') || active_for_ob_auths_object("NewsBulletinCategory") if (is_manager? rescue nil) %>
<%= content_tag :li, link_to(t('announcement.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %> <%= content_tag :li, link_to((t('announcement.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') if (is_manager? rescue nil)%>
<%= content_tag :li, link_to(t('announcement.bulletin.approval_setting'), panel_news_back_end_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue true) %> <%= content_tag :li, link_to((t('announcement.bulletin.approval_setting') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_news_back_end_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %>
<%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_for_app_auth('news') if (is_admin? rescue nil) %> <%= content_tag :li, link_to((t('admin.module.authorization') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_for_app_auth('news') if (is_admin? rescue nil) %>
<% end -%> <% end -%>
<% end -%> <% end -%>
@ -37,14 +37,13 @@
<%# end -%> <%# end -%>
<%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%> <%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.new_admin.user'), admin_users_new_interface_index_path %> <%= link_to content_tag(:i, nil, :class => 'icons-page')+ content_tag(:span, t('admin.new_admin.user')), admin_users_new_interface_index_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface')) do -%> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface')) do -%>
<%= content_tag :li, link_to(t('admin.new_admin.side_bar.all_user'), ), :class => active_for_action('users_new_interface', 'index') %>
<%= content_tag :li, link_to("#TODO Role1", ), :class => active_for_action('users_new_interface', 'index') %> <%= content_tag :li, link_to((t('admin.new_admin.side_bar.all_user') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, admin_users_new_interface_index_path), :class => active_for_action('users_new_interface', 'index') %>
<%= content_tag :li, link_to(t("#TODO Role2"), ), :class => active_for_action('users_new_interface', 'index') %> <%= content_tag :li, link_to((t('admin.new_admin.side_bar.add_user') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, ), :class => active_for_action('users_new_interfacexx', 'index') %>
<%= content_tag :li, link_to(t('admin.new_admin.side_bar.add_user')) %> <%= content_tag :li, link_to((t('admin.new_admin.side_bar.user_roles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, ), :class => active_for_action('users_new_interfacexx', 'index') %>
<%= content_tag :li, link_to(t('admin.new_admin.side_bar.user_roles')) %> <%= content_tag :li, link_to((t('admin.new_admin.side_bar.user_info') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, ), :class => active_for_action('users_new_interfacexx', 'index') %>
<%= content_tag :li, link_to(t('admin.new_admin.side_bar.user_info')) %>
<% end -%> <% end -%>
<% end -%> <% end -%>
@ -53,68 +52,109 @@
<%= content_tag :li, :class => active_for_controllers('page_contexts') || active_for_app_auth('page_content') || active_for_ob_auths_object("PageContext") do -%> <%= content_tag :li, :class => active_for_controllers('page_contexts') || active_for_app_auth('page_content') || active_for_ob_auths_object("PageContext") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.page'), panel_page_content_back_end_page_contexts_path %> <%= link_to content_tag(:i, nil, :class => 'icons-page') + content_tag(:span, t('admin.page')), panel_page_content_back_end_page_contexts_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('page_contexts')) do -%> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('page_contexts')) do -%>
<%#= content_tag :li, link_to(t('admin.all_articles'), panel_page_content_back_end_page_contexts_path), :class => active_for_action('page_context', 'index') %> <%#= content_tag :li, link_to(t('admin.all_articles'), panel_page_content_back_end_page_contexts_path), :class => active_for_action('page_context', 'index') %>
<%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "page_content"}))), :class => active_for_app_auth('page_content') if (is_admin? rescue nil) %> <%= content_tag :li, link_to((t('admin.module.authorization') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "page_content"}))), :class => active_for_app_auth('page_content') if (is_admin? rescue nil) %>
<% end -%> <% end -%>
<% end -%> <% end -%>
<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') ||active_for_ob_auths_object("AdBanner") ||active_for_app_auth('ad_banners') do -%> <%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') ||active_for_ob_auths_object("AdBanner") ||active_for_app_auth('ad_banners') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.ad_banner'), admin_ad_banners_path %> <%= link_to content_tag(:i, nil, :class => 'icons-link') + content_tag(:span, t('admin.ad_banner')), admin_ad_banners_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('ad_banners', 'ad_images') ) do -%> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('ad_banners', 'ad_images') ) do -%>
<%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %> <%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %>
<%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %> <%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %>
<%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %> <%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %>
<%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "ad_banners"}))), :class => active_for_app_auth('ad_banners') if (is_admin? rescue nil) %> <%= content_tag :li, link_to((t('admin.module.authorization') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "ad_banners"}))), :class => active_for_app_auth('ad_banners') if (is_admin? rescue nil) %>
<% end -%> <% end -%>
<% end %> <% end %>
<%= content_tag :li, :class => active_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys') || active_for_app_auth('web_resource') || active_for_ob_auths_object("WebLinkCategory") do -%> <%= content_tag :li, :class => active_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys') || active_for_app_auth('web_resource') || active_for_ob_auths_object("WebLinkCategory") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), panel_web_resource_back_end_web_links_path %> <%= link_to content_tag(:i, nil, :class => 'icons-link') + content_tag(:span, t('admin.link')), panel_web_resource_back_end_web_links_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys')) do -%> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys')) do -%>
<%= content_tag :li, link_to(t('admin.all_articles'), panel_web_resource_back_end_web_links_path), :class => active_for_action('web_links', 'index') %> <%= content_tag :li, link_to((t('admin.all_articles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_web_resource_back_end_web_links_path), :class => active_for_action('web_links', 'index') %>
<%= content_tag :li, link_to(t('announcement.add_new'), new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_links', 'new') %> <%= content_tag :li, link_to((t('announcement.add_new') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_links', 'new') if (is_manager? rescue nil)%>
<%= content_tag :li, link_to(t('announcement.categories'), panel_web_resource_back_end_web_link_categorys_path), :class => (active_for_action('web_link_categorys', 'index') || active_for_ob_auths_object("WebLinkCategory")) %> <%= content_tag :li, link_to((t('announcement.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_web_resource_back_end_web_link_categorys_path), :class => (active_for_action('web_link_categorys', 'index') || active_for_ob_auths_object("WebLinkCategory")) if (is_manager? rescue nil)%>
<%= content_tag :li, link_to(t('announcement.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') %> <%= content_tag :li, link_to((t('announcement.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') if (is_manager? rescue nil)%>
<%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "web_resource"}))), :class => active_for_app_auth('web_resource') if (is_admin? rescue nil) %> <%= content_tag :li, link_to((t('admin.module.authorization') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "web_resource"}))), :class => active_for_app_auth('web_resource') if (is_admin? rescue nil) %>
<% end -%> <% end -%>
<% end -%> <% end -%>
<%= content_tag :li, :class => active_for_controllers('orbit_galleries','/panel/gallery/back_end/tags') || active_for_app_auth("gallery") do -%>
<%#= link_to content_tag(:i, nil, :class => 'icons-picture') + t('admin.orbit_gallery'), panel_gallery_back_end_orbit_gallery_path %> <%= content_tag :li, :class => active_for_controllers('albums','album_images','gallery_categories','/panel/gallery/back_end/tags') || active_for_app_auth("gallery") do -%>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('orbit_galleries') ) do -%> <%= link_to content_tag(:i, nil, :class => 'icons-picture') + content_tag(:span, t('admin.orbit_gallery')), panel_gallery_back_end_albums_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('albums') ) do -%>
<%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %> <%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %>
<%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %> <%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %>
<%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %> <%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %>
<%#= content_tag :li, link_to(t('gallery.categories'), panel_gallery_back_end_categorylist_path), :class => active_for_action('/panel/gallery/back_end/categorylist','categorylist') %> <%= content_tag :li, link_to((t('gallery.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_gallery_categories_path), :class => active_for_action('gallery_categories','index') %>
<%#= content_tag :li, link_to(t('gallery.tags'), panel_gallery_back_end_tags_path), :class => active_for_action('/panel/gallery/back_end/tags', 'index') %> <%= content_tag :li, link_to((t('gallery.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_tags_path), :class => active_for_action('/panel/gallery/back_end/tags', 'index') %>
<%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "gallery"}))), :class => active_for_app_auth('orbit_gallery') if (is_admin? rescue nil) %> <%= content_tag :li, link_to((t('admin.module.authorization') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "gallery"}))), :class => active_for_app_auth('gallery') if (is_admin? rescue nil) %>
<% end -%> <% end -%>
<% end %> <% end %>
<%#= content_tag :li, :class => active_for_controllers('assets', '/admin/asset_tags', 'asset_categories') do -%>
<%#= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.asset'), admin_assets_path %>
<%#= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('assets', '/admin/asset_tags', 'asset_categories')) do -%>
<%#= content_tag :li, link_to(t('admin.all_assets'), admin_assets_path), :class => active_for_action('assets', 'index') %>
<%#= content_tag :li, link_to(t('admin.categories'), admin_asset_categories_path), :class => active_for_action('asset_categories', 'index') %>
<%#= content_tag :li, link_to(t('admin.tags'), admin_asset_tags_path), :class => active_for_action('/admin/asset_tags', 'index') %>
<%# end -%>
<%# end -%>
<%= content_tag :li, :class => active_for_controllers('archive_files', 'tags', 'archive_file_categorys') do -%> <%= content_tag :li, :class => active_for_controllers('archive_files', 'tags', 'archive_file_categorys') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-asset') + t('admin.archive'), panel_archive_back_end_archive_files_path %> <%= link_to content_tag(:i, nil, :class => 'icons-asset') + content_tag(:span, t('admin.archive')), panel_archive_back_end_archive_files_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('archive_files', 'tags', 'archive_file_categorys')) do -%> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('archive_files', 'tags', 'archive_file_categorys')) do -%>
<%= content_tag :li, link_to(t('admin.all_articles'), panel_archive_back_end_archive_files_path), :class => active_for_action('archive_file', 'index') %> <%= content_tag :li, link_to((t('admin.all_articles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_files_path), :class => active_for_action('archive_file', 'index') %>
<%= content_tag :li, link_to(t('admin.add_new'), new_panel_archive_back_end_archive_file_path), :class => active_for_action('archive_file', 'new') %> <%= content_tag :li, link_to((t('admin.add_new') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_archive_back_end_archive_file_path), :class => active_for_action('archive_file', 'new') %>
<%= content_tag :li, link_to(t('admin.categories'), panel_archive_back_end_archive_file_categorys_path), :class => active_for_action('archive_file_categorys', 'index') %> <%= content_tag :li, link_to((t('admin.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_file_categorys_path), :class => active_for_action('archive_file_categorys', 'index') %>
<%= content_tag :li, link_to(t('admin.tags'), panel_archive_back_end_tags_path), :class => active_for_action('tags', 'index') %> <%= content_tag :li, link_to((t('admin.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_tags_path), :class => active_for_action('tags', 'index') %>
<% end -%> <% end -%>
<% end -%> <% end -%>
<%= content_tag :li, :class => active_for_controllers(nil) do -%> <%= content_tag :li, :class => active_for_controllers('cals','calendar_categories') || active_for_app_auth("calendar") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-cog') + t('admin.site_settings'), nil %> <%= link_to content_tag(:i, nil, :class => 'icons-calendar') + content_tag(:span, t('admin.calendar')), panel_calendar_back_end_cals_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('cals','calendar_categories') ) do -%>
<%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %>
<%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %>
<%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %>
<%= content_tag :li, link_to((t('calendar.calendars') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_calendar_back_end_cal_path), :class => active_for_action('cals','new') %>
<%#= content_tag :li, link_to(t('gallery.tags'), panel_gallery_back_end_tags_path), :class => active_for_action('/panel/gallery/back_end/tags', 'index') %>
<%#= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "gallery"}))), :class => active_for_app_auth('gallery') if (is_admin? rescue nil) %>
<% end -%>
<% end %>
<%= content_tag :li, :class => (active_for_controllers('writing_journals', '/panel/personal_journal/back_end/tags', 'writing_journal_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-personal_journal') + t('admin.personal_journal'), panel_personal_journal_back_end_writing_journals_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('writing_journals', '/panel/personal_journal/back_end/tags', 'writing_journal_categorys', 'approvals'))) do -%>
<%= content_tag :li, link_to(t('personal_journal.all_articles'), panel_personal_journal_back_end_writing_journals_path), :class => active_for_action('writing_journals', 'index') %>
<%= content_tag :li, link_to(t('personal_journal.setting'), panel_personal_journal_back_end_writing_journal_setting_path), :class => active_for_action('writing_journal_setting', 'index') %>
<%= content_tag :li, link_to(t('personal_journal.paper_type'), panel_personal_journal_back_end_journal_paper_types_path), :class => active_for_action('paper_types', 'index') %>
<%= content_tag :li, link_to(t('personal_journal.author_type'), panel_personal_journal_back_end_journal_author_types_path), :class => active_for_action('author_types', 'index') %>
<%= content_tag :li, link_to(t('personal_journal.level_type'), panel_personal_journal_back_end_journal_level_types_path), :class => active_for_action('level_types', 'index') %>
<%= content_tag :li, link_to(t('personal_journal.tags'), panel_personal_journal_back_end_tags_path), :class => active_for_action('/panel/personal_journal/back_end/tags', 'index') %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => (active_for_controllers('writing_seminars', '/panel/personal_seminar/back_end/tags', 'writing_seminar_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-personal_seminar') + t('admin.personal_seminar'), panel_personal_seminar_back_end_writing_seminars_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('writing_seminars', '/panel/personal_seminar/back_end/tags', 'writing_seminar_categorys', 'approvals'))) do -%>
<%= content_tag :li, link_to(t('personal_seminar.all_articles'), panel_personal_seminar_back_end_writing_seminars_path), :class => active_for_action('writing_seminars', 'index') %>
<%= content_tag :li, link_to(t('personal_seminar.setting'), panel_personal_seminar_back_end_writing_seminar_setting_path), :class => active_for_action('writing_seminar_setting', 'index') %>
<%= content_tag :li, link_to(t('personal_seminar.paper_type'), panel_personal_seminar_back_end_seminar_paper_types_path), :class => active_for_action('paper_types', 'index') %>
<%= content_tag :li, link_to(t('personal_seminar.author_type'), panel_personal_seminar_back_end_seminar_author_types_path), :class => active_for_action('author_types', 'index') %>
<%= content_tag :li, link_to(t('personal_seminar.tags'), panel_personal_seminar_back_end_tags_path), :class => active_for_action('/panel/personal_seminar/back_end/tags', 'index') %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => (active_for_controllers('writing_books', '/panel/personal_book/back_end/tags', 'writing_book_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-personal_book') + t('admin.personal_book'), panel_personal_book_back_end_writing_books_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('writing_books', '/panel/personal_book/back_end/tags', 'writing_book_categorys', 'approvals'))) do -%>
<%= content_tag :li, link_to(t('personal_book.all_articles'), panel_personal_book_back_end_writing_books_path), :class => active_for_action('writing_books', 'index') %>
<%= content_tag :li, link_to(t('personal_book.setting'), panel_personal_book_back_end_writing_book_setting_path), :class => active_for_action('writing_book_setting', 'index') %>
<%= content_tag :li, link_to(t('personal_book.paper_type'), panel_personal_book_back_end_book_paper_types_path), :class => active_for_action('paper_types', 'index') %>
<%= content_tag :li, link_to(t('personal_book.author_type'), panel_personal_book_back_end_book_author_types_path), :class => active_for_action('author_types', 'index') %>
<%= content_tag :li, link_to(t('personal_book.tags'), panel_personal_book_back_end_tags_path), :class => active_for_action('/panel/personal_book/back_end/tags', 'index') %>
<% end -%>
<% end -%> <% end -%>
<div class="content"> <div class="content">

View File

@ -13,9 +13,13 @@
<%= yield :page_specific_javascript %> <%= yield :page_specific_javascript %>
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
</head> </head>
<body> <body class="folded">
<%= render 'layouts/orbit_bar' %> <%= render 'layouts/orbit_bar' %>
<div id="main-sidebar" class="my_scroll"> <div id="main-sidebar" class="my_scroll">
<div id="position">
<a href="#"><i class="icons-dashboard"></i><span>Dashboard</span></a>
<div id="collapse-menu"><i class="icon-chevron-right"></i><i class="icon-chevron-right"></i></div>
</div>
<div class="scrollbar"> <div class="scrollbar">
<div class="track"> <div class="track">
<div class="thumb"> <div class="thumb">

View File

@ -95,6 +95,7 @@ en:
action: Action action: Action
ad_banner: AD Banner ad_banner: AD Banner
orbit_gallery: Gallery orbit_gallery: Gallery
calendar: Calendar
ad: ad:
sec_place_holder: Enter 3 if 3 sec sec_place_holder: Enter 3 if 3 sec
ab_fx: FX ab_fx: FX

View File

@ -217,6 +217,13 @@ zh_tw:
user_roles: 角色 user_roles: 角色
user_info: 使用者資訊 user_info: 使用者資訊
user: 會員 user: 會員
users:
all_plugin_summary: 全部
profile: 基本資料
roles:
staff: 職員資料
student: 學生資料
teacher: 教師資料
action: action:
add: 新增 add: 新增
edit: 編輯 edit: 編輯

View File

@ -8,10 +8,10 @@ defaults: &defaults
development: development:
<<: *defaults <<: *defaults
database: prototype_r4_development database: demo_site_development
test: test:
<<: *defaults <<: *defaults
database: prototype_r4_test database: demo_site_test
# set these environment variables on your prod server # set these environment variables on your prod server
production: production:
@ -21,5 +21,4 @@ production:
# password: <%= ENV['MONGOID_PASSWORD'] %> # password: <%= ENV['MONGOID_PASSWORD'] %>
# database: <%= ENV['MONGOID_DATABASE'] %> # database: <%= ENV['MONGOID_DATABASE'] %>
<<: *defaults <<: *defaults
database: prototype_r4_ldap0229 database: demo_site_production
slave_ok: true

View File

@ -217,6 +217,7 @@ Orbit::Application.routes.draw do
match '/desktop_appstore/widgets_settings'=>'desktop_appstore#widgets_settings' match '/desktop_appstore/widgets_settings'=>'desktop_appstore#widgets_settings'
match '/desktop_orbit/orbit' => 'desktop_orbit#orbit' match '/desktop_orbit/orbit' => 'desktop_orbit#orbit'
match '/desktop_orbit/eventajaxload'=> 'desktop_orbit#eventajaxload' match '/desktop_orbit/eventajaxload'=> 'desktop_orbit#eventajaxload'
match '/desktop_orbit/gettimelinespan' => 'desktop_orbit#gettimelinespan' match '/desktop_orbit/gettimelinespan' => 'desktop_orbit#gettimelinespan'
@ -227,7 +228,7 @@ Orbit::Application.routes.draw do
match '/desktop/temp_func/'=>'desktop#temp_func' match '/desktop/temp_func/'=>'desktop#temp_func'
match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request| match '/panel/:app_name/front_end/:app_action/:id(/:controller_action)' => 'pages#show_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true") !request.query_string.include?("inner=true")
} }

View File

@ -135,19 +135,18 @@ module OrbitCoreLib
module PermissionUnility module PermissionUnility
private private
def check_permission(type = :use) def check_permission(type = :use)
setup_vars permission_grant = current_or_guest_user.admin?? true : false
permission_grant = current_user.admin?? true : false
module_app = @module_app.nil?? find_module_app_by_token(params[:token]) : @module_app module_app = @module_app.nil?? find_module_app_by_token(params[:token]) : @module_app
unless permission_grant unless permission_grant
permission_grant = case type permission_grant = case type
when :use when :use
users_ary = module_app.app_auth.auth_users rescue nil users_ary = module_app.app_auth.auth_users rescue nil
users_ary = [] if users_ary.nil? users_ary = [] if users_ary.nil?
(users_ary.include?(current_user) || module_app.is_manager?(current_user) || module_app.is_sub_manager?(current_user)) (users_ary.include?(current_or_guest_user) || module_app.is_manager?(current_or_guest_user) || module_app.is_sub_manager?(current_or_guest_user))
when :manager when :manager
module_app.is_manager?(current_user) module_app.is_manager?(current_or_guest_user)
when :sub_manager when :sub_manager
module_app.is_manager?(current_user) || module_app.is_sub_manager?(current_user) module_app.is_manager?(current_or_guest_user) || module_app.is_sub_manager?(current_or_guest_user)
end end
end end
permission_grant permission_grant

View File

@ -189,6 +189,7 @@ module ParserCommon
if (content["main"] == "true" && !page.module_app.nil?) if (content["main"] == "true" && !page.module_app.nil?)
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}" ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}"
ret << "/#{params[:id]}" if params[:id] && !params[:id].eql?(page.id.to_s) ret << "/#{params[:id]}" if params[:id] && !params[:id].eql?(page.id.to_s)
ret << "/#{params[:controller_action]}" if params[:controller_action] && params[:id]
ret << "?inner=true&page_id=#{page.id}&category_id=#{category}&tag_id=#{tag}&preview=#{params[:preview]}&page_main=#{params[:page_main]}&search_query=#{params[:search_query]}&name=#{params[:name]}" ret << "?inner=true&page_id=#{page.id}&category_id=#{category}&tag_id=#{tag}&preview=#{params[:preview]}&page_main=#{params[:page_main]}&search_query=#{params[:search_query]}&name=#{params[:name]}"
ret << "'></div>" ret << "'></div>"
else else

View File

@ -0,0 +1,240 @@
# encoding: utf-8
namespace :build_new_member do
task :sub_role_tags_generate => :environment do
SubRoleTag.destroy_all
role_keys = %w{teacher staff student}
role_keys.each do |role_key|
role = Role.first({conditions:{key: role_key}})
puts "Starting with Role with key: #{role_key}"
role.sub_roles.each do |sr|
puts "Role : #{role_key} => #{sr.title}"
for i in 1..7
sr.tags.build(:en => "Students-#{sr.title_translations['en']}_#{i}" , :zh_tw => "在校學生-#{sr.title_translations['zh_tw']}_#{i}" , :key => "#{role_key}_#{sr.title_translations['en'].parameterize}_#{i}" )
end
sr.save
end
end
end
task :fields_for_teacher => :environment do
sub_role_attribute_fields_template = [
{key: 'status', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"狀態", "en"=>"Status"}, neutral_title: nil },
{key: 'other_position', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"其他職位", "en"=>"Other Position"}, neutral_title: nil },
{key: 'research_domain', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"研究領域", "en"=>"Research Domain"}, neutral_title: nil },
{key: 'teaching_domain', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"授課領域", "en"=>"Teaching Domain"}, neutral_title: nil }
]
role = Role.first({conditions:{key: 'teacher'}})
role.sub_roles.each{|sb|
sb.attribute_fields.destroy_all
sub_role_attribute_fields_template.each{|att_f|
sb.attribute_fields.build att_f
}
sb.save
}
end
task :fields_for_student => :environment do
sub_role_attribute_fields_template = [
{key: 'status', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"狀態", "en"=>"Status"}, neutral_title: nil },
{key: 'entrance_year', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"入學年", "en"=>"Entrance Year"}, neutral_title: nil },
{key: 'graduation_date', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"屆別", "en"=>"Graduation Date"}, neutral_title: nil },
{key: 'actual_graduation', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"實際畢業年", "en"=>"Actual Graduation"}, neutral_title: nil }
]
role = Role.first({conditions:{key: 'student'}})
role.sub_roles.each{|sb|
sb.attribute_fields.destroy_all
sub_role_attribute_fields_template.each{|att_f|
sb.attribute_fields.build att_f
}
sb.save
}
end
task :fields_for_staff => :environment do
sub_role_attribute_fields_template = [
{key: 'status', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"狀態", "en"=>"Status"}, neutral_title: nil },
{key: 'responsibilities', markup: "text_field", locale: true, list_options: nil, built_in: true, disabled: false, locale_title_translations: {"zh_tw"=>"負責業務", "en"=>"Responsibilities"}, neutral_title: nil }
]
role = Role.first({conditions:{key: 'staff'}})
role = Role.create!({key: "staff", built_in: true, disabled: false, title_translations: {"en"=>"Staff", "zh_tw"=>"行政人員"}}) if role.nil?
role.sub_roles.each{|sb|
sb.attribute_fields.destroy_all
sub_role_attribute_fields_template.each{|att_f|
sb.attribute_fields.build att_f
}
sb.save
}
end
task :matt_data => :environment do
b = User.first({conditions:{email: 'matt@rulingcom.com'}})
b.attribute_values.destroy_all
data = [{:key=> 'last_name',:en=>'Fu',:zh_tw=>'傅'},
{:key=> 'first_name',:en=>'Matt',:zh_tw=>'儒淵'},
{:key=> 'nick_name',:en=> 'Matt K.',:zh_tw=> 'Matt K.'},
{:key=> 'addr',:en=>'Earth',:zh_tw=>'302新竹縣竹北市嘉豐南路二段101號'},
{:key=> 'phone',:en=>'035508881',:zh_tw=>'035508881'},
{:key=> 'gender',:en=>'Male',:zh_tw=>'男'},
{:key=> 'birthday',:en=>'1986',:zh_tw=>'1986'},
{:key=> 'email',:en=>'matt@rulingcom.com',:zh_tw=>'matt@rulingcom.com'}]
data_hash = Hash[data.map{|t| [t[:key],t] }]
Info.first.attribute_fields.each do |profile_field|
b.attribute_values.build(data_hash.fetch(profile_field.key).merge({:attribute_field_id=>profile_field.id}))
end
#==================================================================
b.roles = []
b.roles << Role.first({conditions:{key: 'teacher'}})
b.roles << Role.first({conditions:{key: 'student'}})
#==================================================================
b.sub_roles = []
sr_1 = b.roles.first.sub_roles.last
sr_2 = b.roles.last.sub_roles.last
b.sub_roles << sr_1 #use teacher data
b.sub_roles << sr_2 #use student data
#==================================================================
# to get field for fast fill up: sr_2.attribute_fields.map{|t| Hash[t.key,nil]}
{"status"=>"兼職","research_domain"=>"神經網絡","teaching_domain"=>"平行運算"}.each do |key, value|
field = sr_1.attribute_fields.where({key: key}).first
b.attribute_values.build({key=>value}.merge({:key=>field.key,:attribute_field_id=>field.id}))
end
{"status"=>"在學中","entrance_year"=>2010}.each do |key, value|
field = sr_2.attribute_fields.where({key: key}).first
b.attribute_values.build({key=>value}.merge({:key=>field.key,:attribute_field_id=>field.id}))
end
# b.attribute_values.build :key=> 'last_name',:en=>'Fu',:zh_tw=>'傅'
# b.attribute_values.build :key=> 'first_name',:en=>'Matt',:zh_tw=>'儒淵'
# b.attribute_values.build :key=> 'nick_name',:en=> 'Matt K.',:zh_tw=> 'Matt K.'
# b.attribute_values.build :key=> 'addr',:en=>'Earth',:zh_tw=>'302新竹縣竹北市嘉豐南路二段101號'
# b.attribute_values.build :key=> 'phone',:en=>'035508881',:zh_tw=>'035508881'
# b.attribute_values.build :key=> 'gender',:en=>'Male',:zh_tw=>'男'
# b.attribute_values.build :key=> 'birthday',:en=>'1986',:zh_tw=>'1986'
# b.attribute_values.build :key=> 'email',:en=>'matt@rulingcom.com',:zh_tw=>'matt@rulingcom.com'
b.save
end
task :chris_data => :environment do
b = User.first({conditions:{email: 'chris@rulingcom.com'}})
b.attribute_values.destroy_all
b.attribute_values.build :key=> 'last_name',:en=>'Vilayphiou',:zh_tw=>'林'
b.attribute_values.build :key=> 'first_name',:en=>'Christophe',:zh_tw=>'順發'
b.attribute_values.build :key=> 'nick_name',:en=> 'Chris',:zh_tw=> 'Chris'
b.attribute_values.build :key=> 'addr',:en=>'asdsaddasdasd',:zh_tw=>'302新竹縣竹北市嘉豐南路二段101號'
b.attribute_values.build :key=> 'phone',:en=>'035508881',:zh_tw=>'035508881'
b.attribute_values.build :key=> 'gender',:en=>'Male',:zh_tw=>'男'
b.attribute_values.build :key=> 'birthday',:en=>'1990',:zh_tw=>'1990'
b.attribute_values.build :key=> 'email',:en=>'chris@rulingcom.com',:zh_tw=>'chris@rulingcom.com'
b.save
end
task :module_app => :environment do
ModuleApp.create!(:key=>"new_member",
:title=>"new_member",
:version=> "0.1",
:organization => "Rulingcom",
:author => "RD dep",
:intro => "New interface for member menagement",
:enable_frontend => true)
end
task :sub_role => :environment do
teacher_role = Role.first({conditions:{key: 'teacher'}})
teacher_role.sub_roles.destroy_all
teacher_sub_roles ={
:professor => {"zh_tw"=>"教授", "en"=>"Professor"},
:lecturer => {"zh_tw"=>"講師", "en"=>"Lecturer"},
:associate_professor => {"zh_tw"=>"副教授", "en"=>"Associate Professor"},
:assistant_professor => {"zh_tw"=>"助理教授", "en"=>"Assistant Professor"}
}
teacher_sub_roles.each do |key,title|
teacher_role.sub_roles.build :key=>key,:title_translations=>title,:built_in=>true
puts "=SubRole key:#{key}\t Title:#{title}"
end
teacher_role.save
p "==Finished building sub_roles for Teachers"
student_role = Role.first({conditions:{key: 'student'}})
student_role.sub_roles.destroy_all
student_sub_roles ={
:ph_d => {"zh_tw"=>"博士班", "en"=>"Ph.D"},
:master => {"zh_tw"=>"碩士班", "en"=>"Master"},
:bachelor => {"zh_tw"=>"學士班", "en"=>"Bachelor"},
}
student_sub_roles.each do |key,title|
student_role.sub_roles.build :key=>key,:title_translations=>title,:built_in=>true
puts "=SubRole key:#{key}\t Title:#{title}"
end
student_role.save
p "==Finished building sub_roles for Students"
staff_role = Role.first({conditions:{key: 'staff'}})
staff_role.sub_roles.destroy_all
staff_sub_roles ={
:general => {"zh_tw"=>"一般", "en"=>"General"}
}
staff_sub_roles.each do |key,title|
staff_role.sub_roles.build :key=>key,:title_translations=>title,:built_in=>true
puts "=SubRole key:#{key}\t Title:#{title}"
end
staff_role.save
p "==Finished building sub_roles for Staff"
staff_role = Role.first({conditions:{key: 'staff'}})
staff_role.sub_roles.destroy_all
staff_sub_roles ={
:general => {"zh_tw"=>"一般", "en"=>"General"}
}
staff_sub_roles.each do |key,title|
staff_role.sub_roles.build :key=>key,:title_translations=>title,:built_in=>true
puts "=SubRole key:#{key}\t Title:#{title}"
end
staff_role.save
p "==Finished building sub_roles for Staff"
end
# task :status => :environment do
# teacher_role = Role.first({conditions:{key: 'teacher'}})
# teacher_role.statuses.destroy_all
# teacher_status ={
# :fulltime => {"en"=>"Full Time", "zh_tw"=>"全職"},
# :adjunct => {"en"=>"Adjunct", "zh_tw"=>"兼職"},
# :co_hiring => {"en"=>"Co Hiring", "zh_tw"=>"合聘"},
# :distinguished => {"en"=>"Distinguished", "zh_tw"=>"特聘"}
# }
# teacher_status.each do |key,title|
# teacher_role.statuses.build :key=>key,:title_translations=>title
# puts "=Status key:#{key}\t Title:#{title}"
# end
# teacher_role.save
# p "==Finished building status for Teachers"
# student_role = Role.first({conditions:{key: 'student'}})
# student_status.statuses.destroy_all
# student_status ={
# :studying => {"en"=>"Studying", "zh_tw"=>"在學"},
# :drop_out => {"en"=>"Drop-out", "zh_tw"=>"休學"},
# :alumi => {"en"=>"Alumi", "zh_tw"=>"校友"},
# :suspended => {"en"=>"Suspended", "zh_tw"=>"未完成"}
# }
# student_status.each do |key,title|
# student_role.statuses.build :key=>key,:title_translations=>title
# puts "=Status key:#{key}\t Title:#{title}"
# end
# student_role.save
# p "==Finished building status for Students"
# end
end

View File

@ -96,4 +96,8 @@ namespace :data_migration do
app.save! app.save!
end end
task :rename_attribute_field => :environment do
AttributeField.collection.update({},{'$rename' => {'title' => 'locale_title'}}, multi: true, safe: true)
end
end end

View File

@ -0,0 +1,37 @@
/*
* Smart event highlighting
* Handles when events span rows, or don't have a background color
*/
jQuery(document).ready(function($) {
var highlight_color = "#2EAC6A";
// highlight events that have a background color
$(".ec-event-bg").live("mouseover", function() {
event_id = $(this).attr("data-event-id");
event_class_name = $(this).attr("data-event-class");
$(".ec-"+event_class_name+"-"+event_id).css("background-color", highlight_color);
});
$(".ec-event-bg").live("mouseout", function() {
event_id = $(this).attr("data-event-id");
event_class_name = $(this).attr("data-event-class");
event_color = $(this).attr("data-color");
$(".ec-"+event_class_name+"-"+event_id).css("background-color", event_color);
});
// highlight events that don't have a background color
$(".ec-event-no-bg").live("mouseover", function() {
ele = $(this);
ele.css("color", "white");
ele.find("a").css("color", "white");
ele.find(".ec-bullet").css("background-color", "white");
ele.css("background-color", highlight_color);
});
$(".ec-event-no-bg").live("mouseout", function() {
ele = $(this);
event_color = $(this).attr("data-color");
ele.css("color", event_color);
ele.find("a").css("color", event_color);
ele.find(".ec-bullet").css("background-color", event_color);
ele.css("background-color", "transparent");
});
});

View File

@ -0,0 +1,237 @@
/*
Event Calendar stylesheet
Colors:
#d5d5d5 - border (gray)
#303030 - day names bg (gray)
#444 - number (gray)
#ecede2 - day header bg (light tan)
##d7d7ba - today header bg (tan)
#ffffdd - today bg light (yellow)
#777 - other month number (gray)
#efefef - other month day header (gray)
#2eac6a - hover (green)
*/
/* Outer most container */
.ec-calendar {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 11px;
line-height: 14px;
margin: 0;
padding: 0;
border-bottom: 1px solid #d5d5d5;
}
/* Month name header & links */
.ec-calendar-header {
padding: 5px 0;
width: 100%;
table-layout: fixed;
}
.ec-month-name {
font-size: 16px;
font-weight: bold;
}
.ec-month-nav {
}
/* Containers */
.ec-body {
position: relative;
border-right: 1px solid #303030;
white-space: nowrap;
}
/* Day names */
.ec-day-names {
position: absolute;
top: 0;
left: 0;
width: 100%;
table-layout: fixed;
padding: 2px 0;
background: #303030;
color: white;
}
.ec-day-name {
font-weight: normal;
}
/* Rows container and Row */
.ec-rows {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
background: white;
overflow: hidden;
border-right: 1px solid #d5d5d5;
}
.ec-row {
position: absolute;
left: 0;
width: 100%;
overflow: hidden;
}
/* Background */
.ec-row-bg {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
table-layout: fixed;
}
.ec-day-bg {
border-left: 1px solid #d5d5d5;
}
.ec-today-bg {
background-color: #ffffdd;
}
.ec-row-table {
position: relative;
width: 100%;
table-layout: fixed;
}
/* Day header */
.ec-day-header {
color: #444;
text-align: right;
padding: 0 5px;
line-height: 16px;
border-top: 1px solid #d5d5d5;
border-left: 1px solid #d5d5d5;
border-bottom: 1px dotted #bbbbbb;
background-color: #ecede2;
overflow: hidden;
}
a.ec-day-link {
color: #444;
}
.ec-today-header {
background-color: #d7d7ba;
}
.ec-weekend-day-header {
}
.ec-other-month-header {
background-color: #efefef;
color: #777;
}
.ec-other-month-bg {
}
/* Event cell and container */
.ec-event-cell {
cursor: pointer;
vertical-align: top;
padding-right: 1px;
padding-left: 2px;
}
.ec-event-cell a {
text-decoration: none;
display: block;
width: 100%;
height: 100%;
}
.ec-no-event-cell {
cursor: default;
}
.ec-event {
color: white;
padding-right: 1px;
padding-left: 11px;
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
-moz-border-radius: 3px;
overflow: hidden;
white-space: nowrap;
}
.ec-event :hover {
/* doesn't look as good as js highlighting */
/* background-color: #2eac6a; */
}
.ec-event-bg a {
color: white;
}
/* used to distinguish non-all_day events */
.ec-event-no-bg {
position: relative;
/* padding-left: 5px; */
}
.ec-event-no-bg a {
/* isn't implemented in all browsers */
color: inherit;
}
.ec-event-time {
font-size: 85%;
font-weight: bold;
padding-right: 3px;
}
/* Left and right arrows */
/* Doesn't work in IE6, use bg images instead */
.ec-left-arrow, .ec-right-arrow {
position: relative;
top: 3px;
width: 0;
height: 0;
font-size: 0;
line-height: 0;
margin-bottom: -8px;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
}
.ec-left-arrow {
margin-left: -7px;
margin-right: auto;
border-right: 4px solid white;
}
.ec-right-arrow {
margin-left: auto;
margin-right: 3px;
border-left: 4px solid white;
}
/* remove this to not have a bullet */
/* don't look as good in ie */
.ec-bullet {
position: absolute;
top: 7px;
width: 4px;
height: 4px;
margin-left: -7px;
margin-right: auto;
-webkit-border-radius: 2px;
-khtml-border-radius: 2px;
-moz-border-radius: 2px;
}

View File

@ -2,15 +2,16 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
include AdminHelper include AdminHelper
include OrbitControllerLib::DivisionForDisable include OrbitControllerLib::DivisionForDisable
layout 'new_admin' # before_filter :for_admin_only,:only => [:]
# before_filter :for_app_manager,:only => [:index,:show,]
before_filter :authenticate_user! before_filter :force_order_for_visitor,:only=>[:index,:show,:get_sorted_and_filtered_bulletins]
before_filter :force_order_for_user,:except => [:index,:show,:get_sorted_and_filtered_bulletins]
before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_bulletins]
before_filter :only => [ :new,:create,:edit,:update,:create] do |controller| before_filter :only => [ :new,:create,:edit,:update,:create] do |controller|
controller.get_categorys('BulletinCategory') controller.get_categorys('BulletinCategory')
end end
# before_filter :for_admin_only,:only => [:]
# before_filter :for_app_manager,:only => [:index,:show,]
before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_bulletins]
def index def index
# @bulletins = Bulletin.all # @bulletins = Bulletin.all
# @bulletins = Bulletin.desc("postdate desc") # @bulletins = Bulletin.desc("postdate desc")

View File

@ -1,6 +1,6 @@
<tr id="<%= dom_id bulletin %>" class="with_action"> <tr id="<%= dom_id bulletin %>" class="with_action">
<td> <td>
<% if (bulletin.create_user_id == current_user.id) || is_manager? %> <% if (bulletin.create_user_id == current_or_guest_user.id) || is_manager? %>
<%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %> <%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %>
<% end -%> <% end -%>
</td> </td>
@ -33,9 +33,9 @@
<%= show_bulletin_title_at_index bulletin%> <%= show_bulletin_title_at_index bulletin%>
<div class="quick-edit"> <div class="quick-edit">
<ul class="nav nav-pills hide"> <ul class="nav nav-pills hide">
<% if (bulletin.create_user_id == current_user.id) || is_manager? %> <% if (bulletin.create_user_id == current_or_guest_user.id) || is_manager? %>
<% if current_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %> <% if current_or_guest_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
<li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li> <li><%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li>
<li class="dropdown"> <li class="dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a> <a href="#" data-toggle="dropdown" class="dropdown-toggle"><%= t(:quick_edit) %><b class="caret"></b></a>
@ -43,7 +43,7 @@
<li><%= link_to t(:basic), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'basic'), :remote => true %></li> <li><%= link_to t(:basic), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'basic'), :remote => true %></li>
<li><%#= link_to t(:picture), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'picture'), :remote => true %></li> <li><%#= link_to t(:picture), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'picture'), :remote => true %></li>
<li><%= link_to t(:tags), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'tags'), :remote => true %></li> <li><%= link_to t(:tags), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'tags'), :remote => true %></li>
<li><%#= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %></li> <li><%= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %></li>
<li><%#= link_to t(:file), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li> <li><%#= link_to t(:file), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %></li>
</ul> </ul>
</li> </li>

View File

@ -1,3 +1,3 @@
<div class="filter-clear"> <div class="filter-clear">
<%= link_to content_tag(:i, nil, :class => 'icons-brush-large') + t(:clear), panel_announcement_back_end_bulletins_path(:filter => @filter, :sort => params[:sort], :direction => params[:direction], :clear => true, :type => type), :class => "btn js_history" %> <%= link_to content_tag(:i, nil, :class => 'icons-brush-large') + t(:clear), panel_announcement_back_end_bulletins_path(:filter => @filter, :sort => params[:sort], :direction => params[:direction], :clear => true, :type => type), :class => "btn btn-small js_history" %>
</div> </div>

View File

@ -1,6 +1,6 @@
<div class="accordion-inner" data-toggle="buttons-checkbox"> <div class="accordion-inner" data-toggle="buttons-checkbox">
<% @bulletin_categories.each do |category| -%> <% @bulletin_categories.each do |category| -%>
<%= link_to category.title, panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'categories', :id => category.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn js_history#{is_filter_active?('categories', category.id)}" %> <%= link_to category.title, panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'categories', :id => category.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('categories', category.id)}" %>
<% end -%> <% end -%>
</div> </div>
<%= render :partial => 'clear_filters', :locals => {:type => 'categories'} %> <%= render :partial => 'clear_filters', :locals => {:type => 'categories'} %>

View File

@ -1,9 +1,9 @@
<div class="accordion-inner" data-toggle="buttons-checkbox"> <div class="accordion-inner" data-toggle="buttons-checkbox">
<%= link_to t(:top), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_top'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn js_history#{is_filter_active?('status', 'is_top')}" %> <%= link_to t(:top), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_top'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_top')}" %>
<%= link_to t(:hot), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hot'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn js_history#{is_filter_active?('status', 'is_hot')}" %> <%= link_to t(:hot), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hot'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_hot')}" %>
<%= link_to t(:hidden), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hidden'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn js_history#{is_filter_active?('status', 'is_hidden')}" %> <%= link_to t(:hidden), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hidden'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_hidden')}" unless(is_guest?)%>
<%= link_to t(:pending), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_pending'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn js_history#{is_filter_active?('status', 'is_pending')}" %> <%= link_to t(:pending), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_pending'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_pending')}" if(is_manager?)%>
<%= link_to t(:passed), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_checked'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn js_history#{is_filter_active?('status', 'is_checked')}" %> <%= link_to t(:passed), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_checked'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_checked')}" if(is_manager?)%>
<%= link_to t(:rejected), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_rejected'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn js_history#{is_filter_active?('status', 'is_rejected')}" %> <%= link_to t(:rejected), panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_rejected'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_rejected')}" if(is_manager?)%>
</div> </div>
<%= render :partial => 'clear_filters', :locals => {:type => 'status'} %> <%= render :partial => 'clear_filters', :locals => {:type => 'status'} %>

View File

@ -1,6 +1,6 @@
<div class="accordion-inner" data-toggle="buttons-checkbox"> <div class="accordion-inner" data-toggle="buttons-checkbox">
<% @tags.each do |tag| -%> <% @tags.each do |tag| -%>
<%= link_to tag[I18n.locale], panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn js_history#{is_filter_active?('tags', tag.id)}" %> <%= link_to tag[I18n.locale], panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('tags', tag.id)}" %>
<% end -%> <% end -%>
</div> </div>
<%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %> <%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %>

View File

@ -211,18 +211,57 @@
<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i><%= t(:add) %></span></a> <a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i><%= t(:add) %></span></a>
<p><%= t("sys.limit_of_upload_file_size",:best_size => '3MB') %></p> <p><%= t("sys.limit_of_upload_file_size",:best_size => '3MB') %></p>
<p><%= t("sys.preview_only_for_img") %></p> <p><%= t("sys.preview_only_for_img") %></p>
</div>
<fieldset>
<input type="hidden" id="MAX_FILE_SIZE" name="MAX_FILE_SIZE" value="300000" />
<div id="filedrag">
<div class="point">Drop files here
<span>or</span>
<label class="file-select" for="fileselect">select from a folder
<!-- <input type="file" class="upload" id="fileselect" name="fileselect[]" multiple="multiple" /> -->
<%= f.fields_for @bulletin.bulletin_files.build, do |f| %>
<%= f.file_field :file, :multiple => true, :class => 'upload', :id => 'fileselect' %>
<% end %>
</label>
</div>
</div>
<div id="submitbutton">
<button type="submit">Upload Files</button>
</div>
</fieldset>
<div>
<table class="table table-condensed">
<thead>
<tr>
<th>File Name</th>
<th class="span2">Chinese</th>
<th class="span2">English</th>
<th class="span1"></th>
</tr>
</thead>
<tfoot>
<tr>
<td>File Name</td>
<td><input type="checkbox" id="optionsCheckbox" value="true" disabled /></td>
<td><input type="checkbox" id="optionsCheckbox" value="true" disabled checked /></td>
<td><a class="action" data-toggle="modal" href="#modal-link"><i class="icon-pencil"></i></a><a class="action" href=""><i class="icon-remove"></i></a></td>
</tr>
</tfoot>
<tbody id="messages">
</tbody>
</table>
</div> </div>
</td> </td>
</tr> </tr>
</tfoot> </tfoot>
<tbody> <tbody>
<% @bulletin.bulletin_files.each_with_index do |bulletin_file, i| %> <%# @bulletin.bulletin_files.each_with_index do |bulletin_file, i| %>
<%#= fields_for "bulletin[bulletin_files][]", bulletin_file do |f| %> <%#= fields_for "bulletin[bulletin_files][]", bulletin_file do |f| %>
<%= f.fields_for :bulletin_files, bulletin_file do |f| %> <%#= f.fields_for :bulletin_files do |f| %>
<%= render :partial => 'form_bulletin_file', :object => bulletin_file, :locals => {:f => f, :i => i} %> <%#= render :partial => 'form_bulletin_file', :object => bulletin_file, :locals => {:f => f, :i => i} %>
<% end %> <%# end %>
<% end %> <%# end %>
</tbody> </tbody>
</table> </table>

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