diff --git a/app/controllers/admin/page_contents_controller.rb b/app/controllers/admin/page_contents_controller.rb index 9c781b9..9842f5c 100644 --- a/app/controllers/admin/page_contents_controller.rb +++ b/app/controllers/admin/page_contents_controller.rb @@ -57,6 +57,13 @@ class Admin::PageContentsController < OrbitAdminController render :json => {"success" => true}.to_json end + def wiki_parent + parent_page_id = params[:id] + @wiki_parent_page = Page.where(:id => parent_page_id).first + @table_fields = ["page_content.id", :name,:version,:update_at,:last_modified, :category] + @categories = @module_app.categories.enabled.authorized(current_user).collect{|c| [c.title, c.id]} + end + private def update_params diff --git a/app/controllers/admin/wiki_pages_controller.rb b/app/controllers/admin/wiki_pages_controller.rb index 868a1f9..86f87cc 100644 --- a/app/controllers/admin/wiki_pages_controller.rb +++ b/app/controllers/admin/wiki_pages_controller.rb @@ -53,7 +53,7 @@ class Admin::WikiPagesController < OrbitAdminController def update wiki = WikiPage.find(params[:id]) wiki.update_attributes(wiki_page_params) - redirect_to admin_wiki_pages_path(:page_id => wiki.page.id) + redirect_to params['referer_url'] end private @@ -61,4 +61,4 @@ class Admin::WikiPagesController < OrbitAdminController def wiki_page_params params.require(:wiki_page).permit! end -end \ No newline at end of file +end diff --git a/app/views/admin/page_contents/wiki_parent.html.erb b/app/views/admin/page_contents/wiki_parent.html.erb new file mode 100644 index 0000000..13213e0 --- /dev/null +++ b/app/views/admin/page_contents/wiki_parent.html.erb @@ -0,0 +1,34 @@ +
<%= @wiki_parent_page.page_id%> | +
+ <%= @wiki_parent_page.name %>
+
+
+
+ |
+ <%= @wiki_parent_page.page_contexts.last.version rescue nil %> | +<%= format_value @wiki_parent_page.page_contexts.last.updated_at rescue nil %> | +<%= User.find(@wiki_parent_page.page_contexts.last.update_user_id).user_name rescue nil %> | ++ <% if can_edit_or_delete?(@wiki_parent_page) %> + <%= select_tag("category_id",options_for_select(@categories, (@wiki_parent_page.category_id.to_s rescue "")), prompt: t("select_category"), class: "category_select", style: "margin-bottom:0; width:150px;") %> + + <% end %> + | +