diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb
index 964547c79..1c609d8cc 100644
--- a/app/views/layouts/_side_bar.html.erb
+++ b/app/views/layouts/_side_bar.html.erb
@@ -122,6 +122,7 @@
<%= link_to content_tag(:i, nil, :class => 'icons-personal_journal') + t('admin.personal_journal'), panel_personal_journal_back_end_writing_journals_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('writing_journals', '/panel/personal_journal/back_end/tags', 'writing_journal_categorys', 'approvals'))) do -%>
<%= content_tag :li, link_to(t('personal_journal.all_articles'), panel_personal_journal_back_end_writing_journals_path), :class => active_for_action('writing_journals', 'index') %>
+ <%= content_tag :li, link_to(t('personal_journal.setting'), panel_personal_journal_back_end_writing_journal_setting_path), :class => active_for_action('writing_journal_setting', 'index') %>
<%= content_tag :li, link_to(t('personal_journal.paper_type'), panel_personal_journal_back_end_journal_paper_types_path), :class => active_for_action('paper_types', 'index') %>
<%= content_tag :li, link_to(t('personal_journal.author_type'), panel_personal_journal_back_end_journal_author_types_path), :class => active_for_action('author_types', 'index') %>
<%= content_tag :li, link_to(t('personal_journal.level_type'), panel_personal_journal_back_end_journal_level_types_path), :class => active_for_action('level_types', 'index') %>
@@ -135,6 +136,7 @@
<%= link_to content_tag(:i, nil, :class => 'icons-personal_seminar') + t('admin.personal_seminar'), panel_personal_seminar_back_end_writing_seminars_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('writing_seminars', '/panel/personal_seminar/back_end/tags', 'writing_seminar_categorys', 'approvals'))) do -%>
<%= content_tag :li, link_to(t('personal_seminar.all_articles'), panel_personal_seminar_back_end_writing_seminars_path), :class => active_for_action('writing_seminars', 'index') %>
+ <%= content_tag :li, link_to(t('personal_seminar.setting'), panel_personal_seminar_back_end_writing_seminar_setting_path), :class => active_for_action('writing_seminar_setting', 'index') %>
<%= content_tag :li, link_to(t('personal_seminar.paper_type'), panel_personal_seminar_back_end_seminar_paper_types_path), :class => active_for_action('paper_types', 'index') %>
<%= content_tag :li, link_to(t('personal_seminar.author_type'), panel_personal_seminar_back_end_seminar_author_types_path), :class => active_for_action('author_types', 'index') %>
<%= content_tag :li, link_to(t('personal_seminar.tags'), panel_personal_seminar_back_end_tags_path), :class => active_for_action('/panel/personal_seminar/back_end/tags', 'index') %>
@@ -147,6 +149,7 @@
<%= link_to content_tag(:i, nil, :class => 'icons-personal_book') + t('admin.personal_book'), panel_personal_book_back_end_writing_books_path %>
<%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('writing_books', '/panel/personal_book/back_end/tags', 'writing_book_categorys', 'approvals'))) do -%>
<%= content_tag :li, link_to(t('personal_book.all_articles'), panel_personal_book_back_end_writing_books_path), :class => active_for_action('writing_books', 'index') %>
+ <%= content_tag :li, link_to(t('personal_book.setting'), panel_personal_book_back_end_writing_book_setting_path), :class => active_for_action('writing_book_setting', 'index') %>
<%= content_tag :li, link_to(t('personal_book.paper_type'), panel_personal_book_back_end_book_paper_types_path), :class => active_for_action('paper_types', 'index') %>
<%= content_tag :li, link_to(t('personal_book.author_type'), panel_personal_book_back_end_book_author_types_path), :class => active_for_action('author_types', 'index') %>
<%= content_tag :li, link_to(t('personal_book.tags'), panel_personal_book_back_end_tags_path), :class => active_for_action('/panel/personal_book/back_end/tags', 'index') %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb
index 02f4220ab..ab49549d0 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb
@@ -43,7 +43,7 @@
<%= link_to t(:basic), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'basic'), :remote => true %>
<%#= link_to t(:picture), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'picture'), :remote => true %>
<%= link_to t(:tags), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'tags'), :remote => true %>
- <%#= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %>
+ <%= link_to t(:link), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'links'), :remote => true %>
<%#= link_to t(:file), load_quick_edit_panel_announcement_back_end_bulletin_path(bulletin, :type => 'files'), :remote => true %>
diff --git a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_book_categorys_controller.rb b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_book_categorys_controller.rb
index 4eab19d53..4fb020da0 100644
--- a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_book_categorys_controller.rb
+++ b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_book_categorys_controller.rb
@@ -1,6 +1,9 @@
class Panel::PersonalBook::BackEnd::WritingBookCategorysController < OrbitBackendController
- before_filter :for_app_manager,:except => [:index]
- include OrbitControllerLib::DivisionForDisable
+ include OrbitControllerLib::DivisionForDisable
+
+ before_filter :force_order_for_visitor,:only=>[:index,:show]
+ before_filter :force_order_for_user,:except => [:index,:show]
+ before_filter :for_app_manager,:except => [:index]
def index
diff --git a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb
index d02cb7d28..3e0dc5eac 100644
--- a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb
+++ b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb
@@ -1,8 +1,11 @@
class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendController
+ include AdminHelper
include OrbitControllerLib::DivisionForDisable
+
before_filter :authenticate_user!
+ before_filter :force_order_for_visitor,:only=>[:index,:show]
+ before_filter :force_order_for_user,:except => [:index,:show]
# before_filter :for_app_manager,:except => [:index,:show]
- before_filter :for_app_sub_manager,:except => [:index]
before_filter :only => [ :new,:edit,:update] do |controller|
controller.get_categorys('WritingBookCategory')
end
@@ -45,6 +48,64 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
end
end
+ def writing_book_setting
+
+ @author_types = BookAuthorType.all
+ @paper_types = BookPaperType.all
+
+ get_tags
+
+ @set_author_type = BookAuthorType.new(:display => 'List')
+ @author_type_url = panel_personal_book_back_end_writing_books_path
+
+ @set_paper_type = BookPaperType.new(:display => 'List')
+ @paper_type_url = panel_personal_book_back_end_writing_books_path
+
+
+ end
+
+ def author_type_quick_add
+ @set_author_type = BookAuthorType.new(:display => 'List')
+ @author_type_url = panel_personal_book_back_end_writing_books_path
+ @set_author_type.id = params[:id]
+
+ respond_to do |format|
+ format.js
+ end
+
+ end
+
+ def author_type_quick_edit
+
+ @set_author_type = BookAuthorType.find(params[:writing_book_id])
+ @author_type_url = panel_personal_book_back_end_writing_book_path(@set_author_type)
+
+ respond_to do |format|
+ format.js
+ end
+ end
+
+ def paper_type_quick_add
+ @set_paper_type = BookPaperType.new(:display => 'List')
+ @paper_type_url = panel_personal_book_back_end_writing_books_path
+ @set_paper_type.id = params[:id]
+
+ respond_to do |format|
+ format.js
+ end
+
+ end
+
+ def paper_type_quick_edit
+
+ @set_paper_type = BookPaperType.find(params[:writing_book_id])
+ @paper_type_url = panel_personal_book_back_end_writing_book_path(@set_paper_type)
+
+ respond_to do |format|
+ format.js
+ end
+ end
+
# GET /writing_books/1
# GET /writing_books/1.xml
def show
@@ -87,6 +148,29 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
# POST /writing_books
# POST /writing_books.xml
def create
+
+ if params[:book_author_type]
+
+ @book_author_type = BookAuthorType.new(params[:book_author_type])
+
+ respond_to do |format|
+ if @book_author_type.save
+ format.js { render 'create_writing_book_setting' }
+ end
+ end
+
+
+ elsif params[:book_paper_type]
+
+ @book_paper_type = BookPaperType.new(params[:book_paper_type])
+
+ respond_to do |format|
+ if @book_paper_type.save
+ format.js { render 'create_writing_book_setting' }
+ end
+ end
+
+ else
# @level_types = BookLevelType.all
@author_types = BookAuthorType.all
@@ -108,10 +192,39 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
end
end
end
+
+ end
# PUT /writing_books/1
# PUT /writing_books/1.xml
def update
+
+ if params[:book_author_type]
+
+ @book_author_type = BookAuthorType.find(params[:id])
+
+ respond_to do |format|
+
+ if @book_author_type.update_attributes(params[:book_author_type])
+ # format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js { render 'update_writing_book_setting' }
+ end
+ end
+
+ elsif params[:book_paper_type]
+
+ @book_paper_type = BookPaperType.find(params[:id])
+
+ respond_to do |format|
+
+ if @book_paper_type.update_attributes(params[:book_paper_type])
+ # format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js { render 'update_writing_book_setting' }
+ end
+ end
+
+ else
+
@writing_book = WritingBook.find(params[:id])
@writing_book.update_user_id = current_user.id
@@ -129,6 +242,8 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
end
end
end
+
+ end
# DELETE /writing_books/1
# DELETE /writing_books/1.xml
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_author_type_qe.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_author_type_qe.html.erb
new file mode 100644
index 000000000..efb32fef5
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_author_type_qe.html.erb
@@ -0,0 +1,34 @@
+<% # encoding: utf-8 %>
+
+<%= form_for(@set_author_type, :remote => true, :url => @author_type_url ) do |f| %>
+
+
+
+
+
+
+
+ <%= f.text_field :key %>
+
+
+ <%= f.fields_for :title_translations do |f| %>
+ <% @site_valid_locales.each do |locale| %>
+
+ <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
+
+ <%= f.text_field locale, :class => 'control-label', :value => (@set_author_type.title_translations[locale] rescue nil) %>
+
+
+ <% end %>
+ <% end %>
+
+
+<% end %>
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_list_author_type.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_list_author_type.html.erb
new file mode 100644
index 000000000..7504e9f0d
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_list_author_type.html.erb
@@ -0,0 +1,11 @@
+<% # encoding: utf-8 %>
+
+
+ <%= list_author_type.title %> |
+
+
+ 編輯
+ <%= link_to show_toggle_archive_btn(list_author_type),
+ polymorphic_path([:panel, :personal_book, :back_end, list_author_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %>
+ |
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_list_paper_type.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_list_paper_type.html.erb
new file mode 100644
index 000000000..744a6bcd2
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_list_paper_type.html.erb
@@ -0,0 +1,11 @@
+<% # encoding: utf-8 %>
+
+
+ <%= list_paper_type.title %> |
+
+
+ 編輯
+ <%= link_to show_toggle_archive_btn(list_paper_type),
+ polymorphic_path([:panel, :personal_book, :back_end, list_paper_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %>
+ |
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_paper_type_qe.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_paper_type_qe.html.erb
new file mode 100644
index 000000000..b73dc9067
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_paper_type_qe.html.erb
@@ -0,0 +1,29 @@
+<% # encoding: utf-8 %>
+
+<%= form_for(@set_paper_type, :remote => true, :url => @paper_type_url ) do |f| %>
+
+
+
+
+
+
+
+ <%= f.text_field :key %>
+
+
+
+
+
+ <%= f.text_field :title %>
+
+
+
+<% end %>
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/author_type_quick_add.js.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/author_type_quick_add.js.erb
new file mode 100644
index 000000000..d94a00e18
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/author_type_quick_add.js.erb
@@ -0,0 +1 @@
+$("#myModal2").html("<%= j render "author_type_qe" %>");
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/author_type_quick_edit.js.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/author_type_quick_edit.js.erb
new file mode 100644
index 000000000..6212e666e
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/author_type_quick_edit.js.erb
@@ -0,0 +1 @@
+$("#myModal2").html("<%= j render "author_type_qe" %>");
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/create_writing_book_setting.js.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/create_writing_book_setting.js.erb
new file mode 100644
index 000000000..564cfd55e
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/create_writing_book_setting.js.erb
@@ -0,0 +1,10 @@
+
+<% if !@book_paper_type.blank? %>
+$("#myModal1").modal('hide');
+$('<%= j render :partial => 'list_paper_type', :collection => [@book_paper_type] %>').appendTo('#paper_types').hide().fadeIn();
+<% end %>
+
+<% if !@book_author_type.blank? %>
+$("#myModal2").modal('hide');
+$('<%= j render :partial => 'list_author_type', :collection => [@book_author_type] %>').appendTo('#author_types').hide().fadeIn();
+<% end %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/paper_type_quick_add.js.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/paper_type_quick_add.js.erb
new file mode 100644
index 000000000..86e1a73fc
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/paper_type_quick_add.js.erb
@@ -0,0 +1 @@
+$("#myModal1").html("<%= j render "paper_type_qe" %>");
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/paper_type_quick_edit.js.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/paper_type_quick_edit.js.erb
new file mode 100644
index 000000000..b815230a8
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/paper_type_quick_edit.js.erb
@@ -0,0 +1 @@
+$("#myModal1").html("<%= j render "paper_type_qe" %>");
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/update_writing_book_setting.js.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/update_writing_book_setting.js.erb
new file mode 100644
index 000000000..4c565713f
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/update_writing_book_setting.js.erb
@@ -0,0 +1,10 @@
+
+<% if !@book_paper_type.blank? %>
+$("#myModal1").modal('hide');
+$("#<%= dom_id @book_paper_type %>").replaceWith("<%= j render :partial => 'list_paper_type', :collection => [@book_paper_type] %>");
+<% end %>
+
+<% if !@book_author_type.blank? %>
+$("#myModal2").modal('hide');
+$("#<%= dom_id @book_author_type %>").replaceWith("<%= j render :partial => 'list_author_type', :collection => [@book_author_type] %>");
+<% end %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/writing_book_setting.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/writing_book_setting.html.erb
new file mode 100644
index 000000000..5db2c01cc
--- /dev/null
+++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/writing_book_setting.html.erb
@@ -0,0 +1,145 @@
+<% # encoding: utf-8 %>
+
+
+
+
+
+
+
+ <%= render :partial => "author_type_qe" %>
+
+
+
+
+
+ <%= render :partial => "paper_type_qe" %>
+
+
+
+
+
+
+
+
+<% content_for :page_specific_css do %>
+ <%= stylesheet_link_tag "item" %>
+<% end %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_book/config/routes.rb b/vendor/built_in_modules/personal_book/config/routes.rb
index 6e26ad911..8d2ea0d1a 100644
--- a/vendor/built_in_modules/personal_book/config/routes.rb
+++ b/vendor/built_in_modules/personal_book/config/routes.rb
@@ -3,10 +3,19 @@ Rails.application.routes.draw do
namespace :panel do
namespace :personal_book do
namespace :back_end do
+
+ match 'writing_book_setting' => "writing_books#writing_book_setting" ,:as => :writing_book_setting
+
resources :writing_books do
collection do
get 'delete'
end
+
+ match "author_type_quick_add" => "writing_books#author_type_quick_add" ,:as => :author_type_quick_add
+ match "author_type_quick_edit" => "writing_books#author_type_quick_edit" ,:as => :author_type_quick_edit
+
+ match "paper_type_quick_add" => "writing_books#paper_type_quick_add" ,:as => :paper_type_quick_add
+ match "paper_type_quick_edit" => "writing_books#paper_type_quick_edit" ,:as => :paper_type_quick_edit
end
resources :book_paper_types
resources :book_author_types
diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/tags_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/tags_controller.rb
index a3ae60555..aee889c61 100644
--- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/tags_controller.rb
+++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/tags_controller.rb
@@ -1,5 +1,7 @@
class Panel::PersonalJournal::BackEnd::TagsController < Admin::TagsController
+ include OrbitControllerLib::DivisionForDisable
+
def initialize
super
@app_title = 'personal_journal'
diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journal_categorys_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journal_categorys_controller.rb
index a9b7ebc2a..8176a8550 100644
--- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journal_categorys_controller.rb
+++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journal_categorys_controller.rb
@@ -1,7 +1,11 @@
class Panel::PersonalJournal::BackEnd::WritingJournalCategorysController < OrbitBackendController
- before_filter :for_app_manager,:except => [:index]
- include OrbitControllerLib::DivisionForDisable
-
+
+ include OrbitControllerLib::DivisionForDisable
+
+ before_filter :force_order_for_visitor,:only=>[:index,:show]
+ before_filter :force_order_for_user,:except => [:index,:show]
+ before_filter :for_app_manager,:except => [:index]
+
def index
get_types
diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb
index 0d7d855b5..7caca3fe3 100644
--- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb
+++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb
@@ -1,8 +1,11 @@
class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendController
+ include AdminHelper
include OrbitControllerLib::DivisionForDisable
+
before_filter :authenticate_user!
+ before_filter :force_order_for_visitor,:only=>[:index,:show]
+ before_filter :force_order_for_user,:except => [:index,:show]
# before_filter :for_app_manager,:except => [:index,:show]
- before_filter :for_app_sub_manager,:except => [:index]
before_filter :only => [ :new,:edit,:update] do |controller|
controller.get_categorys('WritingJournalCategory')
end
@@ -45,6 +48,92 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
end
end
+ def writing_journal_setting
+
+ @module_apps = ModuleApp.where(has_plugin: true).order_by(:title, :asc)
+
+ @level_types = JournalLevelType.all
+ @author_types = JournalAuthorType.all
+ @paper_types = JournalPaperType.all
+
+ get_tags
+
+ # @writing_journal_categorys = JournalLevelType.all
+ @set_level_type = JournalLevelType.new(:display => 'List')
+ @level_type_url = panel_personal_journal_back_end_writing_journals_path
+
+ @set_author_type = JournalAuthorType.new(:display => 'List')
+ @author_type_url = panel_personal_journal_back_end_writing_journals_path
+
+ @set_paper_type = JournalPaperType.new(:display => 'List')
+ @paper_type_url = panel_personal_journal_back_end_writing_journals_path
+
+
+ end
+
+ def level_type_quick_add
+ @set_level_type = JournalLevelType.new(:display => 'List')
+ @level_type_url = panel_personal_journal_back_end_writing_journals_path
+ @set_level_type.id = params[:id]
+
+ respond_to do |format|
+ format.js
+ end
+
+ end
+
+ def level_type_quick_edit
+
+ @set_level_type = JournalLevelType.find(params[:writing_journal_id])
+ @level_type_url = panel_personal_journal_back_end_writing_journal_path(@set_level_type)
+
+ respond_to do |format|
+ format.js
+ end
+ end
+
+ def author_type_quick_add
+ @set_author_type = JournalAuthorType.new(:display => 'List')
+ @author_type_url = panel_personal_journal_back_end_writing_journals_path
+ @set_author_type.id = params[:id]
+
+ respond_to do |format|
+ format.js
+ end
+
+ end
+
+ def author_type_quick_edit
+
+ @set_author_type = JournalAuthorType.find(params[:writing_journal_id])
+ @author_type_url = panel_personal_journal_back_end_writing_journal_path(@set_author_type)
+
+ respond_to do |format|
+ format.js
+ end
+ end
+
+ def paper_type_quick_add
+ @set_paper_type = JournalPaperType.new(:display => 'List')
+ @paper_type_url = panel_personal_journal_back_end_writing_journals_path
+ @set_paper_type.id = params[:id]
+
+ respond_to do |format|
+ format.js
+ end
+
+ end
+
+ def paper_type_quick_edit
+
+ @set_paper_type = JournalPaperType.find(params[:writing_journal_id])
+ @paper_type_url = panel_personal_journal_back_end_writing_journal_path(@set_paper_type)
+
+ respond_to do |format|
+ format.js
+ end
+ end
+
# GET /writing_journals/1
# GET /writing_journals/1.xml
def show
@@ -87,6 +176,39 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
# POST /writing_journals
# POST /writing_journals.xml
def create
+
+ if params[:journal_level_type]
+
+ @journal_level_type = JournalLevelType.new(params[:journal_level_type])
+
+ respond_to do |format|
+ if @journal_level_type.save
+ format.js { render 'create_writing_journal_setting' }
+ end
+ end
+
+ elsif params[:journal_author_type]
+
+ @journal_author_type = JournalAuthorType.new(params[:journal_author_type])
+
+ respond_to do |format|
+ if @journal_author_type.save
+ format.js { render 'create_writing_journal_setting' }
+ end
+ end
+
+
+ elsif params[:journal_paper_type]
+
+ @journal_paper_type = JournalPaperType.new(params[:journal_paper_type])
+
+ respond_to do |format|
+ if @journal_paper_type.save
+ format.js { render 'create_writing_journal_setting' }
+ end
+ end
+
+ else
@level_types = JournalLevelType.all
@author_types = JournalAuthorType.all
@@ -108,27 +230,71 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
end
end
end
+
+ end
# PUT /writing_journals/1
# PUT /writing_journals/1.xml
def update
- @writing_journal = WritingJournal.find(params[:id])
-
- @writing_journal.update_user_id = current_user.id
-
- params[:writing_journal][:tag_ids] ||=[]
+
+ if params[:journal_level_type]
+
+ @journal_level_type = JournalLevelType.find(params[:id])
- respond_to do |format|
- if @writing_journal.update_attributes(params[:writing_journal])
- format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) }
- # format.js { render 'toggle_enable' }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @writing_journal.errors, :status => :unprocessable_entity }
+ respond_to do |format|
+
+ if @journal_level_type.update_attributes(params[:journal_level_type])
+ # format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js { render 'update_writing_journal_setting' }
+ end
+ end
+
+ elsif params[:journal_author_type]
+
+ @journal_author_type = JournalAuthorType.find(params[:id])
+
+ respond_to do |format|
+
+ if @journal_author_type.update_attributes(params[:journal_author_type])
+ # format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js { render 'update_writing_journal_setting' }
+ end
+ end
+
+ elsif params[:journal_paper_type]
+
+ @journal_paper_type = JournalPaperType.find(params[:id])
+
+ respond_to do |format|
+
+ if @journal_paper_type.update_attributes(params[:journal_paper_type])
+ # format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js { render 'update_writing_journal_setting' }
+ end
+ end
+
+ else
+
+
+ @writing_journal = WritingJournal.find(params[:id])
+
+ @writing_journal.update_user_id = current_user.id
+
+ params[:writing_journal][:tag_ids] ||=[]
+
+ respond_to do |format|
+ if @writing_journal.update_attributes(params[:writing_journal])
+ format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) }
+ # format.js { render 'toggle_enable' }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @writing_journal.errors, :status => :unprocessable_entity }
+ end
end
+ end
+
end
- end
# DELETE /writing_journals/1
# DELETE /writing_journals/1.xml
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_author_type_qe.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_author_type_qe.html.erb
new file mode 100644
index 000000000..a1f66d51e
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_author_type_qe.html.erb
@@ -0,0 +1,24 @@
+<% # encoding: utf-8 %>
+
+<%= form_for(@set_author_type, :remote => true, :url => @author_type_url ) do |f| %>
+
+
+
+
+<% end %>
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_level_type_qe.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_level_type_qe.html.erb
new file mode 100644
index 000000000..8836cc873
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_level_type_qe.html.erb
@@ -0,0 +1,34 @@
+<% # encoding: utf-8 %>
+
+<%= form_for(@set_level_type, :remote => true, :url => @level_type_url ) do |f| %>
+
+
+
+
+
+
+
+ <%= f.text_field :key %>
+
+
+ <%= f.fields_for :title_translations do |f| %>
+ <% @site_valid_locales.each do |locale| %>
+
+ <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
+
+ <%= f.text_field locale, :class => 'control-label', :value => (@set_level_type.title_translations[locale] rescue nil) %>
+
+
+ <% end %>
+ <% end %>
+
+
+<% end %>
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_author_type.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_author_type.html.erb
new file mode 100644
index 000000000..e3d2e4c62
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_author_type.html.erb
@@ -0,0 +1,11 @@
+<% # encoding: utf-8 %>
+
+
+ <%= list_author_type.title %> |
+
+
+ 編輯
+ <%= link_to show_toggle_archive_btn(list_author_type),
+ polymorphic_path([:panel, :personal_journal, :back_end, list_author_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %>
+ |
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_level_type.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_level_type.html.erb
new file mode 100644
index 000000000..f62fdf313
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_level_type.html.erb
@@ -0,0 +1,11 @@
+<% # encoding: utf-8 %>
+
+
+ <%= list_level_type.title %> |
+
+
+ 編輯
+ <%= link_to show_toggle_archive_btn(list_level_type),
+ polymorphic_path([:panel, :personal_journal, :back_end, list_level_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %>
+ |
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_paper_type.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_paper_type.html.erb
new file mode 100644
index 000000000..d43ca172e
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_paper_type.html.erb
@@ -0,0 +1,11 @@
+<% # encoding: utf-8 %>
+
+
+ <%= list_paper_type.title %> |
+
+
+ 編輯
+ <%= link_to show_toggle_archive_btn(list_paper_type),
+ polymorphic_path([:panel, :personal_journal, :back_end, list_paper_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %>
+ |
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_tag_type.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_tag_type.html.erb
new file mode 100644
index 000000000..8936139e1
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_tag_type.html.erb
@@ -0,0 +1,11 @@
+<% # encoding: utf-8 %>
+
+
+ <%= list_tag_type[I18n.locale] %> |
+
+
+ 編輯
+ <%= link_to show_toggle_archive_btn(list_level_type),
+ polymorphic_path([:panel, :personal_journal, :back_end, list_level_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %>
+ |
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_paper_type_qe.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_paper_type_qe.html.erb
new file mode 100644
index 000000000..0951ecc87
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_paper_type_qe.html.erb
@@ -0,0 +1,29 @@
+<% # encoding: utf-8 %>
+
+<%= form_for(@set_paper_type, :remote => true, :url => @paper_type_url ) do |f| %>
+
+
+
+
+
+
+
+ <%= f.text_field :key %>
+
+
+
+
+
+ <%= f.text_field :title %>
+
+
+
+<% end %>
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/author_type_quick_add.js.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/author_type_quick_add.js.erb
new file mode 100644
index 000000000..d94a00e18
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/author_type_quick_add.js.erb
@@ -0,0 +1 @@
+$("#myModal2").html("<%= j render "author_type_qe" %>");
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/author_type_quick_edit.js.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/author_type_quick_edit.js.erb
new file mode 100644
index 000000000..6212e666e
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/author_type_quick_edit.js.erb
@@ -0,0 +1 @@
+$("#myModal2").html("<%= j render "author_type_qe" %>");
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/create_writing_journal_setting.js.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/create_writing_journal_setting.js.erb
new file mode 100644
index 000000000..12ef414aa
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/create_writing_journal_setting.js.erb
@@ -0,0 +1,15 @@
+
+<% 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 %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/level_type_quick_add.js.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/level_type_quick_add.js.erb
new file mode 100644
index 000000000..6c61ff40d
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/level_type_quick_add.js.erb
@@ -0,0 +1 @@
+$("#myModal1").html("<%= j render "level_type_qe" %>");
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/level_type_quick_edit.js.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/level_type_quick_edit.js.erb
new file mode 100644
index 000000000..064caccb4
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/level_type_quick_edit.js.erb
@@ -0,0 +1 @@
+$("#myModal1").html("<%= j render "level_type_qe" %>");
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/paper_type_quick_add.js.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/paper_type_quick_add.js.erb
new file mode 100644
index 000000000..f7c4cc94d
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/paper_type_quick_add.js.erb
@@ -0,0 +1 @@
+$("#myModal3").html("<%= j render "paper_type_qe" %>");
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/paper_type_quick_edit.js.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/paper_type_quick_edit.js.erb
new file mode 100644
index 000000000..c9a463411
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/paper_type_quick_edit.js.erb
@@ -0,0 +1 @@
+$("#myModal3").html("<%= j render "paper_type_qe" %>");
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/update_writing_journal_setting.js.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/update_writing_journal_setting.js.erb
new file mode 100644
index 000000000..d6332f1f8
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/update_writing_journal_setting.js.erb
@@ -0,0 +1,14 @@
+<% 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 %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/writing_journal_setting.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/writing_journal_setting.html.erb
new file mode 100644
index 000000000..d9dd5dee4
--- /dev/null
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/writing_journal_setting.html.erb
@@ -0,0 +1,193 @@
+<% # encoding: utf-8 %>
+
+
+
+
+
+
+
+
+
+
+ <% @module_apps.each do |ma| %>
+ - <%= link_to eval("#{ma.object.classify.constantize}") , eval("panel_#{ma.title}_back_end_#{ma.object}s_path") %>
+ <% end %>
+
+
+
+
+
+
+
+
+
+
+
+ <%= render :partial => "level_type_qe" %>
+
+
+
+
+
+ <%= render :partial => "author_type_qe" %>
+
+
+
+
+
+ <%= render :partial => "paper_type_qe" %>
+
+
+
+
+
+
+
+
+<% content_for :page_specific_css do %>
+ <%= stylesheet_link_tag "item" %>
+<% end %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/config/routes.rb b/vendor/built_in_modules/personal_journal/config/routes.rb
index 8c3b065e3..fd80bf0f1 100644
--- a/vendor/built_in_modules/personal_journal/config/routes.rb
+++ b/vendor/built_in_modules/personal_journal/config/routes.rb
@@ -3,11 +3,27 @@ Rails.application.routes.draw do
namespace :panel do
namespace :personal_journal do
namespace :back_end do
+
+ match 'writing_journal_setting' => "writing_journals#writing_journal_setting" ,:as => :writing_journal_setting
+
resources :writing_journals do
collection do
get 'delete'
end
+
+ match "level_type_quick_add" => "writing_journals#level_type_quick_add" ,:as => :level_type_quick_add
+ match "level_type_quick_edit" => "writing_journals#level_type_quick_edit" ,:as => :level_type_quick_edit
+
+ match "author_type_quick_add" => "writing_journals#author_type_quick_add" ,:as => :author_type_quick_add
+ match "author_type_quick_edit" => "writing_journals#author_type_quick_edit" ,:as => :author_type_quick_edit
+
+ match "paper_type_quick_add" => "writing_journals#paper_type_quick_add" ,:as => :paper_type_quick_add
+ match "paper_type_quick_edit" => "writing_journals#paper_type_quick_edit" ,:as => :paper_type_quick_edit
+
+ match "tag_quick_add" => "writing_journals#tag_quick_add" ,:as => :tag_quick_add
+ match "tag_quick_edit" => "writing_journals#tag_quick_edit" ,:as => :tag_quick_edit
end
+
resources :journal_paper_types
resources :journal_author_types
resources :journal_level_types
diff --git a/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminar_categorys_controller.rb b/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminar_categorys_controller.rb
index 37798b563..7714dd86d 100644
--- a/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminar_categorys_controller.rb
+++ b/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminar_categorys_controller.rb
@@ -1,6 +1,10 @@
class Panel::PersonalSeminar::BackEnd::WritingSeminarCategorysController < OrbitBackendController
- before_filter :for_app_manager,:except => [:index]
- include OrbitControllerLib::DivisionForDisable
+
+ include OrbitControllerLib::DivisionForDisable
+
+ before_filter :force_order_for_visitor,:only=>[:index,:show]
+ before_filter :force_order_for_user,:except => [:index,:show]
+ before_filter :for_app_manager,:except => [:index]
def index
diff --git a/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminars_controller.rb b/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminars_controller.rb
index dfd3626ae..5b3c48153 100644
--- a/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminars_controller.rb
+++ b/vendor/built_in_modules/personal_seminar/app/controllers/panel/personal_seminar/back_end/writing_seminars_controller.rb
@@ -1,8 +1,11 @@
class Panel::PersonalSeminar::BackEnd::WritingSeminarsController < OrbitBackendController
+ include AdminHelper
include OrbitControllerLib::DivisionForDisable
+
before_filter :authenticate_user!
- # before_filter :for_app_manager,:except => [:index,:show]
- before_filter :for_app_sub_manager,:except => [:index]
+ before_filter :force_order_for_visitor,:only=>[:index,:show]
+ before_filter :force_order_for_user,:except => [:index,:show]
+
before_filter :only => [ :new,:edit,:update] do |controller|
controller.get_categorys('WritingSeminarCategory')
end
@@ -46,6 +49,64 @@ class Panel::PersonalSeminar::BackEnd::WritingSeminarsController < OrbitBackendC
end
end
+ def writing_seminar_setting
+
+ @author_types = SeminarAuthorType.all
+ @paper_types = SeminarPaperType.all
+
+ get_tags
+
+ @set_author_type = SeminarAuthorType.new(:display => 'List')
+ @author_type_url = panel_personal_seminar_back_end_writing_seminars_path
+
+ @set_paper_type = SeminarPaperType.new(:display => 'List')
+ @paper_type_url = panel_personal_seminar_back_end_writing_seminars_path
+
+
+ end
+
+ def paper_type_quick_add
+ @set_paper_type = SeminarPaperType.new(:display => 'List')
+ @paper_type_url = panel_personal_seminar_back_end_writing_seminars_path
+ @set_paper_type.id = params[:id]
+
+ respond_to do |format|
+ format.js
+ end
+
+ end
+
+ def paper_type_quick_edit
+
+ @set_paper_type = SeminarPaperType.find(params[:writing_seminar_id])
+ @paper_type_url = panel_personal_seminar_back_end_writing_seminar_path(@set_paper_type)
+
+ respond_to do |format|
+ format.js
+ end
+ end
+
+ def author_type_quick_add
+ @set_author_type = SeminarAuthorType.new(:display => 'List')
+ @author_type_url = panel_personal_seminar_back_end_writing_seminars_path
+ @set_author_type.id = params[:id]
+
+ respond_to do |format|
+ format.js
+ end
+
+ end
+
+ def author_type_quick_edit
+
+ @set_author_type = SeminarAuthorType.find(params[:writing_seminar_id])
+ @author_type_url = panel_personal_seminar_back_end_writing_seminar_path(@set_author_type)
+
+ respond_to do |format|
+ format.js
+ end
+ end
+
# GET /writing_seminars/1
# GET /writing_seminars/1.xml
def show
@@ -62,7 +123,7 @@ class Panel::PersonalSeminar::BackEnd::WritingSeminarsController < OrbitBackendC
@writing_seminar = WritingSeminar.new
# @writing_seminar_files = WritingSeminarFile.all
- # @level_types = SeminarLevelType.all
+ # @paper_types = SeminarLevelType.all
@author_types = SeminarAuthorType.all
@paper_types = SeminarPaperType.all
@@ -78,7 +139,7 @@ class Panel::PersonalSeminar::BackEnd::WritingSeminarsController < OrbitBackendC
def edit
@writing_seminar = WritingSeminar.find(params[:id])
- # @level_types = SeminarLevelType.all
+ # @paper_types = SeminarLevelType.all
@author_types = SeminarAuthorType.all
@paper_types = SeminarPaperType.all
@@ -88,8 +149,30 @@ class Panel::PersonalSeminar::BackEnd::WritingSeminarsController < OrbitBackendC
# POST /writing_seminars
# POST /writing_seminars.xml
def create
+
+ if params[:seminar_paper_type]
+
+ @seminar_paper_type = SeminarPaperType.new(params[:seminar_paper_type])
+
+ respond_to do |format|
+ if @seminar_paper_type.save
+ format.js { render 'create_writing_seminar_setting' }
+ end
+ end
+
+ elsif params[:seminar_author_type]
+
+ @seminar_author_type = SeminarAuthorType.new(params[:seminar_author_type])
+
+ respond_to do |format|
+ if @seminar_author_type.save
+ format.js { render 'create_writing_seminar_setting' }
+ end
+ end
- # @level_types = SeminarLevelType.all
+ else
+
+ # @paper_types = SeminarLevelType.all
@author_types = SeminarAuthorType.all
@paper_types = SeminarPaperType.all
get_tags
@@ -110,9 +193,38 @@ class Panel::PersonalSeminar::BackEnd::WritingSeminarsController < OrbitBackendC
end
end
+ end
+
# PUT /writing_seminars/1
# PUT /writing_seminars/1.xml
def update
+
+ if params[:seminar_paper_type]
+
+ @seminar_paper_type = SeminarPaperType.find(params[:id])
+
+ respond_to do |format|
+
+ if @seminar_paper_type.update_attributes(params[:seminar_paper_type])
+ # format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js { render 'update_writing_seminar_setting' }
+ end
+ end
+
+ elsif params[:seminar_author_type]
+
+ @seminar_author_type = SeminarAuthorType.find(params[:id])
+
+ respond_to do |format|
+
+ if @seminar_author_type.update_attributes(params[:seminar_author_type])
+ # format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js { render 'update_writing_seminar_setting' }
+ end
+ end
+
+ else
+
@writing_seminar = WritingSeminar.find(params[:id])
@writing_seminar.update_user_id = current_user.id
@@ -130,6 +242,8 @@ class Panel::PersonalSeminar::BackEnd::WritingSeminarsController < OrbitBackendC
end
end
end
+
+ end
# DELETE /writing_seminars/1
# DELETE /writing_seminars/1.xml
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_author_type_qe.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_author_type_qe.html.erb
new file mode 100644
index 000000000..f0994f908
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_author_type_qe.html.erb
@@ -0,0 +1,34 @@
+<% # encoding: utf-8 %>
+
+<%= form_for(@set_author_type, :remote => true, :url => @author_type_url ) do |f| %>
+
+
+
+
+
+
+
+ <%= f.text_field :key %>
+
+
+ <%= f.fields_for :title_translations do |f| %>
+ <% @site_valid_locales.each do |locale| %>
+
+ <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
+
+ <%= f.text_field locale, :class => 'control-label', :value => (@set_author_type.title_translations[locale] rescue nil) %>
+
+
+ <% end %>
+ <% end %>
+
+
+<% end %>
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_list_author_type.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_list_author_type.html.erb
new file mode 100644
index 000000000..9bf5648d7
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_list_author_type.html.erb
@@ -0,0 +1,11 @@
+<% # encoding: utf-8 %>
+
+
+ <%= list_author_type.title %> |
+
+
+ 編輯
+ <%= link_to show_toggle_archive_btn(list_author_type),
+ polymorphic_path([:panel, :personal_seminar, :back_end, list_author_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %>
+ |
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_list_paper_type.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_list_paper_type.html.erb
new file mode 100644
index 000000000..cb796f681
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_list_paper_type.html.erb
@@ -0,0 +1,11 @@
+<% # encoding: utf-8 %>
+
+
+ <%= list_paper_type.title %> |
+
+
+ 編輯
+ <%= link_to show_toggle_archive_btn(list_paper_type),
+ polymorphic_path([:panel, :personal_seminar, :back_end, list_paper_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %>
+ |
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_paper_type_qe.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_paper_type_qe.html.erb
new file mode 100644
index 000000000..a96aaab60
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_paper_type_qe.html.erb
@@ -0,0 +1,34 @@
+<% # encoding: utf-8 %>
+
+<%= form_for(@set_paper_type, :remote => true, :url => @paper_type_url ) do |f| %>
+
+
+
+
+
+
+
+ <%= f.text_field :key %>
+
+
+ <%= f.fields_for :title_translations do |f| %>
+ <% @site_valid_locales.each do |locale| %>
+
+ <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
+
+ <%= f.text_field locale, :class => 'control-label', :value => (@set_paper_type.title_translations[locale] rescue nil) %>
+
+
+ <% end %>
+ <% end %>
+
+
+<% end %>
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/author_type_quick_add.js.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/author_type_quick_add.js.erb
new file mode 100644
index 000000000..d94a00e18
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/author_type_quick_add.js.erb
@@ -0,0 +1 @@
+$("#myModal2").html("<%= j render "author_type_qe" %>");
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/author_type_quick_edit.js.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/author_type_quick_edit.js.erb
new file mode 100644
index 000000000..6212e666e
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/author_type_quick_edit.js.erb
@@ -0,0 +1 @@
+$("#myModal2").html("<%= j render "author_type_qe" %>");
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/create_writing_seminar_setting.js.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/create_writing_seminar_setting.js.erb
new file mode 100644
index 000000000..e42553131
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/create_writing_seminar_setting.js.erb
@@ -0,0 +1,10 @@
+
+<% if !@seminar_paper_type.blank? %>
+$("#myModal1").modal('hide');
+$('<%= j render :partial => 'list_paper_type', :collection => [@seminar_paper_type] %>').appendTo('#paper_types').hide().fadeIn();
+<% end %>
+
+<% if !@seminar_author_type.blank? %>
+$("#myModal2").modal('hide');
+$('<%= j render :partial => 'list_author_type', :collection => [@seminar_author_type] %>').appendTo('#author_types').hide().fadeIn();
+<% end %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/paper_type_quick_add.js.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/paper_type_quick_add.js.erb
new file mode 100644
index 000000000..86e1a73fc
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/paper_type_quick_add.js.erb
@@ -0,0 +1 @@
+$("#myModal1").html("<%= j render "paper_type_qe" %>");
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/paper_type_quick_edit.js.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/paper_type_quick_edit.js.erb
new file mode 100644
index 000000000..b815230a8
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/paper_type_quick_edit.js.erb
@@ -0,0 +1 @@
+$("#myModal1").html("<%= j render "paper_type_qe" %>");
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/update_writing_seminar_setting.js.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/update_writing_seminar_setting.js.erb
new file mode 100644
index 000000000..698d4adac
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/update_writing_seminar_setting.js.erb
@@ -0,0 +1,10 @@
+
+<% if !@seminar_paper_type.blank? %>
+$("#myModal1").modal('hide');
+$("#<%= dom_id @seminar_paper_type %>").replaceWith("<%= j render :partial => 'list_paper_type', :collection => [@seminar_paper_type] %>");
+<% end %>
+
+<% if !@seminar_author_type.blank? %>
+$("#myModal2").modal('hide');
+$("#<%= dom_id @seminar_author_type %>").replaceWith("<%= j render :partial => 'list_author_type', :collection => [@seminar_author_type] %>");
+<% end %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/writing_seminar_setting.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/writing_seminar_setting.html.erb
new file mode 100644
index 000000000..f4795b61c
--- /dev/null
+++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/writing_seminar_setting.html.erb
@@ -0,0 +1,146 @@
+<% # encoding: utf-8 %>
+
+
+
+
+
+
+
+
+ <%= render :partial => "paper_type_qe" %>
+
+
+
+
+
+ <%= render :partial => "author_type_qe" %>
+
+
+
+
+
+
+
+
+<% content_for :page_specific_css do %>
+ <%= stylesheet_link_tag "item" %>
+<% end %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_seminar/config/routes.rb b/vendor/built_in_modules/personal_seminar/config/routes.rb
index e77f2a5f7..d99e2801a 100644
--- a/vendor/built_in_modules/personal_seminar/config/routes.rb
+++ b/vendor/built_in_modules/personal_seminar/config/routes.rb
@@ -3,10 +3,19 @@ Rails.application.routes.draw do
namespace :panel do
namespace :personal_seminar do
namespace :back_end do
+
+ match 'writing_seminar_setting' => "writing_seminars#writing_seminar_setting" ,:as => :writing_seminar_setting
+
resources :writing_seminars do
collection do
get 'delete'
end
+
+ match "author_type_quick_add" => "writing_seminars#author_type_quick_add" ,:as => :author_type_quick_add
+ match "author_type_quick_edit" => "writing_seminars#author_type_quick_edit" ,:as => :author_type_quick_edit
+
+ match "paper_type_quick_add" => "writing_seminars#paper_type_quick_add" ,:as => :paper_type_quick_add
+ match "paper_type_quick_edit" => "writing_seminars#paper_type_quick_edit" ,:as => :paper_type_quick_edit
end
resources :seminar_paper_types
resources :seminar_author_types