From 5bde2a9e81c3cdb6b32847d0f1b57f12be0aa21b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Sep 2012 11:02:11 +0800 Subject: [PATCH] demo site plugin --- app/views/layouts/_side_bar.html.erb | 3 + .../back_end/bulletins/_bulletin.html.erb | 2 +- .../writing_book_categorys_controller.rb | 7 +- .../back_end/writing_books_controller.rb | 117 ++++++++++- .../writing_books/_author_type_qe.html.erb | 34 +++ .../writing_books/_list_author_type.html.erb | 11 + .../writing_books/_list_paper_type.html.erb | 11 + .../writing_books/_paper_type_qe.html.erb | 29 +++ .../author_type_quick_add.js.erb | 1 + .../author_type_quick_edit.js.erb | 1 + .../create_writing_book_setting.js.erb | 10 + .../writing_books/paper_type_quick_add.js.erb | 1 + .../paper_type_quick_edit.js.erb | 1 + .../update_writing_book_setting.js.erb | 10 + .../writing_book_setting.html.erb | 145 +++++++++++++ .../personal_book/config/routes.rb | 9 + .../back_end/tags_controller.rb | 2 + .../writing_journal_categorys_controller.rb | 10 +- .../back_end/writing_journals_controller.rb | 196 ++++++++++++++++-- .../writing_journals/_author_type_qe.html.erb | 24 +++ .../writing_journals/_level_type_qe.html.erb | 34 +++ .../_list_author_type.html.erb | 11 + .../_list_level_type.html.erb | 11 + .../_list_paper_type.html.erb | 11 + .../writing_journals/_list_tag_type.html.erb | 11 + .../writing_journals/_paper_type_qe.html.erb | 29 +++ .../author_type_quick_add.js.erb | 1 + .../author_type_quick_edit.js.erb | 1 + .../create_writing_journal_setting.js.erb | 15 ++ .../level_type_quick_add.js.erb | 1 + .../level_type_quick_edit.js.erb | 1 + .../paper_type_quick_add.js.erb | 1 + .../paper_type_quick_edit.js.erb | 1 + .../update_writing_journal_setting.js.erb | 14 ++ .../writing_journal_setting.html.erb | 193 +++++++++++++++++ .../personal_journal/config/routes.rb | 16 ++ .../writing_seminar_categorys_controller.rb | 8 +- .../back_end/writing_seminars_controller.rb | 124 ++++++++++- .../writing_seminars/_author_type_qe.html.erb | 34 +++ .../_list_author_type.html.erb | 11 + .../_list_paper_type.html.erb | 11 + .../writing_seminars/_paper_type_qe.html.erb | 34 +++ .../author_type_quick_add.js.erb | 1 + .../author_type_quick_edit.js.erb | 1 + .../create_writing_seminar_setting.js.erb | 10 + .../paper_type_quick_add.js.erb | 1 + .../paper_type_quick_edit.js.erb | 1 + .../update_writing_seminar_setting.js.erb | 10 + .../writing_seminar_setting.html.erb | 146 +++++++++++++ .../personal_seminar/config/routes.rb | 9 + 50 files changed, 1347 insertions(+), 29 deletions(-) create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_author_type_qe.html.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_list_author_type.html.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_list_paper_type.html.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/_paper_type_qe.html.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/author_type_quick_add.js.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/author_type_quick_edit.js.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/create_writing_book_setting.js.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/paper_type_quick_add.js.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/paper_type_quick_edit.js.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/update_writing_book_setting.js.erb create mode 100644 vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/writing_book_setting.html.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_author_type_qe.html.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_level_type_qe.html.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_author_type.html.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_level_type.html.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_paper_type.html.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_list_tag_type.html.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_paper_type_qe.html.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/author_type_quick_add.js.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/author_type_quick_edit.js.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/create_writing_journal_setting.js.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/level_type_quick_add.js.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/level_type_quick_edit.js.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/paper_type_quick_add.js.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/paper_type_quick_edit.js.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/update_writing_journal_setting.js.erb create mode 100644 vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/writing_journal_setting.html.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_author_type_qe.html.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_list_author_type.html.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_list_paper_type.html.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_paper_type_qe.html.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/author_type_quick_add.js.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/author_type_quick_edit.js.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/create_writing_seminar_setting.js.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/paper_type_quick_add.js.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/paper_type_quick_edit.js.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/update_writing_seminar_setting.js.erb create mode 100644 vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/writing_seminar_setting.html.erb diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index 964547c7..1c609d8c 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 02f4220a..ab49549d 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 4eab19d5..4fb020da 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 d02cb7d2..3e0dc5ea 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 00000000..efb32fef --- /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| %> + + +