diff --git a/Gemfile b/Gemfile index 07a50937..1e2a6448 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'http://rubygems.org' -gem 'rails' +gem 'rails', "~> 3.2.9" gem "brakeman" gem 'mime-types' @@ -11,7 +11,7 @@ gem "net-ldap", "~> 0.3.1" gem 'devise', '1.5.3' gem 'exception_notification' # Send error trace gem 'execjs' -gem 'jquery-rails' +gem 'jquery-rails', '2.1.4' gem 'jquery-ui-rails' gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git' diff --git a/app/assets/javascripts/desktop.js b/app/assets/javascripts/desktop.js index e5e4a05a..d8d67107 100644 --- a/app/assets/javascripts/desktop.js +++ b/app/assets/javascripts/desktop.js @@ -15,4 +15,3 @@ //= require orbitTimeline //= require orbitdesktop //= require desktop/books_pages -//= require desktop/seminar_pages diff --git a/app/assets/javascripts/mobile/orbit.mobile.js.erb b/app/assets/javascripts/mobile/orbit.mobile.js.erb index 2a567730..90531899 100644 --- a/app/assets/javascripts/mobile/orbit.mobile.js.erb +++ b/app/assets/javascripts/mobile/orbit.mobile.js.erb @@ -25,8 +25,8 @@ $('#index').live('pageinit',function(){ $(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)}); $(this).find(".newpic img").muImageResize({width: 280, height: 200}); $('.slideshow').cycle({ - fx:'scrollLeft', - timeout: 6000, + fx: $effect, + timeout: $timeout }); $(".newlist").css({ "width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30, @@ -40,8 +40,9 @@ $('#index').live('pageinit',function(){ $('#announcement_content').live('pageinit',function(){ $(this).find(".newpic img").muImageResize({width: 320, height: 220}); }); -var mobileDemo = { 'center': '24.987449, 121.576117', 'zoom': 17 }; + $('#map').live('pageinit', function() { + var mobileDemo = { 'center': $map_center, 'zoom': $map_zoom }; var $windowH = $(window).height(); $("#map_canvas").css({ 'height' : $windowH, @@ -50,7 +51,7 @@ $('#map').live('pageinit', function() { $('#map_canvas').gmap({'center': mobileDemo.center, 'zoom': mobileDemo.zoom, 'disableDefaultUI':false, 'callback': function() { var self = this; 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'); diff --git a/app/assets/javascripts/new_admin.js b/app/assets/javascripts/new_admin.js index c5ec022e..965a61b7 100644 --- a/app/assets/javascripts/new_admin.js +++ b/app/assets/javascripts/new_admin.js @@ -9,7 +9,6 @@ //= require jquery.form //= require bootstrap //= require jquery.masonry.min -//= require jquery.isotope.min //= require jquery.tinyscrollbar.min //= require orbit-1.0 //= require tinymce-jquery diff --git a/app/assets/javascripts/orbit-bar-search.js b/app/assets/javascripts/orbit-bar-search.js index cc422b12..265cd92b 100644 --- a/app/assets/javascripts/orbit-bar-search.js +++ b/app/assets/javascripts/orbit-bar-search.js @@ -1,28 +1,42 @@ -$(document).on('click', '.orbit-bar-search', function (){ - if ($(this).parents('.search').hasClass('visible')){ - $(this).parents('.search').stop().animate({ - 'width':'28px', - },500); - $('.navbar-search').stop().animate({ - 'left':'30px', - 'opacity':'0', - },200); - $(this).parents('.search').css({ - 'background-color': 'transparent', - }); - $(this).parents('.search').removeClass('visible'); - } - else{ - $(this).parents('.search').stop().animate({ - 'width':'265px', - },200); - $('.navbar-search').stop().animate({ - 'left':'7px', - 'opacity':'1' - },500); - $(this).parents('.search').css({ - 'background-color': 'rgba(0, 0, 0, 0.5)', - }); - $(this).parents('.search').addClass('visible'); - } -}); \ No newline at end of file + +$(document).ready(function(){ + $('.search').tooltip({ + placement: "bottom" + }); +}); +$(document).on('mouseenter', '.orbit-bar-search', function (){ + $(this).parents('.search').stop().animate({ + 'width':'265px', + },200); + $('.navbar-search').stop().animate({ + 'left':'4px', + 'opacity':'1' + },500); + $(this).parents('.search').css({ + 'background-color': 'rgba(0, 0, 0, 0.5)', + }); + $(this).parents('.search').addClass('visible'); +}); + + +$(document).on('mouseleave', '.search.visible', function (){ + $(this).stop().animate({ + 'width':'28px', + },500); + $('.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") +}) diff --git a/app/assets/javascripts/page_edit.js.erb b/app/assets/javascripts/page_edit.js.erb index 29047c7b..aec24de6 100644 --- a/app/assets/javascripts/page_edit.js.erb +++ b/app/assets/javascripts/page_edit.js.erb @@ -1,5 +1,11 @@ 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) { @@ -10,26 +16,26 @@ $("#page_design").live('change', function() { $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes'); }); -$("#page_module_app_id").live('change', function() { - var app_id = $(this).val(); - if(app_id!=''){ - $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_frontend_pages',function(data, textStatus){ - if(textStatus == 'success'){ - $(this).after(data); - } - }); - } - else{ - $("#app_page_url").children().remove(); - } -}); +// $("#page_module_app_id").live('change', function() { +// var app_id = $(this).val(); +// if(app_id!=''){ +// $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_after_module_changed',function(data, textStatus){ +// if(textStatus == 'success'){ +// $(this).after(data); +// } +// }); +// } +// else{ +// $("#app_page_url").children().remove(); +// } +// }); $("#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() { - $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_widget_styles?module_app_id=' + $("#module_app_list select").val() + '&part_id=' + get_part_id()); +$("#widget_list select,#frontend_list select").live('change', function() { + $.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() { diff --git a/app/assets/javascripts/site_editor.js b/app/assets/javascripts/site_editor.js index 5d77e701..3c7281bd 100644 --- a/app/assets/javascripts/site_editor.js +++ b/app/assets/javascripts/site_editor.js @@ -10,7 +10,6 @@ //= require jquery.ui.sortable //= require jquery_ujs //= require bootstrap -//= require jquery.isotope.min //= require jquery.tinyscrollbar.min //= require orbit-1.0 //= require orbit-bar-search diff --git a/app/assets/stylesheets/admin/default_widget_setting.css b/app/assets/stylesheets/admin/default_widget_setting.css index b3fe424d..1743849a 100644 --- a/app/assets/stylesheets/admin/default_widget_setting.css +++ b/app/assets/stylesheets/admin/default_widget_setting.css @@ -1,6 +1,11 @@ +label{ + white-space: nowrap !important; +} .style_switch{} -.style_switch ul{} +.style_switch ul{ + margin: 0; +} .style_switch li{ float: left; @@ -9,19 +14,22 @@ width: 103px; } .style_radio{ - margin: 0 0 5px 10px; + cursor: pointer; + margin: 0 0 0 10px; } .style_img{ display: block; - margin: 0 0 5px; + margin: 5px 0 5px -28px; } .style_description{ color: #6B6B6B; display: block; - margin: 0 0 0 5px; + font-size: 12px; + margin: 0 0 0 -25px; + white-space: normal; } label{ - white-space: nowrap !important ; -} \ No newline at end of file + white-space: nowrap !important ; +} diff --git a/app/assets/stylesheets/new_admin.css.erb b/app/assets/stylesheets/new_admin.css.erb index 2cb340da..325e9cb5 100644 --- a/app/assets/stylesheets/new_admin.css.erb +++ b/app/assets/stylesheets/new_admin.css.erb @@ -13,7 +13,6 @@ *= require list *= require widget *= require scroll_style - *= require isotope *= require icons *= require site-map *= require lib/bootstrap-datetimepicker diff --git a/app/controllers/admin/module_apps_controller.rb b/app/controllers/admin/module_apps_controller.rb index 9729a97a..da029420 100644 --- a/app/controllers/admin/module_apps_controller.rb +++ b/app/controllers/admin/module_apps_controller.rb @@ -9,32 +9,6 @@ class Admin::ModuleAppsController < ApplicationController 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 @module_app = ModuleApp.find(params[:id]) @@ -136,7 +110,6 @@ class Admin::ModuleAppsController < ApplicationController end #user is not permited to do that flash[:notice] = t('app_auth.operation_not_permitted') - render :nothing => true, :status => 403 - end - + render :nothing => true,:status => 403 + end end \ No newline at end of file diff --git a/app/controllers/admin/object_auths_controller.rb b/app/controllers/admin/object_auths_controller.rb index dab659b4..d407d3db 100644 --- a/app/controllers/admin/object_auths_controller.rb +++ b/app/controllers/admin/object_auths_controller.rb @@ -1,5 +1,5 @@ class Admin::ObjectAuthsController < ApplicationController - include OrbitCoreLib::PermissionUnility + include OrbitCoreLib::PermissionUtility layout "new_admin" before_filter :force_order # before_filter :is_admin? ,:only => :index diff --git a/app/controllers/admin/object_auths_new_interface_controller.rb b/app/controllers/admin/object_auths_new_interface_controller.rb index 3af52ac2..cb210877 100644 --- a/app/controllers/admin/object_auths_new_interface_controller.rb +++ b/app/controllers/admin/object_auths_new_interface_controller.rb @@ -1,7 +1,11 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController - include OrbitCoreLib::PermissionUnility + include OrbitCoreLib::PermissionUtility before_filter :force_order - + + def set_module_app + @module_app = ModuleApp.where(:title=>'Announcement').first + end + def setting @sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user @@ -59,6 +63,7 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController def force_order authenticate_user! + set_module_app setup_vars check_if_user_can_do_object_auth end diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index af6b0ed8..21050985 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -25,31 +25,28 @@ class Admin::PagePartsController < ApplicationController def edit @part = PagePart.find(params[:id]) @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 @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 + + 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.widgets.any?{|b| b.class == Array} + if @module_app && @module_app.widgets.any?{|b| b.class == Array} @widget_style = @module_app.widgets[@widget_path] if !@widget_path.blank? && !@module_app.widgets.blank? 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 def create @@ -59,9 +56,12 @@ class Admin::PagePartsController < ApplicationController def update @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_type] = nil - + 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 + + if params[:page_part][:module_app].blank? + params[:page_part][:module_app] = nil + end if @part.update_attributes(params[:page_part]) set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu') flash.now[:notice] = t('update.success.content') @@ -91,30 +91,14 @@ class Admin::PagePartsController < ApplicationController end def reload_widgets - @part = PagePart.find params[:part_id] - @categories =[] - @module_app = ModuleApp.find(params[:id]) - - @widget_path = @module_app.widgets.keys[0] if ( @module_app.widgets[0].blank? ) - + @part = PagePart.find params[:id] + @module_app = ModuleApp.find(params[:module_app_id]) rescue nil + @categories =@module_app ? @module_app.get_categories : [] + @tags =@module_app ? @module_app.get_tags : [] + @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? ) - 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 - - @part.widget_path = @module_app.widgets.first if @module_app.needs_to_widget_option? + @part.widget_path = @module_app.widgets.first if( @module_app) respond_to do |format| format.js {} end @@ -122,9 +106,11 @@ class Admin::PagePartsController < ApplicationController def reload_widget_styles @module_app = ModuleApp.find(params[:module_app_id]) - @part = PagePart.find params[:part_id] - @user_choose =@widget_path= params[:id] - @widget_style = @module_app.widgets[params[:id]] + + @part = PagePart.find params[:id] + @user_choose =@widget_path= params[:frontend] + @widget_style = @module_app.widgets[@widget_path] + respond_to do |format| format.js {} diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index 73ddc398..f2de0c9e 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -19,15 +19,21 @@ helper Admin::PagePartsHelper end 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 @module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc) @designs = Design.all.entries @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 @module_app = @item.module_app @@ -84,13 +90,13 @@ helper Admin::PagePartsHelper def update @item = Page.find(params[:id]) - 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 ) - 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 + 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 ) + 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 + if @item.update_attributes(params[:page]) flash[:notice] = t('update.success.page') respond_to do |format| @@ -123,7 +129,42 @@ helper Admin::PagePartsHelper format.js { @item = @item.parent } 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 @design = Design.find(params[:id]) @themes = @design.themes diff --git a/app/controllers/admin/plugins_controller.rb b/app/controllers/admin/plugins_controller.rb index 424a482d..57cb9ad8 100644 --- a/app/controllers/admin/plugins_controller.rb +++ b/app/controllers/admin/plugins_controller.rb @@ -4,7 +4,7 @@ class Admin::PluginsController < ApplicationController def index - @plugins = OrbitApp::Module::Registration.all + @plugins = OrbitApp::Plugin::Registration.all if(!params[:show_plugin_profile].nil?) diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index af06aa9a..23eace92 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -36,7 +36,7 @@ class Admin::UsersNewInterfaceController < OrbitBackendController def show @user = User.find(params[:id]) - @plugins = OrbitApp::Module::Registration.all + @plugins = OrbitApp::Plugin::Registration.all @profile_data = [] @teacher_data = [] diff --git a/app/controllers/default_widget_controller.rb b/app/controllers/default_widget_controller.rb index ba5e8ba5..637810cd 100644 --- a/app/controllers/default_widget_controller.rb +++ b/app/controllers/default_widget_controller.rb @@ -1,7 +1,12 @@ class DefaultWidgetController< OrbitWidgetController 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? end @@ -9,11 +14,17 @@ class DefaultWidgetController< OrbitWidgetController @tag_class = nil @default_widget = @page_part.module_app.get_default_widget - @widget_image_field = @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) + @widget_image_field = @default_widget["image"] || @default_widget[:image] + 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) - @fields = @page_part.widget_field - + case params[:type] when "typeA" @tag_class = 'default_widget_typeA' @@ -26,15 +37,6 @@ class DefaultWidgetController< OrbitWidgetController render "typeC" 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 diff --git a/app/controllers/desktop_publications_controller.000.rb b/app/controllers/desktop_publications_controller.000.rb deleted file mode 100644 index fc3f36ab..00000000 --- a/app/controllers/desktop_publications_controller.000.rb +++ /dev/null @@ -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 diff --git a/app/controllers/desktop_publications_controller.rb b/app/controllers/desktop_publications_controller.rb index ae77ed19..918b99e2 100644 --- a/app/controllers/desktop_publications_controller.rb +++ b/app/controllers/desktop_publications_controller.rb @@ -1,10 +1,6 @@ require 'mime/types' class DesktopPublicationsController< ApplicationController - #def journal_p - # render "desktop/journal_p", :layout => false - #end - def books render "desktop/books", :layout => false end @@ -16,44 +12,4 @@ class DesktopPublicationsController< ApplicationController 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 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 diff --git a/app/controllers/orbit_backend_controller.rb b/app/controllers/orbit_backend_controller.rb index 557070f4..7c25e6fc 100644 --- a/app/controllers/orbit_backend_controller.rb +++ b/app/controllers/orbit_backend_controller.rb @@ -1,10 +1,6 @@ class OrbitBackendController < ApplicationController - #before_filter :setup_vars - #before_filter :set_current_user - - # before_filter {|c| c.front_end_available(@app_title)} - # before_filter :check_user_can_use - include OrbitCoreLib::PermissionUnility + include OrbitCoreLib::AppBackendUtility + include OrbitCoreLib::PermissionUtility include AdminHelper include ApplicationHelper diff --git a/app/controllers/orbit_frontend_controller.rb b/app/controllers/orbit_frontend_controller.rb index e1be8167..386b8cda 100644 --- a/app/controllers/orbit_frontend_controller.rb +++ b/app/controllers/orbit_frontend_controller.rb @@ -1,3 +1,4 @@ class OrbitFrontendController< OrbitFrontendComponentController + end \ No newline at end of file diff --git a/app/controllers/orbit_widget_controller.rb b/app/controllers/orbit_widget_controller.rb index 47e24fe0..f006cd43 100644 --- a/app/controllers/orbit_widget_controller.rb +++ b/app/controllers/orbit_widget_controller.rb @@ -1,3 +1,4 @@ class OrbitWidgetController< OrbitFrontendComponentController + end \ No newline at end of file diff --git a/app/helpers/admin/page_parts_helper.rb b/app/helpers/admin/page_parts_helper.rb index e8a1afc4..818fe46b 100644 --- a/app/helpers/admin/page_parts_helper.rb +++ b/app/helpers/admin/page_parts_helper.rb @@ -10,43 +10,85 @@ module Admin::PagePartsHelper end def widget_field_options(i,local_item=nil) - local_item = @part if local_item.nil? - options = @module_app.widget_fields.collect{|widget_field| [I18n.t(widget_field[1]), widget_field[0]]} - options_for_select(options, (local_item[:widget_field][i][0] if (local_item && !local_item[:widget_field].blank? && !local_item[:widget_field][i].blank?)) ) + local_item = @part if local_item.nil? && @part + local_item = @page if local_item.nil? && @page + + 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 def widget_fiield_type_options(i,local_item=nil) options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]} - local_item = @part if local_item.nil? - 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 = @part if local_item.nil? && @part + 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 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 - 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 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 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 - 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") end end def show_default_widget_setting_panel - if @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget' - true - else - false - end + @module_app && @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget' end def show_custom_widget_setting_panel diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 120e1245..7cb28b96 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -16,7 +16,7 @@ module AdminHelper end def is_admin? - current_or_guest_user.admin? + current_or_guest_user.admin? rescue false end def is_member? diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5c6cca95..655a2090 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -54,8 +54,14 @@ module ApplicationHelper raw(formatted_messages.join) end - def link_back - link_to t('back'), get_go_back, :class => 'nav' + def link_back(custom_class=nil) + 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 # Clean the link back @@ -197,7 +203,6 @@ module ApplicationHelper javascripts << "\n" javascripts << "\n" javascripts << "\n" - javascripts << "\n" javascripts << "\n" javascripts << "\n" javascripts << "\n" diff --git a/app/helpers/default_widget_helper.rb b/app/helpers/default_widget_helper.rb index acab557c..645f50f0 100644 --- a/app/helpers/default_widget_helper.rb +++ b/app/helpers/default_widget_helper.rb @@ -49,7 +49,8 @@ module DefaultWidgetHelper when nil eval method_entry else - eval("#{method_entry}('#{object}')" ) + object = "'#{object.to_s}'" if object.class == BSON::ObjectId + eval("#{method_entry}(#{object})" ) end end diff --git a/app/models/item.rb b/app/models/item.rb index 6b34d8b8..a670435f 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -4,7 +4,8 @@ class Item include Mongoid::Timestamps include Mongoid::Tree include Mongoid::Tree::Ordering - + LIST = YAML.load(File.read('config/list.yml')) + field :name field :path field :is_published, :type => Boolean, :default => false @@ -15,7 +16,7 @@ class Item 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_presence_of :name validates_associated :parent, :children diff --git a/app/models/module_app.rb b/app/models/module_app.rb index ab88cdea..fb735438 100644 --- a/app/models/module_app.rb +++ b/app/models/module_app.rb @@ -1,111 +1,130 @@ class ModuleApp include Mongoid::Document include Mongoid::Timestamps - include OrbitCoreLib::ObjectTokenUnility + include OrbitCoreLib::ObjectTokenUtility + include OrbitApp::ModuleAppMembershipTools field :key field :title - field :version - field :organization - field :author - field :intro - field :update_info - field :create_date - field :enable_frontend, type: Boolean, :default => true + field :sidebar_order#,type: Integer + + def refetch_setting!(reg) + # %w{module_label category base_url version organization author intro update_info create_date}.each do |field| + # self[field.to_sym] = reg.send field + # end + 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 - # field :widgets ,type: Array - field :widgets ,type: Hash - field :widget_fields ,type: Array - field :widget_options,type:Hash - field :widget_options_fields_i18n,type:Hash - field :widget_fields_link_method,type:Hash - field :get_default_widget,type:Hash + # def app_pages + # get_registration.get_app_pages + # end + + + def enable_frontend? + self[:enable_frontend] + 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 :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 :pages has_one :app_auth,dependent: :delete - - before_save :set_key - - def is_manager?(user) - managing_users.include?(user) - end - - def is_sub_manager?(user) - sub_managing_users.include?(user) || is_manager?(user) - end - - def managing_users - 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 + + def get_tags + get_registration.get_tags end - def has_default_widget? - case self[:widgets] - when Array - false - when Hash - self[:widgets].has_key? 'default_widget' - end - + def get_categories + get_registration.get_categories end - protected - - def set_key - self.key = self.title.underscore.singularize if self.title + def module_name + I18n.t(get_registration.get_label_i18n) end + def get_registration + OrbitApp::Module::Registration.find_by_key(key) + end end diff --git a/app/models/object_auth.rb b/app/models/object_auth.rb index 6c7405ca..f2ef5c04 100644 --- a/app/models/object_auth.rb +++ b/app/models/object_auth.rb @@ -1,5 +1,5 @@ class ObjectAuth < PrototypeAuth - include OrbitCoreLib::ObjectTokenUnility + include OrbitCoreLib::ObjectTokenUtility validates_uniqueness_of :title ,:scope => [:obj_authable_type,:obj_authable_id] #{ |c| } belongs_to :obj_authable, polymorphic: true after_save :check_user_has_can_access_app diff --git a/app/models/page_part.rb b/app/models/page_part.rb index ebaac684..b48c8060 100644 --- a/app/models/page_part.rb +++ b/app/models/page_part.rb @@ -23,6 +23,15 @@ class PagePart before_save :delete_empty_widget_field 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 @@ -37,5 +46,4 @@ class PagePart self.page.save end - end \ No newline at end of file diff --git a/app/uploaders/location_uploader.rb b/app/uploaders/location_uploader.rb new file mode 100644 index 00000000..1c2ec99d --- /dev/null +++ b/app/uploaders/location_uploader.rb @@ -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 + diff --git a/app/views/admin/module_apps/_app_selector.html.erb b/app/views/admin/module_apps/_app_selector.html.erb index c20a3885..60cf2d6f 100644 --- a/app/views/admin/module_apps/_app_selector.html.erb +++ b/app/views/admin/module_apps/_app_selector.html.erb @@ -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 } %> diff --git a/app/views/admin/module_apps/reload_frontend_pages.js.erb b/app/views/admin/module_apps/reload_frontend_pages.js.erb deleted file mode 100644 index 4bfbd7fc..00000000 --- a/app/views/admin/module_apps/reload_frontend_pages.js.erb +++ /dev/null @@ -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' %>") diff --git a/app/views/admin/page_parts/_custom_widget_setting.html.erb b/app/views/admin/page_parts/_custom_widget_setting.html.erb index a257336e..998b5853 100644 --- a/app/views/admin/page_parts/_custom_widget_setting.html.erb +++ b/app/views/admin/page_parts/_custom_widget_setting.html.erb @@ -1,12 +1,20 @@ -
- <%= f.submit t(:update_) %> <%= link_back %> -
+- <%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %> - <%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil),:size=>30 %> -
- <% end %> +- - <%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :title, :selected => @module_app.id), {}, {:rel => admin_page_parts_path} %> -
+ +- - <%= f.select :widget_path, @module_app.widgets.collect{|k,v| [k.humanize, k]}, {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %> -
+本網站著作權屬於國立政治大學。
-RulingDigital 銳綸數位建置
+<%= t('mobile.copytight') %>
+<%= t('mobile.copytight_orbit') %>
diff --git a/app/views/mobile/index.mobile.erb b/app/views/mobile/index.mobile.erb index 7bbf2607..b91bc35b 100644 --- a/app/views/mobile/index.mobile.erb +++ b/app/views/mobile/index.mobile.erb @@ -23,4 +23,5 @@ diff --git a/app/views/mobile/map.mobile.erb b/app/views/mobile/map.mobile.erb index ba969acb..51e69dbf 100644 --- a/app/views/mobile/map.mobile.erb +++ b/app/views/mobile/map.mobile.erb @@ -2,4 +2,9 @@ <%= render 'header_map' %> <% end %> - \ No newline at end of file + + + \ No newline at end of file diff --git a/config/list.yml b/config/list.yml index bae7a90d..a3b48cfc 100644 --- a/config/list.yml +++ b/config/list.yml @@ -70,3 +70,10 @@ widget_field_type: - tag - viewcount - poster + +default_widget_style: + - style1 + - style2 + - style3 + - style4 + - style5 \ No newline at end of file diff --git a/config/locales/mobile.en.yml b/config/locales/mobile.en.yml index b72ca7c0..1b3327f1 100644 --- a/config/locales/mobile.en.yml +++ b/config/locales/mobile.en.yml @@ -4,8 +4,10 @@ en: bulletin: Bulletin contact: Contact copyright: Copyright + copyright_text: National Chengchi University © All RIGHTS RESERVED. + copyright_orbit: Developed by RulingDigital home: Home language: Language location: Location - location_description: '\\n \"\n\n\n; _erbout.concat((h frames.first.filename.split(\"/\").last ).to_s); _erbout.concat \"
\"\n; _erbout.concat((h frames.first.function ).to_s); _erbout.concat \"\\n
JUMP TO:\\n GET\\n POST\\n COOKIES\\n ENV\\n
\\n \\n\\n\"\n; _erbout.concat((h frame.filename ).to_s); _erbout.concat \"
in\\n \"\n; _erbout.concat((h frame.function ).to_s); _erbout.concat \"
\\n \"\n; _erbout.concat((h line ).to_s); _erbout.concat \"
\"; _erbout.concat((\n h frame.context_line ).to_s); _erbout.concat \"
\"\n; _erbout.concat((h line ).to_s); _erbout.concat \"
Variable | \\nValue | \\n
---|---|
\"\n\n; _erbout.concat((h key ).to_s); _erbout.concat \" | \\n\"\n; _erbout.concat((h val.inspect ).to_s); _erbout.concat \" | \\n
No GET data.
\\n \"\n\n; end ; _erbout.concat \"\\n \\nVariable | \\nValue | \\n
---|---|
\"\n\n; _erbout.concat((h key ).to_s); _erbout.concat \" | \\n\"\n; _erbout.concat((h val.inspect ).to_s); _erbout.concat \" | \\n
No POST data.
\\n \"\n\n; end ; _erbout.concat \"\\n \\nVariable | \\nValue | \\n
---|---|
\"\n\n; _erbout.concat((h key ).to_s); _erbout.concat \" | \\n\"\n; _erbout.concat((h val.inspect ).to_s); _erbout.concat \" | \\n
No cookie data.
\\n \"\n\n; end ; _erbout.concat \"\\n \\nVariable | \\nValue | \\n
---|---|
\"\n\n; _erbout.concat((h key ).to_s); _erbout.concat \" | \\n\"\n; _erbout.concat((h val ).to_s); _erbout.concat \" | \\n
You're seeing this error because you have\\nenabled the show_exceptions
setting.
<%= t('writing_seminar_category.key') %> | +<%= t('writing_conference_category.key') %> | <% if @types.is_localized?(:title) %> <% @site_valid_locales.each do |locale| %><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %> | <% end %> <% else %> -<%= t('writing_seminar_category.title') %> | +<%= t('writing_conference_category.title') %> | <% end %>
---|
- <%= t('add')%> + <%= t('add')%> 論文型態
- <%= t('add')%> + <%= t('add')%> 作者型態
<%= t(:year) %> | +<%= t(:title) %> | +
---|---|
<%= post.year %> | ++ <%= link_to post.create_link , panel_personal_conference_front_end_writing_conference_path(post) %> + | +
<%= t("writing_conference.year")%> | <%= @writing_conference.year %> |
---|---|
<%= t("writing_conference.language")%> | <%= @writing_conference.language %> |
<%= t("writing_conference.paper_title")%> | <%= @writing_conference.paper_title %> |
<%= t("writing_conference.conference_title")%> | <%= @writing_conference.conference_title %> |
<%= t("writing_conference.conference_paper_types")%> | <%= @conference_paper_types %> |
<%= t("writing_conference.conference_author_types")%> | <%= @conference_author_types %> |
<%= t("writing_conference.location")%> | <%= @writing_conference.location %> |
<%= t("writing_conference.sponsor")%> | <%= @writing_conference.sponsor %> |
<%= t("writing_conference.period_start_date")%> | <%= @writing_conference.period_start_date %> |
<%= t("writing_conference.period_end_date")%> | <%= @writing_conference.period_end_date %> |
<%= t("writing_conference.abstract")%> | <%= @writing_conference.abstract %> |
<%= t("writing_conference.publication_date")%> | <%= @writing_conference.publication_date %> |
<%= t("writing_conference.url")%> | <%= link_to t(:url), @writing_conference.url, {:target => '_blank', :title => @writing_conference.conference_title} if !@writing_conference.url.blank? %> |
<%= t("writing_conference.note")%> | <%= @writing_conference.note %> |
<%= t("writing_conference.authors")%> | <%= "#{User.from_id(@writing_conference.create_user_id).name rescue ''},#{@writing_conference.authors rescue ''}"%> |
<%= t("writing_conference.files")%> | +
+<% if @writing_conference.writing_conference_files.size > 0 %>
+
+
+
+ <% end %>
+
+ <% @writing_conference.writing_conference_files.each do | wsfile | %>
+ <%= link_to wsfile.title, wsfile.file.url, {:target => '_blank', :title => wsfile.title} if wsfile.file.file %>
+ <% end %>
+
+ |
+
<%= t('writing_conference.year') %> | +<%= t('writing_conference.title') %> | +
---|---|
<%= writing_conference.year %> | ++ <%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %> + | +
+ | + | + | + | + |
---|
File | -File Name | -Action | +<%= t("personal_journal.file")%> | +<%= t("personal_journal.file_name")%> | +<%= t("personal_journal.description") %> |
---|---|---|---|---|---|
- <%= writing_seminar_category.key %>
-
-
-
|
- <% if @types.is_localized?(:title) %>
- <% @site_valid_locales.each do |locale| %>
- <%= writing_seminar_category.title_translations[locale] rescue nil %> | - <% end %> - <% else %> -<%= writing_seminar_category.title %> | - <% end %> -|||
<%= list_author_type.title %> | -- - 編輯 - <%= link_to show_toggle_archive_btn(list_author_type), - polymorphic_path([:panel, :personal_seminar, :back_end, list_author_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> - | -||||
<%= list_paper_type.title %> | -- - 編輯 - <%= link_to show_toggle_archive_btn(list_paper_type), - polymorphic_path([:panel, :personal_seminar, :back_end, list_paper_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> - | -||||
- <% if (writing_seminar.create_user_id == current_user.id) || is_manager? %> - <%= check_box_tag 'to_delete[]', writing_seminar.id, false, :class => "checkbox_in_list" %> - <% end -%> - | -<%= writing_seminar.year %> | -
- <%= link_to writing_seminar.create_link, panel_personal_seminar_front_end_writing_seminar_path(writing_seminar) %>
-
-
-
|
- <%= User.from_id(writing_seminar.create_user_id).name rescue ''%> | -
<%= t(:year) %> | -<%= t(:title) %> | -
---|---|
<%= post.year %> | -- <%= link_to post.create_link , panel_personal_seminar_front_end_writing_seminar_path(post) %> - | -
<%= t("writing_seminar.year")%> | <%= @writing_seminar.year %> |
---|---|
<%= t("writing_seminar.language")%> | <%= @writing_seminar.language %> |
<%= t("writing_seminar.paper_title")%> | <%= @writing_seminar.paper_title %> |
<%= t("writing_seminar.seminar_title")%> | <%= @writing_seminar.seminar_title %> |
<%= t("writing_seminar.seminar_paper_types")%> | <%= @seminar_paper_types %> |
<%= t("writing_seminar.seminar_author_types")%> | <%= @seminar_author_types %> |
<%= t("writing_seminar.location")%> | <%= @writing_seminar.location %> |
<%= t("writing_seminar.sponsor")%> | <%= @writing_seminar.sponsor %> |
<%= t("writing_seminar.period_start_date")%> | <%= @writing_seminar.period_start_date %> |
<%= t("writing_seminar.period_end_date")%> | <%= @writing_seminar.period_end_date %> |
<%= t("writing_seminar.abstract")%> | <%= @writing_seminar.abstract %> |
<%= t("writing_seminar.publication_date")%> | <%= @writing_seminar.publication_date %> |
<%= t("writing_seminar.url")%> | <%= link_to t(:url), @writing_seminar.url, {:target => '_blank', :title => @writing_seminar.seminar_title} if !@writing_seminar.url.blank? %> |
<%= t("writing_seminar.note")%> | <%= @writing_seminar.note %> |
<%= t("writing_seminar.authors")%> | <%= "#{User.from_id(@writing_seminar.create_user_id).name rescue ''},#{@writing_seminar.authors rescue ''}"%> |
<%= t("writing_seminar.files")%> | -
-<% if @writing_seminar.writing_seminar_files.size > 0 %>
-
-
-
- <% end %>
-
- <% @writing_seminar.writing_seminar_files.each do | wsfile | %>
- <%= link_to wsfile.title, wsfile.file.url, {:target => '_blank', :title => wsfile.title} if wsfile.file.file %>
- <% end %>
-
- |
-
<%= t('writing_seminar.year') %> | -<%= t('writing_seminar.title') %> | -
---|---|
<%= writing_seminar.year %> | -- <%= link_to writing_seminar.create_link, panel_personal_seminar_front_end_writing_seminar_path(writing_seminar) %> - | -
- | - | - | - | - |
---|