diff --git a/app/controllers/admin/plugins_controller.rb b/app/controllers/admin/plugins_controller.rb index cbc933ed..15ed630e 100644 --- a/app/controllers/admin/plugins_controller.rb +++ b/app/controllers/admin/plugins_controller.rb @@ -4,7 +4,7 @@ class Admin::PluginsController < ApplicationController def index - @module_apps = ModuleApp.excludes(widgets: nil).where(has_plugin: true).order_by(:title, :asc) + @plugins = ModuleApp.where(has_plugin: true).order_by(:title, :asc) end diff --git a/app/helpers/admin/plugin_helper.rb b/app/helpers/admin/plugin_helper.rb new file mode 100644 index 00000000..3afa9d1f --- /dev/null +++ b/app/helpers/admin/plugin_helper.rb @@ -0,0 +1,30 @@ +module Admin::PluginHelper + + def render_plugin_list + ret = '' + + ret << "
" + ret << "
" + ret << "
" + ret << "
" + ret << "
" + + ret << "
    " + + @plugins.each do |plugin| + ret << "
  • " + ret << (link_to eval("#{plugin.title}") , eval("panel_#{plugin.title}_back_end_#{plugin.object}s_path")) + ret << "
  • " + end + + ret << "
" + + ret << "
" + ret << "
" + ret << "
" + + ret.html_safe + + end + +end diff --git a/app/views/admin/plugins/_plugin.html.erb b/app/views/admin/plugins/_plugin.html.erb deleted file mode 100644 index b2f11ce1..00000000 --- a/app/views/admin/plugins/_plugin.html.erb +++ /dev/null @@ -1,27 +0,0 @@ - -
-
-
-
- -
-
\ No newline at end of file diff --git a/app/views/admin/plugins/index.html.erb b/app/views/admin/plugins/index.html.erb index c4de7068..a4233864 100644 --- a/app/views/admin/plugins/index.html.erb +++ b/app/views/admin/plugins/index.html.erb @@ -1,4 +1,2 @@ - \ No newline at end of file +<%= render_plugin_list %> \ No newline at end of file diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index cc6daf73..112e2845 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -157,6 +157,41 @@ <% end -%> +<%= content_tag :li, :class => (active_for_controllers('researchs', '/panel/personal_research/back_end/tags', 'research_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-personal_research') + t('admin.personal_research'), panel_personal_research_back_end_researchs_path %> + <%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('researchs', '/panel/personal_research/back_end/tags', 'research_categorys', 'approvals'))) do -%> + <%= content_tag :li, link_to(t('personal_research.all_articles'), panel_personal_research_back_end_researchs_path), :class => active_for_action('researchs', 'index') %> + <%#= content_tag :li, link_to(t('personal_research.setting'), panel_personal_research_back_end_research_setting_path), :class => active_for_action('research_setting', 'index') %> + <%= content_tag :li, link_to(t('personal_research.tags'), panel_personal_research_back_end_tags_path), :class => active_for_action('/panel/personal_research/back_end/tags', 'index') %> + + <% end -%> + +<% end -%> + +<%= content_tag :li, :class => (active_for_controllers('projects', '/panel/personal_project/back_end/tags', 'project_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-personal_project') + t('admin.personal_project'), panel_personal_project_back_end_projects_path %> + <%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('projects', '/panel/personal_project/back_end/tags', 'project_categorys', 'approvals'))) do -%> + <%= content_tag :li, link_to(t('personal_project.all_articles'), panel_personal_project_back_end_projects_path), :class => active_for_action('projects', 'index') %> + <%= content_tag :li, link_to(t('personal_project.setting'), panel_personal_project_back_end_project_setting_path), :class => active_for_action('project_setting', 'index') %> + <%= content_tag :li, link_to(t('personal_project.project_category'), panel_personal_project_back_end_project_categorys_path), :class => active_for_action('project_categorys', 'index') %> + <%= content_tag :li, link_to(t('personal_project.tags'), panel_personal_project_back_end_tags_path), :class => active_for_action('/panel/personal_project/back_end/tags', 'index') %> + + <% end -%> + +<% end -%> + +<%= content_tag :li, :class => (active_for_controllers('writing_patents', '/panel/personal_patent/back_end/tags', 'writing_patent_categorys', 'approvals') || active_for_app_auth('PersonalJournal') ) do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-personal_patent') + t('admin.personal_patent'), panel_personal_patent_back_end_writing_patents_path %> + <%= content_tag :ul, :class => ("nav nav-list " + (visible_for_controllers('writing_patents', '/panel/personal_patent/back_end/tags', 'writing_patent_categorys', 'approvals'))) do -%> + <%= content_tag :li, link_to(t('personal_patent.all_articles'), panel_personal_patent_back_end_writing_patents_path), :class => active_for_action('writing_patents', 'index') %> + <%= content_tag :li, link_to(t('personal_patent.setting'), panel_personal_patent_back_end_writing_patent_setting_path), :class => active_for_action('writing_patent_setting', 'index') %> + <%#= content_tag :li, link_to(t('personal_patent.writing_patent_category'), panel_personal_patent_back_end_writing_patent_categorys_path), :class => active_for_action('writing_patent_categorys', 'index') %> + <%= content_tag :li, link_to(t('personal_patent.tags'), panel_personal_patent_back_end_tags_path), :class => active_for_action('/panel/personal_patent/back_end/tags', 'index') %> + + <% end -%> + +<% end -%> +
<% flash.each do |key, msg| %> <%= content_tag :span, msg, :class => [key, "notice label label-warning"] %> diff --git a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/plugin/writing_books_controller.rb b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/plugin/writing_books_controller.rb index 4d844181..583b4897 100644 --- a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/plugin/writing_books_controller.rb +++ b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/plugin/writing_books_controller.rb @@ -1,8 +1,11 @@ class Panel::PersonalBook::Plugin::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 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 index 7504e9f0..b3d1af71 100644 --- 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 @@ -2,10 +2,10 @@ <%= list_author_type.title %> - + - 蝺刻摩 + <%= t('edit')%> <%= 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" %> + polymorphic_path([:panel, :personal_book, :back_end, list_author_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> \ 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 index 744a6bcd..cf46e61a 100644 --- 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 @@ -2,10 +2,10 @@ <%= list_paper_type.title %> - + - 蝺刻摩 + <%= t('edit')%> <%= 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" %> + polymorphic_path([:panel, :personal_book, :back_end, list_paper_type]), :confirm => t('announcement.sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %> \ No newline at end of file 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 7caca3fe..a505b031 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 @@ -50,7 +50,7 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC def writing_journal_setting - @module_apps = ModuleApp.where(has_plugin: true).order_by(:title, :asc) + @plugins = ModuleApp.where(has_plugin: true).order_by(:title, :asc) @level_types = JournalLevelType.all @author_types = JournalAuthorType.all diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/plugin/writing_journals_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/plugin/writing_journals_controller.rb index 788fb513..133fb480 100644 --- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/plugin/writing_journals_controller.rb +++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/plugin/writing_journals_controller.rb @@ -1,8 +1,11 @@ class Panel::PersonalJournal::Plugin::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 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 index a1f66d51..b609538d 100644 --- 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 @@ -2,23 +2,33 @@ <%= form_for(@set_author_type, :remote => true, :url => @author_type_url ) do |f| %> -