forked from saurabh/personal-journal
something fix
This commit is contained in:
parent
4a8a0df7da
commit
41d11e12a3
|
@ -1,51 +1,43 @@
|
|||
class Admin::JournalLevelsController < OrbitMemberController
|
||||
before_action :allow_admin_only
|
||||
before_action :set_journal_level, only: [:edit, :update, :destroy]
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_type = 'journal_level'
|
||||
end
|
||||
|
||||
def new
|
||||
@journal_level = JournalLevel.new
|
||||
@paper_level = JournalLevel.new
|
||||
@url = admin_journal_levels_path(@paper_level)
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
def create
|
||||
@journal_level = JournalLevel.new(journal_level_attributes)
|
||||
respond_to do |format|
|
||||
if @journal_level.save
|
||||
format.js { render 'create_writing_journal_setting' }
|
||||
end
|
||||
end
|
||||
@paper_level = JournalLevel.new(paper_level_params)
|
||||
@paper_level.save
|
||||
@paper_levels = JournalLevel.all
|
||||
render :partial=>'index', :layout=>false
|
||||
end
|
||||
|
||||
def edit
|
||||
@paper_level = JournalLevel.find(params[:id])
|
||||
@url = admin_journal_level_path(@paper_level)
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @journal_level.update_attributes(journal_level_attributes)
|
||||
format.js { render 'update_writing_journal_setting' }
|
||||
end
|
||||
end
|
||||
@paper_level = JournalLevel.find(params[:id])
|
||||
@paper_level.update_attributes(paper_level_params)
|
||||
@paper_level.save
|
||||
@paper_levels = JournalLevel.all
|
||||
render :partial=>'index', :layout=>false
|
||||
end
|
||||
|
||||
def destroy
|
||||
@journal_level.destroy
|
||||
respond_to do |format|
|
||||
format.js { render 'delete_journal_setting' }
|
||||
end
|
||||
paper_level = JournalLevel.find(params[:id])
|
||||
paper_level.destroy
|
||||
@paper_levels = JournalLevel.all
|
||||
render :partial=>'index', :layout=>false
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_journal_level
|
||||
@journal_level = JournalLevel.find(params[:id])
|
||||
end
|
||||
|
||||
def journal_level_attributes
|
||||
def paper_level_params
|
||||
params.require(:journal_level).permit! rescue nil
|
||||
end
|
||||
|
||||
end
|
|
@ -1,51 +1,43 @@
|
|||
class Admin::JournalPaperAuthorTypesController < OrbitMemberController
|
||||
before_action :allow_admin_only
|
||||
before_action :set_journal_paper_author_type, only: [:edit, :update, :destroy]
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_type = 'journal_paper_author_type'
|
||||
end
|
||||
|
||||
def new
|
||||
@journal_author_type = JournalPaperAuthorType.new
|
||||
@author_type = JournalPaperAuthorType.new
|
||||
@url = admin_journal_paper_author_types_path(@author_type)
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
def create
|
||||
@journal_author_type = JournalPaperAuthorType.new(journal_paper_author_type_attributes)
|
||||
respond_to do |format|
|
||||
if @journal_author_type.save
|
||||
format.js { render 'create_writing_journal_setting' }
|
||||
end
|
||||
end
|
||||
@author_type = JournalPaperAuthorType.new(author_type_params)
|
||||
@author_type.save
|
||||
@author_types = JournalPaperAuthorType.all
|
||||
render :partial=>'list', :layout=>false
|
||||
end
|
||||
|
||||
def edit
|
||||
@author_type = JournalPaperAuthorType.find(params[:id])
|
||||
@url = admin_journal_paper_author_type_path(@author_type)
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @journal_author_type.update_attributes(journal_paper_author_type_attributes)
|
||||
format.js { render 'update_writing_journal_setting' }
|
||||
end
|
||||
end
|
||||
@author_type = JournalPaperAuthorType.find(params[:id])
|
||||
@author_type.update_attributes(author_type_params)
|
||||
@author_type.save
|
||||
@author_types = JournalPaperAuthorType.all
|
||||
render :partial=>'list', :layout=>false
|
||||
end
|
||||
|
||||
def destroy
|
||||
@journal_author_type.destroy
|
||||
respond_to do |format|
|
||||
format.js { render 'delete_journal_setting' }
|
||||
end
|
||||
author_type = JournalPaperAuthorType.find(params[:id])
|
||||
author_type.destroy
|
||||
@author_types = JournalPaperAuthorType.all
|
||||
render :partial=>'list', :layout=>false
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_journal_paper_author_type
|
||||
@journal_author_type = JournalPaperAuthorType.find(params[:id])
|
||||
end
|
||||
|
||||
def journal_paper_author_type_attributes
|
||||
def author_type_params
|
||||
params.require(:journal_paper_author_type).permit! rescue nil
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
class Admin::JournalPaperIntrosController < Admin::PersonalPluginIntrosController
|
||||
def initialize
|
||||
super
|
||||
@app_type = 'journal_paper_intro'
|
||||
@app_type_name = 'journal_paper'
|
||||
@reback_name = 'JournalPaper'
|
||||
end
|
||||
end
|
|
@ -1,50 +1,43 @@
|
|||
class Admin::JournalPaperTypesController < OrbitMemberController
|
||||
before_action :allow_admin_only
|
||||
before_action :set_journal_paper_type, only: [:edit, :update, :destroy]
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_type = 'journal_paper_type'
|
||||
end
|
||||
|
||||
def new
|
||||
@journal_paper_type = JournalPaperType.new
|
||||
@paper_type = JournalPaperType.new
|
||||
@url = admin_journal_paper_types_path(@paper_type)
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
def create
|
||||
@journal_paper_type = JournalPaperType.new(journal_paper_type_attributes)
|
||||
respond_to do |format|
|
||||
if @journal_paper_type.save
|
||||
format.js { render 'create_writing_journal_setting' }
|
||||
end
|
||||
end
|
||||
@paper_type = JournalPaperType.new(paper_type_params)
|
||||
@paper_type.save
|
||||
@paper_types = JournalPaperType.all
|
||||
render :partial=>'index', :layout=>false
|
||||
end
|
||||
|
||||
def edit
|
||||
@paper_type = JournalPaperType.find(params[:id])
|
||||
@url = admin_journal_paper_type_path(@paper_type)
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @journal_paper_type.update_attributes(journal_paper_type_attributes)
|
||||
format.js { render 'update_writing_journal_setting' }
|
||||
end
|
||||
end
|
||||
@paper_type = JournalPaperType.find(params[:id])
|
||||
@paper_type.update_attributes(paper_type_params)
|
||||
@paper_type.save
|
||||
@paper_types = JournalPaperType.all
|
||||
render :partial=>'index', :layout=>false
|
||||
end
|
||||
|
||||
def destroy
|
||||
@journal_paper_type.destroy
|
||||
respond_to do |format|
|
||||
format.js { render 'delete_journal_setting' }
|
||||
end
|
||||
paper_type = JournalPaperType.find(params[:id])
|
||||
paper_type.destroy
|
||||
@paper_types = JournalPaperType.all
|
||||
render :partial=>'index', :layout=>false
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_journal_paper_type
|
||||
@journal_paper_type = JournalPaperType.find(params[:id])
|
||||
end
|
||||
|
||||
def journal_paper_type_attributes
|
||||
def paper_type_params
|
||||
params.require(:journal_paper_type).permit! rescue nil
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,40 +2,37 @@ class Admin::JournalPapersController < OrbitMemberController
|
|||
include Admin::JournalPapersHelper
|
||||
layout "member_plugin"
|
||||
|
||||
before_action :set_journal_paper, only: [:show, :edit , :update]
|
||||
before_action :get_plugins, only: [:index, :writing_journal_setting, :new, :create, :edit, :update]
|
||||
before_action :set_types, only: [:writing_journal_setting, :new, :edit, :create, :update]
|
||||
before_action :find_journal_paper, only: [:destroy]
|
||||
before_action :set_journal_paper, only: [:show, :edit , :update, :destroy]
|
||||
before_action :set_plugin
|
||||
before_action :get_settings,:only => [:new, :edit, :setting]
|
||||
|
||||
before_action :need_access_right
|
||||
before_action :allow_admin_only, :only => [:index, :writing_journal_setting]
|
||||
before_action :allow_admin_only, :only => [:index, :setting]
|
||||
|
||||
def index
|
||||
@writing_journals = JournalPaper.order_by(:year=>'desc').page(params[:page]).per(10)
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.js { }
|
||||
format.xml { render :xml => @writing_journals }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.xml { render :xml => @journal_paper }
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@journal_paper = JournalPaper.new
|
||||
@member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
|
||||
@journal_paper = JournalPaper.new
|
||||
|
||||
if params[:desktop]
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@member = MemberProfile.find(journal_paper_params['member_profile_id']) rescue nil
|
||||
@journal_paper = JournalPaper.new(journal_paper_params)
|
||||
@journal_paper.save
|
||||
if params[:desktop] == "true"
|
||||
render json: {"data" => get_paper_list}.to_json
|
||||
else
|
||||
redirect_to params['referer_url']
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@member = @journal_paper.member_profile
|
||||
if params[:desktop]
|
||||
|
@ -43,136 +40,66 @@ class Admin::JournalPapersController < OrbitMemberController
|
|||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@journal_paper = JournalPaper.new(journal_paper_attributes)
|
||||
respond_to do |format|
|
||||
if @journal_paper.save
|
||||
if params[:desktop] == "true"
|
||||
format.json { render json: get_paper_list }
|
||||
end
|
||||
format.html { redirect_to params['referer_url'] }
|
||||
format.json { render action: 'show', status: :created, location: @journal_paper }
|
||||
else
|
||||
format.html { render action: 'new' }
|
||||
format.json { render json: @journal_paper.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @journal_paper.update_attributes(journal_paper_attributes)
|
||||
@member = @journal_paper.member_profile
|
||||
@journal_paper.update_attributes(journal_paper_params)
|
||||
@journal_paper.save
|
||||
if params[:desktop] == "true"
|
||||
format.json { render json: get_paper_list }
|
||||
end
|
||||
format.html { redirect_to params['referer_url'] }
|
||||
# format.js { render 'toggle_enable' }
|
||||
format.json { head :no_content }
|
||||
render json: {"data" => get_paper_list}.to_json
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @journal_paper.errors, status: :unprocessable_entity }
|
||||
end
|
||||
redirect_to params['referer_url']
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@journal_paper.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to(admin_journal_papers_url) }
|
||||
format.html { redirect_to(admin_journal_paper_url) }
|
||||
# format.xml { head :ok }
|
||||
format.js
|
||||
format.json {render json: {"success" => true}}
|
||||
end
|
||||
end
|
||||
|
||||
def delete
|
||||
end
|
||||
|
||||
def writing_journal_setting
|
||||
|
||||
@set_level_type = JournalLevel.new(display: 'List')
|
||||
@level_type_url = admin_journal_papers_path
|
||||
|
||||
@set_author_type = JournalPaperAuthorType.new(display: 'List')
|
||||
@author_type_url = admin_journal_papers_path
|
||||
|
||||
@set_paper_type = JournalPaperType.new(display: 'List')
|
||||
@paper_type_url = admin_journal_papers_path
|
||||
end
|
||||
|
||||
def add_level
|
||||
@set_level_type = JournalLevel.new(display: 'List')
|
||||
@level_type_url = admin_journal_levels_path
|
||||
@set_level_type.id = params[:id]
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def edit_level
|
||||
@set_level_type = JournalLevel.find(params[:journal_paper_id])
|
||||
@level_type_url = admin_journal_level_path(@set_level_type)
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def add_author_type
|
||||
@set_author_type = JournalPaperAuthorType.new(display: 'List')
|
||||
@author_type_url = admin_journal_paper_author_types_path
|
||||
@set_author_type.id = params[:id]
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def edit_author_type
|
||||
@set_author_type = JournalPaperAuthorType.find(params[:journal_paper_id])
|
||||
@author_type_url = admin_journal_paper_author_type_path(@set_author_type)
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def add_paper_type
|
||||
@set_paper_type = JournalPaperType.new(:display => 'List')
|
||||
@paper_type_url = admin_journal_paper_types_path
|
||||
@set_paper_type.id = params[:id]
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def edit_paper_type
|
||||
@set_paper_type = JournalPaperType.find(params[:journal_paper_id])
|
||||
@paper_type_url = admin_journal_paper_type_path(@set_paper_type)
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def data_share
|
||||
def toggle_hide
|
||||
if params[:ids]
|
||||
@writing_journals = JournalPaper.any_in(_id: params[:ids])
|
||||
@journal_papers = JournalPaper.any_in(_id: params[:ids])
|
||||
|
||||
@writing_journals.each do |writing_journal|
|
||||
writing_journal.is_hidden = params[:disable]
|
||||
writing_journal.save
|
||||
@journal_papers.each do |journal_paper|
|
||||
journal_paper.is_hidden = params[:disable]
|
||||
journal_paper.save
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to(admin_member_path(id: params[:member_profile_id],show_plugin_profile: "JournalPaper")) }
|
||||
format.json { render json: {"success"=>true}.to_json}
|
||||
render json: {"success"=>true}
|
||||
end
|
||||
|
||||
def setting
|
||||
end
|
||||
|
||||
def frontend_setting
|
||||
@member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
|
||||
@intro = JournalPaperIntro.find_by(:member_profile_id=>@member.id) rescue nil
|
||||
@intro = @intro.nil? ? JournalPaperIntro.new({:member_profile_id=>@member.id}) : @intro
|
||||
end
|
||||
|
||||
def update_frontend_setting
|
||||
@member = MemberProfile.find(intro_params['member_profile_id']) rescue nil
|
||||
@intro = JournalPaperIntro.find_by(:member_profile_id=>@member.id) rescue nil
|
||||
@intro = @intro.nil? ? JournalPaperIntro.new({:member_profile_id=>@member.id}) : @intro
|
||||
@intro.update_attributes(intro_params)
|
||||
@intro.save
|
||||
redirect_to URI.encode('/admin/members/'+@member.to_param+'/JournalPaper')
|
||||
end
|
||||
|
||||
def get_settings
|
||||
@journal_levels = JournalLevel.all
|
||||
@author_types = JournalPaperAuthorType.all
|
||||
@paper_types = JournalPaperType.all
|
||||
end
|
||||
|
||||
def set_plugin
|
||||
@plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'JournalPaper'}.first
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -186,29 +113,14 @@ class Admin::JournalPapersController < OrbitMemberController
|
|||
uid = path[-2].split("-").last
|
||||
uid = uid.split("?").first
|
||||
end
|
||||
@journal_paper = JournalPaper.find_by(uid: uid)
|
||||
@journal_paper = JournalPaper.find_by(:uid => uid) rescue JournalPaper.find(params[:id])
|
||||
end
|
||||
|
||||
def find_journal_paper
|
||||
@journal_paper = JournalPaper.find_by(id: params[:id])
|
||||
end
|
||||
|
||||
def journal_paper_attributes
|
||||
def journal_paper_params
|
||||
params.require(:journal_paper).permit! rescue nil
|
||||
end
|
||||
|
||||
def get_plugins
|
||||
@plugins = OrbitApp::Plugin::Registration.all rescue nil
|
||||
def intro_params
|
||||
params.require(:journal_paper_intro).permit! rescue nil
|
||||
end
|
||||
|
||||
def set_plugin
|
||||
@plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'JournalPaper'}.first
|
||||
end
|
||||
|
||||
def set_types
|
||||
@journal_levels = JournalLevel.all
|
||||
@author_types = JournalPaperAuthorType.all
|
||||
@paper_types = JournalPaperType.all
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
class JournalPapersController < ApplicationController
|
||||
def index
|
||||
journal_papers = JournalPaper.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
||||
journal_paper_list = journal_papers.collect do |journal_paper|
|
||||
{
|
||||
"year" => journal_paper.year,
|
||||
"paper_title" => journal_paper.create_link,
|
||||
"author" => journal_paper.authors,
|
||||
"link_to_show" => OrbitHelper.url_to_show(journal_paper.to_param)
|
||||
}
|
||||
end
|
||||
{
|
||||
"journal_papers" => journal_paper_list,
|
||||
"extras" => {
|
||||
"widget-title" => t("module_name.journal_paper"),
|
||||
"th_year" => t('personal_plugins.year'),
|
||||
"th_title" => t("personal_conference.paper_title"),
|
||||
"th_author" => t('personal_plugins.author')
|
||||
},
|
||||
"total_pages" => journal_papers.total_pages
|
||||
}
|
||||
end
|
||||
|
||||
def show
|
||||
params = OrbitHelper.params
|
||||
plugin = JournalPaper.find_by(uid: params[:uid])
|
||||
fields_to_show = [
|
||||
"paper_title",
|
||||
"journal_title",
|
||||
"level_type",
|
||||
"paper_type",
|
||||
"author_name",
|
||||
"authors",
|
||||
"author_type",
|
||||
"year",
|
||||
"publication_date",
|
||||
"language",
|
||||
"vol_no",
|
||||
"issue_no",
|
||||
"form_to_start",
|
||||
"form_to_end",
|
||||
"total_pages",
|
||||
"isbn",
|
||||
"url",
|
||||
"associated_project",
|
||||
"note",
|
||||
"file"
|
||||
]
|
||||
|
||||
{"plugin_datas"=>plugin.get_plugin_data(fields_to_show)}
|
||||
end
|
||||
end
|
|
@ -0,0 +1,52 @@
|
|||
class PersonalJournalsController < ApplicationController
|
||||
def index
|
||||
journal_papers = JournalPaper.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
||||
journal_paper_list = journal_papers.collect do |journal_paper|
|
||||
{
|
||||
"year" => journal_paper.year,
|
||||
"paper_title" => journal_paper.create_link,
|
||||
"author" => journal_paper.authors,
|
||||
"link_to_show" => OrbitHelper.url_to_show(journal_paper.to_param)
|
||||
}
|
||||
end
|
||||
{
|
||||
"journal_papers" => journal_paper_list,
|
||||
"extras" => {
|
||||
"widget-title" => t("module_name.journal_paper"),
|
||||
"th_year" => t('personal_plugins.year'),
|
||||
"th_title" => t("personal_conference.paper_title"),
|
||||
"th_author" => t('personal_plugins.author')
|
||||
},
|
||||
"total_pages" => journal_papers.total_pages
|
||||
}
|
||||
end
|
||||
|
||||
def show
|
||||
params = OrbitHelper.params
|
||||
plugin = JournalPaper.where(:is_hidden=>false).find_by(uid: params[:uid])
|
||||
fields_to_show = [
|
||||
"year",
|
||||
"author_name",
|
||||
"authors",
|
||||
"author_type",
|
||||
"paper_title",
|
||||
"journal_title",
|
||||
"vol_no",
|
||||
"issue_no",
|
||||
"form_to_start",
|
||||
"form_to_end",
|
||||
"level_type",
|
||||
"paper_type",
|
||||
"total_pages",
|
||||
"publication_date",
|
||||
"isbn",
|
||||
"abstract",
|
||||
"language",
|
||||
"url",
|
||||
"associated_project",
|
||||
"file"
|
||||
]
|
||||
|
||||
{"plugin_datas"=>plugin.get_plugin_data(fields_to_show)}
|
||||
end
|
||||
end
|
|
@ -1,2 +0,0 @@
|
|||
module Admin::JournalLevelsHelper
|
||||
end
|
|
@ -1,2 +0,0 @@
|
|||
module Admin::JournalPaperAuthorTypesHelper
|
||||
end
|
|
@ -1,2 +0,0 @@
|
|||
module Admin::JournalPaperIntrosHelper
|
||||
end
|
|
@ -1,2 +0,0 @@
|
|||
module Admin::JournalPaperTypesHelper
|
||||
end
|
|
@ -22,7 +22,7 @@ module Admin::JournalPapersHelper
|
|||
|
||||
{
|
||||
"id" => j.id.to_s,
|
||||
"edit_url" => "/#{I18n.locale.to_s}/admin/journal_papers/#{j.to_param}/edit",
|
||||
"edit_url" => "/#{I18n.locale.to_s}/admin/members/#{user_profile.to_param}/journal_papers/#{j.to_param}/edit",
|
||||
"delete_url" => "/#{I18n.locale.to_s}/admin/journal_papers/#{j.id.to_s}",
|
||||
"paper_title" => j.paper_title,
|
||||
"journal_title" => j.journal_title,
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
module JournalPapersHelper
|
||||
end
|
|
@ -1,9 +1,6 @@
|
|||
class JournalLevel
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include Mongoid::Attributes::Dynamic
|
||||
|
||||
include OrbitCoreLib::ObjectDisable
|
||||
|
||||
field :key, type: String
|
||||
field :title, type: String, localize: true
|
||||
|
|
|
@ -53,16 +53,17 @@ class JournalPaper
|
|||
|
||||
title << self.member_profile.name if self.member_profile_id.present?
|
||||
title << (!self.authors.blank? ? self.authors : nil)
|
||||
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.journal_title if self.journal_title.present?
|
||||
title << self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
||||
title << self.issue_no if (self.issue_no.present? && self.issue_no != "0")
|
||||
title << "pp"+self.form_to_start+"-"+self.form_to_end if (self.form_to_start.present? && self.form_to_start != "0")
|
||||
title << ( !self.journal_levels.blank? ? "(#{self.journal_levels.collect{|x| x.title}.join(', ')})" : nil)
|
||||
# if !self.publication_date.nil?
|
||||
# pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
||||
# title << pd[0]
|
||||
# end
|
||||
title << self.year
|
||||
title.join(', ').gsub(', ,',',')
|
||||
end
|
||||
|
||||
|
@ -125,6 +126,8 @@ class JournalPaper
|
|||
value = self.publication_date.to_date.strftime("%Y-%m-%d") rescue ""
|
||||
when "language"
|
||||
value = I18n.t(self.language) rescue ""
|
||||
when "abstract"
|
||||
value = nl2br(self.abstract)
|
||||
when "file"
|
||||
files = []
|
||||
self.journal_paper_files.each do |file|
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
class JournalPaperAuthorType
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include Mongoid::Attributes::Dynamic
|
||||
include OrbitCoreLib::ObjectDisable
|
||||
|
||||
field :key, type: String
|
||||
field :title, type: String, localize: true
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
class JournalPaperType
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include Mongoid::Attributes::Dynamic
|
||||
include OrbitCoreLib::ObjectDisable
|
||||
|
||||
field :key, type: String
|
||||
field :title, type: String, localize: true
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<%= form_for(@paper_level, :html =>{:class=>"form-horizontal", :style=>"margin: 0;"}, :remote => true, :url => @url ) do |f| %>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="myModalLabel"><%= t("personal_journal.level_type") %></h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag t(locale), t(locale), :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :value => (@paper_level.title_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
|
||||
</div>
|
||||
<% end %>
|
|
@ -0,0 +1,2 @@
|
|||
$('#paper_levels tbody').html("<%= j render :partial => '/admin/journal_papers/list_level_type', :collection => @paper_levels %>");
|
||||
$('#paper_level_modal').modal('hide');
|
|
@ -1,2 +0,0 @@
|
|||
$("#myModal1").modal('hide');
|
||||
$('<%= j render :partial => 'admin/journal_papers/list_level_type', :collection => [@journal_level] %>').appendTo('#level_types').hide().fadeIn();
|
|
@ -1,3 +0,0 @@
|
|||
$('.delete_level').bind('ajax:success', function() {
|
||||
$(this).closest('tr').fadeOut();
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
$('#paper_level_modal').html("<%= j render 'form' %>");
|
|
@ -0,0 +1 @@
|
|||
$('#paper_level_modal').html("<%= j render 'form' %>");
|
|
@ -1,2 +0,0 @@
|
|||
$("#myModal1").modal('hide');
|
||||
$("#<%= dom_id @journal_level %>").replaceWith("<%= j render :partial => 'admin/journal_papers/list_level_type', :collection => [@journal_level] %>");
|
|
@ -0,0 +1,24 @@
|
|||
<%= form_for(@author_type, :html =>{:class=>"form-horizontal", :style=>"margin: 0;"}, :remote => true, :url => @url ) do |f| %>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="myModalLabel"><%= t("personal_journal.author_type") %></h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag t(locale), t(locale), :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :value => (@author_type.title_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
|
||||
</div>
|
||||
<% end %>
|
|
@ -0,0 +1,2 @@
|
|||
$('#author_types tbody').html("<%= j render :partial => '/admin/journal_papers/list_author_type', :collection => @author_types %>");
|
||||
$('#author_type_modal').modal('hide');
|
|
@ -1,2 +0,0 @@
|
|||
$("#myModal2").modal('hide');
|
||||
$('<%= j render :partial => 'admin/journal_papers/list_author_type', :collection => [@journal_author_type] %>').appendTo('#author_types').hide().fadeIn();
|
|
@ -1,3 +0,0 @@
|
|||
$('.delete_author').bind('ajax:success', function() {
|
||||
$(this).closest('tr').fadeOut();
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
$('#author_type_modal').html("<%= j render 'form' %>");
|
|
@ -0,0 +1 @@
|
|||
$('#author_type_modal').html("<%= j render 'form' %>");
|
|
@ -1,2 +0,0 @@
|
|||
$("#myModal2").modal('hide');
|
||||
$("#<%= dom_id @journal_author_type %>").replaceWith("<%= j render :partial => 'admin/journal_papers/list_author_type', :collection => [@journal_author_type] %>");
|
|
@ -0,0 +1,24 @@
|
|||
<%= form_for(@paper_type, :html =>{:class=>"form-horizontal", :style=>"margin: 0;"}, :remote => true, :url => @url ) do |f| %>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="myModalLabel"><%= t("personal_journal.paper_type") %></h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag t(locale), t(locale), :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :value => (@paper_type.title_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
|
||||
</div>
|
||||
<% end %>
|
|
@ -0,0 +1,2 @@
|
|||
$('#paper_types tbody').html("<%= j render :partial => '/admin/journal_papers/list_paper_type', :collection => @paper_types %>");
|
||||
$('#paper_type_modal').modal('hide');
|
|
@ -1,2 +0,0 @@
|
|||
$("#myModal3").modal('hide');
|
||||
$('<%= j render :partial => 'admin/journal_papers/list_paper_type', :collection => [@journal_paper_type] %>').appendTo('#paper_types').hide().fadeIn();
|
|
@ -1,3 +0,0 @@
|
|||
$('.delete_paper').bind('ajax:success', function() {
|
||||
$(this).closest('tr').fadeOut();
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
$('#paper_type_modal').html("<%= j render 'form' %>");
|
|
@ -0,0 +1 @@
|
|||
$('#paper_type_modal').html("<%= j render 'form' %>");
|
|
@ -1,2 +0,0 @@
|
|||
$("#myModal3").modal('hide');
|
||||
$("#<%= dom_id @journal_paper_type %>").replaceWith("<%= j render :partial => 'admin/journal_papers/list_paper_type', :collection => [@journal_paper_type] %>");
|
|
@ -1,33 +0,0 @@
|
|||
<script type="text/javascript">
|
||||
var map = {},
|
||||
members = [],
|
||||
data = <%= raw @members_data %>;
|
||||
$.each(data, function (i, member) {
|
||||
map[member.memberName] = member;
|
||||
members.push(member.memberName);
|
||||
});
|
||||
$(document).ready(function(){
|
||||
$('#member_autocomplete').typeahead({
|
||||
source: function (query, process) {
|
||||
return members;
|
||||
},
|
||||
updater: function (item) {
|
||||
selectedMember = map[item].memberId;
|
||||
$('#member_value').val(selectedMember);
|
||||
return item;
|
||||
},
|
||||
matcher: function (item) {
|
||||
if (item.toLowerCase().indexOf(this.query.trim().toLowerCase()) != -1) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
sorter: function (items) {
|
||||
return items.sort();
|
||||
},
|
||||
highlighter: function (item) {
|
||||
var regex = new RegExp( '(' + this.query + ')', 'gi' );
|
||||
return item.replace( regex, "<strong>$1</strong>" );
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -1,33 +0,0 @@
|
|||
<% # 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-#{t(locale).to_s}", :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 'journal_paper[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 %>
|
|
@ -1,9 +0,0 @@
|
|||
<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 %>
|
|
@ -3,6 +3,7 @@
|
|||
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||
<%= stylesheet_link_tag "lib/fileupload" %>
|
||||
<%= stylesheet_link_tag "lib/main-list" %>
|
||||
<%= stylesheet_link_tag "lib/main-form-col2" %>
|
||||
<% end %>
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
|
||||
|
@ -19,201 +20,6 @@
|
|||
<!-- Input Area -->
|
||||
<div class="input-area">
|
||||
|
||||
<!-- Module Tabs -->
|
||||
<ul class="nav nav-pills module-nav">
|
||||
<li></li>
|
||||
<li class="active">
|
||||
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Module -->
|
||||
<div class="tab-content module-area">
|
||||
|
||||
<!-- Basic Module -->
|
||||
<div class="tab-pane fade in active" id="basic">
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
|
||||
<div class="controls">
|
||||
<%= @member.name rescue ''%>
|
||||
<%= f.hidden_field :member_profile_id, :value => @member.id if !@member.nil? %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- year -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.year") %></label>
|
||||
<div class="controls">
|
||||
<%= select_year((@journal_paper.year ? @journal_paper.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'journal_paper[year]', :class => "span1"} ) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- language -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.language") %></label>
|
||||
<div class="controls">
|
||||
<select id="journal_paper_language" name="journal_paper[language]">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<option value="<%= locale %>" <%= @journal_paper.language.eql?(locale.to_s) ? "selected" : ""%>><%= t(locale) %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- level_type -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.level_type") %></label>
|
||||
<div class="controls">
|
||||
<% @journal_levels.each do |level_type| %>
|
||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
||||
<%= check_box_tag 'journal_paper[journal_level_ids][]', level_type.id, @journal_paper.journal_level_ids.include?(level_type.id)%>
|
||||
<%= level_type.title %>
|
||||
<%= hidden_field_tag 'journal_paper[journal_level_ids][]', '' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- paper_type -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.paper_type") %></label>
|
||||
<div class="controls">
|
||||
<%= f.select :journal_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]}, :class => "span3" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- author_type -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.author_type") %></label>
|
||||
<div class="controls">
|
||||
<% @author_types.each do |author_type| %>
|
||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
||||
<%= check_box_tag 'journal_paper[journal_paper_author_type_ids][]', author_type.id, @journal_paper.journal_paper_author_type_ids.include?(author_type.id)%>
|
||||
<%= author_type.title %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- number_of_authors -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.number_of_authors") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :number_of_authors, :class=>'span1' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- associated_project -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.associated_project") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :associated_project %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- vol_no -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.vol_no") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :vol_no %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- issue_no -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.issue_no") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :issue_no %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- form_to -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.form_to") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- total_pages -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.total_pages") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :total_pages %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- isbn -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.isbn") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :isbn %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- keywords -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.keywords") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :keywords %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- publication_date -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.publication_date") %></label>
|
||||
<div class="controls">
|
||||
<%= f.datetime_picker :publication_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- url -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.url") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :url , :class => "span6" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- abstract -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.abstract") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_area :abstract, rows: 2, class: "input-block-level" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- note -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.note") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Status Module -->
|
||||
<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 @journal_paper.is_hidden? %>">
|
||||
<%= f.check_box :is_hidden %> <%= t(:hide) %>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Language Tabs -->
|
||||
<div class="nav-name"><strong><%= t(:language) %></strong></div>
|
||||
<ul class="nav nav-pills language-nav">
|
||||
|
@ -294,6 +100,201 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Module Tabs -->
|
||||
<ul class="nav nav-pills module-nav">
|
||||
<li></li>
|
||||
<li class="active">
|
||||
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Module -->
|
||||
<div class="tab-content module-area">
|
||||
|
||||
<!-- Basic Module -->
|
||||
<div class="tab-pane fade in active" id="basic">
|
||||
|
||||
<div class="control-group big-group">
|
||||
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
|
||||
<div class="controls">
|
||||
<%= @member.name rescue ''%>
|
||||
<%= f.hidden_field :member_profile_id, :value => @member.id if !@member.nil? %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- year -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.year") %></label>
|
||||
<div class="controls">
|
||||
<%= select_year((@journal_paper.year ? @journal_paper.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'journal_paper[year]', :class => "span1"} ) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- language -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.language") %></label>
|
||||
<div class="controls">
|
||||
<select id="journal_paper_language" name="journal_paper[language]">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<option value="<%= locale %>" <%= @journal_paper.language.eql?(locale.to_s) ? "selected" : ""%>><%= t(locale) %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- vol_no -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.vol_no") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :vol_no %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- issue_no -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.issue_no") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :issue_no %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- form_to -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.form_to") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- total_pages -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.total_pages") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :total_pages %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- level_type -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.level_type") %></label>
|
||||
<div class="controls">
|
||||
<% @journal_levels.each do |level_type| %>
|
||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
||||
<%= check_box_tag 'journal_paper[journal_level_ids][]', level_type.id, @journal_paper.journal_level_ids.include?(level_type.id)%>
|
||||
<%= level_type.title %>
|
||||
<%= hidden_field_tag 'journal_paper[journal_level_ids][]', '' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- paper_type -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.paper_type") %></label>
|
||||
<div class="controls">
|
||||
<%= f.select :journal_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]}, :class => "span3" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- author_type -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.author_type") %></label>
|
||||
<div class="controls">
|
||||
<% @author_types.each do |author_type| %>
|
||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
||||
<%= check_box_tag 'journal_paper[journal_paper_author_type_ids][]', author_type.id, @journal_paper.journal_paper_author_type_ids.include?(author_type.id)%>
|
||||
<%= author_type.title %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- number_of_authors -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.number_of_authors") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :number_of_authors, :class=>'span1' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- isbn -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.isbn") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :isbn %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- publication_date -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.publication_date") %></label>
|
||||
<div class="controls">
|
||||
<%= f.datetime_picker :publication_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- url -->
|
||||
<div class="control-group big-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.url") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :url , :class => "span6" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- keywords -->
|
||||
<div class="control-group big-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.keywords") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :keywords %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- abstract -->
|
||||
<div class="control-group big-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.abstract") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_area :abstract, rows: 2, class: "input-block-level" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- note -->
|
||||
<div class="control-group big-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.note") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- associated_project -->
|
||||
<div class="control-group big-group">
|
||||
<label class="control-label muted"><%= t("personal_journal.associated_project") %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :associated_project %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Status Module -->
|
||||
<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 @journal_paper.is_hidden? %>">
|
||||
<%= f.check_box :is_hidden %> <%= t(:hide) %>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Form Actions -->
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
<% # encoding: utf-8 %>
|
||||
<%= form_for(@set_level_type, remote: true, url: @level_type_url) do |f| %>
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3 id="myModalLabel"><%= (@set_level_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-#{t(locale).to_s}", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :class => 'control-label', :value => (@set_level_type.title_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<%= hidden_field_tag 'journal_paper[journal_level]', @set_level_type.id %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -4,8 +4,7 @@
|
|||
<td><%= list_author_type.title %></td>
|
||||
<td class="span2">
|
||||
|
||||
<a href="<%= admin_journal_paper_edit_author_type_path(list_author_type) %>#myModal2" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
|
||||
<%= link_to 'Delete',
|
||||
polymorphic_path([:admin, list_author_type]), data: { confirm: t('sure?') }, method: :delete, remote:true, class: "delete_author archive_toggle action" %>
|
||||
<a href="<%= edit_admin_journal_paper_author_type_path(list_author_type) %>#author_type_modal" data-toggle="modal" data-remote="true" class="action"><%= t(:edit) %></a>
|
||||
<%= link_to t(:delete_), admin_journal_paper_author_type_path(list_author_type), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
|
||||
</td>
|
||||
</tr>
|
|
@ -4,8 +4,7 @@
|
|||
<td><%= list_level_type.title %></td>
|
||||
<td class="span2">
|
||||
|
||||
<a href="<%= admin_journal_paper_edit_level_path(journal_paper_id: list_level_type.id) %>#myModal1" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
|
||||
<%= link_to 'Delete',
|
||||
polymorphic_path([:admin, list_level_type]), data: { confirm: t('sure?') }, method: :delete, remote: true, class: "delete_level archive_toggle action" %>
|
||||
<a href="<%= edit_admin_journal_level_path(list_level_type) %>#paper_level_modal" data-toggle="modal" data-remote="true" class="action"><%= t(:edit) %></a>
|
||||
<%= link_to t(:delete_), admin_journal_level_path(list_level_type), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
|
||||
</td>
|
||||
</tr>
|
|
@ -4,8 +4,7 @@
|
|||
<td><%= list_paper_type.title %></td>
|
||||
<td class="span2">
|
||||
|
||||
<a href="<%= admin_journal_paper_edit_paper_type_path(list_paper_type) %>#myModal3" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
|
||||
<%= link_to 'Delete',
|
||||
polymorphic_path([:admin, list_paper_type]), data: { confirm: t('sure?') }, method: :delete, remote: true,class: "delete_paper archive_toggle action" %>
|
||||
<a href="<%= edit_admin_journal_paper_type_path(list_paper_type) %>#paper_type_modal" data-toggle="modal" data-remote="true" class="action"><%= t(:edit) %></a>
|
||||
<%= link_to t(:delete_), admin_journal_paper_type_path(list_paper_type), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
|
||||
</td>
|
||||
</tr>
|
|
@ -1,29 +0,0 @@
|
|||
<% # 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="myModalLabe3"><%= (@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>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="http" class="control-label">Title</label>
|
||||
<div class="controls">
|
||||
<%= f.text_field :title %>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<%= hidden_field_tag 'writing_journal_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 %>
|
||||
|
|
@ -10,6 +10,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td class="span1"><%= writing_journal.authors%></td>
|
||||
<td><%= writing_journal.member_profile.name rescue "" %></td>
|
||||
</tr>
|
||||
<% end %>
|
|
@ -1 +0,0 @@
|
|||
$("#myModal2").html("<%= j render "author_type_qe" %>");
|
|
@ -1 +0,0 @@
|
|||
$("#myModal1").html("<%= j render "level_type_qe" %>");
|
|
@ -1 +0,0 @@
|
|||
$("#myModal3").html("<%= j render "paper_type_qe" %>");
|
|
@ -1,15 +0,0 @@
|
|||
|
||||
<% if !@journal_level_type.blank? %>
|
||||
$("#myModal1").modal('hide');
|
||||
$('<%= j render :partial => 'list_level_type', :collection => [@journal_level_type] %>').appendTo('#level_types').hide().fadeIn();
|
||||
<% end %>
|
||||
|
||||
<% if !@journal_author_type.blank? %>
|
||||
$("#myModal2").modal('hide');
|
||||
$('<%= j render :partial => 'list_author_type', :collection => [@journal_author_type] %>').appendTo('#author_types').hide().fadeIn();
|
||||
<% end %>
|
||||
|
||||
<% if !@journal_paper_type.blank? %>
|
||||
$("#myModal3").modal('hide');
|
||||
$('<%= j render :partial => 'list_paper_type', :collection => [@journal_paper_type] %>').appendTo('#paper_types').hide().fadeIn();
|
||||
<% end %>
|
|
@ -1 +0,0 @@
|
|||
$("#myModal2").html("<%= j render "author_type_qe" %>");
|
|
@ -1 +0,0 @@
|
|||
$("#myModal1").html("<%= j render "level_type_qe" %>");
|
|
@ -1 +0,0 @@
|
|||
$("#myModal3").html("<%= j render "paper_type_qe" %>");
|
|
@ -0,0 +1,93 @@
|
|||
<% content_for :page_specific_css do %>
|
||||
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||
<%= stylesheet_link_tag "lib/main-list" %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for(:journal_paper_intro, :url => update_frontend_setting_admin_journal_papers_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %>
|
||||
<fieldset>
|
||||
<!-- Input Area -->
|
||||
<div class="input-area">
|
||||
|
||||
<!-- Module Tabs -->
|
||||
<div class="nav-name"><strong><%= t("module_name.journal_paper") %></strong></div>
|
||||
<ul class="nav nav-pills module-nav">
|
||||
<li></li>
|
||||
<li class="active">
|
||||
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Module -->
|
||||
<div class="tab-content module-area">
|
||||
<!-- Basic Module -->
|
||||
<div class="tab-pane fade in active" id="basic">
|
||||
<% if !@member.blank? %>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
|
||||
<div class="controls">
|
||||
<%= @member.name rescue ''%>
|
||||
<%= f.hidden_field :member_profile_id, :value => @member.id %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- frontend_page -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("personal_plugins.frontend_page") %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :brief_intro, :checked => @intro.brief_intro %> <%= t("personal_plugins.brief_intro") %>
|
||||
<%= f.check_box :complete_list, :checked => @intro.complete_list %> <%= t("personal_plugins.complete_list") %>
|
||||
</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 %>"><%= t(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" : '' %>">
|
||||
|
||||
<!-- Content -->
|
||||
<div class="control-group input-content">
|
||||
<label class="control-label muted"><%= t(:content) %></label>
|
||||
<div class="controls">
|
||||
<div class="textarea">
|
||||
<%= f.fields_for :text_translations do |f| %>
|
||||
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@intro.text_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
</fieldset>
|
||||
<% end %>
|
|
@ -3,7 +3,7 @@
|
|||
<tr>
|
||||
<th class="span1"><%= t('personal_journal.year') %></th>
|
||||
<th class="span7"><%= t('module_name.journal_paper') %></th>
|
||||
<th class="span1"><%= t('personal_journal.authors') %></th>
|
||||
<th class="span1"><%= t("personal_plugins.author") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody_writing_journals" class="sort-holder">
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
$("#myModal1").html("<%= j render "level_type_qe" %>");
|
|
@ -0,0 +1,116 @@
|
|||
<style type="text/css">
|
||||
.element{
|
||||
background: #FFF;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #DDD;
|
||||
}
|
||||
.detail{
|
||||
padding: 10px;
|
||||
min-height: 250px;
|
||||
}
|
||||
.totle{
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.totle span{
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="element span4">
|
||||
<div class="detail w-a h-a">
|
||||
<p class="totle">
|
||||
<a class="btn btn-small btn-primary pull-right" href="<%= new_admin_journal_paper_type_path %>#paper_type_modal" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
||||
<span><%= t("personal_journal.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="element span4">
|
||||
<div class="detail w-a h-a">
|
||||
<p class="totle">
|
||||
<a class="btn btn-small btn-primary pull-right" href="<%= new_admin_journal_level_path %>#paper_level_modal" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
||||
<span><%= t("personal_journal.level_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_levels" class="table table-striped">
|
||||
<tbody>
|
||||
<%= render :partial => 'list_level_type', :collection => @journal_levels %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="element span4">
|
||||
<div class="detail w-a h-a">
|
||||
<p class="totle">
|
||||
<a class="btn btn-small btn-primary pull-right" href="<%= new_admin_journal_paper_author_type_path %>#author_type_modal" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
||||
<span><%= t("personal_journal.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>
|
||||
|
||||
<div id="paper_type_qe">
|
||||
<div style="display:none;" class="modal" id="paper_type_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="paper_level_qe">
|
||||
<div style="display:none;" class="modal" id="paper_level_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="author_type_qe">
|
||||
<div style="display:none;" class="modal" id="author_type_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
</div>
|
||||
</div>
|
|
@ -1,14 +0,0 @@
|
|||
<% if !@journal_level_type.blank? %>
|
||||
$("#myModal1").modal('hide');
|
||||
$("#<%= dom_id @journal_level_type %>").replaceWith("<%= j render :partial => 'list_level_type', :collection => [@journal_level_type] %>");
|
||||
<% end %>
|
||||
|
||||
<% if !@journal_author_type.blank? %>
|
||||
$("#myModal2").modal('hide');
|
||||
$("#<%= dom_id @journal_author_type %>").replaceWith("<%= j render :partial => 'list_author_type', :collection => [@journal_author_type] %>");
|
||||
<% end %>
|
||||
|
||||
<% if !@journal_paper_type.blank? %>
|
||||
$("#myModal3").modal('hide');
|
||||
$("#<%= dom_id @journal_paper_type %>").replaceWith("<%= j render :partial => 'list_paper_type', :collection => [@journal_paper_type] %>");
|
||||
<% end %>
|
|
@ -1,131 +0,0 @@
|
|||
<% # encoding: utf-8 %>
|
||||
<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="<%= admin_journal_paper_add_level_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
||||
<span><%= t("personal_journal.level_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="level_types" class="table table-striped">
|
||||
<tbody>
|
||||
<%= render partial: 'list_level_type', collection: @journal_levels %>
|
||||
</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="<%= admin_journal_paper_add_author_type_path('add') %>#myModal2" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
||||
<span><%= t("personal_journal.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">
|
||||
<a class="btn btn-small btn-primary pull-right" href="<%= admin_journal_paper_add_paper_type_path('add') %>#myModal3" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
|
||||
<span><%= t("personal_journal.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>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<!-- <a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯出</a>
|
||||
<a class="btn btn-primary pull-right" href><i class="icon-plus icon-white"></i> 匯入</a> -->
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_admin_journal_paper_path, :class => 'btn btn-primary pull-right' %>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="level_type_qe">
|
||||
<div style="display:none;" class="modal" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<%= render "level_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 "author_type_qe" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="paper_type_qe">
|
||||
<div style="display:none;" class="modal" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<%= render "paper_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>
|
|
@ -16,8 +16,8 @@
|
|||
<% if has_access? %>
|
||||
<div class="list-active">
|
||||
<div class="btn-group">
|
||||
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => data_share_admin_journal_papers_path(member_profile_id: params[:id], disable: 'true') ) %>
|
||||
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => data_share_admin_journal_papers_path(member_profile_id: params[:id], disable: 'false') ) %>
|
||||
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => toggle_hide_admin_journal_papers_path(member_profile_id: params[:id], disable: 'true') ) %>
|
||||
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => toggle_hide_admin_journal_papers_path(member_profile_id: params[:id], disable: 'false') ) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
@ -47,7 +47,7 @@
|
|||
<% end -%>
|
||||
<td><%= writing_journal.year %></td>
|
||||
<td>
|
||||
<%= link_to writing_journal.create_link, page_for_journal_paper(writing_journal), target: "blank"%>
|
||||
<%= link_to writing_journal.create_link, OrbitHelper.url_to_plugin_show(writing_journal.to_param,'personal_journal'), target: "blank"%>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<% if has_access? %>
|
||||
|
@ -66,19 +66,18 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<% if has_access? %>
|
||||
<div class="bottomnav clearfix">
|
||||
|
||||
<% if has_access? %>
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-edit') +' '+ t('setting'),admin_journal_paper_intros_path(member_profile_id: @member.id), :class => 'btn btn-primary' %>
|
||||
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('new_'), '/admin/members/'+@member.to_param+'/journal_papers/new', :class => 'btn btn-primary' %>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-edit') +' '+ t('setting'),'/admin/members/'+@member.to_param+'/journal_papers/frontend_setting', :class => 'btn btn-primary' %>
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('new_'),
|
||||
'/admin/members/'+@member.to_param+'/journal_papers/new', :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="pagination pagination-centered">
|
||||
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort] } %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
|
||||
<div class="modal-header">
|
|
@ -1,5 +1,6 @@
|
|||
en:
|
||||
module_name:
|
||||
personal_journal: Journal Paper
|
||||
journal_paper: Journal Paper
|
||||
personal_journal:
|
||||
paper_title : "Paper Title"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
zh_tw:
|
||||
module_name:
|
||||
personal_journal: 期刊論文
|
||||
journal_paper: 期刊論文
|
||||
personal_journal:
|
||||
associated_project: "所屬計畫案"
|
||||
|
@ -28,7 +29,7 @@ zh_tw:
|
|||
author_type : "作者類別"
|
||||
paper_type: "論文類型"
|
||||
from : "起"
|
||||
to : "訖"
|
||||
to : "迄"
|
||||
file : "檔案"
|
||||
file_name : "檔案名稱"
|
||||
description : "描述"
|
||||
|
|
|
@ -1,20 +1,13 @@
|
|||
Rails.application.routes.draw do
|
||||
|
||||
locales = Site.find_by(site_active: true).in_use_locales rescue I18n.available_locales
|
||||
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
||||
namespace :admin do
|
||||
match 'writing_journal_setting' => "journal_papers#writing_journal_setting" ,as: :writing_journal_setting, via: [:get]
|
||||
get 'writing_journal_setting' => "journal_papers#setting"
|
||||
|
||||
resources :journal_papers do
|
||||
collection do
|
||||
get 'delete'
|
||||
get 'data_share'
|
||||
get 'toggle_hide' => 'journal_papers#toggle_hide'
|
||||
end
|
||||
match "add_level" => "journal_papers#add_level" ,as: :add_level, via: [:get, :post]
|
||||
match "edit_level" => "journal_papers#edit_level" ,as: :edit_level, via: [:get, :post]
|
||||
match "add_author_type" => "journal_papers#add_author_type" ,as: :add_author_type, via: [:get, :post]
|
||||
match "edit_author_type" => "journal_papers#edit_author_type" ,as: :edit_author_type, via: [:get, :post]
|
||||
match "add_paper_type" => "journal_papers#add_paper_type" ,as: :add_paper_type, via: [:get, :post]
|
||||
match "edit_paper_type" => "journal_papers#edit_paper_type" ,as: :edit_paper_type, via: [:get, :post]
|
||||
end
|
||||
|
||||
resources :members do
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
module PersonalJournal
|
||||
class Engine < ::Rails::Engine
|
||||
initializer "journal_paper" do
|
||||
OrbitApp.registration "JournalPaper",:type=> 'ModuleApp' do
|
||||
initializer "personal_journal" do
|
||||
OrbitApp.registration "PersonalJournal",:type=> 'ModuleApp' do
|
||||
module_label 'module_name.journal_paper'
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
personal_plugin :enable => true, :sort_number => '5', :app_name=>"JournalPaper", :intro_app_name=>"JournalPaperlIntro",:path=>"/plugin/journal_paper/profile",:front_path=>"/profile",:admin_path=>"/admin/journal_papers/",:i18n=>'module_name.journal_paper', :module_app_name=>'JournalPaper'
|
||||
personal_plugin :enable => true, :sort_number => '5', :app_name=>"JournalPaper", :intro_app_name=>"JournalPaperlIntro",:path=>"/plugin/personal_journal/profile",:front_path=>"/profile",:admin_path=>"/admin/journal_papers/",:i18n=>'module_name.journal_paper', :module_app_name=>'PersonalJournal'
|
||||
|
||||
version "0.1"
|
||||
desktop_enabled true
|
||||
|
@ -19,3 +19,4 @@ module PersonalJournal
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue