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