Fix mailing redirect
Conflicts: vendor/built_in_modules/ask/init.rb vendor/built_in_modules/ask_new/app/controllers/panel/ask/front_end/ask_questions_controller.rb vendor/built_in_modules/ask_new/app/views/panel/ask/front_end/ask_questions/thank_you.html.erb vendor/built_in_modules/ask_new/config/routes.rb
This commit is contained in:
parent
fde9fd7ffe
commit
33f256bd16
|
@ -0,0 +1,50 @@
|
||||||
|
module Ask
|
||||||
|
OrbitApp.registration "Ask",:type=> 'ModuleApp' do
|
||||||
|
module_label 'ask.ask'
|
||||||
|
base_url File.expand_path File.dirname(__FILE__)
|
||||||
|
# personal_plugin :enable => true,:path=>"panel/faq/plugin/profile",:i18n=>'admin.faq'
|
||||||
|
|
||||||
|
version "0.1"
|
||||||
|
organization "Rulingcom"
|
||||||
|
author "RD dep"
|
||||||
|
intro "I am intro"
|
||||||
|
update_info 'some update_info'
|
||||||
|
|
||||||
|
front_end do
|
||||||
|
app_page 'ask_questions' do
|
||||||
|
frontend_i18n 'ask.ask'
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
widgets do
|
||||||
|
default_widget do
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
side_bar do
|
||||||
|
head_label_i18n 'ask.ask', icon_class: 'icons-light-bulb'
|
||||||
|
available_for [:admin,:manager,:sub_manager]
|
||||||
|
active_for_controllers({ private: ['ask_questions'] })
|
||||||
|
head_link_path "panel_ask_back_end_ask_questions_path"
|
||||||
|
|
||||||
|
context_link 'categories', link_path: 'panel_ask_back_end_ask_categories_path',
|
||||||
|
priority: 1,
|
||||||
|
active_for_action: {:ask_categories=>:index},
|
||||||
|
available_for: [:all]
|
||||||
|
|
||||||
|
context_link 'ask.acknowledgement', link_path: 'panel_ask_back_end_ask_acknowledgements_path',
|
||||||
|
priority: 1,
|
||||||
|
available_for: [:all]
|
||||||
|
|
||||||
|
context_link 'ask.admin', link_path: 'panel_ask_back_end_ask_admins_path',
|
||||||
|
priority: 1,
|
||||||
|
available_for: [:all]
|
||||||
|
|
||||||
|
context_link 'ask.export', link_path: 'export_panel_ask_back_end_ask_questions_path',
|
||||||
|
priority: 1,
|
||||||
|
available_for: [:all]
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
|
@ -21,27 +21,26 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
|
||||||
AskMailer.notice(ask_admin, @ask_question).deliver
|
AskMailer.notice(ask_admin, @ask_question).deliver
|
||||||
Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id)
|
Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id)
|
||||||
end
|
end
|
||||||
|
# redirect_to panel_ask_front_end_thank_you_path
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
# format.js { render :thank_you, notice: 'Your question has been successfully sent.' }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def thank_you
|
||||||
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
|
if @item
|
||||||
|
if @item.frontend_data_count
|
||||||
|
@page_num = @item.frontend_data_count
|
||||||
else
|
else
|
||||||
# @captcha.error will explain what went wrong
|
@page_num = 15
|
||||||
flash[:notice] = "Please refill human verification"
|
|
||||||
render :action => 'index'
|
|
||||||
end
|
end
|
||||||
|
@frontend_style = @item.frontend_style
|
||||||
#respond_to do |format|
|
|
||||||
# format.js
|
|
||||||
#end
|
|
||||||
end
|
end
|
||||||
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
private
|
>>>>>>> a4fa967... Fix mailing redirect
|
||||||
def setup_negative_captcha
|
|
||||||
@captcha = NegativeCaptcha.new(
|
|
||||||
# A secret key entered in environment.rb. 'rake secret' will give you a good one.
|
|
||||||
secret: "8a056b337dcc34741626c0b2a14dc3a05794abc11a83407f1d8ed1a1c48afec01dcae1ec2f90348981564ee1d05a537253881cf86bf9644ec4695ab797317738",
|
|
||||||
spinner: request.remote_ip,
|
|
||||||
# Whatever fields are in your form
|
|
||||||
fields: [:name, :email, :content],
|
|
||||||
params: params
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
<% if @ask_question.errors.empty? %>
|
<% #if @ask_question.errors.empty? %>
|
||||||
$('html,body').scrollTop(0);
|
//$('html,body').scrollTop(0);
|
||||||
$('#acknowledgement')
|
//$('#acknowledgement')
|
||||||
.html('<%= j simple_format(@ask_acknowledgement.content) %>')
|
// .html('<%= j simple_format(@ask_acknowledgement.content) %>')
|
||||||
.fadeIn(600)
|
// .fadeIn(600)
|
||||||
.delay(3000)
|
// .delay(3000)
|
||||||
.fadeOut(600);
|
// .fadeOut(600);
|
||||||
<% else %>
|
<% #else %>
|
||||||
alert('<%= @ask_question.errors.full_messages.join('\n') %>');
|
//alert('<%= @ask_question.errors.full_messages.join('\n') %>');
|
||||||
Recaptcha.reload()
|
//Recaptcha.reload()
|
||||||
<% end %>
|
<% #end %>
|
||||||
|
window.location.href= "<%= panel_ask_front_end_thank_you_path %>"
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<link href='/assets/ask.css' rel='stylesheet' type='text/css' />
|
<link href='/assets/ask.css' rel='stylesheet' type='text/css' />
|
||||||
<div id="new-ask-question" class="ask-question">
|
<div id="new-ask-question" class="ask-question">
|
||||||
<div id="acknowledgement"></div>
|
<div id="acknowledgement"></div>
|
||||||
<%= form_for @ask_question, url: panel_ask_front_end_ask_questions_path(standalone: true), remote: true,
|
<%= form_for @ask_question, url: panel_ask_front_end_ask_questions_path(standalone: true), html: {class: 'form-horizontal'} do |f| %>
|
||||||
html: {class: 'form-horizontal'} do |f| %>
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<%= f.label :ask_category_id, class: 'control-label required' %>
|
<%= f.label :ask_category_id, class: 'control-label required' %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<h3>Thank you for your email, we will get back to you soon.</h3>
|
|
@ -18,6 +18,7 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :front_end do
|
namespace :front_end do
|
||||||
|
match "ask_questions/thank_you" => "ask_questions#thank_you", :as => 'thank_you'
|
||||||
resources :ask_questions
|
resources :ask_questions
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue