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

Conflicts:
	app/controllers/default_widget_controller.rb
	lib/tasks/migrate.rake
This commit is contained in:
Fu Matthew 2013-02-22 17:53:49 +08:00
commit 9fec7beb47
319 changed files with 3012 additions and 4094 deletions

1
.gitignore vendored
View File

@ -20,4 +20,3 @@ config/application.rb
app/assets/javascripts/.DS_Store
solr
Gemfile.lock

View File

@ -76,8 +76,8 @@ group :test, :development do
gem 'pry-remote'
gem 'pry-stack_explorer'
gem 'pry-debugger'
gem 'debugger'
gem 'faker'
gem "sunspot-rails-tester"
gem 'database_cleaner' #Strategies for cleaning databases. Can be used to ensure a clean state for testing.
gem "rspec", "~> 2.0"
@ -93,4 +93,3 @@ group :test, :development do
# gem "bluecloth"
end
gem 'debugger'

384
Gemfile.lock Normal file
View File

@ -0,0 +1,384 @@
GIT
remote: git://github.com/amatsuda/kaminari.git
revision: 2e09b5374fec33b57c6387ca7bac89ecaa60c9eb
specs:
kaminari (0.14.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
GIT
remote: git://github.com/charlotte-ruby/impressionist.git
revision: 0894f6a550a33f83f4937d655e9f0774521781e4
specs:
impressionist (1.2.0)
httpclient (~> 2.2)
nokogiri (~> 1.5)
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.2.12)
actionpack (= 3.2.12)
mail (~> 2.4.4)
actionpack (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.12)
activesupport (= 3.2.12)
builder (~> 3.0.0)
activerecord (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
activesupport (3.2.12)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
bcrypt-ruby (3.0.0)
binding_of_caller (0.7.1)
debug_inspector (>= 0.0.1)
bourne (1.1.2)
mocha (= 0.10.5)
brakeman (1.9.2)
erubis (~> 2.6)
fastercsv (~> 1.5)
haml (~> 3.0)
highline (~> 1.6)
multi_json (~> 1.2)
ruby2ruby (~> 2.0)
ruby_parser (~> 3.1.1)
sass (~> 3.0)
terminal-table (~> 1.4)
bson (1.8.2)
bson_ext (1.8.2)
bson (~> 1.8.2)
builder (3.0.4)
capybara (2.0.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 1.0.0)
carrierwave (0.6.2)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
carrierwave-mongoid (0.2.2)
carrierwave (~> 0.6.1)
mongoid (~> 2.1)
childprocess (0.3.8)
ffi (~> 1.0, >= 1.0.11)
chinese_pinyin (0.4.1)
chronic (0.9.0)
coderay (1.0.9)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.4.0)
columnize (0.3.6)
database_cleaner (0.9.1)
debug_inspector (0.0.2)
debugger (1.2.4)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
debugger-ruby_core_source (~> 1.1.7)
debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.1.8)
delorean (2.1.0)
chronic
devise (1.5.3)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
warden (~> 1.1)
diff-lcs (1.1.3)
encrypted_strings (0.3.3)
erubis (2.7.0)
exception_notification (3.0.1)
actionmailer (>= 3.0.4)
execjs (1.4.0)
multi_json (~> 1.0)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
faker (1.1.2)
i18n (~> 0.5)
fastercsv (1.5.5)
fattr (2.2.1)
ffi (1.4.0)
haml (3.1.8)
highline (1.6.15)
hike (1.2.1)
httpclient (2.3.2)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.1.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.0.1)
jquery-rails
railties (>= 3.1.0)
json (1.7.7)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
method_source (0.8.1)
mime-types (1.21)
mini_magick (3.5.0)
subexec (~> 0.2.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
mongo (1.8.2)
bson (~> 1.8.2)
mongo_session_store-rails3 (3.0.6)
actionpack (>= 3.0)
mongo
mongoid (2.6.0)
activemodel (~> 3.1)
mongo (~> 1.7)
tzinfo (~> 0.3.22)
mongoid-encryptor (0.0.5)
activesupport (~> 3.0)
encrypted_strings (~> 0.3.3)
mongoid (~> 2)
mongoid-tree (0.7.0)
mongoid (~> 2.0)
multi_json (1.6.1)
net-ldap (0.3.1)
nokogiri (1.5.6)
options (2.3.0)
fattr
orm_adapter (0.0.7)
polyglot (0.3.3)
pr_geohash (1.0.0)
progress_bar (0.4.0)
highline (~> 1.6.1)
options (~> 2.3.0)
pry (0.9.12)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pry-debugger (0.2.1)
debugger (~> 1.2.0)
pry (~> 0.9.10)
pry-remote (0.1.6)
pry (~> 0.9)
slop (~> 3.0)
pry-stack_explorer (0.4.9)
binding_of_caller (>= 0.7)
pry (~> 0.9.11)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-protection (1.3.2)
rack
rack-ssl (1.3.3)
rack
rack-test (0.6.2)
rack (>= 1.0)
radius (0.7.3)
rails (3.2.12)
actionmailer (= 3.2.12)
actionpack (= 3.2.12)
activerecord (= 3.2.12)
activeresource (= 3.2.12)
activesupport (= 3.2.12)
bundler (~> 1.0)
railties (= 3.2.12)
railties (3.2.12)
actionpack (= 3.2.12)
activesupport (= 3.2.12)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.0.3)
rdoc (3.12.1)
json (~> 1.4)
redis (3.0.2)
redis-namespace (1.2.1)
redis (~> 3.0.0)
redis-search (0.9.0)
chinese_pinyin (>= 0.3.0)
redis (>= 2.1.1)
redis-namespace (>= 1.0.2)
resque (1.23.0)
multi_json (~> 1.0)
redis-namespace (~> 1.0)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
resque-restriction (0.3.0)
resque (>= 1.7.0)
resque-scheduler (2.0.0)
redis (>= 2.0.1)
resque (>= 1.20.0)
rufus-scheduler
rmmseg-cpp-huacnlee (0.2.9)
rsolr (1.0.8)
builder (>= 2.1.2)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.2)
rspec-rails (2.12.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
ruby2ruby (2.0.3)
ruby_parser (~> 3.1)
sexp_processor (~> 4.0)
ruby_parser (3.1.1)
sexp_processor (~> 4.1)
rubyzip (0.9.9)
rufus-scheduler (2.0.17)
tzinfo (>= 0.3.23)
sass (3.2.5)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
selenium-webdriver (2.30.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip
websocket (~> 1.0.4)
sexp_processor (4.1.5)
shoulda-matchers (1.4.2)
activesupport (>= 3.0.0)
bourne (~> 1.1.2)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
sinatra (1.3.4)
rack (~> 1.4)
rack-protection (~> 1.3)
tilt (~> 1.3, >= 1.3.3)
slop (3.4.3)
social-share-button (0.1.1)
spork (0.9.2)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
subexec (0.2.2)
sunspot (1.3.3)
pr_geohash (~> 1.0)
rsolr (~> 1.0.7)
sunspot-rails-tester (0.0.4)
sunspot_rails (~> 1.2)
sunspot_mongo (1.0.1)
sunspot_rails
sunspot_rails (1.3.3)
nokogiri
sunspot (= 1.3.3)
sunspot_solr (1.3.3)
terminal-table (1.4.5)
thor (0.17.0)
tilt (1.3.3)
tinymce-rails (3.5.8)
railties (>= 3.1.1)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.35)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
vegas (0.1.11)
rack (>= 1.0.0)
warden (1.2.1)
rack (>= 1.0)
watchr (0.7)
websocket (1.0.7)
xpath (1.0.0)
nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
brakeman
bson_ext
capybara
carrierwave
carrierwave-mongoid
chinese_pinyin (= 0.4.1)
coffee-rails
database_cleaner
debugger
delorean
devise (= 1.5.3)
exception_notification
execjs
factory_girl_rails
faker
impressionist!
jquery-rails (= 2.1.4)
jquery-ui-rails
kaminari!
mime-types
mini_magick
mongo_session_store-rails3 (= 3.0.6)
mongoid (> 2.1, < 3.0.0)
mongoid-encryptor
mongoid-tree
net-ldap (~> 0.3.1)
nokogiri
progress_bar
pry
pry-debugger
pry-remote
pry-stack_explorer
radius
rails (~> 3.2.9)
rake
redis (>= 2.1.1)
redis-namespace
redis-search
resque
resque-restriction
resque-scheduler
rmmseg-cpp-huacnlee (= 0.2.9)
rspec (~> 2.0)
rspec-rails (~> 2.0)
rubyzip
sass-rails
shoulda-matchers
simplecov
sinatra
social-share-button
spork
sprockets
sunspot-rails-tester
sunspot_mongo
sunspot_solr
tinymce-rails
uglifier
watchr

View File

@ -31,5 +31,5 @@ label{
}
label{
white-space: nowrap !important ;
}
white-space: nowrap !important ;
}

View File

@ -35,7 +35,7 @@ div[data-role="page"] {
}
.main-menu ul {
background-color: #333;
width: 280px;
width: 210px;
list-style: none;
margin: 0 auto;
padding: 0;
@ -128,8 +128,8 @@ div[data-role="page"] {
left: 0;
}
.header .language .ui-btn-text i {
font-size: .83em;
margin-top: .2em;
font-size: 1.1em;
margin-top: .33em;
}
.header .language .ui-icon {
background-image: none;
@ -213,6 +213,9 @@ div[data-role="page"] {
padding: 0 10px 20px;
margin-bottom: 0;
}
#announcement_content .content {
padding: 10px;
}
#map div[data-role="content"] {
padding: 0;
}
@ -323,7 +326,7 @@ div[id^="dialog"] .content {
}
@media(min-width:600px) {
.main-menu ul {
width: 560px;
width: 420px;
}
.main-menu ul li {
width: 128px;
@ -331,7 +334,7 @@ div[id^="dialog"] .content {
}
@media(min-width:768px) {
.main-menu ul {
width: 640px;
width: 480px;
}
.main-menu ul li {
width: 148px;
@ -342,7 +345,7 @@ div[id^="dialog"] .content {
}
@media(min-width:800px) {
.main-menu ul {
width: 640px;
width: 480px;
}
.main-menu ul li {
width: 148px;
@ -350,7 +353,7 @@ div[id^="dialog"] .content {
}
@media(min-width:961px) {
.main-menu ul {
width: 640px;
width: 480px;
}
.main-menu ul li {
width: 148px;
@ -358,7 +361,7 @@ div[id^="dialog"] .content {
}
@media(min-width: 1024px) {
.main-menu ul {
width: 800px;
width: 600px;
}
.main-menu ul li {
width: 188px;

View File

@ -88,7 +88,7 @@ class Admin::AssetsController < OrbitBackendController
def delete
if params[:ids]
asset = Asset.any_in(:_id => params[:ids]).delete_all
asset = Asset.any_in(:_id => params[:ids]).destroy_all
end
redirect_to assets_url(:filter => params[:filter], :direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end

View File

@ -114,7 +114,7 @@ class Admin::DesignsController < OrbitBackendController
def delete
if params[:ids]
designs = Design.any_in(:_id => params[:ids]).delete_all
designs = Design.any_in(:_id => params[:ids]).destroy_all
end
redirect_to admin_designs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end

View File

@ -36,12 +36,11 @@ helper Admin::PagePartsHelper
if @item.module_app
@module_app = @item.module_app
@frontend_path = @item.app_frontend_url ? @item.app_frontend_url : @module_app.widgets.keys[0]
@frontend_path = @item.app_frontend_url
if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array}
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
end
if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array}
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
end
case @item.module_app.key
when 'announcement'
@ -59,7 +58,7 @@ helper Admin::PagePartsHelper
end
else
@categories = nil
@module_app = @module_apps[0]
@module_app = @module_apps[0]
end
end

View File

@ -4,10 +4,20 @@ class Admin::PluginsController < ApplicationController
def index
@plugins = OrbitApp::Module::Registration.all
@plugins = OrbitApp::Plugin::Registration.all
if(!params[:show_plugin_profile].nil?)
@right_partial = OrbitApp::Plugin::Registration.find_by_key(params[:show_plugin_profile]).profile_partial_path rescue 'plugin_summary'
@right_partial = OrbitApp::Plugin::Registration.find_by_key(params[:show_plugin_profile]).admin_partial_path
if !@right_partial.blank?
respond_to do |format|
format.html { redirect_to( @right_partial ) }
end
else
@right_partial = "admin/users_new_interface/plugin_summary"
end
else
@right_partial = "admin/users_new_interface/plugin_summary"
end

View File

@ -1,4 +1,4 @@
class Admin::SubRolesController < RolesController
class Admin::SubRolesController < Admin::RolesController
end

View File

@ -32,7 +32,11 @@ class DefaultWidgetController< OrbitWidgetController
end
def default_widget
@tag_class = nil
if !params[:id].blank?
redirect_to eval("#{@page_part.module_app.widget_fields_link_method['title']['method']}('#{params[:id]}', {inner: #{params[:inner] || true}})")
else
@tag_class = nil
@default_widget = @page_part.module_app.get_default_widget
@widget_image_field = @default_widget["image"] || @default_widget[:image]
case @page_part
@ -47,8 +51,10 @@ class DefaultWidgetController< OrbitWidgetController
end
if @paginate
@data = query_for_default_widget.includes(@widget_image_field).page(params[:page_main]).per(@data_limit)
# @data = query_for_default_widget.limit(@data_limit).includes(@widget_image_field)
else
@data = query_for_default_widget.limit(@data_limit).includes(@widget_image_field)
@data = eval(@default_widget["query"]).includes(@widget_image_field).page(params[:page_main]).per(@data_limit).desc(:created_at)
# @data = eval(@default_widget["query"]).limit(@data_limit).includes(@widget_image_field).desc(:created_at)
end
case params[:type]
when "typeA"
@ -64,7 +70,7 @@ class DefaultWidgetController< OrbitWidgetController
@partial = "typeC"
render "typeC"
end
end
end
end

View File

@ -2,6 +2,11 @@ class FrontController < ApplicationController
layout false
def show_breadcrumb
@ancestors = Page.find(params[:id]).ancestors_and_self
@ancestors = nil if @ancestors.size == 1
end
def show_banner
@ad_banner = AdBanner.find(params[:id]) rescue nil
end

View File

@ -64,17 +64,23 @@ class PagesController < ApplicationController
protected
def get_item
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
if !params[:category_id].blank? && !params[:tag_id].blank?
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => params[:tag_id]})
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) unless @item
elsif !params[:category_id].blank?
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action],category: params[:category_id]).any_in(tag: [nil,'']).first
elsif !params[:tag_id].blank?
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action],tag: params[:tag_id]).any_in(category: [nil,'']).first
if params[:same_page_id]
@item = Item.find(params[:same_page_id])
else
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
if !params[:category_id].blank? && !params[:tag_id].blank?
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => params[:tag_id]})
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) unless @item
elsif !params[:category_id].blank?
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], category: params[:category_id]).any_in(tag: [nil,'']).first
elsif !params[:tag_id].blank?
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], tag: params[:tag_id]).any_in(category: [nil,'']).first
end
@item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil,'']},"category" => { "$in" => [nil,'']}).first unless @item
@item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
end
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action]).all_of("tag" => {"$in" => [nil,'']},"category" => { "$in" => [nil,'']}).first unless @item
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action]).first unless @item
raise PageError,'Missing Frontend Page' if @item.nil?
end

View File

@ -3,24 +3,24 @@ module DefaultWidgetHelper
I18n.t("#{@page_part.module_app.key}.default_widget.#{field}")
end
def link_to_field(row_data,field,switch)
def link_to_field(row_data,field, switch, options=nil)
method_ary = @page_part.module_app.widget_fields_link_method
field = field.to_sym
if(method_ary.has_key?(field) and (switch == "true"))
url = case method_ary[field][:args]
when nil # no args
get_data_link(method_ary[field][:method])
get_data_link(method_ary[field]["method"], options)
when :self # passing self
get_data_link(method_ary[field][:method],row_data.id)
get_data_link(method_ary[field]['method'], options,row_data.id)
else
ary = method_ary[field][:args].clone
object_hash = ary.each do |key,val|
ary[key]= type_trans_or_to_s(row_data.send(val[0]).send(val[1]))
end
get_data_link(method_ary[field][:method],object_hash)
get_data_link(method_ary[field]['method'], options,object_hash)
end
link_to row_data.send(field),url
link_to row_data.send(field), url
else
type_trans_or_to_s(row_data.send(field) )
end
@ -45,13 +45,17 @@ module DefaultWidgetHelper
end
end
def get_data_link(method_entry,object = nil)
def get_data_link(method_entry, options=nil, object = nil)
case object
when nil
eval method_entry
when NilClass
eval eval("#{method_entry}(#{options})")
when BSON::ObjectId
object = "'#{object.to_s}'"
eval("#{method_entry}(#{object}, #{options})")
when Hash
eval("#{method_entry}(#{object.merge options})")
else
object = "'#{object.to_s}'" if object.class == BSON::ObjectId
eval("#{method_entry}(#{object})" )
''
end
end

View File

@ -23,7 +23,7 @@ class AdImage
belongs_to :ad_banner
before_validation :add_http
validates :out_link, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix, :allow_blank => true
validates :out_link, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i, :allow_blank => true
def display?
if (self.post_date <= Date.today && (self.unpost_date.nil? || self.unpost_date>= Date.today) rescue false)

View File

@ -12,7 +12,7 @@ class Item
field :enabled_for, :type => Array, :default => nil
field :menu_enabled_for, :type => Array, :default => nil
field :title, localize: true
field :sitemap_enabled, :type => Hash
field :sitemap_enabled, :type => Hash, :default => {}
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
@ -23,6 +23,7 @@ class Item
before_destroy :destroy_children
after_rearrange :rebuild_path, :if => "parent_id_changed? || name_changed?"
after_save :rebuild_children_path, :if => "path_changed?"
def enabled_for_lang(lang)
enabled_for.include?(lang)
@ -57,7 +58,7 @@ class Item
end
def show_in_sitemap_for(locale)
if sitemap_enabled && !sitemap_enabled[locale].blank?
if !sitemap_enabled.blank? && !sitemap_enabled[locale].blank?
sitemap_enabled[locale].eql?('true') ? true : false
else
true
@ -68,7 +69,6 @@ class Item
def rebuild_path
self.path = (self.ancestors_and_self - [Item.root]).collect{|x| x.name unless x.root?}.join('/')
self.rebuild_children_path
end
def rebuild_children_path

View File

@ -2,7 +2,7 @@ class Link < Item
field :url
validates :url, :presence => true, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
validates :url, :presence => true, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i
before_validation :add_http

View File

@ -27,6 +27,11 @@ class Page < Item
before_save :create_parts, if: Proc.new { |page| page.new_record? || page.design_id_changed? }
before_save :delete_empty_frontend_field, :generate_html
def generate_parts
create_parts
self.save
end
protected
def create_parts

View File

@ -8,6 +8,20 @@
<h4><span><%= t(eval(":#{@attribute_type}"))%></span></h4>
<div class="form-horizontal">
<div class="clear">
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="controls">
<% if @attribute.new_record? %>
<%= f.text_field :key, :placeholder => t(:key) %>
<% else %>
<div><%= @attribute.key%></div>
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:to_search) %></label>
@ -23,24 +37,13 @@
</div>
</div>
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="controls">
<% if @attribute.new_record? %>
<%= f.text_field :key, :placeholder => t(:key) %>
<% else %>
<div><%= @attribute.key%></div>
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
</div>
</div>
</div>
<% if @attribute._type == "Info" %>
<div class="map-block back attributes">
<h4><span><%= @attribute.title+ t(:attributes)%></span></h4>
<h4><span><%= @attribute.title+ t(:field)%></span></h4>
<div id="attribute_field_list">
<%= render :partial=>"shared/attribute_field/attribute_field",:collection=>@attribute.attribute_fields%>
</div>

View File

@ -7,7 +7,8 @@
<%= f.hidden_field :public_r_tag_object_id, :value => @part.page.id %>
<%#= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %>
<% elsif @r_tag.eql?('sitemap') %>
<% elsif @r_tag.eql?('breadcrumb') %>
<% else %>
<%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, :selected => @part.public_r_tag_object_id) %>
<% end %>
</span>
</span>

View File

@ -0,0 +1,18 @@
<div id="module-nav">
<div class="arrow_next pull-right"><i class="icon-chevron-right"></i></div>
<div class="arrow_prev pull-left"><i class="icon-chevron-left"></i></div>
<div class="module-nav-view">
<ul class="nav nav-pills">
<%= content_tag :li, :class=>(params[:show_plugin_profile].nil? ? "active" : nil) do %>
<%= link_to t(:all_plugin_summary)%>
<% end -%>
<% @plugins.each do |plugin| %>
<%= content_tag :li, :class=>(params[:show_plugin_profile] == plugin.name ? "active" : nil) do %>
<%= link_to plugin.name, admin_plugins_path(:show_plugin_profile => plugin.name) %>
<% end -%>
<% end -%>
</ul>
</div>
</div>

View File

@ -4,23 +4,6 @@
<div id="isotope" class="user-data">
<div id="module-nav">
<div class="arrow_next pull-right"><i class="icon-chevron-right"></i></div>
<div class="arrow_prev pull-left"><i class="icon-chevron-left"></i></div>
<div class="module-nav-view">
<ul class="nav nav-pills">
<%= content_tag :li, :class=>(params[:show_plugin_profile].nil? ? "active" : nil) do %>
<%= link_to t(:all_plugin_summary)%>
<% end -%>
<% @plugins.each do |plugin| %>
<%= content_tag :li, :class=>(params[:show_plugin_profile] == plugin.name ? "active" : nil) do %>
<%= link_to plugin.name, :show_plugin_profile => plugin.name %>
<% end -%>
<% end -%>
</ul>
</div>
</div>
<%= render :partial => 'plugin_list' %>
<%= render :partial => @right_partial %>
</div>

View File

@ -10,6 +10,17 @@
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<a class="btn btn-small pull-right btn-danger remove_attribute"><i class="icon-trash icon-large"></i> <%= t(:delete_)%></a>
<div class="clear">
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="multipleInput">
<div class="controls">
<%= text_field "#{@field_name}[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key%>
</div>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group">
<label class="control-label" for="key"><%= t(:to_search) %></label>
<div class="controls">
@ -21,15 +32,8 @@
</label>
</div>
</div>
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="multipleInput">
<div class="controls">
<%= text_field "#{@field_name}[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key%>
</div>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group pull-left">
<label class="control-label" for=""><%= t(:type)%></label>
<div class="controls">
@ -46,7 +50,7 @@
<div class="<%= attribute_field.disabled ? 'hide' : ''%>">
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeA") do%>
<div class="control-group">
<label class="control-label"><%= t(:options)%></label>
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"]) %>
@ -103,7 +107,7 @@
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeD") do%>
<div class="control-group">
<label class="control-label"><%= t(:options)%></label>
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>

View File

@ -4,6 +4,18 @@
<h4><span><%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %></span></h4>
<div class="form-horizontal">
<div class="clear">
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="controls">
<% if @sub_attribute.new_record? %>
<%= f.text_field :key, :placeholder => t(:key) %>
<% else %>
<div><%= @sub_attribute.key%></div>
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@sub_attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"sub_role[title_translations]"}%>
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:to_search) %></label>
@ -19,17 +31,6 @@
</div>
</div>
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="controls">
<% if @sub_attribute.new_record? %>
<%= f.text_field :key, :placeholder => t(:key) %>
<% else %>
<div><%= @sub_attribute.key%></div>
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@sub_attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"sub_role[title_translations]"}%>
</div>
</div>
</div>

View File

@ -6,7 +6,7 @@
<div class="site-map role-block">
<div class="map-block back attributes">
<h4><span><%= @attribute.title+ t(:attributes)%></span></h4>
<h4><span><%= @attribute.title + t(:role)%></span></h4>
<div id="attribute_field_list">
<%= render :partial=>"attribute_field",:collection=>@attribute.attribute_fields%>
</div>

View File

@ -56,5 +56,5 @@
</table>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i,t(:new_sub_role),:class=>"icon-plus icon-white"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary pull-right"%>
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus icon-white"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary pull-right"%>
</div>

View File

@ -6,7 +6,7 @@
<div class="site-map role-block">
<div class="map-block back attributes">
<h4><span><%= @attribute.title+ t(:attributes)%> - <%= @sub_attribute.title %></span></h4>
<h4><span><%= @attribute.title+ t(:role)%> - <%= @sub_attribute.title %></span></h4>
<div id="attribute_field_list">
<%= render :partial=>"attribute_field",:collection=>@sub_attribute.attribute_fields%>
</div>

View File

@ -1,23 +0,0 @@
<div class="site-map">
<% @items.each_with_index do |item, i| %>
<div class="map-block">
<h4><%= i+1 %> <a href='<%= item.path %>'><%= item.title %></a></h4>
<ul>
<% item.children.each_with_index do |child, ii| %>
<li class="clear"><%= "#{i+1}-#{ii+1}" %> <a href='<%= child.path %>'><%= child.title %></a></span></li>
<% end if item.children %>
</ul>
</div>
<% end %>
</div>
<%= javascript_include_tag "lib/jquery.masonry.min.js" %>
<script>
$(document).ready(function(){
$('.site-map').masonry({
itemSelector: '.map-block',
columnWidth: 220,
isAnimated: true
});
});
</script>

View File

@ -3,16 +3,24 @@
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface')) do -%>
<%= content_tag :li, link_to((t(:all_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, admin_users_new_interface_index_path), :class => active_for_action('users_new_interface', 'index') %>
<%= content_tag :li, link_to((t(:add_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((t(:roles) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_roles_path ), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((t(:info) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, edit_admin_info_path(Info.first.id.to_s)), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((t(:authorigation) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((t(:registrant) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((t(:member_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((t(:member_registration) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((t(:member_role) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_roles_path ), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((t(:member_info) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, edit_admin_info_path(Info.first.id.to_s)), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-pie')+ content_tag(:span, t(:analysis)), admin_plugins_path %>
<%= link_to content_tag(:i, nil, :class => 'icons-graduation')+ content_tag(:span, t(:academic_info)), admin_plugins_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('plugins')) do -%>
<%= content_tag :li, link_to((t(:all_plugins) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, admin_plugins_path), :class => active_for_action('users_new_interface', 'index') %>
<%= content_tag :li, link_to((t(:list_) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, admin_plugins_path), :class => active_for_action('users_new_interface', 'index') %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-pie')+ content_tag(:span, t(:analysis)), '#' %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-layout')+ content_tag(:span, t(:groups)), '#' %>
<% end -%>

View File

@ -2,10 +2,11 @@
<td class="span1"><% if is_admin? %><input type="checkbox"><% end%></td>
<td class="span3">
<div class="label-group">
<div class="label-td"><!--
<span class="label label-teacher"># TODO:Teacher</span>
<span class="label label-student"># TODO:Student</span>
<span class="label label-staff"># TODO:Staff</span> -->
<div class="label-td">
<% user_for_listing.roles.each do |rf| %>
<% @roledata = Role.find(rf.id) %>
<span class="label label-<%= @roledata.key %>"><%= @roledata.title %></span>
<% end %>
</div>
</div>
</td>

View File

@ -21,6 +21,7 @@
<%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true } do |f| %>
<%= f.error_messages %>
<%= render :partial => 'user_basic', :locals => {:f => f}%>
<%= render :partial => 'form', :locals => { :f => f } %>
<div class="button_bar">
<%= link_back %>

View File

@ -11,7 +11,7 @@
<% @data.each do |row_data| %>
<tr>
<% @fields.each do |field|%>
<td><%= content_tag(:span,link_to_field(row_data,field[0],field[2]),:class=>field[1])%></td>
<td><%= content_tag(:span,link_to_field(row_data,field[0], field[2], {orig_page: @page_id.to_s}),:class=>field[1])%></td>
<% end %>
</tr>
<% end %>

View File

@ -7,7 +7,7 @@
</div>
<div class="wrap">
<% @fields.each do |field|%>
<%= content_tag(:span,link_to_field(row_data,field[0]),:class=>field[1])%>
<%= content_tag(:span,link_to_field(row_data,field[0], field[2], {orig_page: @page_id.to_s}),:class=>field[1])%>
<% end %>
</div>
<% end %>

View File

@ -6,7 +6,7 @@
<% @data.each do |row_data| %>
<%= content_tag(:li) do %>
<% @fields.each do |field|%>
<%= content_tag(:span,link_to_field(row_data,field[0]),:class=>field[1])%>
<%= content_tag(:span, link_to_field(row_data,field[0], field[2], {orig_page: @page_id.to_s}),:class=>field[1])%>
<% end %>
<% end %>
<% end %>

View File

@ -0,0 +1,4 @@
<%= render @partial %>
<% if @paginate %>
<%= paginate @data, :param_name => :page_main, :params => {:same_page_id => @page_id} %>
<% end %>

View File

@ -13,7 +13,7 @@
<li class="dock_item"><a callback-method='initializeJournalPapers' href="<%= panel_personal_journal_desktop_journal_p_path %>" class="widget_fn wh3 hh3" id='d_journal_p' custom-load="journal" onclick="return false;"><span class="widget_icon"><img src="" alt="Journal Papers" id="journal_p_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeConference' href="<%= panel_personal_conference_desktop_conference_p_path %>" class="widget_fn wh3 hh3" id='d_conference_p' custom-load="conference" onclick="return false;"><span class="widget_icon"><img src="" alt="Conference Papers" id="conference_p_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeConference' href="<%= panel_personal_conference_desktop_conference_window_path %>" class="widget_fn wh3 hh3" id='d_conference_p' custom-load="conference" onclick="return false;"><span class="widget_icon"><img src="" alt="Conference Papers" id="conference_p_icon" width="30" height="30"/></span></a></li>
<li class="dock_item"><a callback-method='initializeBooks' href="<%= desktop_publications_books_path %>" class="widget_fn wh3 hh3" id='d_books' onclick="return false;"><span class="widget_icon"><img src="" alt="Books" id="books_icon" width="30" height="30"/></span></a></li>

View File

@ -0,0 +1,15 @@
<% unless @ancestors.blank? %>
<ul class="breadcrumb">
<% @ancestors.each_with_index do |node, i| %>
<% last = i == @ancestors.size-1 %>
<li class='<%= 'active' if last %>'>
<% if last %>
<%= node.title %>
<% else %>
<%= link_to node.title, "/#{node.path}" %>
<span class="divider">/</span>
<% end %>
</li>
<% end %>
</ul>
<% end %>

View File

@ -1,6 +1,6 @@
<% if @menu_page && @menu_page.visible_children.size > 0 %>
<div class='category_list'>
<h3 class='h3'><%= @menu_page.title %></h3>
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
<ul class='list'>
<% @menu_page.visible_children.each do |child| %>
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">

View File

@ -10,6 +10,17 @@
<%= hidden_field "info[attribute_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<a class="btn btn-small pull-right btn-danger remove_attribute"><i class="icon-trash icon-large"></i> <%= t(:delete_)%></a>
<div class="clear">
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="multipleInput">
<div class="controls">
<%= text_field "info[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key%>
</div>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"info[attribute_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group">
<label class="control-label" for="key"><%= t(:to_search) %></label>
<div class="controls">
@ -21,15 +32,7 @@
</label>
</div>
</div>
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="multipleInput">
<div class="controls">
<%= text_field "info[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key%>
</div>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"info[attribute_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group pull-left">
<label class="control-label" for=""><%= t(:type)%></label>
<div class="controls">
@ -46,7 +49,7 @@
<div class="<%= attribute_field.disabled ? 'hide' : ''%>">
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeA") do%>
<div class="control-group">
<label class="control-label"><%= t(:options)%></label>
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"]) %>
@ -103,7 +106,7 @@
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeD") do%>
<div class="control-group">
<label class="control-label"><%= t(:options)%></label>
<label class="control-label"><%= t(:enabled_for)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>

View File

@ -2,7 +2,7 @@
<div class="control-group">
<%= hidden_field_tag "#{temp_field_name}[count]",((values.keys.collect{|t| t.to_i}.max rescue nil) || 0 ),:class=>"list_count"%>
<%= hidden_field_tag "#{temp_field_name}[name]",field_name,:class=>"field_name"%>
<label class="control-label" ><%= t(:list_)%></label>
<label class="control-label" ><%= t(:options)%></label>
<div class="multipleInput">
<%if values.blank? %>
<div class="controls">

View File

@ -37,17 +37,18 @@ markups:
muti_lang_input_supprt: true
ext_support: true
public_r_tags:
- ad_banner
- sub_menu
- sitemap
- breadcrumb
page_part_kinds:
- text
- public_r_tag
- module_widget
widget_field:
- title
- category
@ -57,7 +58,7 @@ widget_field:
- content
- link
- file
widget_field_type:
- title
- category
@ -76,4 +77,4 @@ default_widget_style:
- style2
- style3
- style4
- style5
- style5

View File

@ -10,7 +10,8 @@ en:
not_authed_user: Access Denied for you are not User for this app
object: Access Denied for you don't have permission for this object
not_admin: Access Denied for you are not Admin
account_settings: Account settings
account_settings: Account settings
academic_info: Academic Info.
action: Action
ad:
chinese_1: 在套圖中出現次數 1次請輸入1
@ -40,8 +41,8 @@ en:
add_attribute_field: Add attribute field
add_image: Add image
add_item: Add item
add_member: Add member
add_more: Add more
add_member: Create New Member
add_more: Exteudable Field
address_modal:
default_title: Address
street_address: Street address
@ -55,7 +56,7 @@ en:
all: All
all_content: All Content
all_file: All File
all_member: All Member
all_member: Member List
all_plugin_summary: All plugin summary
all_plugins: All plugins
always_display_title: Always displayed in the title bar
@ -126,20 +127,20 @@ en:
paper: Paper was successfully created.
user: User was successfully created.
create_: Create
cross_lang: 跨語言輸入
cross_lang: Enable Monolingual
data: Data
date:
calendar: 紀年法
range: 本欄為時間區段
calendar: Calendar Era
range: Enable Time Period
format: 格式
tw_calendar: 民國
tw_calendar: R.O.C Year.
minguo_calendar:
after: 民國
before: 民前
first_year: 民國元年
year:
month:
west_calendar: 西元
year: Year
month: Month
west_calendar: A.C.
date_: Date
dashboard:
bulletin: Announcement
@ -177,6 +178,7 @@ en:
end_date: End date
errors:
at_least_one: must at least have one value
field: Fields
file:
size: File size
type: File type
@ -188,6 +190,7 @@ en:
frequency: Frequency
frontend_data_count: Frontend data count
gallery: Gallery
groups: Groups
help: Help
hidden: Hidden
hide: Hide
@ -198,13 +201,13 @@ en:
image: Image
images: Images
info: Information
initial: 起始值
initial: Default Value
intro: Introduction
is_published: Is published
item: Item
item_name: Item name
item_name: Name
javascripts: Javascripts
key: Key
key: Index Keys
last_modified: Last modified
layout: Layout
link: Link
@ -247,6 +250,10 @@ en:
markup_value: Markup value
me: Me
member: Member
member_authorization: Authorizations
member_info: Profile Form
member_registration: Registration Approval
member_role: Member Roles
menu_enabled_for: Menu enabled for
module: Module
module_authorization: Module Authorization
@ -265,7 +272,8 @@ en:
page: New page
user: New user
info: New user information
role: New user role
role: New role
sub_role: New sub role
new_: New
news: News
no_: "No"
@ -291,7 +299,7 @@ en:
password_current: Current password
pending: Pending
picture: Picture
placeholder: Placeholder
placeholder: Field Hint
plugins: Plugins
postdate: Postdate
posted_by: Posted by
@ -310,6 +318,7 @@ en:
rejected_reason_empty: "Approval rejected, no referencable information"
related_links: Related Links
role: Role
role_field: Role Field
Roles: Roles
ruling_site: Ruling Site
search:
@ -355,6 +364,8 @@ en:
status: Status
structure: Structure
sub_manager: SubManager
sub_role: Sub Role
sub_role_field: Sub Role Field
subtitle: Subtitle
submit: Submit
submit_approval: Submit approval
@ -376,10 +387,11 @@ en:
theme: Theme
themes: Themes
title: Title
to_search: Set as Search Key
top: Top
total_visitors: Total Visitors
traffic: Traffic
type: Type
type: Field Type
unit_name: Unit name
unzip_success: "App unzip procress is finished, please restart the server to apply effect"
up_to_date: Up-to-date

View File

@ -20,6 +20,7 @@ zh_tw:
object: 拒絕存取,因你沒有權限
not_admin: 拒絕存取,因你不是此應用程式管理員
account_settings: 帳號設定
academic_info: 學術資訊
action: 操作
ad:
ab_fx: 轉場效果
@ -37,13 +38,26 @@ zh_tw:
widget_info_for_ad_image_size: "此區塊圖片尺寸使用: %{best_size}"
ad_banner: 廣告輪播
add: 新增
add_attribute_field: 新增欄位
add_image: Add image
add_item: 新增項目
add_member: 新增成員
add_more: 可擴充欄位
address_modal:
default_title: 地址
street_address: 街道地址
city: 城市
county: 縣市
zip: 郵遞區號
country: 國家/地區
addthis_tools:
add_to_bookmark: 加入書籤
admin: 管理員
all_content: 所有內容
all_file: 所有檔案
all_member: 所有會員
all_member: 成員列表
all_plugin_summary: All plugin summary
all_plugins: All plugins
always_display_title: 永遠顯示標題
app_auth:
list_setting_result: 授權列表
@ -103,7 +117,21 @@ zh_tw:
page: 頁面已成功建立
user: 使用者已成功建立
create_: 建立
cross_lang: 啟用單語系
data: 資料
date:
calendar: 紀年法
range: 時間區段設定
format: 格式
tw_calendar: 民國
minguo_calendar:
after: 民國
before: 民前
first_year: 民國元年
year:
month:
west_calendar: 西元
date_: Date
dashboard:
bulletin: 公告
news_bulletin: 新聞
@ -162,6 +190,7 @@ zh_tw:
end_date: 結束日期
errors:
at_least_one: 至少擁有一個值
field: 欄位
file:
size: 檔案大小
type: 檔案類型
@ -170,6 +199,9 @@ zh_tw:
file_type: 檔案類型
forgot_password: 忘記密碼?
frequency: 頻率
frontend_data_count: Frontend data count
gallery: Gallery
groups: 群組
help: 幫助
hidden: 隱藏的
hide: 隱藏
@ -178,10 +210,14 @@ zh_tw:
horizontal: 水平的
hot: 熱門
image: 圖片
info: 信息
images: Images
info: 基本資料
initial: 預設值
intro: 簡介
is_published: 已發佈
item: 項目
item_name: 名稱
javascripts: Javascripts
key: 索引
last_modified: 最後修改者
layout: 範本
@ -229,8 +265,15 @@ zh_tw:
user_name: 電子郵件帳號
manager: 管理者
manager: 管理者
markup: 輸入模式
markup_options: Markup options
markup_value: Markup value
me:
member: 會員
member: 成員
member_authorization: 成員權限
member_info: 基本資料表
member_registration: 註冊審核
member_role: 身份欄位
menu_enabled_for: 選單啟用
modal:
close: 關閉
@ -251,7 +294,9 @@ zh_tw:
page: 新增頁面
user: 新增使用者
info: 新增使用者資訊
role: 新增使用者角色
role: 新增身份
sub_role: 新增子身份
new_: New
news: 新聞
no_: "不是"
no_deadline: 沒有期限
@ -276,6 +321,8 @@ zh_tw:
password_current: 目前的密碼
pending: 待審核
picture: 圖片
placeholder: 欄位提示文字
plugins: Plugins
postdate: 張貼日期
posted_by: 張貼人
preview: 預覽
@ -290,9 +337,9 @@ zh_tw:
rejected_reason: '拒絕原因:'
rejected_reason_empty: "拒絕核准, 沒有參考資訊"
related_links: 相關連結
remember_me: 記住我
role: 角色
Roles: 角色
role: 身份
role_field: 身份欄位
roles: 身份
ruling_site: 銳綸網站
search:
domains: Google Search Domains
@ -333,6 +380,8 @@ zh_tw:
status: 狀態
structure: 結構
sub_manager: 次管理員
sub_role: 子身份
sub_role_field: 子身份欄位
subtitle: 副標題
submit: 送出
submit_approval: 送出已核准
@ -353,10 +402,11 @@ zh_tw:
theme: 套用頁面樣式
themes: 主題
title: 標題
to_search: 加入搜尋條件
top: 置頂
total_visitors: 總計造訪人次
traffic: 流量
type: 類型
type: 欄位類型
unit_name: 單位名稱
up_to_date: 最新版本
update:

View File

@ -209,11 +209,6 @@ Orbit::Application.routes.draw do
match 'desktop_publications/books_list'=>'desktop_publications#books_list'
match 'desktop_publications/books_add'=>'desktop_publications#books_add'
match 'desktop_publications/conference_p' => 'desktop_publications#conference_p'
match 'desktop_publications/conference_p_list/'=>'desktop_publications#conference_p_list'
match 'desktop_publications/conference_p_add/'=>'desktop_publications#conference_p_add'
# end
# namespace :desktop_research do
match 'desktop_research/research_d' => 'desktop_research#research_d'
match 'desktop_research/research_d_list/' => 'desktop_research#research_d_list'
@ -255,7 +250,7 @@ Orbit::Application.routes.draw do
end
end
controller_paths :front, %w[show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap]
controller_paths :front, %w[show_breadcrumb show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap]
# controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content]
# scope 'app' do
@ -274,7 +269,9 @@ Orbit::Application.routes.draw do
root :to => 'mobile#index', :as => 'mobile'
end
match '/panel/orbit_app/widget/:type' => 'pages#index_from_link', :constraints => lambda { |request|
request.query_string.include?("same_page_id=")
}
match '/panel/orbit_app/widget/:type' => 'default_widget#default_widget'

View File

@ -6,28 +6,53 @@ FactoryGirl.definition_file_paths = Dir["#{Rails.root}/vendor/built_in_modules/*
FactoryGirl.find_definitions
CoAuthorRelation.destroy_all
CoAuthor.destroy_all
JournalLevelType.destroy_all
WritingJournalFile.destroy_all
WritingJournal.destroy_all
ConferenceCoAuthorRelation.destroy_all
ConferenceCoAuthor.destroy_all
ConferencePaperType.destroy_all
WritingConferenceFile.destroy_all
WritingConference.destroy_all
#Dir[Rails.root.join("spec/factories/*.rb")].each {|f| require f}
10.size.times do
FactoryGirl.create(:journal_level)
2.times do
FactoryGirl.create(:conference_paper_type)
end
10.times do
FactoryGirl.create(:relations)
FactoryGirl.create(:conference_co_author_relation)
end
50.times do
FactoryGirl.create(:paper_record)
FactoryGirl.create(:conference_co_author)
end
50.times do
FactoryGirl.create(:co_author_candidate)
FactoryGirl.create(:writing_conference)
end
puts "Success!"
# =======
#
#CoAuthorRelation.destroy_all
#CoAuthor.destroy_all
#JournalLevelType.destroy_all
#WritingJournalFile.destroy_all
#WritingJournal.destroy_all
#
#10.size.times do
# FactoryGirl.create(:journal_level)
#end
#
#10.times do
# FactoryGirl.create(:journal_relation)
#end
#
#50.times do
# FactoryGirl.create(:journal)
#end
#
#50.times do
# FactoryGirl.create(:journal_co_author)
#end
#puts "Success!"

View File

@ -47,9 +47,11 @@ module OrbitApp
@base_path = args[0][:base_path]
@name = partial[0][:i18n].nil? ? name : lambda{ I18n.t(partial[0][:i18n]) }
@partial_path = ''
@admin_partial_path = ''
unless partial.nil?
@partial_path = partial[0][:path]
@admin_partial_path = partial[0][:admin_path]
end
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
@ -58,6 +60,10 @@ module OrbitApp
def profile_partial_path
return @partial_path
end
def admin_partial_path
return @admin_partial_path
end
end
end

View File

@ -30,6 +30,7 @@ module ParserBackEnd
parse_images_edit(body, page)
parse_footer_edit(body, page)
parse_sub_menu_edit(body, page)
parse_breadcrumb_edit(body, page)
parse_counter_edit(body)
public_r_tags.each do |tag|
send("parse_#{tag}s_edit", body, page, true)

View File

@ -144,6 +144,32 @@ module ParserCommon
end
end
# breadcrumb
def parse_breadcrumbs_edit(body = nil, page = nil, edit=nil)
body.css('breadcrumb').each do |breadcrumb|
ancestors = Page.find(page.id).ancestors_and_self rescue nil
ancestors = nil if ancestors.size == 1
res = ''
if ancestors
res << "<ul class='breadcrumb'>"
ancestors.each_with_index do |node, i|
last = i == ancestors.size-1
res << "<li class=#{'active' if last}>"
if last
res << node.title
else
res << "<a herf='/#{node.path}'>#{node.title}</a>"
res << "<span class='divider'>/</span>"
end
res << "</li>"
end
res << "</ul>"
end
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
breadcrumb.swap(fragment)
end
end
# page_footer
def parse_footer_edit(body, page)
page_footer = body.css('.page_footer').first
@ -172,10 +198,23 @@ module ParserCommon
end
end
def parse_breadcrumb_edit(body, page)
page_breadcrumb = body.css('.page_breadcrumb').first
if page_breadcrumb
res = "<div id='#{page_breadcrumb['id']}', class='#{page_breadcrumb['class']}'>"
res << @site.breadcrumb rescue nil
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_breadcrumb.swap(fragment) rescue nil
else
''
end
end
# sitemap
def parse_sitemaps_edit(body = nil, page = nil, edit=nil)
sitemap = body.css('sitemap').first
url = admin_site_sitemap_frontend_path(@site)
url = front_show_sitemap_path
options = "?inner=true"
fragment = Nokogiri::HTML::DocumentFragment.new(body, "<div class='dymanic_load' path='#{url + options}'></div>")
sitemap.swap(fragment)
@ -219,7 +258,7 @@ module ParserCommon
raise ModuleAppError,"PagePart can't find ModuleApp" if part.module_app.nil?
"/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true"
end
options = "&part_id=#{part.id}&category_id=#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=#{!part[:tag].blank? ? part[:tag] : tag}&page=#{params[:page]}&search_query=#{params[:search_query]}&part_title=#{Rack::Utils.escape(part_title).gsub("+", "%20") rescue nil}&item_type=page_part"
options = "&part_id=#{part.id}&category_id=#{!part[:category].blank? ? part[:category] : category}&tag_id=#{!part[:tag].blank? ? part[:tag] : tag}&page=#{params[:page]}&search_query=#{params[:search_query]}&part_title=#{Rack::Utils.escape(part_title).gsub("+", "%20") rescue nil}&item_type=page_part"
ret << "<div class='dymanic_load widget' path='#{url + options}'></div>"
when 'public_r_tag'
ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>"

View File

@ -11,6 +11,7 @@ module ParserFrontEnd
parse_images(body, page)
parse_menu(body, page)
parse_sub_menu(body, page, site)
parse_breadcrumb(body, page, site)
parse_counter(body)
i18n.merge!({locale => body.to_html})
end
@ -18,8 +19,8 @@ module ParserFrontEnd
end
def parse_page_content(page)
category = params[:category_id].blank? ? page[:category] : params[:category_id]
tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
category = params[:category_id].blank? ? page[:category] : params[:category_id]
body = Nokogiri::HTML(page.content)
body.css('orbit_front').each do |front|
if front['value']
@ -92,6 +93,18 @@ module ParserFrontEnd
end
end
# page_breadcrumb
def parse_breadcrumb(body, page, site)
page_breadcrumb = body.css('.page_breadcrumb').first
if page_breadcrumb
res = "<orbit_front path='\#{front_show_breadcrumb_path(@item)}' class='dymanic_load widget'></orbit_front>"
fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
page_breadcrumb.swap(fragment)
else
''
end
end
# page_contents
def parse_contents(body, page, edit=nil, locale)
public_r_tags = []
@ -101,6 +114,7 @@ module ParserFrontEnd
if (content["main"] == "true" && !page.module_app.nil?)
if page.app_frontend_url == 'default_widget'
url = "/panel/orbit_app/widget/#{page.frontend_style}?inner=true"
url << "&id=\#{params[:id] if params[:id] && !params[:id].eql?(page.id.to_s)}"
else
url = "/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}\#{(\"/\" + params[:id]) if params[:id] && !params[:id].eql?(page.id.to_s)}\#{(\"/\" + params[:controller_action]) if params[:controller_action] && params[:id]}?inner=true"
end
@ -123,9 +137,7 @@ module ParserFrontEnd
else
"/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true"
end
options = "&part_id=\#{part.id}&category_id=\#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=\#{!part[:tag].blank? ? part[:tag] : tag}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}&item_type=page_part"
options = "&part_id=\#{part.id}&category_id=\#{part[:category]}&tag_id=\#{part[:tag]}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}&item_type=page_part"
ret << "<orbit_front path='#{url + options}' part_id=#{part.id} class='dymanic_load widget'></orbit_front>"
when 'public_r_tag'
@ -178,5 +190,9 @@ module ParserFrontEnd
def generate_sub_menus(*args)
"<div class='dymanic_load' path='#{front_show_page_sub_menu_path({:menu_page_id => args[0], :page_id => args[1]})}'></div>"
end
# breadcrumb
def generate_breadcrumbs(*args)
"<div class='dymanic_load' path='#{front_show_breadcrumb_path(args[1])}'></div>"
end
end

View File

@ -1,313 +1,10 @@
# encoding: utf-8
namespace :migrate do
task :i18n => :environment do
p 'Start Bulletin'
bulletins = Bulletin.admin_manager_all
i = 1
bulletins.each do |bulletin|
p "#{i}/#{bulletins.size} - #{bulletin.id}"
title = I18nVariable.first(:conditions => {:key => 'title', :language_value_id => bulletin.id, :language_value_type => bulletin.class})
bulletin.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
subtitle = I18nVariable.first(:conditions => {:key => 'subtitle', :language_value_id => bulletin.id, :language_value_type => bulletin.class})
bulletin.subtitle_translations = {'en' => subtitle['en'], 'zh_tw' => subtitle['zh_tw']} if subtitle
text = I18nVariable.first(:conditions => {:key => 'text', :language_value_id => bulletin.id, :language_value_type => bulletin.class})
bulletin.text_translations = {'en' => text['en'], 'zh_tw' => text['zh_tw']} if text
p bulletin.save(:validate => false)
i += 1
end
p 'End Bulletin'
p '====================================================='
p 'Start BulletinCategory'
categories = BulletinCategory.admin_manager_all
i = 1
categories.each do |category|
p "#{i}/#{categories.size} - #{category.id}"
title = I18nVariable.first(:conditions => {:language_value_id => category.id, :language_value_type => category.class})
category.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p category.save(:validate => false)
i += 1
end
p 'End BulletinCategory'
p '====================================================='
p 'Start BulletinFile'
files = BulletinFile.all
i = 1
files.each do |file|
p "#{i}/#{files.size} - #{file.id}"
description = I18nVariable.first(:conditions => {:language_value_id => file.id, :language_value_type => file.class})
file.description_translations = {'en' => description['en'], 'zh_tw' => description['zh_tw']} if description
title = I18nVariable.first(:conditions => {:language_value_id => file.id, :language_value_type => file.class})
file.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p file.save(:validate => false)
i += 1
end
p 'End BulletinFile'
p '====================================================='
p 'Start BulletinLink'
links = BulletinLink.all
i = 1
links.each do |link|
p "#{i}/#{links.size} - #{link.id}"
title = I18nVariable.first(:conditions => {:language_value_id => link.id, :language_value_type => link.class})
link.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p link.save(:validate => false)
i += 1
end
p 'End BulletinLink'
p '====================================================='
p 'Start UnitListForAnc'
units = UnitListForAnc.all
i = 1
units.each do |unit|
p "#{i}/#{units.size} - #{unit.id}"
title = I18nVariable.first(:conditions => {:language_value_id => unit.id, :language_value_type => unit.class})
unit.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p unit.save(:validate => false)
i += 1
end
p 'End UnitListForAnc'
p '====================================================='
p '====================================================='
p 'Start PageContext'
page_contexts = PageContext.all
i = 1
page_contexts.each do |page_context|
p "#{i}/#{page_contexts.size} - #{page_context.id}"
context = I18nVariable.first(:conditions => {:language_value_id => page_context.id, :language_value_type => page_context.class})
page_context.context_translations = {'en' => context['en'], 'zh_tw' => context['zh_tw']} if context
p page_context.save(:validate => false)
i += 1
end
p 'End PageContext'
p '====================================================='
p '====================================================='
p 'Start WebLink'
links = WebLink.all
i = 1
links.each do |link|
p "#{i}/#{links.size} - #{link.id}"
# the original key was 'name'
title = I18nVariable.first(:conditions => {:key => 'name', :language_value_id => link.id, :language_value_type => link.class})
link.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
context = I18nVariable.first(:conditions => {:key => 'context', :language_value_id => link.id, :language_value_type => link.class})
link.context_translations = {'en' => context['en'], 'zh_tw' => context['zh_tw']} if context
p link.save(:validate => false)
i += 1
end
p 'End WebLink'
p '====================================================='
p 'Start WebLinkCategory'
categories = WebLinkCategory.admin_manager_all
i = 1
categories.each do |category|
p "#{i}/#{categories.size} - #{category.id}"
title = I18nVariable.first(:conditions => {:language_value_id => category.id, :language_value_type => category.class})
category.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p category.save(:validate => false)
i += 1
end
p 'End WebLinkCategory'
p '====================================================='
p '====================================================='
p 'Start Meta'
metas = Meta.all
i = 1
metas.each do |meta|
p "#{i}/#{metas.size} - #{meta.id}"
title = I18nVariable.first(:conditions => {:language_value_id => meta.id, :language_value_type => meta.class})
meta.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p meta.save(:validate => false)
i += 1
end
p 'End Meta'
p '====================================================='
p '====================================================='
p 'Start Attribute'
attributes = Attribute.all
i = 1
attributes.each do |attribute|
p "#{i}/#{attributes.size} - #{attribute.id}"
title = I18nVariable.first(:conditions => {:language_value_id => attribute.id, :language_value_type => attribute.class})
attribute.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p attribute.save(:validate => false)
i += 1
end
p 'End Attribute'
p '====================================================='
p 'Start AttributeField'
attribute_fields = AttributeField.all
i = 1
attribute_fields.each do |attribute_field|
p "#{i}/#{attribute_fields.size} - #{attribute_field.id}"
title = I18nVariable.first(:conditions => {:language_value_id => attribute_field.id, :language_value_type => attribute_field.class})
attribute_field.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p attribute_field.save(:validate => false)
i += 1
end
p 'End AttributeField'
p '====================================================='
p 'Start Role'
roles = Role.all
i = 1
roles.each do |role|
p "#{i}/#{roles.size} - #{role.id}"
title = I18nVariable.first(:conditions => {:language_value_id => role.id, :language_value_type => role.class})
role.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p role.save(:validate => false)
i += 1
end
p 'End Role'
p '====================================================='
p '====================================================='
p 'Start AdImage'
ad_images = AdImage.all
i = 1
ad_images.each do |image|
p "#{i}/#{ad_images.size} - #{image.id}"
# no key is set and title = context, this is due to original error in the code
title = I18nVariable.first(:conditions => {:language_value_id => image.id, :language_value_type => image.class})
image.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
image.context_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p image.save(:validate => false)
i += 1
end
p 'End AdImage'
p '====================================================='
p '====================================================='
p 'Start Asset'
assets = Asset.all
i = 1
assets.each do |asset|
p "#{i}/#{assets.size} - #{asset.id}"
title = I18nVariable.first(:conditions => {:key => 'title', :language_value_id => asset.id, :language_value_type => asset.class})
asset.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
description = I18nVariable.first(:conditions => {:key => 'description', :language_value_id => asset.id, :language_value_type => asset.class})
asset.description_translations = {'en' => description['en'], 'zh_tw' => description['zh_tw']} if description
p asset.save(:validate => false)
i += 1
end
p 'End Asset'
p '====================================================='
p 'Start AssetCategory'
categories = AssetCategory.all
i = 1
categories.each do |category|
p "#{i}/#{categories.size} - #{category.id}"
title = I18nVariable.first(:conditions => {:language_value_id => category.id, :language_value_type => category.class})
category.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p category.save(:validate => false)
i += 1
end
p 'End AssetCategory'
p '====================================================='
p '====================================================='
p 'Start Item'
items = Item.all
i = 1
items.each do |item|
p "#{i}/#{items.size} - #{item.id}"
title = I18nVariable.first(:conditions => {:language_value_id => item.id, :language_value_type => item.class})
item.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p item.save(:validate => false)
i += 1
end
p 'End Item'
p '====================================================='
p 'Start Page'
pages = Page.all
i = 1
pages.each do |item|
p "#{i}/#{pages.size} - #{item.id}"
# the key was originally 'title', changed to 'page_title' to avoit conflict with parent
title = I18nVariable.first(:conditions => {:key => 'title', :language_value_id => item.id, :language_value_type => item.class})
item.page_title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
p item.save(:validate => false)
i += 1
end
p 'End Page'
p '====================================================='
p 'Start PagePart'
page_parts = PagePart.all
i = 1
page_parts.each do |part|
p "#{i}/#{page_parts.size} - #{part.id}"
title = I18nVariable.first(:conditions => {:key => 'title', :language_value_id => part.id, :language_value_type => part.class})
part.page_title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
content = I18nVariable.first(:conditions => {:key => 'i18n_variable', :language_value_id => part.id, :language_value_type => part.class})
part.content_translations = {'en' => content['en'], 'zh_tw' => content['zh_tw']} if content
p part.save(:validate => false)
i += 1
end
p 'End PagePart'
p '====================================================='
p '====================================================='
p 'Start Site'
site = Site.first
title = I18nVariable.first(:conditions => {:key => 'title', :language_value_id => site.id, :language_value_type => site.class})
site.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
footer = I18nVariable.first(:conditions => {:key => 'footer', :language_value_id => site.id, :language_value_type => site.class})
site.footer_translations = {'en' => footer['en'], 'zh_tw' => footer['zh_tw']} if footer
sub_menu = I18nVariable.first(:conditions => {:key => 'sub_menu', :language_value_id => site.id, :language_value_type => site.class})
site.sub_menu_translations = {'en' => sub_menu['en'], 'zh_tw' => sub_menu['zh_tw']} if sub_menu
p site.save(:validate => false)
p 'End Site'
end
task :news_p => :environment do
news_bulletins = NewsBulletin.admin_manager_all rescue nil
i = 1
news_bulletins.each do |news|
p "#{i}/#{news_bulletins.size} - #{news.id}"
news.subtitle_translations = {'en' => (news.subtitle_translations['en'].gsub(/^\<p\>/, '').gsub(/\<\/p\>$/, '') rescue ''), 'zh_tw' => (news.subtitle_translations['zh_tw'].gsub(/^\<p\>/, '').gsub(/\<\/p\>$/, '') rescue nil)}
p news.save(:validate => false) if news.changed?
i += 1
end if news_bulletins
end
task :sitemap_i18n => :environment do
Item.all.each do |item|
item.sitemap_enabled = item.sitemap_enabled ? {'en' => 'true', 'zh_tw' => 'true'} : nil
item.sitemap_enabled = item.sitemap_enabled ? {'en' => 'true', 'zh_tw' => 'true'} : {}
item.save
end
end
@ -448,7 +145,7 @@ namespace :migrate do
PagePart.all.each do |pp|
pp[:backup_module_app_key] = (pp.module_app ? pp.module_app.key : nil)
puts pp.id
# puts pp.id
pp.save
# puts pp.inspect
end
@ -493,6 +190,7 @@ namespace :migrate do
end
end
task :convert_cate_tag_type => :environment do
[Page,PagePart].each do |obj|
obj.all.each do |pp|
@ -510,6 +208,30 @@ namespace :migrate do
pp.save
end
end
task :clean_parts => :environment do
PagePart.where(widget_style: /\d/, kind: 'module_widget').each{|part| part.update_attributes({kind: 'text', widget_style: nil, widget_field: nil})}
PagePart.where(widget_style: /\d/).each{|part| part.update_attributes({widget_style: nil, widget_field: nil})}
end
task :delete_import_archive => :environment do
categories = ArchiveFileCategory.where(key: /import_/).entries
unless categories.blank?
categories.each do |category|
files = category.archive_files
unless files.blank?
files.each(&:destroy)
end
category.destroy
end
end
end
task :save_pages => :environment do
Page.all.each do |page|
page.save
end
end
end

View File

@ -4,7 +4,7 @@ namespace :pages do
task :build => :environment do
Item.delete_all
Item.destroy_all
var_10 = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁')

View File

@ -4,8 +4,8 @@ namespace :site do
task :build => :environment do
Site.delete_all
Purchase.delete_all
Site.destroy_all
Purchase.destroy_all
Site.create( :school => 'RulingDigital University', :department => 'Computer Science', :valid_locales => [ 'en', 'zh_tw' ], :in_use_locales => [ 'zh_tw', 'en' ])

View File

@ -9,7 +9,7 @@
"settings":"d_settings.png",
"publication":"d_publication.png",
"journal_p":"d_journal_p.png",
"seminar_p":"d_seminar_p.png",
"conference_p":"d_conference_p.png",
"books":"d_books.png",
"research":"d_research.png",
"research_d":"d_research_d.png",
@ -36,4 +36,4 @@
"connection":"d_connection.png",
"appstore":"d_appstore.png"
}
}
}

View File

@ -9,7 +9,7 @@
"settings":"d_settings.png",
"publication":"d_publication.png",
"journal_p":"d_journal_p.png",
"seminar_p":"d_seminar_p.png",
"conference_p":"d_conference_p.png",
"books":"d_books.png",
"research":"d_research.png",
"research_d":"d_research_d.png",
@ -36,4 +36,4 @@
"connection":"d_connection.png",
"appstore":"d_appstore.png"
}
}
}

View File

@ -9,7 +9,7 @@
"settings":"d_settings.png",
"publication":"d_publication.png",
"journal_p":"d_journal_p.png",
"seminar_p":"d_seminar_p.png",
"conference_p":"d_conference_p.png",
"books":"d_books.png",
"research":"d_research.png",
"research_d":"d_research_d.png",
@ -36,4 +36,4 @@
"connection":"d_connection.png",
"appstore":"d_appstore.png"
}
}
}

View File

@ -9,7 +9,7 @@
"settings":"d_settings.png",
"publication":"d_publication.png",
"journal_p":"d_journal_p.png",
"seminar_p":"d_seminar_p.png",
"conference_p":"d_conference_p.png",
"books":"d_books.png",
"research":"d_research.png",
"research_d":"d_research_d.png",
@ -36,4 +36,4 @@
"connection":"d_connection.png",
"appstore":"d_appstore.png"
}
}
}

View File

@ -9,7 +9,7 @@
"settings":"d_settings.png",
"publication":"d_publication.png",
"journal_p":"d_journal_p.png",
"seminar_p":"d_seminar_p.png",
"conference_p":"d_conference_p.png",
"books":"d_books.png",
"research":"d_research.png",
"research_d":"d_research_d.png",
@ -36,4 +36,4 @@
"connection":"d_connection.png",
"appstore":"d_appstore.png"
}
}
}

View File

@ -9,7 +9,7 @@
"settings":"d_settings.png",
"publication":"d_publication.png",
"journal_p":"d_journal_p.png",
"seminar_p":"d_seminar_p.png",
"conference_p":"d_conference_p.png",
"books":"d_books.png",
"research":"d_research.png",
"research_d":"d_research_d.png",
@ -36,4 +36,4 @@
"connection":"d_connection.png",
"appstore":"d_appstore.png"
}
}
}

1038
route

File diff suppressed because one or more lines are too long

View File

@ -286,7 +286,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
def delete
if params[:ids]
bulletins = Bulletin.any_in(:_id => params[:ids]).delete_all
bulletins = Bulletin.any_in(:_id => params[:ids]).destroy_all
end
redirect_to panel_announcement_back_end_bulletins_url(:filter => params[:filter], :direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end

View File

@ -12,7 +12,7 @@ class BulletinLink
belongs_to :bulletin
before_validation :add_http
validates :url, :presence => true, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
validates :url, :presence => true, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i
protected

View File

@ -16,4 +16,17 @@ en:
update_bulletin_success: Announcement was successfully updated
update_bulletin_category_success: Announcement category was successfully updated
all_articles: All Articles
add_new: New
add_new: New
widget:
index: Index widget
bulletins_and_web_links: "Abreast of bulletins and web link"
#init don't merge
all_articles: "All article"
add_new: New
categories: Categories
approval_setting: "Approval setting"
tags: Tag
default_widget:
bulletin_category_with_title: Category
title: Title
postdate: "Post date"

View File

@ -3,7 +3,7 @@ module Announcement
module_label 'announcement.announcement'
base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile",:i18n=>'announcement.announcement'
# personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile",:i18n=>'announcement.announcement'
version "0.1"
organization "Rulingcom"

View File

@ -13,6 +13,7 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController
respond_to do |format|
format.html # index.html.erb
format.js
format.xml { render :xml => @archive_files }
end
end

View File

@ -12,5 +12,9 @@ class ArchiveFileCategory
has_many :archive_files
validates :title, :at_least_one => true
def self.from_id(id)
ArchiveFileCategory.find(id) rescue nil
end
end

View File

@ -6,7 +6,7 @@
<div class="quick-edit">
<ul class="nav nav-pills hide">
<li><%= link_to t('archive_file_category.edit'), edit_panel_archive_back_end_archive_file_category_path(archive_file_category), :remote => true %></li>
<li><%= link_to t('archive_file_category.delete'), panel_archive_back_end_archive_file_category_path(archive_file_category), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
<!-- <li><%#= link_to t('archive_file_category.delete'), panel_archive_back_end_archive_file_category_path(archive_file_category), :confirm => t('sure?'), :method => :delete, :remote => true %></li> -->
</ul>
</div>
</td>

View File

@ -1,30 +1,30 @@
<tr id="<%= dom_id post %>" class="with_action">
<tr id="<%= dom_id archive_file %>" class="with_action">
<td>
<% if post.is_top? %>
<% if archive_file.is_top? %>
<span class="label label-success"><%= t(:top) %></span>
<% end %>
<% if post.is_hot? %>
<% if archive_file.is_hot? %>
<span class="label label-important"><%= t(:hot) %></span>
<% end %>
<% if post.is_hidden? %>
<% if archive_file.is_hidden? %>
<span class="label"><%= t(:hidden) %></span>
<% end %>
<% if is_manager?%>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<li><%= link_to t('archive_file.edit'), edit_panel_archive_back_end_archive_file_path(post) %></li>
<li><%= link_to t('archive_file.delete'), panel_archive_back_end_archive_file_path(post), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
<li><%= link_to t('archive_file.edit'), edit_panel_archive_back_end_archive_file_path(archive_file) %></li>
<li><%= link_to t('archive_file.delete'), panel_archive_back_end_archive_file_path(archive_file), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
</ul>
</div>
<%end%>
</td>
<td><%= post.archive_file_category.title %></td>
<td><%= archive_file.archive_file_category.title %></td>
<td>
<%= link_to post.title, panel_archive_front_end_archive_file_path(post) %>
<%= link_to archive_file.title, panel_archive_front_end_archive_file_path(archive_file) %>
</td>
<td>
<% post.tags.each do |tag| %>
<% archive_file.tags.each do |tag| %>
<span class="label label-tags"><%= tag[I18n.locale] %></span>
<% end %>
</td>

View File

@ -10,14 +10,11 @@
<th class="span1-2"><%= t('archive_file.tags') %></th>
</tr>
</thead>
<tbody>
<% @archive_files.each do |post| %>
<%= render :partial => 'archive_files', :locals => {:post => post} %>
<% end %>
<tbody id="tbody_archive">
<%= render :partial => 'archive_file', :collection => @archive_files %>
</tbody>
</table>
<%= paginate @archive_files %>
<div id="archive_pagination">
<%= paginate @archive_files %>
</div>

View File

@ -0,0 +1,2 @@
$("#tbody_archive").html("<%= j render :partial => 'archive_file', :collection => @archive_files %>");
$("#archive_pagination").html("<%= j paginate @archive_files %>");

View File

@ -4,17 +4,17 @@
<%#= paginate @archive_files, :params => {:inner => false}%>
<% if @title %>
<h1 class="h1"><%= @title %></h1>
<% end %>
<%# if @title %>
<!-- <h1 class="h1"><%#= @title %></h1> -->
<%# end %>
<ul class="subm">
<% @archive_file_categorys.each do |afcpost| %>
<li><%= link_to afcpost.title, panel_archive_front_end_archive_files_path(:category_id => afcpost.id) %></li>
<% end %>
</ul>
<!-- <ul class="subm"> -->
<%# @archive_file_categorys.each do |afcpost| %>
<!-- <li><%#= link_to afcpost.title, panel_archive_front_end_archive_files_path(:category_id => afcpost.id) %></li> -->
<%# end %>
<!-- </ul> -->
<h3><%= @archive_files.first.archive_file_category.title rescue nil %></h3>
<h3><%= @current_category.title rescue nil %></h3>
<% @archive_files.each do |post| %>

View File

@ -3,7 +3,6 @@ Rails.application.routes.draw do
namespace :panel do
namespace :archive do
namespace :back_end do
root :to => "archive_files#index"
resources :archive_files
resources :archive_file_categorys
resources :tags

View File

@ -4,9 +4,6 @@ module Archive
base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/archive/plugin/profile",:i18n=>'archive.archive'
# =======
# personal_plugin :enable => true,:path=>"panel/archive/plugin/profile",:i18n=>'admin.archive'
# >>>>>>> 858e942da234fffa3053a995231f2b0d9eee43d1
version "0.1"
organization "Rulingcom"

View File

@ -2,13 +2,9 @@ zh_tw:
miss_module_i18n:
# miss_plugin_i18n:
# personal_experience: 經歷
# personal_honor: 榮譽
# personal_project: 研究計畫
# personal_research: 研究
# personal_conference: 研討會論文

View File

@ -11,6 +11,8 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
end
def index
get_plugins
get_categorys("BookPaperType",params[:book_paper_type_id])
@filter = params[:filter]
@ -50,6 +52,8 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
def writing_book_setting
get_plugins
@author_types = BookAuthorType.all
@paper_types = BookPaperType.all
@ -120,6 +124,8 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
# GET /writing_books/new.xml
def new
get_plugins
@writing_book = WritingBook.new
# @writing_book_files = WritingBookFile.all
# @level_types = BookLevelType.all
@ -136,6 +142,9 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
# GET /writing_books/1/edit
def edit
get_plugins
@writing_book = WritingBook.find(params[:id])
# @level_types = BookLevelType.all
@ -271,7 +280,7 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
def delete
if params[:ids]
writing_books = WritingBook.any_in(:_id => params[:ids]).delete_all
writing_books = WritingBook.any_in(:_id => params[:ids]).destroy_all
end
redirect_to panel_personal_book_back_end_writing_books_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end
@ -303,6 +312,10 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
# end
# end
def get_plugins
@plugins = OrbitApp::Plugin::Registration.all
end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_book'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})

View File

@ -146,7 +146,7 @@ class Panel::PersonalBook::Plugin::WritingBooksController < OrbitBackendControll
def delete
if params[:ids]
writing_books = WritingBook.any_in(:_id => params[:ids]).delete_all
writing_books = WritingBook.any_in(:_id => params[:ids]).destroy_all
end
redirect_to panel_personal_book_plugin_writing_books_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end

View File

@ -51,7 +51,7 @@ class WritingBook
after_save :save_writing_book_files
validates :url, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix, :unless => Proc.new{self.url.blank?}
validates :url, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i, :unless => Proc.new{self.url.blank?}
def self.search( category_id = nil )

View File

@ -1,8 +1,6 @@
<div id="filter" class="subnav">
<div class="filters">
<div id="sort_headers" class="table-label">
<%= render 'sort_headers' %>
</div>
<div class="table-label">
<div id="sort_headers" class="table-label">
<%= render 'sort_headers' %>
</div>
</div>

View File

@ -1,11 +1,11 @@
<tr id="<%= dom_id writing_book %>" class="with_action">
<td>
<td class="span1">
<% if (writing_book.create_user_id == current_user.id) || is_manager? %>
<%= check_box_tag 'to_delete[]', writing_book.id, false, :class => "checkbox_in_list" %>
<% end -%>
</td>
<td><%= writing_book.year %></td>
<td>
<td class="span1"><%= writing_book.year %></td>
<td class="span1">
<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
@ -16,6 +16,6 @@
</ul>
</div>
</td>
<td><%= User.from_id(writing_book.create_user_id).name rescue ''%></td>
<td class="span1"><%= User.from_id(writing_book.create_user_id).name rescue ''%></td>
</tr>

View File

@ -1,3 +1,14 @@
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %>
</div>
<h1><%= t('personal_book.editing_personal_book') %></h1>
<%= form_for @writing_book, :url => panel_personal_book_back_end_writing_book_path(@writing_book), :html => {:class => 'clear'} do |f| %>

View File

@ -1,12 +1,22 @@
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %>
<%= render 'filter' %>
</div>
<table class="table main-list">
<thead>
<tr>
<th class="span1"></th>
<th class="span1"></th>
<th class="span2"></th>
<th class="span3"></th>
<th class="span2"></th>
<th class="span1"></th>
<th class="span1"></th>
</tr>
</thead>
<tbody id="tbody_writing_books" class="sort-holder">

View File

@ -1,10 +1,22 @@
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %>
</div>
<%= flash_messages %>
<div id="poststuff">
<h1><%= t('writing_book.new_personal_book') %></h1>
<%= form_for @writing_book, :url => panel_personal_book_back_end_writing_books_path, :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
</div>
<%#= link_back %>

View File

@ -1,5 +1,14 @@
<% # encoding: utf-8 %>
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %>
</div>
<div id="isotope">
<div class="item element">

View File

@ -1,12 +1,9 @@
module PersonalBook
OrbitApp.registration "Book",:type=> 'ModuleApp' do
OrbitApp.registration "PersonalBook",:type=> 'ModuleApp' do
module_label 'module_name.personal_book'
base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_book/plugin/profile",:i18n=>'module_name.personal_book'
base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_book/plugin/profile",:admin_path=>"/panel/personal_book/back_end/writing_books",:i18n=>'module_name.personal_book'
end
end

View File

@ -11,6 +11,8 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
end
def index
get_plugins
get_categorys("ConferencePaperType",params[:conference_paper_type_id])
@filter = params[:filter]
@ -51,6 +53,8 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
def writing_conference_setting
get_plugins
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
@ -120,6 +124,9 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
# GET /writing_conferences/new
# GET /writing_conferences/new.xml
def new
get_plugins
@writing_conference = WritingConference.new
# @writing_conference_files = WritingConferenceFile.all
# @paper_types = ConferenceLevelType.all
@ -135,6 +142,9 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
# GET /writing_conferences/1/edit
def edit
get_plugins
@writing_conference = WritingConference.find(params[:id])
# @paper_types = ConferenceLevelType.all
@ -269,7 +279,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
def delete
if params[:ids]
writing_conferences = WritingConference.any_in(:_id => params[:ids]).delete_all
writing_conferences = WritingConference.any_in(:_id => params[:ids]).destroy_all
end
redirect_to panel_personal_conference_back_end_writing_conferences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end
@ -301,6 +311,10 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
# end
# end
def get_plugins
@plugins = OrbitApp::Plugin::Registration.all
end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_conference'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})

View File

@ -0,0 +1,63 @@
class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController < ApplicationController
def index
@conference_co_author_relations = ConferenceCoAuthorRelation.all
new
respond_to do |format|
format.html {render layout: false }
end
end
def edit
@conference_co_author_relation = ConferenceCoAuthorRelation.find(params[:id])
respond_to do |format|
format.html { render :layout => false}
end
end
def new
@conference_co_author_relation = ConferenceCoAuthorRelation.new
end
def create
@conference_co_author_relation = ConferenceCoAuthorRelation.new(params[:conference_co_author_relation])
@conference_co_author_relations = ConferenceCoAuthorRelation.all
if @conference_co_author_relation.save
newv = render_to_string partial: "show_form", object: @conference_co_author_relations
render json: {success: true, msg: "New Relation successfully saved!", newvalue: newv}.to_json
else
error_msg = @conference_co_author_relation.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def update
@conference_co_author_relation = ConferenceCoAuthorRelation.find(params[:id])
if @conference_co_author_relation.update_attributes(params[:conference_co_author_relation])
@conference_co_author_relations = ConferenceCoAuthorRelation.all
newv = render_to_string partial: "show_form", object: @conference_co_author_relations
render json: {success: true, msg: "New Relation successfully updated!", newvalue: newv}.to_json
else
error_msg = @conference_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def destroy
@conference_co_author_relation = ConferenceCoAuthorRelation.find(params[:id])
@conference_co_author_relation.destroy
reset_co_author_relation
render :json => {success: true, msg: "deleted successfully!"}
end
private
def reset_co_author_relation
co_author = ConferenceCoAuthor.where(co_author_relations_id: @co_author_relation.id)
co_author.map do |c|
c.update_attributes(co_author_relations_id: nil)
end
end
end

View File

@ -0,0 +1,59 @@
class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < ApplicationController
def index
nils, not_nils = ConferenceCoAuthor.where(name_id: current_user.id)\
.asc(:co_author).partition{|p| p.email.nil?}
@conference_co_authors = not_nils + nils
@conference_co_author_relations = ConferenceCoAuthorRelation.all
respond_to do |format|
format.html { render :layout => false}
end
end
def new
@conference_co_author = ConferenceCoAuthor.new
@conference_co_author_relations = ConferenceCoAuthorRelation.all
respond_to do |format|
format.html { render :layout => false}
end
end
def edit
@conference_co_author = ConferenceCoAuthor.find(params[:id])
@conference_co_author_relations = ConferenceCoAuthorRelation.all
respond_to do |format|
format.html { render :layout => false}
end
end
def create
@conference_co_author = ConferenceCoAuthor.new(params[:conference_co_author])
@conference_co_author.name_id= current_user.id
if @conference_co_author.save
render json: {success:true, msg: t('create.sucess.co_author')}.to_json
else
error_msg = @conference_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def update
@conference_co_author = ConferenceCoAuthor.find(params[:id])
if @conference_co_author.update_attributes(params[:co_author])
render json: {success:true, msg: t('update.sucess.co_author')}.to_json
else
error_msg = @conference_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def destroy
@conference_co_author = ConferenceCoAuthor.find(params[:id])
@conference_co_author.destroy
render :json => {success: true, msg: "Co-author deleted successfully!"}
end
end

View File

@ -1,5 +0,0 @@
class Panel::PersonalConference::Desktop::ConferencePController < ApplicationController
def conference_p
render panel_personal_conference_desktop_conference_p_path, :layout => false
end
end

View File

@ -1,11 +1,82 @@
class Panel::PersonalConference::Desktop::ConferencePagesController < ApplicationController
def index
@writing_conferences = WritingConference.all
@level_types = ConferencePaperType.all
respond_to do |format|
format.html { render :layout => false}
end
end
def show
end
def new
@writing_conference = WritingConference.new
@paper_types = ConferencePaperType.all
@author_types = ConferenceAuthorType.all
#@co_author_candidate =
# CoAuthor.where(name_id: current_user.id).map{|c|c.co_author}
#@conference_candidate =
# WritingConference.where(create_user_id: current_user.id).map{|j|j.conference_title}.uniq
respond_to do |format|
format.html { render :layout => false}
end
end
def edit
@writing_conference = WritingConference.find(params[:id])
@paper_types = ConferencePaperType.all
@author_types = ConferenceAuthorType.all
respond_to do |format|
format.html { render :layout => false}
end
end
def create
params[:writing_conference][:create_user_id] = current_user.id
@writing_conference = WritingConference.new(params[:writing_conference])
if @writing_conference.save
render json: {success: true, msg: t('create.success.paper')}.to_json
else
error_msg = @writing_conference.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def update
params[:writing_conference][:update_user_id] = current_user.id
@writing_conference= WritingConference.find(params[:id])
if @writing_conference.update_attributes(params[:writing_conference])
render json: {success: true, msg: t('update.success.paper')}.to_json
else
error_msg = @writing_conference.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def destroy
@writing_conference = WritingConference.find(params[:id])
@writing_conference.destroy
render :json => {success: true, msg: t('delete.success.paper')}
end
def conference_type
conference_types = ConferencePaperType.all
all_conference_lists = WritingConference.where(create_user_id: current_user.id)
all_conference_lists = all_conference_lists.map do |j|
[ j.conference_title,
j.conference_paper_type_ids.map do |type|
conference_types.find(type).title
end
]
end
@conference_lists = all_conference_lists.uniq
respond_to do |format|
format.html { render :layout => false}
end

View File

@ -0,0 +1,5 @@
class Panel::PersonalConference::Desktop::ConferenceWindowsController < ApplicationController
def conference_window
render panel_personal_conference_desktop_conference_window_path, :layout => false
end
end

View File

@ -0,0 +1,31 @@
class Panel::PersonalConference::FrontEnd::WritingConferencesController < OrbitWidgetController
def initialize
super
@app_title = 'personal_conference'
end
def index
@writing_conferences = WritingConference.desc(:year).page(params[:page]).per(10)
end
# GET /writing_conferences/1
# GET /writing_conferences/1.xml
def show
@writing_conference = WritingConference.find(params[:id])
@conference_paper_types = ( !@writing_conference.conference_paper_types.blank? ? @writing_conference.conference_paper_types.collect{|x| x.title}.join(', ') : nil)
@conference_author_types = ( !@writing_conference.conference_author_types.blank? ? @writing_conference.conference_author_types.collect{|x| x.title}.join(', ') : nil)
end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_conference'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end

View File

@ -147,7 +147,7 @@ class Panel::PersonalConference::Plugin::WritingConferencesController < OrbitBac
def delete
if params[:ids]
writing_conferences = WritingConference.any_in(:_id => params[:ids]).delete_all
writing_conferences = WritingConference.any_in(:_id => params[:ids]).destroy_all
end
redirect_to panel_personal_conference_plugin_writing_conferences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end

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