fix announcement links & files
This commit is contained in:
commit
a755eb184b
5
Gemfile
5
Gemfile
|
@ -1,6 +1,8 @@
|
||||||
source 'http://rubygems.org'
|
source 'http://rubygems.org'
|
||||||
gem 'rails', '>=3.1.0', '<3.2.0'
|
gem 'rails', '>=3.1.0', '<3.2.0'
|
||||||
|
|
||||||
|
gem "brakeman"
|
||||||
|
|
||||||
gem 'bson_ext'
|
gem 'bson_ext'
|
||||||
gem 'carrierwave'
|
gem 'carrierwave'
|
||||||
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
|
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
|
||||||
|
@ -13,6 +15,7 @@ gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git'
|
||||||
|
|
||||||
gem 'mini_magick'
|
gem 'mini_magick'
|
||||||
gem 'mongoid'
|
gem 'mongoid'
|
||||||
|
gem "mongo_session_store-rails3"
|
||||||
gem 'radius'
|
gem 'radius'
|
||||||
gem 'rake'
|
gem 'rake'
|
||||||
gem 'ruby-debug19'
|
gem 'ruby-debug19'
|
||||||
|
@ -20,7 +23,7 @@ gem 'rubyzip'
|
||||||
gem 'sinatra'
|
gem 'sinatra'
|
||||||
gem 'sprockets'
|
gem 'sprockets'
|
||||||
gem 'tinymce-rails'
|
gem 'tinymce-rails'
|
||||||
# gem 'therubyracer'
|
#gem 'therubyracer'
|
||||||
|
|
||||||
# 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.
|
||||||
|
|
140
Gemfile.lock
140
Gemfile.lock
|
@ -10,48 +10,55 @@ GIT
|
||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (3.1.3)
|
actionmailer (3.1.4)
|
||||||
actionpack (= 3.1.3)
|
actionpack (= 3.1.4)
|
||||||
mail (~> 2.3.0)
|
mail (~> 2.3.0)
|
||||||
actionpack (3.1.3)
|
actionpack (3.1.4)
|
||||||
activemodel (= 3.1.3)
|
activemodel (= 3.1.4)
|
||||||
activesupport (= 3.1.3)
|
activesupport (= 3.1.4)
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
i18n (~> 0.6)
|
i18n (~> 0.6)
|
||||||
rack (~> 1.3.5)
|
rack (~> 1.3.6)
|
||||||
rack-cache (~> 1.1)
|
rack-cache (~> 1.1)
|
||||||
rack-mount (~> 0.8.2)
|
rack-mount (~> 0.8.2)
|
||||||
rack-test (~> 0.6.1)
|
rack-test (~> 0.6.1)
|
||||||
sprockets (~> 2.0.3)
|
sprockets (~> 2.0.3)
|
||||||
activemodel (3.1.3)
|
activemodel (3.1.4)
|
||||||
activesupport (= 3.1.3)
|
activesupport (= 3.1.4)
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
i18n (~> 0.6)
|
i18n (~> 0.6)
|
||||||
activerecord (3.1.3)
|
activerecord (3.1.4)
|
||||||
activemodel (= 3.1.3)
|
activemodel (= 3.1.4)
|
||||||
activesupport (= 3.1.3)
|
activesupport (= 3.1.4)
|
||||||
arel (~> 2.2.1)
|
arel (~> 2.2.3)
|
||||||
tzinfo (~> 0.3.29)
|
tzinfo (~> 0.3.29)
|
||||||
activeresource (3.1.3)
|
activeresource (3.1.4)
|
||||||
activemodel (= 3.1.3)
|
activemodel (= 3.1.4)
|
||||||
activesupport (= 3.1.3)
|
activesupport (= 3.1.4)
|
||||||
activesupport (3.1.3)
|
activesupport (3.1.4)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
archive-tar-minitar (0.5.2)
|
archive-tar-minitar (0.5.2)
|
||||||
arel (2.2.1)
|
arel (2.2.3)
|
||||||
bcrypt-ruby (3.0.1)
|
|
||||||
bcrypt-ruby (3.0.1-x86-mingw32)
|
bcrypt-ruby (3.0.1-x86-mingw32)
|
||||||
bson (1.5.2)
|
brakeman (1.5.1)
|
||||||
bson_ext (1.5.2)
|
activesupport
|
||||||
bson (= 1.5.2)
|
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)
|
builder (3.0.0)
|
||||||
carrierwave (0.5.8)
|
carrierwave (0.5.8)
|
||||||
activesupport (~> 3.0)
|
activesupport (~> 3.0)
|
||||||
carrierwave-mongoid (0.1.3)
|
carrierwave-mongoid (0.1.3)
|
||||||
carrierwave (>= 0.5.6)
|
carrierwave (>= 0.5.6)
|
||||||
mongoid (~> 2.1)
|
mongoid (~> 2.1)
|
||||||
chronic (0.6.6)
|
chronic (0.6.7)
|
||||||
coffee-rails (3.1.1)
|
coffee-rails (3.1.1)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (~> 3.1.0)
|
railties (~> 3.1.0)
|
||||||
|
@ -59,26 +66,32 @@ GEM
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.2.0)
|
coffee-script-source (1.2.0)
|
||||||
|
color (1.4.1)
|
||||||
columnize (0.3.6)
|
columnize (0.3.6)
|
||||||
database_cleaner (0.7.1)
|
database_cleaner (0.7.1)
|
||||||
delorean (1.2.0)
|
delorean (1.2.0)
|
||||||
chronic
|
chronic
|
||||||
devise (1.5.3)
|
devise (2.0.4)
|
||||||
bcrypt-ruby (~> 3.0)
|
bcrypt-ruby (~> 3.0)
|
||||||
orm_adapter (~> 0.0.3)
|
orm_adapter (~> 0.0.3)
|
||||||
warden (~> 1.1)
|
railties (~> 3.1)
|
||||||
|
warden (~> 1.1.1)
|
||||||
diff-lcs (1.1.3)
|
diff-lcs (1.1.3)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
exception_notification (2.5.2)
|
exception_notification (2.5.2)
|
||||||
actionmailer (>= 3.0.4)
|
actionmailer (>= 3.0.4)
|
||||||
execjs (1.3.0)
|
execjs (1.3.0)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
factory_girl (2.5.0)
|
factory_girl (2.6.3)
|
||||||
activesupport
|
activesupport (>= 2.3.9)
|
||||||
factory_girl_rails (1.6.0)
|
factory_girl_rails (1.7.0)
|
||||||
factory_girl (~> 2.5.0)
|
factory_girl (~> 2.6.0)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
|
fastercsv (1.5.4)
|
||||||
|
haml (3.1.4)
|
||||||
hike (1.2.1)
|
hike (1.2.1)
|
||||||
|
hoe (2.16.1)
|
||||||
|
rake (~> 0.8)
|
||||||
i18n (0.6.0)
|
i18n (0.6.0)
|
||||||
jquery-rails (1.0.19)
|
jquery-rails (1.0.19)
|
||||||
railties (~> 3.0)
|
railties (~> 3.0)
|
||||||
|
@ -86,24 +99,30 @@ GEM
|
||||||
json (1.6.5)
|
json (1.6.5)
|
||||||
linecache19 (0.5.12)
|
linecache19 (0.5.12)
|
||||||
ruby_core_source (>= 0.1.4)
|
ruby_core_source (>= 0.1.4)
|
||||||
mail (2.3.0)
|
mail (2.3.3)
|
||||||
i18n (>= 0.4.0)
|
i18n (>= 0.4.0)
|
||||||
mime-types (~> 1.16)
|
mime-types (~> 1.16)
|
||||||
treetop (~> 1.4.8)
|
treetop (~> 1.4.8)
|
||||||
mime-types (1.17.2)
|
mime-types (1.17.2)
|
||||||
mini_magick (3.4)
|
mini_magick (3.4)
|
||||||
subexec (~> 0.2.1)
|
subexec (~> 0.2.1)
|
||||||
mongo (1.5.2)
|
mongo (1.6.1)
|
||||||
bson (= 1.5.2)
|
bson (~> 1.6.1)
|
||||||
mongoid (2.4.2)
|
mongo_session_store-rails3 (3.0.5)
|
||||||
|
actionpack (>= 3.0)
|
||||||
|
mongo
|
||||||
|
mongoid (2.4.6)
|
||||||
activemodel (~> 3.1)
|
activemodel (~> 3.1)
|
||||||
mongo (~> 1.3)
|
mongo (~> 1.3)
|
||||||
tzinfo (~> 0.3.22)
|
tzinfo (~> 0.3.22)
|
||||||
multi_json (1.0.4)
|
multi_json (1.1.0)
|
||||||
orm_adapter (0.0.6)
|
orm_adapter (0.0.6)
|
||||||
|
pdf-writer (1.1.8)
|
||||||
|
color (>= 1.4.0)
|
||||||
|
transaction-simple (~> 1.3)
|
||||||
polyglot (0.3.3)
|
polyglot (0.3.3)
|
||||||
rack (1.3.6)
|
rack (1.3.6)
|
||||||
rack-cache (1.1)
|
rack-cache (1.2)
|
||||||
rack (>= 0.4)
|
rack (>= 0.4)
|
||||||
rack-mount (0.8.3)
|
rack-mount (0.8.3)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
|
@ -113,18 +132,18 @@ GEM
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.1)
|
rack-test (0.6.1)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
radius (0.7.1)
|
radius (0.7.3)
|
||||||
rails (3.1.3)
|
rails (3.1.4)
|
||||||
actionmailer (= 3.1.3)
|
actionmailer (= 3.1.4)
|
||||||
actionpack (= 3.1.3)
|
actionpack (= 3.1.4)
|
||||||
activerecord (= 3.1.3)
|
activerecord (= 3.1.4)
|
||||||
activeresource (= 3.1.3)
|
activeresource (= 3.1.4)
|
||||||
activesupport (= 3.1.3)
|
activesupport (= 3.1.4)
|
||||||
bundler (~> 1.0)
|
bundler (~> 1.0)
|
||||||
railties (= 3.1.3)
|
railties (= 3.1.4)
|
||||||
railties (3.1.3)
|
railties (3.1.4)
|
||||||
actionpack (= 3.1.3)
|
actionpack (= 3.1.4)
|
||||||
activesupport (= 3.1.3)
|
activesupport (= 3.1.4)
|
||||||
rack-ssl (~> 1.3.2)
|
rack-ssl (~> 1.3.2)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
rdoc (~> 3.4)
|
rdoc (~> 3.4)
|
||||||
|
@ -153,25 +172,33 @@ GEM
|
||||||
columnize (>= 0.3.1)
|
columnize (>= 0.3.1)
|
||||||
linecache19 (>= 0.5.11)
|
linecache19 (>= 0.5.11)
|
||||||
ruby-debug-base19 (>= 0.11.19)
|
ruby-debug-base19 (>= 0.11.19)
|
||||||
|
ruby2ruby (1.3.1)
|
||||||
|
ruby_parser (~> 2.0)
|
||||||
|
sexp_processor (~> 3.0)
|
||||||
ruby_core_source (0.1.5)
|
ruby_core_source (0.1.5)
|
||||||
archive-tar-minitar (>= 0.5.2)
|
archive-tar-minitar (>= 0.5.2)
|
||||||
rubyzip (0.9.5)
|
ruby_parser (2.3.1)
|
||||||
sass (3.1.12)
|
sexp_processor (~> 3.0)
|
||||||
|
rubyzip (0.9.6.1)
|
||||||
|
ruport (1.6.3)
|
||||||
|
fastercsv
|
||||||
|
pdf-writer (= 1.1.8)
|
||||||
|
sass (3.1.15)
|
||||||
sass-rails (3.1.5)
|
sass-rails (3.1.5)
|
||||||
actionpack (~> 3.1.0)
|
actionpack (~> 3.1.0)
|
||||||
railties (~> 3.1.0)
|
railties (~> 3.1.0)
|
||||||
sass (~> 3.1.10)
|
sass (~> 3.1.10)
|
||||||
tilt (~> 1.3.2)
|
tilt (~> 1.3.2)
|
||||||
|
sexp_processor (3.1.0)
|
||||||
shoulda-matchers (1.0.0)
|
shoulda-matchers (1.0.0)
|
||||||
simplecov (0.5.4)
|
simplecov (0.6.1)
|
||||||
multi_json (~> 1.0.3)
|
multi_json (~> 1.0)
|
||||||
simplecov-html (~> 0.5.3)
|
simplecov-html (~> 0.5.3)
|
||||||
simplecov-html (0.5.3)
|
simplecov-html (0.5.3)
|
||||||
sinatra (1.3.2)
|
sinatra (1.3.2)
|
||||||
rack (~> 1.3, >= 1.3.6)
|
rack (~> 1.3, >= 1.3.6)
|
||||||
rack-protection (~> 1.2)
|
rack-protection (~> 1.2)
|
||||||
tilt (~> 1.3, >= 1.3.3)
|
tilt (~> 1.3, >= 1.3.3)
|
||||||
spork (0.9.0)
|
|
||||||
spork (0.9.0-x86-mingw32)
|
spork (0.9.0-x86-mingw32)
|
||||||
win32-process
|
win32-process
|
||||||
sprockets (2.0.3)
|
sprockets (2.0.3)
|
||||||
|
@ -183,30 +210,32 @@ GEM
|
||||||
tilt (1.3.3)
|
tilt (1.3.3)
|
||||||
tinymce-rails (3.4.8)
|
tinymce-rails (3.4.8)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
|
transaction-simple (1.4.0)
|
||||||
|
hoe (>= 1.1.7)
|
||||||
treetop (1.4.10)
|
treetop (1.4.10)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
tzinfo (0.3.31)
|
tzinfo (0.3.32)
|
||||||
uglifier (1.2.2)
|
uglifier (1.2.3)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
multi_json (>= 1.0.2)
|
multi_json (>= 1.0.2)
|
||||||
warden (1.1.0)
|
warden (1.1.1)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
watchr (0.7)
|
watchr (0.7)
|
||||||
win32-api (1.4.8-x86-mingw32)
|
win32-api (1.4.8-x86-mingw32)
|
||||||
win32-process (0.6.5)
|
win32-process (0.6.5)
|
||||||
windows-pr (>= 1.1.2)
|
windows-pr (>= 1.1.2)
|
||||||
windows-api (0.4.0)
|
windows-api (0.4.1)
|
||||||
win32-api (>= 1.4.5)
|
win32-api (>= 1.4.5)
|
||||||
windows-pr (1.2.1)
|
windows-pr (1.2.1)
|
||||||
win32-api (>= 1.4.5)
|
win32-api (>= 1.4.5)
|
||||||
windows-api (>= 0.3.0)
|
windows-api (>= 0.3.0)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
|
||||||
x86-mingw32
|
x86-mingw32
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
brakeman
|
||||||
bson_ext
|
bson_ext
|
||||||
carrierwave
|
carrierwave
|
||||||
carrierwave-mongoid
|
carrierwave-mongoid
|
||||||
|
@ -220,6 +249,7 @@ DEPENDENCIES
|
||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari!
|
kaminari!
|
||||||
mini_magick
|
mini_magick
|
||||||
|
mongo_session_store-rails3
|
||||||
mongoid
|
mongoid
|
||||||
radius
|
radius
|
||||||
rails (>= 3.1.0, < 3.2.0)
|
rails (>= 3.1.0, < 3.2.0)
|
||||||
|
|
2
Rakefile
2
Rakefile
|
@ -5,4 +5,4 @@ require File.expand_path('../config/application', __FILE__)
|
||||||
require 'rake/dsl_definition'
|
require 'rake/dsl_definition'
|
||||||
require 'rake'
|
require 'rake'
|
||||||
|
|
||||||
PrototypeR4::Application.load_tasks
|
Orbit::Application.load_tasks
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -1,104 +1,100 @@
|
||||||
var viewportwidth,
|
var viewportwidth,
|
||||||
viewportheight;
|
viewportheight;
|
||||||
function resize() {
|
function resize() {
|
||||||
viewportheight=$(window).height();
|
viewportheight=$(window).height();
|
||||||
viewportwidth=$(window).width();
|
viewportwidth=$(window).width();
|
||||||
if(window.navigator.userAgent.indexOf("MSIE")>0){
|
if(window.navigator.userAgent.indexOf("MSIE")>0){
|
||||||
windH=document.clientHeight;
|
windH=document.clientHeight;
|
||||||
windW=document.clientWidht;
|
windW=document.clientWidht;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$(document).on('click', '.language-menu li', function(){
|
$(document).on('click', '.orbit-bar-member', function(){
|
||||||
$(this).each(function(i){
|
$(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open');
|
||||||
$(this).siblings().removeClass('active')
|
$('.bar-login .dropdown-menu').toggle();
|
||||||
$(this).addClass('active')
|
return false;
|
||||||
})
|
});
|
||||||
return false;
|
|
||||||
});
|
$(document).click(function() {
|
||||||
$(document).on('click', '.orbit-bar-member', function(){
|
$('.orbit-bar-member').removeClass("open");
|
||||||
$(this).hasClass('open') ? $(this).removeClass('open') : $(this).addClass('open');
|
$('.bar-login .dropdown-menu').hide();
|
||||||
$('.bar-login .dropdown-menu').toggle();
|
});
|
||||||
return false;
|
|
||||||
});
|
$(document).on('click', '.bar-login .dropdown-menu', function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
$(document).click(function() {
|
$('.bar-login .dropdown-menu').show();
|
||||||
$('.orbit-bar-member').removeClass("open");
|
});
|
||||||
$('.bar-login .dropdown-menu').hide();
|
|
||||||
});
|
$('.tip').tooltip({
|
||||||
|
placement: "left"
|
||||||
$(document).on('click', '.bar-login .dropdown-menu', function(e) {
|
});
|
||||||
e.stopPropagation();
|
|
||||||
$('.bar-login .dropdown-menu').show();
|
$(document).on('click', '.privacy', function() {
|
||||||
});
|
switch ($(this).val()) {
|
||||||
|
case 'true':
|
||||||
$('.tip').tooltip({
|
$(this).parents('.controls').children('.select-role').slideUp(300);
|
||||||
placement: "left"
|
break;
|
||||||
});
|
case 'false':
|
||||||
|
$(this).parents('.controls').children('.select-role').slideDown(300);
|
||||||
$(document).on('click', '.privacy', function() {
|
break;
|
||||||
switch ($(this).val()) {
|
}
|
||||||
case 'true':
|
});
|
||||||
$(this).parents('.controls').children('.select-role').slideUp(300);
|
|
||||||
break;
|
$(document).on('click', '.toggle-tr-edit', function() {
|
||||||
case 'false':
|
$(this).parents('tr').next('.qe-block').removeClass('hide');
|
||||||
$(this).parents('.controls').children('.select-role').slideDown(300);
|
$(this).parents('tr').next('.qe-block').find('.qe-edit-div').addClass('hide');
|
||||||
break;
|
$(this).parents('tr').next('.qe-block').find('#qe-' + $(this).attr('rel')).toggleClass('hide');
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
$(document).on('click', '.sort-header > .sort', function() {
|
||||||
$(document).on('click', '.toggle-tr-edit', function() {
|
$.getScript($(this).attr('rel'));
|
||||||
$(this).parents('tr').next('.qe-block').removeClass('hide');
|
});
|
||||||
$(this).parents('tr').next('.qe-block').find('.qe-edit-div').addClass('hide');
|
|
||||||
$(this).parents('tr').next('.qe-block').find('#qe-' + $(this).attr('rel')).toggleClass('hide');
|
/*tinyscrollbar&windows-Size*/
|
||||||
});
|
resize();
|
||||||
|
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2;
|
||||||
$(document).on('click', '.sort-header > .sort', function() {
|
$('#main-sidebar').css("height", viewportheight-30);
|
||||||
$.getScript($(this).attr('rel'));
|
$('#main-sidebar .viewport').css("height", viewportheight-30);
|
||||||
});
|
$('.post-title').css("width", viewportwidth-495);
|
||||||
|
$('#main-wrap > .subnav').css("width", viewportwidth-$mainWrapMarginLeft)
|
||||||
/*tinyscrollbar&windows-Size*/
|
$('#main-sidebar').tinyscrollbar();
|
||||||
resize();
|
$('.detal-list').tinyscrollbar();
|
||||||
$('#main-sidebar').css("height", viewportheight-40);
|
$('#main-sidebar').tinyscrollbar({size:(viewportheight-34)});
|
||||||
$('#main-sidebar .viewport').css("height", viewportheight-40);
|
mainTablePosition()
|
||||||
$('.post-title').css("width", viewportwidth-495);
|
|
||||||
$('#main-sidebar').tinyscrollbar();
|
/*isotope*/
|
||||||
$('.detal-list').tinyscrollbar();
|
var $container = $('#isotope');
|
||||||
$('#main-sidebar').tinyscrollbar({size:(viewportheight-44)});
|
$container.isotope({
|
||||||
|
itemSelector : '.item',
|
||||||
/*isotope*/
|
layoutMode : 'masonry',
|
||||||
var $container = $('#isotope');
|
});
|
||||||
$container.isotope({
|
|
||||||
itemSelector : '.item',
|
|
||||||
layoutMode : 'masonry',
|
});
|
||||||
});
|
$(window).resize(function(){
|
||||||
|
resize();
|
||||||
|
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2;
|
||||||
});
|
$('#main-sidebar').css("height", viewportheight-30);
|
||||||
$(window).resize(function(){
|
$('#main-sidebar .viewport').css("height", viewportheight-30);
|
||||||
resize();
|
$('.post-title').css("width", viewportwidth-495);
|
||||||
var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-2;
|
$('#main-wrap > .subnav').css("width", viewportwidth-$mainWrapMarginLeft)
|
||||||
$('#main-sidebar').css("height", viewportheight-30);
|
$('#main-sidebar').tinyscrollbar({size:(viewportheight-34)});
|
||||||
$('#main-sidebar .viewport').css("height", viewportheight-30);
|
mainTablePosition()
|
||||||
$('.post-title').css("width", viewportwidth-495);
|
});
|
||||||
$('#main-wrap > .subnav').css("width", viewportwidth-$mainWrapMarginLeft)
|
/*main-table position*/
|
||||||
$('#main-sidebar').tinyscrollbar({size:(viewportheight-34)});
|
function mainTablePosition() {
|
||||||
mainTablePosition()
|
var $height = $('#main-wrap > .subnav').height()
|
||||||
});
|
var $table = $('#main-wrap > .table')
|
||||||
/*main-table position*/
|
//alert ($table.height())
|
||||||
function mainTablePosition() {
|
$table.stop().animate({marginTop:$height},500)
|
||||||
var $height = $('#main-wrap > .subnav').height()
|
//$table.css({marginTop : $height})
|
||||||
var $table = $('#main-wrap > .table')
|
}
|
||||||
//alert ($table.height())
|
$(window).scroll(function () {
|
||||||
$table.stop().animate({marginTop:$height},500)
|
//var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-1;
|
||||||
//$table.css({marginTop : $height})
|
//var $subnavWidth = parseInt($('#main-wrap > .subnav').css("width"));
|
||||||
}
|
var $winLeft = $(window).scrollLeft()
|
||||||
$(window).scroll(function () {
|
$(".table-label").css({left:$winLeft*-1} );
|
||||||
//var $mainWrapMarginLeft = parseInt($('#main-wrap').css("margin-left"))-1;
|
//$(".table-label").css({left:$mainWrapMarginLeft+($winLeft*-1)} );
|
||||||
//var $subnavWidth = parseInt($('#main-wrap > .subnav').css("width"));
|
//$("#main-wrap > .subnav").css({width:$subnavWidth+($winLeft)} );
|
||||||
var $winLeft = $(window).scrollLeft()
|
//console.log($mainWrapMarginLeft+($winLeft*-1)+5);
|
||||||
$(".table-label").css({left:$winLeft*-1} );
|
});
|
||||||
//$(".table-label").css({left:$mainWrapMarginLeft+($winLeft*-1)} );
|
|
||||||
//$("#main-wrap > .subnav").css({width:$subnavWidth+($winLeft)} );
|
|
||||||
//console.log($mainWrapMarginLeft+($winLeft*-1)+5);
|
|
||||||
});
|
|
||||||
|
|
|
@ -2642,8 +2642,8 @@ button.btn.small, input[type="submit"].btn.small {
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
.pagination {
|
.pagination {
|
||||||
height: 36px;
|
height: 36px;
|
||||||
margin: 18px 0;
|
margin: 18px 0;
|
||||||
}
|
}
|
||||||
.pagination ul {
|
.pagination ul {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -2663,7 +2663,8 @@ button.btn.small, input[type="submit"].btn.small {
|
||||||
.pagination li {
|
.pagination li {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
.pagination a {
|
|
||||||
|
.pagination .page{
|
||||||
float: left;
|
float: left;
|
||||||
padding: 0 14px;
|
padding: 0 14px;
|
||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
|
@ -2671,6 +2672,28 @@ button.btn.small, input[type="submit"].btn.small {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
border-left-width: 0;
|
border-left-width: 0;
|
||||||
}
|
}
|
||||||
|
.pagination a {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.pagination .next{
|
||||||
|
float: left;
|
||||||
|
padding: 0 14px;
|
||||||
|
line-height: 34px;
|
||||||
|
text-decoration: none;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-left-width: 0;
|
||||||
|
}
|
||||||
|
.pagination .last{
|
||||||
|
float: left;
|
||||||
|
padding: 0 14px;
|
||||||
|
line-height: 34px;
|
||||||
|
text-decoration: none;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-left-width: 0;
|
||||||
|
}
|
||||||
|
.pagination .current{
|
||||||
|
border-left-width: 1px;
|
||||||
|
}
|
||||||
.pagination a:hover, .pagination .active a {
|
.pagination a:hover, .pagination .active a {
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,482 +1,483 @@
|
||||||
html, body{
|
html, body{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
html{
|
html{
|
||||||
background: url(<%= asset_path "body.jpg" %>) no-repeat fixed 0 0 transparent;
|
background: url(<%= asset_path "body.jpg" %>) no-repeat fixed 0 0 transparent;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
body{
|
body{
|
||||||
color: #000000;
|
color: #000000;
|
||||||
font-family: Helvetica, '微軟正黑體';
|
font-family: Helvetica, '微軟正黑體';
|
||||||
}
|
}
|
||||||
#back_banner_link{
|
#back_banner_link{
|
||||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #787e82), color-stop(0.05, #61676c), color-stop(1, #292c2d) );
|
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #787e82), color-stop(0.05, #61676c), color-stop(1, #292c2d) );
|
||||||
background:-moz-linear-gradient( center top -90deg, #787e82 0%, #61676c 5%, #292c2d 100% );
|
background:-moz-linear-gradient( center top -90deg, #787e82 0%, #61676c 5%, #292c2d 100% );
|
||||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#61676c', endColorstr='#292c2d');
|
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#61676c', endColorstr='#292c2d');
|
||||||
-moz-box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7);
|
-moz-box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7);
|
||||||
-webkit-box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7);
|
-webkit-box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7);
|
||||||
box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7);
|
box-shadow: 0px 1px 5px 0px rgba(0,0,0,.7);
|
||||||
border-top: 1px solid #474a4c;
|
border-top: 1px solid #474a4c;
|
||||||
border-bottom: 1px solid #1d2020;
|
border-bottom: 1px solid #1d2020;
|
||||||
height: 41px;
|
height: 41px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
behavior: url(<%= asset_path "PIE.htc" %>);
|
behavior: url(<%= asset_path "PIE.htc" %>);
|
||||||
}
|
}
|
||||||
.hmenu{
|
.hmenu{
|
||||||
float: right;
|
float: right;
|
||||||
height: 41px;
|
height: 41px;
|
||||||
}
|
}
|
||||||
#back_orbit{
|
#back_orbit{
|
||||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #70787d), color-stop(1, #3b4043) );
|
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #70787d), color-stop(1, #3b4043) );
|
||||||
background:-moz-linear-gradient( center top -90deg, #70787d 0%, #3b4043 100% );
|
background:-moz-linear-gradient( center top -90deg, #70787d 0%, #3b4043 100% );
|
||||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#70787d', endColorstr='#3b4043');
|
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#70787d', endColorstr='#3b4043');
|
||||||
-webkit-border-radius: 0px 0px 5px 5px;
|
-webkit-border-radius: 0px 0px 5px 5px;
|
||||||
-moz-border-radius: 0px 0px 5px 5px;
|
-moz-border-radius: 0px 0px 5px 5px;
|
||||||
border-radius: 0px 0px 5px 5px;
|
border-radius: 0px 0px 5px 5px;
|
||||||
-moz-box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7);
|
-moz-box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7);
|
||||||
-webkit-box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7);
|
-webkit-box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7);
|
||||||
box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7);
|
box-shadow: 0px 1px 1px 0px rgba(0,0,0,.7);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
float: left;
|
float: left;
|
||||||
height: 43px;
|
height: 43px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
width: 41px;
|
width: 41px;
|
||||||
behavior: url(<%= asset_path "PIE.htc" %>);
|
behavior: url(<%= asset_path "PIE.htc" %>);
|
||||||
}
|
}
|
||||||
#back_orbit span{
|
#back_orbit span{
|
||||||
text-indent: -9999px;
|
text-indent: -9999px;
|
||||||
background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent;
|
background: url(<%= asset_path "bar_orbit.png" %>) no-repeat scroll 0 0 transparent;
|
||||||
display: block;
|
display: block;
|
||||||
height: 43px;
|
height: 43px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
#back_orbit:hover{
|
#back_orbit:hover{
|
||||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #fefefe), color-stop(1, #e4e4e4) );
|
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #fefefe), color-stop(1, #e4e4e4) );
|
||||||
background:-moz-linear-gradient( center top -90deg, #fefefe 0%, #e4e4e4 100% );
|
background:-moz-linear-gradient( center top -90deg, #fefefe 0%, #e4e4e4 100% );
|
||||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefefe', endColorstr='#e4e4e4');
|
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefefe', endColorstr='#e4e4e4');
|
||||||
-webkit-border-radius: 0px;
|
-webkit-border-radius: 0px;
|
||||||
-moz-border-radius: 0px;
|
-moz-border-radius: 0px;
|
||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
}
|
}
|
||||||
#back_orbit:hover span{
|
#back_orbit:hover span{
|
||||||
background-position: 0 -44px;
|
background-position: 0 -44px;
|
||||||
}
|
}
|
||||||
#back_orbit:hover #orblist{
|
#back_orbit:hover #orblist{
|
||||||
display:block;
|
display:block;
|
||||||
}
|
}
|
||||||
#orblist{
|
#orblist{
|
||||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #e4e4e4), color-stop(1, #FFFFFF) );
|
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #e4e4e4), color-stop(1, #FFFFFF) );
|
||||||
background:-moz-linear-gradient( center top -90deg, #e4e4e4 0%, #FFFFFF 100% );
|
background:-moz-linear-gradient( center top -90deg, #e4e4e4 0%, #FFFFFF 100% );
|
||||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e4e4e4', endColorstr='#FFFFFF');
|
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e4e4e4', endColorstr='#FFFFFF');
|
||||||
-webkit-border-radius: 0px 3px 3px 3px;
|
-webkit-border-radius: 0px 3px 3px 3px;
|
||||||
-moz-border-radius: 0px 3px 3px 3px;
|
-moz-border-radius: 0px 3px 3px 3px;
|
||||||
border-radius: 0px 3px 3px 3px;
|
border-radius: 0px 3px 3px 3px;
|
||||||
-webkit-box-shadow: 0 3px 3px #000000;
|
-webkit-box-shadow: 0 3px 3px #000000;
|
||||||
-moz-box-shadow: 0 3px 3px #000000;
|
-moz-box-shadow: 0 3px 3px #000000;
|
||||||
box-shadow: 0 3px 3px #000000;
|
box-shadow: 0 3px 3px #000000;
|
||||||
display: none;
|
display: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 43px;
|
top: 43px;
|
||||||
width: 130px;
|
width: 130px;
|
||||||
}
|
}
|
||||||
#orblist li{
|
#orblist li{
|
||||||
border-bottom:1px solid #aaa;
|
border-bottom:1px solid #aaa;
|
||||||
list-style:none;
|
list-style:none;
|
||||||
}
|
}
|
||||||
.orblink{
|
.orblink{
|
||||||
color: #333333;
|
color: #333333;
|
||||||
display: block;
|
display: block;
|
||||||
font: 12px/100% arial,sans-serif;
|
font: 12px/100% arial,sans-serif;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.orblink:hover{
|
.orblink:hover{
|
||||||
background:#eee;
|
background:#eee;
|
||||||
color:#333;
|
color:#333;
|
||||||
}
|
}
|
||||||
#log_out{
|
#log_out{
|
||||||
-moz-box-shadow:inset 1px 0px 0px 0px #73777b;
|
-moz-box-shadow:inset 1px 0px 0px 0px #73777b;
|
||||||
-webkit-box-shadow:inset 1px 0px 0px 0px #73777b;
|
-webkit-box-shadow:inset 1px 0px 0px 0px #73777b;
|
||||||
box-shadow:inset 1px 0px 0px 0px #73777b;
|
box-shadow:inset 1px 0px 0px 0px #73777b;
|
||||||
border-right:1px solid #41474c;
|
border-right:1px solid #41474c;
|
||||||
border-left:1px solid #41474c;
|
border-left:1px solid #41474c;
|
||||||
float:right;
|
float:right;
|
||||||
width:41px;
|
width:41px;
|
||||||
height:41px;
|
height:41px;
|
||||||
}
|
}
|
||||||
#log_out:hover{
|
#log_out:hover{
|
||||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #01afde), color-stop(1, #007ec6) );
|
background:-webkit-gradient( linear, left top, left bottom, color-stop(0, #01afde), color-stop(1, #007ec6) );
|
||||||
background:-moz-linear-gradient( center top -90deg, #01afde 0%, #007ec6 100% );
|
background:-moz-linear-gradient( center top -90deg, #01afde 0%, #007ec6 100% );
|
||||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#01afde', endColorstr='#007ec6');
|
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#01afde', endColorstr='#007ec6');
|
||||||
}
|
}
|
||||||
#log_out a{
|
#log_out a{
|
||||||
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent;
|
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right 0 transparent;
|
||||||
display: block;
|
display: block;
|
||||||
height: 41px;
|
height: 41px;
|
||||||
text-indent: -9999px;
|
text-indent: -9999px;
|
||||||
width: 41px;
|
width: 41px;
|
||||||
}
|
}
|
||||||
#log_out a:hover{
|
#log_out a:hover{
|
||||||
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important;
|
background: url(<%= asset_path "service_btn.png" %>) no-repeat scroll right bottom transparent !important;
|
||||||
}
|
}
|
||||||
.lang{
|
.lang{
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
.lang a{
|
.lang a{
|
||||||
color:#fff;
|
color:#fff;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
}
|
}
|
||||||
.lang a:hover{
|
.lang a:hover{
|
||||||
text-decoration:underline;
|
text-decoration:underline;
|
||||||
}
|
}
|
||||||
#back_content{
|
#back_content{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
#back_footer{
|
#back_footer{
|
||||||
background-color: #101010;
|
background-color: #101010;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
font-size: 11px;
|
display:none;
|
||||||
padding: 10px;
|
font-size: 11px;
|
||||||
position: fixed;
|
padding: 10px;
|
||||||
width: 100%;
|
position: fixed;
|
||||||
left: 0;
|
width: 100%;
|
||||||
box-shadow: 0 -3px 4px #000;
|
left: 0;
|
||||||
}
|
box-shadow: 0 -3px 4px #000;
|
||||||
.items_setup{
|
}
|
||||||
padding:42px 0 0 0;
|
.items_setup{
|
||||||
}
|
padding:42px 0 0 0;
|
||||||
#back_sidebar .items_setup .list li{
|
}
|
||||||
padding: 6px 0 7px 5px;
|
#back_sidebar .items_setup .list li{
|
||||||
}
|
padding: 6px 0 7px 5px;
|
||||||
#back_sidebar .items_setup .list li a{
|
}
|
||||||
display: inline;
|
#back_sidebar .items_setup .list li a{
|
||||||
font-size: 0.9em;
|
display: inline;
|
||||||
padding: 0;
|
font-size: 0.9em;
|
||||||
}
|
padding: 0;
|
||||||
#back_sidebar .items_setup .list li a span{
|
}
|
||||||
background:none;
|
#back_sidebar .items_setup .list li a span{
|
||||||
padding:0;
|
background:none;
|
||||||
text-shadow:none;
|
padding:0;
|
||||||
}
|
text-shadow:none;
|
||||||
.main {
|
}
|
||||||
background: none repeat scroll 0 0 #FFFFFF;
|
.main {
|
||||||
height: 100%;
|
background: none repeat scroll 0 0 #FFFFFF;
|
||||||
margin-left: 220px;
|
height: 100%;
|
||||||
padding: 0 40px;
|
margin-left: 220px;
|
||||||
position: relative;
|
padding: 0 40px;
|
||||||
}
|
position: relative;
|
||||||
.main_list {
|
}
|
||||||
padding-top: 70px;
|
.main_list {
|
||||||
}
|
padding-top: 70px;
|
||||||
.main_list ul {
|
}
|
||||||
clear:both;
|
.main_list ul {
|
||||||
}
|
clear:both;
|
||||||
#porfile {
|
}
|
||||||
padding-top: 100px;
|
#porfile {
|
||||||
}
|
padding-top: 100px;
|
||||||
/*add_buttom*/
|
}
|
||||||
.button_bar {
|
/*add_buttom*/
|
||||||
float: right;
|
.button_bar {
|
||||||
-moz-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
|
float: right;
|
||||||
-webkit-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
|
-moz-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
|
||||||
box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
|
-webkit-box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
|
||||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4f4f4f), color-stop(1, #000000) );
|
box-shadow:inset 0px 1px 0px 0px #666, 0px 0px 3px black;
|
||||||
background:-moz-linear-gradient( center top, #4f4f4f 5%, #000000 100% );
|
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4f4f4f), color-stop(1, #000000) );
|
||||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f', endColorstr='#000000');
|
background:-moz-linear-gradient( center top, #4f4f4f 5%, #000000 100% );
|
||||||
background-color:#4f4f4f;
|
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4f4f4f', endColorstr='#000000');
|
||||||
-moz-border-radius:5px;
|
background-color:#4f4f4f;
|
||||||
-webkit-border-radius:5px;
|
-moz-border-radius:5px;
|
||||||
border-radius:5px;
|
-webkit-border-radius:5px;
|
||||||
display:inline-block;
|
border-radius:5px;
|
||||||
padding:0;
|
display:inline-block;
|
||||||
margin:10px 0 60px;
|
padding:0;
|
||||||
}
|
margin:10px 0 60px;
|
||||||
.button_bar a {
|
}
|
||||||
text-decoration:none;
|
.button_bar a {
|
||||||
text-shadow:0px -1px 0px #000000;
|
text-decoration:none;
|
||||||
font-size:12px;
|
text-shadow:0px -1px 0px #000000;
|
||||||
color:#EDEDED;
|
font-size:12px;
|
||||||
border-right:1px solid #555;
|
color:#EDEDED;
|
||||||
-moz-box-shadow:1px 0px 0px black;
|
border-right:1px solid #555;
|
||||||
-webkit-box-shadow:1px 0px 0px black;
|
-moz-box-shadow:1px 0px 0px black;
|
||||||
box-shadow:1px 0px 0px black;
|
-webkit-box-shadow:1px 0px 0px black;
|
||||||
padding: 6px 10px 4px;
|
box-shadow:1px 0px 0px black;
|
||||||
display: inline-block;
|
padding: 6px 10px 4px;
|
||||||
float: left;
|
display: inline-block;
|
||||||
}
|
float: left;
|
||||||
.button_bar a:active {
|
}
|
||||||
padding: 7px 10px 3px !important;
|
.button_bar a:active {
|
||||||
text-shadow:0px 1px 0px #000000;
|
padding: 7px 10px 3px !important;
|
||||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #000000), color-stop(1, #4f4f4f) );
|
text-shadow:0px 1px 0px #000000;
|
||||||
background:-moz-linear-gradient( center top, #000000 5%, #4f4f4f 100% );
|
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #000000), color-stop(1, #4f4f4f) );
|
||||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#4f4f4f');
|
background:-moz-linear-gradient( center top, #000000 5%, #4f4f4f 100% );
|
||||||
}
|
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#4f4f4f');
|
||||||
.button_bar a:last-child {
|
}
|
||||||
border-right:none;
|
.button_bar a:last-child {
|
||||||
-moz-box-shadow:none;
|
border-right:none;
|
||||||
-webkit-box-shadow:none;
|
-moz-box-shadow:none;
|
||||||
box-shadow:none;
|
-webkit-box-shadow:none;
|
||||||
-moz-border-radius:0px 5px 5px 0px;
|
box-shadow:none;
|
||||||
-webkit-border-radius:0px 5px 5px 0px;
|
-moz-border-radius:0px 5px 5px 0px;
|
||||||
border-radius:0px 5px 5px 0px;
|
-webkit-border-radius:0px 5px 5px 0px;
|
||||||
}
|
border-radius:0px 5px 5px 0px;
|
||||||
.button_bar a:first-child {
|
}
|
||||||
-moz-border-radius:5px 0px 0px 5px;
|
.button_bar a:first-child {
|
||||||
-webkit-border-radius:5px 0px 0px 5px;
|
-moz-border-radius:5px 0px 0px 5px;
|
||||||
border-radius:5px 0px 0px 5px;
|
-webkit-border-radius:5px 0px 0px 5px;
|
||||||
}
|
border-radius:5px 0px 0px 5px;
|
||||||
.button_bar a.new {
|
}
|
||||||
padding: 5px 10px;
|
.button_bar a.new {
|
||||||
-moz-border-radius:5px;
|
padding: 5px 10px;
|
||||||
-webkit-border-radius:5px;
|
-moz-border-radius:5px;
|
||||||
border-radius:5px;
|
-webkit-border-radius:5px;
|
||||||
}
|
border-radius:5px;
|
||||||
.button_bar a:hover {
|
}
|
||||||
color:#FFFFFF;
|
.button_bar a:hover {
|
||||||
}
|
color:#FFFFFF;
|
||||||
.up {
|
}
|
||||||
margin:10px 0;
|
.up {
|
||||||
}
|
margin:10px 0;
|
||||||
#person {
|
}
|
||||||
left: 245px;
|
#person {
|
||||||
position: fixed;
|
left: 245px;
|
||||||
text-align: center;
|
position: fixed;
|
||||||
top: 75px;
|
text-align: center;
|
||||||
width: 140px;
|
top: 75px;
|
||||||
background-color:#FFF;
|
width: 140px;
|
||||||
padding:15px;
|
background-color:#FFF;
|
||||||
border-radius: 5px;
|
padding:15px;
|
||||||
-moz-border-radius: 5px;
|
border-radius: 5px;
|
||||||
-webkit-border-radius: 5px;
|
-moz-border-radius: 5px;
|
||||||
-moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
|
-webkit-border-radius: 5px;
|
||||||
-webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
|
-moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
|
||||||
box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
|
-webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
|
||||||
}
|
box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
|
||||||
#file {
|
}
|
||||||
display:none;
|
#file {
|
||||||
}
|
display:none;
|
||||||
#person img {
|
}
|
||||||
}
|
#person img {
|
||||||
.user_mail {
|
}
|
||||||
border: medium none;
|
.user_mail {
|
||||||
border:1px solid #DDDDDD;
|
border: medium none;
|
||||||
color: #666666;
|
border:1px solid #DDDDDD;
|
||||||
font-size: 12px;
|
color: #666666;
|
||||||
width: 140px;
|
font-size: 12px;
|
||||||
}
|
width: 140px;
|
||||||
#person label {
|
}
|
||||||
display: block;
|
#person label {
|
||||||
margin: 15px 0 0;
|
display: block;
|
||||||
}
|
margin: 15px 0 0;
|
||||||
#person label input {
|
}
|
||||||
}
|
#person label input {
|
||||||
#person label #user_admin {
|
}
|
||||||
float:right;
|
#person label #user_admin {
|
||||||
margin: 0;
|
float:right;
|
||||||
}
|
margin: 0;
|
||||||
#person label span {
|
}
|
||||||
text-align:left;
|
#person label span {
|
||||||
font-size:11px;
|
text-align:left;
|
||||||
color:#888;
|
font-size:11px;
|
||||||
display:block;
|
color:#888;
|
||||||
}
|
display:block;
|
||||||
#person select {
|
}
|
||||||
border: 1px solid #DDDDDD;
|
#person select {
|
||||||
padding: 0;
|
border: 1px solid #DDDDDD;
|
||||||
width: 140px;
|
padding: 0;
|
||||||
}
|
width: 140px;
|
||||||
#porfile .users{
|
}
|
||||||
margin-left: 180px;
|
#porfile .users{
|
||||||
}
|
margin-left: 180px;
|
||||||
.roles_block {
|
}
|
||||||
background: url(<%= asset_path "75.png" %>) repeat left top;
|
.roles_block {
|
||||||
min-width:710px;
|
background: url(<%= asset_path "75.png" %>) repeat left top;
|
||||||
margin-bottom:50px;
|
min-width:710px;
|
||||||
position:relative;
|
margin-bottom:50px;
|
||||||
padding-bottom: 20px;
|
position:relative;
|
||||||
border-radius: 5px;
|
padding-bottom: 20px;
|
||||||
-moz-border-radius: 5px;
|
border-radius: 5px;
|
||||||
-webkit-border-radius: 5px;
|
-moz-border-radius: 5px;
|
||||||
-moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
|
-webkit-border-radius: 5px;
|
||||||
-webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
|
-moz-box-shadow: 0px 0px 4px #180902; /* Firefox */
|
||||||
box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
|
-webkit-box-shadow: 0px 0px 4px #180902;/* Safari 和 Chrome */
|
||||||
}
|
box-shadow: 0px 0px 4px #180902; /* Opera 10.5 + */
|
||||||
.roles_block h2 {
|
}
|
||||||
color: #FFFFFF;
|
.roles_block h2 {
|
||||||
font-weight: normal;
|
color: #FFFFFF;
|
||||||
margin: 0;
|
font-weight: normal;
|
||||||
padding: 0;
|
margin: 0;
|
||||||
position: absolute;
|
padding: 0;
|
||||||
text-shadow: 0 3px 2px #000000;
|
position: absolute;
|
||||||
top: -30px;
|
text-shadow: 0 3px 2px #000000;
|
||||||
}
|
top: -30px;
|
||||||
.main hr {
|
}
|
||||||
height:8px;
|
.main hr {
|
||||||
border:none;
|
height:8px;
|
||||||
margin:0;
|
border:none;
|
||||||
border-radius: 5px 5px 0px 0px;
|
margin:0;
|
||||||
-moz-border-radius: 5px 5px 0px 0px;
|
border-radius: 5px 5px 0px 0px;
|
||||||
-webkit-border-radius: 5px 5px 0px 0px;
|
-moz-border-radius: 5px 5px 0px 0px;
|
||||||
border-bottom:1px solid #000;
|
-webkit-border-radius: 5px 5px 0px 0px;
|
||||||
}
|
border-bottom:1px solid #000;
|
||||||
.main2{
|
}
|
||||||
padding:70px 0 0;
|
.main2{
|
||||||
}
|
padding:70px 0 0;
|
||||||
#basic_block hr {
|
}
|
||||||
background-color: #666666;
|
#basic_block hr {
|
||||||
}
|
background-color: #666666;
|
||||||
#teacher_block hr {
|
}
|
||||||
background-color: #0071A9;
|
#teacher_block hr {
|
||||||
}
|
background-color: #0071A9;
|
||||||
#student_block hr {
|
}
|
||||||
background-color: #AF0045;
|
#student_block hr {
|
||||||
}
|
background-color: #AF0045;
|
||||||
.info_input {
|
}
|
||||||
padding:10px 20px;
|
.info_input {
|
||||||
}
|
padding:10px 20px;
|
||||||
.info_input table {
|
}
|
||||||
color:#fff;
|
.info_input table {
|
||||||
width:100%;
|
color:#fff;
|
||||||
font-size:14px;
|
width:100%;
|
||||||
}
|
font-size:14px;
|
||||||
.info_input table td {
|
}
|
||||||
padding:5px 10px 5px 0;
|
.info_input table td {
|
||||||
width: 10%;
|
padding:5px 10px 5px 0;
|
||||||
}
|
width: 10%;
|
||||||
.info_input .list_head {
|
}
|
||||||
background:url(<%= asset_path "line.png" %>) left bottom repeat-x;
|
.info_input .list_head {
|
||||||
}
|
background:url(<%= asset_path "line.png" %>) left bottom repeat-x;
|
||||||
.info_input .list_head td {
|
}
|
||||||
}
|
.info_input .list_head td {
|
||||||
.info_input .list_item {
|
}
|
||||||
color:#AEAEAE;
|
.info_input .list_item {
|
||||||
}
|
color:#AEAEAE;
|
||||||
.info_input .add {
|
}
|
||||||
display:block;
|
.info_input .add {
|
||||||
padding-left:22px;
|
display:block;
|
||||||
font-size:12px;
|
padding-left:22px;
|
||||||
line-height:21px;
|
font-size:12px;
|
||||||
height:19px;
|
line-height:21px;
|
||||||
background:url(<%= asset_path "icon.png" %>) no-repeat -59px 0;
|
height:19px;
|
||||||
margin-top: 10px;
|
background:url(<%= asset_path "icon.png" %>) no-repeat -59px 0;
|
||||||
color: #DDDDDD;
|
margin-top: 10px;
|
||||||
}
|
color: #DDDDDD;
|
||||||
|
}
|
||||||
.main table {
|
|
||||||
width:100%;
|
.main table {
|
||||||
}
|
width:100%;
|
||||||
.main td {
|
}
|
||||||
padding-left:20px;
|
.main td {
|
||||||
color:#fff;
|
padding-left:20px;
|
||||||
font-size:14px;
|
color:#fff;
|
||||||
line-height:40px;
|
font-size:14px;
|
||||||
}
|
line-height:40px;
|
||||||
.main tr.have td{
|
}
|
||||||
background: url(<%= asset_path "75.png" %>) repeat left top;
|
.main tr.have td{
|
||||||
}
|
background: url(<%= asset_path "75.png" %>) repeat left top;
|
||||||
.main tr.have td:first-child{
|
}
|
||||||
border-radius: 5px 0 0 5px;
|
.main tr.have td:first-child{
|
||||||
-moz-border-radius: 5px 0 0 5px;
|
border-radius: 5px 0 0 5px;
|
||||||
-webkit-border-radius: 5px 0 0 5px;
|
-moz-border-radius: 5px 0 0 5px;
|
||||||
}
|
-webkit-border-radius: 5px 0 0 5px;
|
||||||
.main tr.have td:last-child{
|
}
|
||||||
border-radius: 0 5px 5px 0;
|
.main tr.have td:last-child{
|
||||||
-moz-border-radius: 0 5px 5px 0;
|
border-radius: 0 5px 5px 0;
|
||||||
-webkit-border-radius: 0 5px 5px 0;
|
-moz-border-radius: 0 5px 5px 0;
|
||||||
}
|
-webkit-border-radius: 0 5px 5px 0;
|
||||||
.main thead td {
|
}
|
||||||
line-height:40px;
|
.main thead td {
|
||||||
font-size:16px;
|
line-height:40px;
|
||||||
text-shadow: 0px 1px 1px #3e2914;
|
font-size:16px;
|
||||||
}
|
text-shadow: 0px 1px 1px #3e2914;
|
||||||
.main thead td.action {
|
}
|
||||||
width:140px;
|
.main thead td.action {
|
||||||
}
|
width:140px;
|
||||||
.main tbody td.roles {
|
}
|
||||||
background-image: url(<%= asset_path "roles_type.jpg" %>);
|
.main tbody td.roles {
|
||||||
background-repeat: repeat-x;
|
background-image: url(<%= asset_path "roles_type.jpg" %>);
|
||||||
}
|
background-repeat: repeat-x;
|
||||||
.main tbody td.teacher {
|
}
|
||||||
background-position: 0 -54px;
|
.main tbody td.teacher {
|
||||||
}
|
background-position: 0 -54px;
|
||||||
.main tbody td.student {
|
}
|
||||||
background-position: 0 -5px;
|
.main tbody td.student {
|
||||||
}
|
background-position: 0 -5px;
|
||||||
.main tbody td.action a {
|
}
|
||||||
background-image: url(<%= asset_path "icon.png" %>);
|
.main tbody td.action a {
|
||||||
display: inline-block;
|
background-image: url(<%= asset_path "icon.png" %>);
|
||||||
height: 19px;
|
display: inline-block;
|
||||||
margin-right: 10px;
|
height: 19px;
|
||||||
top: 8px;
|
margin-right: 10px;
|
||||||
text-indent: -9999px;
|
top: 8px;
|
||||||
width: 19px;
|
text-indent: -9999px;
|
||||||
position: relative;
|
width: 19px;
|
||||||
}
|
position: relative;
|
||||||
.main tbody td.action a.show {
|
}
|
||||||
background-position: left top;
|
.main tbody td.action a.show {
|
||||||
}
|
background-position: left top;
|
||||||
.main tbody td.action a.show:hover {
|
}
|
||||||
background-position: left -19px;
|
.main tbody td.action a.show:hover {
|
||||||
}
|
background-position: left -19px;
|
||||||
.main tbody td.action a.edit {
|
}
|
||||||
background-position: -19px top;
|
.main tbody td.action a.edit {
|
||||||
}
|
background-position: -19px top;
|
||||||
.main tbody td.action a.edit:hover {
|
}
|
||||||
background-position: -19px -19px;
|
.main tbody td.action a.edit:hover {
|
||||||
}
|
background-position: -19px -19px;
|
||||||
.main tbody td.action a.delete {
|
}
|
||||||
background-position: -38px top;
|
.main tbody td.action a.delete {
|
||||||
}
|
background-position: -38px top;
|
||||||
.main tbody td.action a.delete:hover {
|
}
|
||||||
background-position: -38px -19px;
|
.main tbody td.action a.delete:hover {
|
||||||
}
|
background-position: -38px -19px;
|
||||||
.main tbody td.action a.switch {
|
}
|
||||||
background: url(<%= asset_path "switch.png" %>) no-repeat left 3px;
|
.main tbody td.action a.switch {
|
||||||
width: 40px;
|
background: url(<%= asset_path "switch.png" %>) no-repeat left 3px;
|
||||||
}
|
width: 40px;
|
||||||
.main tbody tr.disable td.action a.switch {
|
}
|
||||||
background-position:left bottom;
|
.main tbody tr.disable td.action a.switch {
|
||||||
}
|
background-position:left bottom;
|
||||||
.main tbody td.action a.delete:hover {
|
}
|
||||||
background-position: -38px -19px;
|
.main tbody td.action a.delete:hover {
|
||||||
}
|
background-position: -38px -19px;
|
||||||
.main tbody tr.have {
|
}
|
||||||
}
|
.main tbody tr.have {
|
||||||
.main tbody tr.disable {
|
}
|
||||||
opacity: 0.7;
|
.main tbody tr.disable {
|
||||||
}
|
opacity: 0.7;
|
||||||
.main tbody tr {
|
}
|
||||||
background:none;
|
.main tbody tr {
|
||||||
height:15px;
|
background:none;
|
||||||
}
|
height:15px;
|
||||||
h1{
|
}
|
||||||
margin:0 0 20px;
|
h1{
|
||||||
}
|
margin:0 0 20px;
|
||||||
p{
|
}
|
||||||
margin:0 0 10px;
|
p{
|
||||||
}
|
margin:0 0 10px;
|
||||||
|
}
|
||||||
#back_sidebar .items_setup .list li{
|
|
||||||
background:url(<%= asset_path "sidebar_li2.jpg" %>) repeat left top;
|
#back_sidebar .items_setup .list li{
|
||||||
border:none;
|
background:url(<%= asset_path "sidebar_li2.jpg" %>) repeat left top;
|
||||||
padding: 0 0 0 5px;
|
border:none;
|
||||||
}
|
padding: 0 0 0 5px;
|
||||||
#back_sidebar .items_setup .list li a{
|
}
|
||||||
line-height:31px;
|
#back_sidebar .items_setup .list li a{
|
||||||
}
|
line-height:31px;
|
||||||
#back_sidebar .items_setup .list li:hover{
|
}
|
||||||
background:url(<%= asset_path "sidebar_li2.jpg" %>) repeat left top;
|
#back_sidebar .items_setup .list li:hover{
|
||||||
border:none;
|
background:url(<%= asset_path "sidebar_li2.jpg" %>) repeat left top;
|
||||||
}
|
border:none;
|
||||||
#back_sidebar .items_setup ul .list {
|
}
|
||||||
|
#back_sidebar .items_setup ul .list {
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -21,7 +21,10 @@ class Admin::AppAuthsController < ApplicationController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
app_auth = AppAuth.find_or_create_by(module_app_id: params[:module_app_id])
|
app_auth = AppAuth.find_or_create_by(module_app_id: params[:module_app_id])
|
||||||
params[:new].each do |item|
|
auth_all = params[:auth_all] || false
|
||||||
|
app_auth.update_attribute(:all,auth_all)
|
||||||
|
new_array = params[:new] || []
|
||||||
|
new_array.each do |item|
|
||||||
field = item[0]
|
field = item[0]
|
||||||
field_value = item[1]
|
field_value = item[1]
|
||||||
if field_value!=''
|
if field_value!=''
|
||||||
|
@ -66,6 +69,8 @@ class Admin::AppAuthsController < ApplicationController
|
||||||
@module_app = ModuleApp.find(params[:id])
|
@module_app = ModuleApp.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@module_app = ModuleApp.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -21,6 +21,10 @@ class Admin::ModuleAppsController < ApplicationController
|
||||||
@module_app = ModuleApp.find(params[:id])
|
@module_app = ModuleApp.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@module_app = ModuleApp.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@module_app = ModuleApp.find(params[:id])
|
@module_app = ModuleApp.find(params[:id])
|
||||||
|
@ -97,7 +101,7 @@ class Admin::ModuleAppsController < ApplicationController
|
||||||
end
|
end
|
||||||
#user is not permited to do that
|
#user is not permited to do that
|
||||||
flash[:notice] = t('admin.app_auth.operation_not_permitted')
|
flash[:notice] = t('admin.app_auth.operation_not_permitted')
|
||||||
redirect_to :action => "edit" # [TODO] maybe need to redirect to some other page
|
render :nothing => true, :status => 403
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -109,7 +113,7 @@ class Admin::ModuleAppsController < ApplicationController
|
||||||
end
|
end
|
||||||
#user is not permited to do that
|
#user is not permited to do that
|
||||||
flash[:notice] = t('admin.app_auth.operation_not_permitted')
|
flash[:notice] = t('admin.app_auth.operation_not_permitted')
|
||||||
redirect_to :action => "edit" # [TODO] maybe need to redirect to some other page
|
render :nothing => true, :status => 403
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -1,8 +1,12 @@
|
||||||
class Admin::ObjectAuthsController < ApplicationController
|
class Admin::ObjectAuthsController < ApplicationController
|
||||||
|
include OrbitCoreLib::PermissionUnility
|
||||||
layout "admin"
|
layout "admin"
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
before_filter :check_if_user_can_do_object_auth
|
||||||
# before_filter :is_admin? ,:only => :index
|
# before_filter :is_admin? ,:only => :index
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
# if current_user.admin?
|
# if current_user.admin?
|
||||||
@object_auths = ObjectAuth.all
|
@object_auths = ObjectAuth.all
|
||||||
|
@ -14,6 +18,7 @@ class Admin::ObjectAuthsController < ApplicationController
|
||||||
def new
|
def new
|
||||||
obj = eval(params[:type]).find params[:obj_id]
|
obj = eval(params[:type]).find params[:obj_id]
|
||||||
@object_auth=obj.object_auths.build
|
@object_auth=obj.object_auths.build
|
||||||
|
@object_auth_title_option = eval(params[:type]+"::ObjectAuthTitlesOptions")
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # new.html.erb
|
format.html # new.html.erb
|
||||||
format.xml { render :xml => @post }
|
format.xml { render :xml => @post }
|
||||||
|
@ -22,13 +27,21 @@ class Admin::ObjectAuthsController < ApplicationController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
obj = eval(params[:object_auth][:type]).find params[:object_auth][:obj_id]
|
obj = eval(params[:object_auth][:type]).find params[:object_auth][:obj_id]
|
||||||
@object_auth=obj.object_auths.create :title=> params[:object_auth][:title]
|
@object_auth=obj.object_auths.build :title=> params[:object_auth][:title]
|
||||||
redirect_to edit_admin_object_auth_path(@object_auth)
|
if @object_auth.save
|
||||||
|
redirect_to edit_admin_object_auth_path(@object_auth)
|
||||||
|
else
|
||||||
|
flash[:error] = t('admin.object.a_object_must_have_only_one_object_auth_profile_for_each_action')
|
||||||
|
redirect_to (:back)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_role
|
def create_role
|
||||||
object_auth = ObjectAuth.find(params[:id])
|
object_auth = ObjectAuth.find(params[:id])
|
||||||
params[:new].each do |item|
|
auth_all = params[:auth_all] || false
|
||||||
|
object_auth.update_attribute(:all,auth_all)
|
||||||
|
new_array = params[:new] || []
|
||||||
|
new_array.each do |item|
|
||||||
field = item[0]
|
field = item[0]
|
||||||
field_value = item[1]
|
field_value = item[1]
|
||||||
if field_value!=''
|
if field_value!=''
|
||||||
|
@ -69,7 +82,11 @@ class Admin::ObjectAuthsController < ApplicationController
|
||||||
def edit
|
def edit
|
||||||
@object_auth = ObjectAuth.find(params[:id])
|
@object_auth = ObjectAuth.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private
|
||||||
|
def check_if_user_can_do_object_auth
|
||||||
|
unless check_permission(:manager)
|
||||||
|
render :nothing => true, :status => 403
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -0,0 +1,8 @@
|
||||||
|
class SessionsController < Devise::SessionsController
|
||||||
|
|
||||||
|
def create
|
||||||
|
super
|
||||||
|
reset_session
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -1,3 +0,0 @@
|
||||||
class ObitFrontendController< ObitFrontendComponentController
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,3 +0,0 @@
|
||||||
class ObitWidgetController< ObitFrontendComponentController
|
|
||||||
|
|
||||||
end
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
class OrbitBackendController< ApplicationController
|
||||||
|
before_filter :authenticate_user!
|
||||||
|
before_filter :setup_vars
|
||||||
|
# before_filter {|c| c.front_end_available(@app_title)}
|
||||||
|
before_filter :check_user_can_use,:except => [:public]
|
||||||
|
include OrbitCoreLib::PermissionUnility
|
||||||
|
include AdminHelper
|
||||||
|
|
||||||
|
layout 'admin'
|
||||||
|
|
||||||
|
def setup_vars
|
||||||
|
@app_title = request.fullpath.split('/')[2]
|
||||||
|
@module_app = ModuleApp.first(conditions: {:key => @app_title} )
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def check_user_can_use
|
||||||
|
unless check_permission
|
||||||
|
redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -1,7 +1,7 @@
|
||||||
class ObitFrontendComponentController< ApplicationController
|
class OrbitFrontendComponentController< ApplicationController
|
||||||
before_filter :setup_vars
|
before_filter :setup_vars
|
||||||
before_filter {|c| c.front_end_available(@app_title)}
|
before_filter {|c| c.front_end_available(@app_title)}
|
||||||
layout 'module_widget'
|
layout :false
|
||||||
|
|
||||||
def setup_vars
|
def setup_vars
|
||||||
@app_title = request.fullpath.split('/')[2]
|
@app_title = request.fullpath.split('/')[2]
|
|
@ -0,0 +1,3 @@
|
||||||
|
class OrbitFrontendController< OrbitFrontendComponentController
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1,3 @@
|
||||||
|
class OrbitWidgetController< OrbitFrontendComponentController
|
||||||
|
|
||||||
|
end
|
|
@ -30,7 +30,11 @@ class PagesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def index_from_link
|
def index_from_link
|
||||||
redirect_to "/#{@item.full_name}"
|
if params[:page]
|
||||||
|
redirect_to "/#{@item.full_name}?page=#{params[:page]}"
|
||||||
|
else
|
||||||
|
redirect_to "/#{@item.full_name}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_from_link
|
def show_from_link
|
||||||
|
|
|
@ -3,4 +3,9 @@ module Admin::AppAuthHelper
|
||||||
link_to t(:enable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch'
|
link_to t(:enable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch'
|
||||||
link_to t(:disable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch'
|
link_to t(:disable), eval("admin_#{attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def if_permitted_to(user,role)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -5,4 +5,17 @@ module AdminHelper
|
||||||
link_to('/' , admin_items_path) + ( @parent_items.map{ |i| link_to(i.name, admin_items_path(:parent_id=>i.id) ) } << @parent_item.name ).join("/").html_safe
|
link_to('/' , admin_items_path) + ( @parent_items.map{ |i| link_to(i.name, admin_items_path(:parent_id=>i.id) ) } << @parent_item.name ).join("/").html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Check if the current_user is manager in current module app
|
||||||
|
def is_manager?
|
||||||
|
@module_app.is_manager?(current_user) || is_admin?
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check if the current_user is sub manager in current module app
|
||||||
|
def is_sub_manager?
|
||||||
|
@module_app.is_sub_manager?(current_user)|| is_admin?
|
||||||
|
end
|
||||||
|
|
||||||
|
def is_admin?
|
||||||
|
current_user.admin?
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -2,4 +2,5 @@ class AppAuth < PrototypeAuth
|
||||||
|
|
||||||
belongs_to :module_app
|
belongs_to :module_app
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
|
@ -1,6 +1,7 @@
|
||||||
class ModuleApp
|
class ModuleApp
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
|
include OrbitCoreLib::ObjectTokenUnility
|
||||||
|
|
||||||
field :key
|
field :key
|
||||||
field :title
|
field :title
|
||||||
|
@ -14,7 +15,7 @@ class ModuleApp
|
||||||
|
|
||||||
field :app_pages ,type: Array
|
field :app_pages ,type: Array
|
||||||
field :widgets ,type: Array
|
field :widgets ,type: Array
|
||||||
|
|
||||||
has_many :managers,as: :managing_app ,:class_name => "AppManager" #,:dependent => :destroy,:foreign_key => "managing_app_id",:inverse_of => :managing_app
|
has_many :managers,as: :managing_app ,:class_name => "AppManager" #,:dependent => :destroy,:foreign_key => "managing_app_id",:inverse_of => :managing_app
|
||||||
has_many :sub_managers,as: :sub_managing_app ,:class_name => "AppManager"#, :dependent => :destroy,:foreign_key => "sub_managing_app_id",:inverse_of => :sub_managing_app
|
has_many :sub_managers,as: :sub_managing_app ,:class_name => "AppManager"#, :dependent => :destroy,:foreign_key => "sub_managing_app_id",:inverse_of => :sub_managing_app
|
||||||
|
|
||||||
|
@ -26,6 +27,14 @@ class ModuleApp
|
||||||
|
|
||||||
before_save :set_key
|
before_save :set_key
|
||||||
|
|
||||||
|
def is_manager?(user)
|
||||||
|
managing_users.include?(user)
|
||||||
|
end
|
||||||
|
|
||||||
|
def is_sub_manager?(user)
|
||||||
|
sub_managing_users.include?(user) || is_manager?(user)
|
||||||
|
end
|
||||||
|
|
||||||
def managing_users
|
def managing_users
|
||||||
self.managers.collect{ |t| t.user }
|
self.managers.collect{ |t| t.user }
|
||||||
end
|
end
|
||||||
|
@ -73,5 +82,6 @@ class ModuleApp
|
||||||
def set_key
|
def set_key
|
||||||
self.key = self.title.underscore if self.title
|
self.key = self.title.underscore if self.title
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class ObjectAuth < PrototypeAuth
|
class ObjectAuth < PrototypeAuth
|
||||||
|
include OrbitCoreLib::ObjectTokenUnility
|
||||||
|
validates_uniqueness_of :obj_authable_type,:scope => :title #{ |c| }
|
||||||
belongs_to :obj_authable, polymorphic: true
|
belongs_to :obj_authable, polymorphic: true
|
||||||
# > - Something.find_with_auth(query)
|
# > - Something.find_with_auth(query)
|
||||||
# > - or Something.find(query).auth
|
# > - or Something.find(query).auth
|
||||||
|
|
|
@ -4,7 +4,6 @@ class PrototypeAuth
|
||||||
# after_save :update_block_list,:update_privilage_list
|
# after_save :update_block_list,:update_privilage_list
|
||||||
|
|
||||||
field :title
|
field :title
|
||||||
field :token
|
|
||||||
field :all ,type: Boolean,default: false
|
field :all ,type: Boolean,default: false
|
||||||
|
|
||||||
belongs_to :users
|
belongs_to :users
|
||||||
|
@ -12,11 +11,12 @@ class PrototypeAuth
|
||||||
has_and_belongs_to_many :blocked_users, :inverse_of => nil, :class_name => "User"
|
has_and_belongs_to_many :blocked_users, :inverse_of => nil, :class_name => "User"
|
||||||
has_and_belongs_to_many :privilege_users, :inverse_of => nil, :class_name => "User"
|
has_and_belongs_to_many :privilege_users, :inverse_of => nil, :class_name => "User"
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
attr_protected :roles,:sub_roles,:privilege_users,:blocked_users,:users
|
attr_protected :roles,:sub_roles,:privilege_users,:blocked_users
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def add_role role
|
def add_role role
|
||||||
add_operation(:roles,role)
|
add_operation(:roles,role)
|
||||||
|
@ -68,7 +68,7 @@ class PrototypeAuth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def auth_users
|
def auth_users_before_block_list
|
||||||
if self.all?
|
if self.all?
|
||||||
User.all.entries
|
User.all.entries
|
||||||
else
|
else
|
||||||
|
@ -83,11 +83,10 @@ class PrototypeAuth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def auth_users_after_block_list
|
def auth_users
|
||||||
auth_users - self.blocked_users
|
auth_users_before_block_list - self.blocked_users
|
||||||
end
|
end
|
||||||
|
|
||||||
# protected
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
|
@ -0,0 +1,12 @@
|
||||||
|
class Session
|
||||||
|
include Mongoid::Document
|
||||||
|
include Mongoid::Timestamps
|
||||||
|
|
||||||
|
def self.sweep(time = 1.hour)
|
||||||
|
if time.is_a?(String)
|
||||||
|
time = time.split.inject { |count, unit| count.to_i.send(unit) }
|
||||||
|
end
|
||||||
|
|
||||||
|
delete_all "updated_at < '#{time.ago.to_s(:db)}' OR created_at < '#{2.days.ago.to_s(:db)}'"
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1 @@
|
||||||
|
<%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
|
|
@ -1,3 +1,10 @@
|
||||||
|
<div id="open_for_all_user">
|
||||||
|
<h1>All User</h1>
|
||||||
|
<%= form_tag(submit_url) do %>
|
||||||
|
<%= check_box_tag 'auth_all',true,(auth.all rescue true) %><%= submit_tag 'Add Role' %><br/>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="user_role_management">
|
<div id="user_role_management">
|
||||||
<h1>User Role</h1>
|
<h1>User Role</h1>
|
||||||
<%= form_tag(submit_url) do %>
|
<%= form_tag(submit_url) do %>
|
||||||
|
@ -10,7 +17,6 @@
|
||||||
<%= collection_select(:new,:blocked_user, User.all, :id, :name, :prompt => true) %>
|
<%= collection_select(:new,:blocked_user, User.all, :id, :name, :prompt => true) %>
|
||||||
<%= submit_tag 'Add BlockedList' %><br/>
|
<%= submit_tag 'Add BlockedList' %><br/>
|
||||||
<% end %>
|
<% end %>
|
||||||
<ul>Roles </ul>
|
|
||||||
<% unless auth.nil? %>
|
<% unless auth.nil? %>
|
||||||
<% auth.roles.each do |role| %>
|
<% auth.roles.each do |role| %>
|
||||||
<li> <%= role.key %> Build in:<%= role.built_in ? 'Yes' : 'No' %>
|
<li> <%= role.key %> Build in:<%= role.built_in ? 'Yes' : 'No' %>
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
<%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {}, {:rel => admin_module_apps_path } %>
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
<br /><br /><br /><br />
|
||||||
|
<%=@module_app.key %><br />
|
||||||
|
<%=@module_app.title %><br />
|
||||||
|
<%=@module_app.version %><br />
|
||||||
|
<%=@module_app.organization %><br />
|
||||||
|
<%=@module_app.author %><br />
|
||||||
|
<%=@module_app.intro %><br />
|
||||||
|
<%=@module_app.update_info %><br />
|
||||||
|
<%=@module_app.create_date %><br />
|
||||||
|
<%=@module_app.enable_frontend%><br />
|
||||||
|
<%=@module_app.app_pages%><br />
|
||||||
|
<%=@module_app.widgets%><br />
|
||||||
|
|
||||||
|
Mangers:
|
||||||
|
<ul>
|
||||||
|
<% @module_app.managers.each do |manager|%>
|
||||||
|
<li><%= manager.user.name %></li>
|
||||||
|
<%end%>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
SubManagers:
|
||||||
|
<div>
|
||||||
|
<% @module_app.sub_managers.each do |manager|%>
|
||||||
|
<%= manager.user.name %>
|
||||||
|
<%end%>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
All User?:<%= @module_app.app_auth.all %><br />
|
||||||
|
Blocked Users:<%= @module_app.app_auth.blocked_users.collect{|t| t.name} %><br />
|
||||||
|
Privilege Users:<%= @module_app.app_auth.privilege_users.collect{|t| t.name}%><br />
|
||||||
|
User Roles:<%= @module_app.app_auth.roles.collect{|t| t.key} %><br />
|
||||||
|
User Sub Roles:<%= @module_app.app_auth.sub_roles.collect{|t| t.key} %><br />
|
||||||
|
|
||||||
|
Available users after calculation:
|
||||||
|
<%= @module_app.app_auth.auth_users.collect{|user| user.name}.join(',') %>
|
|
@ -11,4 +11,4 @@
|
||||||
<%= render :partial => "admin/components/user_role_management", :locals => {
|
<%= render :partial => "admin/components/user_role_management", :locals => {
|
||||||
:object => @object_auth.auth_obj ,:auth=>@object_auth,:submit_url=>create_role_admin_object_auth_path(@object_auth),:ploy_route_ary=>['remove',:admin,@object_auth] } %>
|
:object => @object_auth.auth_obj ,:auth=>@object_auth,:submit_url=>create_role_admin_object_auth_path(@object_auth),:ploy_route_ary=>['remove',:admin,@object_auth] } %>
|
||||||
|
|
||||||
|
<%= link_to 'Back to object',eval(@object_auth.obj_authable.class.to_s+"::AfterObjectAuthUrl") %>
|
|
@ -12,7 +12,8 @@
|
||||||
<h1><%= t('object_auth.new_object_auth') %></h1>
|
<h1><%= t('object_auth.new_object_auth') %></h1>
|
||||||
<%= form_for @object_auth, :url => admin_object_auths_path do |f| %>
|
<%= form_for @object_auth, :url => admin_object_auths_path do |f| %>
|
||||||
<%= f.label :title %>
|
<%= f.label :title %>
|
||||||
<%= f.text_field :title, :class => 'text' %>
|
<%= f.select :title,@object_auth_title_option %>
|
||||||
|
|
||||||
<%= f.hidden_field :obj_id, :value => params[:obj_id] %>
|
<%= f.hidden_field :obj_id, :value => params[:obj_id] %>
|
||||||
<%= f.hidden_field :type, :value => params[:type] %>
|
<%= f.hidden_field :type, :value => params[:type] %>
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<li class="dropdown active clear">
|
<li class="dropdown active">
|
||||||
<a class="orbit-bar-account" href="#" data-toggle="dropdown">
|
<a class="orbit-bar-account" href="#" data-toggle="dropdown">
|
||||||
<!-- <img src="images/menber-pic.png" /> -->
|
<img class="member-img" src="/assets/menber-pic.png" />
|
||||||
<%= image_tag current_user.avatar.thumb.url, :class => 'member-img' %>
|
<%#= image_tag current_user.avatar.thumb.url, :class => 'member-img' %>
|
||||||
<span class="member-name"><%= current_user.name %></span>
|
<span class="member-name"><%= current_user.name %></span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu account-menu">
|
<ul class="dropdown-menu account-menu">
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<%= t(:desktop) %>
|
<%= t(:desktop) %>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li><%= link_to content_tag(:i, nil, :class => 'icons-out') + t(:logout), destroy_user_session_path %></li>
|
<li><%= link_to content_tag(:i, nil, :class => 'icons-out') + ' ' + t(:logout), destroy_user_session_path %></li>
|
||||||
|
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<form class="navbar-search span6" action="">
|
<form class="navbar-search span6" action="">
|
||||||
<input class="search-query span4" type="text" placeholder="Search NCCU">
|
<input class="search-query span4" type="text" placeholder="<%= t(:search_nccu) %>">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<%= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
|
<%= content_tag :li, link_to(t('admin.add_new'), new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') %>
|
||||||
<%= content_tag :li, link_to(t('admin.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %>
|
<%= content_tag :li, link_to(t('admin.categories'), panel_announcement_back_end_bulletin_categorys_path), :class => active_for_action('bulletin_categorys', 'index') %>
|
||||||
<%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('tags', 'index') %>
|
<%= content_tag :li, link_to(t('admin.tags'), panel_announcement_back_end_tags_path), :class => active_for_action('tags', 'index') %>
|
||||||
|
<%= content_tag :li, link_to(t('announcement.bulletin.fact_check_setting'), panel_announcement_back_end_fact_checks_setting_path), :class => active_for_action('tags', 'index') %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# This file is used by Rack-based servers to start the application.
|
# This file is used by Rack-based servers to start the application.
|
||||||
|
|
||||||
require ::File.expand_path('../config/environment', __FILE__)
|
require ::File.expand_path('../config/environment', __FILE__)
|
||||||
run PrototypeR4::Application
|
run Orbit::Application
|
||||||
|
|
|
@ -13,12 +13,13 @@ require 'sprockets/railtie'
|
||||||
# or test environments.
|
# or test environments.
|
||||||
Bundler.require *Rails.groups(:assets) if defined?(Bundler)
|
Bundler.require *Rails.groups(:assets) if defined?(Bundler)
|
||||||
|
|
||||||
module PrototypeR4
|
module Orbit
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
|
|
||||||
# Add directories for plugins
|
# Add directories for plugins
|
||||||
config.paths["vendor/plugins"] += %W(#{config.root}/vendor/built_in_modules)
|
config.paths["vendor/plugins"] += %W(#{config.root}/vendor/built_in_modules)
|
||||||
config.paths["vendor/plugins"] += %W(#{config.root}/vendor/downloaded_modules)
|
config.paths["vendor/plugins"] += %W(#{config.root}/vendor/downloaded_modules)
|
||||||
|
config.paths.app.views << "app/views/devise"
|
||||||
|
|
||||||
|
|
||||||
# Settings in config/environments/* take precedence over those specified here.
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
|
@ -47,7 +48,7 @@ module PrototypeR4
|
||||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||||
# config.i18n.default_locale = :de
|
# config.i18n.default_locale = :de
|
||||||
config.i18n.default_locale = :en
|
config.i18n.default_locale = :zh_tw
|
||||||
|
|
||||||
# JavaScript files you want as :defaults (application.js is always included).
|
# JavaScript files you want as :defaults (application.js is always included).
|
||||||
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
||||||
|
|
|
@ -4,4 +4,4 @@ require 'yaml'
|
||||||
YAML::ENGINE.yamler = 'syck'
|
YAML::ENGINE.yamler = 'syck'
|
||||||
|
|
||||||
# Initialize the rails application
|
# Initialize the rails application
|
||||||
PrototypeR4::Application.initialize!
|
Orbit::Application.initialize!
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
PrototypeR4::Application.configure do
|
Orbit::Application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb
|
# Settings specified here will take precedence over those in config/application.rb
|
||||||
|
|
||||||
# In the development environment your application's code is reloaded on
|
# In the development environment your application's code is reloaded on
|
||||||
|
@ -24,21 +24,21 @@ PrototypeR4::Application.configure do
|
||||||
config.action_dispatch.best_standards_support = :builtin
|
config.action_dispatch.best_standards_support = :builtin
|
||||||
|
|
||||||
|
|
||||||
config.middleware.use ExceptionNotifier,
|
# config.middleware.use ExceptionNotifier,
|
||||||
:email_prefix => "[R4_error]",
|
# :email_prefix => "[R4_error]",
|
||||||
:sender_address => %{"notifier" <redmine@rulingcom.com>},
|
# :sender_address => %{"notifier" <redmine@rulingcom.com>},
|
||||||
:exception_recipients => %w{chris@rulingcom.com}
|
# :exception_recipients => %w{chris@rulingcom.com}
|
||||||
|
|
||||||
config.action_mailer.delivery_method = :smtp
|
# config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.smtp_settings = {
|
# config.action_mailer.smtp_settings = {
|
||||||
:tls => true,
|
# :tls => true,
|
||||||
:enable_starttls_auto => true,
|
# :enable_starttls_auto => true,
|
||||||
:address => "smtp.gmail.com",
|
# :address => "smtp.gmail.com",
|
||||||
:port => '587',
|
# :port => '587',
|
||||||
:domain => "smtp.gmail.com",
|
# :domain => "smtp.gmail.com",
|
||||||
:authentication => "plain",
|
# :authentication => "plain",
|
||||||
:user_name => "redmine@rulingcom.com",
|
# :user_name => "redmine@rulingcom.com",
|
||||||
:password => "rulingredmine" }
|
# :password => "rulingredmine" }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
PrototypeR4::Application.configure do
|
Orbit::Application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb
|
# Settings specified here will take precedence over those in config/application.rb
|
||||||
|
|
||||||
# The production environment is meant for finished, "live" apps.
|
# The production environment is meant for finished, "live" apps.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
PrototypeR4::Application.configure do
|
Orbit::Application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb
|
# Settings specified here will take precedence over those in config/application.rb
|
||||||
|
|
||||||
# The test environment is used exclusively to run your application's
|
# The test environment is used exclusively to run your application's
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
# If you change this key, all old signed cookies will become invalid!
|
# If you change this key, all old signed cookies will become invalid!
|
||||||
# Make sure the secret is at least 30 characters and all random,
|
# Make sure the secret is at least 30 characters and all random,
|
||||||
# no regular words or you'll be exposed to dictionary attacks.
|
# no regular words or you'll be exposed to dictionary attacks.
|
||||||
PrototypeR4::Application.config.secret_token = 'cbf6409102b30cb9f4da455ee08c3a7e9d8b2a3d32a0e5b59a354dad03f469d363a8127ef4b7bc3b1afa632d7cf947a1e59e09022d2d4cd8df1f4fa521d7ec07'
|
Orbit::Application.config.secret_token = 'cbf6409102b30cb9f4da455ee08c3a7e9d8b2a3d32a0e5b59a354dad03f469d363a8127ef4b7bc3b1afa632d7cf947a1e59e09022d2d4cd8df1f4fa521d7ec07'
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
# If you change this key, all old signed cookies will become invalid!
|
# If you change this key, all old signed cookies will become invalid!
|
||||||
# Make sure the secret is at least 30 characters and all random,
|
# Make sure the secret is at least 30 characters and all random,
|
||||||
# no regular words or you'll be exposed to dictionary attacks.
|
# no regular words or you'll be exposed to dictionary attacks.
|
||||||
PrototypeR4::Application.config.secret_token = 'b8d78ecaf3086ebfc1ba42e912acba60d85cf3d789d933e117770e1a045a12911f121ff012a234982abb446c8b8c768052eea4bf8b2d5d336be821e2c25d8cdb'
|
Orbit::Application.config.secret_token = 'b8d78ecaf3086ebfc1ba42e912acba60d85cf3d789d933e117770e1a045a12911f121ff012a234982abb446c8b8c768052eea4bf8b2d5d336be821e2c25d8cdb'
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
PrototypeR4::Application.config.session_store :cookie_store, :key => '_prototype_R4_session'
|
Orbit::Application.config.session_store :mongoid_store
|
||||||
|
|
||||||
# Use the database for sessions instead of the cookie-based default,
|
|
||||||
# which shouldn't be used to store highly confidential information
|
|
||||||
# (create the session table with "rails generate session_migration")
|
|
||||||
# PrototypeR4::Application.config.session_store :active_record_store
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ en:
|
||||||
password: Password
|
password: Password
|
||||||
register: Register
|
register: Register
|
||||||
remember_me: Remember me
|
remember_me: Remember me
|
||||||
|
search_nccu: Search NCCU
|
||||||
show: Show
|
show: Show
|
||||||
submit: Submit
|
submit: Submit
|
||||||
sure?: Are you sure?
|
sure?: Are you sure?
|
||||||
|
|
|
@ -17,7 +17,7 @@ zh_tw:
|
||||||
edit: 編輯
|
edit: 編輯
|
||||||
email: 電子郵件
|
email: 電子郵件
|
||||||
enable: 啟用
|
enable: 啟用
|
||||||
forget_password: 忘記密碼?
|
forgot_password: 忘記密碼?
|
||||||
help: 協助
|
help: 協助
|
||||||
hide: 隱藏
|
hide: 隱藏
|
||||||
homepage: 首頁
|
homepage: 首頁
|
||||||
|
@ -25,10 +25,11 @@ zh_tw:
|
||||||
logout: 登出
|
logout: 登出
|
||||||
no_: "No"
|
no_: "No"
|
||||||
nothing: 無
|
nothing: 無
|
||||||
or_lower: 或者
|
or_lower: 或
|
||||||
password: 密碼
|
password: 密碼
|
||||||
register: 註冊
|
register: 註冊
|
||||||
remember_me: 記住我
|
remember_me: 記住我
|
||||||
|
search_nccu: 搜尋政大
|
||||||
show: 顯示
|
show: 顯示
|
||||||
submit: 送出
|
submit: 送出
|
||||||
sure?: 您肯定嗎?
|
sure?: 您肯定嗎?
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
PrototypeR4::Application.routes.draw do
|
Orbit::Application.routes.draw do
|
||||||
|
|
||||||
devise_for :users
|
devise_for :users
|
||||||
|
|
||||||
|
|
|
@ -31,4 +31,44 @@ module OrbitCoreLib
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
module ObjectTokenUnility
|
||||||
|
def self.included(base)
|
||||||
|
base.instance_eval("field :s_token")
|
||||||
|
base.instance_eval("after_create :generate_token")
|
||||||
|
end
|
||||||
|
|
||||||
|
def token
|
||||||
|
return self.s_token
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
def generate_token
|
||||||
|
self.s_token = ActiveSupport::SecureRandom.hex(16)
|
||||||
|
self.save!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
module PermissionUnility
|
||||||
|
private
|
||||||
|
def check_permission(type = :use)
|
||||||
|
permission_grant = current_user.admin?? true : false
|
||||||
|
module_app = @module_app.nil?? find_module_app_by_token(params[:token]) : @module_app
|
||||||
|
unless permission_grant
|
||||||
|
permission_grant = case type
|
||||||
|
when :use
|
||||||
|
users_ary = module_app.app_auth.auth_users rescue 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))
|
||||||
|
when :manager
|
||||||
|
module_app.is_manager?(current_user)
|
||||||
|
when :sub_manager
|
||||||
|
module_app.is_manager?(current_user) || module_app.is_sub_manager?(current_user)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
permission_grant
|
||||||
|
end
|
||||||
|
def find_module_app_by_token(token)
|
||||||
|
ModuleApp.first(conditions: {s_token: token})
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -100,7 +100,7 @@ module ParserBackEnd
|
||||||
ret = ''
|
ret = ''
|
||||||
if (tag.attributes["main"] == "true" && !page.module_app.nil?)
|
if (tag.attributes["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}?inner=true&page_id=#{page.id}"
|
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}?inner=true&page_id=#{page.id}"
|
||||||
ret << "&bulletin_category_id=#{page.category}" if page[:category]
|
ret << "&category_id=#{page.category}" if page[:category]
|
||||||
ret << "'></div>"
|
ret << "'></div>"
|
||||||
else
|
else
|
||||||
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s }
|
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s }
|
||||||
|
|
|
@ -62,6 +62,7 @@ module ParserFrontEnd
|
||||||
c.define_tag 'stylesheets' do |tag|
|
c.define_tag 'stylesheets' do |tag|
|
||||||
res = ''
|
res = ''
|
||||||
res << "<link href='/assets/bootstrap.css.erb' rel='stylesheet' type='text/css'/>"
|
res << "<link href='/assets/bootstrap.css.erb' rel='stylesheet' type='text/css'/>"
|
||||||
|
res << "<link href='/assets/bootstrap-orbit.css' rel='stylesheet' type='text/css'/>"
|
||||||
res << "<link href='/assets/style.css.erb' rel='stylesheet' type='text/css'/>"
|
res << "<link href='/assets/style.css.erb' rel='stylesheet' type='text/css'/>"
|
||||||
res << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />" if page.design.reset_css
|
res << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />" if page.design.reset_css
|
||||||
res << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' /> " if page.design.default_css
|
res << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' /> " if page.design.default_css
|
||||||
|
@ -81,7 +82,7 @@ module ParserFrontEnd
|
||||||
res << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>"
|
res << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>"
|
||||||
res << "<script type='text/javascript' src='/assets/event.js'></script>"
|
res << "<script type='text/javascript' src='/assets/event.js'></script>"
|
||||||
page.design.javascripts.each do |js|
|
page.design.javascripts.each do |js|
|
||||||
res << "<script type='text/javascript' src='#{js.file.url}'></script>"
|
# res << "<script type='text/javascript' src='#{js.file.url}'></script>"
|
||||||
end
|
end
|
||||||
res
|
res
|
||||||
end
|
end
|
||||||
|
@ -127,7 +128,7 @@ module ParserFrontEnd
|
||||||
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 << "/#{id}" if id
|
ret << "/#{id}" if id
|
||||||
ret << "?inner=true&page_id=#{page.id}"
|
ret << "?inner=true&page_id=#{page.id}"
|
||||||
ret << "&bulletin_category_id=#{page.category}" if page[:category]
|
ret << "&category_id=#{page.category}" if page[:category]
|
||||||
ret << "'></div>"
|
ret << "'></div>"
|
||||||
else
|
else
|
||||||
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil
|
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
namespace :anc do
|
||||||
|
|
||||||
|
task :build => :environment do
|
||||||
|
bulletin_category_1 = BulletinCategory.create(:key => "C1ChrisCheckANDPreivew",:display => "List" )
|
||||||
|
bulletin_category_1.create_i18n_variable(:en => "ChrisCheckANDPreivew", :zh_tw => 'ChrisCheckANDPreivew')
|
||||||
|
bulletin_category_2 = BulletinCategory.create(:key => "C2MattCheckANDPreivew",:display => "List" )
|
||||||
|
bulletin_category_2.create_i18n_variable(:en => "MattCheckANDPreivew", :zh_tw => 'MattCheckANDPreivew')
|
||||||
|
bulletin_category_3 = BulletinCategory.create(:key => "C3MattCheckChrisPreview",:display => "List" )
|
||||||
|
bulletin_category_3.create_i18n_variable(:en => "MattCheckChrisPreview", :zh_tw => 'MattCheckChrisPreview')
|
||||||
|
|
||||||
|
|
||||||
|
bulletin_1 = Bulletin.create(:title => "C1P1",:status => nil,:subtitle => "",:text => "value",:post_date => Time.now,:deadline => nil,:bulletin_category => bulletin_category_1 )
|
||||||
|
bulletin_2 = Bulletin.create(:title => "C1P2",:status => nil,:subtitle => "",:text => "value",:post_date => Time.now,:deadline => nil,:bulletin_category => bulletin_category_1 )
|
||||||
|
bulletin_3 = Bulletin.create(:title => "C2P1",:status => nil,:subtitle => "",:text => "value",:post_date => Time.now,:deadline => nil,:bulletin_category => bulletin_category_2 )
|
||||||
|
bulletin_4 = Bulletin.create(:title => "C2P2",:status => nil,:subtitle => "",:text => "value",:post_date => Time.now,:deadline => nil,:bulletin_category => bulletin_category_2 )
|
||||||
|
bulletin_5 = Bulletin.create(:title => "C3P1",:status => nil,:subtitle => "",:text => "value",:post_date => Time.now,:deadline => nil,:bulletin_category => bulletin_category_3 )
|
||||||
|
bulletin_6 = Bulletin.create(:title => "C3P2",:status => nil,:subtitle => "",:text => "value",:post_date => Time.now,:deadline => nil,:bulletin_category => bulletin_category_3 )
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
|
@ -125,6 +125,12 @@ namespace :dev do
|
||||||
AttributeValue.create( :user_id => user.id, :attribute_field_id => i_1.attribute_fields[1].id, :key => 'last_name', :en => 'Fu', :zh_tw => '傅' )
|
AttributeValue.create( :user_id => user.id, :attribute_field_id => i_1.attribute_fields[1].id, :key => 'last_name', :en => 'Fu', :zh_tw => '傅' )
|
||||||
AttributeValue.create( :user_id => user.id, :attribute_field_id => sr_2_1.attribute_fields[0].id, :key => 'major', :en => 'Information management', :zh_tw => '信息化管理' )
|
AttributeValue.create( :user_id => user.id, :attribute_field_id => sr_2_1.attribute_fields[0].id, :key => 'major', :en => 'Information management', :zh_tw => '信息化管理' )
|
||||||
AttributeValue.create( :user_id => user.id, :attribute_field_id => sr_2_1.attribute_fields[1].id, :key => 'department', :en => 'Computer Science', :zh_tw => '計算機科學' )
|
AttributeValue.create( :user_id => user.id, :attribute_field_id => sr_2_1.attribute_fields[1].id, :key => 'department', :en => 'Computer Science', :zh_tw => '計算機科學' )
|
||||||
|
|
||||||
|
user = User.create( :email => 'manager@rulingcom.com', :password => 'password', :password_confirmation => 'password', :admin => false, :role_id => r_2.id, :sub_role_ids => [sr_2_1.id ] )
|
||||||
|
AttributeValue.create( :user_id => user.id, :attribute_field_id => i_1.attribute_fields[0].id, :key => 'first_name', :en => 'Manager', :zh_tw => '管理員' )
|
||||||
|
AttributeValue.create( :user_id => user.id, :attribute_field_id => i_1.attribute_fields[1].id, :key => 'last_name', :en => 'Chen', :zh_tw => '陳' )
|
||||||
|
AttributeValue.create( :user_id => user.id, :attribute_field_id => sr_2_1.attribute_fields[0].id, :key => 'major', :en => 'Information management', :zh_tw => '信息化管理' )
|
||||||
|
AttributeValue.create( :user_id => user.id, :attribute_field_id => sr_2_1.attribute_fields[1].id, :key => 'department', :en => 'Computer Science', :zh_tw => '計算機科學' )
|
||||||
|
|
||||||
|
|
||||||
ad_banner = AdBanner.new(:title => 'banner_1',:post_date => Date.today,:context=> "context",:ad_fx=>'zoom',:direct_to_after_click=>true)
|
ad_banner = AdBanner.new(:title => 'banner_1',:post_date => Date.today,:context=> "context",:ad_fx=>'zoom',:direct_to_after_click=>true)
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace :user do
|
||||||
User.all(conditions: {email: /nor/}).destroy_all
|
User.all(conditions: {email: /nor/}).destroy_all
|
||||||
|
|
||||||
username_list = %w{nor1 nor2 nor3 nor4 nor5 nor6 nor7}
|
username_list = %w{nor1 nor2 nor3 nor4 nor5 nor6 nor7}
|
||||||
userfirstname_list_en = %w{ One Two Thre For Fiv Six Sen }
|
userfirstname_list_en = %w{ UserOne UserTwo Thre For Fiv Six Sen }
|
||||||
userlastname_list_en = %w{ Aa Bb Cc Dd Ee Ff Gg }
|
userlastname_list_en = %w{ Aa Bb Cc Dd Ee Ff Gg }
|
||||||
|
|
||||||
userfirstname_list_ct = %w{ 一一 二二 三三 四四 五五 六六 七七 }
|
userfirstname_list_ct = %w{ 一一 二二 三三 四四 五五 六六 七七 }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"title": "Announcement",
|
"title": "announcement",
|
||||||
"version": "0.1",
|
"version": "0.1",
|
||||||
"organization": "Rulingcom",
|
"organization": "Rulingcom",
|
||||||
"author": "RD dep",
|
"author": "RD dep",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
|
class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
|
|
||||||
layout 'new_admin'
|
layout 'new_admin'
|
||||||
|
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
@ -15,7 +14,7 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
|
||||||
|
|
||||||
# @bulletins = Bulletin.search(params[:search], params[:category_id])
|
# @bulletins = Bulletin.search(params[:search], params[:category_id])
|
||||||
# @bulletins = Bulletin.all.order_by([params[:sort], params[:direction]])
|
# @bulletins = Bulletin.all.order_by([params[:sort], params[:direction]])
|
||||||
@bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.limit(1).desc("postdate")
|
@bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.all
|
||||||
@bulletin_categories = BulletinCategory.all
|
@bulletin_categories = BulletinCategory.all
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -137,7 +136,7 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
|
||||||
# end
|
# end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @bulletin.update_attributes(params[:bulletin])
|
if @bulletin.update_attributes(params[:bulletin]) && @bulletin.save
|
||||||
# format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('bulletin.update_bulletin_success')) }
|
# format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('bulletin.update_bulletin_success')) }
|
||||||
format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('bulletin.update_bulletin_success')) }
|
format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('bulletin.update_bulletin_success')) }
|
||||||
format.js { render 'toggle_enable' }
|
format.js { render 'toggle_enable' }
|
||||||
|
@ -177,7 +176,17 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def get_categorys(id = nil)
|
def get_categorys(id = nil)
|
||||||
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
|
@bulletin_categorys = []
|
||||||
|
if(is_manager? || is_admin?)
|
||||||
|
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
|
||||||
|
elsif is_sub_manager?
|
||||||
|
@bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit_new')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_tags
|
||||||
|
module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
|
||||||
|
@tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_tags
|
def get_tags
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
class Panel::Announcement::BackEnd::FactChecksController < OrbitBackendController
|
||||||
|
before_filter :authenticate_user!
|
||||||
|
include AdminHelper
|
||||||
|
# layout 'admin'
|
||||||
|
layout 'new_admin'
|
||||||
|
|
||||||
|
def setting
|
||||||
|
@bulletin_categorys = BulletinCategory.all
|
||||||
|
if params.has_key?(:category_id)
|
||||||
|
first_category = BulletinCategory.find params[:category_id]
|
||||||
|
if params[:commit] == 'Update'
|
||||||
|
privilege_users = params[:users].collect{|key,value| User.find key } rescue []
|
||||||
|
preload_object_auth_ary = first_category.object_auths.where(title: 'fact_check') || (first_category.object_auths.create :title=> 'fact_check')
|
||||||
|
preload_object_auth = preload_object_auth_ary.first
|
||||||
|
preload_object_auth.privilege_users = privilege_users
|
||||||
|
preload_object_auth.save!
|
||||||
|
end
|
||||||
|
else
|
||||||
|
first_category = @bulletin_categorys.first
|
||||||
|
end
|
||||||
|
preload_object_auth = first_category.object_auths.where(title: 'fact_check') || (first_category.object_auths.create :title=> 'fact_check')
|
||||||
|
@users_array = preload_object_auth.first.privilege_users rescue []
|
||||||
|
respond_to do |format|
|
||||||
|
format.html
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update_setting
|
||||||
|
|
||||||
|
end
|
||||||
|
# def index
|
||||||
|
# get_categorys(params[:bulletin_category_id])
|
||||||
|
#
|
||||||
|
# @bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.all
|
||||||
|
# @bulletin_categories = BulletinCategory.all
|
||||||
|
#
|
||||||
|
# module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
|
||||||
|
# @tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc)
|
||||||
|
#
|
||||||
|
# respond_to do |format|
|
||||||
|
# format.html # index.html.erb
|
||||||
|
# format.js
|
||||||
|
# format.xml { render :xml => @bulletins }
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# def new
|
||||||
|
#
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# def create
|
||||||
|
#
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# def update
|
||||||
|
#
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# def edit
|
||||||
|
#
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# def destroy
|
||||||
|
#
|
||||||
|
# end
|
||||||
|
protected
|
||||||
|
def get_categorys(id = nil)
|
||||||
|
@bulletin_categorys = []
|
||||||
|
if(is_manager? || is_admin?)
|
||||||
|
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
|
||||||
|
elsif is_sub_manager?
|
||||||
|
@bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit_new')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
|
class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
super
|
super
|
||||||
|
@ -11,13 +11,15 @@ class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController
|
||||||
def index
|
def index
|
||||||
|
|
||||||
date_now = Time.now
|
date_now = Time.now
|
||||||
if params[:bulletin_category_id]
|
if params[:category_id]
|
||||||
@bulletins = Bulletin.where(:bulletin_category_id => params[:bulletin_category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
|
@bulletins = Bulletin.where(:bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
|
||||||
else
|
else
|
||||||
@bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
|
@bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10)
|
||||||
end
|
end
|
||||||
|
|
||||||
get_categorys
|
get_categorys
|
||||||
|
|
||||||
|
@current_category = BulletinCategory.from_id(params[:category_id]) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Panel::Announcement::Widget::BulletinsController < ObitWidgetController
|
class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
super
|
super
|
||||||
|
@ -28,6 +28,7 @@ class Panel::Announcement::Widget::BulletinsController < ObitWidgetController
|
||||||
@selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0]
|
@selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0]
|
||||||
@bulletins = @selected_tag.get_visible_bulletins.page(params[:page]).per(5) rescue nil
|
@bulletins = @selected_tag.get_visible_bulletins.page(params[:page]).per(5) rescue nil
|
||||||
@web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links.page(params[:page]).per(5) rescue nil
|
@web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links.page(params[:page]).per(5) rescue nil
|
||||||
|
render :layout => 'module_widget'
|
||||||
end
|
end
|
||||||
|
|
||||||
def reload_bulletins
|
def reload_bulletins
|
||||||
|
|
|
@ -4,7 +4,7 @@ class Bulletin
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
include Mongoid::MultiParameterAttributes
|
include Mongoid::MultiParameterAttributes
|
||||||
|
|
||||||
has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
|
has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
|
||||||
has_one :subtitle, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
|
has_one :subtitle, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
|
||||||
has_one :text, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
|
has_one :text, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
|
||||||
|
@ -19,6 +19,9 @@ class Bulletin
|
||||||
field :is_top, :type => Boolean, :default => false
|
field :is_top, :type => Boolean, :default => false
|
||||||
field :is_hot, :type => Boolean, :default => false
|
field :is_hot, :type => Boolean, :default => false
|
||||||
field :is_hidden, :type => Boolean, :default => false
|
field :is_hidden, :type => Boolean, :default => false
|
||||||
|
field :is_checked, :type => Boolean, :default => false
|
||||||
|
|
||||||
|
field :not_checked_reason
|
||||||
|
|
||||||
field :public, :type => Boolean, :default => true
|
field :public, :type => Boolean, :default => true
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
class BulletinCategory
|
class BulletinCategory
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
|
include OrbitCoreLib::ObjectAuthable
|
||||||
|
|
||||||
|
ObjectAuthTitlesOptions = %W{submit_new fact_check}
|
||||||
|
AfterObjectAuthUrl = '/panel/announcement/back_end/bulletin_categorys'
|
||||||
# include Mongoid::MultiParameterAttributes
|
# include Mongoid::MultiParameterAttributes
|
||||||
|
|
||||||
PAYMENT_TYPES = [ "List", "Picture" ]
|
PAYMENT_TYPES = [ "List", "Picture" ]
|
||||||
|
@ -14,4 +18,8 @@ class BulletinCategory
|
||||||
|
|
||||||
has_many :bulletins
|
has_many :bulletins
|
||||||
|
|
||||||
|
def self.from_id(id)
|
||||||
|
BulletinCategory.find(id) rescue nil
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -14,4 +14,4 @@
|
||||||
<td><%= bulletin_category.i18n_variable[locale] rescue nil %></td>
|
<td><%= bulletin_category.i18n_variable[locale] rescue nil %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td><%= bulletin_category.display %></td>
|
<td><%= bulletin_category.display %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
<% # encoding: utf-8 %>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :key %><br />
|
|
||||||
<%= f.text_field :key %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :name %><br />
|
|
||||||
<%= f.fields_for :i18n_variable, (@bulletin_category.new_record? ? @bulletin_category.build_i18n_variable : @bulletin_category.i18n_variable) do |f| %>
|
|
||||||
<% @site_valid_locales.each do |locale| %>
|
|
||||||
<%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
|
|
||||||
<%= f.text_field locale, :style => "width:130px" %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :display %> <br />
|
|
||||||
<%#= f.select :display, BulletinCategory::PAYMENT_TYPES, :prompt => 'Select a display method' %>
|
|
||||||
|
|
||||||
<%= f.radio_button :display, "List" %>List
|
|
||||||
<%#= f.label :display, 'list', :value => '1', :checked => @a %>
|
|
||||||
<%= f.radio_button :display, "Picture" %>Picture
|
|
||||||
<%#= f.label :display, 'picture', :value => '2', :checked => @b %>
|
|
||||||
<br />顯示方式是設定在前台頁面時,資訊所呈現的樣式
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="actions">
|
|
||||||
<%= f.submit %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<% content_for :secondary do %>
|
<% content_for :secondary do %>
|
||||||
<ul class="list">
|
<%= render :partial => '/panel/announcement/back_end/announcement_secondary' %>
|
||||||
<li><%= link_to t('bulletin_category.index'), panel_announcement_back_end_bulletin_categorys_path, :class => 'seclink2' %></li>
|
|
||||||
</ul>
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<%= flash_messages %>
|
<%= flash_messages %>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
|
||||||
<h1><%= t('bulletin_category.new_announcement_class') %></h1>
|
<h1><%= t('bulletin_category.new_announcement_class') %></h1>
|
||||||
<%= form_for @bulletin_category, :url => panel_announcement_back_end_bulletin_categorys_path do |f| %>
|
<%= form_for @bulletin_category, :url => panel_announcement_back_end_bulletin_categorys_path do |f| %>
|
||||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||||
|
|
|
@ -24,11 +24,12 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
<li class="dropdown"><%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||||
|
<li><%= link_to t('bulletin.fact_check'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] %></td>
|
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] %></td>
|
||||||
<td><%= link_to bulletin.title[I18n.locale], panel_announcement_back_end_bulletin_path(bulletin) %></td>
|
<td><%= link_to bulletin.title[I18n.locale], panel_announcement_back_end_bulletin_path(bulletin) rescue ''%></td>
|
||||||
<td><%= bulletin.postdate %></td>
|
<td><%= bulletin.postdate %></td>
|
||||||
<td><%= (bulletin.deadline) ? bulletin.deadline : t('bulletin.no_deadline') %></td>
|
<td><%= (bulletin.deadline) ? bulletin.deadline : t('bulletin.no_deadline') %></td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -36,7 +37,7 @@
|
||||||
<span class="label label-tags"><%= tag[I18n.locale] %></span>
|
<span class="label label-tags"><%= tag[I18n.locale] %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= User.from_id(bulletin.update_user_id).name %></td>
|
<td><%= User.from_id(bulletin.update_user_id).name rescue ''%></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<%= render :partial => 'quick_edit', :locals => {:bulletin => bulletin} %>
|
<%= render :partial => 'quick_edit', :locals => {:bulletin => bulletin} %>
|
||||||
|
|
|
@ -36,4 +36,4 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="sort-holder">
|
<tbody class="sort-holder">
|
||||||
<%= render :partial => 'bulletin', :collection => @bulletins %>
|
<%= render :partial => 'bulletin', :collection => @bulletins %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -1,6 +1,25 @@
|
||||||
<% # encoding: utf-8 %>
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
<%= f.error_messages %>
|
<%= f.error_messages %>
|
||||||
|
<%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %>
|
||||||
|
<div class="field">
|
||||||
|
<%= label :fact_check_stat, t('announcement.bulletin.fact_check_stat') %>
|
||||||
|
<%= f.radio_button :is_checked, true%>
|
||||||
|
<%= label :is_checked_true, t('announcement.bulletin.fact_check_pass') %>
|
||||||
|
<%= f.radio_button :is_checked, false, (@bulletin.is_checked.nil?? {:checked => true} : {}) %>
|
||||||
|
<%= label :is_checked_false, t('announcement.bulletin.fact_check_not_pass') %>
|
||||||
|
|
||||||
|
<%= label :is_checked_false, t('announcement.bulletin.fact_check_not_pass_reason') %>
|
||||||
|
<%= f.text_field :not_checked_reason %>
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<%= f.label :image, t('announcement.image') %><br />
|
||||||
|
<%= f.file_field :image %>
|
||||||
|
<% if @bulletin.image.file %>
|
||||||
|
<%= check_box_tag 'bulletin[image_del]' %>
|
||||||
|
<%= t('announcement.刪除已上傳檔案') %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!--Widget start-->
|
<!--Widget start-->
|
||||||
|
|
||||||
|
@ -83,7 +102,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!--Wiget End-->
|
<!--Wiget End-->
|
||||||
<!--Post Start-->
|
<!--Post Start-->
|
||||||
|
|
||||||
|
@ -194,49 +213,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="main-wiget">
|
|
||||||
<div id="widget-link" class="widget-box">
|
|
||||||
<div class="widget-action clear">
|
|
||||||
<a class="action"><i title="Add a reference link" class="icon-exclamation-sign icon-white tip"></i></a>
|
|
||||||
</div>
|
|
||||||
<h3 class="widget-title"><i class="icons-link icons-white"></i>Link</h3>
|
|
||||||
<div class="widget-content">
|
|
||||||
<table class="table table-condensed">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Chinese</th>
|
|
||||||
<th>English</th>
|
|
||||||
<th class="span1"></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td style="text-align:center" colspan="3">
|
|
||||||
<a class="btn btn-primary btn-small" href="#modal-link" data-toggle="modal"><i class="icon-plus icon-white"></i> ADD/新增</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
<tbody>
|
|
||||||
<%#= render :partial => 'bulletin_link2', :collection => @bulletin.bulletin_links %>
|
|
||||||
|
|
||||||
<% @bulletin.bulletin_links.each_with_index do |bulletin_link2, i| %>
|
|
||||||
<%= f.fields_for :bulletin_links, bulletin_link2 do |f| %>
|
|
||||||
<%= render :partial => 'bulletin_link2', :object => bulletin_link2, :locals => {:f => f, :i => i} %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="bulletin_link_qe"><%#= render :partial => "bulletin_link_qe" %></div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="main-wiget">
|
<div class="main-wiget">
|
||||||
<div id="widget-file" class="widget-box">
|
<div id="widget-file" class="widget-box">
|
||||||
<div class="widget-action clear">
|
<div class="widget-action clear">
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
<td colspan="8">
|
<td colspan="8">
|
||||||
<legend><%= t(:quick_edit) %> - <span class='qe_title'></span>Basic / Picture / Tags / Link / File</legend>
|
<legend><%= t(:quick_edit) %> - <span class='qe_title'></span>Basic / Picture / Tags / Link / File</legend>
|
||||||
<%= form_for bulletin, :url => panel_announcement_back_end_bulletin_path(bulletin), :html => {:class => 'form-horizontal'} do |f| %>
|
<%= form_for bulletin, :url => panel_announcement_back_end_bulletin_path(bulletin), :html => {:class => 'form-horizontal'} do |f| %>
|
||||||
<%= render :partial => "quick_edit_basic", :locals => { :f => f, :bulletin => bulletin } %>
|
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_basic", :locals => { :f => f, :bulletin => bulletin } %>
|
||||||
<%= render :partial => "quick_edit_picture", :locals => { :f => f, :bulletin => bulletin } %>
|
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_picture", :locals => { :f => f, :bulletin => bulletin } %>
|
||||||
<%= render :partial => "quick_edit_tags", :locals => { :f => f, :bulletin => bulletin } %>
|
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_tags", :locals => { :f => f, :bulletin => bulletin } %>
|
||||||
<%= render :partial => "quick_edit_links", :locals => { :f => f, :bulletin => bulletin } %>
|
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_links", :locals => { :f => f, :bulletin => bulletin } %>
|
||||||
<%= render :partial => "quick_edit_files", :locals => { :f => f, :bulletin => bulletin } %>
|
<%= render :partial => "panel/announcement/back_end/bulletins/quick_edit_files", :locals => { :f => f, :bulletin => bulletin } %>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<%= f.submit t(:submit), :class => 'btn btn-primary' %>
|
<%= f.submit t(:submit), :class => 'btn btn-primary' %>
|
||||||
<%= f.submit t(:cancel), :class => 'btn', :type => 'reset' %>
|
<%= f.submit t(:cancel), :class => 'btn', :type => 'reset' %>
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= link_back %>
|
<%= link_back %>
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
<table id="bulettin_sort_list" class="table main-list">
|
<table id="bulettin_sort_list" class="table main-list">
|
||||||
<%= render 'bulletins' %>
|
<%= render 'bulletins' %>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<%= javascript_include_tag "bulletin_form" %>
|
<%= javascript_include_tag "bulletin_form" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
<%= form_for @bulletin, :url => panel_announcement_back_end_bulletins_path do |f| %>
|
<%= form_for @bulletin, :url => panel_announcement_back_end_bulletins_path do |f| %>
|
||||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= link_back %>
|
<%= link_back %>
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<% # encoding: utf-8 %>
|
<% content_for :secondary do %>
|
||||||
|
<%= render :partial => '/panel/announcement/back_end/announcement_secondary' %>
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
|
<%= flash_messages %>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
<br />
|
||||||
<p id="notice"><%= flash_messages %></p>
|
<br />
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
<%= flash_messages %>
|
<%= flash_messages %>
|
||||||
|
|
||||||
<h1 class="h1"><%= t('announcement.list_announcement') %></h1>
|
<% if @current_category %>
|
||||||
|
<h1 class="h1"><%= @current_category.i18n_variable[I18n.locale] + t('announcement.bulletin.list_lower') %></h1>
|
||||||
|
<% else %>
|
||||||
|
<h1 class="h1"><%= t('announcement.list_announcement') %></h1>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
|
@ -24,6 +28,6 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<%= paginate @bulletins %>
|
<%= paginate @bulletins, :params => {:inner => 'false'} %>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<% @web_links.each do |web_link| %>
|
<% @web_links.each do |web_link| %>
|
||||||
<li>
|
<li>
|
||||||
<a><%= web_link.name[I18n.locale] %></a>
|
<%= link_to web_link.name[I18n.locale], web_link.url %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,12 @@ en:
|
||||||
list_lower: " list"
|
list_lower: " list"
|
||||||
title: Title
|
title: Title
|
||||||
postdate: Postdate
|
postdate: Postdate
|
||||||
|
fact_check: Fact Check
|
||||||
|
fact_check_setting: Fact Check Setting
|
||||||
|
fact_check_stat: Fact Check Status
|
||||||
|
fact_check_not_pass: 'Not Pass'
|
||||||
|
fact_check_not_pass_reason: 'Reason'
|
||||||
|
fact_check_pass: 'Pass'
|
||||||
# admin:
|
# admin:
|
||||||
# action: Action
|
# action: Action
|
||||||
# add_language: Add language
|
# add_language: Add language
|
||||||
|
|
|
@ -30,6 +30,13 @@ zh_tw:
|
||||||
list_lower: 列表
|
list_lower: 列表
|
||||||
title: 標題
|
title: 標題
|
||||||
postdate: 張貼日期
|
postdate: 張貼日期
|
||||||
|
fact_check: 公告審核
|
||||||
|
fact_check_setting: 審核設定
|
||||||
|
fact_check_stat: 審核狀況
|
||||||
|
fact_check_not_pass: '不通過'
|
||||||
|
fact_check_pass: '通過'
|
||||||
|
fact_check_not_pass_reason: '不通過原因'
|
||||||
|
|
||||||
# admin:
|
# admin:
|
||||||
# action: 行動
|
# action: 行動
|
||||||
# add_language: 新增語言
|
# add_language: 新增語言
|
||||||
|
|
|
@ -2,6 +2,10 @@ Rails.application.routes.draw do
|
||||||
namespace :panel do
|
namespace :panel do
|
||||||
namespace :announcement do
|
namespace :announcement do
|
||||||
namespace :back_end do
|
namespace :back_end do
|
||||||
|
match 'public' => "announcements#public",:as => :public
|
||||||
|
match 'fact_check_setting' => "fact_checks#setting" ,:as => :fact_checks_setting
|
||||||
|
match 'update_setting' => "fact_checks#update_setting" ,:as => :fact_checks_update_setting
|
||||||
|
|
||||||
root :to => "bulletins#index"
|
root :to => "bulletins#index"
|
||||||
resources :bulletins do
|
resources :bulletins do
|
||||||
match "link_quick_add/:bulletin_id" => "bulletins#link_quick_add" ,:as => :link_quick_add
|
match "link_quick_add/:bulletin_id" => "bulletins#link_quick_add" ,:as => :link_quick_add
|
||||||
|
@ -10,11 +14,9 @@ Rails.application.routes.draw do
|
||||||
resources :bulletin_categorys, :controller => 'bulletin_categorys' do
|
resources :bulletin_categorys, :controller => 'bulletin_categorys' do
|
||||||
match "quick_edit/:bulletin_category_id" => "bulletin_categorys#quick_edit" ,:as => :quick_edit
|
match "quick_edit/:bulletin_category_id" => "bulletin_categorys#quick_edit" ,:as => :quick_edit
|
||||||
end
|
end
|
||||||
resources :bulletin_links
|
|
||||||
resources :tags
|
resources :tags
|
||||||
end
|
end
|
||||||
namespace :front_end do
|
namespace :front_end do
|
||||||
root :to => "bulletins#index"
|
|
||||||
resources :bulletins
|
resources :bulletins
|
||||||
end
|
end
|
||||||
namespace :widget do
|
namespace :widget do
|
||||||
|
@ -25,4 +27,4 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
# desc "Explaining what the task does"
|
|
||||||
# task :announcement do
|
|
||||||
# # Task goes here
|
|
||||||
# end
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Panel::NewBlog::FrontEnd::CommentsController < ObitFrontendController
|
class Panel::NewBlog::FrontEnd::CommentsController < OrbitFrontendController
|
||||||
def create
|
def create
|
||||||
@post = Post.find(params[:post_id])
|
@post = Post.find(params[:post_id])
|
||||||
@comment = @post.comments.create!(params[:comment])
|
@comment = @post.comments.create!(params[:comment])
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Panel::NewBlog::FrontEnd::PostsController < ObitFrontendController
|
class Panel::NewBlog::FrontEnd::PostsController < OrbitFrontendController
|
||||||
# GET /posts
|
# GET /posts
|
||||||
# GET /posts.xml
|
# GET /posts.xml
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Panel::NewBlog::Widget::PostsController < ObitWidgetController
|
class Panel::NewBlog::Widget::PostsController < OrbitWidgetController
|
||||||
# GET /posts
|
# GET /posts
|
||||||
# GET /posts.xml
|
# GET /posts.xml
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# # Add a load path for this specific Engine
|
# # Add a load path for this specific Engine
|
||||||
# # config.autoload_paths << File.expand_path("../lib/some/path", __FILE__)
|
# # config.autoload_paths << File.expand_path("../lib/some/path", __FILE__)
|
||||||
# put "ABC"
|
# put "ABC"
|
||||||
# PrototypeR4::Application::Orbit_Apps << "NewBlog"
|
# Orbit::Application::Orbit_Apps << "NewBlog"
|
||||||
#
|
#
|
||||||
# # initializer "my_engine.add_middleware" do |app|
|
# # initializer "my_engine.add_middleware" do |app|
|
||||||
# # app.middleware.use MyEngine::Middleware
|
# # app.middleware.use MyEngine::Middleware
|
||||||
|
@ -15,4 +15,4 @@ module NewBlog
|
||||||
VERSION = "0.0.1"
|
VERSION = "0.0.1"
|
||||||
MOUDLEAPP_TITLE = "NewBlog"
|
MOUDLEAPP_TITLE = "NewBlog"
|
||||||
end
|
end
|
||||||
# PrototypeR4::Application::Orbit_Apps << "NewBlog"
|
# Orbit::Application::Orbit_Apps << "NewBlog"
|
|
@ -1,4 +1,4 @@
|
||||||
class Panel::PageContent::FrontEnd::PageContextsController < ObitWidgetController
|
class Panel::PageContent::FrontEnd::PageContextsController < OrbitWidgetController
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
super
|
super
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Panel::WebResource::FrontEnd::WebLinksController < ObitWidgetController
|
class Panel::WebResource::FrontEnd::WebLinksController < OrbitWidgetController
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
super
|
super
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Panel::WebResource::Widget::WebLinksController < ObitWidgetController
|
class Panel::WebResource::Widget::WebLinksController < OrbitWidgetController
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
super
|
super
|
||||||
|
@ -14,7 +14,7 @@ class Panel::WebResource::Widget::WebLinksController < ObitWidgetController
|
||||||
|
|
||||||
# @web_link = WebLink.where( :is_hidden => false ).desc(:is_top, :name).first
|
# @web_link = WebLink.where( :is_hidden => false ).desc(:is_top, :name).first
|
||||||
|
|
||||||
@web_links = WebLink.widget_datas.page(params[:page]).per(9)
|
@web_links = WebLink.widget_datas.page(params[:page]).per(5)
|
||||||
|
|
||||||
# get_categorys
|
# get_categorys
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class Panel::WebResource::Widget::WebLinksController < ObitWidgetController
|
||||||
end
|
end
|
||||||
|
|
||||||
def reload_web_links
|
def reload_web_links
|
||||||
@web_links = WebLink.widget_datas.page(params[:page]).per(9)
|
@web_links = WebLink.widget_datas.page(params[:page]).per(5)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue