diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb
index a50a537d..dddc27a9 100644
--- a/lib/parsers/parser_back_end.rb
+++ b/lib/parsers/parser_back_end.rb
@@ -98,7 +98,8 @@ module ParserBackEnd
c.define_tag 'content' do |tag|
ret = ''
if (tag.attributes["main"] == "true" && !page.module_app.nil?)
- ret << "
"
diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb
index 6a1a88e4..2b9f3a4f 100644
--- a/lib/parsers/parser_front_end.rb
+++ b/lib/parsers/parser_front_end.rb
@@ -124,7 +124,8 @@ module ParserFrontEnd
if (tag.attributes["main"] == "true" && !page.module_app.nil?)
ret << "
"
+ # ret << "?inner=true'>
"
+ ret << "?inner=true&page_id=#{page.id}'>"
else
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil
case part.kind
diff --git a/vendor/built_in_modules/page_content/app/controllers/panel/page_content/back_end/page_contexts_controller.rb b/vendor/built_in_modules/page_content/app/controllers/panel/page_content/back_end/page_contexts_controller.rb
index b51e3559..efde60c8 100644
--- a/vendor/built_in_modules/page_content/app/controllers/panel/page_content/back_end/page_contexts_controller.rb
+++ b/vendor/built_in_modules/page_content/app/controllers/panel/page_content/back_end/page_contexts_controller.rb
@@ -1,14 +1,24 @@
class Panel::PageContent::BackEnd::PageContextsController < ApplicationController
- layout 'admin'
+ layout 'new_admin'
before_filter :authenticate_user!
before_filter :is_admin?
def index
- @page_contexts = PageContext.all
+ @page_contexts = PageContext.where(:archived => false).desc(:updated_at)
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @page_contexts }
+ end
+ end
+
+ def view
+
+ @page_contexts = PageContext.where("page_id" => params[:page_id]).desc(:updated_at)
respond_to do |format|
format.html # index.html.erb
@@ -68,10 +78,23 @@ class Panel::PageContent::BackEnd::PageContextsController < ApplicationControlle
def update
@page_context = PageContext.find(params[:id])
+ if ( @page_context.version > 0 )
+ @create_page_context = PageContext.new(:version => @page_context.version)
+ @create_page_context = @page_context.clone
+ @create_page_context.context = @page_context.context.clone
+ @create_page_context.archived = true
+ end
+
@page_context.update_user_id = current_user.id
+ @page_context.version = @page_context.version + 1
respond_to do |format|
if @page_context.update_attributes(params[:page_context])
+
+ if ( @page_context.version > 1 )
+ @create_page_context.save
+ end
+
format.html { redirect_to(panel_page_content_back_end_page_contexts_url, :notice => t('page_content.update_page_content_success')) }
format.js { render 'toggle_enable' }
format.xml { head :ok }
diff --git a/vendor/built_in_modules/page_content/app/controllers/panel/page_content/front_end/page_contexts_controller.rb b/vendor/built_in_modules/page_content/app/controllers/panel/page_content/front_end/page_contexts_controller.rb
new file mode 100644
index 00000000..8b750dcc
--- /dev/null
+++ b/vendor/built_in_modules/page_content/app/controllers/panel/page_content/front_end/page_contexts_controller.rb
@@ -0,0 +1,19 @@
+class Panel::PageContent::FrontEnd::PageContextsController < ObitWidgetController
+
+ def initialize
+ super
+ @app_title = NewBlog::MOUDLEAPP_TITLE
+ end
+
+ def index
+
+ # @page_context = PageContext.where("page_id" => params[:page_id], :archived => false)
+ @page_context = PageContext.first(conditions: { page_id: params[:page_id], :archived => false })
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @page_contexts }
+ end
+ end
+
+end
diff --git a/vendor/built_in_modules/page_content/app/models/page_context.rb b/vendor/built_in_modules/page_content/app/models/page_context.rb
index dcd8452a..5c096711 100644
--- a/vendor/built_in_modules/page_content/app/models/page_context.rb
+++ b/vendor/built_in_modules/page_content/app/models/page_context.rb
@@ -10,11 +10,10 @@ class PageContext
field :create_user_id
field :update_user_id
- field :version, :type => Integer , :default => 1
+ field :version, :type => Integer , :default => 0
- field :is_top, :type => Boolean, :default => false
- field :is_hot, :type => Boolean, :default => false
- field :is_hidden, :type => Boolean, :default => false
+ field :archived, :type => Boolean, :default => false
+ # field :current, :type => Boolean, :default => false
belongs_to :page
@@ -22,8 +21,4 @@ class PageContext
self.is_top
end
- def context
- @context ||= I18nVariable.first(:conditions => {:key => 'context', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
- end
-
end
\ No newline at end of file
diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb
index b7d48360..e5c7fc45 100644
--- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb
+++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb
@@ -20,17 +20,20 @@
<% end %>
-
-
- <% if page_context.is_top? %>
- <%= t(:top) %>
- <% end %>
- <% if page_context.is_hot? %>
- <%= t(:hot) %>
- <% end %>
- <% if page_context.is_hidden? %>
- <%= t(:hidden) %>
- <% end %>
- |
<%= page_context.page.i18n_variable[I18n.locale] %> |
- <%= page_context.version %> |
+ <%= link_to page_context.version, panel_page_content_back_end_view_path(page_context.page_id) %> |
<%= page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %> |
<%= User.find(page_context.create_user_id).name %> |
diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_view_page_context.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_view_page_context.html.erb
new file mode 100644
index 00000000..db23a280
--- /dev/null
+++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_view_page_context.html.erb
@@ -0,0 +1,10 @@
+
+ |
+ <%= view_page_context.page.i18n_variable[I18n.locale] %> |
+ <%= view_page_context.version %> |
+ <%= view_page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %> |
+ <%= User.find(view_page_context.create_user_id).name %> |
+
+ <%= link_to t('view_page_context.show'), panel_page_content_back_end_page_context_path(view_page_context) %>
+ |
+
diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb
index 17f4f771..a1566881 100644
--- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb
+++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb
@@ -21,7 +21,6 @@