CKEditor.
Edition of page part for single language.
This commit is contained in:
1 parent
d971a8ecbe
commit
a8c4e17c56
664 files changed
+119327
-10
No files matched your search
@@ -22,8 +22,6 @@ class Admin::PagePartsController < ApplicationController
|
||||
|
||||
def edit
|
||||
@part = PagePart.find(params[:id])
|
||||
#@part.content = parse_content(@part.content, {:locale => 'show'})
|
||||
# @part = @part.i18n_variable
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -32,12 +30,16 @@ class Admin::PagePartsController < ApplicationController
|
||||
|
||||
def update
|
||||
@part = PagePart.find(params[:id])
|
||||
parse_content(@part.content, {:locale => 'destroy'})
|
||||
if @part.update_attributes(params[:page])
|
||||
@part.content = parse_content(@part.content, {:locale => 'create'})
|
||||
@part.save!
|
||||
flash[:notice] = t('admin.update_success_page')
|
||||
redirect_to admin_items_url( :parent_id => @part.page_id )
|
||||
if @part.update_attributes(params[:page_part])
|
||||
flash.now[:notice] = t('admin.update_success_content')
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_page_url( @part.page )
|
||||
}
|
||||
format.js {
|
||||
@item = @part.page
|
||||
}
|
||||
end
|
||||
else
|
||||
render :action => "edit"
|
||||
end
|
||||
|
||||
@@ -5,6 +5,7 @@ class PagePart
|
||||
|
||||
field :name
|
||||
field :content
|
||||
field :kind
|
||||
|
||||
belongs_to :page
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
$('#main').html("<%= escape_javascript(render(:partial => 'admin/links/show')) %>");
|
||||
$('#main').html("<%= escape_javascript(render(:partial => 'admin/links/show')) %>");
|
||||
history.pushState(null, document.title, "<%= escape_javascript(admin_link_url(@item)) %>");
|
||||
@@ -1 +1,10 @@
|
||||
<h1>EDIT</h1>
|
||||
<%= flash_messages %>
|
||||
|
||||
<%= form_for @part, :url => admin_page_part_path(@part), :html => { :class => 'form' } do |f| %>
|
||||
|
||||
<%= render :partial => "admin/page_parts/form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit t(:update) %> <%= link_back %>
|
||||
</p>
|
||||
<% end %>
|
||||
@@ -0,0 +1,3 @@
|
||||
<%= f.error_messages %>
|
||||
|
||||
<%= f.cktext_area :content, :toolbar=>'Custom', :width=>'700px', :height=>'200px' %>
|
||||
@@ -0,0 +1,2 @@
|
||||
$('#main').html("<%= escape_javascript(render(:partial => 'admin/pages/show' )) %>");
|
||||
history.pushState(null, document.title, "<%= escape_javascript(admin_page_url(@item)) %>");
|
||||
@@ -1,3 +1,5 @@
|
||||
<%= flash_messages %>
|
||||
|
||||
<%= parse_page_edit(@item).html_safe %>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<%= stylesheet_link_tag "easyprint", :media => "print" %>
|
||||
<%= javascript_include_tag "jquery", "jquery-ui", "rails", "easy", :cache => 'all' %>
|
||||
<%= javascript_include_tag "application", :cache => 'all' %>
|
||||
<%= javascript_include_tag :ckeditor %>
|
||||
<%= yield :page_specific_javascript %>
|
||||
<!--[if IE]>
|
||||
<%= stylesheet_link_tag "ie", :media => "screen, projection" %>
|
||||
|
||||
Reference in new issue
Block a user