member plugin edit

This commit is contained in:
unknown 2013-02-20 17:25:20 +08:00
commit bc44d38948
319 changed files with 5405 additions and 2763 deletions

View File

@ -1,5 +1,5 @@
source 'http://rubygems.org' source 'http://rubygems.org'
gem 'rails' gem 'rails', "~> 3.2.9"
gem "brakeman" gem "brakeman"
gem 'mime-types' gem 'mime-types'
@ -11,7 +11,7 @@ gem "net-ldap", "~> 0.3.1"
gem 'devise', '1.5.3' gem 'devise', '1.5.3'
gem 'exception_notification' # Send error trace gem 'exception_notification' # Send error trace
gem 'execjs' gem 'execjs'
gem 'jquery-rails' gem 'jquery-rails', '2.1.4'
gem 'jquery-ui-rails' gem 'jquery-ui-rails'
gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git' gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git'

View File

@ -15,4 +15,3 @@
//= require orbitTimeline //= require orbitTimeline
//= require orbitdesktop //= require orbitdesktop
//= require desktop/books_pages //= require desktop/books_pages
//= require desktop/seminar_pages

View File

@ -25,8 +25,8 @@ $('#index').live('pageinit',function(){
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)}); $(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
$(this).find(".newpic img").muImageResize({width: 280, height: 200}); $(this).find(".newpic img").muImageResize({width: 280, height: 200});
$('.slideshow').cycle({ $('.slideshow').cycle({
fx:'scrollLeft', fx: $effect,
timeout: 6000, timeout: $timeout
}); });
$(".newlist").css({ $(".newlist").css({
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30, "width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
@ -40,8 +40,9 @@ $('#index').live('pageinit',function(){
$('#announcement_content').live('pageinit',function(){ $('#announcement_content').live('pageinit',function(){
$(this).find(".newpic img").muImageResize({width: 320, height: 220}); $(this).find(".newpic img").muImageResize({width: 320, height: 220});
}); });
var mobileDemo = { 'center': '24.987449, 121.576117', 'zoom': 17 };
$('#map').live('pageinit', function() { $('#map').live('pageinit', function() {
var mobileDemo = { 'center': $map_center, 'zoom': $map_zoom };
var $windowH = $(window).height(); var $windowH = $(window).height();
$("#map_canvas").css({ $("#map_canvas").css({
'height' : $windowH, 'height' : $windowH,
@ -50,7 +51,7 @@ $('#map').live('pageinit', function() {
$('#map_canvas').gmap({'center': mobileDemo.center, 'zoom': mobileDemo.zoom, 'disableDefaultUI':false, 'callback': function() { $('#map_canvas').gmap({'center': mobileDemo.center, 'zoom': mobileDemo.zoom, 'disableDefaultUI':false, 'callback': function() {
var self = this; var self = this;
self.addMarker({'position': this.get('map').getCenter() }).click(function() { self.addMarker({'position': this.get('map').getCenter() }).click(function() {
self.openInfoWindow({ 'content': "<%= I18n.t('mobile.location_description') %>" }, this); self.openInfoWindow({ 'content': $info }, this);
}); });
}}); }});
}).load('basic_map'); }).load('basic_map');

View File

@ -9,7 +9,6 @@
//= require jquery.form //= require jquery.form
//= require bootstrap //= require bootstrap
//= require jquery.masonry.min //= require jquery.masonry.min
//= require jquery.isotope.min
//= require jquery.tinyscrollbar.min //= require jquery.tinyscrollbar.min
//= require orbit-1.0 //= require orbit-1.0
//= require tinymce-jquery //= require tinymce-jquery

View File

@ -1,28 +1,42 @@
$(document).on('click', '.orbit-bar-search', function (){
if ($(this).parents('.search').hasClass('visible')){ $(document).ready(function(){
$(this).parents('.search').stop().animate({ $('.search').tooltip({
'width':'28px', placement: "bottom"
},500); });
$('.navbar-search').stop().animate({ });
'left':'30px', $(document).on('mouseenter', '.orbit-bar-search', function (){
'opacity':'0', $(this).parents('.search').stop().animate({
},200); 'width':'265px',
$(this).parents('.search').css({ },200);
'background-color': 'transparent', $('.navbar-search').stop().animate({
}); 'left':'4px',
$(this).parents('.search').removeClass('visible'); 'opacity':'1'
} },500);
else{ $(this).parents('.search').css({
$(this).parents('.search').stop().animate({ 'background-color': 'rgba(0, 0, 0, 0.5)',
'width':'265px', });
},200); $(this).parents('.search').addClass('visible');
$('.navbar-search').stop().animate({ });
'left':'7px',
'opacity':'1'
},500); $(document).on('mouseleave', '.search.visible', function (){
$(this).parents('.search').css({ $(this).stop().animate({
'background-color': 'rgba(0, 0, 0, 0.5)', 'width':'28px',
}); },500);
$(this).parents('.search').addClass('visible'); $('.navbar-search').stop().animate({
} 'left':'30px',
}); 'opacity':'0',
},200);
$(this).css({
'background-color': 'transparent',
});
$(this).removeClass('visible');
});
$(document).on("mouseenter",".orbit-bar-language, .language-menu",function(){
$(this).parents('.language').addClass("open")
})
$(document).on("mouseleave",".orbit-bar-language, .language-menu",function(){
$(this).parents('.language').removeClass("open")
})

View File

@ -1,5 +1,11 @@
function get_part_id(){ function get_part_id(){
return $(".edit_page_part").attr("action").split('/').pop(); return $(".edit_page_part,.edit_page").attr("action").split('/').pop();
}
function get_object_path(){
a = window.location.href.split('/');
a.pop();
return a.join('/');
} }
$("div.editable").live("mouseenter mouseleave", function (event) { $("div.editable").live("mouseenter mouseleave", function (event) {
@ -10,26 +16,26 @@ $("#page_design").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes'); $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
}); });
$("#page_module_app_id").live('change', function() { // $("#page_module_app_id").live('change', function() {
var app_id = $(this).val(); // var app_id = $(this).val();
if(app_id!=''){ // if(app_id!=''){
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_frontend_pages',function(data, textStatus){ // $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_after_module_changed',function(data, textStatus){
if(textStatus == 'success'){ // if(textStatus == 'success'){
$(this).after(data); // $(this).after(data);
} // }
}); // });
} // }
else{ // else{
$("#app_page_url").children().remove(); // $("#app_page_url").children().remove();
} // }
}); // });
$("#module_app_list select").live('change', function() { $("#module_app_list select").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_widgets?part_id=' + get_part_id()); $.getScript(get_object_path() + '/reload_after_module_changed?module_app_id='+$(this).val()); //?part_id=' + get_part_id());
}); });
$("#widget_list select").live('change', function() { $("#widget_list select,#frontend_list select").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_widget_styles?module_app_id=' + $("#module_app_list select").val() + '&part_id=' + get_part_id()); $.getScript(get_object_path() +'/reload_after_list_changed?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() );//+ '&part_id=' + get_part_id());
}); });
$("#tag_list select").live('change', function() { $("#tag_list select").live('change', function() {

View File

@ -10,7 +10,6 @@
//= require jquery.ui.sortable //= require jquery.ui.sortable
//= require jquery_ujs //= require jquery_ujs
//= require bootstrap //= require bootstrap
//= require jquery.isotope.min
//= require jquery.tinyscrollbar.min //= require jquery.tinyscrollbar.min
//= require orbit-1.0 //= require orbit-1.0
//= require orbit-bar-search //= require orbit-bar-search

View File

@ -1,6 +1,11 @@
label{
white-space: nowrap !important;
}
.style_switch{} .style_switch{}
.style_switch ul{} .style_switch ul{
margin: 0;
}
.style_switch li{ .style_switch li{
float: left; float: left;
@ -9,19 +14,22 @@
width: 103px; width: 103px;
} }
.style_radio{ .style_radio{
margin: 0 0 5px 10px; cursor: pointer;
margin: 0 0 0 10px;
} }
.style_img{ .style_img{
display: block; display: block;
margin: 0 0 5px; margin: 5px 0 5px -28px;
} }
.style_description{ .style_description{
color: #6B6B6B; color: #6B6B6B;
display: block; display: block;
margin: 0 0 0 5px; font-size: 12px;
margin: 0 0 0 -25px;
white-space: normal;
} }
label{ label{
white-space: nowrap !important ; white-space: nowrap !important ;
} }

View File

@ -13,7 +13,6 @@
*= require list *= require list
*= require widget *= require widget
*= require scroll_style *= require scroll_style
*= require isotope
*= require icons *= require icons
*= require site-map *= require site-map
*= require lib/bootstrap-datetimepicker *= require lib/bootstrap-datetimepicker

View File

@ -9,32 +9,6 @@ class Admin::ModuleAppsController < ApplicationController
end end
def reload_frontend_pages
@categories =[]
@module_app = ModuleApp.find(params[:id])
@frontend_path = @module_app.widgets.keys[0] if ( !@module_app.widgets.blank? && @module_app.widgets[0].blank? )
@frontend_style = @module_app.widgets[@frontend_path] if ( !@frontend_path.blank? )
case @module_app.key
when 'announcement'
@categories = BulletinCategory.all
@tags = AnnouncementTag.all
when 'news'
@categories = NewsBulletinCategory.all
@tags = NewsTag.all
when 'web_resource'
@categories = WebLinkCategory.all
@tags = WebResourceTag.all
when 'archive'
@categories = ArchiveFileCategory.all
@tags = ArchiveTag.all
end
respond_to do |format|
format.js {}
end
end
def module_auth_proc def module_auth_proc
@module_app = ModuleApp.find(params[:id]) @module_app = ModuleApp.find(params[:id])
@ -136,7 +110,6 @@ class Admin::ModuleAppsController < ApplicationController
end end
#user is not permited to do that #user is not permited to do that
flash[:notice] = t('app_auth.operation_not_permitted') flash[:notice] = t('app_auth.operation_not_permitted')
render :nothing => true, :status => 403 render :nothing => true,:status => 403
end end
end end

View File

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

View File

@ -1,7 +1,11 @@
class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
include OrbitCoreLib::PermissionUnility include OrbitCoreLib::PermissionUtility
before_filter :force_order before_filter :force_order
def set_module_app
@module_app = ModuleApp.where(:title=>'Announcement').first
end
def setting def setting
@sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user @sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user
@ -59,6 +63,7 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
def force_order def force_order
authenticate_user! authenticate_user!
set_module_app
setup_vars setup_vars
check_if_user_can_do_object_auth check_if_user_can_do_object_auth
end end

View File

@ -25,31 +25,28 @@ class Admin::PagePartsController < ApplicationController
def edit def edit
@part = PagePart.find(params[:id]) @part = PagePart.find(params[:id])
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc) @module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
@module_app = @part.module_app ? @part.module_app : @module_apps[0] @module_app = @part.module_app ? @part.module_app : nil
@user_choose = @part.widget_path @user_choose = @part.widget_path
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag @r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
@tag_objects = @r_tag.classify.constantize.all rescue nil @tag_objects = @r_tag.classify.constantize.all rescue nil
if @module_app
@widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0]
@widget_style = @module_app.get_widget_style[@widget_path][:style] unless @widget_path.nil? or @module_app.nil?
end
unless @module_app.nil?
@categories = @module_app.get_categories
@tags = @module_app.get_tags
end
@widget_path = @part.widget_path ? @part.widget_path : (@module_app.widgets.keys[0] rescue nil)
@widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0] if @module_app && @module_app.widgets.any?{|b| b.class == Array}
if @module_app.widgets.any?{|b| b.class == Array}
@widget_style = @module_app.widgets[@widget_path] if !@widget_path.blank? && !@module_app.widgets.blank? @widget_style = @module_app.widgets[@widget_path] if !@widget_path.blank? && !@module_app.widgets.blank?
end end
case @module_app.key
when 'announcement'
@categories = BulletinCategory.all
@tags = AnnouncementTag.all
when 'gallery'
@albums = GalleryAlbum.all
@tags = []
when 'web_resource'
@categories = WebLinkCategory.all
@tags = WebResourceTag.all
when 'archive'
@categories = ArchiveFileCategory.all
@tags = ArchiveTag.all
end
end end
def create def create
@ -59,9 +56,12 @@ class Admin::PagePartsController < ApplicationController
def update def update
@part = PagePart.find(params[:id]) @part = PagePart.find(params[:id])
params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type] ) if params[:page_part][:widget_field] params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type] ) if params[:page_part][:widget_field]
params[:page_part][:widget_field_type] = nil params[:page_part][:widget_field_type] = nil
if params[:page_part][:module_app].blank?
params[:page_part][:module_app] = nil
end
if @part.update_attributes(params[:page_part]) if @part.update_attributes(params[:page_part])
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu') set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
flash.now[:notice] = t('update.success.content') flash.now[:notice] = t('update.success.content')
@ -91,30 +91,14 @@ class Admin::PagePartsController < ApplicationController
end end
def reload_widgets def reload_widgets
@part = PagePart.find params[:part_id] @part = PagePart.find params[:id]
@categories =[] @module_app = ModuleApp.find(params[:module_app_id]) rescue nil
@module_app = ModuleApp.find(params[:id]) @categories =@module_app ? @module_app.get_categories : []
@tags =@module_app ? @module_app.get_tags : []
@widget_path = @module_app.widgets.keys[0] if ( @module_app.widgets[0].blank? ) @widget_path = @module_app.widgets.keys[0] if (@module_app && @module_app.widgets[0].blank? )
@widget_style = @module_app.widgets[@widget_path] if ( !@widget_path.blank? ) @widget_style = @module_app.widgets[@widget_path] if ( !@widget_path.blank? )
case @module_app.key @part.widget_path = @module_app.widgets.first if( @module_app)
when 'announcement'
@categories = BulletinCategory.all
@tags = AnnouncementTag.all
when 'gallery'
@albums = GalleryAlbum.all
@tags = []
when 'web_resource'
@categories = WebLinkCategory.all
@tags = WebResourceTag.all
when 'archive'
@categories = ArchiveFileCategory.all
@tags = ArchiveTag.all
end
@part.widget_path = @module_app.widgets.first if @module_app.needs_to_widget_option?
respond_to do |format| respond_to do |format|
format.js {} format.js {}
end end
@ -122,9 +106,11 @@ class Admin::PagePartsController < ApplicationController
def reload_widget_styles def reload_widget_styles
@module_app = ModuleApp.find(params[:module_app_id]) @module_app = ModuleApp.find(params[:module_app_id])
@part = PagePart.find params[:part_id]
@user_choose =@widget_path= params[:id] @part = PagePart.find params[:id]
@widget_style = @module_app.widgets[params[:id]] @user_choose =@widget_path= params[:frontend]
@widget_style = @module_app.widgets[@widget_path]
respond_to do |format| respond_to do |format|
format.js {} format.js {}

View File

@ -19,15 +19,21 @@ helper Admin::PagePartsHelper
end end
def edit def edit
@item = Page.find(params[:id]) @item = @page =Page.find(params[:id])
@user_choose = @item.app_frontend_url
@apps = ModuleApp.excludes(app_pages: nil).entries @apps = ModuleApp.excludes(app_pages: nil).entries
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc) @module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
@designs = Design.all.entries @designs = Design.all.entries
@design = @item.design ? @item.design : @designs.first @design = @item.design ? @item.design : @designs.first
@app_frontend_urls = @item.module_app.app_pages if @item.module_app
if @item.module_app
@app_frontend_urls = @item.module_app.app_pages.map{|t| [I18n.t(t[0]),t[1]]}
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if @item.module_app.has_default_widget?
end
if @item.module_app if @item.module_app
@module_app = @item.module_app @module_app = @item.module_app
@ -84,13 +90,13 @@ helper Admin::PagePartsHelper
def update def update
@item = Page.find(params[:id]) @item = Page.find(params[:id])
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank? if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id ) @item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
end end
params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type] ) if params[:page][:frontend_field]
params[:page][:frontend_field_type] = nil
params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type] ) if params[:page][:frontend_field]
params[:page][:frontend_field_type] = nil
if @item.update_attributes(params[:page]) if @item.update_attributes(params[:page])
flash[:notice] = t('update.success.page') flash[:notice] = t('update.success.page')
respond_to do |format| respond_to do |format|
@ -123,7 +129,42 @@ helper Admin::PagePartsHelper
format.js { @item = @item.parent } format.js { @item = @item.parent }
end end
end end
def reload_front_end_setting
@page = Page.find params[:id]
@module_app = ModuleApp.find params[:module_app_id]
@chosen_frontend = @user_choose = params[:frontend]
end
def reload_frontend_pages
@page = Page.find params[:id] rescue nil
# @categories =[]
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
@app_frontend_urls = @module_app.nil? ? nil : @module_app.app_pages.map{|t| [I18n.t(t[0]),t[1]]}
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if(@module_app && @module_app.has_default_widget?)
case (@module_app.nil? ? nil : @module_app.key )
when 'announcement'
@categories = BulletinCategory.all
@tags = AnnouncementTag.all
when 'news'
@categories = NewsBulletinCategory.all
@tags = NewsTag.all
when 'web_resource'
@categories = WebLinkCategory.all
@tags = WebResourceTag.all
when 'archive'
@categories = ArchiveFileCategory.all
@tags = ArchiveTag.all
else
@categories = []
@tags = []
end
respond_to do |format|
format.js {}
end
end
def reload_themes def reload_themes
@design = Design.find(params[:id]) @design = Design.find(params[:id])
@themes = @design.themes @themes = @design.themes

View File

@ -4,7 +4,7 @@ class Admin::PluginsController < ApplicationController
def index def index
@plugins = OrbitApp::Module::Registration.all @plugins = OrbitApp::Plugin::Registration.all
if(!params[:show_plugin_profile].nil?) if(!params[:show_plugin_profile].nil?)

View File

@ -36,7 +36,7 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
def show def show
@user = User.find(params[:id]) @user = User.find(params[:id])
@plugins = OrbitApp::Module::Registration.all @plugins = OrbitApp::Plugin::Registration.all
@profile_data = [] @profile_data = []
@teacher_data = [] @teacher_data = []

View File

@ -1,7 +1,12 @@
class DefaultWidgetController< OrbitWidgetController class DefaultWidgetController< OrbitWidgetController
def front_end_available(var) def front_end_available(var)
@page_part = PagePart.find params[:part_id] @page_part = case params[:item_type]
when "page"
Page.find params[:page_id]
when "page_part"
PagePart.find params[:part_id]
end
@page_part.module_app.enable_frontend? @page_part.module_app.enable_frontend?
end end
@ -9,11 +14,17 @@ class DefaultWidgetController< OrbitWidgetController
@tag_class = nil @tag_class = nil
@default_widget = @page_part.module_app.get_default_widget @default_widget = @page_part.module_app.get_default_widget
@widget_image_field = @default_widget[:image] @widget_image_field = @default_widget["image"] || @default_widget[:image]
data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3) data_limit = case @page_part
when Page
@fields = @page_part.frontend_field
@page_part.frontend_data_count.is_a?(Fixnum) ? @page_part.frontend_data_count : (@page_part.frontend_data_count.to_i rescue 3)
when PagePart
@fields = @page_part.widget_field
@page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
end
@data = eval(@default_widget["query"]).limit(data_limit).includes(@widget_image_field) @data = eval(@default_widget["query"]).limit(data_limit).includes(@widget_image_field)
@fields = @page_part.widget_field
case params[:type] case params[:type]
when "typeA" when "typeA"
@tag_class = 'default_widget_typeA' @tag_class = 'default_widget_typeA'
@ -26,15 +37,6 @@ class DefaultWidgetController< OrbitWidgetController
render "typeC" render "typeC"
end end
# {"inner"=>"true",
# "category_id"=>"false",
# "tag_id"=>"",
# "page"=>"",
# "search_query"=>"",
# "part_title"=>"",
# "part_id"=>"50ac426f83e75219d20000a7",
# "controller"=>"default_widget",
# "action"=>"default_widget",
# "type"=>"typeA"}
end end
end end

View File

@ -1,75 +0,0 @@
class DesktopPublicationsController< ApplicationController
def journal_p
render "desktop/journal_p", :layout => false
end
def journal_p_list
render "desktop/journal_pages/list", :layout => false
end
def journal_p_add
debugger
render "desktop/journal_pages/add", :layout => false
end
def books
render "desktop/books", :layout => false
end
def books_list
render "desktop/books/list", :layout => false
end
def books_add
render "desktop/books/add", :layout => false
end
def seminar_p
render "desktop/seminar_p", :layout => false
end
def seminar_p_list
render "desktop/seminar_pages/list", :layout => false
end
def seminar_p_add
render "desktop/seminar_pages/add", :layout => false
end
def create_journal
Journal.create(user_id: current_user.id, title: "Ice Cream Sandwich")
b = Array.new
b << {"success"=>"true"}
render :json=>b.to_json
end
def getjournals
@journals = current_user.journals
data = Array.new
@journals.each do |journal|
@papers = journal.papers.all
data << {"title" => journal.title, "papers" => @papers}
end
render :json=>data.to_json
end
def delete_journal
@journals = Journal.find("")
@journals.delete
b = Array.new
b << {"success"=>"true"}
render :json=>b.to_json
end
def update_journal
@journal = Journal.find("4ff2d6ebbd98eb02b9000017")
@papers = @journal.papers
@papers.each do |paper|
paper.update_attributes(:user_id => current_user.id)
end
b = Array.new
b << {"success"=>"true"}
render :json=>b.to_json
end
end

View File

@ -1,10 +1,6 @@
require 'mime/types' require 'mime/types'
class DesktopPublicationsController< ApplicationController class DesktopPublicationsController< ApplicationController
#def journal_p
# render "desktop/journal_p", :layout => false
#end
def books def books
render "desktop/books", :layout => false render "desktop/books", :layout => false
end end
@ -16,44 +12,4 @@ class DesktopPublicationsController< ApplicationController
def books_add def books_add
render "desktop/books/add", :layout => false render "desktop/books/add", :layout => false
end end
def seminar_p
render "desktop/seminar_p", :layout => false
end
def seminar_p_list
render "desktop/seminar_pages/list", :layout => false
end
def seminar_p_add
render "desktop/seminar_pages/add", :layout => false
end
# def create_journal
# Journal.create(user_id: current_user.id, title: "Ice Cream Sandwich")
# b = Array.new
# b << {"success"=>"true"}
# render :json=>b.to_json
# end
#
#
# def delete_journal
# @journals = Journal.find("")
# @journals.delete
# b = Array.new
# b << {"success"=>"true"}
# render :json=>b.to_json
# end
#
# def update_journal
# @journal = Journal.find("4ff2d6ebbd98eb02b9000017")
# @papers = @journal.papers
# @papers.each do |paper|
# paper.update_attributes(:user_id => current_user.id)
# end
# b = Array.new
#
# b << {"success"=>"true"}
# render :json=>b.to_json
# end
end end

View File

@ -1,10 +1,6 @@
class OrbitBackendController < ApplicationController class OrbitBackendController < ApplicationController
#before_filter :setup_vars include OrbitCoreLib::AppBackendUtility
#before_filter :set_current_user include OrbitCoreLib::PermissionUtility
# before_filter {|c| c.front_end_available(@app_title)}
# before_filter :check_user_can_use
include OrbitCoreLib::PermissionUnility
include AdminHelper include AdminHelper
include ApplicationHelper include ApplicationHelper

View File

@ -1,3 +1,4 @@
class OrbitFrontendController< OrbitFrontendComponentController class OrbitFrontendController< OrbitFrontendComponentController
end end

View File

@ -1,3 +1,4 @@
class OrbitWidgetController< OrbitFrontendComponentController class OrbitWidgetController< OrbitFrontendComponentController
end end

View File

@ -10,43 +10,85 @@ module Admin::PagePartsHelper
end end
def widget_field_options(i,local_item=nil) def widget_field_options(i,local_item=nil)
local_item = @part if local_item.nil? local_item = @part if local_item.nil? && @part
options = @module_app.widget_fields.collect{|widget_field| [I18n.t(widget_field[1]), widget_field[0]]} local_item = @page if local_item.nil? && @page
options_for_select(options, (local_item[:widget_field][i][0] if (local_item && !local_item[:widget_field].blank? && !local_item[:widget_field][i].blank?)) )
options = @module_app.widget_fields.collect do |widget_field|
label = I18n.t("#{@module_app.key}.default_widget.#{widget_field[0]}")
[label, widget_field[0]]
end
case local_item
when Page
options_for_select(options, (local_item[:frontend_field][i][0] if (local_item && !local_item[:frontend_field].blank? && !local_item[:frontend_field][i].blank?)) )
when PagePart
options_for_select(options, (local_item[:widget_field][i][0] if (local_item && !local_item[:widget_field].blank? && !local_item[:widget_field][i].blank?)) )
end
end end
def widget_fiield_type_options(i,local_item=nil) def widget_fiield_type_options(i,local_item=nil)
options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]} options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
local_item = @part if local_item.nil? local_item = @part if local_item.nil? && @part
options_for_select(options, (local_item[:widget_field][i][1] if (local_item && !local_item[:widget_field].blank? && !local_item[:widget_field][i].blank?)) ) local_item = @page if local_item.nil? && @page
case local_item
when Page
options_for_select(options, (local_item[:frontend_field][i][1] if (local_item && !local_item[:frontend_field].blank? && !local_item[:frontend_field][i].blank?)) )
when PagePart
options_for_select(options, (local_item[:widget_field][i][1] if (local_item && !local_item[:widget_field].blank? && !local_item[:widget_field][i].blank?)) )
end
end end
def tag_checked_value(part,radio_value) def tag_checked_value(part,radio_value)
part and (part[:tag] == radio_value) ? true : false if radio_value.blank?
(part.nil? || part[:tag].blank?)? true : false
else
part and (part[:tag] == radio_value.to_s) ? true : false
end
end end
def category_checked_value(part,radio_value) def category_checked_value(part,radio_value)
part and (part[:category] == radio_value) ? true : false if radio_value.blank?
(part.nil? || part[:category].blank?)? true : false
else
part and (part[:category] == radio_value.to_s) ? true : false
end
end end
def style_checked_value(part,radio_value) def style_checked_value(part,radio_value)
part and (part.widget_style == radio_value) ? true : false case part
when Page
if part.frontend_style.nil? && radio_value == "typeA"
true
else
(part.frontend_style == radio_value) ? true : false
end
when PagePart
if part.widget_style.nil? && radio_value == "typeA"
true
else
(part.widget_style == radio_value) ? true : false
end
when nil
false
end
end end
def nil_radio_button(part,tag_or_cate) def nil_radio_button(part,tag_or_cate)
field_name = case part
when PagePart
'page_part'
when Page
'page'
end
content_tag :label,:class=>"radio inline" do content_tag :label,:class=>"radio inline" do
op = radio_button("page_part", tag_or_cate, '' , :checked => eval("#{tag_or_cate}_checked_value(part,'')")) op = radio_button(field_name, tag_or_cate, '' , :checked => eval("#{tag_or_cate}_checked_value(part,'')"))
op << I18n.t("default_widget.no_value") op << I18n.t("default_widget.no_value")
end end
end end
def show_default_widget_setting_panel def show_default_widget_setting_panel
if @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget' @module_app && @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget'
true
else
false
end
end end
def show_custom_widget_setting_panel def show_custom_widget_setting_panel

View File

@ -16,7 +16,7 @@ module AdminHelper
end end
def is_admin? def is_admin?
current_or_guest_user.admin? current_or_guest_user.admin? rescue false
end end
def is_member? def is_member?

View File

@ -54,8 +54,14 @@ module ApplicationHelper
raw(formatted_messages.join) raw(formatted_messages.join)
end end
def link_back def link_back(custom_class=nil)
link_to t('back'), get_go_back, :class => 'nav' case custom_class
when nil
link_to t('back'), get_go_back, :class => 'nav'
else
link_to t('back'), get_go_back, :class => custom_class
end
end end
# Clean the link back # Clean the link back
@ -197,7 +203,6 @@ module ApplicationHelper
javascripts << "<script type='text/javascript' src='/static/jquery.js'></script>\n" javascripts << "<script type='text/javascript' src='/static/jquery.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/bootstrap.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/bootstrap.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/jquery.tinyscrollbar.min.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/jquery.tinyscrollbar.min.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/jquery.isotope.min.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-member.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/orbit-bar-member.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/orbit_bar.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n" javascripts << "<script type='text/javascript' src='/assets/orbit-bar-search.js'></script>\n"

View File

@ -49,7 +49,8 @@ module DefaultWidgetHelper
when nil when nil
eval method_entry eval method_entry
else else
eval("#{method_entry}('#{object}')" ) object = "'#{object.to_s}'" if object.class == BSON::ObjectId
eval("#{method_entry}(#{object})" )
end end
end end

View File

@ -4,7 +4,8 @@ class Item
include Mongoid::Timestamps include Mongoid::Timestamps
include Mongoid::Tree include Mongoid::Tree
include Mongoid::Tree::Ordering include Mongoid::Tree::Ordering
LIST = YAML.load(File.read('config/list.yml'))
field :name field :name
field :path field :path
field :is_published, :type => Boolean, :default => false field :is_published, :type => Boolean, :default => false
@ -15,7 +16,7 @@ class Item
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/ validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
validates :name, :exclusion => { :in => LIST[:forbidden_item_names] } # validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
validates_uniqueness_of :name, :scope => :parent_id validates_uniqueness_of :name, :scope => :parent_id
validates_presence_of :name validates_presence_of :name
validates_associated :parent, :children validates_associated :parent, :children

View File

@ -1,111 +1,130 @@
class ModuleApp class ModuleApp
include Mongoid::Document include Mongoid::Document
include Mongoid::Timestamps include Mongoid::Timestamps
include OrbitCoreLib::ObjectTokenUnility include OrbitCoreLib::ObjectTokenUtility
include OrbitApp::ModuleAppMembershipTools
field :key field :key
field :title field :title
field :version field :sidebar_order#,type: Integer
field :organization
field :author def refetch_setting!(reg)
field :intro # %w{module_label category base_url version organization author intro update_info create_date}.each do |field|
field :update_info # self[field.to_sym] = reg.send field
field :create_date # end
field :enable_frontend, type: Boolean, :default => true self[:app_pages] = reg.get_app_pages
self[:enable_frontend] = reg.get_enable_frontend
self[:get_widget_style] = reg.get_widgets
self[:using_default_widget] = !reg.get_default_widget.blank?
self[:widgets] = reg.get_widgets
end
field :app_pages ,type: Array # def app_pages
# field :widgets ,type: Array # get_registration.get_app_pages
field :widgets ,type: Hash # end
field :widget_fields ,type: Array
field :widget_options,type:Hash
field :widget_options_fields_i18n,type:Hash def enable_frontend?
field :widget_fields_link_method,type:Hash self[:enable_frontend]
field :get_default_widget,type:Hash end
def get_default_widget
raise 'Need to link with OrbitApp [type: Array]'
end
def get_widget_for_select
widgets = get_widget_style
ary = widgets.collect do |k,v|
if k == 'default_widget'
[I18n.t('widget.default_widget'),'default_widget']
else
[I18n.t(v[:label]),k]
end
end
end
# def get_widget_style
# get_registration.get_widgets
# end
def has_default_widget?
self[:widgets].has_key? 'default_widget'
end
def label
I18n.t(label_i18n)
end
def label_i18n
reg = get_registration
reg.nil? ? 'Init is not defined completely' : get_registration.get_label_i18n
end
# def needs_to_widget_option?
# if self.widget_options
# self.widget_options.has_key? widgets.first
# else
# false
# end
# end
def using_default_widget?
# !get_registration.get_default_widget.blank?
self[:get_default_widget]
end
def widget_fields
# binding.pry
# raise 'Need to link with OrbitApp [type: Array]'
get_registration.get_default_widget_fields
end
# def widgets
# # get_registration.get_widgets
# # get_registration.get_default_widget
# end
def widget_options(widget_path=nil)
get_registration.get_widget_by_path(widget_path)
# raise 'Need to link with OrbitApp [type: Hash]'
end
def widget_options_fields_i18n
raise 'Need to link with OrbitApp [type: Hash]'
end
def widget_fields_link_method
raise 'Need to link with OrbitApp [type: Hash]'
end
has_many :managers,as: :managing_app ,:class_name => "AppManager" ,:dependent => :destroy#,:foreign_key => "managing_app_id",:inverse_of => :managing_app has_many :managers,as: :managing_app ,:class_name => "AppManager" ,:dependent => :destroy#,:foreign_key => "managing_app_id",:inverse_of => :managing_app
has_many :sub_managers,as: :sub_managing_app ,:class_name => "AppManager", :dependent => :destroy#,:foreign_key => "sub_managing_app_id",:inverse_of => :sub_managing_app has_many :sub_managers,as: :sub_managing_app ,:class_name => "AppManager", :dependent => :destroy#,:foreign_key => "sub_managing_app_id",:inverse_of => :sub_managing_app
has_many :tags # # has_many :tags
has_many :page_parts has_many :page_parts
has_many :pages has_many :pages
has_one :app_auth,dependent: :delete has_one :app_auth,dependent: :delete
before_save :set_key def get_tags
get_registration.get_tags
def is_manager?(user)
managing_users.include?(user)
end
def is_sub_manager?(user)
sub_managing_users.include?(user) || is_manager?(user)
end
def managing_users
self.managers.collect{ |t| t.user }
end
def sub_managing_users
self.sub_managers.collect{ |t| t.user }
end
def assign_manager(user,assigner)
manager = AppManager.first(conditions: {managing_app_id: self.id,user_id: user.id}) rescue nil
if manager.nil?
manager = self.managers.create(:user_id => user.id,:rule_creator_id => (assigner.id rescue nil))
end
manager
end
def assign_sub_manager(user,assigner)
submanager = AppManager.first(conditions: {sub_managing_app_id: self.id,user_id: user.id}) rescue nil
if submanager.nil? && !self.managing_users.include?(user)
submanager = self.sub_managers.create(:user_id => user.id,:rule_creator_id => (assigner.id rescue nil) )
end
submanager
end
def remove_manager(user)
manager = AppManager.first(conditions: {managing_app_id: self.id,user_id: user.id}) rescue nil
if manager
manager.destroy
else
false
end
end
def remove_sub_manager(user)
submanager = AppManager.first(conditions: {sub_managing_app_id: self.id,user_id: user.id}) rescue nil
if submanager
submanager.destroy
else
false
end
end
def needs_to_widget_option?
if self.widget_options
self.widget_options.has_key? widgets.first
else
false
end
end end
def has_default_widget? def get_categories
case self[:widgets] get_registration.get_categories
when Array
false
when Hash
self[:widgets].has_key? 'default_widget'
end
end end
protected def module_name
I18n.t(get_registration.get_label_i18n)
def set_key
self.key = self.title.underscore.singularize if self.title
end end
def get_registration
OrbitApp::Module::Registration.find_by_key(key)
end
end end

View File

@ -1,5 +1,5 @@
class ObjectAuth < PrototypeAuth class ObjectAuth < PrototypeAuth
include OrbitCoreLib::ObjectTokenUnility include OrbitCoreLib::ObjectTokenUtility
validates_uniqueness_of :title ,:scope => [:obj_authable_type,:obj_authable_id] #{ |c| } validates_uniqueness_of :title ,:scope => [:obj_authable_type,:obj_authable_id] #{ |c| }
belongs_to :obj_authable, polymorphic: true belongs_to :obj_authable, polymorphic: true
after_save :check_user_has_can_access_app after_save :check_user_has_can_access_app

View File

@ -23,6 +23,15 @@ class PagePart
before_save :delete_empty_widget_field before_save :delete_empty_widget_field
after_save :update_parent after_save :update_parent
# def module_app
# if self[:module_app]
# self[:module_app]
# elsif self[:kind] == 'module_widget'
# self.page.module_app
# else
# nil
# end
# end
protected protected
@ -37,5 +46,4 @@ class PagePart
self.page.save self.page.save
end end
end end

View File

@ -0,0 +1,61 @@
class LocationUploader < CarrierWave::Uploader::Base
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
# include CarrierWave::ImageScience
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
# storage :file
# storage :s3
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"location/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
# end
# Process files as they are uploaded:
# process :scale => [200, 300]
#
# def scale(width, height)
# # do something
# end
# Create different versions of your uploaded files:
# version :thumb do
# process :scale => [50, 50]
# end
version :thumb do
process :resize_to_fill => [150, 120]
end
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
# def extension_white_list
# %w(jpg jpeg gif png)
# end
# Override the filename of the uploaded files:
# def filename
# "something.jpg" if original_filename
# end
# def manipulate!
# raise current_path.inspect
# image = ::MiniMagick::Image.open(current_path)
# image = yield(image)
# image.write(current_path)
# ::MiniMagick::Image.open(current_path)
# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
# raise CarrierWave::ProcessingError.new("Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: #{e}")
# end
end

View File

@ -1 +1 @@
<%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %> <%= f.select :module_app_id, @apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>

View File

@ -1,5 +0,0 @@
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', @module_app.app_pages) %>");
$('#app_page_frontend_style').html("<%= escape_javascript(select 'page', 'frontend_style', @module_app.widgets[@frontend_path]) if !@frontend_path.blank? %>");
$('#app_page_category').html("<%= j (select 'page', 'category', @categories.collect{|category| [category.title, category.id]}, {:include_blank => true}) if @categories %>");
$('#app_page_tag').html("<%= j (select 'page', 'tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, {:include_blank => true}) if @tags %>");
$('#app_page_frontend_field').html("<%= j render '../admin/pages/frontend_fields' %>")

View File

@ -1,12 +1,20 @@
<div class="style_switch well"> <div class="style_switch control-group">
<label><%= t("default_widget.select_widget_style") %></label> <label class="control-label">
<% if @module_app.widgets[@widget_path].blank? %> <%= t("default_widget.select_widget_style") %>
<%= t("default_widget.no_support_setting")%> </label>
<%else%> <div class="controls well">
<%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]) %> <% if @module_app.nil? || @module_app.widgets.nil? || (@module_app.widgets[@widget_path].blank? rescue true) %>
<% end %> <%= t("default_widget.no_support_setting")%>
<% if(@module_app.widget_options && @module_app.widget_options.has_key?(@widget_path)) %> <%else%>
<label><%= t("default_widget.select_widget_ext_option") %></label> <%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]["style"]) %>
<%= render :partial=> "widget_ext_options" %> <% end %>
<% end %> </div>
</div> </div>
<% if(@module_app && @module_app.widget_options(@widget_path)) %>
<div class="style_switch control-group">
<label class="control-label"><%= t("default_widget.select_widget_ext_option") %></label>
<div class="controls well" >
<%= render :partial=> "widget_ext_options" %>
</div>
</div>
<% end %>

View File

@ -1,4 +1,19 @@
<div id="widget_field" class="well clear"> <% case object%>
<% when PagePart %>
<% object_name = 'page_part' %>
<% field_name = 'widget_field' %>
<% data_count = 'widget_data_count' %>
<% when Page %>
<% object_name = 'page' %>
<% field_name = 'frontend_field' %>
<% data_count = 'frontend_data_count' %>
<% end %>
<div class="style_switch control-group">
<label class="control-label">
<%= t("default_widget.fields_") %>
</label>
<div id="widget_field" class="well clear controls">
<div class="rows clear"> <div class="rows clear">
@ -16,19 +31,24 @@
<div class="rows clear"> <div class="rows clear">
<span class="span4"> <span class="span4">
<%= i+1 %> <%= i+1 %>
<%= select_tag "page_part[widget_field][]", widget_field_options(i), :include_blank => true %> <%= select_tag "#{object_name}[#{field_name}][]", widget_field_options(i), :include_blank => true %>
</span> </span>
<span class="span3"> <span class="span3">
<%= select_tag "page_part[widget_field_type][]", widget_fiield_type_options(i), :include_blank => true %> <br /> <%= select_tag "#{object_name}[#{field_name}_type][]", widget_fiield_type_options(i), :include_blank => true %> <br />
</span> </span>
<span class="span5"></span> <span class="span5"></span>
</div> </div><br/>
<% end %> <% end %>
<br/> <br/>
<div class="rows clear"> <div class="rows clear">
<span class="span4"><%= label_tag t("default_widget.widget_data_count") %></span> <span class="span4">
<%= label_tag t("default_widget.widget_data_count") %>
</span>
</div> </div>
<div class="rows clear"> <div class="rows clear">
<span class="span4"><%= text_field_tag :widget_data_count,@part.widget_data_count %></span> <span class="span4">
<%= text_field_tag "#{object_name}[#{data_count}]",object.send(data_count) %>
</span>
</div> </div>
</div> </div>
</div>

View File

@ -1,45 +1,58 @@
<div class="style_switch well"> <% field_name='' %>
<label><%= t("default_widget.select_widget_style") %></label> <% case object %>
<% when Page %>
<% field_name = "page[frontend_style]" %>
<% when PagePart %>
<% field_name = "page_part[widget_style]" %>
<% end %>
<div class="style_switch control-group">
<label class="control-label">
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls well">
<ul class="clear"> <ul class="clear">
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :widget_style,"typeA",:checked => style_checked_value(@part,"typeA") %> <%= radio_button_tag field_name,"typeA",style_checked_value(object,"typeA") %>
1 1
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style01.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style01.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeA") %></span> <span class="style_description"><%= t("default_widget.caption.typeA") %></span>
</label>
</li> </li>
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :widget_style,"typeB_style2",:checked => style_checked_value(@part,"typeB_style2") %> <%= radio_button_tag field_name,"typeB_style2",style_checked_value(object,"typeB_style2") %>
2 2
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style02.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style02.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeA") %></span> <span class="style_description"><%= t("default_widget.caption.typeB_style2") %></span>
</label>
</li> </li>
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :widget_style,"typeB_style3",:checked => style_checked_value(@part,"typeB_style3") %> <%= radio_button_tag field_name,"typeB_style3",style_checked_value(object,"typeB_style3") %>
3 3
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style03.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style03.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeB_style3") %></span> <span class="style_description"><%= t("default_widget.caption.typeB_style3") %></span>
</label>
</li> </li>
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :widget_style,"typeB_style4",:checked => style_checked_value(@part,"typeB_style4") %> <%= radio_button_tag field_name,"typeB_style4",style_checked_value(object,"typeB_style4") %>
4 4
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style04.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style04.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeB_style4") %></span> <span class="style_description"><%= t("default_widget.caption.typeB_style4") %></span>
</label>
</li> </li>
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :widget_style,"typeC",:checked => style_checked_value(@part,"typeC") %> <%= radio_button_tag field_name,"typeC",style_checked_value(object,"typeC") %>
5 5
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style05.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style05.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeC") %></span> <span class="style_description"><%= t("default_widget.caption.typeC") %></span>
</label>
</li> </li>
</ul> </ul>
</div>
</div> </div>

View File

@ -1,10 +1,11 @@
<%= stylesheet_link_tag "admin/default_widget_setting" %> <%= stylesheet_link_tag "admin/default_widget_setting" %>
<%= form_for @part, :url => admin_page_part_path(@part) do |f| %> <%= form_for @part, :url => admin_page_part_path(@part),:html=>{:class=>"clear form-horizontal edit_page_part"} do |f| %>
<% LIST[:page_part_kinds].each do |kind| %> <% LIST[:page_part_kinds].each do |kind| %>
<%= label_tag '',:class=>'checkbox inline' do %>
<%= f.radio_button :kind, kind, :class => 'part_kind' %> <%= f.radio_button :kind, kind, :class => 'part_kind' %>
<%= t(kind, :scope => 'page_part_kinds') %> <%= t(kind, :scope => 'page_part_kinds') %>
<% end %>
<% end %> <% end %>
<% LIST[:page_part_kinds].each do |kind| %> <% LIST[:page_part_kinds].each do |kind| %>
<div id='<%= "part_#{kind}" %>' class='part_kind_partial' style="display:<%= kind.eql?(@part.kind) ? 'block' : 'none' %>"> <div id='<%= "part_#{kind}" %>' class='part_kind_partial' style="display:<%= kind.eql?(@part.kind) ? 'block' : 'none' %>">
@ -12,7 +13,9 @@
</div> </div>
<% end %> <% end %>
<p> <div class="form-actions form-fixed pagination-right">
<%= f.submit t(:update_) %> <%= link_back %> <%= f.submit t(:update_),:class=>"btn btn-primary" %>
</p> <%= link_back("btn") %>
</div>
<% end %> <% end %>

View File

@ -1,39 +1,47 @@
<div> <div>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<p> <div class="control-group">
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %> <%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}",:class=>"control-label" %>
<%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil),:size=>30 %> <div class="controls">
</p> <%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil),:size=>30 %>
<% end %> </div>
</div>
<% end %> <% end %>
<% end %>
</div> </div>
<p id="module_app_list">
<label for="age_part[module_app]"><%= t "default_widget.select_module_app" %></label> <div id="module_app_list" class="control-group">
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :title, :selected => @module_app.id), {}, {:rel => admin_page_parts_path} %> <label for="page_part[module_app]" class="control-label">
</p> <%= t "default_widget.select_module_app" %>
</label>
<div class="controls">
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@module_app.id rescue nil)), {:include_blank => true }, {:rel => admin_page_parts_path,:id=>"page_module_app_id"} %>
</div>
</div>
<p id="widget_list"> <div id="widget_list" class="control-group">
<label for="age_part[widget_path]"><%= t "default_widget.select_widget_path" %></label> <label for="page_part[widget_path]" class="control-label">
<%= f.select :widget_path, @module_app.widgets.collect{|k,v| [k.humanize, k]}, {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %> <%= t "default_widget.select_widget_path" %>
</p> </label>
<div class="controls">
<%= f.select :widget_path, @module_app ? @module_app.widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} : [], {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %>
</div>
</div>
<div id="widget_option"> <div id="widget_option">
<div id="widget_data_source_category" class="well"> <div id="widget_data_source_category" class="control-group">
<%= render :partial => 'widget_data_source_category' %> <%= render :partial => 'widget_data_source_category' ,:locals=>{:object=>@part}%>
</div> </div>
<div id="widget_data_source_tag" class="well"> <div id="widget_data_source_tag" class="control-group">
<%= render :partial => 'widget_data_source_tag' %> <%= render :partial => 'widget_data_source_tag' ,:locals=>{:object=>@part} %>
</div> </div>
</div> </div>
<div id="widget_setting"> <div id="widget_setting">
<%= render :partial => 'widget_setting' ,:locals=>{:f=>f} %> <%= render :partial => 'widget_setting' ,:locals=>{:f=>f,:object=>@part} %>
</div> </div>
<!-- <span id="widget_options">
</span> -->

View File

@ -0,0 +1,8 @@
<div class="style_switch control-group">
<label class="control-label">
<%= t(label_i18n) %>
</label>
<div class="controls well">
<%= t('default_widget.no_support_setting') %>
</div>
</div>

View File

@ -1,12 +1,22 @@
<label><%= t "default_widget.data_source.tag" %></label> <% case object %>
<% when Page %>
<% field_name = 'page' %>
<% when PagePart %>
<% field_name = 'page_part' %>
<% end %>
<label class="control-label"><%= t "default_widget.data_source.category" %></label>
<div class="well controls">
<% if @categories %> <% if @categories %>
<fieldset> <fieldset>
<%= nil_radio_button(@part,:category) %> <%= nil_radio_button(object,:category) %>
<%= content_tag_for(:label, @categories,:class=>"radio inline") do |category|%> <%= content_tag_for(:label, @categories,:class=>"radio inline") do |category|%>
<%= radio_button("page_part", "category", category.id, :checked => category_checked_value(@part,category.id) )%> <%= radio_button_tag("#{field_name}[category]", category.id, category_checked_value(object,category.id) )%>
<%= category.title%> <%= category.title%>
<% end %> <% end %>
</fieldset> </fieldset>
<% else %> <% else %>
<%= t("default_widget.no_support_setting")%> <%= t("default_widget.no_support_setting")%>
<% end %> <% end %>
</div>

View File

@ -1,12 +1,22 @@
<label><%= t "default_widget.data_source.category" %></label> <% case object %>
<% when Page %>
<% field_name = 'page' %>
<% when PagePart %>
<% field_name = 'page_part' %>
<% end %>
<label class="control-label"><%= t "default_widget.data_source.tag" %></label>
<div class="well controls">
<% if @categories %> <% if @categories %>
<fieldset> <fieldset>
<%= nil_radio_button(@part,:tag) %> <%= nil_radio_button(object,:tag) %>
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%> <%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%>
<%= radio_button("page_part", "tag", tag.id, :checked => tag_checked_value(@part,tag.id) )%> <%= radio_button_tag("#{field_name}[tag]", tag.id, tag_checked_value(object,tag.id) ) %>
<%= tag[I18n.locale]%> <%= tag[I18n.locale]%>
<% end %> <% end if @tags%>
</fieldset> </fieldset>
<% else %> <% else %>
<%= t("default_widget.no_support_setting")%> <%= t("default_widget.no_support_setting")%>
<% end %> <% end %>
</div>

View File

@ -1,5 +1,6 @@
<% @module_app.widget_options[@widget_path].each do |key,options| %> <% @module_app.widget_options(@widget_path).get_options.each do |key,settings| %>
<%= label_tag(t(@module_app.widget_options_fields_i18n[@widget_path][key]))%> <% options = settings[:opts] %>
<%= label_tag(t(settings[:label_i18n]))%>
<% case options%> <% case options%>
<% when Hash%> <% when Hash%>
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)) %> <%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)) %>

View File

@ -1,10 +1,10 @@
<% if show_default_widget_setting_panel %> <% if show_default_widget_setting_panel %>
<div id="default_widget"> <div id="default_widget">
<%= render :partial => 'default_widget_style_panel',:locals=>{:f=>f} %> <%= render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:f=>f,:object=>object} %>
<%= render :partial => 'default_widget_setting' %> <%= render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>object} %>
</div> </div>
<% elsif show_custom_widget_setting_panel %> <% elsif show_custom_widget_setting_panel %>
<div id="custom_widget"> <div id="custom_widget">
<%= render :partial => 'custom_widget_setting' %> <%= render :partial => 'admin/page_parts/custom_widget_setting',:locals=>{:object=>object} %>
</div> </div>
<% end %> <% end %>

View File

@ -1 +0,0 @@
<%= select 'page_part', 'category', @categories.collect{|category| [category.title, category.id]}, :selected => (@part ? @part[:category] : nil), :include_blank => true if @categories && @categories.size > 0 %>

View File

@ -1 +0,0 @@
<%= select 'page_part', 'tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, :selected => (@part ? @part[:tag] : nil), :include_blank => true if @tags && @tags.size > 0 %>

View File

@ -1,7 +1,7 @@
<% if show_default_widget_setting_panel %> <% if show_default_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>"); $('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel',:locals=>{:object=>@part} %>");
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting' %>"); $('#widget_setting').append("<%= j render :partial => 'default_widget_setting',:locals=>{:object=>@part} %>");
<% elsif show_custom_widget_setting_panel %> <% elsif show_custom_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>"); $('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
<% end %> <% end %>

View File

@ -1,13 +1,18 @@
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| k},@part.widget_path) %>"); <% if @module_app%>
$("#widget_data_source_category").html("<%= j render :partial => 'widget_data_source_category' %>"); $('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| [I18n.t(v['i18n']),k]},@part.widget_path) %>");
$("#widget_data_source_tag").html("<%= j render :partial => 'widget_data_source_tag' %>"); $("#widget_data_source_category").html("<%= j render :partial => 'widget_data_source_category',:locals=>{:object=>@part} %>");
$("#widget_data_source_tag").html("<%= j render :partial => 'widget_data_source_tag',:locals=>{:object=>@part} %>");
<% if !@part.widget_path.blank? %> <% if @part %>
<% if show_default_widget_setting_panel %> <% if show_default_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>"); $('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>");
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting' %>"); $('#widget_setting').append("<%= j render :partial => 'default_widget_setting',:locals=>{:object=>@part} %>");
<% elsif show_custom_widget_setting_panel %> <% elsif show_custom_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>"); $('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
<% end %>
<% end %> <% end %>
<% else %>
$('#widget_option').find("div.well.controls").html("<%= t('default_widget.no_support_setting')%>");
$('#widget_setting').html("<%=j render :partial=> 'reset',:locals=>{:label_i18n=>'default_widget.select_widget_style'}%>");
$('#widget_list select').html("<%= j options_for_select([]) %>");
<% end %> <% end %>

View File

@ -1 +1 @@
<%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %> <%= f.select :module_app_id, @apps.collect { |t| [t.module_name, t.id] }, {:include_blank => true} ,{:rel => admin_pages_path } %>

View File

@ -0,0 +1,8 @@
<div class="control-group">
<label class="control-label">
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls well">
<%= t("default_widget.no_support_setting")%>
</div>
</div>

View File

@ -2,9 +2,12 @@
<%= f.hidden_field :parent, :value => (@item.parent.id rescue nil) %> <%= f.hidden_field :parent, :value => (@item.parent.id rescue nil) %>
<div class="control-group"> <div class="control-group">
<%= f.label :name, t(:name), :class => 'control-label' %> <%= f.label :name, '*'+t(:name), :class => 'control-label' %>
<div class="controls"> <div class="controls">
<%= f.text_field :name, :class => 'text input-xlarge' %> <%= f.text_field :name, :class => 'text input-xlarge' %>
<span class="help-inline">請輸入數字或英文,不可使用空白</span>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> --> <!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div> </div>
</div> </div>
@ -35,36 +38,37 @@
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> --> <!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div> </div>
</div> </div>
<div class="control-group">
<%= f.label :name, t(:module), :class => 'control-label' %> <div class="control-group" id="module_app_list">
<%= f.label '',t("default_widget.select_module_app"), :class => 'control-label' %>
<div class="controls"> <div class="controls">
<%= render :partial => "app_selector", :locals => { :f => f } %> <%= render :partial => "app_selector", :locals => { :f => f } %>
<span id="app_page_url">
<%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%>
</span>
<span id="app_page_frontend_style">
<%= select('page','frontend_style', @frontend_style, :selected => @item[:frontend_style], :include_blank => true ) rescue ''%>
</span>
<span id="app_page_category">
<%= select('page','category', @categories.collect{|category| [category.title, category.id]}, :selected => @item[:category], :include_blank => true ) rescue ''%>
</span>
<span id="app_page_tag">
<%= select('page','tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, :selected => @item[:tag], :include_blank => true ) rescue ''%>
</span>
<span id="app_page_frontend_field">
<%= render 'frontend_fields' %>
</span>
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
</div> </div>
</div> </div>
<div class="control-group">
<%= f.label :frontend_data_count, t(:frontend_data_count), :class => 'control-label' %> <div class="control-group" id="frontend_list">
<div class="controls"> <%= f.label '', t("front_page.select_app_url"), :class => 'control-label' %>
<%= f.text_field :frontend_data_count %> <div class="controls" id="app_page_url">
<%= select('page','app_frontend_url', @app_frontend_urls || [], :selected => @item.app_frontend_url ) rescue ''%>
</div> </div>
</div> </div>
<div id="app_page_category" class="control-group">
<%= render :partial=>"admin/page_parts/widget_data_source_category",:locals=>{:object=>@item} %>
</div>
<div id="app_page_tag" class="control-group">
<%= render :partial=>"admin/page_parts/widget_data_source_tag" ,:locals=>{:object=>@item}%>
</div>
<div id="frontend_setting">
<%= render :partial => 'frontend_setting', :locals=>{:object=>@item,:f=>f} %>
</div>
<div class="control-group"> <div class="control-group">
<%= f.label :is_published, "#{t(:is_published)} ?", :class => 'control-label' %> <%= f.label :is_published, "#{t('front_page.is_published')} ?", :class => 'control-label' %>
<div class="controls"> <div class="controls">
<label class="radio"> <label class="radio">
<%= f.radio_button :is_published, true %> <%= f.radio_button :is_published, true %>
@ -78,7 +82,7 @@
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<%= f.label :menu_enabled_for, "#{t(:menu_enabled_for)}:", :class => 'control-label' %> <%= f.label :menu_enabled_for, "#{t('front_page.menu_enable_lang')}:", :class => 'control-label' %>
<div class="controls"> <div class="controls">
<% @site_valid_locales.each do |valid_locale| %> <% @site_valid_locales.each do |valid_locale| %>
<label class="checkbox"> <label class="checkbox">
@ -92,7 +96,7 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<%= f.label :enabled_for, "#{t(:enabled_for)}:", :class => 'control-label' %> <%= f.label :enabled_for, "#{t('front_page.link_enable_lang')}:", :class => 'control-label' %>
<div class="controls"> <div class="controls">
<% @site_valid_locales.each do |valid_locale| %> <% @site_valid_locales.each do |valid_locale| %>
<label class="checkbox"> <label class="checkbox">

View File

@ -0,0 +1,3 @@
<% if show_default_widget_setting_panel %>
<%= render :partial=>'admin/page_parts/widget_setting',:locals=>{:object=>object,:f=>f} %>
<% end %>

View File

@ -1,3 +1,4 @@
<%= stylesheet_link_tag "admin/default_widget_setting" %>
<% content_for :sidebar do %> <% content_for :sidebar do %>
<%= render 'admin/items/site_map_left_bar' %> <%= render 'admin/items/site_map_left_bar' %>
<% end -%> <% end -%>

View File

@ -0,0 +1,8 @@
<% if show_default_widget_setting_panel %>
// $('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@page} %>");
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@page} %>");
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@page} %>");
<% else %>
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
<% end %>

View File

@ -0,0 +1,33 @@
<% if @module_app %>
$('#app_page_category').html("<%= j render :partial => 'admin/page_parts/widget_data_source_category' ,:locals=>{:object=>@page}%>");
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@page} %>");
<% if !@module_app.app_pages.blank? %>
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', options_for_select(@app_frontend_urls, @app_frontend_urls.first)) %>");
<%else %>
$('#app_page_url').html("<%= t('default_widget.no_support_setting')%>");
<% end %>
<% if @app_frontend_urls.first =='default_widget' %>
$('#app_page_frontend_style').html("<%= escape_javascript(select 'page', 'frontend_style', @module_app.widgets[@frontend_path]) if !@frontend_path.blank? %>");
<% else %>
$('#app_page_frontend_style').html("<%= t('default_widget.no_support_setting')%>");
<% end %>
<% if show_default_widget_setting_panel %>
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@page} %>");
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@page} %>");
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@page} %>");
<% else %>
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
<% end %>
<% else %>
$('#app_page_url').html("<%= t('default_widget.no_support_setting')%>");
$('#app_page_category').find("div.well.controls").html("<%= t('default_widget.no_support_setting')%>");
$('#app_page_tag').find("div.well.controls").html("<%= t('default_widget.no_support_setting')%>");
$('#app_page_url').html("<%= t('default_widget.no_support_setting')%>");
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
<% end %>

View File

@ -5,7 +5,6 @@
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%= stylesheet_link_tag "member" %>
<%= stylesheet_link_tag "site-map" %> <%= stylesheet_link_tag "site-map" %>
<%= stylesheet_link_tag "isotope" %>
<% end -%> <% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>

View File

@ -5,7 +5,6 @@
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%= stylesheet_link_tag "member" %>
<%= stylesheet_link_tag "site-map" %> <%= stylesheet_link_tag "site-map" %>
<%= stylesheet_link_tag "isotope" %>
<% end -%> <% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>

View File

@ -5,7 +5,6 @@
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
<%= stylesheet_link_tag "member" %> <%= stylesheet_link_tag "member" %>
<%= stylesheet_link_tag "site-map" %> <%= stylesheet_link_tag "site-map" %>
<%= stylesheet_link_tag "isotope" %>
<% end -%> <% end -%>
<% content_for :page_specific_javascript do -%> <% content_for :page_specific_javascript do -%>
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>

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='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='initializeSeminar' href="<%= desktop_publications_seminar_p_path %>" class="widget_fn wh3 hh3" id='d_seminar_p' custom-load="seminar" onclick="return false;"><span class="widget_icon"><img src="" alt="Seminar Papers" id="seminar_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='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> <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>
@ -103,3 +103,4 @@
o.notify("Welcome "+o.currentUsername+"!!","alert",3); o.notify("Welcome "+o.currentUsername+"!!","alert",3);
</script> </script>
<%= javascript_include_tag "personal_journal" %> <%= javascript_include_tag "personal_journal" %>
<%= javascript_include_tag "personal_conference" %>

View File

@ -41,10 +41,10 @@
<div class="overview"> <div class="overview">
<div class="s_grid_con s_form"> <div class="s_grid_con s_form">
<ul> <ul>
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Seminar Title</textarea></li> <li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Conference Title</textarea></li>
<li class="s_grid_row"> <li class="s_grid_row">
<label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li> <label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li>
<li class="s_grid_row"><label>Seminar time</label></li> <li class="s_grid_row"><label>Conference time</label></li>
<li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1"> <li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1">
<option value=""></option> <option value=""></option>
@ -104,4 +104,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -41,10 +41,10 @@
<div class="overview"> <div class="overview">
<div class="s_grid_con s_form"> <div class="s_grid_con s_form">
<ul> <ul>
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Seminar Title</textarea></li> <li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Conference Title</textarea></li>
<li class="s_grid_row"> <li class="s_grid_row">
<label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li> <label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li>
<li class="s_grid_row"><label>Seminar time</label></li> <li class="s_grid_row"><label>Conference time</label></li>
<li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1"> <li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1">
<option value=""></option> <option value=""></option>
@ -104,4 +104,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -41,10 +41,10 @@
<div class="overview"> <div class="overview">
<div class="s_grid_con s_form"> <div class="s_grid_con s_form">
<ul> <ul>
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Seminar Title</textarea></li> <li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Conference Title</textarea></li>
<li class="s_grid_row"> <li class="s_grid_row">
<label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li> <label>Paper type</label><input type="radio" name="" value="Books" />Oral<input type="radio" name="" value="Chapter" />Poster</li>
<li class="s_grid_row"><label>Seminar time</label></li> <li class="s_grid_row"><label>Conference time</label></li>
<li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1"> <li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1">
<option value=""></option> <option value=""></option>
@ -104,4 +104,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,33 +0,0 @@
<div id="seminar_p">
<div id="content">
<div id="header" class="hh3">
<div class="dtitle w2 hh3 hp">
<span class="thmtxth">Seminar</span>
</div>
<div id="search_app" class="hfn w2 hh2 hp thmc3">
<input type="text" class="ini_input form" value="Search" id="searchbox" />
<input type="submit" class="ini_input submit thmc1" value="Submit"/>
</div>
</div>
<div id="holder">
<div id="panel_l" class="ph">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="<%= desktop_publications_seminar_p_list_path %>" callback-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_publications_seminar_p_add_path %>" callback-method="addseminar" custom-load="add" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= desktop_publications_seminar_p_add_path %>" callback-method="seminar" class="admtxt hh2 w2 hp" onclick='return false;'>Seminar</a></li>
<li><a href="<%= desktop_publications_seminar_p_list_path %>" callback-method="rues" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Analysis</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Import</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Export</a></li>
</ul>
</div>
</div>
<div id="panel_r" container="true" class="ph pw admbg hp">
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>

View File

@ -10,25 +10,19 @@
</div> </div>
<ul class="nav"> <ul class="nav">
<li><a href="<%= root_path %>" data-icons="&#xe022;"></a></li> <li><a href="<%= root_path %>" data-icons="&#xe022;"></a></li>
<!-- <li><a href="<%= desktop_path %>" data-icons="&#xe060;"></a></li> --> <li><a href="<%= desktop_path %>" data-icons="&#xe060;"></a></li>
</ul> </ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
<!--
<li class="dropdown"> <li class="dropdown">
<a class="dropdown-toggle" data-icons="&#xe02d;" href="#" data-toggle="dropdown"></a> <a class="dropdown-toggle" data-icons="&#xe02d;" href="#" data-toggle="dropdown"></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<% t('ntu.site_names').each do |site| %> <% #t('ntu.site_names').each do |site| %>
<li><%= link_to site[1], get_link(site[0]) %></li> <li><%#= link_to site[1], get_link(site[0]) %></li>
<% end %> <%# end %>
</ul> </ul>
</li> </li>
<li class="dropdown language"> -->
<a class="dropdown-toggle" href="#" data-toggle="dropdown" data-icons="&#xe054;"></a>
<ul class="dropdown-menu language-menu">
<% @site_in_use_locales.each do |locale| %>
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
<% end %>
</ul>
</li>
<li class="search clear" title="<%= t :search_google %>"> <li class="search clear" title="<%= t :search_google %>">
<a class="orbit-bar-search" href="#" data-icons="&#xe024;"></a> <a class="orbit-bar-search" href="#" data-icons="&#xe024;"></a>
<form class="navbar-search" method="get" action="http://www.google.com/custom"> <form class="navbar-search" method="get" action="http://www.google.com/custom">
@ -41,6 +35,14 @@
<%= text_field_tag 'q','',{:class => "search-query span3",:placeholder=> t(:search_google) ,:disabled=> ((@site.search["sitesearch"] || @site.search["domains"] ).blank? rescue true)}%> <%= text_field_tag 'q','',{:class => "search-query span3",:placeholder=> t(:search_google) ,:disabled=> ((@site.search["sitesearch"] || @site.search["domains"] ).blank? rescue true)}%>
</form> </form>
</li> </li>
<li class="dropdown language">
<a class="dropdown-toggle orbit-bar-language" href="#" data-toggle="dropdown" data-icons="&#xe054;"></a>
<ul class="dropdown-menu language-menu">
<% @site_in_use_locales.each do |locale| %>
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
<% end %>
</ul>
</li>
<% if user_signed_in? %> <% if user_signed_in? %>
<li class="dropdown active"> <li class="dropdown active">
<a class="orbit-bar-account" href="#" data-toggle="dropdown"> <a class="orbit-bar-account" href="#" data-toggle="dropdown">

View File

@ -13,7 +13,8 @@
<div class="viewport"> <div class="viewport">
<div class="overview"> <div class="overview">
<ul class="nav nav-list"> <ul class="nav nav-list">
<%= render ((local_assigns.has_key? :side_bar_content) ? side_bar_content : 'layouts/side_bar_content') %> <%= render :partial=> 'layouts/side_bar_content'%>
<%#= render ((local_assigns.has_key? :side_bar_content) ? side_bar_content : 'layouts/side_bar_content') %>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -1,78 +1,15 @@
<%#= content_tag :li, :class => active_for_controllers('purchases') do -%>
<%#= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %>
<%# end -%>
<% content_for :page_specific_javascript do %> <% content_for :page_specific_javascript do %>
<%= javascript_include_tag "/static/kernel.js" %> <%= javascript_include_tag "/static/kernel.js" %>
<% end %> <% end %>
<%= content_tag :li, :class => (active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals') || active_for_app_auth('Announcement') || active_for_ob_auths_object("BulletinCategory") ) do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-megaphone') + content_tag(:span, t('announcement.announcement')), panel_announcement_back_end_bulletins_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')||active_for_ob_auths_object("BulletinCategory"))) do -%>
<%= content_tag :li, link_to((t('announcement.all_articles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_bulletins_path), :class => active_for_action('bulletins', 'index')if (is_manager? rescue nil) %>
<%= content_tag :li, link_to((t('announcement.add_new') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_announcement_back_end_bulletin_path), :class => active_for_action('bulletins', 'new') if (is_manager? rescue nil) %>
<%= content_tag :li, link_to((t('announcement.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_bulletin_categorys_path), :class =>( active_for_action('bulletin_categorys', 'index') || active_for_ob_auths_object("BulletinCategory") )if (is_manager? rescue nil) %>
<%= content_tag :li, link_to((t('announcement.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_tags_path), :class => active_for_action('/panel/announcement/back_end/tags', 'index')if (is_manager? rescue nil) %>
<%= content_tag :li, link_to((t('announcement.bulletin.approval_setting') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_announcement_back_end_approval_setting_path), :class => active_for_action('approvals', 'setting') if (is_manager? rescue nil) %>
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "announcement"}))), :class => active_for_app_auth('Announcement') if (is_admin? rescue nil) %>
<% end -%> <%OrbitApp::Module::SideBarRegisition.all.each do |t| %>
<%= t.render(request,params,current_user,@module_app) %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('page_contexts') || active_for_app_auth('page_content') || active_for_ob_auths_object("PageContext") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-newspaper') + content_tag(:span, t(:page)), panel_page_content_back_end_page_contexts_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('page_contexts')) do -%>
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "page_content"}))), :class => active_for_app_auth('page_content') if (is_admin? rescue nil) %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('ad_banners', 'ad_images') ||active_for_ob_auths_object("AdBanner") ||active_for_app_auth('ad_banner') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-landscape') + content_tag(:span, t(:ad_banner)), admin_ad_banners_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('ad_banners', 'ad_images') ) do -%>
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "ad_banner"}))), :class => active_for_app_auth('ad_banners') if (is_admin? rescue nil) %>
<% end -%>
<% end %>
<%= content_tag :li, :class => active_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys') || active_for_app_auth('web_resource') || active_for_ob_auths_object("WebLinkCategory") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-link') + content_tag(:span, t(:link)), panel_web_resource_back_end_web_links_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys')) do -%>
<%= content_tag :li, link_to((t(:list_) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_web_resource_back_end_web_links_path), :class => active_for_action('web_links', 'index')if (is_manager? rescue nil) %>
<%= content_tag :li, link_to((t(:link) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_links', 'new') if (is_manager? rescue nil)%>
<%= content_tag :li, link_to((t(:categories) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_web_resource_back_end_web_link_categorys_path), :class => (active_for_action('web_link_categorys', 'index') || active_for_ob_auths_object("WebLinkCategory")) if (is_manager? rescue nil)%>
<%= content_tag :li, link_to((t(:tags) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') if (is_manager? rescue nil)%>
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "web_resource"}))), :class => active_for_app_auth('web_resource') if (is_admin? rescue nil) %>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('albums','album_images','gallery_categories','/panel/gallery/back_end/tags') || active_for_app_auth("gallery") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-pictures') + content_tag(:span, t("gallery.gallery")), panel_gallery_back_end_albums_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('albums') ) do -%>
<%= content_tag(:li, link_to((t('gallery.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_gallery_categories_path), :class => active_for_action('gallery_categories','index') )if (is_manager? rescue nil)%>
<%= content_tag :li, link_to((t('gallery.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_gallery_back_end_tags_path), :class => active_for_action('/panel/gallery/back_end/tags', 'index') if (is_manager? rescue nil) %>
<%= content_tag :li, link_to((t(:module_authorization) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "gallery"}))), :class => active_for_app_auth('gallery') if (is_admin? rescue nil) %>
<% end -%>
<% end %>
<%= content_tag :li, :class => active_for_controllers('archive_files', 'panel/archive/back_end/tags', 'archive_file_categorys') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-archive') + content_tag(:span, t(:archive)), panel_archive_back_end_archive_files_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('archive_files', 'tags', 'archive_file_categorys')) do -%>
<%= content_tag :li, link_to((t(:all) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_files_path), :class => active_for_action('archive_file', 'index')if (is_manager? rescue nil) %>
<%= content_tag :li, link_to((t(:add) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_archive_back_end_archive_file_path), :class => active_for_action('archive_file', 'new') if (is_admin? rescue nil)%>
<%= content_tag(:li, link_to((t(:categories) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_file_categorys_path), :class => active_for_action('archive_file_categorys', 'index'))if (is_manager? rescue nil)%>
<%= content_tag :li, link_to((t(:tags) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_tags_path), :class => active_for_action('tags', 'index') if (is_manager? rescue nil)%>
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('cals','panel/calendar/back_end/tags') || active_for_app_auth("calendar") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-calendar') + content_tag(:span, t("calendar.calendar")), panel_calendar_back_end_cals_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('cals','calendar_categories') ) do -%>
<%= content_tag :li, link_to((t('calendar.calendars') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_calendar_back_end_cal_path), :class => active_for_action('cals','new') if (is_manager? rescue nil)%>
<%= content_tag :li, link_to(t(:tags), panel_calendar_back_end_tags_path), :class => active_for_action('/panel/calendar/back_end/tags', 'index')if (is_manager? rescue nil) %>
<% end -%>
<% end %>
<%= content_tag :li, :class => active_for_controllers('locations') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-location') + content_tag(:span, t(:location)), panel_location_back_end_locations_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('locations') ) do -%>
<% end -%>
<% end %> <% end %>
<div class="content"> <div class="content">

View File

@ -20,6 +20,7 @@
<% else %> <% else %>
<%= render 'layouts/side_bar' %> <%= render 'layouts/side_bar' %>
<% end %> <% end %>
<div id="main-wrap"> <div id="main-wrap">
<%= yield %> <%= yield %>
</div> </div>

View File

@ -2,5 +2,5 @@
<%= render 'header_dialog_copyright' %> <%= render 'header_dialog_copyright' %>
<% end %> <% end %>
<p>本網站著作權屬於國立政治大學。</p> <p><%= t('mobile.copytight') %></p>
<p>RulingDigital 銳綸數位建置</p> <p><%= t('mobile.copytight_orbit') %></p>

View File

@ -23,4 +23,5 @@
<script type='text/javascript'> <script type='text/javascript'>
var $effect = "<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>" var $effect = "<%= @ad_banner.ad_fx.nil? ? 'fade': @ad_banner.ad_fx %>"
var $timeout = "<%= @ad_banner.transition_msec %>" var $timeout = "<%= @ad_banner.transition_msec %>"
var $info = "<%= t('mobile.location_description').html_safe %>"
</script> </script>

View File

@ -2,4 +2,9 @@
<%= render 'header_map' %> <%= render 'header_map' %>
<% end %> <% end %>
<div id='map_canvas'></div> <div id='map_canvas'></div>
<script type='text/javascript'>
var $map_center = "24.987449, 121.576117"
var $map_zoom = 17
</script>

View File

@ -70,3 +70,10 @@ widget_field_type:
- tag - tag
- viewcount - viewcount
- poster - poster
default_widget_style:
- style1
- style2
- style3
- style4
- style5

View File

@ -4,8 +4,10 @@ en:
bulletin: Bulletin bulletin: Bulletin
contact: Contact contact: Contact
copyright: Copyright copyright: Copyright
copyright_text: National Chengchi University © All RIGHTS RESERVED.
copyright_orbit: Developed by RulingDigital
home: Home home: Home
language: Language language: Language
location: Location location: Location
location_description: '<h3>國立政治大學</h3>11605 臺北市文山區指南路二段64號' location_description: '<h3>National Chengchi University</h3>NO.64,Sec.2,ZhiNan Rd.,Wenshan District,Taipei City 11605,Taiwan (R.O.C)'
page: Page page: Page

View File

@ -4,6 +4,8 @@ zh_tw:
bulletin: 公告 bulletin: 公告
contact: 聯絡資訊 contact: 聯絡資訊
copyright: 版權宣告 copyright: 版權宣告
copyright_text: 本網站著作權屬於國立政治大學。
copyright_orbit: 銳綸數位建置
home: 首頁 home: 首頁
language: 語言 language: 語言
location: 地理位置 location: 地理位置

View File

@ -1,7 +1,16 @@
zh_tw: zh_tw:
_locale: 中文 _locale: 中文
rulingcom:
errors:
init:
app_page_noname: 未命名前台頁面
module_app_noname: 未命名模組
front_page:
select_app_url: 模組前台樣式
is_published: 是否公開
menu_enable_lang: 選單啓用語系
link_enable_lang: 連結生效語系
access: access:
denied: denied:
app: app:
@ -14,27 +23,18 @@ zh_tw:
academic_info: 學術資訊 academic_info: 學術資訊
action: 操作 action: 操作
ad: ad:
chinese_1: 在套圖中出現次數 1次請輸入1
chinese_2: 輸入連結
chinese_3: 輸入標題
ab_fx: 轉場效果 ab_fx: 轉場效果
add_link: Add a reference link
banner_best_size: 輪播圖片尺寸 banner_best_size: 輪播圖片尺寸
best_size: 最佳尺寸 best_size: 最佳尺寸
best_size_example: "Ex: 500px x 300px"
new_image: 新增輪播圖片 new_image: 新增輪播圖片
not_showing: 沒有顯示 not_showing: 沒有顯示
picture_list: 圖片列表 picture_list: 圖片列表
sec_place_holder: 每張輪播圖片顯示秒數(3秒就請輸入3) sec_place_holder: 每張輪播圖片顯示秒數(3秒就請輸入3)
select_fx: Select the effect type
set_dates: Set the image to start and end dates
set_range: Set the range time
showing: 顯示中 showing: 顯示中
success_destroy_ad_image: 刪除圖片成功 success_destroy_ad_image: 刪除圖片成功
trans_unit_sec: trans_unit_sec:
transition_sec: 轉場單位時間 transition_sec: 轉場單位時間
update_banner: 更新輪播 update_banner: 更新輪播
upload_pictures: Upload pictures
widget_info_for_ad_image_size: "此區塊圖片尺寸使用: %{best_size}" widget_info_for_ad_image_size: "此區塊圖片尺寸使用: %{best_size}"
ad_banner: 廣告輪播 ad_banner: 廣告輪播
add: 新增 add: 新增
@ -53,7 +53,6 @@ zh_tw:
addthis_tools: addthis_tools:
add_to_bookmark: 加入書籤 add_to_bookmark: 加入書籤
admin: 管理員 admin: 管理員
all: All
all_content: 所有內容 all_content: 所有內容
all_file: 所有檔案 all_file: 所有檔案
all_member: 成員列表 all_member: 成員列表
@ -76,7 +75,6 @@ zh_tw:
fail: 刪除次管理員失敗 fail: 刪除次管理員失敗
success: 刪除次管理員成功 success: 刪除次管理員成功
failed_no_user: 失敗,不是使用者 failed_no_user: 失敗,不是使用者
operation_not_permitted: Operation not permitted
approval: approval:
not_pass: 拒絕 not_pass: 拒絕
not_pass_reason: 拒絕原因 not_pass_reason: 拒絕原因
@ -85,9 +83,7 @@ zh_tw:
stat: 審核狀態 stat: 審核狀態
user_list: 使用者列表 user_list: 使用者列表
approval_: 審核 approval_: 審核
archive: Archive
asset: 資產 asset: 資產
attributes: 屬性
auth: auth:
add_manager: 新增管理員 add_manager: 新增管理員
add_sub_manager: 新增次管理員 add_sub_manager: 新增次管理員
@ -101,8 +97,6 @@ zh_tw:
back: 回上一步 back: 回上一步
basic: 基本 basic: 基本
browse: 瀏覽 browse: 瀏覽
built_in: Built-in
calendar: Calendar
cancel: 取消 cancel: 取消
cant_delete_self: 不可以刪除自己 cant_delete_self: 不可以刪除自己
cant_empty_star: 不能為空白 (*) cant_empty_star: 不能為空白 (*)
@ -111,9 +105,7 @@ zh_tw:
category: 類別 category: 類別
category_auth: 類別授權 category_auth: 類別授權
clear: 清除 clear: 清除
close: Close
content: 內容 content: 內容
courses: 開課數
create: create:
error: error:
link: 建立連結時出錯 link: 建立連結時出錯
@ -121,8 +113,6 @@ zh_tw:
fail: 建立失敗 fail: 建立失敗
success: success:
asset_category: 資產類別已成功建立 asset_category: 資產類別已成功建立
co_author: Co-author was successfully created.
link: Link was successfully created.
link: 連結已成功建立 link: 連結已成功建立
page: 頁面已成功建立 page: 頁面已成功建立
user: 使用者已成功建立 user: 使用者已成功建立
@ -145,21 +135,25 @@ zh_tw:
dashboard: dashboard:
bulletin: 公告 bulletin: 公告
news_bulletin: 新聞 news_bulletin: 新聞
page_context: 頁面 page_context: 頁面內容
web_link: 鏈接 web_link: 連結
dashboard_: 儀表版 dashboard_: 儀表版
deadline: 最後期限 deadline: 最後期限
default: Default default: Default
default_css: 預設樣式表 default_css: 預設樣式表
delete: 刪除
delete_file: 刪除檔案
default_widget: default_widget:
name: 預設樣式
no_support_setting: 沒有可以使用的設定 no_support_setting: 沒有可以使用的設定
no_value: 不設定(全部) no_value: 不設定(全部)
fields_: 前台輸出欄位
fields_order: 輸出欄位順序 fields_order: 輸出欄位順序
fields_style: 輸出欄位樣式 fields_style: 輸出欄位樣式
select_module_app: 外掛模組選擇 select_module_app: 套用模組
select_widget_path: 外掛樣版選擇 select_widget_path: 外掛樣版選擇
select_widget_style: 排版樣式 select_widget_style: 排版樣式
widget_data_count: 模組輸出則數 widget_data_count: 顯示則數
select_widget_ext_option: 模組延伸選項 select_widget_ext_option: 模組延伸選項
caption: caption:
typeA: 表格式排版,簡單明瞭呈現內容 typeA: 表格式排版,簡單明瞭呈現內容
@ -178,7 +172,6 @@ zh_tw:
description: 描述 description: 描述
desktop: 桌面 desktop: 桌面
disable: 關閉 disable: 關閉
disabled: Disabled
dots: ●●●●●● dots: ●●●●●●
download: 下載 download: 下載
downloaded: 已下載 downloaded: 已下載
@ -202,7 +195,6 @@ zh_tw:
upload: 上傳檔案 upload: 上傳檔案
file_: 檔案 file_: 檔案
file_type: 檔案類型 file_type: 檔案類型
followers: Followers
forgot_password: 忘記密碼? forgot_password: 忘記密碼?
frequency: 頻率 frequency: 頻率
frontend_data_count: Frontend data count frontend_data_count: Frontend data count
@ -238,16 +230,25 @@ zh_tw:
user: 使用者列表 user: 使用者列表
list_: 列表 list_: 列表
list_lower: 列表 list_lower: 列表
address_modal:
default_title: 地址
street_address: 街道地址
city: 城市
county: 縣市
zip: 郵遞區號
country: 國家/地區
langs:
zh_tw: 中文
en: 英文
lists: lists:
markups: markups:
address: 地址欄位
text_field: 文字輸入框 text_field: 文字輸入框
select: 下拉選單 select: 下拉選單
date: 日期 date: 日期
text_area: 文字輸入方塊 text_area: 文字輸入方塊
radio_button: 單選 radio_button: 單選
checkbox: 多選 checkbox: 多選
locale: Locale
location: Location
login: 登入 login: 登入
logout: 登出 logout: 登出
mail: mail:
@ -265,22 +266,24 @@ zh_tw:
markup: 輸入模式 markup: 輸入模式
markup_options: Markup options markup_options: Markup options
markup_value: Markup value markup_value: Markup value
me: Me me:
member: 成員 member: 成員
member_authorization: 成員權限 member_authorization: 成員權限
member_info: 基本資料表 member_info: 基本資料表
member_registration: 註冊審核 member_registration: 註冊審核
member_role: 身份欄位 member_role: 身份欄位
menu_enabled_for: 選單啟用 menu_enabled_for: 選單啟用
module: Module modal:
close: 關閉
preview: 預覽
module: 模組
module_authorization: 模組授權 module_authorization: 模組授權
more_plus: 更多+ more_plus: 更多+
most_visited_page: 最多瀏覽頁面 most_visited_page: 最多瀏覽頁面
multilingual: 多語系 multilingual: 多語系
name: 名稱 name: 名稱
need_home: You need a home page nccu_c:
neutral_title: Neutral title nccu_ldap_uid: 政治大學LDAP帳號
neutral_for: Neutral for
new: new:
asset: 新增資產 asset: 新增資產
banner: 新增橫幅 banner: 新增橫幅
@ -321,8 +324,6 @@ zh_tw:
postdate: 張貼日期 postdate: 張貼日期
posted_by: 張貼人 posted_by: 張貼人
preview: 預覽 preview: 預覽
profile: Profile
publications: Publications
purchase: 購買 purchase: 購買
quantity: 數量 quantity: 數量
quick_edit: 快速編輯 quick_edit: 快速編輯
@ -345,15 +346,12 @@ zh_tw:
sitesearch: 全站搜尋 sitesearch: 全站搜尋
too_many: "搜尋有關 ' %{search_word} '尋找到超過 %{exceed_num} 筆資料,請嘗試加入更多關鍵字縮小搜尋範圍,以作更精確的搜尋?" too_many: "搜尋有關 ' %{search_word} '尋找到超過 %{exceed_num} 筆資料,請嘗試加入更多關鍵字縮小搜尋範圍,以作更精確的搜尋?"
unit_get: "列出由 :%{unit_name}發佈的資料,共有%{item_num}筆" unit_get: "列出由 :%{unit_name}發佈的資料,共有%{item_num}筆"
search_: Search
search_google: 搜尋Google search_google: 搜尋Google
search_nccu: 搜尋政治大學
setup_member: 會員設定 setup_member: 會員設定
show: 顯示 show: 顯示
show_mode:
index: 清單
summary: 摘要
thumbnail: 縮圖
site: site:
default_image: 預設圖像
description: 網站描述 description: 網站描述
description_help: '' description_help: ''
footer: 網站頁尾 footer: 網站頁尾
@ -374,7 +372,6 @@ zh_tw:
site_info: 網站資訊 site_info: 網站資訊
sitemap: 網站地圖 sitemap: 網站地圖
site_name: 網站名稱 site_name: 網站名稱
size: Size
start: 開始 start: 開始
start_date: 開始日期 start_date: 開始日期
statistics: 統計資訊 statistics: 統計資訊
@ -394,14 +391,13 @@ zh_tw:
module_page_lang_not_support: "很抱歉,此頁面沒有開放中文版本" module_page_lang_not_support: "很抱歉,此頁面沒有開放中文版本"
not_previewable: "不支援預覽" not_previewable: "不支援預覽"
preview_only_for_img: "預覽僅支援jpg,png,gif,bmp等圖片格式" preview_only_for_img: "預覽僅支援jpg,png,gif,bmp等圖片格式"
sys_basic_form: 系統基本資料表
system_info: 系統資訊 system_info: 系統資訊
tag_cloud: 標籤雲 tag_cloud: 標籤雲
tags: 標籤 tags: 標籤
template: 樣版 template: 樣版
template_name: 樣版名稱 template_name: 樣版名稱
text: 內文 text: 內文
theme: 主題 theme: 套用頁面樣式
themes: 主題 themes: 主題
title: 標題 title: 標題
to_search: 加入搜尋條件 to_search: 加入搜尋條件
@ -410,17 +406,17 @@ zh_tw:
traffic: 流量 traffic: 流量
type: 欄位類型 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: 最新版本
update: update:
error: error:
link: 更新連接時出錯 link: 更新連接時出錯
fail: 更新消息 fail: 更新消息
success: success:
co_author: Co-author was successfully updated.
content: 內容已更新成功 content: 內容已更新成功
link: 連結已更新成功 link: 連結已更新成功
page: 頁面已更新成功 page: 頁面已更新成功
user: 使用者已更新成功
# success_: 更新成功
paper: Paper was successfully updated. paper: Paper was successfully updated.
user: User was successfully updated. user: User was successfully updated.
success_: S使用者已更新成功 success_: S使用者已更新成功
@ -439,3 +435,571 @@ zh_tw:
visitors_today: 今日造訪人次 visitors_today: 今日造訪人次
yes_: "是" yes_: "是"
nccu:
date: 起迄日期
file: 附加檔案
file_description: 檔案描述
file_name: 檔案名稱
link_name: 連結名稱
picture: 刊頭圖片
selected_file: 選擇檔案
tags: 頁籤
url: 連結位置
# : <<<<<<< HEAD
# : =======
errors:
at_least_one: 必須至少有一個值
admin:
infos:
add_attribute_field: 新增
save: 儲存
initial: 起始值
markup: 輸入模式
item_name: 資料表名稱
name: 名稱
options: 選項
:cross_lang: 跨語言輸入
add_more: 使用者可自行延伸欄位
add: 新增
placeholder: 輸入協助
type: 類型
placeholder: 提示內容
list: 自定選單
is_range:
not_range:
date:
claendar: 紀年法
range: 本欄為時間區段
format: 格式
tw_claendar: 民國
minguo_calendar:
after: 民國
before: 民前
first_year: 民國元年
year:
month:
west_claendar: 西元
access:
denied:
app:
not_sub_manager: 拒絕存取因你不是此應用程式次管理員
not_manager: 拒絕存取因你不是此應用程式管理員
not_authed_user: 拒絕存取因你不是此應用程式授權使用者
not_admin: 拒絕存取因你不是此應用程式次管理員
object: 拒絕存取因你不是網站管理者
action: 操作
ad_banner: 廣告輪播
orbit_gallery: 活動花絮
ad:
sec_place_holder: 3秒請輸入3
ab_fx: 轉場特效
all_banners: 輪播清單
banner_best_size: Banner 尺寸
best_size: 最佳尺寸
cate_auth: 分類授權
delete_banner: 刪除整組輪播
new_banner: 新增輪播
new_image: 新增橫幅
showing: 顯示中
not_showing: 沒有顯示
picture_list: 圖片列表
title: 標題
transition_sec: 轉場單位時間
trans_unit_sec:
update_banner: 更新輪播
widget_info_for_ad_image_size: "此區塊圖片尺寸請使用 %{best_size}"
add: 新增
add_item: 新增項目
add_language: 新增語言
add_drop_down_item: 增加Orbit選單
admin: 網站管理者
all_articles: 列表
always_display_title: 永遠顯示於標題列
announcement: 公告管理
asset: 資產
assets:
file: 檔案
album: 相簿
video: 影片
book: 書籍
attributes: 屬性
author: 作者
calendar: 行事曆
cant_delete_self: 您不可以刪除自己。
cant_revoke_self_admin: 您不可以撤銷自己的管理身份。
category: 類別
choose_file: 請選擇一個文件...
class: 階級
content: 內容
contenteditable:
update_done: 更新完成
update_failed: 更新失敗
create_error_link: 新增連接時出錯。
create_error_page: 新增頁面時出錯。
create_success_home: 首頁已成功新增。
create_success_layout: 樣板已成功新增。
create_success_link: 連結已成功新增。
create_success_page: 頁面已成功新增。
create_success_home: 首頁已成功新增。
create_success_layout: 佈局已成功新增。
create_success_link: 連結已成功新增。
create_success_page: 頁面已成功新增。
create_success_snippet: 片段已成功新增。
create_success_user: 用戶已成功新增。。
dashboard: 儀表板
data: 選擇檔案
delete_language: 刪除語言
description: 描述
design: 版型管理
disable_language: 禁用語言
edit: 編輯
editing_home: 編輯首頁
editing_layout: 編輯樣板
editing_link: 編輯連結
editing_page: 編輯頁面
editing_snippet: 編輯片段
editing_info: 編輯用戶資料
editing_role: 編輯用戶身份
email: Email
enable_language: 啟用語言
enabled_for: 啟用
file_name: 檔名
file_size: 檔案大小
file_upload: 文件上載
format: 格式
home: 首頁
id: ID
info: 資料
intro: 簡介
is_published: 被出版
item: 網站架構
key: 關鍵
keywords: 關鍵字
language: 語言
layout: 佈局
layout_name: 佈局名字
link: 連結管理
links: 網路資源
list_assets: 資產列表
list_designs: 設計列表
list_items: 項目列表
list_puchases: 購買清單
list_snippets: 斷片列表
list_users: 使用列表
list_infos: 用戶資料列表
list_roles: 用戶身份列表
mail_address: 郵件地址
mail_port: 傳輸埠
mail_domain: 網域名稱
mail_authentication: 認證
mail_user_name: 帳號
mail_password: 密碼
mail_tls: TLS
mail_enable_starttls_auto: Enable Start TLS Auto
member: 會員
menu_enabled_for: 選單啟用
module:
authorization: 模組授權
move_down: 往下移
move_up: 往上移
multilingual: 多種語言
my_avatar: 我的頭像
no_home_page: 您沒有首頁
no_layout: 您沒有佈局
name: 名稱
new_admin:
side_bar:
all_user: 所有使用者
add_user: 新增使用者
user_roles: 角色
user_info: 使用者資訊
user: 會員
users:
all_plugin_summary: 全部
profile: 基本資料
roles:
staff: 職員資料
student: 學生資料
teacher: 教師資料
action:
add: 新增
edit: 編輯
delete: 刪除
quick_edit: 快速編輯
next: 下一頁
prev: 上一頁
attributes:
roles: 角色
name: 名稱
publications: 出版數
courses: 開課數
followers: 被關注數
show_mode:
index: 清單
summary: 摘要
thumbnail: 縮圖
table_header:
status: 狀態
category: 分類
tags: 標籤
clear_filter: 重置
new_asset: 新增資產
new_component: 新增元件
new_design: 新設計
new_home: 新增首頁
new_layout: 新增樣板
new_link: 新增連結
new_page: 新增頁面
new_snippet: 新增片段
new_user: 新增使用
new_info: 新增用戶資料
new_role: 新增用戶身份
news: 新聞
non_multilingual:
object_auth:
list_title_of_users: 授權清單-%{auth_title}
update_done: 更新完成,結果顯示於清單
update_failed: 更新失敗
options: 選項
orig_upload_file: 原上傳檔名
page: 頁面管理
page_context:
edit: 編輯
ob_auth:
edit: 分類授權
page_part_kinds:
text: 文字區塊
public_r_tag: 系統模塊
module_widget: 外掛模塊
position: 位置
published?: 發布?
purchase: 購買
role: 身份
roles: 身份
site_description: 網站描述
site_footer: 網站頁尾
site_settings: 基本設定
site_sub_menu: 網站次選單
site_title: 網站標題
setup_member: 成員設置
setup_translations: 語系設定
setup_designs: 版型設定
site: 網站
site_setting: 網站設定
super_pages: 可編頁面
structure: 網站結構
tags: 標籤
title: 標題
translation: 翻譯
type: 類型
up_to_date: 最新版本
update_error_link: 更新鏈接時出現錯誤。
update_error_page: 更新頁面時出現錯誤。
update_success_content: 內容已成功更新。
update_success_home: 首頁已成功更新。
update_success_layout: 樣板已成功更新。
update_success_link: 連結已成功更新。
update_success_page: 頁面已成功更新。
update_success_snippet: 片段已成功更新。
update_success_user: 用戶已成功更新
upload_design: 上傳設計
url: URL
user: 用戶
user_new_interface:
sys_basic_form: 系統基本資料表
password: 密碼
password_confirmation: 確認密碼
email: 使用者帳號信箱
user_role:
auth:
all_member: 所有會員
manager: 管理員
sub_manager: 次管理員
by_role: 根據身份
by_sub_role: 根據次身份
block_list: 封鎖名單
add_manager: 增加到管理員
add_sub_manager: 增加到次管理員
add_to_block_list: 封鎖名單
add_to_privilege_list: 特許名單
auth_by: -由%{user_display_name}授權
user: 使用會員
info: 用戶資料
panel: 用戶面板
role: 用戶身份
dashboard:
bulletin: 公告
news_bulletin: 新聞
page_context: 頁面
web_link: 鏈接
panel:
# : >>>>>>> various_bugs
# Chinese (Taiwan) translations for Ruby on Rails
# by tsechingho (http://github.com/tsechingho)
date:
formats:
default: "%Y-%m-%d"
short: "%b%d日"
long: "%Y年%b%d日"
day_names: [星期日, 星期一, 星期二, 星期三, 星期四, 星期五, 星期六]
abbr_day_names: [日, 一, 二, 三, 四, 五, 六]
month_names: [~, 一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月]
abbr_month_names: [~, 1月, 2月, 3月, 4月, 5月, 6月, 7月, 8月, 9月, 10月, 11月, 12月]
order: [ :year, :month, :day ]
time:
formats:
default: "%Y年%b%d日 %A %H:%M:%S %Z"
short: "%b%d日 %H:%M"
long: "%Y年%b%d日 %H:%M"
am: "上午"
pm: "下午"
datetime:
distance_in_words:
half_a_minute: "半分鐘"
less_than_x_seconds:
one: "不到一秒"
other: "不到 %{count} 秒"
x_seconds:
one: "一秒"
other: "%{count} 秒"
less_than_x_minutes:
one: "不到一分鐘"
other: "不到 %{count} 分鐘"
x_minutes:
one: "一分鐘"
other: "%{count} 分鐘"
about_x_hours:
one: "大約一小時"
other: "大約 %{count} 小時"
x_days:
one: "一天"
other: "%{count} 天"
about_x_months:
one: "大約一個月"
other: "大約 %{count} 個月"
x_months:
one: "一個月"
other: "%{count} 個月"
about_x_years:
one: "大約一年"
other: "大約 %{count} 年"
over_x_years:
one: "一年多"
other: "%{count} 年多"
almost_x_years:
one: "接近一年"
other: "接近 %{count} 年"
prompts:
year: "年"
month: "月"
day: "日"
hour: "時"
minute: "分"
second: "秒"
number:
format:
separator: "."
delimiter: ","
precision: 3
significant: false
strip_insignificant_zeros: false
currency:
format:
format: "%u %n"
unit: "NT$"
separator: "."
delimiter: ","
precision: 2
significant: false
strip_insignificant_zeros: false
percentage:
format:
delimiter: ""
precision:
format:
delimiter: ""
human:
format:
delimiter: ""
precision: 1
significant: false
strip_insignificant_zeros: false
storage_units:
format: "%n %u"
units:
byte:
one: "Byte"
other: "Bytes"
kb: "KB"
mb: "MB"
gb: "GB"
tb: "TB"
decimal_units:
format: "%n %u"
units:
# 10^-21 zepto, 10^-24 yocto
atto: "渺" # 10^-18
femto: "飛" # 10^-15 毫微微
pico: "漠" # 10^-12 微微
nano: "奈" # 10^-9 毫微
micro: "微" # 10^-6
mili: "毫" # 10^-3 milli
centi: "厘" # 10^-2
deci: "分" # 10^-1
unit: ""
ten:
one: "十"
other: "十" # 10^1
hundred: "百" # 10^2
thousand: "千" # 10^3 kilo
million: "百萬" # 10^6 mega
billion: "十億" # 10^9 giga
trillion: "兆" # 10^12 tera
quadrillion: "千兆" # 10^15 peta
# 10^18 exa, 10^21 zetta, 10^24 yotta
support:
array:
words_connector: ", "
two_words_connector: " 和 "
last_word_connector: ", 和 "
select:
prompt: "請選擇"
search:
not_found: "沒有搜尋結果"
domains: Google Search Domains
site_search: "全站搜尋"
sitesearch: Google Site Search
site_setting_help: 請輸入送交Google搜尋的參數
result_get: "搜尋有關 ' %{search_word} ' 共搜尋到%{item_num}筆資料"
too_many: "搜尋有關 ' %{search_word} ' 尋找到超過 %{exceed_num} 筆資料,請嘗試加入更多關鍵字縮小搜尋範圍,以作更精確的搜尋"
result_get: "搜尋標題有關 ' %{search_word} ' 共搜尋到%{item_num}筆資料"
unit_get: "列出由:%{unit_name}發佈的資料,共有%{item_num}筆"
activerecord:
errors:
template: # ~ 2.3.5 backward compatible
header:
one: "有 1 個錯誤發生使得「%{model}」無法被儲存。"
other: "有 %{count} 個錯誤發生使得「%{model}」無法被儲存。"
body: "以下欄位發生問題:"
full_messages:
format: "%{attribute} %{message}"
messages:
inclusion: "沒有包含在列表中"
exclusion: "是被保留的關鍵字"
invalid: "是無效的"
confirmation: "不符合確認值"
accepted: "必須是可被接受的"
empty: "不能留空"
blank: "不能是空白字元"
too_long: "過長(最長是 %{count} 個字)"
too_short: "過短(最短是 %{count} 個字)"
wrong_length: "字數錯誤(必須是 %{count} 個字)"
not_a_number: "不是數字"
not_an_integer: "必須是整數"
greater_than: "必須大於 %{count}"
greater_than_or_equal_to: "必須大於或等於 %{count}"
equal_to: "必須等於 %{count}"
less_than: "必須小於 %{count}"
less_than_or_equal_to: "必須小於或等於 %{count}"
odd: "必須是奇數"
even: "必須是偶數"
taken: "已經被使用"
record_invalid: "校驗失敗: %{errors}"
activemodel:
errors:
template:
header:
one: "有 1 個錯誤發生使得「%{model}」無法被儲存。"
other: "有 %{count} 個錯誤發生使得「%{model}」無法被儲存。"
body: "以下欄位發生問題:"
errors:
format: "%{attribute} %{message}"
messages:
inclusion: "沒有包含在列表中"
exclusion: "是被保留的關鍵字"
invalid: "是無效的"
confirmation: "不符合確認值"
accepted: "必須是可被接受的"
empty: "不能留空"
blank: "不能是空白字元"
too_long: "過長(最長是 %{count} 個字)"
too_short: "過短(最短是 %{count} 個字)"
wrong_length: "字數錯誤(必須是 %{count} 個字)"
not_a_number: "不是數字"
not_an_integer: "必須是整數"
greater_than: "必須大於 %{count}"
greater_than_or_equal_to: "必須大於或等於 %{count}"
equal_to: "必須等於 %{count}"
less_than: "必須小於 %{count}"
less_than_or_equal_to: "必須小於或等於 %{count}"
odd: "必須是奇數"
even: "必須是偶數"
template:
header:
one: "有 1 個錯誤發生使得「%{model}」無法被儲存。"
other: "有 %{count} 個錯誤發生使得「%{model}」無法被儲存。"
body: "以下欄位發生問題:"
widget:
default_widget: 系統預設Widget
_default_widget:
typeA: 表格列表
typeB_style2: 單行列佐圖(同邊)
typeB_style3: 多行列佐圖(同邊)
typeB_style4: 多行列佐圖(異邊)
typeC: 單行列佐單圖(同邊)
mongoid:
models:
news_bulletin: 新聞
bulletin: 公告
ad_banner: 廣告輪播
web_link: 連結管理
attributes:
news_bulletin:
title: 新聞標題
bulletin:
title: 公告標題
ad_banner:
title: 標題
web_link:
title: 名稱
url: 路徑
helpers:
select:
prompt: "請選擇"
submit:
create: "新增%{model}"
update: "更新%{model}"
submit: "儲存%{model}"
modal:
save_and_close: "儲存並關閉"
close: "關閉"
preview: "預覽"
sys:
not_previewable: "不支援預覽"
limit_of_upload_file_size: "上傳檔案大小限制: %{best_size}"
preview_only_for_img: "預覽僅支援jpg,png,gif,bmp...等圖片格式"
can_not_display_due_to_no_context: "因為沒有中文版本,所以無法顯示"
module_page_lang_not_support: "很抱歉,本頁沒有開放中文版本"
object_disable:
change_to_true: "設為停用"
change_to_false: "重新啓用"

View File

@ -1,4 +1,6 @@
Orbit::Application.routes.draw do Orbit::Application.routes.draw do
# get "robots.txt" => 'robots#index'
devise_for :users do devise_for :users do
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
end end
@ -79,9 +81,15 @@ Orbit::Application.routes.draw do
end end
resources :pages do resources :pages do
collection do
get 'reload_after_module_changed', :action=>'reload_frontend_pages'
get 'reload_after_list_changed',:action=> 'reload_front_end_setting'
end
member do member do
get 'delete' get 'delete'
get 'reload_themes' get 'reload_themes'
get 'reload_after_module_changed',:action=>'reload_frontend_pages'
get 'reload_after_list_changed',:action=> 'reload_front_end_setting'
end end
end end
@ -101,14 +109,13 @@ Orbit::Application.routes.draw do
match 'remove_manager/:app_manager_id' ,:action=> 'remove_manager',:via => "delete",:as =>:remove_manager match 'remove_manager/:app_manager_id' ,:action=> 'remove_manager',:via => "delete",:as =>:remove_manager
match 'remove_sub_manager/:app_sub_manager_id' ,:action=> 'remove_sub_manager',:via => "delete",:as =>:remove_sub_manager match 'remove_sub_manager/:app_sub_manager_id' ,:action=> 'remove_sub_manager',:via => "delete",:as =>:remove_sub_manager
get 'reload_frontend_pages'
end end
end end
resources :page_parts do resources :page_parts do
member do member do
get 'reload_widgets' get 'reload_after_module_changed',:action=>'reload_widgets'
get 'reload_widget_styles' get 'reload_after_list_changed',:action=> 'reload_widget_styles'
get 'reload_r_tag_options' get 'reload_r_tag_options'
end end
end end
@ -201,9 +208,9 @@ Orbit::Application.routes.draw do
match 'desktop_publications/books_list'=>'desktop_publications#books_list' match 'desktop_publications/books_list'=>'desktop_publications#books_list'
match 'desktop_publications/books_add'=>'desktop_publications#books_add' match 'desktop_publications/books_add'=>'desktop_publications#books_add'
match 'desktop_publications/seminar_p' => 'desktop_publications#seminar_p' match 'desktop_publications/conference_p' => 'desktop_publications#conference_p'
match 'desktop_publications/seminar_p_list/'=>'desktop_publications#seminar_p_list' match 'desktop_publications/conference_p_list/'=>'desktop_publications#conference_p_list'
match 'desktop_publications/seminar_p_add/'=>'desktop_publications#seminar_p_add' match 'desktop_publications/conference_p_add/'=>'desktop_publications#conference_p_add'
# end # end
# namespace :desktop_research do # namespace :desktop_research do

View File

@ -1,6 +1,11 @@
require 'factory_girl' require 'factory_girl'
require 'faker' require 'faker'
FactoryGirl.definition_file_paths = Dir["#{Rails.root}/vendor/built_in_modules/*/spec/factories"]
FactoryGirl.find_definitions
CoAuthorRelation.destroy_all CoAuthorRelation.destroy_all
CoAuthor.destroy_all CoAuthor.destroy_all
JournalLevelType.destroy_all JournalLevelType.destroy_all
@ -8,7 +13,8 @@ WritingJournalFile.destroy_all
WritingJournal.destroy_all WritingJournal.destroy_all
#Dir[Rails.root.join("spec/factories/*.rb")].each {|f| require f} #Dir[Rails.root.join("spec/factories/*.rb")].each {|f| require f}
10.times do
10.size.times do
FactoryGirl.create(:journal_level) FactoryGirl.create(:journal_level)
end end

View File

@ -11,7 +11,7 @@
<li class="d_cate"><a href="" class="widget_fn wh3 hh3" id='d_publication' onclick="return false;"><span class="widget_icon"><img src="" alt="Publication" id="publication_icon" width="30" height="30"/></span></a> <li class="d_cate"><a href="" class="widget_fn wh3 hh3" id='d_publication' onclick="return false;"><span class="widget_icon"><img src="" alt="Publication" id="publication_icon" width="30" height="30"/></span></a>
<ul class="dock_child hh3 thmc4" style="width: 180px;"> <ul class="dock_child hh3 thmc4" style="width: 180px;">
<li class="dock_item"><a href="journal_p" class="widget_fn wh3 hh3" id='d_journal_p' 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 href="journal_p" class="widget_fn wh3 hh3" id='d_journal_p' 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 href="seminar_p" class="widget_fn wh3 hh3" id='d_seminar_p' onclick="return false;"><span class="widget_icon"><img src="" alt="Seminar Papers" id="seminar_p_icon" width="30" height="30"/></span></a></li> <li class="dock_item"><a href="conference_p" class="widget_fn wh3 hh3" id='d_conference_p' 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 href="books" 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> <li class="dock_item"><a href="books" 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>
</ul> </ul>
</li> </li>

View File

@ -1,6 +1,11 @@
require "orbit_app/summary" require "orbit_app/summary"
require "orbit_app/dsl" require "orbit_app/dsl"
require "orbit_app/module/backend_side_bar" require "orbit_app/helper/renderer"
require "orbit_app/helper/side_bar_renderer"
require "orbit_app/helper/context_link_renderer"
require "orbit_app/module/side_bar"
require "orbit_app/module/widget"
require "orbit_app/module/front_end"
require "orbit_app/plugin/summary" require "orbit_app/plugin/summary"
require "orbit_app/plugin/registration" require "orbit_app/plugin/registration"
require "orbit_app/module/summary" require "orbit_app/module/summary"

View File

@ -0,0 +1,33 @@
module ContextLinkRenderer
include Renderer
def render(request,params,current_module_app,current_user,belong_module_app)
@current_module_app = current_module_app
@belong_module_app = belong_module_app
@request = request
@params = params
@current_user = current_user
if display?
content_tag :li, link_to((I18n.t(@label_i18n) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, eval(@path)), :class => (active? ? 'active' : nil)
end
end
protected
def display?
@available_for.each do |available_for_in_sym|
result = case available_for_in_sym
when :all
true
when :manager
@belong_module_app.is_manager? @current_user
when :sub_manager
@belong_module_app.is_sub_manager? @current_user
else
(eval(available_for_in_sym).include? @current_user rescue false)
end # of case
return true if result || (@current_user.admin? rescue false)
end # of collect
false
end
end

View File

@ -0,0 +1,68 @@
module Renderer
include Rails.application.routes.url_helpers
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::TagHelper
include ActionView::Helpers::RenderingHelper
include ActionView::Context
include OrbitBasis::RenderAnywhere
protected
def active_for_app_auth?
module_app = get_module_app
if module_app.nil?
false
else
module_app.id.to_s == @params[:module_app_id] ? true : false
end
end
def active_for_ob_auths?
if @params.has_key? :object_auth_id
oa = ObjectAuth.find @params[:object_auth_id]
check_controller = @params[:controller] == 'admin/object_auths_new_interface'
check_object_class = @active_for_object_auth.include? oa.obj_authable_type
return (check_controller and check_object_class)
else
return false
end
end
def current_user
current_or_guest_user
end
def current_or_guest_user
@current_user
end
def request
@request
end
def default_url_options
_routes.default_url_options
end
def _routes
@request.env["action_dispatch.routes"]
end
def controller
@params[:controller]
end
def action
@params[:action]
end
def check_user_available_for
end
protected
def display?
true
end
end

View File

@ -0,0 +1,45 @@
module SideBarRenderer
include Renderer
include AdminHelper
def render(request,params,user,current_module_app)
@belong_module_app = get_module_app
@current_module_app = current_module_app
@request = request
@params = params
@current_user = user
if display?
content_tag :li, :class => (module_sidebar_active? ? 'active' : nil) do
buf = link_to( content_tag(:i, nil, :class => @icon_class ) + content_tag(:span, I18n.t( @head_label )), eval(@head_link))
buf << content_tag( :ul, :class => ("nav nav-list active") )do # visible_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys', 'approvals')||active_for_ob_auths_object("BulletinCategory"))
@context_links.sort_by! {| obj | obj.priority}.collect do |link|
link.render(request,params,@current_module_app,@current_user,@belong_module_app)
end.join.html_safe
end
end
end
end
protected
def display? #控制sidebar 要不要算圖
if is_manager? || is_admin? #如果是系統管理員 或 是模組管理員
true
elsif (@current_module_app.open rescue true) # 如果app 被設定成 開放
true
elsif is_member? #如果app 是封閉 那至少需要是 member
true
else
false
end
end
def module_sidebar_active?
active_for_controller? or active_for_app_auth? or active_for_ob_auths?
end
def active_for_controller?
@active_for_controllers.include? controller
end
end

View File

@ -1,17 +0,0 @@
module OrbitApp
module Module
class BackendSideBar
attr_reader :name
def initialize(name, &block)
@name = name
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
end
# def personal_plugin(*args)
# binding.pry
# end
end
end
end

View File

@ -0,0 +1,67 @@
module OrbitApp
module Module
module FrontendUtility
Version = "0.1"
module ClassMethods
@@frontend_pages = []
#Record all frontend pages of orbit
def add(var) #build @@frontend_pages
@@frontend_pages << var
end
def all #return all frontend_pages of orbit
return @@frontend_pages
end
end
extend ClassMethods
def self.included( other )
other.extend( ClassMethods )
end
class AppPageSet # From Registration
def initialize(&block)
@frontend_pages = []
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
end
def app_page(name,&block)
@frontend_pages << AppPage.new(name,&block)
end
def to_module_app_format #For ModuleApp to fetch data
@frontend_pages.collect{|t| [t.get_i18n,t.name]}
end
end
class AppPage
attr_reader :name
def initialize(name,&block)
@name = name
@frontend_i18n = 'rulingcom.errors.init.app_page_noname'
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
end
def frontend_i18n(i18n)
@frontend_i18n = i18n
end
def get_i18n
@frontend_i18n
end
def finalize!
end
protected
end# of AppPage
end # of FrontendUtility
end # of Module
end # of OrbitApp

View File

@ -12,7 +12,7 @@ module OrbitApp
def find_by_key(key) def find_by_key(key)
@@registrations.each{|t| @@registrations.each{|t|
return t if t.name == key return t if t.key == key
} }
return nil return nil
end end
@ -28,27 +28,107 @@ module OrbitApp
end end
class DataSheet class DataSheet
attr_reader :name attr_reader :name,:key,:base_path,:module_label
attr_reader :base_path
def initialize(name, &block) def initialize(name, &block)
@name = name @name = name
@key = name.underscore.singularize
@side_bar = nil
@front_end_app_pages = nil
@module_label = 'rulingcom.errors.init.module_app_noname'
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
setup_module_app
end end
def plugin def get_module_app
ModuleApp.first(conditions: {:key=>@key,:title=>name})
end end
def personal_plugin(params) def setup_module_app
module_app = get_module_app
module_app = ModuleApp.new(:key=>@key,:title=>name) if module_app.nil?
module_app.refetch_setting!(self)
begin
module_app.save(:validate=>false)
rescue
retry
end
end
def get_label_i18n
@module_label
end
def get_default_widget_fields
return @widget_set.get_fields
end
def get_default_widget
if @widget_set.nil? # Init not defining widget
return {}
elsif @widget_set.get_default_widget.nil? # Init had defining widget,but say nothing about default_widget
return {}
else
@widget_set.get_default_widget.to_module_app_format
end
end
def get_enable_frontend
(@front_end_app_pages.nil? ? false : true)
end
def get_app_pages
@front_end_app_pages.nil? ? [] : @front_end_app_pages.to_module_app_format
end
def get_widget_by_path(path)
if @widget_set
@widget_set.find_by_path(path)
else
nil
end
end
def get_widgets
@widget_set.nil? ? {} : @widget_set.to_module_app_format
end
def get_categories
@widget_set.get_categories rescue []
end
def get_tags
@widget_set.get_tags rescue []
end
def front_end(&block) #setter for front_end from init
@front_end_app_pages = FrontendUtility::AppPageSet.new(&block)
end
def side_bar(&block) #setter for side_bar from init
@side_bar = SideBarRegisition::SideBar.new(@name,@key,method(:get_module_app),&block)
end
def personal_plugin(params) #setter for personal_plugin from init
# TODO 這裡要看是一些檔案是不是都有 # TODO 這裡要看是一些檔案是不是都有
Plugin::Registration.new_from_module_app(@name,@base_path,params) Plugin::Registration.new_from_module_app(@name,@base_path,params)
end end
def base_url(var) def widgets(&block) #setter for widget from init
@base_path = var # @widgets = WidgetRegisition::WidgetSet.new(&block)
@widget_set = WidgetUtility::WidgetSet.new(&block)
# @widgets = widget_set.widgets
# @default_widget = widget_set.default_widget
end end
end
%w{module_label category base_url version organization author intro update_info}.each do |field|
define_method(field){|var| instance_variable_set( "@" + field, var)}
end
end # of class DataSheet
end end
end end
end end

View File

@ -0,0 +1,172 @@
module OrbitApp
module Module
module SideBarRegisition
Version = "0.1"
module ClassMethods
@@side_bars = []
def add(var)
@@side_bars << var
end
def find_by_key(key)
@@side_bars.each{|t|
return t if t.name == key
}
return nil
end
def render_all(request,params,user,current_module_app)
@@side_bars.collect{|t| t.render(request,params,user,current_module_app)}.join.html_safe
end
def all
return @@side_bars
end
end
extend ClassMethods
def self.included( other )
other.extend( ClassMethods )
end
class SideBar
# include ApplicationHelper
# include AdminHelper
include SideBarRenderer
# def is_admin?
# binding.pry
# end
# def is_manager?
# binding.pry
# end
def initialize(name = '',key,get_module_app,&block)
@head_label = name
@context_links = []
@available_for = []
@active_for_controllers = []
@active_for_object_auth = []
@active_for_app_auth = []
@head_link = ""
@app_base_path = ''
@module_app_key = key
@get_module_app = get_module_app
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
# setup_module_app(module_app_key)
finalize!
SideBarRegisition.add(self)
end
def get_module_app
@get_module_app.call
end
def head_label_i18n(var,options ={})
@head_label = var
@icon_class = options[:icon_class]
end
def available_for(var)
@available_for = var
end
def active_for_controllers(var)
@active_for_controllers = var
end
def active_for_object_auth(var)
@active_for_object_auth = var
end
def head_link_path(var)
@head_link = var
end
def context_link(*var)
var[1].merge!({:module_app_key=>@module_app_key,:get_module_app=>@get_module_app}) unless @module_app_key.nil?
new_context_link = ContextLink.new(*var)
@context_links << new_context_link
end
def finalize!
set_controllers_scope
# set_default_active_app_auth
@context_links.each do |t|
# t.set_module_app = @module_app
t.finalize!
end
end
protected
# def setup_module_app(var)
# @module_app_title = var
# @module_app = ModuleApp.where(:key=>var).desc(:create_date).first
# @module_app_key = @module_app.key
# end
# def set_default_active_app_auth
# @active_for_app_auth = @module_app.title
# end
def set_controllers_scope
var = @active_for_controllers
@active_for_controllers = []
var[:private].each do |controller|
@active_for_controllers << "panel/#{@module_app_key}/back_end/"+controller
end unless var[:private].nil?
var[:public].each do |controller|
@active_for_controllers << controller
end unless var[:public].nil?
end
end
class ContextLink
include ContextLinkRenderer
attr_reader :label_i18n,:available_for,:priority,:path,:active_for_action
def initialize(label_i18n="NoNameLink",options={})
@label_i18n = label_i18n
@available_for = options[:available_for]
@priority = options[:priority] || 0
@path = options[:link_path] || ""
@active_for_action = options[:active_for_action] || []
@active_for_object_auth = options[:active_for_object_auth] || []
@active_for_app_auth = options[:active_for_app_auth] || []
@module_app_key = options[:module_app_key]
@get_module_app = options[:get_module_app]
end
def get_module_app
@get_module_app.call
end
def active?
for_action = @active_for_action.blank? ? false : active_for_action?
for_app_auth = @active_for_app_auth.blank? ? false : active_for_app_auth?
for_ob_auth = @active_for_object_auth.blank? ? false : active_for_ob_auths?
for_action || for_app_auth || for_ob_auth
end
def active_for_action?
@active_for_action[controller] == action
end
# def set_module_app=(var)
# @module_app = var
# @module_app_key = var.key
# end
def finalize!
set_active_actions
end
protected
def set_active_actions
controller_action_hash = @active_for_action
@active_for_action = Hash[controller_action_hash.map{|controller,action| ["panel/#{@module_app_key}/back_end/"+controller.to_s,action.to_s]}]
end
end
end
end
end

View File

@ -3,7 +3,7 @@ require "orbit_app/summary"
module OrbitApp module OrbitApp
module Module module Module
module Summary module Summary
include OrbitApp::Summary include OrbitApp::Summary
class Item class Item

View File

@ -0,0 +1,172 @@
module OrbitApp
module Module
module WidgetUtility
Version = "0.1"
module ClassMethods
@@widgets = []
def add(var)
@@widgets << var
end
def all
return @@widgets
end
end
extend ClassMethods
def self.included( other )
other.extend( ClassMethods )
end
class WidgetSet
attr_reader :widgets,:categories_query,:tags_query
def initialize(&block)
@widgets = []
@default_widget = nil
@categories_query = ''
@tags_query = ''
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
end
%w{categories_query tags_query}.each do |field|
define_method(field){|var| instance_variable_set( "@" + field, var)}
end
def find_by_path(path)
@widgets.each do |widget|
return widget if widget.name == path
end
end
def get_categories
eval(@categories_query) rescue nil
end
def get_tags
eval(@tags_query) rescue nil
end
def default_widget(&block)
@default_widget = DefaultWidget.new(&block)
end
def customize_widget(name,&block)
@widgets << Widget.new(name,&block)
end
# def customize_widget(name,label,options ={})
# @widgets << Widget.new(name,label,options)
# end
# def customize_widget_options_fields_i18n(settings)
# @customize_widget_options_fields_i18n = settings
# end
def to_module_app_format
hash = {}
@widgets.collect{|t| hash[t.name] = t.to_hash}
hash["default_widget"]= DefaultWidget.get_interface_args unless @default_widget.blank?
hash
end
def get_fields
get_default_widget.get_fields
end
def get_default_widget
return @default_widget
end
end
class DefaultWidget
STYLE = ["typeA","typeB_style2","typeB_style3","typeB_style4","typeC"]
def initialize(&block)
@query = nil
@image = nil
@more_link = {}
@fields = []
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
end
def more_link_to(label_i18n,path_method)
@more_link[:label_i18n] = label_i18n
@more_link[:path_method] = path_method
end
def self.get_interface_args
#will need to work with design
{:name=>"default_widget",:field=>nil,:label=>'label',:style=>STYLE}
end
def to_module_app_format
{:query=>@query,:image=>@image} rescue nil
end
def link_field(field_name,setting)
@fields << [field_name,setting,:link]
end
def field(field_name)
@fields << [field_name,nil,:field]
end
def get_fields
@fields
end
def query(var)
@query = var
end
def image(var)
@image = var
end
end
class Widget
attr_reader :name,:default_template,:fields
def initialize(name,&block)
@name = name
@options = {}
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
# @fields = options[:fields]
# @label = label
# @style= options[:style]
end
def widget_i18n(str) # "gallery.widget.widget1"
@widget_i18n = str
end
def style(ary)# []
@style = ary
end
def get_options
@options
end
def options(opt_name,*options) # "vertical",
option = options[0]
@options[opt_name] = {:label_i18n=>option[:i18n] , :opts=>option[:options_item]}
# options => :i18n => "gallery.widget_option.vertical",:options_item=>[1, 2]
# :i18n =>"gallery.widget_option.album",:options_item => {"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}
end
def to_hash
{:name => @name,:fields=>@fields,:label=>@label,:style=>@style,:i18n=>@widget_i18n}
end
protected
end# of widget
end # of WidgetRegisition
end # of Module
end # of OrbitApp

View File

@ -0,0 +1,73 @@
module OrbitApp
module ModuleAppMembershipTools
def is_manager?(user)
if user.nil?
return false
else
m_users = managing_users
if m_users.blank?
false
else
m_users.include?(user)
end
end
end
def is_sub_manager?(user)
if user.nil?
return false
else # when user is guest
s_m_users = sub_managing_users
result = false
if s_m_users.blank?
result = false
else
result = s_m_users.include?(user)
end
result || is_manager?(user)
end
end
def managing_users
self.managers.collect{ |t| t.user }
end
def sub_managing_users
self.sub_managers.collect{ |t| t.user }
end
def assign_manager(user,assigner)
manager = AppManager.first(conditions: {managing_app_id: self.id,user_id: user.id}) rescue nil
if manager.nil?
manager = self.managers.create(:user_id => user.id,:rule_creator_id => (assigner.id rescue nil))
end
manager
end
def assign_sub_manager(user,assigner)
submanager = AppManager.first(conditions: {sub_managing_app_id: self.id,user_id: user.id}) rescue nil
if submanager.nil? && !self.managing_users.include?(user)
submanager = self.sub_managers.create(:user_id => user.id,:rule_creator_id => (assigner.id rescue nil) )
end
submanager
end
def remove_manager(user)
manager = AppManager.first(conditions: {managing_app_id: self.id,user_id: user.id}) rescue nil
if manager
manager.destroy
else
false
end
end
def remove_sub_manager(user)
submanager = AppManager.first(conditions: {sub_managing_app_id: self.id,user_id: user.id}) rescue nil
if submanager
submanager.destroy
else
false
end
end
end
end

View File

@ -10,8 +10,8 @@ module OrbitApp
@@registrations << DataSheet.new(name,&block) @@registrations << DataSheet.new(name,&block)
end end
def new_from_module_app(name,base_path,arg) def new_from_module_app(name,base_path,*args)
@@registrations << DataSheet.new(name,arg,:base_path=>base_path) @@registrations << DataSheet.new(name,args,:base_path=>base_path)
end end
def find_by_key(key) def find_by_key(key)
@ -35,16 +35,23 @@ module OrbitApp
attr_reader :name attr_reader :name
attr_reader :base_path attr_reader :base_path
def name
if @name.is_a? Proc
@name.call
else
@name
end
end
def initialize(name,partial=nil,*args ,&block) def initialize(name,partial=nil,*args ,&block)
@base_path = args[0][:base_path] @base_path = args[0][:base_path]
@name = name @name = partial[0][:i18n].nil? ? name : lambda{ I18n.t(partial[0][:i18n]) }
@partial_path = '' @partial_path = ''
@admin_partial_path = '' @admin_partial_path = ''
unless partial.nil? unless partial.nil?
@partial_path = partial[:path] @partial_path = partial[0][:path]
@admin_partial_path = partial[:admin_path] @admin_partial_path = partial[0][:admin_path]
end end
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?

View File

@ -7,7 +7,7 @@ module OrbitApp
def new( name ,&block) def new( name ,&block)
@@summaries << Item.new(name,&block) @@summaries << Item.new(name,&block)
binding.pry # binding.pry
end end
def all def all

View File

@ -81,7 +81,7 @@ module OrbitCoreLib
end end
query1 = auth_object_space.any_in({sub_role_ids: sub_role_ids_ary}).excludes(blocked_user_ids: user.id) query1 = auth_object_space.any_in({sub_role_ids: sub_role_ids_ary}).excludes(blocked_user_ids: user.id)
query2 = auth_object_space.any_of({all: true},{privilege_user_ids: user.id},{role_ids: user.role.id}).excludes(blocked_user_ids: user.id) query2 = auth_object_space.any_of({all: true},{privilege_user_ids: user.id},{role_ids: user.role_ids}).excludes(blocked_user_ids: user.id)
result = (query1 + query2).uniq result = (query1 + query2).uniq
result.collect{|t| t.obj_authable}.delete_if{|val| val==nil} result.collect{|t| t.obj_authable}.delete_if{|val| val==nil}
end end
@ -128,7 +128,7 @@ module OrbitCoreLib
end end
end end
module ObjectTokenUnility module ObjectTokenUtility
def self.included(base) def self.included(base)
base.instance_eval("field :s_token") base.instance_eval("field :s_token")
base.instance_eval("after_create :generate_token") base.instance_eval("after_create :generate_token")
@ -145,7 +145,7 @@ module OrbitCoreLib
end end
end end
module PermissionUnility module PermissionUtility
private private
def check_permission(type = :use) def check_permission(type = :use)
permission_grant = current_or_guest_user.admin?? true : false permission_grant = current_or_guest_user.admin?? true : false
@ -168,4 +168,34 @@ module OrbitCoreLib
ModuleApp.first(conditions: {s_token: token}) ModuleApp.first(conditions: {s_token: token})
end end
end end
module AppBackendUtility
def setup_vars
@app_title ||= controller_path.split('/')[1].singularize
@module_app ||= ModuleApp.first(conditions: {:key => @app_title} )
end
private
def force_order_for_visitor
setup_vars
set_current_user
end
def force_order_for_user
setup_vars
set_current_user
authenticate_user!
check_user_can_use
end
def check_user_can_use
unless check_permission
#redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
redirect_to root_url
end
end
end
end end

View File

@ -184,15 +184,21 @@ module ParserCommon
# page_contents # page_contents
def parse_contents_edit(body, page, edit=nil) def parse_contents_edit(body, page, edit=nil)
public_r_tags = [] public_r_tags = []
url = ''
body.css('.page_content').each do |content| body.css('.page_content').each do |content|
ret = '' ret = ''
category = params[:category_id].blank? ? page[:category] : params[:category_id] category = params[:category_id].blank? ? page[:category] : params[:category_id]
tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id] tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
if (content["main"] == "true" && !page.module_app.nil?) if (content["main"] == "true" && !page.module_app.nil?)
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}" if page.app_frontend_url == 'default_widget'
ret << "/#{params[:id]}" if params[:id] && !params[:id].eql?(page.id.to_s) url = "/panel/orbit_app/widget/#{page.frontend_style}?inner=true"
ret << "?inner=true&page_id=#{page.id}&category_id=#{category}&tag_id=#{tag}&preview=#{params[:preview]}&page_main=#{params[:page_main]}&search_query=#{params[:search_query]}&name=#{params[:name]}" else
ret << "'></div>" url = "/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}"
end
ret << "<div id='appfrontend' class='dymanic_load' path='#{url}"
ret << "/#{params[:id]}" if params[:id] && !params[:id].eql?(page.id.to_s)
ret << "?inner=true&page_id=#{page.id}&category_id=#{category}&tag_id=#{tag}&preview=#{params[:preview]}&page_main=#{params[:page_main]}&search_query=#{params[:search_query]}&name=#{params[:name]}&item_type=page"
ret << "'></div>"
else else
part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil
part_title = part.title rescue nil part_title = part.title rescue nil
@ -213,7 +219,7 @@ module ParserCommon
raise ModuleAppError,"PagePart can't find ModuleApp" if part.module_app.nil? raise ModuleAppError,"PagePart can't find ModuleApp" if part.module_app.nil?
"/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true" "/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true"
end 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}" 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"
ret << "<div class='dymanic_load widget' path='#{url + options}'></div>" ret << "<div class='dymanic_load widget' path='#{url + options}'></div>"
when 'public_r_tag' when 'public_r_tag'
ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>" ret << "<r:#{part.public_r_tag} id='#{part.public_r_tag_object_id}'/>"

View File

@ -95,11 +95,18 @@ module ParserFrontEnd
# page_contents # page_contents
def parse_contents(body, page, edit=nil, locale) def parse_contents(body, page, edit=nil, locale)
public_r_tags = [] public_r_tags = []
url = ''
body.css('.page_content').each do |content| body.css('.page_content').each do |content|
ret = '' ret = ''
if (content["main"] == "true" && !page.module_app.nil?) if (content["main"] == "true" && !page.module_app.nil?)
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" if page.app_frontend_url == 'default_widget'
options = "&page_id=#{page.id}&category_id=\#{category}&tag_id=\#{tag}&preview=\#{params[:preview]}&page_main=\#{params[:page_main]}&search_query=\#{params[:search_query]}&name=\#{params[:name]}" url = "/panel/orbit_app/widget/#{page.frontend_style}?inner=true"
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
options = "&page_id=#{page.id}&category_id=\#{category}&tag_id=\#{tag}&preview=\#{params[:preview]}&page_main=\#{params[:page_main]}&search_query=\#{params[:search_query]}&name=\#{params[:name]}&item_type=page"
ret << "<orbit_front path='#{url + options}'></div>" ret << "<orbit_front path='#{url + options}'></div>"
else else
part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil
@ -116,7 +123,9 @@ module ParserFrontEnd
else else
"/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true" "/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true"
end 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}"
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"
ret << "<orbit_front path='#{url + options}' part_id=#{part.id} class='dymanic_load widget'></orbit_front>" ret << "<orbit_front path='#{url + options}' part_id=#{part.id} class='dymanic_load widget'></orbit_front>"
when 'public_r_tag' when 'public_r_tag'

View File

@ -351,9 +351,11 @@ namespace :migrate do
end end
task :make_default_widget_work_config => :environment do
task :make_default_widget_work_config_for_announcement => :environment do
a = ModuleApp.where(:key=>'announcement').first a = ModuleApp.where(:key=>'announcement').first
a.widgets[:default_widget] = ['typeA','typeC','typeB_style2','typeB_style3','typeB_style4'] a.widgets[:default_widget] = ['typeA','typeC','typeB_style2','typeB_style3','typeB_style4']
a.widgets = {"index"=>["1", "2"], "default_widget"=>["typeA", "typeC", "typeB_style2", "typeB_style3", "typeB_style4"]}
a.widget_fields = [ a.widget_fields = [
["title","announcement.default_widget.title"], ["title","announcement.default_widget.title"],
["bulletin_category_with_title","announcement.default_widget.bulletin_category_with_title"], ["bulletin_category_with_title","announcement.default_widget.bulletin_category_with_title"],
@ -370,6 +372,24 @@ namespace :migrate do
a.save a.save
end end
task :make_default_widget_work_config_for_web_link => :environment do
a = ModuleApp.where(:key=>'web_resource').first
a.widgets = { "default_widget"=>["typeA", "typeC", "typeB_style2", "typeB_style3", "typeB_style4"]}
a.widget_fields = [
["title","web_link.default_widget.title"],
["web_link_with_title","web_link.default_widget.bulletin_category_with_title"]
]
a.get_default_widget = {:query=>'WebLink.all'}
a.widget_fields_link_method = {
"title"=>{:method => 'panel_web_resource_front_end_web_link_path',
:args=>:self},
"web_link_with_title"=>{
:method => 'panel_web_resource_front_end_web_link_path',
:args=>{:category_id => [:web_link_category,:id]}}
}
a.save
end
task :reorder_items => :environment do task :reorder_items => :environment do
reorder_children(Item.root) reorder_children(Item.root)
@ -392,17 +412,32 @@ namespace :migrate do
task :correct_gallery_and_web_resoure_config => :environment do task :correct_gallery_and_web_resoure_config => :environment do
a = ModuleApp.where(:key=>'web_resource').first a = ModuleApp.where(:key=>'web_resource').first
a.widgets = {} if a
a.widgets[:web_links] = [] a.widgets = {}
a.widgets[:home_list] = [] a.widgets[:web_links] = []
a.save a.widgets[:home_list] = []
a.app_pages = ["web_links"]
a.save
end
a = ModuleApp.where(:key=>'gallery').first a = ModuleApp.where(:key=>'gallery').first
a.widgets = {} if a
a.widgets[:widget1] = [] a.widgets = {}
a.widget_options_fields_i18n = {"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.widget_option.album"}} a.widgets[:widget1] = []
a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}} a.widget_options_fields_i18n = {"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.widget_option.album"}}
a.save a.widget_options = {"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
a.save
end
end
task :clean_module_app_objects => :environment do
ModuleApp.all.each do |ma|
%w{intro widget_fields_link_method widgets get_default_widget app_pages author enable_frontend get_widget_style get_widget_style organization update_info using_default_widget version widget_fields version create_date}.each do |field|
ma.unset field
end
ma.save
end
end end
end end

View File

@ -1,222 +0,0 @@
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: using system property solr.solr.home: /home/nccu/stage/NCCU/solr
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to '/home/nccu/stage/NCCU/solr/'
Sep 24, 2012 10:20:33 AM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init()
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: using system property solr.solr.home: /home/nccu/stage/NCCU/solr
Sep 24, 2012 10:20:33 AM org.apache.solr.core.CoreContainer$Initializer initialize
INFO: looking for solr.xml: /home/nccu/stage/NCCU/solr/solr.xml
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to '/home/nccu/stage/NCCU/solr/'
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrConfig initLibs
INFO: Adding specified lib dirs to ClassLoader
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrConfig <init>
INFO: Loaded SolrConfig: solrconfig.xml
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrCore <init>
INFO: Opening new SolrCore at /home/nccu/stage/NCCU/solr/, dataDir=/home/nccu/stage/NCCU/solr/data/development/
Sep 24, 2012 10:20:33 AM org.apache.solr.schema.IndexSchema readSchema
INFO: Reading Solr Schema
Sep 24, 2012 10:20:33 AM org.apache.solr.schema.IndexSchema readSchema
INFO: Schema name=sunspot
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created string: org.apache.solr.schema.StrField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created tdouble: org.apache.solr.schema.TrieDoubleField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created rand: org.apache.solr.schema.RandomSortField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created null: org.apache.solr.analysis.CJKTokenizerFactory
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created null: org.apache.solr.analysis.StandardFilterFactory
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created null: org.apache.solr.analysis.LowerCaseFilterFactory
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created text: org.apache.solr.schema.TextField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created boolean: org.apache.solr.schema.BoolField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created date: org.apache.solr.schema.DateField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created sdouble: org.apache.solr.schema.SortableDoubleField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created sfloat: org.apache.solr.schema.SortableFloatField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created sint: org.apache.solr.schema.SortableIntField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created slong: org.apache.solr.schema.SortableLongField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created tint: org.apache.solr.schema.TrieIntField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created tfloat: org.apache.solr.schema.TrieFloatField
Sep 24, 2012 10:20:33 AM org.apache.solr.util.plugin.AbstractPluginLoader load
INFO: created tdate: org.apache.solr.schema.TrieDateField
Sep 24, 2012 10:20:33 AM org.apache.solr.schema.IndexSchema readSchema
INFO: default search field is text
Sep 24, 2012 10:20:33 AM org.apache.solr.schema.IndexSchema readSchema
INFO: query parser default operator is AND
Sep 24, 2012 10:20:33 AM org.apache.solr.schema.IndexSchema readSchema
INFO: unique key field: id
Sep 24, 2012 10:20:33 AM org.apache.solr.core.JmxMonitoredMap <init>
INFO: No JMX servers found, not exposing Solr information with JMX.
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrCore initListeners
INFO: Added SolrEventListener: org.apache.solr.core.QuerySenderListener{queries=[]}
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrCore initListeners
INFO: Added SolrEventListener: org.apache.solr.core.QuerySenderListener{queries=[{q=solr rocks,start=0,rows=10}, {q=static firstSearcher warming query from solrconfig.xml}]}
Sep 24, 2012 10:20:33 AM org.apache.solr.request.XSLTResponseWriter init
INFO: xsltCacheLifetimeSeconds=5
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created standard: solr.SearchHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created dismax: solr.SearchHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created partitioned: solr.SearchHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /spell: solr.SearchHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created tvrh: org.apache.solr.handler.component.SearchHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: adding lazy requestHandler: org.apache.solr.handler.extraction.ExtractingRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /update/extract: org.apache.solr.handler.extraction.ExtractingRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /terms: org.apache.solr.handler.component.SearchHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: adding lazy requestHandler: solr.SearchHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /elevate: solr.SearchHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /update: solr.XmlUpdateRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /update/javabin: solr.BinaryUpdateRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /analysis/document: solr.DocumentAnalysisRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /analysis/field: solr.FieldAnalysisRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: adding lazy requestHandler: solr.CSVRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /update/csv: solr.CSVRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /admin/: org.apache.solr.handler.admin.AdminHandlers
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /admin/ping: PingRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /debug/dump: solr.DumpRequestHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.core.RequestHandlers initHandlersFromConfig
INFO: created /mlt: solr.MoreLikeThisHandler
Sep 24, 2012 10:20:33 AM org.apache.solr.search.SolrIndexSearcher <init>
INFO: Opening Searcher@6a510e39 main
Sep 24, 2012 10:20:33 AM org.apache.solr.update.DirectUpdateHandler2$CommitTracker <init>
INFO: AutoCommit: disabled
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SpellCheckComponent inform
INFO: Initializing spell checkers
Sep 24, 2012 10:20:33 AM org.apache.solr.spelling.AbstractLuceneSpellChecker init
INFO: Using WhitespaceAnalzyer for dictionary: default
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SpellCheckComponent inform
WARNING: No queryConverter defined, using default converter
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.QueryElevationComponent inform
INFO: Loading QueryElevation from: /home/nccu/stage/NCCU/solr/conf/elevate.xml
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@3cc70b0d
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@2fa6a1a7
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@64bef361
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@345c98f3
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@2b3d9460
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@57d840cd
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@3cc70b0d
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@2fa6a1a7
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@64bef361
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@345c98f3
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@2b3d9460
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@57d840cd
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@3cc70b0d
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@2fa6a1a7
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@64bef361
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@345c98f3
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@2b3d9460
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@57d840cd
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@3cc70b0d
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@2fa6a1a7
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@64bef361
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@345c98f3
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@2b3d9460
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.SpellCheckComponent@36867fc9
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@57d840cd
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.QueryComponent@3cc70b0d
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.FacetComponent@2fa6a1a7
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.MoreLikeThisComponent@64bef361
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.HighlightComponent@345c98f3
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.StatsComponent@2b3d9460
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.TermVectorComponent@382f8116
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding debug component:org.apache.solr.handler.component.DebugComponent@57d840cd
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SearchHandler inform
INFO: Adding component:org.apache.solr.handler.component.TermsComponent@36c3e82b
Sep 24, 2012 10:20:33 AM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener sending requests to Searcher@6a510e39 main
Sep 24, 2012 10:20:33 AM org.apache.solr.core.CoreContainer register
INFO: registering core:
Sep 24, 2012 10:20:33 AM org.apache.solr.servlet.SolrDispatchFilter init
INFO: user.dir=/home/nccu/.rvm/gems/ruby-1.9.2-p318@stage/gems/sunspot_solr-1.3.3/solr
Sep 24, 2012 10:20:33 AM org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init() done
Sep 24, 2012 10:20:33 AM org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init()
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: using system property solr.solr.home: /home/nccu/stage/NCCU/solr
Sep 24, 2012 10:20:33 AM org.apache.solr.servlet.SolrServlet init
INFO: SolrServlet.init() done
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: using system property solr.solr.home: /home/nccu/stage/NCCU/solr
Sep 24, 2012 10:20:33 AM org.apache.solr.servlet.SolrUpdateServlet init
INFO: SolrUpdateServlet.init() done
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=null path=null params={start=0&event=firstSearcher&q=solr+rocks&rows=10} hits=0 status=0 QTime=46
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=null path=null params={event=firstSearcher&q=static+firstSearcher+warming+query+from+solrconfig.xml} hits=0 status=0 QTime=4
Sep 24, 2012 10:20:33 AM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener done.
Sep 24, 2012 10:20:33 AM org.apache.solr.handler.component.SpellCheckComponent$SpellCheckerListener newSearcher
INFO: Loading spell index for spellchecker: default
Sep 24, 2012 10:20:33 AM org.apache.solr.core.SolrCore registerSearcher
INFO: [] Registered new searcher Searcher@6a510e39 main

1038
route Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,49 @@
module AdBanner
OrbitApp.registration "AdBanner",:type=> 'ModuleApp' do
module_label 'miss_module_i18n.ad_banner'
base_url File.expand_path File.dirname(__FILE__)
# personal_plugin :enable => true,:path=>"panel/ad_banner/plugin/profile",:i18n=>'admin.ad_banner'
version "0.1"
organization "Rulingcom"
author "RD dep"
intro "I am intro"
update_info 'some update_info'
# front_end do
# app_page 'bulletins'
# end
# category ["BulletinCategory"]
# widgets do
# # default_widget do
# # query 'Bulletin.all'
# # image :image
# # end
# # categories_query 'BulletinCategory.all'
# # tags_query 'AdBannerTag.all'
# # customize_widget "index","ad_banner.widget.index",:fields=>["title","category","postdate"],:style=>["cu_style_1","cu_style_2","cu_style_3","cu_style_4","cu_style_5"]
# # customize_widget "bulletins_and_web_links","ad_banner.widget.bulletins_and_web_links"
# # item "index","ad_banner.widget.index",:default_template=>true,:fields=>["title","category","postdate"]
# # item "bulletins_and_web_links","ad_banner.widget.bulletins_and_web_links"
# end
side_bar do
head_label_i18n 'admin.ad_banner',:icon_class=>"icons-landscape"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:public=>['admin/ad_banners', 'admin/ad_images']})
head_link_path "admin_ad_banners_path"
context_link 'module_authorization',
:link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'AdBanner'}))",
:priority=>6,
:active_for_app_auth => 'ad_banners',
:available_for => [:admin]
end
end
end

View File

@ -1,17 +1,24 @@
{ {
"title": "announcement", "app_pages":["bulletins"],
"version": "0.1", "author":"RD dep",
"organization": "Rulingcom", "create_date":"11-11-2011",
"author": "RD dep", "enable_frontend":true,
"intro": "A simple blog……", "get_default_widget":{"query":"Bulletin.all","image":"image"},
"update_info": "Some info", "intro":"A simple blog",
"create_date": "11-11-2011", "key":"announcement",
"app_pages": ["bulletins"], "organization":"Rulingcom",
"widgets": { "title":"Announcement",
"index":["1","2","3","4","5"], "update_info":"Some info",
"bulletins_and_web_links":[] "version":"0.1",
}, "widget_fields":[["title","announcement.default_widget.title"],
"category": ["BulletinCategory"], ["bulletin_category_with_title","announcement.default_widget.bulletin_category_with_title"],
"widget_fields":["title","category","postdate"], ["postdate","announcement.default_widget.postdate"]],
"enable_frontend": true "widget_fields_link_method":{"title":{"method":"panel_announcement_front_end_bulletin_path","args":"self"},
} "bulletin_category_with_title":{"method":"panel_announcement_front_end_bulletins_path",
"args":{"category_id":["bulletin_category","id"]}
}},
"widget_options":null,
"widget_options_fields_i18n":null,
"widgets":{"index":["1","2"],
"default_widget":["typeA","typeC","typeB_style2","typeB_style3","typeB_style4"]
}}

View File

@ -1,7 +1,20 @@
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
include OrbitControllerLib::DivisionForDisable include OrbitControllerLib::DivisionForDisable
# if someone want to use json format replace with rss, please add :get_bulletins_json to below
before_filter :for_app_manager,:except => [:index,:get_categorys_json] # <<<<<<< HEAD
# before_filter :for_app_manager,:except => [:index,:get_categorys_json]
# before_filter :set_module_app
# def set_module_app
# @module_app = ModuleApp.where(:title=>'Announcement').first
# end
# =======
before_filter :for_app_manager,:except => [:index,:get_categorys_json,:get_bulletins_json]
before_filter :force_order_for_visitor,:only=>[:index,:get_categorys_json,:get_bulletins_json]
before_filter :force_order_for_user,:except => [:index,:get_categorys_json,:get_bulletins_json]
before_filter :for_app_sub_manager,:except => [:index,:get_categorys_json,:get_bulletins_json]
def index def index
@bulletin_categorys = get_categories_for_index("BulletinCategory") @bulletin_categorys = get_categories_for_index("BulletinCategory")

View File

@ -70,13 +70,6 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
end end
def bulletins_and_web_links
@tags = AnnouncementTag.any_in(key: ['students', 'alumni', 'employee', 'guest']).asc(:order)
@selected_tag = AnnouncementTag.find(params[:id]) rescue @tags[0]
@bulletins = @selected_tag.get_visible_bulletins(:postdate).available_for_lang(I18n.locale).can_display.page(params[:page]).per(5) rescue nil
@web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links(:created_at).available_for_lang(I18n.locale).page(params[:page]).per(5) rescue nil
end
def reload_bulletins def reload_bulletins
@selected_tag = AnnouncementTag.find(params[:tag_id]) @selected_tag = AnnouncementTag.find(params[:tag_id])
@bulletins = @selected_tag.get_visible_bulletins(:postdate).available_for_lang(I18n.locale).can_display.page(params[:page]).per(5) rescue nil @bulletins = @selected_tag.get_visible_bulletins(:postdate).available_for_lang(I18n.locale).can_display.page(params[:page]).per(5) rescue nil

View File

@ -1,23 +0,0 @@
<div class="tag_block">
<ul id='bulletins_web_links_tags' class="tag_list">
<%= render :partial => 'tag', :collection => @tags %>
</ul>
</div>
<div class="news_block">
<h3 class="news_title2"><%= link_to t("announcement.bulletins"), panel_announcement_front_end_bulletins_path, :class => 'more' %></h3>
<ul id='bulletins_web_links_bulletins' class="news_list">
<%= render 'bulletins' if @bulletins %>
</ul>
</div>
<div class="links_block">
<h3 class="links_title"><%= t(:related_links) %></h3>
<ul id='bulletins_web_links_web_links' class="links_list">
<%= render 'web_links' if @web_links %>
</ul>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "news_link" %>
<% end %>

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