Updated with loader

Conflicts:
	vendor/built_in_modules/ask/app/views/panel/ask/back_end/ask_acknowledgements/index.html.erb
	vendor/built_in_modules/ask/app/views/panel/ask/front_end/ask_questions/index.html.erb
This commit is contained in:
saurabhbhatia 2013-08-20 17:55:06 +08:00
parent c511aeb8de
commit 1ebda22f0e
5 changed files with 44 additions and 5 deletions

View File

@ -19,6 +19,7 @@ gem "acts_as_unvlogable"
gem 'youtube_it'
gem 'gotcha'
# gem "memcached", "~> 1.4.3"
# gem "memcache-client"

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -5,3 +5,4 @@
*= require_self
*= require social-share-button
*/

View File

@ -15,10 +15,6 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
@ask_question = AskQuestion.new(params[:ask_question])
if gotcha_valid? && @ask_question.save
@acknowledgement = AskAcknowledgement.last
respond_to do |format|
format.js
# format.js { render :thank_you, notice: 'Your question has been successfully sent.' }
end
@ask_acknowledgement = AskAcknowledgement.first || AskAcknowlegement.new
#@ask_question.save
redirect_to root_path
@ -27,6 +23,10 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id)
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

View File

@ -1,4 +1,34 @@
<link href='/assets/ask.css' rel='stylesheet' type='text/css' />
<style type="text/css">
.spinner {
position: fixed;
top: 50%;
left: 50%;
margin-left: -50px; /* half width of the spinner gif */
margin-top: -50px; /* half height of the spinner gif */
text-align:center;
z-index:1234;
overflow: auto;
width: 100px; /* width of the spinner gif */
height: 102px; /*hight of the spinner gif +2px to fix IE8 issue */
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$("#spinner").bind("ajaxSend", function() {
$(this).show();
}).bind("ajaxStop", function() {
$(this).hide();
}).bind("ajaxError", function() {
$(this).hide();
});
});
</script>
<div id="spinner" class="spinner" style="display:none;">
Sending Mail <%= image_tag 'loading.gif', :id => "img-spinner"%>
</div>
<div id="new-ask-question" class="ask-question">
<div id="acknowledgement"></div>
<%= form_for @ask_question, url: panel_ask_front_end_ask_questions_path(standalone: true), html: {class: 'form-horizontal'} do |f| %>
@ -62,11 +92,18 @@
</div>
<div class="form-actions">
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= f.submit t('submit'), class: 'btn btn-primary', :id => 'button-mail' %>
<%= f.button t('cancel'), type: 'reset', class: 'btn' %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#button-mail').click(function() {
$('#spinner').show();
});
});
</script>
<script type="text/javascript">
$(function() {
$('#new-ask-question .required').each(function() {