PagePart widgets for "system widget"

Delete useless code
This commit is contained in:
chris 2013-10-28 16:21:36 +08:00
parent 218cb03641
commit a14d69211b
46 changed files with 303 additions and 913 deletions

View File

@ -189,7 +189,7 @@ function pageSetting(id, edit) {
});
$pageCategoryGroup.show();
}
if(val.tag.length > 0) {
if(val.tags.length > 0) {
$.each(val.tags, function(index, val) {
var _arr = $.inArray($(this)[1], _selectData.module.tags[1]);
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
@ -371,6 +371,7 @@ $(function() {
$(this).children("option:selected").each(function () {
var _val = $(this).val();
$subSelete.empty();
$pageCount.empty();
if(_val) {
$.each(_data, function(index, val) {
if(_val == val.main[1]) {

View File

@ -42,6 +42,7 @@ $(function() {
$(this).children("option:selected").each(function () {
var _val = $(this).val();
$subSelete.empty();
$pageCount.empty();
if(_val) {
$.each(_data, function(index, val) {
if(_val == val.main[1]) {

View File

@ -441,7 +441,6 @@ legend {
font-size: 1.2em;
}
/* Edit link in structure */
.page_content {
width: 100%;
@ -511,6 +510,73 @@ legend {
color: #E47E6B;
}
/* Page Parts */
.page-parts {
background-color: #E7E7E7;
}
.page-parts body {
background-color: transparent;
}
.page-parts #main-wrap {
padding-top: 0;
}
.page-parts #main-wrap .wrap-inner {
padding: 30px 10px 10px;
}
.page-parts .main-forms {
text-align: center;
}
.page-parts .main-forms fieldset {
text-align: left;
}
.page-parts .main-forms > .btn-group {
margin-bottom: 20px;
}
.page-parts .display-mode td {
padding-bottom: 10px;
}
.page-parts .display-mode td i {
font-size: 2em;
}
.page-parts .radio.inline + .radio.inline,
.page-parts .checkbox.inline + .checkbox.inline {
margin-left: 0;
}
/* Show Preview */
#show_preview .modal {
width: 90%;
margin-left: -45%;
}
#show_preview .modal-body {
padding: 0;
max-height: none;
height: 100%;
overflow: hidden;
}
#show_preview iframe {
border: 0;
outline: none;
width: 100%;
height: 100%;
}
#show_preview form {
text-align: left;
margin-bottom: 0px;
}
#show_preview form .control-group {
margin-bottom: 0;
}
#show_preview form .pull-right + .pull-left {
margin-right: 10px;
}
#show_preview form .control-label {
width: 70px;
}
#show_preview form .controls {
margin-left: 80px;
}
/* tooltip */
#sideset .ui-tooltip.sidebar-tooltip {
color: #FFFFFF;
@ -690,6 +756,9 @@ legend {
width: auto;
margin-left: auto;
}
#show_preview .modal {
  margin-left: 0 auto;
}
}
@media (max-width: 480px) {

View File

@ -1,86 +1,44 @@
class Admin::PagePartsController < OrbitBackendController
include Admin::FrontendWidgetInterface
layout "structure"
before_filter :authenticate_user!
before_filter :is_admin?
before_filter :set_current_item
helper 'admin/items'
def show
@part = PagePart.find(params[:id])
respond_to do |format|
format.html {
render 'admin/items/index'
}
format.js {}
end
end
open_for_admin
def edit
# @part = PagePart.find(params[:id])
# @r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
# @tag_objects = @r_tag.classify.constantize.all rescue nil
# if @r_tag.eql?('tag_cloud')
# @tag_objects = ModuleApp.where(has_tag: true)
# else
# @tag_objects = @r_tag.classify.constantize.all rescue nil
# end
# @module_apps = ModuleApp.for_widget_select
# @categories = nil
# @tags = nil
# @page_frontend_data_counts = nil
# # @frontend_styles = nil
# @selected={
# :module_app=> @part.module_app ? @part.module_app : nil,
# :app_frontend_url=> @part.widget_path || "default_widget", #@module_apps.first
# :category=>nil, #fetch by method: get_categories_and_tags
# :tag=>nil, #fetch by method: get_categories_and_tags
# :page_frontend_data_count=>nil,
# :frontend_style => nil,
# :widget_path=> nil
# }
# @selected[:widget_path] = @part.widget_path ? @part.widget_path : (@selected[:module_app].widgets.keys[0] rescue nil)
# get_categories_and_tags
# get_frontend_data_count
# @app_frontend_urls = get_app_frontend_urls
# @no_orbit_bar = @side_bar = @no_header = true
@id = params[:id]
@part = PagePart.find(params[:id])
@module_apps = ModuleApp.for_widget_select
@module_app = @part.module_app
if @module_app
@module_app_categories = @module_app.categories
@module_app_tags = @module_app.tags
@widget_paths = ModuleApp.find(@module_app.id).widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
if @part.widget_path.present?
if @part.widget_path.eql?("default_widget")
@checked_style = @part.widget_style
@enabled_styles = @module_app.get_default_widget["enabled_styles"]
@widget_fields = @module_app.widget_fields.collect do |widget_field|
label = I18n.t("#{@module_app.key}.default_widget.#{widget_field[0]}")
[label, widget_field[0], class: widget_field[2]]
end
@class_options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
@partial = 'default_widget'
else
@frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil
@partial = 'custom_widget' if @frontend_styles.present?
@module_app = @part.module_app || @module_apps.first
@module_app_categories = @module_app.categories
@module_app_tags = @module_app.tags
@widget_paths = ModuleApp.find(@module_app.id).widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
if @part.widget_path.present?
if @part.widget_path.eql?("default_widget")
@checked_style = @part.widget_style
@enabled_styles = @module_app.get_default_widget["enabled_styles"]
@widget_fields = @module_app.widget_fields.collect do |widget_field|
label = I18n.t("#{@module_app.key}.default_widget.#{widget_field[0]}")
[label, widget_field[0], class: widget_field[2]]
end
@class_options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
@partial = 'default_widget'
else
@frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil
@partial = 'custom_widget' if @frontend_styles.present?
end
@data_count = @module_app.get_registration.get_data_count.to_a rescue []
end
@data_count = @module_app.get_registration.get_data_count.to_a rescue []
@no_orbit_bar = @side_bar = @no_header = true
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
@tag_objects = @r_tag.classify.constantize.all rescue nil
if @r_tag.eql?('tag_cloud')
@tag_objects = ModuleApp.where(has_tag: true)
else
@tag_objects = @r_tag.classify.constantize.all rescue nil
end
@html_class = "page-parts"
end
def get_page_setting_json
@ -103,7 +61,6 @@ class Admin::PagePartsController < OrbitBackendController
m = {}
m["main"] = [module_app.title, module_app.id.to_s]
m["sub"] = module_app.widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
m["sub"] << [I18n.t('default_widget.default_widget'),'default_widget'] if module_app.has_default_widget?
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
m["count"] = module_app.get_registration.get_data_count.to_a
@ -132,67 +89,51 @@ class Admin::PagePartsController < OrbitBackendController
end
end
def reload_widgets
@part = PagePart.find params[:id]
@selected={
:module_app=> ModuleApp.find(params["module_app_id"])
}
get_categories_and_tags
get_frontend_data_count
@selected[:app_frontend_url] = @selected[:module_app].has_default_widget? ? 'default_widget' : @selected[:module_app].widget_options.first.name
end
def reload_widget_styles
@part = PagePart.find(params[:id])
@selected={
:module_app=> ModuleApp.find(params["module_app_id"]),
:app_frontend_url=> params["frontend"], #@module_apps.first
:category=>nil, #fetch by method: get_categories_and_tags
:tag=>nil, #fetch by method: get_categories_and_tags
:page_frontend_data_count=>nil,
:frontend_style => nil,
:widget_path=> nil
}
get_categories_and_tags
get_frontend_data_count
end
def reload_widget_field
@index = params[:field_seri].to_i
@part = PagePart.find(params[:id])
@selected = {
:module_app=> ModuleApp.find(params["module_app_id"]),
:default_widget_field=>params[:widget_field_value]
}
end
def update
@part = PagePart.find(params[:id])
clean_tags_and_category_params
# params[:page_part][:widget_field].each{|t| t[2] = (t[2]=="true" ? true : false )} if !params[:page_part][:widget_field].blank?
if @part.update_attributes(params[:page_part])
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
flash.now[:notice] = t('update.success.content')
if @part.page.name == 'home'
expire_page '/'
else
expire_page page_path(@part.page.name)
end
respond_to do |format|
format.html {
redirect_to admin_page_url( @part.page )
}
format.js {
@item = @part.page
redirect_to admin_page_url(@part.page, edit: true)
}
end
else
@id = params[:id]
@module_apps = ModuleApp.for_widget_select
@module_app = @part.module_app || @module_apps.first
@module_app_categories = @module_app.categories
@module_app_tags = @module_app.tags
@widget_paths = ModuleApp.find(@module_app.id).widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
if @part.widget_path.present?
if @part.widget_path.eql?("default_widget")
@checked_style = @part.widget_style
@enabled_styles = @module_app.get_default_widget["enabled_styles"]
@widget_fields = @module_app.widget_fields.collect do |widget_field|
label = I18n.t("#{@module_app.key}.default_widget.#{widget_field[0]}")
[label, widget_field[0], class: widget_field[2]]
end
@class_options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
@partial = 'default_widget'
else
@frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil
@partial = 'custom_widget' if @frontend_styles.present?
end
end
@data_count = @module_app.get_registration.get_data_count.to_a rescue []
@no_orbit_bar = @side_bar = @no_header = true
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
@tag_objects = @r_tag.classify.constantize.all rescue nil
if @r_tag.eql?('tag_cloud')
@tag_objects = ModuleApp.where(has_tag: true)
else
@tag_objects = @r_tag.classify.constantize.all rescue nil
end
@html_class = "page-parts"
render :action => "edit"
end
end
@ -217,11 +158,6 @@ class Admin::PagePartsController < OrbitBackendController
end
protected
def get_app_frontend_urls
@selected[:module_app] ? @selected[:module_app].widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} : []
# has_old_value = @selected[:module_app].app_pages[@selected[:app_frontend_url]]
# @frontend_styles = has_old_value ? has_old_value["style"] : (@selected[:module_app].app_pages.first[1]["style"] rescue nil)
end
def set_children_sub_menu(part)
part.page.children.each do |child|

View File

@ -1,6 +1,4 @@
class Admin::PagesController < Admin::ItemsController
# helper Admin::PagePartsHelper
# include Admin::FrontendWidgetInterface
def show
@item = Page.find(params[:id])

View File

@ -1,35 +0,0 @@
module Admin::FrontendWidgetInterface
protected
def get_categories_and_tags
unless @selected[:module_app].nil?
@categories = @selected[:module_app].categories
@tags = @selected[:module_app].tags
end
end
def get_frontend_data_count
local_item = set_local_item
@page_frontend_data_counts = @selected[:module_app].get_registration.get_data_count rescue []
@selected[:page_frontend_data_count] = case local_item
when PagePart
local_item.widget_data_count
when Page
local_item.frontend_data_count
end
end
def set_local_item
local_item = @part
local_item = @item if local_item.nil? && @item
local_item
end
def select_array_for_app_frontend_urls(hash)
ary = hash.collect{|name,data| [I18n.t(data["i18n"]),name]}
ary << [I18n.t('default_widget.name'),'default_widget'] if @selected[:module_app] and @selected[:module_app].has_default_widget?
ary
end
end

View File

@ -1,138 +0,0 @@
module Admin::PagePartsHelper
include Admin::FrontendWidgetInterface
def support_link
url_method = @selected[:module_app].get_default_widget[:url_method]
unless url_method.nil?
res = "Link:"
res << select_tag( "page_part[widget_field_is_link][]", options_for_select([["NotLink",false],["Link1",url_method]]))
res.html_safe
end
end
def get_widget_field_rel
case set_local_item
when Page
reload_after_list_changed_admin_pages_path
when PagePart
reload_after_list_changed_admin_page_part_path
end
end
def link_to_field_switch( i ,object_name,field_name,local_item=nil,assign_field_name_value=nil) #link_to_field is for showing
field_is_checked = nil
local_item = case
when local_item.nil? && @part
@part
when local_item.nil? && @item
@item
end
field_is_checked = local_item.default_widget_field_sat_to_link?(i)
res = hidden_field_tag "#{object_name}[#{field_name}][][sat_to_link]", 'false'
unless field_is_checked.nil? and assign_field_name_value.nil?
origin_field = nil
origin_field = @selected[:module_app].widget_fields.select{|t| t.first.to_s==(assign_field_name_value || local_item.default_widget_field_name[i])}.first
if origin_field and origin_field[2]==:link #choosen_field_is_link
res = label_tag '' do
check_box_tag("#{object_name}[#{field_name}][][sat_to_link]", "true", field_is_checked) + I18n.t("default_widget.field_is_link")
end
else # choosen_field_not_link
return res
end # of if choosen_field_is_link
else
return res
end
end
def widget_field_options(i,local_item=nil)
local_item = set_local_item
options = @selected[:module_app].widget_fields.collect do |widget_field|
label = I18n.t("#{@selected[:module_app].key}.default_widget.#{widget_field[0]}")
[label, widget_field[0]]
end
case local_item
when Page
options_for_select(options, (local_item.frontend_field_name[i] if(local_item) ))
when PagePart
options_for_select(options, (local_item.widget_field_name[i] if(local_item) ))
end
end
def widget_field_class_options(i,local_item=nil)
options = LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}
local_item = set_local_item
case local_item
when Page
options_for_select(options, (local_item.frontend_class[i] if (local_item) ))
when PagePart
options_for_select(options, (local_item.widget_class[i] if (local_item) ))
end
end
def tag_checked_value(part,radio_value)
if radio_value.blank?
(part.nil? || part[:tag].blank?) ? true : false
else
part and (part[:tag].include?(radio_value.to_s)) ? true : false
end
end
def category_checked_value(part,radio_value)
if radio_value.blank?
(part.nil? || part[:category].blank?) ? true : false
else
part and (part[:category].include?(radio_value.to_s)) ? true : false
end
end
def style_checked_value(part,radio_value)
case part
when Page
if part.frontend_style.nil? && radio_value == "typeA"
true
else
(part.frontend_style == radio_value) ? true : false
end
when PagePart
if part.widget_style.nil? && radio_value == "typeA"
true
else
(part.widget_style == radio_value) ? true : false
end
when nil
false
end
end
def nil_checkbox_button(part,tag_or_cate)
field_name = set_field_name
content_tag :label,:class=>"radio inline" do
op = check_box_tag("#{field_name}[#{tag_or_cate}][]", 'nil' , eval("#{tag_or_cate}_checked_value(part,'')"),:class=>'select_all')
op << I18n.t("default_widget.no_value")
end
end
def nil_radio_button(part,tag_or_cate)
field_name = set_field_name
content_tag :label,:class=>"radio inline" do
op = radio_button(field_name, tag_or_cate, '' , :checked => eval("#{tag_or_cate}_checked_value(part,'')"))
op << I18n.t("default_widget.no_value")
end
end
def show_default_widget_setting_panel
@selected[:module_app] && @selected[:module_app].has_default_widget? && (@selected[:app_frontend_url]== 'default_widget')
end
def show_custom_widget_setting_panel
true
end
end

View File

@ -1,20 +0,0 @@
<div class="style_switch control-group">
<label class="control-label">
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls">
<% if @selected[:module_app].nil? || @selected[:module_app].widgets.nil? || (@selected[:module_app].widgets[@selected[:app_frontend_url]].blank? rescue true) || @selected[:module_app].widgets[@selected[:app_frontend_url]]["style"].nil? %>
<%= t("default_widget.no_support_setting")%>
<%else%>
<%= select('page_part', 'widget_style', @selected[:module_app].widgets[@selected[:app_frontend_url]]["style"]) %>
<% end %>
</div>
</div>
<% if(@selected[:module_app] && @selected[:module_app].widget_options(@selected[:app_frontend_url])) %>
<div class="style_switch control-group">
<label class="control-label"><%= t("default_widget.select_widget_ext_option") %></label>
<div class="controls well" >
<%= render :partial=> "widget_ext_options" %>
</div>
</div>
<% end %>

View File

@ -1,45 +0,0 @@
<% case object%>
<% when PagePart %>
<% object_name = 'page_part' %>
<% field_name = 'widget_field' %>
<% reload_rel = reload_after_widget_field_changed_admin_page_part_path %>
<% when Page %>
<% object_name = 'page' %>
<% field_name = 'frontend_field' %>
<% reload_rel = reload_after_widget_field_changed_admin_pages_path %>
<% end %>
<div class="style_switch control-group">
<label class="control-label">
<%= t("default_widget.fields_") %>
</label>
<div id="widget_field" class="clear controls">
<div class="rows clear">
<span class="span4">
<label for="widget_field"><%= t "default_widget.fields_order" %></label>
</span>
<span class="span3">
<label for="widget_field"><%= t "default_widget.fields_style" %></label>
</span>
<span class="span5"></span>
</div>
<% @selected[:module_app].widget_fields.each_with_index do |widget_field, i| %>
<div class="rows clear">
<span class="span4">
<%= i+1 %>
<%= select_tag "#{object_name}[#{field_name}][][field_name]", widget_field_options(i), :include_blank => true ,:class=>'widget_field_select',:field_seri => i ,:id=>"#{object_name}_#{field_name}_#{i}",:rel=>reload_rel%>
</span>
<span class="span3">
<%= select_tag "#{object_name}[#{field_name}][][class]", widget_field_class_options(i), :include_blank => true %> <br />
</span>
<span class="span5 link_switch_holder">
<%= link_to_field_switch(i,object_name,field_name) %>
</span>
</div><br/>
<% end %>
</div>
</div>

View File

@ -1,67 +0,0 @@
<% field_name='' %>
<% case object %>
<% when Page %>
<% field_name = "page[frontend_style]" %>
<% when PagePart %>
<% field_name = "page_part[widget_style]" %>
<% end %>
<div class="style_switch control-group">
<label class="control-label">
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls">
<ul class="clear">
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeA") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeA",style_checked_value(object,"typeA") %>
1
<span class="style_img"><%=image_tag 'module/default_widgets/style01.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeA") %></span>
</label>
</li>
<% end %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeB_style2") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeB_style2",style_checked_value(object,"typeB_style2") %>
2
<span class="style_img"><%=image_tag 'module/default_widgets/style02.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeB_style2") %></span>
</label>
</li>
<% end %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeB_style3") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeB_style3",style_checked_value(object,"typeB_style3") %>
3
<span class="style_img"><%=image_tag 'module/default_widgets/style03.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeB_style3") %></span>
</label>
</li>
<% end %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeB_style4") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeB_style4",style_checked_value(object,"typeB_style4") %>
4
<span class="style_img"><%=image_tag 'module/default_widgets/style04.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeB_style4") %></span>
</label>
</li>
<% end %>
<% if @selected[:module_app].get_default_widget["enabled_styles"].include?("typeC") %>
<li>
<label class="radio style_radio">
<%= radio_button_tag field_name,"typeC",style_checked_value(object,"typeC") %>
5
<span class="style_img"><%=image_tag 'module/default_widgets/style05.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeC") %></span>
</label>
</li>
<% end %>
</ul>
</div>
</div>

View File

@ -1,136 +0,0 @@
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/items/page_part" %>
<% end %>
<%= form_for @part, url: admin_page_part_path(@part), html: { class: "form-horizontal main-forms"} do |f| %>
<div class="btn-group" data-toggle="buttons-radio">
<label href="#none" class="btn btn-large" data-toggle="tab">
<%= t("page_part_kinds.none") %>
<%= f.radio_button :kind, "none", class: "hide" %>
</label>
<label href="#text" class="btn btn-large" data-toggle="tab">
<%= t("page_part_kinds.text") %>
<%= f.radio_button :kind, "text", class: "hide" %>
</label>
<label href="#public_r_tag" class="btn btn-large" data-toggle="tab">
<%= t("page_part_kinds.public_r_tag") %>
<%= f.radio_button :kind, "public_r_tag", class: "hide" %>
</label>
<label href="#module_widget" class="btn btn-large" data-toggle="tab">
<%= t("page_part_kinds.module_widget") %>
<%= f.radio_button :kind, "module_widget", class: "hide" %>
</label>
</div>
<fieldset>
<div class="input-area tab-content">
<div id="none" class="parts-none tab-pane fade in"><%= t(:select_one_function) %></div>
<div id="text" class="tab-pane fade in">
<div class="nav-name">
<strong><%= t(:language) %></strong>
</div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %>
</ul>
<div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= locale %> <%= 'active in' if i == 0 %>">
<div class="control-group input-content">
<label class="control-label muted"><%= t(:content) %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :content_translations do |f| %>
<%= f.text_area locale, class: "ckeditor input-block-level", value: (@part.content_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>
</div>
<div id="module_widget" class="tab-pane fade in">
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<div class="control-group input-content">
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}", class: "control-label muted" %>
<div class="controls">
<%= f.text_field locale, class: 'input-xlarge page_title', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale %>
</div>
</div>
<% end %>
<% end %>
<div class="control-group input-content">
<%= f.label :module_app_id, t(:module), class: "control-label muted" %>
<div class="controls">
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, selected: (@part.module_app_id rescue nil)), {}, {include_blank: true, class: "input-xlarge change"} %>
</div>
</div>
<div id="front_url" class="control-group input-content <%= 'hide' if @widget_paths.blank? %>">
<%= f.label :widget_path, t('front_page.display_mode'), class: "control-label muted" %>
<div class="controls">
<%= f.select :widget_path, @widget_paths, {}, selected: (@part.widget_path rescue nil), class: "input-xlarge change" %>
</div>
</div>
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_categories.blank? %>" id="page-category-groups">
<%= f.label :categories, t(:categories), class: "control-label muted" %>
<div class="controls">
<%= content_tag :label, class: "checkbox" do %>
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
<% end %>
<div class="groups" id="page-category">
<%= content_tag_for(:label, @module_app_categories, class: "checkbox") do |category|%>
<%= check_box_tag("page_part[tag][]", category.id, (@part.category.include?(category.id) rescue false) ) %>
<%= category.title %>
<% end if @module_app_tags %>
</div>
</div>
</div>
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_tags.blank? %>" id="page-tags-groups">
<%= f.label :tags, t(:tags), class: "control-label muted" %>
<div class="controls">
<%= content_tag :label, class: "checkbox" do %>
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
<% end %>
<div class="groups" id="page-tags">
<%= content_tag_for(:label, @module_app_tags, class: "checkbox") do |tag|%>
<%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id) rescue false) ) %>
<%= tag.name %>
<% end if @module_app_tags %>
</div>
</div>
</div>
<div class="display-mode">
<%= render @partial %>
</div>
<div class="control-group input-content <%= 'hide' if @module_app.blank? %>">
<%= f.label :widget_data_count, t(:widget_data_count), class: "control-label muted" %>
<div class="controls">
<%= f.select :widget_data_count, options_for_select(@data_count, @part.widget_data_count), {}, class: "input-mini", id: "page_count" %>
</div>
</div>
</div>
</div>
<div class="form-actions">
<%= f.submit t(:update_), class: "btn btn-primary" %>
<button type="button" class="btn" onclick="window.history.back()"><%= t(:cancel) %></button>
</div>
</fieldset>
<% end %>
<script>
$('.btn-group input[type="radio"]').each(function(index, el) {
if($(this).prop('checked')) {
$(this).closest('label').addClass('active');
$("#" + $(this).val()).addClass('active');
}
});
$('.btn-group').on(clickEvent, 'label', function(event) {
$(this).find('input').prop('checked', true);
event.preventDefault();
});
</script>

View File

@ -1,7 +0,0 @@
<%= raw(VALID_LOCALES.map{ |locale|
if @part_locale.to_s.eql?(locale)
t(:_locale, :locale => locale)
else
link_to t(:_locale, :locale => locale), edit_admin_page_part_path(@part, :part_locale => locale), :class => 'reload'
end
}.join(' | ')) %>

View File

@ -1,53 +0,0 @@
<div>
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<div class="control-group">
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}",:class=>"control-label" %>
<div class="controls">
<%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil),:size=>30 %>
</div>
</div>
<% end %>
<% end %>
</div>
<div id="module_app_list" class="control-group">
<label for="page_part[module_app]" class="control-label">
<%= t "default_widget.select_module_app" %>
</label>
<div class="controls">
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, :selected => (@selected[:module_app].id rescue nil)), {:include_blank => true }, {:rel => reload_after_module_changed_admin_page_part_path,:id=>"page_module_app_id"} %>
</div>
</div>
<div id="widget_list" class="control-group">
<label for="page_part[widget_path]" class="control-label">
<%= t "default_widget.select_widget_path" %>
</label>
<div class="controls">
<%#= @module_app ? @module_app.widgets.collect{|k,v| [I18n.t(v["i18n"]),k]} %>
<%= f.select :widget_path, @app_frontend_urls , {}, { :selected => @selected[:app_frontend_url], :rel => get_widget_field_rel } %>
</div>
</div>
<div id="widget_option">
<div id="widget_data_source_category" class="control-group">
<%= render :partial => 'widget_data_source_category' ,:locals=>{:object=>@part}%>
</div>
<div id="widget_data_source_tag" class="control-group">
<%= render :partial => 'widget_data_source_tag' ,:locals=>{:object=>@part} %>
</div>
</div>
<div id="widget_setting">
<%= render :partial => 'widget_setting' ,:locals=>{:f=>f,:object=>@part} %>
</div>
<div class="control-group" id='data_count'>
<%= render :partial=>'admin/pages/data_count_field',:locals=>{:field_name=>"page_part[widget_data_count]",:field_value=>@part.widget_data_count } %>
</div>

View File

@ -1,15 +0,0 @@
<span id='tag_list'>
<%= f.select :public_r_tag, LIST[:public_r_tags].collect{|tag| [t(tag), tag]}, {:selected => @r_tag}, {:rel => reload_r_tag_options_admin_page_part_path(@part)} %>
</span>
<span id='name_list'>
<% if @r_tag.eql?('sub_menu') %>
<%= f.hidden_field :public_r_tag_object_id, :value => @part.page.id %>
<%#= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %>
<% elsif @r_tag.eql?('sitemap') %>
<% elsif @r_tag.eql?('terms_of_use') %>
<% elsif @r_tag.eql?('breadcrumb') %>
<% else %>
<%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, :selected => @part.public_r_tag_object_id) %>
<% end %>
</span>

View File

@ -1,8 +0,0 @@
<div class="style_switch control-group">
<label class="control-label">
<%= t(label_i18n) %>
</label>
<div class="controls well">
<%= t('default_widget.no_support_setting') %>
</div>
</div>

View File

@ -1,8 +0,0 @@
<%= f.fields_for :content_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<div>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_area locale, :class => 'tinymce_textarea', :value => (@part.content_translations[locale] rescue nil) %>
</div>
<% end %>
<% end %>

View File

@ -1,20 +0,0 @@
<% case object %>
<% when Page %>
<% field_name = 'page' %>
<% when PagePart %>
<% field_name = 'page_part' %>
<% end %>
<label class="control-label"><%= t "default_widget.data_source.category" %></label>
<p>
<% if @categories %>
<%= nil_checkbox_button(object,:category) %>
<%= content_tag_for(:label, @categories,:class=>"radio") do |category|%>
<%= check_box_tag("#{field_name}[category][]", category.id, category_checked_value(object,category.id),:class=>'select_option' )%>
<%= category.title%>
<% end %>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% end %>
</p>

View File

@ -1,20 +0,0 @@
<% case object %>
<% when Page %>
<% field_name = 'page' %>
<% when PagePart %>
<% field_name = 'page_part' %>
<% end %>
<label class="control-label"><%= t "default_widget.data_source.tag" %></label>
<p>
<% if @categories %>
<%= nil_checkbox_button(object,:tag) %>
<%= content_tag_for(:label, @tags,:class=>"radio") do |tag|%>
<%= check_box_tag("#{field_name}[tag][]", tag.id, tag_checked_value(object,tag.id),:class=>'select_option' ) %>
<%= tag.name%>
<% end if @tags%>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% end %>
</p>

View File

@ -1,18 +0,0 @@
<% if (not(@selected[:module_app].widget_options(@selected[:app_frontend_url]).blank?) and @selected[:app_frontend_url]!='default_widget')%>
<% @selected[:module_app].widget_options(@selected[:app_frontend_url]).get_options.each do |key,settings| %>
<% options = settings[:opts] %>
<%= label_tag(t(settings[:label_i18n]))%>
<% case options%>
<% when Hash%>
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)) %>
<% else%>
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)) %>
<!-- (@part[:widget_field][i][0] if (@part && !@part[:widget_field].blank? && !@part[:widget_field][i].blank?)) ) -->
<% end %>
<% end %>
<% end %>

View File

@ -1,10 +0,0 @@
<% if show_default_widget_setting_panel %>
<div id="default_widget">
<%= render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:f=>f,:object=>object} %>
<%= render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>object} %>
</div>
<% elsif show_custom_widget_setting_panel %>
<div id="custom_widget">
<%= render :partial => 'admin/page_parts/custom_widget_setting',:locals=>{:object=>object} %>
</div>
<% end %>

View File

@ -1,2 +1,163 @@
<%= stylesheet_link_tag "lib/main-forms" %>
<%= render 'edit' %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %><% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/items/page_part" %>
<% end %>
<%= form_for @part, url: admin_page_part_path(@part), html: { class: "form-horizontal main-forms"} do |f| %>
<%= f.error_messages %>
<div class="btn-group" data-toggle="buttons-radio">
<label href="#none" class="btn btn-large" data-toggle="tab">
<%= t("page_part_kinds.none") %>
<%= f.radio_button :kind, "none", class: "hide" %>
</label>
<label href="#text" class="btn btn-large" data-toggle="tab">
<%= t("page_part_kinds.text") %>
<%= f.radio_button :kind, "text", class: "hide" %>
</label>
<label href="#public_r_tag" class="btn btn-large" data-toggle="tab">
<%= t("page_part_kinds.public_r_tag") %>
<%= f.radio_button :kind, "public_r_tag", class: "hide" %>
</label>
<label href="#module_widget" class="btn btn-large" data-toggle="tab">
<%= t("page_part_kinds.module_widget") %>
<%= f.radio_button :kind, "module_widget", class: "hide" %>
</label>
</div>
<fieldset>
<div class="input-area tab-content">
<div id="none" class="parts-none tab-pane fade in"><%= t(:select_one_function) %></div>
<div id="text" class="tab-pane fade in">
<div class="nav-name">
<strong><%= t(:language) %></strong>
</div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a href=".<%= locale %>" data-toggle="tab"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %>
</ul>
<div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= locale %> <%= 'active in' if i == 0 %>">
<div class="control-group input-content">
<label class="control-label muted"><%= t(:content) %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :content_translations do |f| %>
<%= f.text_area locale, class: "ckeditor input-block-level", value: (@part.content_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>
</div>
<div id="public_r_tag" class="tab-pane fade in">
<div class="control-group input-content">
<label class="control-label muted"><%= t("page_part_kinds.public_r_tag") %></label>
<div class="controls">
<span id='tag_list'>
<%= f.select :public_r_tag, LIST[:public_r_tags].collect{|tag| [t(tag), tag]}, {selected: @r_tag}, {rel: reload_r_tag_options_admin_page_part_path(@part), class: "input-xlarge"} %>
</span>
<span id='name_list'>
<% case @r_tag %>
<% when 'sub_menu' %>
<%= f.hidden_field :public_r_tag_object_id, :value => @part.page.id %>
<%#= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %>
<% when 'sitemap', 'terms_of_use', 'breadcrumb' %>
<% else %>
<%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, selected: @part.public_r_tag_object_id) %>
<% end %>
</span>
</div>
</div>
</div>
<div id="module_widget" class="tab-pane fade in">
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<div class="control-group input-content">
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}", class: "control-label muted" %>
<div class="controls">
<%= f.text_field locale, class: 'input-xlarge page_title', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale %>
</div>
</div>
<% end %>
<% end %>
<div class="control-group input-content">
<%= f.label :module_app_id, t(:module), class: "control-label muted" %>
<div class="controls">
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :module_name, selected: (@part.module_app_id rescue nil)), {}, {include_blank: true, class: "input-xlarge change"} %>
</div>
</div>
<div id="front_url" class="control-group input-content <%= 'hide' if @widget_paths.blank? %>">
<%= f.label :widget_path, t('front_page.display_mode'), class: "control-label muted" %>
<div class="controls">
<%= f.select :widget_path, @widget_paths, {}, selected: (@part.widget_path rescue nil), class: "input-xlarge change" %>
</div>
</div>
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_categories.blank? %>" id="page-category-groups">
<%= f.label :categories, t(:categories), class: "control-label muted" %>
<div class="controls">
<%= content_tag :label, class: "checkbox" do %>
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
<% end %>
<div class="groups" id="page-category">
<%= content_tag_for(:label, @module_app_categories, class: "checkbox inline") do |category|%>
<%= check_box_tag("page_part[tag][]", category.id, (@part.category.include?(category.id) rescue false) ) %>
<%= category.title %>
<% end if @module_app_tags %>
</div>
</div>
</div>
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_tags.blank? %>" id="page-tags-groups">
<%= f.label :tags, t(:tags), class: "control-label muted" %>
<div class="controls">
<%= content_tag :label, class: "checkbox" do %>
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
<% end %>
<div class="groups" id="page-tags">
<%= content_tag_for(:label, @module_app_tags, class: "checkbox inline") do |tag|%>
<%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id) rescue false) ) %>
<%= tag.name %>
<% end if @module_app_tags %>
</div>
</div>
</div>
<div class="display-mode">
<%= render @partial if @partial %>
</div>
<div class="control-group input-content <%= 'hide' if @module_app.blank? %>">
<%= f.label :widget_data_count, t(:widget_data_count), class: "control-label muted" %>
<div class="controls">
<%= f.select :widget_data_count, options_for_select(@data_count, @part.widget_data_count), {}, class: "input-mini", id: "page_count" %>
</div>
</div>
</div>
</div>
<div class="form-actions">
<%= f.submit t(:update_), class: "btn btn-primary" %>
<button type="button" class="btn" onclick="window.history.back()"><%= t(:cancel) %></button>
</div>
</fieldset>
<% end %>
<script>
$('.btn-group input[type="radio"]').each(function(index, el) {
if($(this).prop('checked')) {
$(this).closest('label').addClass('active');
$("#" + $(this).val()).addClass('active');
}
});
$('.btn-group').on(clickEvent, 'label', function(event) {
$(this).find('input').prop('checked', true);
event.preventDefault();
});
$("#public_r_tag").on("change", "#tag_list select", function() {
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + "&id=" + "<%= @part.id %>" );
});
</script>

View File

@ -1,44 +0,0 @@
$('#back_main').html("<%= j render(:partial => 'edit') %>");
tinymce.init({
// General options
mode: 'textareas',
theme: 'advanced',
file_browser_callback : 'myFileBrowser',
plugins : "autolink,lists,pagebreak,style,layer,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,fullscreen",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Skin options
skin : "o2k7",
skin_variant : "silver",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
// external_link_list_url : "js/link_list.js",
// external_image_list_url : "js/image_list.js",
// media_external_list_url : "js/media_list.js"
// Style formats
style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});

View File

@ -1 +0,0 @@
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page_part','widget_field',nil,@selected[:default_widget_field]) %>");

View File

@ -1,7 +0,0 @@
<% if show_default_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel',:locals=>{:object=>@part} %>");
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting',:locals=>{:object=>@part} %>");
<% elsif show_custom_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
<% end %>

View File

@ -1,20 +0,0 @@
<% if @selected[:module_app]%>
$('#widget_list select').html("<%= j options_for_select(@selected[:module_app].widgets.collect{|k,v| [I18n.t(v['i18n']),k]},@selected[:app_frontend_url]) %>");
$("#widget_data_source_category").html("<%= j render :partial => 'widget_data_source_category',:locals=>{:object=>@part} %>");
$("#widget_data_source_tag").html("<%= j render :partial => 'widget_data_source_tag',:locals=>{:object=>@part} %>");
$("#data_count").html("<%= j render :partial => 'admin/pages/data_count_field',:locals=>{:field_name=>'page_part[widget_data_count]',:field_value=>@part.widget_data_count } %>");
<% if @part %>
<% if show_default_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel',:locals=>{:object=>@part} %>");
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting',:locals=>{:object=>@part} %>");
<% elsif show_custom_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
<% end %>
<% end %>
<% else %>
$('#widget_option').find("div.well.controls").html("<%= t('default_widget.no_support_setting')%>");
$('#widget_setting').html("<%=j render :partial=> 'reset',:locals=>{:label_i18n=>'default_widget.select_widget_style'}%>");
$('#widget_list select').html("<%= j options_for_select([]) %>");
<% end %>
update_cates_and_tags();
rebind();

View File

@ -1,2 +0,0 @@
$('#back_main').html("<%= escape_javascript(render(:partial => 'admin/pages/show' )) %>");
history.pushState(null, document.title, "<%= escape_javascript(admin_page_url(@item)) %>");

View File

@ -1,12 +0,0 @@
<div class="control-group">
<label class="control-label">
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls well">
<% if @frontend_styles%>
<%= select('page', 'frontend_style', @frontend_styles,{:selected => @selected[:frontend_style]}) %>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% end %>
</div>
</div>

View File

@ -1,6 +0,0 @@
<label for="<%= field_name %>">
<%= t("default_widget.widget_data_count") %>
</label>
<div class="controls">
<%= select_tag(field_name, options_for_select(@page_frontend_data_counts||[],field_value), class: "input-xlarge") %>
</div>

View File

@ -1,10 +0,0 @@
<%= form_for @item, url: admin_page_path(@item), remote: true do |f| %>
<fieldset>
<legend><%= t('editing.page') %></legend>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:update_), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>

View File

@ -1,11 +0,0 @@
<% if (@module_app && @module_app.widget_fields) %>
<%= label_tag('frontend_field & frontend_field_type') %>
<% @module_app.widget_fields.each_with_index do |frontend_field, i| %>
<%= i+1 %>
<%= select_tag "page[frontend_field][]",widget_field_options(i,@item) , :include_blank => true %>
<%= select_tag "page[frontend_field_type][]", widget_field_class_options(i,@item), :include_blank => true %> <br />
<% end %>
<% end %>

View File

@ -1,9 +0,0 @@
<%= form_for @item, url: admin_pages_path, remote: true do |f| %>
<fieldset>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>

View File

@ -1 +0,0 @@
<%= parse_page_edit_noko(@item).html_safe %>

View File

@ -1,2 +0,0 @@
<option></option>
<%= options_from_collection_for_select(@themes, :id, :name) %>

View File

@ -1 +0,0 @@
<%= render 'edit' %>

View File

@ -1 +0,0 @@
$('.view-page .content').html("<%= j render 'edit' %>");

View File

@ -1 +0,0 @@
<%= render 'new' %>

View File

@ -1 +0,0 @@
$('.view-page .content').html("<%= j render 'new' %>");

View File

@ -1,6 +0,0 @@
<% if show_default_widget_setting_panel %>
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@item} %>");
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@item} %>");
<% else %>
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
<% end %>

View File

@ -1,30 +0,0 @@
<% if @selected[:module_app] %>
$('#app_page_category').html("<%= j render :partial => 'admin/page_parts/widget_data_source_category' ,:locals=>{:object=>@item}%>");
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@item} %>");
$("#data_count").html("<%= j render :partial => 'admin/pages/data_count_field',:locals=>{:field_name=>'page[frontend_data_count]',:field_value=>(@item.frontend_data_count rescue nil)} %>");
<% if !@selected[:module_app].app_pages.blank? or @selected[:module_app].has_default_widget? %>
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', options_for_select(@app_frontend_urls, @selected[:app_frontend_url]),{},{:rel => reload_after_list_changed_admin_pages_path}) %>");
<% else %>
$('#app_page_url').html("<div class='well'><%= t('default_widget.no_support_setting')%></div>");
<% end %>
<% if show_default_widget_setting_panel %>
$('#app_page_tag').html("<%= j render :partial => 'admin/page_parts/widget_data_source_tag',:locals=>{:object=>@item} %>");
$('#frontend_setting').html("<%= j render :partial => 'admin/page_parts/default_widget_style_panel',:locals=>{:object=>@item} %>");
$('#frontend_setting').append("<%= j render :partial => 'admin/page_parts/default_widget_setting',:locals=>{:object=>@item} %>");
<% else %>
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
<% end %>
<% else %>
$('#app_page_url').html("<%= t('default_widget.no_support_setting')%>");
$('#app_page_category').find("div.well.controls").html("<%= t('default_widget.no_support_setting')%>");
$('#app_page_tag').find("div.well.controls").html("<%= t('default_widget.no_support_setting')%>");
$('#app_page_url').html("<%= t('default_widget.no_support_setting')%>");
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
<% end %>
update_cates_and_tags();
rebind();

View File

@ -1 +0,0 @@
$('#page_theme_id').html("<%= escape_javascript(render :partial => 'admin/pages/themes_ddl') %>");

View File

@ -1 +0,0 @@
$("#<%= params[:dom_id] %>").parents(".rows").find(".link_switch_holder").html("<%= j link_to_field_switch(@index,'page','frontend_field',nil,@selected[:default_widget_field]) %>");

View File

@ -1 +1 @@
<%= render 'show' %>
<%= parse_page_edit_noko(@item).html_safe %>

View File

@ -1,10 +1,11 @@
<!DOCTYPE HTML>
<html>
<html class="<%= @html_class %>">
<head>
<title><%= @title || t('site.settings') || APP_CONFIG['orbit'] %></title>
<%= render 'layouts/meta' %>
<%= render 'layouts/google_font' %>
<%= stylesheet_link_tag "structure" %>
<%= yield :page_specific_css %>
<%= render 'layouts/ie_html5_fix' %>
<%= javascript_include_tag "structure" %>
<%= yield :page_specific_javascript %>

View File

@ -106,13 +106,6 @@ Orbit::Application.routes.draw do
collection do
get 'get_display_style'
get 'get_page_setting_json'
get 'reload_themes'
get 'reload_after_module_changed', :action=>'reload_frontend_pages'
get 'reload_after_list_changed',:action=> 'reload_front_end_setting'
get 'reload_after_widget_field_changed',:action=> 'reload_widget_field'
end
member do
get 'delete'
end
end
@ -157,9 +150,6 @@ Orbit::Application.routes.draw do
get 'get_page_setting_json'
end
member do
get 'reload_after_widget_field_changed',:action=>'reload_widget_field'
get 'reload_after_module_changed',:action=>'reload_widgets'
get 'reload_after_list_changed',:action=> 'reload_widget_styles'
get 'reload_r_tag_options'
end
end

View File

@ -34,7 +34,7 @@ module ParserFrontEnd
ret << "<div class='edit_link'>"
ret << "<a href='#{edit_admin_page_part_path(page_part['part_id'])}' class='backend_edit' title='#{part ? part.edit_title : ''}'>#{t(:edit)}</a>"
ret << '</div>'
ret << page_part.child.to_html rescue nil
ret << page_part.inner_html rescue nil
ret << '</div>'
fragment = Nokogiri::HTML::DocumentFragment.new(body, ret)
page_part.swap(fragment)