<%= @seminar.title %>
+<%= t('seminar_signup.forgot_password') %>
++ "> + + + <% end %> +
+
diff --git a/app/controllers/admin/seminar_signups_controller.rb b/app/controllers/admin/seminar_signups_controller.rb
index c6a2e14..7e80fde 100644
--- a/app/controllers/admin/seminar_signups_controller.rb
+++ b/app/controllers/admin/seminar_signups_controller.rb
@@ -24,12 +24,12 @@ class Admin::SeminarSignupsController < OrbitAdminController
@seminar_signup = SeminarSignup.find(params[:id])
@seminar = SeminarMain.find(@seminar_signup.seminar_main_id)
- @form_index = 0
+ @form_index = 0
end
def update
-
+
@seminar_signup = SeminarSignup.find(params[:id])
@seminar_signup.update_attributes(seminar_signup_params)
@@ -63,6 +63,15 @@ class Admin::SeminarSignupsController < OrbitAdminController
redirect_to "/admin/seminars/#{@seminar_main_id}/seminar_signup"
end
+ def get_predefined_text
+ seminar = SeminarMain.find(params[:seminar_id])
+ text = seminar.seminar_email_sets.where(:field_name => params[:type]).first.content[I18n.locale]
+ render :json => {
+ "success" => true,
+ "html" => text
+ }
+ end
+
private
def seminar_signup_params
diff --git a/app/controllers/admin/seminars_controller.rb b/app/controllers/admin/seminars_controller.rb
index 5c2216b..d00a22e 100644
--- a/app/controllers/admin/seminars_controller.rb
+++ b/app/controllers/admin/seminars_controller.rb
@@ -90,7 +90,7 @@ class Admin::SeminarsController < OrbitAdminController
# exceptions = ["personal_book","personal_conference","personal_diploma","personal_experience","personal_journal","personal_lab","personal_patent","personal_project","personal_research"]
exceptions = []
@modules = ModuleApp.where(:key.nin => exceptions).frontend_enabled.order_by(:key=>'asc')
- @searchfilter = @modules.collect{|m|[t('module_name.'+m.key),m.key]}
+ @searchfilter = @modules.collect{|m|[t('module_name.'+m.key),m.key]}
end
def reviewer_setting
@seminar_reviews = @seminar.seminar_reviews
@@ -296,7 +296,7 @@ class Admin::SeminarsController < OrbitAdminController
end
elsif params[:mode] == "hide"
if seminar_main.session_show_ids.nil?
- seminar_main.session_show_ids = (0...seminar_main.summary_chioices.count).to_a[0..1]
+ seminar_main.session_show_ids = (0...seminar_main.summary_chioices.count).to_a[0..1]
end
seminar_main.session_show_ids.delete(session_id)
elsif params[:mode] == "show"
@@ -356,13 +356,13 @@ class Admin::SeminarsController < OrbitAdminController
@filter_fields = filter_fields(@categories)
@table_fields = [:category, 'seminar.title', 'seminar.event_during', 'seminar.signup_during', 'seminar.signup_count', 'seminar.export']
- if !params[:sort].blank?
+ if !params[:sort].blank?
if params[:sort] == 'event_during'
- sort = {:seminar_start_date.to_sym=>params[:order]}
+ sort = {:seminar_start_date.to_sym=>params[:order]}
elsif params[:sort] == 'signup_during'
- sort = {:signup_start_date.to_sym=>params[:order]}
+ sort = {:signup_start_date.to_sym=>params[:order]}
else
- sort = {params[:sort].to_sym=>params[:order]}
+ sort = {params[:sort].to_sym=>params[:order]}
end
else
sort = {:signup_start_date=>"desc",:created_at=>"desc"}
@@ -432,7 +432,7 @@ class Admin::SeminarsController < OrbitAdminController
end
def create
-
+
if !seminar_params['seminar_links_attributes'].nil?
seminar_params['seminar_links_attributes'].each do |idx,link|
seminar_params['seminar_links_attributes'].delete(idx.to_s) if link['url'].blank?
@@ -494,7 +494,7 @@ class Admin::SeminarsController < OrbitAdminController
def update
@seminar_params = seminar_params rescue {}
if @seminar_params.count != 0
- @seminar_params[:registration_status] = (@seminar_params[:registration_status] ? @seminar_params[:registration_status] : [])
+ @seminar_params[:registration_status] = (@seminar_params[:registration_status] ? @seminar_params[:registration_status] : [])
uid = params[:id].split('-').last
@seminar = SeminarMain.find_by(:uid=>uid)
if @seminar_params.has_key?("title_translations")
@@ -545,7 +545,7 @@ class Admin::SeminarsController < OrbitAdminController
seminar_params['seminar_links_attributes'].delete(idx.to_s) if link['url'].blank?
end
end
-
+
@seminar.update_user_id = current_user.id
if @seminar.update_attributes(seminar_params)
@seminar.update_enable_recaptcha
@@ -559,7 +559,7 @@ class Admin::SeminarsController < OrbitAdminController
end
redirect_to admin_seminars_path
end
-
+
def set_write_off
@seminar.donation_write_off_status = true
@@ -578,14 +578,14 @@ class Admin::SeminarsController < OrbitAdminController
def seminar_signup_field
@field_name = 'seminar_main'
- @attribute = SeminarMain.find(params[:id])
+ @attribute = SeminarMain.find(params[:id])
@attribute_type = 'seminar'
@class = 'seminars'
end
def seminar_submission_field
@field_name = 'seminar_main'
- @attribute = SeminarMain.find(params[:id])
+ @attribute = SeminarMain.find(params[:id])
@attribute_type = 'seminar'
@class = 'seminars'
end
@@ -672,7 +672,7 @@ class Admin::SeminarsController < OrbitAdminController
end
def delete_seminar_signup
-
+
@seminar_signup = SeminarSignup.find(params[:id])
@seminar_id = @seminar_signup.seminar_main_id
@@ -682,6 +682,11 @@ class Admin::SeminarsController < OrbitAdminController
redirect_to "/admin/seminars/@seminar_id.to_s/seminar_signup"
end
+ def create_email_set
+ SeminarEmailSet.create_new_fields(params[:id])
+ redirect_to "/admin/seminars/#{params[:id]}/edit"
+ end
+
private
def set_seminar
@@ -758,7 +763,7 @@ class Admin::SeminarsController < OrbitAdminController
end
end
@email_set = []
- ['signup','submission','add_file','edit_file'].each do |field_name|
+ ['signup','submission','add_file','edit_file', 'reset_password', "special_reminder"].each do |field_name|
email_set = @seminar.seminar_email_sets.select{|v| v.field_name==field_name}
if email_set.length==0
title = Hash.new
diff --git a/app/controllers/seminars_controller.rb b/app/controllers/seminars_controller.rb
index 50bae30..7b4c933 100644
--- a/app/controllers/seminars_controller.rb
+++ b/app/controllers/seminars_controller.rb
@@ -3,18 +3,18 @@ class SeminarsController < ApplicationController
include MemberHelper
include ActionView::Context #vary important (only add this can access @@session from view)
include Admin::SeminarsHelper
- FrontendMethods = ["show_privacy", "show_data", "check_email", "check_availability", "signup_ok", "add_file", "edit_file", "con_login", "con_upload", "con_logout"]
+ FrontendMethods = ["show_privacy", "show_data", "check_email", "check_availability", "signup_ok", "add_file", "edit_file", "con_login", "con_upload", "con_logout","confirm_email_page","reset_password_page"]
# include SimpleCaptcha::ControllerHelpers
def index
time_now = Time.now
-
+
seminars = SeminarMain.all.desc(:seminar_start_date).filter_by_categories
{
"seminars" => seminars,
'time_now' => time_now,
"total_pages" => seminars.total_pages
- }
+ }
end
def widget
@@ -85,7 +85,7 @@ class SeminarsController < ApplicationController
prefix_url = OrbitHelper.request.path.split("-").first + "-#{params[:uid]}"
@prefix_url = prefix_url
@registration_postfix = "/home/registration"
- header_data = "Home | " +
+ header_data = "Home | " +
"Main Site"
content_style = seminar_template_setting.content_style
background_style = seminar_template_setting.background_style
@@ -392,7 +392,7 @@ class SeminarsController < ApplicationController
params = OrbitHelper.params
- if !params[:email].blank?
+ if !params[:email].blank?
count = SeminarSignup.where(:email => params[:email], :seminar_main_id => params[:no]).count
result = count > 0 ? t('seminar.already_used') : t('seminar.available')
@@ -490,6 +490,9 @@ class SeminarsController < ApplicationController
:seminar_signup=>@seminar_signup},:layout=>false)
if params['seminar_signup']['status']=='C'
status_param = '&status='
+ if(@seminar.seminar_email_sets.where(:field_name => "signup").first.is_confirmation)
+ extra_text += "
#{params[:text]}
" + if params[:type] == "reset_password" + token = seminar_signup.generate_token + extra_text += "+
+ <%= t('seminar.is_confirmation') %> + | ++ + <%= check_box_tag("seminar_main[seminar_email_sets_attributes][#{index1}][is_confirmation]", true ,@email_set[index1].is_confirmation) %> + | +
<%= t('seminar.email_title') %>
diff --git a/app/views/admin/seminars/_seminar_signup_render_table.html.erb b/app/views/admin/seminars/_seminar_signup_render_table.html.erb
index 5db3753..6a721ca 100644
--- a/app/views/admin/seminars/_seminar_signup_render_table.html.erb
+++ b/app/views/admin/seminars/_seminar_signup_render_table.html.erb
@@ -60,6 +60,20 @@
%>
<% elsif names[1] == 'status' %>
<% val = t("seminar.registration_status_#{seminar_signup.status}") if !seminar_signup.status.blank? %>
+ <% elsif names[1] == 'is_confirmed' %>
+ <% if seminar_signup.is_confirmed
+ val = "#{t("seminar_signup.email_confirmed")}"
+ else
+ val = "#{t("seminar_signup.email_not_confirmed")}"
+ end
+ %>
+ <% elsif names[1] == 'signup_confirmed' %>
+ <% if seminar_signup.signup_confirmed
+ val = "#{t("seminar_signup.signup_confirmed")}"
+ else
+ val = "#{t("seminar_signup.signup_not_confirmed")}"
+ end
+ %>
<% elsif names[1] != 'recaptcha' %>
<% val = seminar_signup.send("#{names[1]}") %>
<% end %>
@@ -77,7 +91,7 @@
%>
<% elsif names[2] == "tel" %>
<% val = seminar_signup.tel %>
- <% elsif names[2] == "registration_status" %>
+ <% elsif names[2] == "registration_status" %>
<% val = t("seminar.registration_status_#{seminar_signup.status}") if !seminar_signup.status.blank? %>
<% end %>
<% elsif names[0] == "seminar_signup_field_custom" || names[0] == "seminar_signup_fields" %>
diff --git a/app/views/email/reset_password_email.html.erb b/app/views/email/reset_password_email.html.erb
new file mode 100644
index 0000000..2fada6d
--- /dev/null
+++ b/app/views/email/reset_password_email.html.erb
@@ -0,0 +1,9 @@
+<% email_set = SeminarMain.where(id:@data['seminar_id']).first.seminar_email_sets.select{|v| v.field_name == 'reset_password'} %>
+<% if email_set.length != 0 %>
+ <% if !(email_set[0].content.nil?) %>
+ <%= email_set[0].content[@data['locale']].html_safe %>
+ <% end %>
+<% else %>
+ <%= t('seminar.email_add_file_content') %>
+<% end %>
+<%= (@data['extra_text'] rescue "").to_s.html_safe %>
\ No newline at end of file
diff --git a/app/views/email/special_reminder_email.html.erb b/app/views/email/special_reminder_email.html.erb
new file mode 100644
index 0000000..c0ef16f
--- /dev/null
+++ b/app/views/email/special_reminder_email.html.erb
@@ -0,0 +1,9 @@
+<% email_set = SeminarMain.where(id:@data['seminar_id']).first.seminar_email_sets.select{|v| v.field_name == 'special_reminder'} %>
+<% if email_set.length != 0 %>
+ <% if !(email_set[0].content.nil?) %>
+ <%= email_set[0].content[@data['locale']].html_safe %>
+ <% end %>
+<% else %>
+ <%= t('seminar.email_add_file_content') %>
+<% end %>
+<%= (@data['extra_text'] rescue "").to_s.html_safe %>
\ No newline at end of file
diff --git a/app/views/seminars/con_login.html.erb b/app/views/seminars/con_login.html.erb
index 7125135..1322fa2 100644
--- a/app/views/seminars/con_login.html.erb
+++ b/app/views/seminars/con_login.html.erb
@@ -39,6 +39,9 @@
<%= password_field_tag :password, nil, :placeholder => t(:dots), :id=>"user_password" %>
+ "> diff --git a/app/views/seminars/confirm_email_page.html.erb b/app/views/seminars/confirm_email_page.html.erb new file mode 100644 index 0000000..9a78014 --- /dev/null +++ b/app/views/seminars/confirm_email_page.html.erb @@ -0,0 +1,21 @@ +<% # encoding: utf-8 %> +<% + data = action_data("confirm_email_page") + if data["url"] + url = data["url"] + end +%> + +<% if (data['confirm'] == true) %> + <%= t('seminar_signup.confirm_ok') %> + + + <%= t('seminar.click_to_contribute') %> + +<% else %> + <%= t('seminar_signup.confirm_not_ok') %> + + + <%= t('seminar.back') %> + +<% end %> diff --git a/app/views/seminars/reset_email.html.erb b/app/views/seminars/reset_email.html.erb new file mode 100644 index 0000000..811b9ca --- /dev/null +++ b/app/views/seminars/reset_email.html.erb @@ -0,0 +1,50 @@ +<% # encoding: utf-8 %> +<% + data = action_data("con_login") + @seminar = data["seminar"] + @time_now = data["time_now"] +%> + + +
+ <% flash.each do |key, msg| %>
+ <%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %>
+ <% end %>
+
+
+
+ <%= @seminar.title %>+<%= t('seminar_signup.forgot_password') %>+
+
+
+
+
+
+
+ <%= form_tag reset_password_proc_seminars_path, :class => 'content' do %>
+
+
+
+ <%= text_field_tag :user_name, params[:user_name], :placeholder => t('seminar_signup.email_address'), :id=>"user_email" %>
+
+ + "> + + + <% end %> + +
+ <% flash.each do |key, msg| %>
+ <%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %>
+ <% end %>
+
+ <% else %>
+
+
+ <%= @seminar.title %>+<%= t('seminar_signup.forgot_password') %>+
+
+
+
+
+
+
+ <%= form_tag reset_confirm_password_proc_seminars_path, :class => 'content', :id =>"change-password-form" do %>
+
+
+
+ <%= password_field_tag :password, nil, :placeholder => t(:dots), :id=>"user_password", :required=> true %>
+
+
+
+
+ <%= password_field_tag :confirm_password, nil, :placeholder => t(:dots), :id=>"confirm_user_password", :required=> true %>
+
+
+ + "> + + + + + <% end %> + + Invalid URL + <% end %> +
- <%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true %> check mail
+ <%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true, :title => t("seminar_signup.email_check") %> check mail
+
+ <% elsif signup_field.field_name == 'password' %>
+
+ <%= f.password_field :password, :class=>"input-medium form-control availibility", :id=>signup_field['field_name'], :placeholder=> signup_field.placeholder[I18n.locale], :pattern => signup_field.validator, :title => t("seminar_signup.password_check") %>
<% elsif signup_field.field_name == 'note' %>
@@ -147,7 +151,7 @@
<% else %>
- <%= f.text_field signup_field['field_name'], :class=>"input-medium form-control", :id=>signup_field['field_name'], :placeholder=> signup_field.placeholder[I18n.locale], :required => (signup_field.field_name=='password' ? false : true) %>
+ <%= f.text_field signup_field['field_name'], :class=>"input-medium form-control", :id=>signup_field['field_name'], :placeholder=> signup_field.placeholder[I18n.locale], :required => true %>
<% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index c316bfa..4292f4e 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -102,6 +102,21 @@ en:
email_edit_file: Edit file
email_add_file: Add file
auto_send_email_set: Auto send email setting
+ email_forgot_password: Forgot Password
+ email_special_reminder: Special Reminder
+ email_reset_password_content: Forgot Password
+ email_reset_password_success: Forgot Password
+ email_special_reminder_content: Special Reminder
+ email_special_reminder_success: Special Reminder
+ is_confirmation: Confirmation Email
+ select_email_type: Select Email Type
+ send_email_text: Additional text to send
+ send_email_button: Send email
+ predefined_text: Predifined email text
+ click_here_to_confirm: Click this link to confirm
+ confirm_ok: Email confirmed
+ confirm_not_ok: Email cannot be confirmed
+ validator: Validator
click_to_contribute: Click here to contribute
required: Required
already_used: Already Used
@@ -119,7 +134,6 @@ en:
reviewer: Reviewer #審查委員
review_end_date: Review End Date #審查結束日期
review_start_date: Review Start Date #審查開始日期
- review: Reveiw #審稿
blank_no_limit: Allow Blank Value #空白無限制
export_csv: Export CSV #匯出CSV
recaptcha: Recaptcha #驗證碼
@@ -212,4 +226,24 @@ en:
select: Select box
checkbox: Multiple choice
radio: Single choice
- choices: Choices
\ No newline at end of file
+ choices: Choices
+ forgot_password: Forgot Password
+ reset_email_sent: Reset Email Sent
+ login_failed: Login Failed
+ email_not_found: Email not found
+ reset: Reset
+ email_reset_password_success: Password reset
+ click_on_link: Please click on the link below to reset your password
+ confirm_password: Confirm Password
+ password_mismatch: Password mismatch
+ password_changed: Password changed successfully
+ password_changed_not_ok: There was an error changing password
+ password_check: Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters
+ email_check: Invalid email format
+ is_confirmed: Email Confirmed
+ signup_confirmed: Signup Confirmed
+ registration_complete: Registration Complete
+ email_confirmed: Email Confirmed
+ email_not_confirmed: Email not confirmed
+ signup_not_confirmed: Signup not confirmed
+ send_email: Send Email
\ No newline at end of file
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index a31cc88..ceb5805 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -103,6 +103,21 @@ zh_tw:
email_edit_file: 編輯上傳
email_add_file: 新增上傳
auto_send_email_set: 自動發信設定
+ email_forgot_password: Forgot Password
+ email_special_reminder: Special Reminder
+ email_reset_password_content: Forgot Password
+ email_reset_password_success: Forgot Password
+ email_special_reminder_content: Special Reminder
+ email_special_reminder_success: Special Reminder
+ is_confirmation: Confirmation Email
+ click_here_to_confirm: Click this link to confirm
+ confirm_ok: Email confirmed
+ confirm_not_ok: Email cannot be confirmed
+ select_email_type: Select Email Type
+ send_email_text: Additional text to send
+ predefined_text: Predifined email text
+ send_email_button: Send email
+ validator: Validator
click_to_contribute: 按此登入投稿
required: '必填, necessary'
already_used: 已存在
@@ -120,7 +135,6 @@ zh_tw:
reviewer: 審查委員
review_end_date: 審查結束日期
review_start_date: 審查開始日期
- review: 審稿
blank_no_limit: 空白無限制
export_csv: 匯出CSV
recaptcha: 驗證碼
@@ -213,4 +227,23 @@ zh_tw:
select: 下拉選單
checkbox: 多選
radio: 單選
- choices: 選項
\ No newline at end of file
+ choices: 選項
+ forgot_password: Forgot Password
+ reset_email_sent: Reset Email Sent
+ login_failed: 登入失敗
+ email_not_found: Email not found
+ reset: Reset
+ click_on_link: 請點選下方連結後重設密碼。
+ confirm_password: Confirm Password
+ password_mismatch: Password missmatch
+ password_changed: Password changed successfully
+ password_changed_not_ok: There was an error changing password
+ password_check: Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters
+ email_check: Invalid email format
+ is_confirmed: Email Confirmed
+ signup_confirmed: Signup Confirmed
+ registration_complete: Registration Complete
+ email_confirmed: Email Confirmed
+ email_not_confirmed: Email not confirmed
+ signup_not_confirmed: Signup not confirmed
+ send_email: Send Email
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 0fc54f5..18976dd 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -53,7 +53,7 @@ Rails.application.routes.draw do
SeminarSubmissionField.create_indexes
end
locales = Site.first.in_use_locales rescue I18n.available_locales
-
+
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
namespace :admin do
resources :seminars do
@@ -89,6 +89,7 @@ Rails.application.routes.draw do
post 'delete_items'
end
end
+ get "seminar_signups/get_predefined_text" => "seminar_signups#get_predefined_text"
resources :seminar_agreements
resources :seminar_signups
resources :seminar_submission_values
@@ -101,12 +102,14 @@ Rails.application.routes.draw do
get ':slug_title-:uid', to: 'seminars#show'
post 'con_login_proc', to: 'seminars#con_login_proc'
post 'con_logout_proc', to: 'seminars#con_logout_proc'
+ post 'reset_password_proc', to: 'seminars#reset_password_proc'
+ post 'reset_confirm_password_proc', to: 'seminars#reset_confirm_password_proc'
post 'add_file_proc', to: 'seminars#add_file_proc'
post 'edit_file_proc', to: 'seminars#edit_file_proc'
post 'del_file', to: 'seminars#del_file'
end
end
-
+ post "/xhr/seminars/send_notifying_email" => "seminars#send_notifying_email"
end
-
+
end
|