Orbit PersonalConference Module

This commit is contained in:
Manson Wang 2014-01-15 18:49:46 +08:00
parent ea8efe8b9d
commit d5c65f75f2
129 changed files with 4304 additions and 0 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.bundle/
log/*.log
pkg/
test/dummy/db/*.sqlite3
test/dummy/log/*.log
test/dummy/tmp/

17
Gemfile Normal file
View File

@ -0,0 +1,17 @@
source "http://rubygems.org"
# 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
# jquery-rails is used by the dummy application
gem "jquery-rails"
# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

20
MIT-LICENSE Normal file
View File

@ -0,0 +1,20 @@
Copyright 2012 YOURNAME
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

3
README.rdoc Normal file
View File

@ -0,0 +1,3 @@
= PersonalSeminar
This project rocks and uses MIT-LICENSE.

39
Rakefile Normal file
View File

@ -0,0 +1,39 @@
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
require 'rdoc/task'
rescue LoadError
require 'rdoc/rdoc'
require 'rake/rdoctask'
RDoc::Task = Rake::RDocTask
end
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'PersonalConference'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'
Bundler::GemHelper.install_tasks
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end
task :default => :test

View File

@ -0,0 +1 @@
//= require_tree ./personal_conference/desktop

View File

@ -0,0 +1,155 @@
orbitDesktop.prototype.initializeConferencePapers = function(target,url,cache){ // this init conference papers
this.initializeConferencePapers.formCallback = function(data){
if(data.success){
o.notify(data.msg,"success");
o.sub_menu_item($("div[content-type=menu] a").eq(0));
}else{
o.notify(data.msg,"alert");
}
}
this.initializeConferencePapers.list = function(){ // to open list part in conference papers page
var conferenceData;
var bindHandlers = function(){ // to bind handlers for list page
}
bindHandlers();
var bindSecondaryHandlers = function(){
$("#conference_p div#paper_list a.icon-check-empty").click(function(){
if($(this).hasClass("icon-check-empty")){
$(this).switchClass("icon-check-empty","icon-check",0);
} else if($(this) .hasClass("icon-check")) {
$(this).switchClass("icon-check","icon-check-empty",0);
} else if($(this).hasClass("icon-star")){
$(this).removeClass("icon-star").addClass("icon-star-empty");
} else if($(this).hasClass("icon-star-empty")){
$(this).removeClass("icon-star-empty").addClass("icon-star");
}
return false;
})
}
o.enableSharing("div.share_mode");
}
this.initializeConferencePapers.paperDelete = function(data,dom){
var parent = dom.parent().parent().parent();
if(data.success){
parent.hide("slide",function(){parent.remove();});
o.notify(data.msg,"success");
}
}
this.initializeConferencePapers.cancelpaper = function(){
o.highlight_sub_menu_item(0);
}
var uploadFiles = function(){
$('#add_plugin_file a.add').click(function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_writing_journal_files", "g");
$(this).prev().attr('value', parseInt(new_id) + 1);
var x = get_html(old_id,new_id);
var newfield = $(x);
$(this).parents('table').append(newfield);
newfield.find('.action a.delete').click(function(){
newfield.remove();
});
return false;
});
$('.action a.remove_existing_record').click(function(){
$(this).toggleClass("color-red",function(){
if($(this).hasClass('color-red')){
$(this).next('.should_destroy').attr('value', 1);
}else{
$(this).next('.should_destroy').removeAttr('value');
}
})
});
}
var languageSelect = function(){
$(".language_select a").click(function(event) {
$("*[data-language]").hide();
$("*[data-language="+$(this).data("lang")+"]").show();
return false;
});
}
this.initializeConferencePapers.editpaper = function(){
o.highlight_sub_menu_item(1);
uploadFiles();
languageSelect();
}
this.initializeConferencePapers.addpaper = function(){ // to open add pages in journal papers page
uploadFiles();
languageSelect();
}
this.initializeConferencePapers.brief = function(){
o.enablelanguageSelect();
$("textarea.editor").ckeditor({
height: 300,
width: $(".overview").width() - 20
});
}
this.initializeConferencePapers.conference = function(){ // to open add pages in conference papers page
var bindHandlers = function(){ // to bind handlers for add page
}
bindHandlers();
}
this.initializeConferencePapers.coAuthorformCallback = function(data){
if(data.success){
o.notify(data.msg,"success");
o.sub_menu_item($("div[content-type=menu] a").eq(3));
}else{
o.notify(data.msg,"alert");
}
}
this.initializeConferencePapers.coauthor = function(){ // to open add pages in coauthor page
var bindHandlers = function(){ // to bind handlers for add page
}
bindHandlers();
}
this.initializeConferencePapers.coauthorRelationForm = function(data){
if(data.success){
o.notify(data.msg,"success");
$("#co_author_relation_table").html(data.newvalue);
}else{
o.notify(data.msg,"alert");
}
}
this.initializeConferencePapers.coauthorRelationEditForm = function(data){
if(data.success){
o.notify(data.msg,"success");
var x = o.layout_data.generate_layout_html(data.newvalue);
$("div[container=true] div.overview").html(x.markup);
}else{
o.notify(data.msg,"alert");
}
}
this.initializeConferencePapers.allnone = function(d,o){
switch(o.attr("href")){
case "all":
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
break;
case "none":
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
break;
}
}
this.initializeConferencePapers.allnone = function(d,o){
switch(o.attr("href")){
case "all":
$("div.overview a.icon-check-empty").removeClass("icon-check-empty").addClass("icon-check");
break;
case "none":
$("div.overview a.icon-check").removeClass("icon-check").addClass("icon-check-empty");
break;
}
}
};

View File

@ -0,0 +1,109 @@
/* Conference Papers */
[page-name="conference_p_list"] .list_t_item .inner {
padding-left: 30px; }
[page-name="conference_p_list"] .list_item_action {
font-size: 12px;
float: left;
margin-left: -30px; }
[page-name="conference_p_list"] .list_item_action a {
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px;
font-size: 20px; }
[page-name="conference_p_list"] .list_item_action .icon-star-empty, [page-name="conference_p_list"] .list_item_action .icon-check-empty {
color: #dddddd;
-webkit-transition: color 0.3s ease;
-moz-transition: color 0.3s ease;
transition: color 0.3s ease; }
[page-name="conference_p_list"] .list_item_action .icon-star-empty:hover, [page-name="conference_p_list"] .list_item_action .icon-check-empty:hover {
color: #aaaaaa; }
[page-name="conference_p_list"] .list_item_action .icon-star {
color: #faa732; }
[page-name="conference_p_list"] .list_item_action .icon-check {
color: #333; }
[page-name="conference_p_list"] .file_view .list_t_des {
overflow: hidden; }
[page-name="conference_p_list"] .file_view .file {
float: left;
width: 120px;
height: 50px;
padding: 6px;
margin: 1px;
position: relative;
-webkit-box-sizing: border-box;
/* webkit */
-khtml-box-sizing: border-box;
/* konqueror */
-moz-box-sizing: border-box;
/* firefox */
-ms-box-sizing: border-box;
/* ie */
box-sizing: border-box;
/* css3 */ }
[page-name="conference_p_list"] .file_view .file:hover {
background-color: #f7f7f7; }
[page-name="conference_p_list"] .file_view .file img {
width: 38px;
height: 38px;
position: absolute;
left: 6px;
top: 6px; }
[page-name="conference_p_list"] .file_view .file .filetitle {
display: block;
width: 100%;
height: 38px;
padding-left: 40px;
overflow: hidden;
-webkit-box-sizing: border-box;
/* webkit */
-khtml-box-sizing: border-box;
/* konqueror */
-moz-box-sizing: border-box;
/* firefox */
-ms-box-sizing: border-box;
/* ie */
box-sizing: border-box;
/* css3 */ }
/* Conference Conference list */
[page-name="conference_p_conference"] .datalist_item .inner {
padding-left: 30px; }
[page-name="conference_p_conference"] .list_item_action {
font-size: 12px;
float: left;
margin-left: -30px; }
[page-name="conference_p_conference"] .list_item_action i {
color: #999;
font-size: 20px;
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px; }
[page-name="conference_p_conference"] .list_t_desc {
font-family: Arial, sans-serif;
font-size: 12px;
color: #999; }
/* Conference Co-Author */
[page-name="conference_p_coauthor"] .list_t_item {
height: 110px; }
[page-name="conference_p_coauthor"] .info {
font-family: Arial, sans-serif; }
[page-name="conference_p_coauthor"] .info li {
margin-bottom: 8px;
color: #999; }
[page-name="conference_p_coauthor"] .info .name {
font-size: 18px;
line-height: 24px;
color: #333; }
/* Conference Co-Author Relationship*/
[page-name="conference_p_coauthor_relation"] .edit_co_author_relation {
/*margin-left: -10px;*/ }
[page-name="conference_p_coauthor_relation"] .form_space {
margin-bottom: 10px;
font-size: 18px;
font-family: Arial, sans-serif; }

View File

@ -0,0 +1,124 @@
@import "desktop-helper";
/* Conference Papers */
[page-name="conference_p_list"] {
.list_t_item .inner { padding-left: 30px; }
.list_item_action {
font-size: 12px;
float: left;
margin-left: -30px;
a {
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px;
font-size: 20px;
}
.icon-star-empty, .icon-check-empty {
color: $gray;
@include transition-type(color,0.3);
&:hover {
color: darken($gray, 20%);
}
}
.icon-star { color: #faa732; }
.icon-check { color: #333; }
}
.file_view {
.list_t_des {
overflow: hidden;
}
.file {
float: left;
width: 120px;
height: 50px;
padding: 6px;
margin: 1px;
position: relative;
@include box-sizing;
&:hover {
background-color: lighten($gray, 10%);
}
img {
width: 38px;
height: 38px;
position: absolute;
left: 6px;
top: 6px;
}
.filetitle {
display: block;
width: 100%;
height: 38px;
padding-left: 40px;
overflow: hidden;
@include box-sizing;
}
}
}
}
/* Conference Conference list */
[page-name="conference_p_conference"] {
.datalist_item .inner {
padding-left: 30px;
}
.list_item_action {
font-size: 12px;
float: left;
margin-left: -30px;
}
.list_item_action i {
color: #999;
font-size: 20px;
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px;
}
.list_t_desc {
font-family: Arial, sans-serif;
font-size: 12px;
color: #999;
}
}
/* Conference Co-Author */
[page-name="conference_p_coauthor"] {
.list_t_item {
height: 110px;
}
.list_item_function {}
.list_item_function a {}
.info {
font-family: Arial, sans-serif;
}
.info li {
margin-bottom: 8px;
color: #999;
}
.info .name {
font-size: 18px;
line-height: 24px;
color: #333;
}
}
/* Conference Co-Author Relationship*/
[page-name="conference_p_coauthor_relation"]{
.edit_co_author_relation {
/*margin-left: -10px;*/
}
.form_space {
margin-bottom: 10px;
font-size: 18px;
font-family: Arial, sans-serif;
}
}

0
app/controllers/.gitkeep Normal file
View File

View File

@ -0,0 +1,23 @@
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :set_locale
# Set I18n.locale
def set_locale
# update session if passed
session[:locale] = params[:locale] if params[:locale]
# set locale based on session or default
begin
# check if locale is valid for non site pages
if !VALID_LOCALES.include?(session[:locale])
I18n.locale = I18n.default_locale
else
I18n.locale = session[:locale]
end
rescue
I18n.locale = I18n.default_locale
end
end
end

View File

@ -0,0 +1,8 @@
class Panel::PersonalConference::BackEnd::ConferenceAuthorTypesController < Panel::PersonalConference::BackEnd::WritingConferenceCategorysController
def initialize
super
@app_type = 'conference_author_type'
end
end

View File

@ -0,0 +1,8 @@
class Panel::PersonalConference::BackEnd::ConferencePaperTypesController < Panel::PersonalConference::BackEnd::WritingConferenceCategorysController
def initialize
super
@app_type = 'conference_paper_type'
end
end

View File

@ -0,0 +1,10 @@
class Panel::PersonalConference::BackEnd::PersonalConferenceIntrosController < Admin::PersonalPluginIntrosController
def initialize
super
@app_type = 'personal_conference_intro'
@app_type_name = 'personal_conference'
@reback_name = 'WritingConference'
end
end

View File

@ -0,0 +1,143 @@
class Panel::PersonalConference::BackEnd::WritingConferenceCategorysController < OrbitBackendController
include OrbitControllerLib::DivisionForDisable
open_for_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

View File

@ -0,0 +1,317 @@
class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBackendController
include AdminHelper
include OrbitControllerLib::DivisionForDisable
before_filter :authenticate_user!
before_filter :only => [ :new,:edit,:update] do |controller|
controller.get_categorys('WritingConferenceCategory')
end
def index
get_plugins
# @tags = get_tags
# @categories = get_categories_for_index
# @statuses = get_statuses
# category_ids = @categories.collect{|t| t.id}
@paper_type_ids = ConferencePaperType.all.collect{|t| t.id.to_s} + [nil]
@writing_conferences = get_sorted_and_filtered("writing_conference", :conference_paper_type_id.in => @paper_type_ids)
respond_to do |format|
format.html # index.html.erb
format.js { }
format.xml { render :xml => @writing_conferences }
end
end
def writing_conference_setting
get_plugins
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
@tags = 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
@tags = 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
@tags = 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
@tags = 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=>'WritingConference')) }
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]).destroy_all
end
redirect_to panel_personal_conference_back_end_writing_conferences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end
def data_share
if params[:ids]
@writing_conferences = WritingConference.any_in(:_id => params[:ids])
@writing_conferences.each do |writing_conference|
writing_conference.is_hidden = params[:disable]
writing_conference.save
end
end
respond_to do |format|
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"WritingConference")) }
format.json { render json: {"success"=>true}.to_json}
end
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
end

View File

@ -0,0 +1,67 @@
class Panel::PersonalConference::Desktop::ConferenceCoAuthorRelationsController < ApplicationController
def index
page = params[:page]
page ||= 1
@conference_co_author_relations = ConferenceCoAuthorRelation.all
new
@conference_co_author_relations = @conference_co_author_relations.page(page).per(50)
respond_to do |format|
format.html {render layout: false }
end
end
def edit
@conference_co_author_relation = ConferenceCoAuthorRelation.find(params[:id])
respond_to do |format|
format.html { render :layout => false}
end
end
def new
@conference_co_author_relation = ConferenceCoAuthorRelation.new
end
def create
@conference_co_author_relation = ConferenceCoAuthorRelation.new(params[:conference_co_author_relation])
@conference_co_author_relations = ConferenceCoAuthorRelation.all
if @conference_co_author_relation.save
newv = render_to_string partial: "show_form", object: @conference_co_author_relations
render json: {success: true, msg: t('create_success') , newvalue: newv}.to_json
else
error_msg = @conference_co_author_relation.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def update
@conference_co_author_relation = ConferenceCoAuthorRelation.find(params[:id])
if @conference_co_author_relation.update_attributes(params[:conference_co_author_relation])
@conference_co_author_relations = ConferenceCoAuthorRelation.all
newv = render_to_string partial: "show_form", object: @conference_co_author_relations
newv = '<div class="overview" content-layout="datalist" per-column="4" base-width="300">' + newv + '</div>'
render json: {success: true, msg: t('update_success'), newvalue: newv}.to_json
else
error_msg = @conference_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def destroy
@conference_co_author_relation = ConferenceCoAuthorRelation.find(params[:id])
@conference_co_author_relation.destroy
reset_co_author_relation
render :json => {success: true, msg: t("delete_success")}
end
private
def reset_co_author_relation
co_author = ConferenceCoAuthor.where(conference_co_author_relations_id: @conference_co_author_relation.id)
co_author.map do |c|
c.update_attributes(conference_co_author_relations_id: nil)
end
end
end

View File

@ -0,0 +1,61 @@
class Panel::PersonalConference::Desktop::ConferenceCoAuthorsController < ApplicationController
def index
page = params[:page]
page ||= 1
@conference_co_authors = ConferenceCoAuthor.where(name_id: current_user.id).asc(:co_author)
@conference_co_author_relations = ConferenceCoAuthorRelation.all
@conference_co_authors = @conference_co_authors.page(page).per(40)
respond_to do |format|
format.html { render :layout => false}
end
end
def new
@conference_co_author = ConferenceCoAuthor.new
@conference_co_author_relations = ConferenceCoAuthorRelation.all
respond_to do |format|
format.html { render :layout => false}
end
end
def edit
@conference_co_author = ConferenceCoAuthor.find(params[:id])
@conference_co_author_relations = ConferenceCoAuthorRelation.all
respond_to do |format|
format.html { render :layout => false}
end
end
def create
@conference_co_author = ConferenceCoAuthor.new(params[:conference_co_author])
@conference_co_author.name_id= current_user.id
if @conference_co_author.save
render json: {success:true, msg: t('create_success')}.to_json
else
error_msg = @conference_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def update
@conference_co_author = ConferenceCoAuthor.find(params[:id])
if @conference_co_author.update_attributes(params[:conference_co_author])
render json: {success:true, msg: t('update_success')}.to_json
else
error_msg = @conference_co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def destroy
@conference_co_author = ConferenceCoAuthor.find(params[:id])
@conference_co_author.destroy
render :json => {success: true, msg: "delete_success"}
end
end

View File

@ -0,0 +1,114 @@
class Panel::PersonalConference::Desktop::ConferencePagesController < ApplicationController
def index
@view_by = params[:view]
@writing_conferences = WritingConference.where(create_user_id: current_user.id)
page = params[:page]
page ||= 1
if @view_by.nil?
@writing_conferences = @writing_conferences.asc(:paper_title)
else
@writing_conferences = @writing_conferences.asc(@view_by).asc(:paper_title)
end
@level_types = ConferencePaperType.all
@writing_conferences = @writing_conferences.page(page).per(50)
respond_to do |format|
format.html { render :layout => false}
end
end
def show
end
def new
@writing_conference = WritingConference.new
@paper_types = ConferencePaperType.all
@author_types = ConferenceAuthorType.all
@conference_candidate =
WritingConference.where(create_user_id: current_user.id).map{|j|j.conference_title}.uniq
if (not params[:q].nil?) and (current_user.name.include?params[:q])
@user = [{ :id => 0, :text => current_user.name, :email => current_user.email}] # self account name
else
@user = []
end
@co_authors = ConferenceCoAuthor.where(name_id: current_user.id, :co_author => /#{params[:q]}/).asc(:co_author)
# search string + self account name + match pattern
@co_authors = [{ :id => params[:q], :text => params[:q], :email => "#{t("add")} #{t("author")}" }] +
@user +
@co_authors.map{|m| { :id => m.id, :text => m.co_author, :email => m.email } }
respond_to do |format|
format.html { render :layout => false}
format.json { render :json => {:results => @co_authors}.to_json }
end
end
def edit
@writing_conference = WritingConference.find(params[:id])
@paper_types = ConferencePaperType.all
@author_types = ConferenceAuthorType.all
respond_to do |format|
format.html { render :layout => false}
end
end
def create
params[:writing_conference][:create_user_id] = current_user.id
@writing_conference = WritingConference.new(params[:writing_conference])
if @writing_conference.save
render json: {success: true, msg: t('create_success')}.to_json
else
error_msg = @writing_conference.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def update
params[:writing_conference][:update_user_id] = current_user.id
@writing_conference= WritingConference.find(params[:id])
if @writing_conference.update_attributes(params[:writing_conference])
render json: {success: true, msg: t('update_success')}.to_json
else
error_msg = @writing_conference.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def destroy
@writing_conference = WritingConference.find(params[:id])
@writing_conference.destroy
render :json => {success: true, msg: t('delete_success')}
end
def conference_type
page = params[:page]
page ||= 1
conference_types = ConferencePaperType.all
all_conference_lists = WritingConference.where(create_user_id: current_user.id)
all_conference_lists = all_conference_lists.asc(:conference_title)
all_conference_lists = all_conference_lists.page(page).per(50)
all_conference_lists = all_conference_lists.map do |j|
[ j.conference_title,
j.conference_paper_type_ids.map do |type|
conference_types.find(type).title
end
]
end
@conference_lists = all_conference_lists
respond_to do |format|
format.html { render :layout => false}
end
end
end

View File

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

View File

@ -0,0 +1,32 @@
class Panel::PersonalConference::Desktop::PluginIntrosController < ApplicationController
def index
@intro = PersonalConferenceIntro.where(:user_id => current_user.id.to_s).first
if @intro.blank?
@intro = PersonalConferenceIntro.new
render "new", :layout => false
else
render "edit", :layout => false
end
end
def create
@intro = PersonalConferenceIntro.new(params[:personal_conference_intro])
@intro.user_id = current_user.id
if @intro.save
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
def update
@intro = PersonalConferenceIntro.find(params[:id])
if @intro.update_attributes(params[:personal_conference_intro])
render :json => {"success" => true}.to_json
else
render :json => {"success" => false}.to_json
end
end
end

View File

@ -0,0 +1,26 @@
class Panel::PersonalConference::FrontEnd::WritingConferencesController < OrbitWidgetController
def initialize
super
@app_title = 'personal_conference'
end
def index
@writing_conferences = WritingConference.where(:is_hidden => false).desc(:year,:period_start_date).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
end

View File

@ -0,0 +1,180 @@
class Panel::PersonalConference::Plugin::WritingConferencesController < OrbitBackendController
include AdminHelper
include OrbitControllerLib::DivisionForDisable
before_filter :authenticate_user!
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)
@tags = 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
@tags = 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
@tags = get_tags
end
# POST /writing_conferences
# POST /writing_conferences.xml
def create
# @level_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all
@tags = 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]).destroy_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
end

0
app/helpers/.gitkeep Normal file
View File

View File

View File

@ -0,0 +1,103 @@
module Panel::PersonalConference::Desktop::ConferencePagesHelper
def publication_record publication, view
content_tag :li,
"item" => "true",
"data-id" => publication.id.to_s,
:class => "list_t_item #{view.blank? ? '' : "#{view}_view" } #{publication.is_hidden? ? "private" : "public" }" do
content_tag :div,
:class => "inner" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
end
end
end
def marker id
content_tag :div,
:class => "list_item_action" do
content_tag(:a, "",:href=>"",
:class => "icon-check-empty",
"toggle-onclick"=>"icon-check-empty icon-check",
"data-id" => id.to_s,
"ajax-remote"=>"false") + \
content_tag(:a, "",:href=>"",
:class => "icon-star-empty",
"toggle-onclick"=>"icon-star-empty icon-star",
"data-id" => id.to_s,
"ajax-remote"=>"false")
end
end
def content publication, view
case view
when "conference_title"
des = content_tag(:div, publication.conference_title,
:class => "list_t_des")
when "keywords"
des = content_tag(:div, publication.keywords,
:class => "list_t_des")
when "abstract"
des = content_tag(:div, publication.abstract,
:class => "list_t_des")
when "file"
des = content_tag(:div, link_publication_file(publication),
:class => "list_t_des")
else
end
content_tag(:div, publication.paper_title,
:class => "list_t_title") + des
end
def edit_or_delete publication
content_tag :div,
:class => "list_item_function" do
content_tag(:a, t("edit"),
:class => "journal_paper_edit admbg2 admtxt",
:href => edit_panel_personal_conference_desktop_conference_page_path(publication),
"callback-method" => "editpaper",
"ajax-remote" => "get") + \
content_tag(:a, t(:delete_),
"ajax-remote" => "delete",
"confirm-message" => t("sure?"),
"callback-method" => "paperDelete",
:class => "journal_paper_delete admbg2 admtxt",
:href => panel_personal_conference_desktop_conference_page_path(publication))
end
end
def link_publication_file publication
publication.writing_conference_files.map{|file|
link_to(image_tag(check_file_type(file.file.url)) + \
content_tag(:span, (file.title_translations[I18n.locale.to_s] rescue nil), :class => "filetitle"),
file.file.url,
:class => "file",
"target" => "_blank",
"title" => (file.title_translations[I18n.locale.to_s] rescue nil))
}.inject(:+)
end
def check_file_type file
if not file.nil?
file_type = MIME::Types.type_for(file).first.to_s.split("/")[1]
file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png"
else
file_type = ""
end
end
def generate_authors_name ids
author_name = ids.map{|m|
if m == "0"
#{:id => 0, :text => current_user.name, :email => current_user.email }
{:id => 0, :text => current_user.name }
else
#{:id => m, :text => ConferenceCoAuthor.find(m).co_author, :email => ConferenceCoAuthor.find(m).email}
{:id => m, :text => ConferenceCoAuthor.find(m).co_author}
end
}
author_name.to_json
end
end

0
app/mailers/.gitkeep Normal file
View File

0
app/models/.gitkeep Normal file
View File

View File

@ -0,0 +1,9 @@
# encoding: utf-8
class ConferenceAuthorType < WritingConferenceCategory
field :title, localize: true
has_and_belongs_to_many :writing_conferences
end

View File

@ -0,0 +1,21 @@
class ConferenceCoAuthor
include Mongoid::Document
LANGUAGE_TYPES = [ "English", "Chinese" ]
field :name_id, type: BSON::ObjectId # this is author
field :co_author, localize: true
field :email
belongs_to :conference_co_author_relations
has_and_belongs_to_many :writing_conferences
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/
validates :email, format: { with: VALID_EMAIL_REGEX },
allow_blank: true,
uniqueness: { case_sensitive: false }
validates :co_author, presence: true
before_save { |coauthor| coauthor.email = email.downcase if not coauthor.email.nil?}
end

View File

@ -0,0 +1,11 @@
class ConferenceCoAuthorRelation
include Mongoid::Document
include Mongoid::Timestamps
field :relation, localize: true
has_and_belongs_to_many :conference_co_authors
validates :relation, presence: true,
uniqueness: { case_sensitive: false }
end

View File

@ -0,0 +1,9 @@
# encoding: utf-8
class ConferencePaperType < WritingConferenceCategory
field :title, localize: true
has_and_belongs_to_many :writing_conferences
end

View File

@ -0,0 +1,4 @@
class PersonalConferenceIntro < PersonalPluginIntro
end

View File

@ -0,0 +1,118 @@
class WritingConference
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
include OrbitModel::LanguageRestrict
include OrbitModel::Status
include OrbitTag::Taggable
LANGUAGE_TYPES = [ "English", "Chinese" ]
field :paper_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 => "PersonalConferenceTag"
has_and_belongs_to_many :conference_author_types
has_and_belongs_to_many :conference_paper_types
has_and_belongs_to_many :conference_co_authors
field :year
field :language
field :period_start_date, :type => Date
field :period_end_date, :type => Date
field :keywords
field :abstract
field :publication_date, :type => Date
field :url
field :note
field :create_user_id, :type => BSON::ObjectId
field :update_user_id, :type => BSON::ObjectId
paginates_per 10
has_many :writing_conference_files, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :writing_conference_files, :allow_destroy => true
# before_save :clean_checkboxs
validates :paper_title, :at_least_one => true
before_validation :add_http
after_save :save_writing_conference_files
validates :url, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i, :unless => Proc.new{self.url.blank?}
attr_reader :author_tokens
def author_tokens=(ids)
authors_ids = ids.split(",").map{|id|
begin
ConferenceCoAuthor.find(id).id
rescue
if id != "0"
new_co_author = ConferenceCoAuthor.new(:co_author => id)
new_co_author.save
new_co_author.id
else
id
end
end
}
self.conference_co_author_ids = authors_ids
end
def self.search( category_id = nil )
if category_id.to_s.size > 0
find(:all, :conditions => {writing_conference_category_id: category_id}).desc( :is_top, :title )
else
find(:all).desc( :is_top, :title)
end
end
def self.widget_datas
where( :is_hidden => false ).desc(:is_top, :created_at)
end
def save_writing_conference_files
self.writing_conference_files.each do |t|
if t.should_destroy
t.destroy
end
end
end
def create_link
title = []
title << self.authors if self.authors.present?
if !self.publication_date.nil?
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
title << pd[0]
end
title << self.paper_title if self.paper_title.present?
title << self.conference_title if self.conference_title.present?
title << self.location if self.location.present?
title << "#{period_start_date}-#{period_end_date}" if (self.period_start_date.present? && self.period_end_date.present?)
# title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
title.join(', ')
end
protected
def add_http
unless self.url.blank? || self.url[/^http:\/\//] || self.url[/^https:\/\//]
self.url = 'http://' + self.url
end
end
def clean_checkboxs
self.tagged_ids.delete('')
self.conference_author_type_ids.delete('')
self.conference_level_type_ids.delete('')
end
end

View File

@ -0,0 +1,30 @@
# encoding: utf-8
class WritingConferenceCategory
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCoreLib::ObjectAuthable
include OrbitCoreLib::ObjectDisable
# include Mongoid::MultiParameterAttributes
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_conferences
def pp_object
title
end
def self.from_id(id)
WritingConferenceCategory.find(id) rescue nil
end
def self.is_localized?(field_name)
self.fields[field_name.to_s].localized?
end
end

View File

@ -0,0 +1,14 @@
class WritingConferenceFile
include Mongoid::Document
include Mongoid::Timestamps
mount_uploader :file, AssetUploader
field :description, localize: true
field :should_destroy, :type => Boolean
field :title, localize: true
belongs_to :writing_conference
end

0
app/views/.gitkeep Normal file
View File

View File

@ -0,0 +1,44 @@
<% # encoding: utf-8 %>
<%= form_for(:writing_conference_category, :remote => true, :url => @url, :method => @verb, :html => { :id => 'form_writing_conference_category' } ) do |f| %>
<h2><%= (@writing_conference_category.new_record? ? 'Add' : 'Edit') %></h2>
<div id="widget-title">
<%= f.label :key %>
<%= f.text_field :key %>
</div>
<div id="widget-title">
<% if @types.is_localized?(:title) %>
<%= f.fields_for :title_translations do |f| %>
<% @site_in_use_locales.each do |locale| %>
<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_conference_category.title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
<% end %>
<% else %>
<div id="widget-title">
<%= f.label :title %>
<%= f.text_field :title %>
</div>
<% end %>
</div>
<div id="widget-title">
<%#= f.label :display %>
<%#= f.radio_button :display, "List" List%>
<%#= f.radio_button :display, "Picture" Picture%>
<%# <br />顯示方式是設定在前台頁面時,資訊所呈現的樣式 %>
</div>
<div class="form-actions">
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
</div>
<% end %>

View File

@ -0,0 +1,28 @@
<% # encoding: utf-8 %>
<div id="qe-basic" class="qe-edit-div">
<div id="widget-title">
<%= f.label :key %>
<%= f.text_field :key %>
</div>
<div id="widget-title">
<%= f.fields_for :title_translations do |f| %>
<% @site_in_use_locales.each do |locale| %>
<div class="control-group">
<%= label_tag "title-#{locale}", "Title-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls">
<%= f.text_field locale, :class => 'input-xxlarge', :value => (news_bulletin_category.title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
<% end %>
</div>
<div id="widget-title">
<%= f.label :display %>
<%= f.radio_button :display, "List" %>List
<%= f.radio_button :display, "Picture" %>Picture
<br />顯示方式是設定在前台頁面時,資訊所呈現的樣式
</div>
</div>

View File

@ -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('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %></li>
<% end %>
</ul>
</div>
</td>
<% if @types.is_localized?(:title) %>
<% @site_in_use_locales.each do |locale| %>
<td><%= writing_conference_category.title_translations[locale] rescue nil %></td>
<% end %>
<% else %>
<td><%= writing_conference_category.title %></td>
<% end %>
</tr>

View File

@ -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();

View File

@ -0,0 +1 @@
$("#<%= dom_id @writing_conference_category %>").find(".archive_toggle").text("<%= show_toggle_archive_btn(@writing_conference_category) %> ");

View File

@ -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 %>

View File

@ -0,0 +1 @@
$("#form > form").replaceWith("<%= j render "form" %>");

View File

@ -0,0 +1,29 @@
<%= flash_messages %>
<%= @types %>
<table id="writing_conference_categorys" class="table main-list">
<thead>
<tr>
<th class="span1-2"><%= t('writing_conference_category.key') %></th>
<% if @types.is_localized?(:title) %>
<% @site_in_use_locales.each do |locale| %>
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
<% end %>
<% else %>
<th class="span1-2"><%= t('writing_conference_category.title') %></th>
<% end %>
</tr>
</thead>
<tbody>
<%= render :partial => 'writing_conference_category', :collection => @writing_conference_categorys %>
</tbody>
</table>
<div id="form"><%= render :partial => "form" if is_manager? %></div>

View File

@ -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 %>

View File

@ -0,0 +1 @@
$("#form > form").replaceWith("<%= j render "form" %>");

View File

@ -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();

View File

@ -0,0 +1,34 @@
<% # encoding: utf-8 %>
<%= form_for(@set_author_type, :remote => true, :url => @author_type_url ) do |f| %>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabe2"><%= (@set_author_type.new_record? ? 'Add 作者型態' : 'Edit 作者型態') %></h3>
</div>
<div class="modal-body">
<div class="control-group">
<label for="http" class="control-label">Key</label>
<div class="controls">
<%= f.text_field :key %>
</div>
<%= f.fields_for :title_translations do |f| %>
<% @site_in_use_locales.each do |locale| %>
<div class="control-group">
<%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls">
<%= f.text_field locale, :class => 'control-label', :value => (@set_author_type.title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="modal-footer">
<%= 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 %>

View File

@ -0,0 +1,9 @@
<div class="table-label">
<div id="sort_headers" class="table-label">
<%= render 'sort_headers' %>
</div>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "sort_header" %>
<% end %>

View File

@ -0,0 +1,333 @@
<% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<%= f.error_messages %>
<!-- Input Area -->
<div class="input-area">
<!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav">
<li></li>
<li class="active">
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
</li>
<% if show_form_status_field(@writing_conference) %>
<li>
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
</li>
<% end %>
<li>
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</li>
</ul>
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<% if !params[:user_id].blank? %>
<div class="control-group">
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
<div class="controls">
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
</div>
<% end %>
<!-- paper_type -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.paper_type") %></label>
<div class="controls">
<% @paper_types.each do |paper_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= 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_conference[conference_paper_type_ids][]', '' %>
<% end %>
<% end %>
</div>
</div>
<!-- author_type -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.author_type") %></label>
<div class="controls">
<% @author_types.each do |author_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= 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_conference[conference_author_type_ids][]', '' %>
<% end %>
<% end %>
</div>
</div>
<!-- year -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.year") %></label>
<div class="controls">
<%= 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]',:class => 'span1'} ) %>
</div>
</div>
<!-- period_start_date -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.period_start_date") %></label>
<div class="controls">
<%= 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>
<!-- period_end_date -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.period_end_date") %></label>
<div class="controls">
<%= 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>
</div>
<!-- publication_date -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.publication_date") %></label>
<div class="controls">
<%= 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>
<!-- url -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.url") %></label>
<div class="controls">
<%= f.text_field :url , :class => "span6" %>
</div>
</div>
<!-- keywords -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.keywords") %></label>
<div class="controls">
<%= f.text_field :keywords %>
</div>
</div>
<!-- abstract -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.abstract") %></label>
<div class="controls">
<%= f.text_field :abstract %>
</div>
</div>
<!-- language -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.language") %></label>
<div class="controls">
<%= f.select :language, WritingConference::LANGUAGE_TYPES, :prompt => 'Select' %>
</div>
</div>
<!-- note -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.note") %></label>
<div class="controls">
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
</div>
</div>
</div>
<!-- Status Module -->
<% if show_form_status_field(@writing_conference) %>
<div class="tab-pane fade" id="status">
<!-- Status -->
<div class="control-group">
<label class="control-label muted"><%= t(:status) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn <%= 'active' if @writing_conference.is_hidden? %>">
<%= f.check_box :is_hidden %> <%= t(:hide) %>
</label>
</div>
</div>
</div>
<% end %>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %>
<label class="checkbox inline btn <%= 'active' if @writing_conference.tag_ids.include?(tag.id) %>">
<%= check_box_tag 'writing_conference[tag_ids][]', tag.id, @writing_conference.tag_ids.include?(tag.id) %> <%= tag.name %>
<%= hidden_field_tag 'writing_conference[tag_ids][]', '' %>
</label>
<% end %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- paper_title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.paper_title") %></label>
<div class="controls">
<%= f.fields_for :paper_title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.paper_title"), value: (@writing_conference.paper_title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- conference_title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.conference_title") %></label>
<div class="controls">
<%= f.fields_for :conference_title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.conference_title"), value: (@writing_conference.conference_title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- location-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.location") %></label>
<div class="controls">
<%= f.fields_for :location_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.location"), value: (@writing_conference.location_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- sponsor-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.sponsor") %></label>
<div class="controls">
<%= f.fields_for :sponsor_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.sponsor"), value: (@writing_conference.sponsor_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- authors-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.authors") %></label>
<div class="controls">
<%= f.fields_for :authors_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.authors"), value: (@writing_conference.authors_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<% end %>
<!-- File -->
<div class="control-group">
<label class="control-label muted"><%= t(:file_) %></label>
<div class="controls">
<!-- Exist -->
<% if @writing_conference && !@writing_conference.writing_conference_files.blank? %>
<div class="exist">
<% @writing_conference.writing_conference_files.each_with_index do |archive_file_multiple, i| %>
<%= f.fields_for :writing_conference_files, archive_file_multiple do |f| %>
<%= render :partial => 'form_file', :object => archive_file_multiple, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<hr>
</div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %>
<a id="add_file" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div>
</div>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
<% content_for :page_specific_javascript do %>
<script>
$(document).ready(function() {
$('.main-forms .add-on').tooltip();
$(document).on('click', '#add_file', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_writing_conference_files", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_conference_files) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
});
formTip();
});
$(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);
$(this).parents('.start-line').hide();
}
});
});
</script>
<% end %>

View File

@ -0,0 +1,45 @@
<% if form_file.new_record? %>
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
<% else %>
<div class="fileupload fileupload-exist start-line" data-provides="fileupload">
<% if form_file.file.blank? %>
<%= t(:no_file) %>
<% else %>
<%= link_to content_tag(:i) + form_file.file_identifier, form_file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
<% end %>
<% end %>
<div class="input-prepend input-append">
<label>
<span class="add-on btn btn-file" title='<%= t(:file_) %>'>
<i class="icons-paperclip"></i>
<%= f.file_field :file %>
</span>
<div class="uneditable-input input-medium">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><%= (form_file.new_record? || form_file.file.blank?) ? t(:select_file) : t(:change_file) %></span>
</div>
</label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
<% end %>
</span>
<% end %>
</span>
</span>
<% if form_file.new_record? %>
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class="icon-remove"></a>
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
</span>
<% end %>
</div>
</div>

View File

@ -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 'Delete',
polymorphic_path([:panel, :personal_conference, :back_end, list_author_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>

View File

@ -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 'Delete',
polymorphic_path([:panel, :personal_conference, :back_end, list_paper_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>

View File

@ -0,0 +1,34 @@
<% # encoding: utf-8 %>
<%= form_for(@set_paper_type, :remote => true, :url => @paper_type_url ) do |f| %>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel"><%= (@set_paper_type.new_record? ? 'Add 論文型態' : 'Edit 論文型態') %></h3>
</div>
<div class="modal-body">
<div class="control-group">
<label for="http" class="control-label">Key</label>
<div class="controls">
<%= f.text_field :key %>
</div>
<%= f.fields_for :title_translations do |f| %>
<% @site_in_use_locales.each do |locale| %>
<div class="control-group">
<%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
<div class="controls">
<%= f.text_field locale, :class => 'control-label', :value => (@set_paper_type.title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="modal-footer">
<%= 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 %>

View File

@ -0,0 +1,16 @@
<tr id="<%= dom_id writing_conference %>" class="with_action">
<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>

View File

@ -0,0 +1 @@
$("#myModal2").html("<%= j render "author_type_qe" %>");

View File

@ -0,0 +1 @@
$("#myModal2").html("<%= j render "author_type_qe" %>");

View File

@ -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 %>

View File

@ -0,0 +1 @@
$("#<%= dom_id @writing_conference %>").remove();

View File

@ -0,0 +1,15 @@
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %>
</div>
<%= form_for @writing_conference, url: panel_personal_conference_back_end_writing_conference_path(@writing_conference), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1,34 @@
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %>
<%= render 'filter' %>
</div>
<table class="table main-list">
<thead>
<tr>
<th class="span1"><%= t("personal_book.year") %></th>
<th class="span7"><%= t("module_name.personal_conference") %></th>
<th class="span1"><%= t("personal_plugins.author") %></th>
</tr>
</thead>
<tbody id="tbody_writing_conferences" class="sort-holder">
<%= render :partial => 'writing_conference', :collection => @writing_conferences %>
</tbody>
</table>
<div class="bottomnav clearfix">
<div class="action pull-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>
<div class="pagination pagination-centered">
<%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div>
</div>

View File

@ -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} %>");

View File

@ -0,0 +1,15 @@
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %>
</div>
<%= form_for @writing_conference, url: panel_personal_conference_back_end_writing_conferences_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -0,0 +1 @@
$("#myModal1").html("<%= j render "paper_type_qe" %>");

View File

@ -0,0 +1 @@
$("#myModal1").html("<%= j render "paper_type_qe" %>");

View File

@ -0,0 +1,3 @@
$("#enable_<%= @bulletin.id %>").toggle();
$("#disable_<%= @bulletin.id %>").toggle();
$("#bulletin_<%= @bulletin.id %>").toggleClass('disable');

View File

@ -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 %>

View File

@ -0,0 +1,154 @@
<% # encoding: utf-8 %>
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %>
</div>
<div id="isotope">
<div class="item element">
<div class="detail w-a h-a">
<p class="totle">
<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><%= t("personal_conference.paper_type") %></span>
</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table id="paper_types" class="table table-striped">
<tbody>
<%= render :partial => 'list_paper_type', :collection => @paper_types %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<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_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><%= t("personal_conference.author_type") %></span>
</p>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table id="author_types" class="table table-striped">
<tbody>
<%= render :partial => 'list_author_type', :collection => @author_types %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="item element">
<div class="detail w-a h-a">
<p class="totle">
<button class="btn btn-small btn-primary pull-right" type="button" data-toggle="modal" data-target="#myModal4"><i class="icon-plus"></i> 新增</button>
<span>領域</span>
</p>
<ul class="nav nav-tabs">
<li class="active"><a href="#">中文</a></li>
<li><a href="#">English</a></li>
</ul>
<div class="detal-list my_scroll">
<div class="scrollbar">
<div class="track">
<div class="thumb">
<div class="end"></div>
</div>
</div>
</div>
<div class="viewport">
<div class="overview">
<table class="table table-striped">
<tbody>
<tr>
<td>Corresponding Author</td>
<td>編輯 刪除</td>
</tr>
<tr>
<td>First Author, Co- Authors</td>
<td>編輯 刪除</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-actions form-fixed pagination-right">
<!-- <a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯出</a>&nbsp;
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯入</a>&nbsp; -->
<%= 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>
<div id="paper_type_qe">
<div style="display:none;" class="modal" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<%= render :partial => "paper_type_qe" %>
</div>
</div>
<div id="author_type_qe">
<div style="display:none;" class="modal" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<%= render :partial => "author_type_qe" %>
</div>
</div>
<div style="display:none;" class="modal" id="myModal4" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">領域</h3>
</div>
<ul class="nav nav-tabs">
<li class="active"><a href="#">中文</a></li>
<li><a href="#">English</a></li>
</ul>
<div class="modal-body">
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" for="inputvalue">名稱</label>
<div class="controls">
<input type="text" id="inputvalue" placeholder="Value">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "item" %>
<% end %>

View File

@ -0,0 +1,19 @@
<ul class="s_form">
<li class="s_grid_row">
<% if @conference_co_author_relation.new_record? %>
<%= f.text_field :relation, class: "s_grid s_grid_6" %>
<% else %>
<%= f.text_field :relation, class: "s_grid s_grid_4" %>
<% end %>
<!--
<#%= f.fields_for :relation_translations do |f| %>
<#%= f.text_field locale,
value: (@conference_co_author_relation.relation_translations[locale] rescue nil) %>
<#% end %>
-->
<%= f.submit t("save"), class: "s_grid s_grid_2 ini_input hp hh1 thmtxt thmc2" %>
<% if not @conference_co_author_relation.new_record? %>
<%= submit_tag t("cancel"), "ajax-remote" => "get", :herf => panel_personal_conference_desktop_conference_co_author_relations_path ,:type => "button", class: "bt-cancel-type s_grid s_grid_2 ini_input hp hh1 thmtxt" %>
<% end %>
</li>
</ul>

View File

@ -0,0 +1,3 @@
<%= form_for(@conference_co_author_relation, url: panel_personal_conference_desktop_conference_co_author_relations_path, html:{"form-type"=>"ajax_form", "callback-method"=>"coauthorRelationForm"} ) do |f| %>
<%= render partial: 'form' , locals: {:f => f}%>
<% end %>

View File

@ -0,0 +1,13 @@
<div class="overview" page-name="conference_p_coauthor_relation" content-layout="datalist" per-column="4" base-width="300" pagination-var="page">
<ul>
<% @conference_co_author_relations.each_with_index do |conference_co_author_relation,i| %>
<li class="s_grid_row" item="true">
<div class="form_space" id="form_space_<%= i.to_s %>"><%= conference_co_author_relation.relation %></div>
<div class="list_item_function">
<%= link_to t('edit'), edit_panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), :class => "bt-edit-type admbg2 admtxt", "content-holder"=>"#form_space_"+i.to_s, "ajax-remote"=>"get" %>
<%= link_to t(:delete_), panel_personal_conference_desktop_conference_co_author_relation_path(conference_co_author_relation), "confirm-message"=>t('sure?'), "ajax-remote"=>"delete", :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for(@conference_co_author_relation, url: panel_personal_conference_desktop_conference_co_author_relation_path(@conference_co_author_relation), html:{"form-type"=>"ajax_form", "callback-method"=>"coauthorRelationEditForm"} ) do |f| %>
<%= render partial: 'form' , locals: {:f => f}%>
<% end %>

View File

@ -0,0 +1,23 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<div class="hh1 sdm">
<div class="sdm_t hp hh1 thmc2 thmtxt"><%=t("add") %></div>
<div class="admbg sdm_o">
<ul>
<li class="vp hp s_form" style="width:282px;"><%= render 'new' %></li>
</ul>
</div>
</div>
<%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "bt-cancel fn_btn ini_input hp hh1 thmtxt" %>
</div>
</div>
<!-- <div id="co_author_relation_table" 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"> -->
<%= render :partial => 'show_form'%>
<!-- </div>
</div>
-->

View File

@ -0,0 +1,35 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
<%= submit_tag t("back"), :type => "button", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_co_authors_path, class: "fn_btn ini_input hp hh1 thmtxt" %>
</div>
</div>
<div id="new_co_author" class="s_grid_con s_form vp">
<ul>
<li class="s_grid_row">
<%= f.label :co_author, class: "s_grid s_grid_4" %>
<%= f.text_field :co_author, class: "s_grid_8 s_grid"%>
<!--
<%#= f.fields_for :co_author_translations do |f| %>
<%#= f.text_field locale,
class: "s_grid_4 s_grid",
value: (@conference_co_author.co_author_translations[locale] rescue nil) %>
<%# end %>
-->
</li>
<li class="s_grid_row">
<%= f.label :email, class: "s_grid s_grid_4"%>
<%= f.text_field :email, class: "s_grid s_grid_8" %>
</li>
<li class="s_grid_row">
<%= f.label :type, class: "s_grid s_grid_4"%>
<select name="conference_co_author[co_author_relations_id]" id="" class="s_grid s_grid_8">
<%= options_for_select(
@conference_co_author_relations.map do |relation|
[relation.relation, relation.id]
end
)%>
</select>
</li>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @conference_co_author, html: { multipart: true ,"form-type"=>"ajax_form", "callback-method"=>"coAuthorformCallback"} , url: panel_personal_conference_desktop_conference_co_author_path(@conference_co_author) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<% end %>

View File

@ -0,0 +1,30 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= link_to "New Co-Author", new_panel_personal_conference_desktop_conference_co_author_path, :class=>"bt-co-author fn_btn hp hh1 thmc2 thmtxt", "ajax-remote"=>"get" %>
<%= link_to "New Type", panel_personal_conference_desktop_conference_co_author_relations_path, :class=>"bt-new-type fn_btn hp hh1 thmc2 thmtxt", "ajax-remote"=>"get" %>
</div>
</div>
<!-- <div id="co_author" 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" page-name="conference_p_coauthor" content-layout="datalist" per-column="4" base-width="400" pagination-var="page">
<% @conference_co_authors.each_with_index do |co_author,i| %>
<div class="g_col">
<ul>
<li class="list_t_item" item="true">
<ul class="info">
<li><div class="name"><%= co_author.co_author %></div></li>
<li><div class="email"><i class="icon-envelope"></i> <%= co_author.email %></div></li>
<li><div class="relations"><i class="icon-user"></i> <%= @conference_co_author_relations.find(co_author.conference_co_author_relations_id).relation unless co_author.conference_co_author_relations_id.nil?%></div></li>
</ul>
<div class="list_item_function">
<%= link_to t('edit'), edit_panel_personal_conference_desktop_conference_co_author_path(co_author), :class => "bt-edit admbg2 admtxt", "ajax-remote"=>"get" %>
<%= link_to t(:delete_), panel_personal_conference_desktop_conference_co_author_path(co_author), "ajax-remote"=>"delete", "confirm-message"=>t('sure?'), "callback-method"=>"paperDelete", :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
</ul>
</div>
<% end %>
</div>
<!-- </div>
</div> -->

View File

@ -0,0 +1,3 @@
<%= form_for @conference_co_author, html: { multipart: true ,"form-type"=>"ajax_form", "callback-method"=>"coAuthorformCallback"} , url: panel_personal_conference_desktop_conference_co_authors_path do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<% end %>

View File

@ -0,0 +1,206 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", value: "Save", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
<!-- class: bt-cancle can't be remove -->
<% if not @writing_conference.new_record? %>
<%= submit_tag t("cancel"), :type => "button", "callback-method"=>"cancelpaper", "ajax-remote" => "get", :href => panel_personal_conference_desktop_conference_pages_path, class: "fn_btn ini_input hp hh1 admbg2 admtxt" %>
<% end %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><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" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row" >
<% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<div class="form_fix" <%= style %> <%= data %>>
<%= f.fields_for :paper_title_translations do |f| %>
<%= f.text_area locale,
class: "s_grid_12 s_grid_h_2 s_grid",
size: "20x2",
placeholder: t("personal_conference.paper_title")+ "("+I18nVariable.from_locale(locale)+")",
value: (@writing_conference.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
<%= f.fields_for :conference_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_conference.conference_title")+ "("+I18nVariable.from_locale(locale)+")",
class: "s_grid_12 s_grid",
value: (@writing_conference.conference_title_translations[locale.to_s] rescue nil) %>
<% end %>
</div>
<% end %>
</li>
<li class="s_grid_row">
<div>
<%= label_tag("", t("personal_conference.paper_type"), class: 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_1">
<ul>
<% @paper_types.each_with_index do |paper_type, i| %>
<li>
<%= radio_button_tag "writing_conference[conference_paper_type_ids][]",
paper_type.id,
@writing_conference.conference_paper_type_ids.include?(paper_type.id),
id: "field-#{i}"
%><%= label_tag("field-#{i}", paper_type.title) %>
</li>
<% end %>
</ul>
</div>
</div>
</li>
<li class="s_grid_row">
<%= f.text_field :keywords, size: "20", placeholder: t("personal_conference.keywords"), class: "s_grid_12 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.conference_time"), class: "s_grid s_grid_4") %>
<ul class="s_grid s_grid_8">
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.period_start_date"), class: "s_grid_2 s_grid") %>
<%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_2 s_grid'} %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.period_end_date"), class: "s_grid_2 s_grid") %>
<%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_2 s_grid'} %>
</li>
</ul>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.sponsor"), class: "s_grid_4 s_grid") %><%= f.text_field :sponsor, size: "20", placeholder: "Sponsor", class: "s_grid_8 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.location"), class: "s_grid_4 s_grid") %><%= f.text_field :location, size: "20", placeholder: "Location", class: "s_grid_8 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_8 s_grid"%>
</li>
<li class="s_grid_row">
<%= f.text_area :author_tokens,
class: "s_grid_12 s_grid",
size: "20x2",
placeholder: t("personal_conference.authors"),
"autocomplete" => "/panel/personal_conference/desktop/conference_pages/new.json",
"autocomplete-format" => "--:[text,email]",
"data-pre" => generate_authors_name(@writing_conference.conference_co_author_ids) %>
<%#= f.fields_for :authors_translations do |f| %>
<%#= f.text_area locale,
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_conference.authors"),
# "autocomplete-list" => "coauthor_autocomplete_list",
value: (@writing_conference.authors_translations[locale.to_s] rescue nil) %>
<%# end %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.author_type"), class: "s_grid_4 s_grid") %>
<select name="writing_conference[conference_author_type_ids][]" id="" class="s_grid s_grid_8">
<%= options_for_select(
@author_types.map do |author_type|
[author_type.title, author_type.id]
end
)
%>
</select>
</li>
<li class="s_grid_row">
<label for="" class="s_grid s_grid_4">Status</label>
<select name="" id="" class="s_grid s_grid_8">
<option value="">Published</option>
<option value="">Pending</option>
<option value="">Writing</option>
</select>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.publication_date"), class: "s_grid_6 s_grid") %>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_2 s_grid'} %>
</li>
<li class="s_grid_row">
<%= f.label :year, t("personal_conference.year"), :class => "s_grid_4 s_grid" %>
<%= 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]', :class => "s_grid_8 s_grid"} ) %>
</li>
<li class="s_grid_row"><input class="s_grid s_grid_12" type="text" placeholder=<%= t("personal_conference.tags") %>></li>
<li class="s_grid_row">
<table class="s_table">
<thead>
<tr>
<th class="s_grid_2"><%= t("personal_conference.file")%></th>
<th class="s_grid_4"><%= t("personal_conference.file_name")%></th>
<th class="s_grid_4"><%= t("personal_conference.description") %></th>
<th class="s_grid_2"></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4">
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
<%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %>
<a class="add setting_btn thmc1 thmtxt w1 hh1 hp" href=""><i class="icon-plus icon-white"></i> add</a>
</div>
</td>
</tr>
</tfoot>
<tbody>
<% @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>
</table>
</li>
<li class="s_grid_row">
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_conference.abstract"), class: "s_grid_12 s_grid_h_10 s_grid s_grid_h_full"%>
</li>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x22", placeholder: t("personal_conference.note"), class: "s_grid_12 s_grid_h_10 s_grid s_grid_h_full"%>
</li>
</ul>
</div>
<!-- </div>
</div> -->
<script>
var get_html = function(old_id,new_id){
return ("<%= escape_javascript(add_attribute 'form_file', f, :writing_conference_files) %>").replace(old_id, new_id);
}
</script>

View File

@ -0,0 +1,50 @@
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class="list_item">
<td>
<div>
<% if form_file.new_record? %>
<%= f.file_field :file, class: "s_grid_2", onchange:"var temp = o.filepathSplitter(this.value);temp=temp[temp.length - 1];this.parentNode.getElementsByTagName('label')[0].innerHTML = temp;var inputs = this.parentNode.parentNode.parentNode.getElementsByClassName('title_field');inputs[0].value = temp;inputs[1].value = temp;" %>
<label></label>
<% else %>
<%= link_to(image_tag(check_file_type(form_file.file.url)),
form_file.file.url,
:class => "file",
"target" => "_blank",
"title" => form_file.title) %>
<% end %>
</div>
</td>
<% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<td <%= style %> <%= data %>>
<%= f.fields_for :file_title_translations do |f| %>
<%= f.text_field locale,
class: 's_grid_4 title_field',
placeholder: I18nVariable.from_locale(locale),
value: (form_file.file_title_translations[locale] rescue nil) %>
<% end %>
</td>
<td <%= style %> <%= data %>>
<%= f.fields_for :file_description_translations do |f| %>
<%= f.text_field locale,
class: 's_grid_4',
placeholder: I18nVariable.from_locale(locale),
value: (form_file.file_description_translations[locale] rescue nil) %>
<% end %>
</td>
<% end %>
<td>
<span class="action">
<% if form_file.new_record? %>
<a class="delete"><i class="icon-remove" style="cursor:pointer;"></i></a>
<% else %>
<%= f.hidden_field :id %>
<a class="remove_existing_record" style="cursor:pointer;"><i class="icon-remove"></i></a>
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
<% end %>
<%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %>
</span>
</td>
</tr>

View File

@ -0,0 +1,35 @@
<div class="toolbar hh1">
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh1 admtxt" href="">Friends</a></li>
<li><a class="hp hh1 admtxt" href="">Private</a></li>
<li><a class="hp hh1 admtxt" href="">Group</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<!-- <div id="conference_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" page-name="conference_p_conference" content-layout="datalist" per-column="5" base-width="300" pagination-var="page">
<% @conference_lists.each_with_index do |conference_list,i| %>
<ul>
<li class="list_t_item" item="true">
<div class="list_item_action">
<i class="icon-file"></i>
</div>
<% title, level = conference_list %>
<div class="list_t_title"><%= title %></div>
<div class="list_t_desc"><%= level.join(",") %></div>
</li>
</ul>
<% end %>
</div>
<!-- </div>
</div>
-->

View File

@ -0,0 +1,4 @@
<%= form_for @writing_conference, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_conference_desktop_conference_page_path(@writing_conference) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,80 @@
<div class="toolbar hh1">
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-check"></span></div>
<div class="admbg sdm_o">
<ul id="conference_selection_options">
<li><a class="hp hh1 admtxt" href="all" ajax-remote="false" callback-method="allnone">All</a></li>
<li><a class="hp hh1 admtxt" href="none" ajax-remote="false" callback-method="allnone">None</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">More</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh1 admtxt" href="">Delete</a></li>
<li><a class="hp hh1 admtxt" href="">Tag</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Tag</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh1 admtxt" href="">All</a></li>
<li><a class="hp hh1 admtxt" href="">Starred</a></li>
<li><a class="hp hh1 admtxt" href="">MIT</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Status</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh1 admtxt" href="">All</a></li>
<li><a class="hp hh1 admtxt" href="">Published</a></li>
<li><a class="hp hh1 admtxt" href="">Pending</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">View</div>
<div class="admbg sdm_o">
<ul id="view_selection">
<li><%= link_to "Conference", panel_personal_conference_desktop_conference_pages_path + "?view=conference_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
<li><%= link_to "Title", panel_personal_conference_desktop_conference_pages_path + "?view=paper_title", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
<li><%= link_to "File", panel_personal_conference_desktop_conference_pages_path + "?view=file", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
<li><%= link_to "Keywords", panel_personal_conference_desktop_conference_pages_path + "?view=keywords", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
<li><%= link_to "Abstract", panel_personal_conference_desktop_conference_pages_path + "?view=abstract", :class => "hp hh1 admtxt", "ajax-remote" => "get" %></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1">Share</div>
<div class="admbg sdm_o share_mode" data-link="<%= data_share_panel_personal_conference_back_end_writing_conferences_path %>" data-var="disable" >
<ul>
<li><a class="hp hh1 admtxt" href="" item-class="private" data-mode="true" >Private</a></li>
<li><a class="hp hh1 admtxt" href="" item-class="public" data-mode="false" >Public</a></li>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><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"> -->
<% if @view_by.eql?"abstract" %>
<div class="overview" page-name="conference_p_list" content-layout="simple" per-column="1" base-width="300" pagination-var="page">
<% else %>
<div class="overview" page-name="conference_p_list" content-layout="simple" per-column="5" base-width="300" pagination-var="page">
<% end %>
<ul isotope="true">
<% @writing_conferences.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</ul>
</div>
<!-- </div>
</div> -->

View File

@ -0,0 +1,4 @@
<%= form_for @writing_conference, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_conference_desktop_conference_pages_path do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,36 @@
<%= javascript_include_tag "personal_conference" %>
<%= stylesheet_link_tag "/assets/personal_conference/desktop/personal_conference" %>
<div id="conference_p">
<div id="content">
<div id="header" class="hh2">
<div class="dtitle w2 hh2 hp">
<span class="thmtxth">Conference</span>
</div>
<!-- <div id="search_app" class="hfn w2 hh1 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 %>" load="true" callback-method="list" class="hh1 w2 hp thmc1 thmtxt xx" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_conference_desktop_conference_page_path %>" callback-method="addpaper" custom-load="add" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="<%= panel_personal_conference_desktop_conference_type_path %>" callback-method="conference" class="admtxt hh1 w2 hp" onclick='return false;'>Conference</a></li>
<li><a href="<%= panel_personal_conference_desktop_conference_co_authors_path %>" callback-method="coauthor" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Analysis</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Import</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Export</a></li>
<li><a href="<%= panel_personal_conference_desktop_plugin_intros_path %>" class="admtxt hh1 w2 hp" callback-method="brief" onclick='return false;'>Brief Info</a></li>
</ul>
</div>
</div>
<div id="panel_r" container="true" class="ph pw admbg hp">
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,54 @@
<div class="toolbar hh1">
<div class="fn_g hp">
<%= f.submit t("save"), name: "commit", class: "fn_btn ini_input hp hh1 thmc2 thmtxt" %>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1 ">Language</div>
<div class="admbg sdm_o language_select">
<ul>
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li><a class="hp hh1 admtxt" href="" data-lang="<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="simple">
<ul class="s_form">
<li class="s_grid_row">
<%= label_tag("", "Frontend Page", :class => 's_grid s_grid_4') %>
<div class="s_select_g s_grid s_grid_8 s_grid_h_2">
<ul>
<li>
<%= f.check_box :brief_intro,
id: "field-0" %>
<label for="field-0"> Brief Intro </label>
</li>
<li>
<%= f.check_box :complete_list,
id: "field-1" %>
<label for="field-1"> Complete List </label>
</li>
</ul>
</div>
</li>
<% @site_in_use_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= label_tag("", I18nVariable.from_locale(locale), :class => 's_grid s_grid_4') %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :text_translations do |f| %>
<%= f.text_area locale, :class=>"editor", rows: 5, :value => (@intro.text_translations[locale] rescue nil) %>
<% end %>
</li>
<% end %>
</ul>
</div>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form","notification"=>"Brief Intro Updated"}, url: panel_personal_conference_desktop_plugin_intro_path(@intro) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -0,0 +1,3 @@
<%= form_for @intro, html: { multipart: true, "form-type"=>"ajax_form", "notification"=>"Brief Intro Saved"}, url: panel_personal_conference_desktop_plugin_intros_path do |f| %>
<%= render partial: 'form', locals: {f: f} %>
<% end %>

View File

@ -0,0 +1,50 @@
<%
if @member
@writing_conferences = WritingConference.where(is_hidden: false, :create_user_id => @member.id).desc(:year,:period_start_date)
@writing_conference_intro = !PersonalConferenceIntro.where(:user_id => @member.id).blank? ? PersonalConferenceIntro.where(:user_id => @member.id).first : PersonalConferenceIntro.new
%>
<% if @writing_conference_intro.brief_intro and !@writing_conference_intro.blank? %>
<div class="info">
<%= @writing_conference_intro.text.html_safe rescue '' %>
</div>
<% end %>
<% if ( !@writing_conference_intro.blank? and @writing_conference_intro.complete_list ) or @writing_conference_intro.blank? %>
<% if !@writing_conferences.blank? %>
<table class="table">
<thead>
<tr>
<th class="grid1"><%= t('personal_conference.year') %></th>
<th class="grid8"><%= t('module_name.personal_conference') %></th>
<th class="grid3"><%= t('personal_conference.authors') %></th>
</tr>
</thead>
<tbody>
<% @writing_conferences.each do |writing_conference| %>
<tr>
<td><%= writing_conference.year %></td>
<td>
<%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %>
</td>
<td><%= User.find(writing_conference.create_user_id).name rescue '' %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<% end %>
<% end %>

View File

@ -0,0 +1,32 @@
<% # encoding: utf-8 %>
<%= flash_messages %>
<h1><%= t('module_name.personal_conference') %></h1>
<table class="table">
<thead>
<tr>
<th class="grid1"><%= t('personal_conference.year') %></th>
<th class="grid8"><%= t('module_name.personal_conference') %></th>
<th class="grid3"><%= t('personal_conference.authors') %></th>
</tr>
</thead>
<tbody>
<% @writing_conferences.each do |writing_conference| %>
<tr>
<td><%= writing_conference.year %></td>
<td>
<%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %>
</td>
<td><%= User.find(writing_conference.create_user_id).name rescue '' %></td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @writing_conferences, :params => {:inner => false}%>

View File

@ -0,0 +1,75 @@
<% # encoding: utf-8 %>
<table>
<caption> <%= t("module_name.personal_conference") %> </caption>
<tbody>
<% if !@writing_conference.year.blank? %>
<tr><th><%= t("personal_conference.year")%></th><td><%= @writing_conference.year %></td></tr>
<% end %>
<% if !@writing_conference.language.blank? %>
<tr><th><%= t("personal_conference.language")%></th><td><%= @writing_conference.language %></td></tr>
<% end %>
<% if !@writing_conference.paper_title.blank? %>
<tr><th><%= t("personal_conference.paper_title")%></th><td><%= @writing_conference.paper_title %></td></tr>
<% end %>
<% if !@writing_conference.conference_title.blank? %>
<tr><th><%= t("personal_conference.conference_title")%></th><td><%= @writing_conference.conference_title %></td></tr>
<% end %>
<% if !@conference_paper_types.blank? %>
<tr><th><%= t("personal_conference.paper_type")%></th><td><%= @conference_paper_types %></td></tr>
<% end %>
<% if !@conference_author_types.blank? %>
<tr><th><%= t("personal_conference.author_type")%></th><td><%= @conference_author_types %></td></tr>
<% end %>
<% if !@writing_conference.location.blank? %>
<tr><th><%= t("personal_conference.location")%></th><td><%= @writing_conference.location %></td></tr>
<% end %>
<% if !@writing_conference.sponsor.blank? %>
<tr><th><%= t("personal_conference.sponsor")%></th><td><%= @writing_conference.sponsor %></td></tr>
<% end %>
<% if !@writing_conference.period_start_date.blank? %>
<tr><th><%= t("personal_conference.period_start_date")%></th><td><%= @writing_conference.period_start_date %></td></tr>
<% end %>
<% if !@writing_conference.period_end_date.blank? %>
<tr><th><%= t("personal_conference.period_end_date")%></th><td><%= @writing_conference.period_end_date %></td></tr>
<% end %>
<% if !@writing_conference.abstract.blank? %>
<tr><th><%= t("personal_conference.abstract")%></th><td><%= @writing_conference.abstract %></td></tr>
<% end %>
<% if !@writing_conference.publication_date.blank? %>
<tr><th><%= t("personal_conference.publication_date")%></th><td><%= @writing_conference.publication_date %></td></tr>
<% end %>
<% if !@writing_conference.url.blank? %>
<tr><th><%= t("personal_conference.url")%></th><td><%= link_to t(:url), @writing_conference.url, {:target => '_blank', :title => @writing_conference.url} if !@writing_conference.url.blank? %></td></tr>
<% end %>
<tr><th><%= t("personal_conference.authors")%></th><td><%= "#{User.from_id(@writing_conference.create_user_id).name rescue ''},#{@personal_conference.authors rescue ''}"%></td></tr>
<% if @writing_conference.writing_conference_files.size > 0 %>
<tr><th><%= t("personal_conference.file")%></th>
<td>
<div>
<div class="showFile">
<i class="icons-paperclip"></i>
<% @writing_conference.writing_conference_files.each do | wsfile | %>
<%= link_to !wsfile.title.blank? ? wsfile.title : 'file', wsfile.file.url, {:target => '_blank', :title => wsfile.title} if wsfile.file.file %>
<% end %>
</div>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>

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