new changes for forms and various other things
This commit is contained in:
parent
7b6aba492b
commit
64a8077e5b
|
@ -687,6 +687,18 @@ class Admin::SeminarsController < OrbitAdminController
|
||||||
redirect_to "/admin/seminars/#{params[:id]}/edit"
|
redirect_to "/admin/seminars/#{params[:id]}/edit"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def seminar_signup_success
|
||||||
|
@seminar = SeminarMain.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def seminar_signup_success_save
|
||||||
|
@seminar = SeminarMain.find(params[:id])
|
||||||
|
params.require(:seminar_main).permit!
|
||||||
|
@seminar.update_attributes(params[:seminar_main])
|
||||||
|
@seminar.save
|
||||||
|
redirect_to admin_seminars_path
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_seminar
|
def set_seminar
|
||||||
|
|
|
@ -486,19 +486,21 @@ class SeminarsController < ApplicationController
|
||||||
@seminar.save
|
@seminar.save
|
||||||
end
|
end
|
||||||
extra_text = "<br>#{I18n.t('seminar_signup.serial_number')}: #{@seminar_signup.display_serial_number}"
|
extra_text = "<br>#{I18n.t('seminar_signup.serial_number')}: #{@seminar_signup.display_serial_number}"
|
||||||
extra_text += render_to_string("seminars/signup_email_contents",:locals=>{:seminar=>@seminar,
|
# extra_text += render_to_string("seminars/signup_email_contents",:locals=>{:seminar=>@seminar, :seminar_signup=>@seminar_signup},:layout=>false)
|
||||||
:seminar_signup=>@seminar_signup},:layout=>false)
|
|
||||||
if params['seminar_signup']['status']=='C'
|
if params['seminar_signup']['status']=='C'
|
||||||
status_param = '&status='
|
status_param = '&status='
|
||||||
if(@seminar.seminar_email_sets.where(:field_name => "signup").first.is_confirmation)
|
if(@seminar.seminar_email_sets.where(:field_name => "signup").first.is_confirmation)
|
||||||
extra_text += "<br><div><a href='#{request.protocol + request.host_with_port + OrbitHelper.url_to_show(@seminar.to_param)}?method=confirm_email_page&token=#{@seminar_signup.token}&cid=#{@seminar_signup.id.to_s}'>" + t("seminar.click_here_to_confirm") + "</a></div>"
|
extra_text += "<br><div><a href='#{request.protocol + request.host_with_port + OrbitHelper.url_to_show(@seminar.to_param)}?method=confirm_email_page&token=#{@seminar_signup.token}&cid=#{@seminar_signup.id.to_s}'>" + t("seminar.click_here_to_confirm") + "</a></div>"
|
||||||
end
|
end
|
||||||
send_mail('submission',params[:seminar_signup][:email],params[:seminar_signup][:seminar_main_id],extra_text)
|
send_mail('signup',params[:seminar_signup][:email],params[:seminar_signup][:seminar_main_id],extra_text)
|
||||||
else
|
else
|
||||||
status_param = ''
|
status_param = ''
|
||||||
|
if(@seminar.seminar_email_sets.where(:field_name => "signup").first.is_confirmation)
|
||||||
|
extra_text += "<br><div><a href='#{request.protocol + request.host_with_port + OrbitHelper.url_to_show(@seminar.to_param)}?method=confirm_email_page&token=#{@seminar_signup.token}&cid=#{@seminar_signup.id.to_s}'>" + t("seminar.click_here_to_confirm") + "</a></div>"
|
||||||
|
end
|
||||||
send_mail('signup',params[:seminar_signup][:email],params[:seminar_signup][:seminar_main_id],extra_text)
|
send_mail('signup',params[:seminar_signup][:email],params[:seminar_signup][:seminar_main_id],extra_text)
|
||||||
end
|
end
|
||||||
redirect_to "#{params[:referer_url].to_s.chomp('/').gsub(/\/([^\/?#]+)(|[^\/]+)$/){|f| '/'+$1}}?method=signup_ok#{status_param}&serial_number=#{@seminar_signup.display_serial_number}"
|
redirect_to "#{params[:referer_url].to_s.chomp('/').gsub(/\/([^\/?#]+)(|[^\/]+)$/){|f| '/'+$1}}?method=signup_ok#{status_param}&serial_number=#{@seminar_signup.display_serial_number}&seminar=#{@seminar.uid}"
|
||||||
else
|
else
|
||||||
if has_counter
|
if has_counter
|
||||||
OrbitHelper::SharedMutex.synchronize do
|
OrbitHelper::SharedMutex.synchronize do
|
||||||
|
@ -520,7 +522,11 @@ class SeminarsController < ApplicationController
|
||||||
|
|
||||||
def signup_ok
|
def signup_ok
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
{"serial_number"=> params[:serial_number]}
|
msg = SeminarMain.where(:uid => params[:seminar]).first.signup_success
|
||||||
|
{
|
||||||
|
"serial_number"=> params[:serial_number],
|
||||||
|
"message" => msg
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_file_proc
|
def add_file_proc
|
||||||
|
@ -813,7 +819,7 @@ class SeminarsController < ApplicationController
|
||||||
seminar_signup = SeminarSignup.where(:status=>'C', :email=> params[:user_name], :seminar_main_id => params[:seminar_signup][:seminar_main_id]).first
|
seminar_signup = SeminarSignup.where(:status=>'C', :email=> params[:user_name], :seminar_main_id => params[:seminar_signup][:seminar_main_id]).first
|
||||||
if !seminar_signup.blank?
|
if !seminar_signup.blank?
|
||||||
token = seminar_signup.generate_token
|
token = seminar_signup.generate_token
|
||||||
extra_text = "<br><a href='#{request.protocol + request.host_with_port + params[:referer_url].to_s.chomp('/')}/?method=reset_password_page&token=#{token}&cid=#{seminar_signup.id.to_s}'>#{t("seminar_signup.click_on_link")}</a>"
|
extra_text = "<br><a href='#{request.protocol + request.host_with_port + params[:referer_url].to_s.chomp('/')}/?method=reset_password_page&token=#{token}&cid=#{seminar_signup.id.to_s}'>#{t("seminar.click_here_to_confirm")}</a>"
|
||||||
send_mail('reset_password', seminar_signup.email, @seminar.id.to_s, extra_text)
|
send_mail('reset_password', seminar_signup.email, @seminar.id.to_s, extra_text)
|
||||||
redirect_to "#{params[:referer_url].to_s.chomp('/')}/?method=reset_email", :notice => t('seminar_signup.reset_email_sent')
|
redirect_to "#{params[:referer_url].to_s.chomp('/')}/?method=reset_email", :notice => t('seminar_signup.reset_email_sent')
|
||||||
else
|
else
|
||||||
|
@ -836,7 +842,7 @@ class SeminarsController < ApplicationController
|
||||||
extra_text = "<p> #{params[:text]} </p>"
|
extra_text = "<p> #{params[:text]} </p>"
|
||||||
if params[:type] == "reset_password"
|
if params[:type] == "reset_password"
|
||||||
token = seminar_signup.generate_token
|
token = seminar_signup.generate_token
|
||||||
extra_text += "<br><a href='#{request.protocol + request.host_with_port + "/" + I18n.locale.to_s + "/seminar/" + @seminar.to_param}/?method=reset_password_page&token=#{token}&cid=#{seminar_signup.id.to_s}'>#{t("seminar_signup.click_on_link")}</a>"
|
extra_text += "<br><a href='#{request.protocol + request.host_with_port + "/" + I18n.locale.to_s + "/seminar/" + @seminar.to_param}/?method=reset_password_page&token=#{token}&cid=#{seminar_signup.id.to_s}'>#{t("seminar.click_here_to_confirm")}</a>"
|
||||||
end
|
end
|
||||||
send_mail(params[:type], seminar_signup.email, @seminar.id.to_s, extra_text)
|
send_mail(params[:type], seminar_signup.email, @seminar.id.to_s, extra_text)
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,6 +18,7 @@ class SeminarMain
|
||||||
field :title, as: :slug_title, type: String, localize: true
|
field :title, as: :slug_title, type: String, localize: true
|
||||||
field :speaker, localize: true
|
field :speaker, localize: true
|
||||||
field :content, localize: true
|
field :content, localize: true
|
||||||
|
field :signup_success, localize: true
|
||||||
field :act_place, localize: true
|
field :act_place, localize: true
|
||||||
field :enable_summary_choice, :type => Boolean, :default => false
|
field :enable_summary_choice, :type => Boolean, :default => false
|
||||||
field :summary_chioice_type, :type => String, :default => "checkbox"
|
field :summary_chioice_type, :type => String, :default => "checkbox"
|
||||||
|
|
|
@ -201,7 +201,7 @@
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
|
||||||
<%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.to_require) %>
|
<%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.markup == "file_field" ? false : rf.to_require) %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
<li><a href="<%= admin_seminar_item_contents_path(:seminar_main_id=>seminar.id.to_s) %>"><%= t('seminar.set_seminar_item_content') %></a></li>
|
<li><a href="<%= admin_seminar_item_contents_path(:seminar_main_id=>seminar.id.to_s) %>"><%= t('seminar.set_seminar_item_content') %></a></li>
|
||||||
<li><a href="/admin/seminars/<%=seminar.id.to_s%>/seminar_signup_field"><%= t('seminar.set_seminar_signup_field') %></a></li>
|
<li><a href="/admin/seminars/<%=seminar.id.to_s%>/seminar_signup_field"><%= t('seminar.set_seminar_signup_field') %></a></li>
|
||||||
<li><a href="/admin/seminars/<%=seminar.id.to_s%>/seminar_submission_field"><%= t('seminar.set_seminar_submission_field') %></a></li>
|
<li><a href="/admin/seminars/<%=seminar.id.to_s%>/seminar_submission_field"><%= t('seminar.set_seminar_submission_field') %></a></li>
|
||||||
|
<li><a href="/admin/seminars/<%=seminar.id.to_s%>/seminar_signup_success"><%= t('seminar.seminar_signup_success') %></a></li>
|
||||||
<li><a href="<%=reviewer_setting_admin_seminar_path(seminar.id)%>"><%= t('seminar.reviewer_setting') %></a></li>
|
<li><a href="<%=reviewer_setting_admin_seminar_path(seminar.id)%>"><%= t('seminar.reviewer_setting') %></a></li>
|
||||||
<li><a href="<%=template_setting_admin_seminar_path(seminar.id)%>"><%= t('seminar.template_setting') %></a></li>
|
<li><a href="<%=template_setting_admin_seminar_path(seminar.id)%>"><%= t('seminar.template_setting') %></a></li>
|
||||||
<li><a href="<%=sub_page_setting_admin_seminar_path(seminar.id)%>"><%= t('seminar.sub_page_setting') %></a></li>
|
<li><a href="<%=sub_page_setting_admin_seminar_path(seminar.id)%>"><%= t('seminar.sub_page_setting') %></a></li>
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
<% content_for :page_specific_css do %>
|
||||||
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||||
|
<%= stylesheet_link_tag "lib/main-list" %>
|
||||||
|
<% end %>
|
||||||
|
<% content_for :page_specific_javascript do %>
|
||||||
|
<%= javascript_include_tag "lib/module-area" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<h2><%= t('seminar.seminar') %></h2>
|
||||||
|
|
||||||
|
<%= form_for @seminar, url: "/admin/seminars/#{@seminar.id.to_s}/seminar_signup_success_save", html: {class: "form-horizontal main-forms"} do |f| %>
|
||||||
|
<fieldset>
|
||||||
|
|
||||||
|
<!-- Input Area -->
|
||||||
|
<div class="input-area">
|
||||||
|
|
||||||
|
<!-- Language Tabs -->
|
||||||
|
<div class="nav-name"><strong><%= t(:language) %></strong></div>
|
||||||
|
<ul class="nav nav-pills language-nav">
|
||||||
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
|
<li class="<%= 'active' if i == 0 %>">
|
||||||
|
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!-- Language -->
|
||||||
|
<div class="tab-content language-area">
|
||||||
|
|
||||||
|
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||||
|
|
||||||
|
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
|
||||||
|
|
||||||
|
<div class="control-group input-content">
|
||||||
|
<label class="control-label muted"><%= t('seminar.seminar_signup_success') %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<div class="textarea">
|
||||||
|
<%= f.fields_for :signup_success_translations do |f| %>
|
||||||
|
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@seminar.signup_success_translations[locale] rescue nil) %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Form Actions -->
|
||||||
|
<div class="form-actions">
|
||||||
|
<%= get_referer_url[:action] rescue "" %>
|
||||||
|
<%= f.submit t('submit'), class: 'btn btn-primary' %>
|
||||||
|
<input type="hidden" name="referer_url" value="<%= get_referer_url %>">
|
||||||
|
<%= link_to t('cancel'), admin_seminars_path, :class=>"btn" %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<% end %>
|
|
@ -1,4 +1,5 @@
|
||||||
<% email_set = SeminarMain.where(id:@data['seminar_id']).first.seminar_email_sets.select{|v| v.field_name == 'signup'} %>
|
<% email_set = SeminarMain.where(id:@data['seminar_id']).first.seminar_email_sets.select{|v| v.field_name == 'signup'} %>
|
||||||
|
<%= (@data['extra_text'] rescue "").to_s.html_safe %>
|
||||||
<% if email_set.length != 0 %>
|
<% if email_set.length != 0 %>
|
||||||
<% if !(email_set[0].content.nil?) %>
|
<% if !(email_set[0].content.nil?) %>
|
||||||
<%= email_set[0].content[@data['locale']].html_safe %>
|
<%= email_set[0].content[@data['locale']].html_safe %>
|
||||||
|
@ -6,4 +7,3 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= t('seminar.email_signup_content') %>
|
<%= t('seminar.email_signup_content') %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= (@data['extra_text'] rescue "").to_s.html_safe %>
|
|
|
@ -9,13 +9,13 @@
|
||||||
<% if (data['confirm'] == true) %>
|
<% if (data['confirm'] == true) %>
|
||||||
<%= t('seminar_signup.confirm_ok') %>
|
<%= t('seminar_signup.confirm_ok') %>
|
||||||
<br>
|
<br>
|
||||||
<a href="<%= url %>?method=con_login" class="btn btn-primary" style="display:inline;">
|
<a href="<%= url %>?method=con_login" class="btn btn-primary">
|
||||||
<%= t('seminar.click_to_contribute') %>
|
<%= t('seminar.click_to_contribute') %>
|
||||||
</a>
|
</a>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= t('seminar_signup.confirm_not_ok') %>
|
<%= t('seminar_signup.confirm_not_ok') %>
|
||||||
<br>
|
<br>
|
||||||
<a href="<%= url %>?method=show_data" class="btn btn-primary" style="display:inline;">
|
<a href="<%= url %>?method=show_data" class="btn btn-primary">
|
||||||
<%= t('seminar.back') %>
|
<%= t('seminar.back') %>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -340,7 +340,11 @@ alert("1ssss2");
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
$(".upload").on("change",function(){
|
||||||
|
let filenamedom = $(this).parent().parent().find(".filename");
|
||||||
|
let filenameA = $(this).val().split('\\');
|
||||||
|
filenamedom.text(filenameA[filenameA.length - 1]);
|
||||||
|
})
|
||||||
|
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<%= t('seminar_signup.success_message') %>
|
<%#= t('seminar_signup.success_message') %>
|
||||||
|
<%= data["message"].html_safe %>
|
||||||
<br>
|
<br>
|
||||||
<%=t('seminar_signup.serial_number') %>: <%=data["serial_number"] rescue ""%>
|
<%=t('seminar_signup.serial_number') %>: <%=data["serial_number"] rescue ""%>
|
||||||
<% if !params['status'].nil? %>
|
<% if !params['status'].nil? %>
|
||||||
|
|
|
@ -113,7 +113,7 @@ en:
|
||||||
send_email_text: Additional text to send
|
send_email_text: Additional text to send
|
||||||
send_email_button: Send email
|
send_email_button: Send email
|
||||||
predefined_text: Predifined email text
|
predefined_text: Predifined email text
|
||||||
click_here_to_confirm: Click this link to confirm
|
click_here_to_confirm: Please click this link / 請點選此連結
|
||||||
confirm_ok: Email confirmed
|
confirm_ok: Email confirmed
|
||||||
confirm_not_ok: Email cannot be confirmed
|
confirm_not_ok: Email cannot be confirmed
|
||||||
validator: Validator
|
validator: Validator
|
||||||
|
@ -172,6 +172,7 @@ en:
|
||||||
sign_up_is_full: "Sign up is FULL!"
|
sign_up_is_full: "Sign up is FULL!"
|
||||||
sign_up_failed: "Sign up failed!"
|
sign_up_failed: "Sign up failed!"
|
||||||
contribute_file_count: Count of Contribute Files #投稿檔案數
|
contribute_file_count: Count of Contribute Files #投稿檔案數
|
||||||
|
seminar_signup_success: Signup Success Message
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
seminar: Semianr #研討會前台
|
seminar: Semianr #研討會前台
|
||||||
|
|
|
@ -110,7 +110,7 @@ zh_tw:
|
||||||
email_special_reminder_content: 特殊通知
|
email_special_reminder_content: 特殊通知
|
||||||
email_special_reminder_success: 特殊通知
|
email_special_reminder_success: 特殊通知
|
||||||
is_confirmation: 認證Email
|
is_confirmation: 認證Email
|
||||||
click_here_to_confirm: 點選此確認連結
|
click_here_to_confirm: Please click this link / 請點選此連結
|
||||||
confirm_ok: Email已認證
|
confirm_ok: Email已認證
|
||||||
confirm_not_ok: Email未認證
|
confirm_not_ok: Email未認證
|
||||||
select_email_type: 選擇Email種類
|
select_email_type: 選擇Email種類
|
||||||
|
@ -173,6 +173,7 @@ zh_tw:
|
||||||
sign_up_is_full: "報名已額滿!"
|
sign_up_is_full: "報名已額滿!"
|
||||||
sign_up_failed: "報名失敗"
|
sign_up_failed: "報名失敗"
|
||||||
contribute_file_count: 投稿檔案數
|
contribute_file_count: 投稿檔案數
|
||||||
|
seminar_signup_success: Signup Success Message
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
seminar: 研討會前台
|
seminar: 研討會前台
|
||||||
|
|
|
@ -64,6 +64,8 @@ Rails.application.routes.draw do
|
||||||
get 'seminar_signup'
|
get 'seminar_signup'
|
||||||
get 'seminar_item_content'
|
get 'seminar_item_content'
|
||||||
get 'seminar_signup_field'
|
get 'seminar_signup_field'
|
||||||
|
get 'seminar_signup_success'
|
||||||
|
patch 'seminar_signup_success_save'
|
||||||
get 'seminar_submission_field'
|
get 'seminar_submission_field'
|
||||||
get 'seminar_signup_admin_setting'
|
get 'seminar_signup_admin_setting'
|
||||||
post 'update_seminar_signup_admin_setting'
|
post 'update_seminar_signup_admin_setting'
|
||||||
|
|
Loading…
Reference in New Issue