member plugin edit

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

No files matched your search

+49
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
+24 -17
View File
@@ -1,17 +1,24 @@
{
"title": "announcement",
"version": "0.1",
"organization": "Rulingcom",
"author": "RD dep",
"intro": "A simple blog……",
"update_info": "Some info",
"create_date": "11-11-2011",
"app_pages": ["bulletins"],
"widgets": {
"index":["1","2","3","4","5"],
"bulletins_and_web_links":[]
},
"category": ["BulletinCategory"],
"widget_fields":["title","category","postdate"],
"enable_frontend": true
}
{
"app_pages":["bulletins"],
"author":"RD dep",
"create_date":"11-11-2011",
"enable_frontend":true,
"get_default_widget":{"query":"Bulletin.all","image":"image"},
"intro":"A simple blog",
"key":"announcement",
"organization":"Rulingcom",
"title":"Announcement",
"update_info":"Some info",
"version":"0.1",
"widget_fields":[["title","announcement.default_widget.title"],
["bulletin_category_with_title","announcement.default_widget.bulletin_category_with_title"],
["postdate","announcement.default_widget.postdate"]],
"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"]
}}
@@ -1,7 +1,20 @@
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
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
@bulletin_categorys = get_categories_for_index("BulletinCategory")
@@ -70,13 +70,6 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
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
@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
@@ -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 %>
@@ -1,3 +0,0 @@
$('#bulletins_web_links_tags').html("<%= j render :partial => 'tag', :collection => @tags %>")
$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' if @bulletins %>")
$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>")
@@ -11,10 +11,21 @@ zh_tw:
editing_announcement_category: 編輯公告類別
error:
no_avilb_cate_for_posting: 公告必需有一個類別才能發送,請與管理員聯絡
front_end:
bulletins: 請LIN給名字前台頁
new_bulletin_category: 新增公告類別
search: 搜尋公告
update_bulletin_success: 公告已成功更新
update_bulletin_category_success: 公告類別已成功更新
widget:
index: 目錄Widget
bulletins_and_web_links: 公告與連結並排Widget
#init don't merge
all_articles: 全部公告
add_new: 新增
categories: 分類
approval_setting: 審核權限
tags: 標籤
default_widget:
bulletin_category_with_title: 分類
title: 標題
+128 -17
View File
@@ -1,25 +1,136 @@
# module Announcement
# OrbitApp.registration "Announcement",:type=> 'ModuleApp' do
module Announcement
OrbitApp.registration "Announcement",:type=> 'ModuleApp' do
module_label 'announcement.announcement'
base_url File.expand_path File.dirname(__FILE__)
# base_url File.expand_path File.dirname(__FILE__)
# personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile"
# personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile",:i18n=>'announcement.announcement'
version "0.1"
organization "Rulingcom"
author "RD dep"
intro "I am intro"
update_info 'some update_info'
# end
front_end do
app_page 'bulletins' do
frontend_i18n "announcement.front_end.bulletins"
end
end
# end
category ["BulletinCategory"]
widgets do
default_widget do
query 'Bulletin.all'
image :image
field :postdate
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:bulletin_category,:id]}}
end
categories_query 'BulletinCategory.all'
tags_query 'AnnouncementTag.all'
customize_widget "index" do
widget_i18n "announcement.widget.index"
style ["1","2"]
end
# item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"]
# item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links"
end
side_bar do
head_label_i18n 'admin.announcement',:icon_class=>"icons-megaphone"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:private=>['bulletins', 'bulletin_categorys', 'approvals','tags']})
active_for_object_auth ['BulletinCategory']
head_link_path "panel_announcement_back_end_bulletins_path"
context_link 'announcement.all_articles',
:link_path=>"panel_announcement_back_end_bulletins_path" ,
:priority=>2,
:active_for_action=>{:bulletins=>:index},
:available_for => [:all]
context_link 'announcement.add_new',
:link_path=>"new_panel_announcement_back_end_bulletin_path" ,
:priority=>1,
:active_for_action=>{:bulletins=>:new},
:available_for => [:sub_manager]
context_link 'announcement.categories',
:link_path=>"panel_announcement_back_end_bulletin_categorys_path" ,
:priority=>3,
:active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:manager]
# OrbitApp.backend_side_bar 'News' do
# block :available_for => [:admin,:guest,:manager,:sub_manager],
# :active_for_controllers=> ['news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals'],
# :active_for_ob_auths_object => ['NewsBulletinCategory'],
# :head_link => panel_news_back_end_news_bulletins_path ,
# :head_label=> I18n.t(:news)
context_link 'announcement.tags',
:link_path=>"panel_announcement_back_end_tags_path" ,
:priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:manager]
# context_link :link=>new_panel_news_back_end_news_bulletin_path ,
# :priority=>1,:label=>I18n.t('announcement.add_new'),
# :active_for_action=>{:news_bulletins=>:new}
# end
# widgets do
# default_widget do
# query 'Bulletin.all'
# image :image
# end
# categories_query 'BulletinCategory.all'
# tags_query 'AnnouncementTag.all'
# customize_widget "index","announcement.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","announcement.widget.bulletins_and_web_links"
# # item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"]
# # item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links"
# end
# side_bar do
# head_label_i18n 'admin.announcement',:icon_class=>"icons-megaphone"
# available_for [:admin,:guest,:manager,:sub_manager]
# active_for_controllers ({:private=>['bulletins', 'bulletin_categorys', 'approvals','tags']})
# active_for_object_auth ['BulletinCategory']
# head_link_path "panel_announcement_back_end_bulletins_path"
# context_link 'announcement.all_articles',
# :link_path=>"panel_announcement_back_end_bulletins_path" ,
# :priority=>1,
# :active_for_action=>{:bulletins=>:index},
# :available_for => [:all]
# context_link 'announcement.add_new',
# :link_path=>"new_panel_announcement_back_end_bulletin_path" ,
# :priority=>2,
# :active_for_action=>{:bulletins=>:new},
# :available_for => [:sub_manager]
# context_link 'announcement.categories',
# :link_path=>"panel_announcement_back_end_bulletin_categorys_path" ,
# :priority=>3,
# :active_for_action=>{:bulletin_categorys=>:index},
# :available_for => [:manager]
# context_link 'announcement.tags',
# :link_path=>"panel_announcement_back_end_tags_path" ,
# :priority=>4,
# # :active_for_action=>{:bulletin_categorys=>:index},
# :available_for => [:manager]
context_link 'announcement.approval_setting',
:link_path=>"panel_announcement_back_end_approval_setting_path" ,
:priority=>5,
:active_for_action=>{:approvals=>:setting},
:active_for_object_auth => 'BulletinCategory',
:available_for => [:manager]
context_link 'admin.module.authorization',
:link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'Announcement'}))",
:priority=>6,
:active_for_app_auth => 'Announcement',
:available_for => [:admin]
end
end
end
+3 -1
View File
@@ -1,7 +1,9 @@
zh_tw:
_locale: 中文
archive:
widget:
archive_files: 檔案室Wiget
add: 新增
back: 回去
create: 創造
+69
View File
@@ -0,0 +1,69 @@
module Archive
OrbitApp.registration "Archive",:type=> 'ModuleApp' do
module_label 'miss_module_i18n.archive'
base_url File.expand_path File.dirname(__FILE__)
# personal_plugin :enable => true,:path=>"panel/archive/plugin/profile",:i18n=>'miss_plugin_i18n.archive'
# =======
# personal_plugin :enable => true,:path=>"panel/archive/plugin/profile",:i18n=>'admin.archive'
# >>>>>>> 858e942da234fffa3053a995231f2b0d9eee43d1
version "0.1"
organization "Rulingcom"
author "RD dep"
intro "I am intro"
update_info 'some update_info'
front_end do
app_page 'archive_files'
end
widgets do
# default_widget do
# query 'Bulletin.all'
# image :image
# end
# categories_query 'BulletinCategory.all'
# tags_query 'ArchiveTag.all'
customize_widget "archive_files" do
widget_i18n "archive.widget.archive_files"
style []
end
end
side_bar do
head_label_i18n 'miss_module_i18n.archive',:icon_class=>"icons-archive"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:private=>['archive_file_categorys','archive_files'],:public=>['panel/archive/back_end/tags']})
active_for_object_auth ['BulletinCategory']
head_link_path "panel_archive_back_end_archive_files_path"
context_link 'miss_module_i18n._archive.all',
:link_path=>"panel_archive_back_end_archive_files_path" ,
:priority=>1,
:active_for_action=>{:archive_files=>:index},
:available_for => [:all]
context_link 'add',
:link_path=>"new_panel_archive_back_end_archive_file_path" ,
:priority=>2,
:active_for_action=>{:archive_files=>:new},
:available_for => [:admin]
context_link 'categories',
:link_path=>"panel_archive_back_end_archive_file_categorys_path" ,
:priority=>3,
:active_for_action=>{:archive_file_categorys=>:index},
:available_for => [:manager]
context_link 'tags',
:link_path=>"panel_archive_back_end_tags_path" ,
:priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:admin]
end
end
end
+34
View File
@@ -0,0 +1,34 @@
module Calendar
OrbitApp.registration "Calendar",:type=> 'ModuleApp' do
module_label 'miss_module_i18n.calendar'
base_url File.expand_path File.dirname(__FILE__)
# personal_plugin :enable => true,:path=>"panel/calendar/plugin/profile",:i18n=>'admin.calendar'
version "0.1"
organization "Rulingcom"
author "RD dep"
intro "I am intro"
update_info 'some update_info'
side_bar do
head_label_i18n 'miss_module_i18n.calendar',:icon_class=>"icons-calendar"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:private=>['cals','calendar_categories'],:public=>['panel/calendar/back_end/tags']})
head_link_path "panel_calendar_back_end_cals_path"
context_link 'calendar.calendars',
:link_path=>"new_panel_calendar_back_end_cal_path" ,
:priority=>1,
:active_for_action=>{:cals=>:new},
:available_for => [:manager]
context_link 'tags',
:link_path=>"panel_calendar_back_end_tags_path" ,
:priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:manager]
end
end
end
@@ -1,17 +1,21 @@
class GalleryCategory
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCoreLib::ObjectAuthable
include OrbitCoreLib::ObjectAuthable
ObjectAuthTitlesOptions = %W{new_album}
APP_NAME = "album"
ObjectAuthTitlesOptions = %W{new_album}
APP_NAME = "album"
field :name, localize: true
field :name, localize: true
has_many :gallery_albums, :autosave => true, :dependent => :destroy
has_many :gallery_albums, :autosave => true, :dependent => :destroy
def pp_object
name
end
def title
name
end
def pp_object
name
end
end
@@ -23,6 +23,8 @@ zh_tw:
edit: 編輯
delete_selected: 刪除選擇項目
del_album?: "要刪除這本相簿嗎?"
front_end:
albums: 相簿前台
album_not_found: 找不到此相簿
pic_not_found: 找不到該照片
save: 儲存
@@ -33,6 +35,8 @@ zh_tw:
set_cover: 設為封面
sure?: "你確定嗎?"
no_description: 沒有描述
widget:
widget1: Widget1
widget_option:
horizontal: 水平圖片數量
vertical: 垂直圖片數量
+70
View File
@@ -0,0 +1,70 @@
module Gallery
OrbitApp.registration "Gallery",:type=> 'ModuleApp' do
module_label 'miss_module_i18n.gallery'
base_url File.expand_path File.dirname(__FILE__)
# personal_plugin :enable => true,:path=>"panel/gallery/plugin/profile",:i18n=>'admin.gallery'
version "0.1"
organization "Rulingcom"
author "Visual dep"
intro "A simple and amazing gallery"
update_info 'some update_info'
front_end do
app_page 'albums' do
frontend_i18n "gallery.front_end.albums"
end
end
category ["gallery_categories"]
widgets do
# default_widget do
# query 'Bulletin.all'
# image :image
# end
categories_query 'GalleryCategory.all'
# tags_query 'GalleryTag.all'
#* customize_widget "albums","gallery.widget.albums",:fields=>[],:style=>[],:options=>{"widget1"=>{"vertical"=>[1, 2], "horizontal"=>[1, 2, 3, 4, 5, 6], "album_id"=>{"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}}}
#* customize_widget_options_fields_i18n({"widget1"=>{"vertical"=>"gallery.widget_option.vertical", "horizontal"=>"gallery.widget_option.horizontal", "album_id"=>"gallery.widget_option.album"}} )
customize_widget "widget1" do
widget_i18n "gallery.widget.widget1"
style []
options "vertical",:i18n => "gallery.widget_option.vertical",:options_item=>[1, 2]
options "horizontal",:i18n => "gallery.widget_option.horizontal",:options_item=>[1, 2,3,4,5,6]
options "album_id",:i18n =>"gallery.widget_option.album",:options_item => {"query"=>"GalleryAlbum.all", "value"=>:id, "label"=>:name}
end
end
side_bar do
head_label_i18n 'miss_module_i18n.gallery',:icon_class=>"icons-pictures"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:private=>['albums','album_images','gallery_categories','/panel/gallery/back_end/tags']})
active_for_object_auth ['BulletinCategory']
head_link_path "panel_gallery_back_end_albums_path"
context_link 'gallery.categories',
:link_path=>"panel_gallery_back_end_gallery_categories_path" ,
:priority=>3,
:active_for_action=>{:gallery_categories=>:index},
:available_for => [:manager]
context_link 'tags',
:link_path=>"panel_gallery_back_end_tags_path" ,
:priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:manager]
context_link 'module_authorization',
:link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'Gallery'}))",
:priority=>6,
:active_for_app_auth => 'gallery',
:available_for => [:admin]
end
end
end
@@ -0,0 +1,2 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
@@ -0,0 +1,4 @@
/*
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/
@@ -0,0 +1,77 @@
class Panel::Locations::BackEnd::LocationsController < OrbitBackendController
#before_filter :clean_values, :only => [:create, :update]
before_filter :force_order_for_visitor,:only => [:index, :new, :edit, :delete]
before_filter :force_order_for_user,:except => [:get_locations,:index]
#before_filter :for_app_sub_manager,:except => [:index, :new, :edit, :delete, :get_locations]
def index
@locations = Location.all
respond_to do |format|
format.html # new.html.erb
format.json { render json: @locations }
end
end
def new
@location = Location.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @location }
end
end
def edit
@location = Location.find(params[:id])
end
def show
@location = Location.find(params[:id])
respond_to do |format|
format.html
format.json { render json: @location }
end
end
def create
@location = Location.new(params[:location])
@location.save!
redirect_to panel_gprs_back_end_locations_url
end
def update
@location = Location.find(params[:id])
@location.update_attributes(params[:location])
redirect_to panel_gprs_back_end_locations_url
end
def destroy
@location = Location.find(params[:id])
@location.destroy
redirect_to panel_gprs_back_end_locations_url
end
def get_locations
locations = Location.all
@data = Array.new
locations.each do |location|
picurl = location.file.blank? ? '' : "http://#{request.host_with_port + location.file.url}"
thumburl = location.file.blank? ? '' : "http://#{request.host_with_port + location.file.thumb.url}"
@data << { name: location.name,
pic_url: picurl,
thumb_url: thumburl,
longitude: location.longitude,
latitude: location.latitude,
description: location.description }
end
#print readable json
render :json => JSON.pretty_generate({location: @data})
#render :json => {location: @data}.to_json
end
end
@@ -0,0 +1,2 @@
module Panel::Locations::BackEnd::LocationsHelper
end
+11
View File
@@ -0,0 +1,11 @@
class Location
include Mongoid::Document
include Mongoid::Timestamps
mount_uploader :file, LocationUploader
field :name
field :description
field :longitude, type: Float
field :latitude, type: Float
end
+43
View File
@@ -0,0 +1,43 @@
module Location
OrbitApp.registration "Location",:type=> 'ModuleApp' do
module_label 'miss_module_i18n.location'
base_url File.expand_path File.dirname(__FILE__)
# personal_plugin :enable => true,:path=>"panel/location/plugin/profile",:i18n=>'admin.location'
# 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 'LocationTag.all'
# customize_widget "index","location.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","location.widget.bulletins_and_web_links"
# # item "index","location.widget.index",:default_template=>true,:fields=>["title","category","postdate"]
# # item "bulletins_and_web_links","location.widget.bulletins_and_web_links"
# end
side_bar do
head_label_i18n 'miss_module_i18n.location',:icon_class=>"icons-location"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:private=>['locations']})
head_link_path "panel_location_back_end_locations_path"
end
end
end
+1 -1
View File
@@ -1,4 +1,4 @@
require "location/engine"
require "gprs/engine"
module Location
end
@@ -0,0 +1,14 @@
require 'test_helper'
class Panel::Location::BackEnd::LocationsControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end
test "should get edit" do
get :edit
assert_response :success
end
end
@@ -0,0 +1,4 @@
require 'test_helper'
class Panel::Location::BackEnd::LocationsHelperTest < ActionView::TestCase
end
@@ -0,0 +1,24 @@
zh_tw:
miss_module_i18n:
archive: 檔案室
_archive:
all: 全部檔案
calendar: 日曆模組
calendars: 日曆
gallery: 相簿
location: (未命名)Location
ad_banner: 廣告輪播
miss_plugin_i18n:
personal_book: Personal Book
personal_diploma: Personal Diploma
personal_experience: Personal Experience
personal_honor: Personal Honor
personal_journal: Personal Journal
personal_lab: Personal Lab
personal_patent: Personal Patent
personal_project: Personal Project
personal_research: Personal Research
personal_conference: Personal Conference
+33
View File
@@ -0,0 +1,33 @@
module PageContent
OrbitApp.registration "PageContent",:type=> 'ModuleApp' do
module_label 'page'
base_url File.expand_path File.dirname(__FILE__)
# personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile",:i18n=>'admin.announcement'
version "0.1"
organization "Rulingcom"
author "RD dep"
intro "I am intro"
update_info 'some update_info'
front_end do
app_page 'page_contexts'
end
side_bar do
head_label_i18n 'page',:icon_class=>"icons-page"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:private=>['page_contexts']})
active_for_object_auth ['PageContext']
head_link_path "panel_page_content_back_end_page_contexts_path"
context_link 'module_authorization',
:link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'PageContent'}))",
:priority=>1,
:active_for_app_auth => 'PageContext',
:available_for => [:admin]
end
end
end
@@ -313,7 +313,7 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
# end
def get_plugins
@plugins = OrbitApp::Module::Registration.all
@plugins = OrbitApp::Plugin::Registration.all
end
def get_tags
+4 -4
View File
@@ -1,8 +1,8 @@
module PersonalBook
OrbitApp.registration "Book",:type=> 'ModuleApp' do
base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_book/plugin/profile",:admin_path=>"/panel/personal_book/back_end/writing_books",:i18n=>'admin.personal_book'
OrbitApp.registration "PersonalBook",:type=> 'ModuleApp' do
module_label 'miss_plugin_i18n.personal_book'
base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_book/plugin/profile",:admin_path=>"/panel/personal_book/back_end/writing_books",:i18n=>'miss_plugin_i18n.personal_book'
end
@@ -1,6 +1,6 @@
source "http://rubygems.org"
# Declare your gem's dependencies in personal_seminar.gemspec.
# Declare your gem's dependencies in personal_conference.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec
@@ -14,7 +14,7 @@ end
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'PersonalSeminar'
rdoc.title = 'PersonalConference'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
@@ -0,0 +1 @@
//= require_tree ./personal_conference/desktop
@@ -0,0 +1,58 @@
orbitDesktop.prototype.initializeConference = function(target,url,cache){
this.initializeConference.list = function(){
var bindHandlers = function(){
o.tinyscrollbar_ext({
main : ".tinycanvas",
fill : ".list_t"
})
}
bindHandlers();
}
this.initializeConference.addconference = function(){
var bindHandlers = function(){
o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
})
}
bindHandlers();
}
this.initializeConference.conference = function(){
var bindHandlers = function(){
o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
})
}
bindHandlers();
}
this.initializeConference.coauthor = function(){
var bindHandlers = function(){
o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
})
}
bindHandlers();
}
this.initializeConference.list();
}
@@ -0,0 +1,8 @@
class Panel::PersonalConference::BackEnd::ConferenceAuthorTypesController < Panel::PersonalConference::BackEnd::WritingConferenceCategorysController
def initialize
super
@app_type = 'conference_author_type'
end
end
@@ -0,0 +1,8 @@
class Panel::PersonalConference::BackEnd::ConferencePaperTypesController < Panel::PersonalConference::BackEnd::WritingConferenceCategorysController
def initialize
super
@app_type = 'conference_paper_type'
end
end
@@ -0,0 +1,8 @@
class Panel::PersonalConference::BackEnd::TagsController < Admin::TagsController
def initialize
super
@app_title = 'personal_conference'
end
end
@@ -0,0 +1,145 @@
class Panel::PersonalConference::BackEnd::WritingConferenceCategorysController < OrbitBackendController
include OrbitControllerLib::DivisionForDisable
before_filter :force_order_for_visitor,:only=>[:index,:show]
before_filter :force_order_for_user,:except => [:index,:show]
before_filter :for_app_manager,:except => [:index]
def index
get_types
@writing_conference_categorys = @types.all
@writing_conference_category = @types.new(:display => 'List')
# @url = panel_personal_conference_back_end_writing_conference_categorys_path
@url = eval("panel_personal_conference_back_end_#{@app_type}s_path")
respond_to do |format|
format.html # index.html.erb
format.js
end
end
# GET /writing_conferences/1
# GET /writing_conferences/1.xml
def show
get_types
@writing_conference_category = @types.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.js
end
end
# GET /writing_conferences/new
# GET /writing_conferences/new.xml
def new
get_types
@writing_conference_category = @types.new(:display => 'List')
@verb = :post
respond_to do |format|
format.html # new.html.erb
format.js
end
end
# GET /writing_conferences/1/edit
def edit
get_types
@writing_conference_category = @types.find(params[:id])
# @url = panel_personal_conference_back_end_writing_conference_category_path(@writing_conference_category)
# @url = eval("panel_personal_conference_back_end_#{@app_type}_path(@writing_conference_category)")
@url = polymorphic_path([:panel, :personal_conference, :back_end, @writing_conference_category])
@verb = :put
respond_to do |format|
format.html
format.js
end
end
# POST /writing_conferences
# POST /writing_conferences.xml
def create
get_types
@writing_conference_category = @types.new(params[:writing_conference_category])
respond_to do |format|
if @writing_conference_category.save
format.html { redirect_to(panel_personal_conference_back_end_writing_conference_categorys_url, :notice => t('writing_conference_category.create_writing_conference_category_success')) }
format.js
else
format.html { render :action => "new" }
format.js { render action: "new" }
end
end
end
# PUT /writing_conferences/1
# PUT /writing_conferences/1.xml
def update
get_types
@writing_conference_category = @types.find(params[:id])
# debugger
# @url = panel_personal_conference_back_end_writing_conference_category_path(@writing_conference_category)
# @url = eval("panel_personal_conference_back_end_#{@app_type}_path(#{@writing_conference_category})")
@url = polymorphic_path([:panel, :personal_conference, :back_end, @writing_conference_category])
respond_to do |format|
if @writing_conference_category.update_attributes(params[:writing_conference_category])
format.html { redirect_to(panel_personal_conference_back_end_writing_conference_categorys_url, :notice => t('writing_conference_category.update_writing_conference_category_success')) }
# format.xml { head :ok }
format.js
else
format.html { render :action => "edit" }
format.js { render :action => "edit" }
end
end
end
# DELETE /writing_conferences/1
# DELETE /writing_conferences/1.xml
def destroy
get_types
@writing_conference_category = @types.find(params[:id])
@writing_conference_category.disable = @writing_conference_category.disable ? false : true
if @writing_conference_category.save!
respond_to do |format|
format.html { redirect_to(panel_personal_conference_back_end_writing_conference_categorys_url) }
# format.xml { head :ok }
format.js
end
else
flash[:error] = t("writing_conference_category.update_failed")
format.html { render :action => "index" }
end
end
protected
def get_types
@types = @app_type.classify.constantize
end
end
@@ -0,0 +1,323 @@
class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBackendController
include AdminHelper
include OrbitControllerLib::DivisionForDisable
before_filter :authenticate_user!
before_filter :force_order_for_visitor,:only=>[:index,:show]
before_filter :force_order_for_user,:except => [:index,:show]
before_filter :only => [ :new,:edit,:update] do |controller|
controller.get_categorys('WritingConferenceCategory')
end
def index
get_plugins
get_categorys("ConferencePaperType",params[:conference_paper_type_id])
@filter = params[:filter]
new_filter = params[:new_filter]
if @filter && params[:clear]
@filter.delete(params[:type])
elsif @filter && new_filter
if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s)
@filter[new_filter[:type]].delete(new_filter[:id].to_s)
elsif @filter.has_key?(new_filter[:type])
@filter[new_filter[:type]] << new_filter[:id].to_s
else
@filter.merge!({new_filter[:type] => [new_filter[:id].to_s]})
end
elsif new_filter
@filter = {new_filter[:type] => [new_filter[:id].to_s]}
end
@paper_types = ConferencePaperType.all
@paper_type_ids = @paper_types.collect{|t| t.id.to_s} + [nil]
# @writing_conferences = WritingConference.search(params[:category_id])
#@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_conferences : WritingConference.all.page(params[:page]).per(10)
@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_conference",:conference_paper_type_id.in => @paper_type_ids) : get_viewable("writing_conference",:conference_paper_type_id.in => @paper_type_ids)
get_tags
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @writing_conferences }
format.js
end
end
def writing_conference_setting
get_plugins
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
get_tags
@set_author_type = ConferenceAuthorType.new(:display => 'List')
@author_type_url = panel_personal_conference_back_end_writing_conferences_path
@set_paper_type = ConferencePaperType.new(:display => 'List')
@paper_type_url = panel_personal_conference_back_end_writing_conferences_path
end
def paper_type_quick_add
@set_paper_type = ConferencePaperType.new(:display => 'List')
@paper_type_url = panel_personal_conference_back_end_writing_conferences_path
@set_paper_type.id = params[:id]
respond_to do |format|
format.js
end
end
def paper_type_quick_edit
@set_paper_type = ConferencePaperType.find(params[:writing_conference_id])
@paper_type_url = panel_personal_conference_back_end_writing_conference_path(@set_paper_type)
respond_to do |format|
format.js
end
end
def author_type_quick_add
@set_author_type = ConferenceAuthorType.new(:display => 'List')
@author_type_url = panel_personal_conference_back_end_writing_conferences_path
@set_author_type.id = params[:id]
respond_to do |format|
format.js
end
end
def author_type_quick_edit
@set_author_type = ConferenceAuthorType.find(params[:writing_conference_id])
@author_type_url = panel_personal_conference_back_end_writing_conference_path(@set_author_type)
respond_to do |format|
format.js
end
end
# GET /writing_conferences/1
# GET /writing_conferences/1.xml
def show
@writing_conference = WritingConference.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @writing_conference }
end
end
# GET /writing_conferences/new
# GET /writing_conferences/new.xml
def new
get_plugins
@writing_conference = WritingConference.new
# @writing_conference_files = WritingConferenceFile.all
# @paper_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
get_tags
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @writing_conference }
end
end
# GET /writing_conferences/1/edit
def edit
get_plugins
@writing_conference = WritingConference.find(params[:id])
# @paper_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
get_tags
end
# POST /writing_conferences
# POST /writing_conferences.xml
def create
if params[:conference_paper_type]
@conference_paper_type = ConferencePaperType.new(params[:conference_paper_type])
respond_to do |format|
if @conference_paper_type.save
format.js { render 'create_writing_conference_setting' }
end
end
elsif params[:conference_author_type]
@conference_author_type = ConferenceAuthorType.new(params[:conference_author_type])
respond_to do |format|
if @conference_author_type.save
format.js { render 'create_writing_conference_setting' }
end
end
else
# @paper_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
get_tags
@writing_conference = WritingConference.new(params[:writing_conference])
if params[:writing_conference][:user_id]
@writing_conference.create_user_id = params[:writing_conference][:user_id]
@writing_conference.update_user_id = params[:writing_conference][:user_id]
else
@writing_conference.create_user_id = current_user.id
@writing_conference.update_user_id = current_user.id
end
respond_to do |format|
if @writing_conference.save
if params[:writing_conference][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_conference][:user_id],:show_plugin_profile=>'Conference')) }
else
format.html { redirect_to(panel_personal_conference_back_end_writing_conferences_url) }
end
format.xml { render :xml => @writing_conference, :status => :created, :location => @writing_conference }
else
format.html { render :action => "new" }
format.xml { render :xml => @writing_conference.errors, :status => :unprocessable_entity }
end
end
end
end
# PUT /writing_conferences/1
# PUT /writing_conferences/1.xml
def update
if params[:conference_paper_type]
@conference_paper_type = ConferencePaperType.find(params[:id])
respond_to do |format|
if @conference_paper_type.update_attributes(params[:conference_paper_type])
# format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
format.js { render 'update_writing_conference_setting' }
end
end
elsif params[:conference_author_type]
@conference_author_type = ConferenceAuthorType.find(params[:id])
respond_to do |format|
if @conference_author_type.update_attributes(params[:conference_author_type])
# format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
format.js { render 'update_writing_conference_setting' }
end
end
else
@writing_conference = WritingConference.find(params[:id])
@writing_conference.update_user_id = current_user.id
params[:writing_conference][:tag_ids] ||=[]
respond_to do |format|
if @writing_conference.update_attributes(params[:writing_conference])
format.html { redirect_to(panel_personal_conference_back_end_writing_conferences_url) }
# format.js { render 'toggle_enable' }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @writing_conference.errors, :status => :unprocessable_entity }
end
end
end
end
# DELETE /writing_conferences/1
# DELETE /writing_conferences/1.xml
def destroy
@writing_conference = WritingConference.find(params[:id])
@writing_conference.destroy
respond_to do |format|
format.html { redirect_to(panel_personal_conference_back_end_writing_conferences_url) }
# format.xml { head :ok }
format.js
end
end
def delete
if params[:ids]
writing_conferences = WritingConference.any_in(:_id => params[:ids]).delete_all
end
redirect_to panel_personal_conference_back_end_writing_conferences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end
protected
# def get_index_categories(id = nil)
# @bulletin_categorys = []
# if(is_manager? || is_admin?)
# @bulletin_categorys = (id ? BulletinCategory.admin_manager_all.find(id).to_a : BulletinCategory.admin_manager_all)
# elsif is_sub_manager?
# @bulletin_categorys = BulletinCategory.all
# end
# @bulletin_categorys
# end
# def get_categorys(id = nil)
# @writing_conference_categorys = []
# if(is_manager? || is_admin?)
# @writing_conference_categorys = (id ? WritingConferenceCategory.admin_manager_all.find(id).to_a : WritingConferenceCategory.admin_manager_all))
# elsif is_sub_manager?
# @writing_conference_categorys = WritingConferenceCategory.all.authed_for_user(current_user,'edit')
# end
# if @writing_conference_categorys.empty? && params[:action] != "index"
# flash[:alert] = t("announcement.error.no_avilb_cate_for_posting")
# redirect_to :action => :index
# end
# end
def get_plugins
@plugins = OrbitApp::Plugin::Registration.all
end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_conference'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end
@@ -0,0 +1,5 @@
class Panel::PersonalConference::Desktop::ConferencePController < ApplicationController
def conference_p
render panel_personal_conference_desktop_conference_p_path, :layout => false
end
end
@@ -0,0 +1,14 @@
class Panel::PersonalConference::Desktop::ConferencePagesController < ApplicationController
def index
respond_to do |format|
format.html { render :layout => false}
end
end
def new
respond_to do |format|
format.html { render :layout => false}
end
end
end
@@ -0,0 +1,31 @@
class Panel::PersonalConference::FrontEnd::WritingConferencesController < OrbitWidgetController
def initialize
super
@app_title = 'personal_conference'
end
def index
@writing_conferences = WritingConference.desc(:year).page(params[:page]).per(10)
end
# GET /writing_conferences/1
# GET /writing_conferences/1.xml
def show
@writing_conference = WritingConference.find(params[:id])
@conference_paper_types = ( !@writing_conference.conference_paper_types.blank? ? @writing_conference.conference_paper_types.collect{|x| x.title}.join(', ') : nil)
@conference_author_types = ( !@writing_conference.conference_author_types.blank? ? @writing_conference.conference_author_types.collect{|x| x.title}.join(', ') : nil)
end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_conference'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end
@@ -0,0 +1,187 @@
class Panel::PersonalConference::Plugin::WritingConferencesController < OrbitBackendController
include AdminHelper
include OrbitControllerLib::DivisionForDisable
before_filter :authenticate_user!
before_filter :force_order_for_visitor,:only=>[:index,:show]
before_filter :force_order_for_user,:except => [:index,:show]
before_filter :only => [ :new,:edit,:update] do |controller|
controller.get_categorys('WritingConferenceCategory')
end
def index
get_categorys("ConferencePaperType",params[:conference_paper_type_id])
@filter = params[:filter]
new_filter = params[:new_filter]
if @filter && params[:clear]
@filter.delete(params[:type])
elsif @filter && new_filter
if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s)
@filter[new_filter[:type]].delete(new_filter[:id].to_s)
elsif @filter.has_key?(new_filter[:type])
@filter[new_filter[:type]] << new_filter[:id].to_s
else
@filter.merge!({new_filter[:type] => [new_filter[:id].to_s]})
end
elsif new_filter
@filter = {new_filter[:type] => [new_filter[:id].to_s]}
end
@paper_types = ConferencePaperType.all
@paper_type_ids = @paper_types.collect{|t| t.id.to_s} + [nil]
# @writing_conferences = WritingConference.search(params[:category_id])
#@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_conferences : WritingConference.all.page(params[:page]).per(10)
@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_conference",:create_user_id => current_user.id) : get_viewable("writing_conference", :create_user_id => current_user.id)
get_tags
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @writing_conferences }
format.js
end
end
# GET /writing_conferences/1
# GET /writing_conferences/1.xml
def show
@writing_conference = WritingConference.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @writing_conference }
end
end
# GET /writing_conferences/new
# GET /writing_conferences/new.xml
def new
@writing_conference = WritingConference.new
# @writing_conference_files = WritingConferenceFile.all
# @level_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
get_tags
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @writing_conference }
end
end
# GET /writing_conferences/1/edit
def edit
@writing_conference = WritingConference.find(params[:id])
# @level_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
get_tags
end
# POST /writing_conferences
# POST /writing_conferences.xml
def create
# @level_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
get_tags
@writing_conference = WritingConference.new(params[:writing_conference])
@writing_conference.create_user_id = current_user.id
@writing_conference.update_user_id = current_user.id
respond_to do |format|
if @writing_conference.save
format.html { redirect_to(panel_personal_conference_plugin_writing_conferences_url) }
format.xml { render :xml => @writing_conference, :status => :created, :location => @writing_conference }
else
format.html { render :action => "new" }
format.xml { render :xml => @writing_conference.errors, :status => :unprocessable_entity }
end
end
end
# PUT /writing_conferences/1
# PUT /writing_conferences/1.xml
def update
@writing_conference = WritingConference.find(params[:id])
@writing_conference.update_user_id = current_user.id
params[:writing_conference][:tag_ids] ||=[]
respond_to do |format|
if @writing_conference.update_attributes(params[:writing_conference])
format.html { redirect_to(panel_personal_conference_plugin_writing_conferences_url) }
# format.js { render 'toggle_enable' }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @writing_conference.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /writing_conferences/1
# DELETE /writing_conferences/1.xml
def destroy
@writing_conference = WritingConference.find(params[:id])
@writing_conference.destroy
respond_to do |format|
format.html { redirect_to(panel_personal_conference_plugin_writing_conferences_url) }
# format.xml { head :ok }
format.js
end
end
def delete
if params[:ids]
writing_conferences = WritingConference.any_in(:_id => params[:ids]).delete_all
end
redirect_to panel_personal_conference_plugin_writing_conferences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end
protected
# def get_index_categories(id = nil)
# @bulletin_categorys = []
# if(is_manager? || is_admin?)
# @bulletin_categorys = (id ? BulletinCategory.admin_manager_all.find(id).to_a : BulletinCategory.admin_manager_all)
# elsif is_sub_manager?
# @bulletin_categorys = BulletinCategory.all
# end
# @bulletin_categorys
# end
# def get_categorys(id = nil)
# @writing_conference_categorys = []
# if(is_manager? || is_admin?)
# @writing_conference_categorys = (id ? WritingConferenceCategory.admin_manager_all.find(id).to_a : WritingConferenceCategory.admin_manager_all))
# elsif is_sub_manager?
# @writing_conference_categorys = WritingConferenceCategory.all.authed_for_user(current_user,'edit')
# end
# if @writing_conference_categorys.empty? && params[:action] != "index"
# flash[:alert] = t("announcement.error.no_avilb_cate_for_posting")
# redirect_to :action => :index
# end
# end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_conference'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end
@@ -0,0 +1,9 @@
# encoding: utf-8
class ConferenceAuthorType < WritingConferenceCategory
field :title, localize: true
has_and_belongs_to_many :writing_conferences
end
@@ -0,0 +1,9 @@
# encoding: utf-8
class ConferencePaperType < WritingConferenceCategory
field :title, localize: true
has_and_belongs_to_many :writing_conferences
end
@@ -0,0 +1,9 @@
class PersonalConferenceTag < Tag
has_and_belongs_to_many :writing_conferences
def get_visible_links(sort = :title)
self.writing_conferences.where(:is_hidden => false).desc(:is_top, sort)
end
end
@@ -1,6 +1,4 @@
# encoding: utf-8
class WritingSeminar
class WritingConference
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
@@ -11,15 +9,15 @@ class WritingSeminar
field :paper_title, localize: true
field :seminar_title, localize: true
field :conference_title, localize: true
field :authors, localize: true
field :location, localize: true
field :sponsor, localize: true
has_and_belongs_to_many :tags, :class_name => "PersonalSeminarTag"
has_and_belongs_to_many :tags, :class_name => "PersonalConferenceTag"
has_and_belongs_to_many :seminar_author_types
has_and_belongs_to_many :seminar_paper_types
has_and_belongs_to_many :conference_author_types
has_and_belongs_to_many :conference_paper_types
field :year
@@ -38,9 +36,9 @@ class WritingSeminar
# field :is_hot, :type => Boolean, :default => false
# field :is_hidden, :type => Boolean, :default => false
has_many :writing_seminar_files, :autosave => true, :dependent => :destroy
has_many :writing_conference_files, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :writing_seminar_files, :allow_destroy => true
accepts_nested_attributes_for :writing_conference_files, :allow_destroy => true
# before_save :update_avliable_language, :clean_checkboxs
@@ -48,7 +46,7 @@ class WritingSeminar
before_validation :add_http
after_save :save_writing_seminar_files
after_save :save_writing_conference_files
validates :url, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix, :unless => Proc.new{self.url.blank?}
@@ -56,7 +54,7 @@ class WritingSeminar
if category_id.to_s.size > 0
find(:all, :conditions => {writing_seminar_category_id: category_id}).desc( :is_top, :title )
find(:all, :conditions => {writing_conference_category_id: category_id}).desc( :is_top, :title )
else
@@ -91,8 +89,8 @@ class WritingSeminar
end
end
def save_writing_seminar_files
self.writing_seminar_files.each do |t|
def save_writing_conference_files
self.writing_conference_files.each do |t|
if t.should_destroy
t.destroy
end
@@ -102,11 +100,11 @@ class WritingSeminar
def create_link
title = ["\"#{self.paper_title}\""]
title << self.seminar_title
title << self.conference_title
title << self.sponsor
title << self.location
title << "#{period_start_date}-#{period_end_date}"
# title << "(#{self.seminar_paper_types.collect{|x| x.title}.join(', ')})"
# title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
title.join(', ')
end
@@ -121,8 +119,8 @@ class WritingSeminar
def clean_checkboxs
self.tag_ids.delete('')
self.seminar_author_type_ids.delete('')
self.seminar_level_type_ids.delete('')
self.conference_author_type_ids.delete('')
self.conference_level_type_ids.delete('')
end
end
end
@@ -1,30 +1,30 @@
# encoding: utf-8
class WritingSeminarCategory
class WritingConferenceCategory
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCoreLib::ObjectAuthable
include OrbitCoreLib::ObjectDisable
# include Mongoid::MultiParameterAttributes
AfterObjectAuthUrl = '/panel/personal_seminar/back_end/writing_seminar_categorys'
APP_NAME = 'writing_seminar'
AfterObjectAuthUrl = '/panel/personal_conference/back_end/writing_conference_categorys'
APP_NAME = 'writing_conference'
# ObjectAuthTitlesOptions = %W{edit}
ObjectAuthTitlesOptions = %W{submit_new fact_check}
field :key
has_many :writing_seminars
has_many :writing_conferences
def pp_object
title
end
def self.from_id(id)
WritingSeminarCategory.find(id) rescue nil
WritingConferenceCategory.find(id) rescue nil
end
def self.is_localized?(field_name)
self.fields[field_name.to_s].localized?
end
end
end
@@ -1,4 +1,4 @@
class WritingSeminarFile
class WritingConferenceFile
include Mongoid::Document
include Mongoid::Timestamps
@@ -9,6 +9,6 @@ class WritingSeminarFile
field :should_destroy, :type => Boolean
field :title, localize: true
belongs_to :writing_seminar
belongs_to :writing_conference
end
@@ -1,8 +1,8 @@
<% # encoding: utf-8 %>
<%= form_for(:writing_seminar_category, :remote => true, :url => @url, :method => @verb, :html => { :id => 'form_writing_seminar_category' } ) do |f| %>
<%= form_for(:writing_conference_category, :remote => true, :url => @url, :method => @verb, :html => { :id => 'form_writing_conference_category' } ) do |f| %>
<h2><%= (@writing_seminar_category.new_record? ? 'Add' : 'Edit') %></h2>
<h2><%= (@writing_conference_category.new_record? ? 'Add' : 'Edit') %></h2>
<div id="widget-title">
<%= f.label :key %>
@@ -16,7 +16,7 @@
<div class="control-group">
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls">
<%= f.text_field locale, :class => 'input-xxlarge', :value => (@writing_seminar_category.title_translations[locale] rescue nil) %>
<%= f.text_field locale, :class => 'input-xxlarge', :value => (@writing_conference_category.title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
@@ -41,4 +41,4 @@
</div>
<% end %>
@@ -0,0 +1,22 @@
<tr id="<%= dom_id writing_conference_category %>" class="with_action">
<td>
<%= writing_conference_category.key %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<% if is_admin?%>
<li><%= link_to t('writing_conference_category.edit'),
polymorphic_path([:panel, :personal_conference, :back_end, writing_conference_category], {:action => :edit}), :remote => true %></li>
<li><%= link_to show_toggle_archive_btn(writing_conference_category), polymorphic_path([:panel, :personal_conference, :back_end, writing_conference_category]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %></li>
<% end %>
</ul>
</div>
</td>
<% if @types.is_localized?(:title) %>
<% @site_valid_locales.each do |locale| %>
<td><%= writing_conference_category.title_translations[locale] rescue nil %></td>
<% end %>
<% else %>
<td><%= writing_conference_category.title %></td>
<% end %>
</tr>
@@ -0,0 +1,2 @@
$('<%= j render :partial => 'writing_conference_category', :collection => [@writing_conference_category] %>').appendTo('#writing_conference_categorys').hide().fadeIn();
$("#form_writing_conference_category")[0].reset();
@@ -0,0 +1 @@
$("#<%= dom_id @writing_conference_category %>").find(".archive_toggle").text("<%= show_toggle_archive_btn(@writing_conference_category) %> ");
@@ -0,0 +1,7 @@
<h1><%= t('personal_conference.editing_personal_conference_class') %></h1>
<%= form_for @writing_conference_category, :url => panel_personal_conference_back_end_writing_conference_category_path(@writing_conference_category) do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
<%= link_back %>
@@ -3,22 +3,22 @@
<%= @types %>
<table id="writing_seminar_categorys" class="table main-list">
<table id="writing_conference_categorys" class="table main-list">
<thead>
<tr>
<th class="span1-2"><%= t('writing_seminar_category.key') %></th>
<th class="span1-2"><%= t('writing_conference_category.key') %></th>
<% if @types.is_localized?(:title) %>
<% @site_valid_locales.each do |locale| %>
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %>
<% else %>
<th class="span1-2"><%= t('writing_seminar_category.title') %></th>
<th class="span1-2"><%= t('writing_conference_category.title') %></th>
<% end %>
</tr>
</thead>
<tbody>
<%= render :partial => 'writing_seminar_category', :collection => @writing_seminar_categorys %>
<%= render :partial => 'writing_conference_category', :collection => @writing_conference_categorys %>
</tbody>
</table>
@@ -0,0 +1,19 @@
<% content_for :secondary do %>
<%= render :partial => '/panel/personal_conference/back_end/personal_conference_secondary' %>
<% end -%>
<%= flash_messages %>
<br />
<br />
<br />
<br />
<br />
<h1><%= t('writing_conference_category.new_personal_conference_class') %></h1>
<%= form_for @writing_conference_category, :url => panel_personal_conference_back_end_writing_conference_categorys_path do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
<%= link_back %>
@@ -0,0 +1,4 @@
$("#<%= dom_id @writing_conference_category %>").replaceWith("<%= j render :partial => 'writing_conference_category', :collection => [@writing_conference_category] %>");
<% @writing_conference_category = @types.new(:display => 'List') # reset for new form %>
$("#form_writing_conference_category").replaceWith("<%= j render "form" %>")
$("#form_writing_conference_category")[0].reset();
@@ -26,9 +26,9 @@
<% end %>
</div>
<div class="modal-footer">
<%= hidden_field_tag 'writing_seminar_category[author_type]', @set_author_type.id %>
<%= hidden_field_tag 'writing_conference_category[author_type]', @set_author_type.id %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
</div>
<% end %>
@@ -10,13 +10,13 @@
<div class="widget-action clear tip" title="Setting">
<a class="action"><i class="icon-cog icon-white"></i></a>
</div>
<h3 class="widget-title"><i class="icons-tag"></i><%= f.label :paper_type ,t("personal_seminar.paper_type")%></h3>
<h3 class="widget-title"><i class="icons-tag"></i><%= f.label :paper_type ,t("personal_conference.paper_type")%></h3>
<div class="widget-content clear form-horizontal">
<% @paper_types.each do |paper_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_seminar[seminar_paper_type_ids][]', paper_type.id, @writing_seminar.seminar_paper_type_ids.include?(paper_type.id)%>
<%= check_box_tag 'writing_conference[conference_paper_type_ids][]', paper_type.id, @writing_conference.conference_paper_type_ids.include?(paper_type.id)%>
<%= paper_type.title %>
<%= hidden_field_tag 'writing_seminar[seminar_paper_type_ids][]', '' %>
<%= hidden_field_tag 'writing_conference[conference_paper_type_ids][]', '' %>
<% end %>
<% end %>
</div>
@@ -26,13 +26,13 @@
<div class="widget-action clear tip" title="Setting">
<a class="action"><i class="icon-cog icon-white"></i></a>
</div>
<h3 class="widget-title"><i class="icons-tag"></i><%= f.label :author_type ,t("personal_seminar.author_type")%></h3>
<h3 class="widget-title"><i class="icons-tag"></i><%= f.label :author_type ,t("personal_conference.author_type")%></h3>
<div class="widget-content clear form-horizontal">
<% @author_types.each do |author_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_seminar[seminar_author_type_ids][]', author_type.id, @writing_seminar.seminar_author_type_ids.include?(author_type.id)%>
<%= check_box_tag 'writing_conference[conference_author_type_ids][]', author_type.id, @writing_conference.conference_author_type_ids.include?(author_type.id)%>
<%= author_type.title %>
<%= hidden_field_tag 'writing_seminar[seminar_author_type_ids][]', '' %>
<%= hidden_field_tag 'writing_conference[conference_author_type_ids][]', '' %>
<% end %>
<% end %>
</div>
@@ -47,9 +47,9 @@
<div class="widget-content clear form-horizontal">
<% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_seminar[tag_ids][]', tag.id, @writing_seminar.tag_ids.include?(tag.id)%>
<%= check_box_tag 'writing_conference[tag_ids][]', tag.id, @writing_conference.tag_ids.include?(tag.id)%>
<%= tag[I18n.locale] %>
<%= hidden_field_tag 'writing_seminar[tag_ids][]', '' %>
<%= hidden_field_tag 'writing_conference[tag_ids][]', '' %>
<% end %>
<% end %>
</div>
@@ -74,8 +74,8 @@
<% end %>
<div class="title">
<%= f.label :year ,t("personal_seminar.year")%>
<%= select_year((@writing_seminar.year ? @writing_seminar.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_seminar[year]'} ) %>
<%= f.label :year ,t("personal_conference.year")%>
<%= select_year((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]'} ) %>
</div>
<ul class="nav nav-tabs">
@@ -85,12 +85,12 @@
</ul>
<div class="title">
<%= f.label :period_start_date ,t("personal_seminar.period_start_date")%>
<%= f.label :period_start_date ,t("personal_conference.period_start_date")%>
<%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
<div class="title">
<%= f.label :period_end_date ,t("personal_seminar.period_end_date")%>
<%= f.label :period_end_date ,t("personal_conference.period_end_date")%>
<%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
@@ -100,34 +100,34 @@
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title">
<%= f.label :paper_title ,t("personal_seminar.paper_title")%>
<%= f.label :paper_title ,t("personal_conference.paper_title")%>
<%= f.fields_for :paper_title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_seminar.paper_title_translations[locale] rescue nil) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_conference.paper_title_translations[locale] rescue nil) %>
<% end %>
</div>
<div class="title">
<%= f.label :seminar_title ,t("personal_seminar.seminar_title")%>
<%= f.fields_for :seminar_title_translations do |f| %>
<%= f.label :conference_title ,t("personal_conference.conference_title")%>
<%= f.fields_for :conference_title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_seminar.seminar_title_translations[locale] rescue nil) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_conference.conference_title_translations[locale] rescue nil) %>
<% end %>
</div>
<div class="title">
<%= f.label :location ,t("personal_seminar.location")%>
<%= f.label :location ,t("personal_conference.location")%>
<%= f.fields_for :location_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_seminar.location_translations[locale] rescue nil) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_conference.location_translations[locale] rescue nil) %>
<% end %>
</div>
<div class="title">
<%= f.label :sponsor ,t("personal_seminar.sponsor")%>
<%= f.label :sponsor ,t("personal_conference.sponsor")%>
<%= f.fields_for :sponsor_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_seminar.sponsor_translations[locale] rescue nil) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_conference.sponsor_translations[locale] rescue nil) %>
<% end %>
</div>
@@ -135,7 +135,7 @@
<%= f.label :authors,t("web_resource.authors") %>
<%= f.fields_for :authors_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_area locale, :size => "60x3", :value => (@writing_seminar.authors_translations[locale] rescue nil) %>
<%= f.text_area locale, :size => "60x3", :value => (@writing_conference.authors_translations[locale] rescue nil) %>
<% end %>
</div>
@@ -146,32 +146,32 @@
</div>
<div class="title">
<%= f.label :publication_date ,t("personal_seminar.publication_date")%>
<%= f.label :publication_date ,t("personal_conference.publication_date")%>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
<div class="title">
<%= f.label :url, t("personal_seminar.url") %>
<%= f.label :url, t("personal_conference.url") %>
<%= f.text_field :url %>
</div>
<div class="title">
<%= f.label :keywords, t("personal_seminar.keywords") %>
<%= f.label :keywords, t("personal_conference.keywords") %>
<%= f.text_field :keywords %>
</div>
<div class="title">
<%= f.label :abstract, t("personal_seminar.abstract") %>
<%= f.label :abstract, t("personal_conference.abstract") %>
<%= f.text_field :abstract %>
</div>
<div class="title">
<%= f.label :language, t("personal_journal.language") %>
<%= f.select :language, WritingSeminar::LANGUAGE_TYPES, :prompt => 'Select' %>
<%= f.select :language, WritingConference::LANGUAGE_TYPES, :prompt => 'Select' %>
</div>
<div class="title">
<%= f.label :note, t("personal_seminar.note") %>
<%= f.label :note, t("personal_conference.note") %>
<%= f.text_area :note, :size => "60x3" %>
</div>
@@ -197,7 +197,7 @@
<tr>
<td style="text-align:center" colspan="3">
<div id='add_plugin_file' class="info_input plugin_files_block">
<%= hidden_field_tag 'plugin_file_field_count', @writing_seminar.writing_seminar_files.count %>
<%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %>
<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a>
</div>
</td>
@@ -206,9 +206,9 @@
</tfoot>
<tbody>
<% @writing_seminar.writing_seminar_files.each_with_index do |writing_seminar_file, i| %>
<%= f.fields_for :writing_seminar_files, writing_seminar_file do |f| %>
<%= render :partial => 'form_file', :object => writing_seminar_file, :locals => {:f => f, :i => i} %>
<% @writing_conference.writing_conference_files.each_with_index do |writing_conference_file, i| %>
<%= f.fields_for :writing_conference_files, writing_conference_file do |f| %>
<%= render :partial => 'form_file', :object => writing_conference_file, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
</tbody>
@@ -242,7 +242,7 @@
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_add_plugin_files", "g");
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_seminar_files) %>").replace(old_id, new_id));
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_conference_files) %>").replace(old_id, new_id));
});
$('.add_plugin_files_block a.delete').live('click', function(){
@@ -255,4 +255,4 @@
});
</script>
<% end %>
<% end %>
@@ -0,0 +1,11 @@
<% # encoding: utf-8 %>
<tr id="<%= dom_id list_author_type %>">
<td><%= list_author_type.title %></td>
<td class="span2">
<a href="<%= panel_personal_conference_back_end_writing_conference_author_type_quick_edit_path(list_author_type) %>#myModal2" data-toggle="modal" data-remote="true" class="action">編輯</a>
<%= link_to show_toggle_archive_btn(list_author_type),
polymorphic_path([:panel, :personal_conference, :back_end, list_author_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -0,0 +1,11 @@
<% # encoding: utf-8 %>
<tr id="<%= dom_id list_paper_type %>">
<td><%= list_paper_type.title %></td>
<td class="span2">
<a href="<%= panel_personal_conference_back_end_writing_conference_paper_type_quick_edit_path(list_paper_type) %>#myModal1" data-toggle="modal" data-remote="true" class="action">編輯</a>
<%= link_to show_toggle_archive_btn(list_paper_type),
polymorphic_path([:panel, :personal_conference, :back_end, list_paper_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -26,9 +26,9 @@
<% end %>
</div>
<div class="modal-footer">
<%= hidden_field_tag 'writing_seminar_category[paper_type]', @set_paper_type.id %>
<%= hidden_field_tag 'writing_conference_category[paper_type]', @set_paper_type.id %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
</div>
<% end %>
@@ -0,0 +1,4 @@
<%= render_sort_bar(true, delete_panel_personal_conference_back_end_writing_conferences_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]),
['year', 'year', 'span1', 'writing_conference.year'],
['title', 'title','span3', 'writing_conference.title'],
['create_modified', 'create_user_id','span1-3', 'writing_conference.create_modified']).html_safe %>
@@ -0,0 +1,21 @@
<tr id="<%= dom_id writing_conference %>" class="with_action">
<td>
<% if (writing_conference.create_user_id == current_user.id) || is_manager? %>
<%= check_box_tag 'to_delete[]', writing_conference.id, false, :class => "checkbox_in_list" %>
<% end -%>
</td>
<td><%= writing_conference.year %></td>
<td>
<%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %>
<div class="quick-edit">
<ul class="nav nav-pills hide">
<%if at_least_module_manager || writing_conference.writing_conference_category.cur_user_is_sub_manager_of(:edit)%>
<li><%= link_to t('edit'), edit_panel_personal_conference_back_end_writing_conference_path(writing_conference) %></li>
<li><%= link_to t(:delete_), panel_personal_conference_back_end_writing_conference_path(writing_conference), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
<% end -%>
</ul>
</div>
</td>
<td><%= User.from_id(writing_conference.create_user_id).name rescue ''%></td>
</tr>
@@ -0,0 +1,10 @@
<% if !@conference_paper_type.blank? %>
$("#myModal1").modal('hide');
$('<%= j render :partial => 'list_paper_type', :collection => [@conference_paper_type] %>').appendTo('#paper_types').hide().fadeIn();
<% end %>
<% if !@conference_author_type.blank? %>
$("#myModal2").modal('hide');
$('<%= j render :partial => 'list_author_type', :collection => [@conference_author_type] %>').appendTo('#author_types').hide().fadeIn();
<% end %>
@@ -0,0 +1 @@
$("#<%= dom_id @writing_conference %>").remove();
@@ -8,8 +8,8 @@
</div>
<h1><%= t('personal_seminar.editing_personal_seminar') %></h1>
<h1><%= t('personal_conference.editing_personal_conference') %></h1>
<%= form_for @writing_seminar, :url => panel_personal_seminar_back_end_writing_seminar_path(@writing_seminar), :html => {:class => 'clear'} do |f| %>
<%= form_for @writing_conference, :url => panel_personal_conference_back_end_writing_conference_path(@writing_conference), :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
@@ -19,15 +19,15 @@
<th class="span1"></th>
</tr>
</thead>
<tbody id="tbody_writing_seminars" class="sort-holder">
<%= render :partial => 'writing_seminar', :collection => @writing_seminars %>
<tbody id="tbody_writing_conferences" class="sort-holder">
<%= render :partial => 'writing_conference', :collection => @writing_conferences %>
</tbody>
</table>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_seminar_back_end_writing_seminar_setting_path, :class => 'btn btn-primary pull-right' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_seminar_back_end_writing_seminar_path, :class => 'btn btn-primary pull-right' %>
<div id="writing_seminar_pagination" class="paginationFixed">
<%= paginate @writing_seminars, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_conference_back_end_writing_conference_setting_path, :class => 'btn btn-primary pull-right' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path, :class => 'btn btn-primary pull-right' %>
<div id="writing_conference_pagination" class="paginationFixed">
<%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div>
</div>
@@ -0,0 +1,3 @@
$("#sort_headers").html("<%= j render 'sort_headers' %>");
$("#tbody_writing_conferences").html("<%= j render :partial => 'writing_conference', :collection => @writing_conferences %>");
$("#writing_conference_pagination").html("<%= j paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");
@@ -11,8 +11,8 @@
<%= flash_messages %>
<div id="poststuff">
<h1><%= t('writing_seminar.new_personal_seminar') %></h1>
<%= form_for @writing_seminar, :url => panel_personal_seminar_back_end_writing_seminars_path, :html => {:class => 'clear'} do |f| %>
<h1><%= t('writing_conference.new_personal_conference') %></h1>
<%= form_for @writing_conference, :url => panel_personal_conference_back_end_writing_conferences_path, :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
</div>
@@ -0,0 +1,10 @@
<% if !@conference_paper_type.blank? %>
$("#myModal1").modal('hide');
$("#<%= dom_id @conference_paper_type %>").replaceWith("<%= j render :partial => 'list_paper_type', :collection => [@conference_paper_type] %>");
<% end %>
<% if !@conference_author_type.blank? %>
$("#myModal2").modal('hide');
$("#<%= dom_id @conference_author_type %>").replaceWith("<%= j render :partial => 'list_author_type', :collection => [@conference_author_type] %>");
<% end %>
@@ -14,7 +14,7 @@
<div class="item element">
<div class="detail w-a h-a">
<p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_seminar_back_end_writing_seminar_paper_type_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_conference_back_end_writing_conference_paper_type_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>論文型態</span>
</p>
<div class="detal-list my_scroll">
@@ -40,7 +40,7 @@
<div class="item element">
<div class="detail w-a h-a">
<p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_seminar_back_end_writing_seminar_author_type_quick_add_path('add') %>#myModal2" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_conference_back_end_writing_conference_author_type_quick_add_path('add') %>#myModal2" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>作者型態</span>
</p>
<div class="detal-list my_scroll">
@@ -152,4 +152,4 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "item" %>
<% end %>
<% end %>
@@ -0,0 +1,33 @@
<div id="conference_p">
<div id="content">
<div id="header" class="hh3">
<div class="dtitle w2 hh3 hp">
<span class="thmtxth">Conference</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="<%= panel_personal_conference_desktop_conference_pages_path %>" callback-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="" callback-method="addconference" custom-load="add" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= new_panel_personal_conference_desktop_conference_page_path %>" callback-method="conference" class="admtxt hh2 w2 hp" onclick='return false;'>Conference</a></li>
<li><a href="" callback-method="coauthor" 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>
@@ -0,0 +1,75 @@
<div class="toolbar hh2">
<div class="hh2 hp sdm">
<div class="sdm_t hh2"><span class="icon-check"></span></div>
<div class="admbg sdm_o">
<ul id="journal_selection_options">
<li><a class="hp hh2 admtxt" href="all">All</a></li>
<li><a class="hp hh2 admtxt" href="none">None</a></li>
</ul>
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2">More</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh2 admtxt" href="">Delete</a></li>
<li><a class="hp hh2 admtxt" href="">Tag</a></li>
</ul>
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2">Tag</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh2 admtxt" href="">All</a></li>
<li><a class="hp hh2 admtxt" href="">Starred</a></li>
<li><a class="hp hh2 admtxt" href="">MIT</a></li>
</ul>
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2">Status</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh2 admtxt" href="">All</a></li>
<li><a class="hp hh2 admtxt" href="">Published</a></li>
<li><a class="hp hh2 admtxt" href="">Pending</a></li>
</ul>
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2">View</div>
<div class="admbg sdm_o">
<ul id="journal_view_selection">
<li><a class="hp hh2 admtxt" href="journal">Journal</a></li>
<li><a class="hp hh2 admtxt" href="title">Title</a></li>
<li><a class="hp hh2 admtxt" href="file">File</a></li>
<li><a class="hp hh2 admtxt" href="keywords">Keywords</a></li>
<li><a class="hp hh2 admtxt" href="abstract">Abstract</a></li>
</ul>
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2">Share</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh2 admtxt" href="">Full</a></li>
<li><a class="hp hh2 admtxt" href="">Abstract</a></li>
<li><a class="hp hh2 admtxt" href="">Friends</a></li>
<li><a class="hp hh2 admtxt" href="">Private</a></li>
<li><a class="hp hh2 admtxt" href="">Group</a></li>
</ul>
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2"><span class="icon-question-sign"></span></div>
</div>
</div>
<div id="paper_list" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
</div>
</div>
</div>
@@ -0,0 +1,107 @@
<div class="toolbar hh2">
<div class="fn_g hp">
<button class="fn_btn hh2 thmc2 thmtxt">Save</button>
<button class="fn_btn hh2 admbg2">Cancel</button>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2">Year</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh2 admtxt" href="">2012</a></li>
<li><a class="hp hh2 admtxt" href="">2011</a></li>
<li><a class="hp hh2 admtxt" href="">2010</a></li>
<li><a class="hp hh2 admtxt" href="">2009</a></li>
<li><a class="hp hh2 admtxt" href="">2008</a></li>
<li><a class="hp hh2 admtxt" href="">2007</a></li>
<li><a class="hp hh2 admtxt" href="">2006</a></li>
<li><a class="hp hh2 admtxt" href="">2005</a></li>
<li><a class="hp hh2 admtxt" href="">2004</a></li>
<li><a class="hp hh2 admtxt" href="">2003</a></li>
<li><a class="hp hh2 admtxt" href="">2002</a></li>
<li><a class="hp hh2 admtxt" href="">2001</a></li>
</ul>
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2">Language</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh2 admtxt" href="">English</a></li>
<li><a class="hp hh2 admtxt" href="">Chinese</a></li>
</ul>
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2"><span class="icon-question-sign"></span></div>
</div>
</div>
<div id="paper_add" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row"><textarea class="s_grid_6 s_grid" name="" id="">Conference Title</textarea></li>
<li class="s_grid_row">
<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>Conference time</label></li>
<li class="s_grid_row"><select name="" id="" class="s_grid s_grid_1">
<option value=""></option>
</select>
<label class="s_grid s_grid_1">Year</label>
<select name="" id="" class="s_grid s_grid_1">
<option value=""></option>
</select>
<label class="s_grid s_grid_1">Month</label>
<select name="" id="" class="s_grid s_grid_1">
<option value=""></option>
</select>
<label class="s_grid s_grid_1">Day</label>
</li>
<li class="s_grid_row"><input class="s_grid s_grid_2" type="text" value="Location"><input class="s_grid s_grid_2" type="text" value="Sponsor"></li>
<li class="s_grid_row"><label class="s_grid_2 s_grid" for="">Reference URL</label><input class="s_grid_4 s_grid" type="text" value="www.sample.com"></li>
</ul>
</div>
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row"><textarea class="s_grid s_grid_6" name="" id="">Author</textarea><span class="icon-plus input_append"></span></li>
<li class="s_grid_row">
<select name="" id="" class="s_grid s_grid_4">
<option value="">Author Type</option>
<option value="">First Author</option>
<option value="">Corresponding Author</option>
<option value="">Second Author</option>
<option value="">Third Author</option>
<option value="">Fourth Author</option>
</select>
<select name="" id="" class="s_grid s_grid_2">
<option value="">Status</option>
<option value="">Published</option>
<option value="">Pending</option>
<option value="">Writing</option>
</select>
</li>
<li class="s_grid_row"><label class="s_grid s_grid_2" for="">Date of Publication</label><input class="s_grid s_grid_4" type="text" value="2012 / 05 / 01"></li>
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" value="Tags"><span class="icon-plus input_append"></li>
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" value="Keywords"><span class="icon-plus input_append"></li>
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" value="Associated Project"><span class="icon-plus input_append"></span></li>
<li class="s_grid_row"><label class="s_grid s_grid_2" for="">Abstract</label><input type="file"></li>
<li class="s_grid_row"><label class="s_grid s_grid_2" for="">Full Text</label><input type="file"></li>
</ul>
</div>
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row"><textarea name="" id="" rows="20" class="s_grid s_grid_6">Abstract</textarea></li>
<li class="s_grid_row"><textarea name="" id="" rows="6" class="s_grid s_grid_6">Note</textarea></li>
</ul>
</div>
</div>
</div>
</div>
@@ -0,0 +1,26 @@
<% # encoding: utf-8 %>
<%= flash_messages %>
<h1><%= t('writing_conference.list_writing_conference') %></h1>
<table>
<tr>
<th><%= t(:year) %></th>
<th><%= t(:title) %></th>
</tr>
<% @writing_conferences.each do |post| %>
<tr>
<td><%= post.year %></td>
<td>
<%= link_to post.create_link , panel_personal_conference_front_end_writing_conference_path(post) %>
</td>
</tr>
<% end %>
</table>
<%= paginate @writing_conferences, :params => {:inner => false}%>
@@ -0,0 +1,36 @@
<% # encoding: utf-8 %>
<table>
<caption> <%= t("writing_conference") %> </caption>
<tbody>
<tr><th><%= t("writing_conference.year")%></th><td><%= @writing_conference.year %></td></tr>
<tr><th><%= t("writing_conference.language")%></th><td><%= @writing_conference.language %></td></tr>
<tr><th><%= t("writing_conference.paper_title")%></th><td><%= @writing_conference.paper_title %></td></tr>
<tr><th><%= t("writing_conference.conference_title")%></th><td><%= @writing_conference.conference_title %></td></tr>
<tr><th><%= t("writing_conference.conference_paper_types")%></th><td><%= @conference_paper_types %></td></tr>
<tr><th><%= t("writing_conference.conference_author_types")%></th><td><%= @conference_author_types %></td></tr>
<tr><th><%= t("writing_conference.location")%></th><td><%= @writing_conference.location %></td></tr>
<tr><th><%= t("writing_conference.sponsor")%></th><td><%= @writing_conference.sponsor %></td></tr>
<tr><th><%= t("writing_conference.period_start_date")%></th><td><%= @writing_conference.period_start_date %></td></tr>
<tr><th><%= t("writing_conference.period_end_date")%></th><td><%= @writing_conference.period_end_date %></td></tr>
<tr><th><%= t("writing_conference.abstract")%></th><td><%= @writing_conference.abstract %></td></tr>
<tr><th><%= t("writing_conference.publication_date")%></th><td><%= @writing_conference.publication_date %></td></tr>
<tr><th><%= t("writing_conference.url")%></th><td><%= link_to t(:url), @writing_conference.url, {:target => '_blank', :title => @writing_conference.conference_title} if !@writing_conference.url.blank? %></td></tr>
<tr><th><%= t("writing_conference.note")%></th><td><%= @writing_conference.note %></td></tr>
<tr><th><%= t("writing_conference.authors")%></th><td><%= "#{User.from_id(@writing_conference.create_user_id).name rescue ''},#{@writing_conference.authors rescue ''}"%></td></tr>
<tr><th><%= t("writing_conference.files")%></th>
<td>
<% if @writing_conference.writing_conference_files.size > 0 %>
<div>
<i class="icons-paperclip"></i>
<div class="showFile">
<% @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 %>
</div>
</div>
<% end %>
</td>
</tr>
</tbody>
</table>
Loaded 100 of 319 files, more files were not shown because too many files have changed in this diff. Show more