fix page form bugs

This commit is contained in:
Matthew Fu 2011-12-23 13:54:28 +08:00
parent a9f06b9517
commit d3ca1647be
5 changed files with 6 additions and 5 deletions

View File

@ -6,7 +6,7 @@ $("#page_design_id").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes'); $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
}); });
$("#page_module_app").live('change', function() { $("#page_module_app_id").live('change', function() {
var app_id = $(this).val(); var app_id = $(this).val();
if(app_id!=''){ if(app_id!=''){
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_frontend_pages',function(data, textStatus){ $.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_frontend_pages',function(data, textStatus){
@ -16,6 +16,6 @@ $("#page_module_app").live('change', function() {
}); });
} }
else{ else{
$("#app_page_url").remove(); $("#app_page_url").children().remove();
} }
}); });

View File

@ -32,6 +32,7 @@ class Admin::PagesController < ApplicationController
@i18n_variable = @item.i18n_variable @i18n_variable = @item.i18n_variable
@designs = Design.all.entries @designs = Design.all.entries
@design = @item.design @design = @item.design
@app_frontend_urls = @item.module_app.app_pages
end end
def create def create

View File

@ -1,7 +1,7 @@
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
protect_from_forgery protect_from_forgery
include ParserFrontEnd include ParserFrontEnd,ParserBackEnd
helper :all helper :all
before_filter :set_locale, :set_site before_filter :set_locale, :set_site

View File

@ -1 +1 @@
<%= f.select :module_app, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %> <%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>

View File

@ -33,7 +33,7 @@
<p> <p>
<%= t('admin.module_app') %> <%= t('admin.module_app') %>
<%= render :partial => "admin/module_apps/app_selector", :locals => { :f => f } %> <%= render :partial => "admin/module_apps/app_selector", :locals => { :f => f } %>
<span id="app_page_url"></span> <span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls ) rescue ''%> </span>
</p> </p>
<p> <p>
<%= f.label :is_published, "#{t('admin.is_published')} ?" %> <%= f.label :is_published, "#{t('admin.is_published')} ?" %>