Compare commits
32 Commits
Author | SHA1 | Date |
---|---|---|
邱博亞 | 023b8413e0 | |
rulingcom | b0116e3d5a | |
邱博亞 | 06d09747b6 | |
邱博亞 | f4bae16281 | |
rulingcom | 85291c1e99 | |
邱博亞 | 2cea54660f | |
邱博亞 | f432b1a16a | |
邱博亞 | ee91898333 | |
邱博亞 | 9f9c76a0d4 | |
Bomrah Harry | d7651a1716 | |
Bomrah Harry | 41128244d2 | |
Bomrah Harry | bedb08bf82 | |
Bomrah Harry | 8398bb2c65 | |
Bomrah Harry | 11e6cf516b | |
邱博亞 | ddb8da9eca | |
邱博亞 | 06bc2b1531 | |
Bomrah Harry | e92256e0b6 | |
Bomrah Harry | 4dbd540335 | |
邱博亞 | a38f3214b1 | |
邱博亞 | 6cadd24992 | |
邱博亞 | 2b15ecb5fe | |
Bomrah Harry | 9d4e1e0945 | |
邱博亞 | e6d4227b71 | |
邱博亞 | 6c3b5ca75f | |
Bomrah Harry | 383d1f5862 | |
Bomrah Harry | fc52e6001d | |
Bomrah Harry | d110b8e129 | |
Bomrah Harry | c937242f76 | |
Bomrah Harry | dbff09dbc0 | |
Bomrah Harry | 64a8077e5b | |
Bomrah Harry | 7b6aba492b | |
Bomrah Harry | 4a0f4081ff |
|
@ -110,6 +110,7 @@ function setData(l, type, ol) {
|
|||
_markup: fields+"["+l+"][markup]",
|
||||
_option_list: ["option_list_"+l+"_"+ol, fields+"["+l+"]["+type+"][option_list]["+ol+"]", "option_list_"+ol],
|
||||
_placeholder: ["placeholder_" +l, fields+"["+l+"]["+type+"][placeholder]"],
|
||||
_instructions: ["instructions_" +l, fields+"["+l+"]["+type+"][instructions]"],
|
||||
_title_translations: ["title_translations_" +l, fields+"["+l+"][title_translations]"],
|
||||
_destroy: ["destroy_" +l, fields+"["+l+"][_destroy]"],
|
||||
_to_require: ["to_require_" +l, fields+"["+l+"][to_require]"],
|
||||
|
@ -117,6 +118,34 @@ function setData(l, type, ol) {
|
|||
return data;
|
||||
}
|
||||
|
||||
// Deinit Template HTML (ex: ckeditor)
|
||||
function deinit_template_html(_this) {
|
||||
var ckeditor_areas = _this.find('.ckeditor');
|
||||
if (typeof(CKEDITOR) == 'object') {
|
||||
ckeditor_areas.each(function(i,v) {
|
||||
var name = $(v).attr('name');
|
||||
if (CKEDITOR.instances[name]) {
|
||||
CKEDITOR.instances[name].destroy();
|
||||
}
|
||||
})
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
|
||||
// Init Template HTML (ex: ckeditor)
|
||||
function init_template_html(_this) {
|
||||
var ckeditor_areas = _this.find('.ckeditor');
|
||||
if (typeof(CKEDITOR) == 'object') {
|
||||
ckeditor_areas.each(function(i,v) {
|
||||
var name = $(v).attr('name');
|
||||
if (!CKEDITOR.instances[name]) {
|
||||
CKEDITOR.replace(name);
|
||||
}
|
||||
})
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
|
||||
// Get Default Address Form
|
||||
function getAddressForm(trigger, element, decide) {
|
||||
if(decide) {
|
||||
|
@ -256,11 +285,11 @@ $(function() {
|
|||
nameNumber = nameNumber.match(/[^[\D\]]+(?=])/g)[0];
|
||||
seminar_mainType = $(this).data('seminar_mains')
|
||||
if($(this).hasClass('textInput')) {
|
||||
$("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
|
||||
init_template_html($("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
|
||||
} else if ($(this).hasClass('textLengInput')) {
|
||||
$("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
|
||||
init_template_html($("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
|
||||
} else if ($(this).hasClass('address')) {
|
||||
$("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
|
||||
init_template_html($("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
|
||||
}
|
||||
inputAppendLength();
|
||||
};
|
||||
|
@ -288,7 +317,7 @@ $(function() {
|
|||
};
|
||||
attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
|
||||
attributesLength = $('#attributes-area .attributes').length;
|
||||
$("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" );
|
||||
init_template_html($("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" ));
|
||||
$('.toggle-check').togglebox();
|
||||
});
|
||||
|
||||
|
@ -439,7 +468,7 @@ $(function() {
|
|||
console.log(appendIndex)
|
||||
attributeIndex = $(this).closest('.attributes').index();
|
||||
templateType = $(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref');
|
||||
$("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target'));
|
||||
init_template_html($("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target')));
|
||||
inputAppendLength();
|
||||
};
|
||||
if($(this).hasClass('remove-input')) {
|
||||
|
@ -454,6 +483,7 @@ $(function() {
|
|||
$('#attributes-area').delegate('.dataType', 'change', function() {
|
||||
$(this).children("option:selected").each(function () {
|
||||
var target = $(this).closest('.attributes').find('.field-type').not('.default');
|
||||
deinit_template_html(target);
|
||||
attributeIndex = $(this).closest('.attributes').index();
|
||||
appendIndex = 0
|
||||
// $(this).closest('.attributes').find('.add-target').find('.input-append').length;
|
||||
|
@ -467,7 +497,7 @@ $(function() {
|
|||
if($(this).attr('ref')) {
|
||||
templateType = $(this).attr('ref');
|
||||
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
|
||||
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
|
||||
init_template_html($("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target));
|
||||
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
|
||||
inputAppendLength();
|
||||
}
|
||||
|
@ -481,7 +511,7 @@ $(function() {
|
|||
if($(this).attr('ref')) {
|
||||
templateType = $(this).attr('ref');
|
||||
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
|
||||
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
|
||||
init_template_html($("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target));
|
||||
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
|
||||
inputAppendLength();
|
||||
}
|
||||
|
|
|
@ -110,6 +110,7 @@ function setData(l, type, ol) {
|
|||
_markup: fields+"["+l+"][markup]",
|
||||
_option_list: ["option_list_"+l+"_"+ol, fields+"["+l+"]["+type+"][option_list]["+ol+"]", "option_list_"+ol],
|
||||
_placeholder: ["placeholder_" +l, fields+"["+l+"]["+type+"][placeholder]"],
|
||||
_instructions: ["instructions_" +l, fields+"["+l+"]["+type+"][instructions]"],
|
||||
_title_translations: ["title_translations_" +l, fields+"["+l+"][title_translations]"],
|
||||
_destroy: ["destroy_" +l, fields+"["+l+"][_destroy]"],
|
||||
_to_require: ["to_require_" +l, fields+"["+l+"][to_require]"],
|
||||
|
@ -117,6 +118,34 @@ function setData(l, type, ol) {
|
|||
return data;
|
||||
}
|
||||
|
||||
// Deinit Template HTML (ex: ckeditor)
|
||||
function deinit_template_html(_this) {
|
||||
var ckeditor_areas = _this.find('.ckeditor');
|
||||
if (typeof(CKEDITOR) == 'object') {
|
||||
ckeditor_areas.each(function(i,v) {
|
||||
var name = $(v).attr('name');
|
||||
if (CKEDITOR.instances[name]) {
|
||||
CKEDITOR.instances[name].destroy();
|
||||
}
|
||||
})
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
|
||||
// Init Template HTML (ex: ckeditor)
|
||||
function init_template_html(_this) {
|
||||
var ckeditor_areas = _this.find('.ckeditor');
|
||||
if (typeof(CKEDITOR) == 'object') {
|
||||
ckeditor_areas.each(function(i,v) {
|
||||
var name = $(v).attr('name');
|
||||
if (!CKEDITOR.instances[name]) {
|
||||
CKEDITOR.replace(name);
|
||||
}
|
||||
})
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
|
||||
// Get Default Address Form
|
||||
function getAddressForm(trigger, element, decide) {
|
||||
if(decide) {
|
||||
|
@ -256,11 +285,11 @@ $(function() {
|
|||
nameNumber = nameNumber.match(/[^[\D\]]+(?=])/g)[0];
|
||||
seminar_mainType = $(this).data('seminar_mains')
|
||||
if($(this).hasClass('textInput')) {
|
||||
$("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
|
||||
init_template_html($("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
|
||||
} else if ($(this).hasClass('textLengInput')) {
|
||||
$("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
|
||||
init_template_html($("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
|
||||
} else if ($(this).hasClass('address')) {
|
||||
$("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
|
||||
init_template_html($("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
|
||||
}
|
||||
inputAppendLength();
|
||||
};
|
||||
|
@ -288,7 +317,7 @@ $(function() {
|
|||
};
|
||||
attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
|
||||
attributesLength = $('#attributes-area .attributes').length;
|
||||
$("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" );
|
||||
init_template_html($("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" ));
|
||||
$('.toggle-check').togglebox();
|
||||
});
|
||||
|
||||
|
@ -438,7 +467,7 @@ $(function() {
|
|||
appendIndex = parseInt(appendIndex.match(/[^[\D\]]+(?=])/g)[1])+1;
|
||||
attributeIndex = $(this).closest('.attributes').index();
|
||||
templateType = $(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref');
|
||||
$("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target'));
|
||||
init_template_html($("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target')));
|
||||
inputAppendLength();
|
||||
};
|
||||
if($(this).hasClass('remove-input')) {
|
||||
|
@ -453,6 +482,7 @@ $(function() {
|
|||
$('#attributes-area').delegate('.dataType', 'change', function() {
|
||||
$(this).children("option:selected").each(function () {
|
||||
var target = $(this).closest('.attributes').find('.field-type').not('.default');
|
||||
deinit_template_html(target);
|
||||
attributeIndex = $(this).closest('.attributes').index();
|
||||
appendIndex = 0
|
||||
// $(this).closest('.attributes').find('.add-target').find('.input-append').length;
|
||||
|
@ -466,7 +496,7 @@ $(function() {
|
|||
if($(this).attr('ref')) {
|
||||
templateType = $(this).attr('ref');
|
||||
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
|
||||
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
|
||||
init_template_html($("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target));
|
||||
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
|
||||
inputAppendLength();
|
||||
}
|
||||
|
@ -480,7 +510,7 @@ $(function() {
|
|||
if($(this).attr('ref')) {
|
||||
templateType = $(this).attr('ref');
|
||||
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
|
||||
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
|
||||
init_template_html($("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target));
|
||||
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
|
||||
inputAppendLength();
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
@ -60,7 +60,7 @@ class Admin::SeminarSignupsController < OrbitAdminController
|
|||
|
||||
@seminar_signup.destroy
|
||||
|
||||
redirect_to "/admin/seminars/#{@seminar_main_id}/seminar_signup"
|
||||
redirect_to "/admin/seminars/#{@seminar_main_id}/seminar_signup?type=table"
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -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,55 @@ 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
|
||||
|
||||
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
|
||||
|
||||
def send_notifying_email
|
||||
sent_time = DateTime.now
|
||||
@seminar = SeminarMain.find_by(:id => params[:seminar_id])
|
||||
seminar_signup = @seminar.seminar_signups.where(:email => params[:email]).first
|
||||
if !seminar_signup.blank?
|
||||
extra_text = "<p> #{nl2br(params[:text])} </p>"
|
||||
if params[:type] == "reset_password"
|
||||
seminar_signup.status = 'C'
|
||||
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.click_here_to_confirm")}</a>"
|
||||
end
|
||||
send_mail(params[:type], seminar_signup.email, @seminar.id.to_s, extra_text)
|
||||
seminar_signup.emails_sent << params[:type]
|
||||
seminar_signup.emails_sent_time << sent_time
|
||||
seminar_signup.save
|
||||
end
|
||||
render :json => {
|
||||
"type" => t("seminar.#{params[:type]}"),
|
||||
"sent_time" => sent_time.strftime("%Y/%m/%d %H:%M"),
|
||||
"success" => true
|
||||
}.to_json
|
||||
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 set_seminar
|
||||
|
@ -758,7 +807,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
|
||||
|
|
|
@ -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_name", "check_availability", "signup_ok", "add_file", "edit_file", "con_login", "con_upload", "con_logout","confirm_email_page","reset_password_page","edit_login_seminar_signup"]
|
||||
# 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 = "<a href=\"#{prefix_url}#{home_page.url}\">Home</a> | " +
|
||||
header_data = "<a href=\"#{prefix_url}#{home_page.url}\">Home</a> | " +
|
||||
"<a href=\"/\">Main Site</a>"
|
||||
content_style = seminar_template_setting.content_style
|
||||
background_style = seminar_template_setting.background_style
|
||||
|
@ -295,7 +295,7 @@ class SeminarsController < ApplicationController
|
|||
if last_path.include?("?")
|
||||
referer_url = split_path[0...-1].join('/') + '/' + last_path.split('?')[0]
|
||||
uri_query = last_path.split("?")[1..-1].join('?')
|
||||
uri_query.gsub!(/notice=[^&]*/,'').gsub!(/&+$/,'')
|
||||
uri_query = uri_query.gsub(/notice=[^&]*/,'').gsub(/&+$/,'')
|
||||
if uri_query.blank?
|
||||
referer_url = referer_url + "?notice=#{notice_words}"
|
||||
else
|
||||
|
@ -345,7 +345,7 @@ class SeminarsController < ApplicationController
|
|||
sign_up = link_to(sign_up_text, seminar.get_frontend_url(seminar_url), :target=>'_blank', :title=>sign_up_text)
|
||||
end
|
||||
|
||||
if !seminar.registration_status.blank? && seminar.registration_status.include?('C') && seminar.contribute_start_date <= time_now && ( seminar.contribute_end_date.nil? || seminar.contribute_end_date+1 >= time_now )
|
||||
if !seminar.registration_status.blank? && seminar.registration_status.include?('C') && (seminar.contribute_start_date.nil? || seminar.contribute_start_date <= time_now) && ( seminar.contribute_end_date.nil? || seminar.contribute_end_date+1 >= time_now )
|
||||
if @@session[:seminar_signup_id].present? && @@session[:seminar_main_id] == seminar.id
|
||||
button_text = t('seminar_signup.uploads')
|
||||
contribute_action = link_to(button_text, seminar.get_frontend_url(seminar_url, :con_upload), :title=>button_text)
|
||||
|
@ -379,7 +379,20 @@ class SeminarsController < ApplicationController
|
|||
|
||||
seminar_signup = SeminarSignup.new
|
||||
|
||||
time_now = Time.now
|
||||
time_now = Time.now
|
||||
|
||||
referer_url = OrbitHelper.request.referer
|
||||
|
||||
if (referer_url.nil? || referer_url.match(/(\?|&)method=show_privacy/).nil?) && !OrbitHelper.request.params[:notice]
|
||||
return {
|
||||
"seminar" => seminar,
|
||||
"seminar_signup" => seminar_signup,
|
||||
"time_now" => time_now,
|
||||
"redirect_to" => "#{OrbitHelper.url_to_show(seminar.to_param)}?method=show_privacy"
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
{
|
||||
"seminar" => seminar,
|
||||
"seminar_signup" => seminar_signup,
|
||||
|
@ -391,18 +404,36 @@ class SeminarsController < ApplicationController
|
|||
def check_email
|
||||
|
||||
params = OrbitHelper.params
|
||||
|
||||
if !params[:email].blank?
|
||||
success = true
|
||||
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')
|
||||
else
|
||||
result = t('seminar.please_enter_email')
|
||||
success = count > 0 ? false : true
|
||||
end
|
||||
|
||||
{
|
||||
"result" => result
|
||||
}
|
||||
render :json => {
|
||||
"result" => result,
|
||||
"success" => success
|
||||
}.to_json
|
||||
|
||||
end
|
||||
|
||||
def check_name
|
||||
|
||||
params = OrbitHelper.params
|
||||
success = true
|
||||
if !params[:name].blank?
|
||||
count = SeminarSignup.where(:name => params[:name], :seminar_main_id => params[:no]).count
|
||||
|
||||
result = count > 0 ? t('seminar.already_used') : t('seminar.available')
|
||||
success = count > 0 ? false : true
|
||||
end
|
||||
|
||||
render :json => {
|
||||
"result" => result,
|
||||
"success" => success
|
||||
}.to_json
|
||||
|
||||
end
|
||||
|
||||
|
@ -420,12 +451,18 @@ class SeminarsController < ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
OrbitHelper.set_page(nil)
|
||||
referer_url = request.referer
|
||||
if referer_url
|
||||
params[:url] = URI.parse(referer_url).path.sub(/\/[^\/]*$/, '').sub(/^\/#{I18n.locale}/, '')
|
||||
end
|
||||
OrbitHelper.set_params(params, current_user)
|
||||
seminar_id = params[:seminar_signup][:seminar_main_id]
|
||||
@seminar = SeminarMain.where(id: seminar_id).first
|
||||
if @seminar.enable_recaptcha && (!gotcha_valid?)
|
||||
notice_words = t('recaptcha.errors.verification_failed')
|
||||
referer_url = get_referer_url_for_notice(notice_words)
|
||||
redirect_to referer_url, :notice => notice_words
|
||||
show_alert(notice_words)
|
||||
return
|
||||
end
|
||||
signup_limit = @seminar.signup_limit
|
||||
|
@ -444,7 +481,7 @@ class SeminarsController < ApplicationController
|
|||
else
|
||||
notice_words = t('seminar.sign_up_is_full')
|
||||
referer_url = get_referer_url_for_notice(notice_words)
|
||||
redirect_to referer_url, :notice => notice_words
|
||||
show_alert(notice_words)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
@ -453,12 +490,15 @@ class SeminarsController < ApplicationController
|
|||
if signup_limit <= signup_count
|
||||
notice_words = t('seminar.sign_up_is_full')
|
||||
referer_url = get_referer_url_for_notice(notice_words)
|
||||
redirect_to referer_url, :notice => notice_words
|
||||
show_alert(notice_words)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
@signup = SeminarSignup.where(email: params[:seminar_signup][:email], seminar_main_id: seminar_id ).first
|
||||
if @signup.blank?
|
||||
@signup = SeminarSignup.where(name: params[:seminar_signup][:name], seminar_main_id: seminar_id ).first
|
||||
end
|
||||
|
||||
@seminar_signup = SeminarSignup.new(seminar_signup_params)
|
||||
not_signup_yet = @signup.blank?
|
||||
|
@ -486,16 +526,23 @@ class SeminarsController < ApplicationController
|
|||
@seminar.save
|
||||
end
|
||||
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,
|
||||
:seminar_signup=>@seminar_signup},:layout=>false)
|
||||
# extra_text += render_to_string("seminars/signup_email_contents",:locals=>{:seminar=>@seminar, :seminar_signup=>@seminar_signup},:layout=>false)
|
||||
if params['seminar_signup']['status']=='C'
|
||||
status_param = '&status='
|
||||
send_mail('submission',params[:seminar_signup][:email],params[:seminar_signup][:seminar_main_id],extra_text)
|
||||
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)
|
||||
else
|
||||
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)
|
||||
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_with_js("#{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
|
||||
if has_counter
|
||||
OrbitHelper::SharedMutex.synchronize do
|
||||
|
@ -503,39 +550,90 @@ class SeminarsController < ApplicationController
|
|||
end
|
||||
end
|
||||
if !not_signup_yet
|
||||
notice_words = t('seminar.email_exist')
|
||||
notice_words = t('seminar.email_or_name_exist')
|
||||
referer_url = get_referer_url_for_notice(notice_words)
|
||||
redirect_to referer_url, :notice => notice_words
|
||||
show_alert(notice_words)
|
||||
else
|
||||
notice_words = t('seminar.sign_up_failed')
|
||||
referer_url = get_referer_url_for_notice(notice_words)
|
||||
redirect_to referer_url, :notice => notice_words
|
||||
show_alert(notice_words)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def update_signup_form
|
||||
OrbitHelper.set_page(nil)
|
||||
referer_url = request.referer
|
||||
if referer_url
|
||||
params[:url] = URI.parse(referer_url).path.sub(/\/[^\/]*$/, '').sub(/^\/#{I18n.locale}/, '')
|
||||
end
|
||||
params = OrbitHelper.params
|
||||
tmp_seminar_signup_params = seminar_signup_params
|
||||
@seminar_signup = SeminarSignup.find(params[:signup_id])
|
||||
@seminar_signup.update_attributes(tmp_seminar_signup_params)
|
||||
@seminar_signup.generate_token
|
||||
if !params[:seminar_signup_values].nil?
|
||||
params[:seminar_signup_values].each_with_index do |r,i|
|
||||
field_value = r.last[:id].present?
|
||||
@custom_field_value = SeminarSignupValue.put_field_values(@seminar_signup, r.last, r.last[:id], field_value)
|
||||
end
|
||||
seminar_reviews = SeminarReview.where(:seminar_main_id=>@seminar_signup.seminar_main_id).to_a
|
||||
seminar_reviews.each{|sr| sr.save}
|
||||
@seminar = @seminar_signup.seminar_main
|
||||
unassigned_seminar_signup_ids = @seminar.seminar_signup_ids.map{|s| s.to_s}
|
||||
@seminar.seminar_reviews.each do |sr|
|
||||
unassigned_seminar_signup_ids = unassigned_seminar_signup_ids - sr.all_seminar_signup_ids
|
||||
end
|
||||
@seminar.unassigned_seminar_signup_ids = unassigned_seminar_signup_ids
|
||||
@seminar.save
|
||||
end
|
||||
extra_text = "<br>#{I18n.t('seminar_signup.serial_number')}: #{@seminar_signup.display_serial_number}"
|
||||
if tmp_seminar_signup_params['status']=='C'
|
||||
status_param = '&status='
|
||||
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',tmp_seminar_signup_params[:email],tmp_seminar_signup_params[:seminar_main_id],extra_text)
|
||||
else
|
||||
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',tmp_seminar_signup_params[:email],tmp_seminar_signup_params[:seminar_main_id],extra_text)
|
||||
end
|
||||
redirect_with_js("#{params[:referer_url].to_s.chomp('/').gsub(/\/([^\/?#]+)(|[^\/]+)$/){|f| '/'+$1}}?method=signup_ok#{status_param}&serial_number=#{@seminar_signup.display_serial_number}&seminar=#{@seminar.uid}")
|
||||
end
|
||||
|
||||
def signup_ok
|
||||
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
|
||||
|
||||
def add_file_proc
|
||||
|
||||
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'])
|
||||
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'].to_h)
|
||||
flag = true
|
||||
update_params.permit!
|
||||
if !update_params['seminar_submission_values'].nil?
|
||||
if update_params['seminar_submission_values']['0']['value'].class==String
|
||||
value = update_params['seminar_submission_values']['0']['value']
|
||||
if !value.to_s.blank?
|
||||
flag = false
|
||||
end
|
||||
if update_params['seminar_submission_values'].present?
|
||||
if update_params['seminar_submission_values']['0']['value'].nil?
|
||||
flag = false
|
||||
else
|
||||
update_params['seminar_submission_values']['0']['value'].each do |key,value|
|
||||
if !value.to_s.blank?
|
||||
if update_params['seminar_submission_values']['0']['value'].class==String
|
||||
value = update_params['seminar_submission_values']['0']['value']
|
||||
if !value.to_s.blank?
|
||||
flag = false
|
||||
end
|
||||
else
|
||||
update_params['seminar_submission_values']['0']['value'].each do |key,value|
|
||||
if !value.to_s.blank?
|
||||
flag = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
|
@ -574,20 +672,24 @@ class SeminarsController < ApplicationController
|
|||
|
||||
def update
|
||||
@con = SeminarSignupContribute.find(params[:seminar_signup_contribute][:id])
|
||||
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'])
|
||||
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'].to_h)
|
||||
update_params.permit!
|
||||
unless update_params['seminar_submission_values'].nil?
|
||||
flag = true
|
||||
if update_params['seminar_submission_values']['0']['value'].class==String
|
||||
value = update_params['seminar_submission_values']['0']['value']
|
||||
if !value.to_s.blank?
|
||||
flag = false
|
||||
end
|
||||
if update_params['seminar_submission_values'].present?
|
||||
if update_params['seminar_submission_values']['0']['value'].nil?
|
||||
flag = false
|
||||
else
|
||||
update_params['seminar_submission_values']['0']['value'].each do |key,value|
|
||||
if !value.to_s.blank?
|
||||
flag = true
|
||||
if update_params['seminar_submission_values']['0']['value'].class==String
|
||||
value = update_params['seminar_submission_values']['0']['value']
|
||||
if !value.to_s.blank?
|
||||
flag = false
|
||||
end
|
||||
else
|
||||
update_params['seminar_submission_values']['0']['value'].each do |key,value|
|
||||
if !value.to_s.blank?
|
||||
flag = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if flag
|
||||
|
@ -697,6 +799,16 @@ class SeminarsController < ApplicationController
|
|||
|
||||
seminar_signup = SeminarSignup.find_by(_id: @@session[:seminar_signup_id], seminar_main_id: @@session[:seminar_main_id] ) rescue nil
|
||||
|
||||
show = true
|
||||
seminar.seminar_submission_field_sets.each do |ssf|
|
||||
if ssf.disabled && ssf.hidden
|
||||
show = false
|
||||
else
|
||||
show = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
seminar = {}
|
||||
|
@ -707,11 +819,32 @@ class SeminarsController < ApplicationController
|
|||
{
|
||||
'time_now' => time_now,
|
||||
'seminar' => seminar,
|
||||
'seminar_signup' => seminar_signup
|
||||
'seminar_signup' => seminar_signup,
|
||||
"show" => show
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
def edit_login_seminar_signup #copy from show
|
||||
if !@@session[:seminar_main_id].blank?
|
||||
seminar = SeminarMain.find_by(id: @@session[:seminar_main_id])
|
||||
seminar_signup = SeminarSignup.find_by(_id: @@session[:seminar_signup_id], seminar_main_id: @@session[:seminar_main_id] ) rescue nil
|
||||
else
|
||||
seminar = {}
|
||||
seminar_signup = {}
|
||||
end
|
||||
module_app = ModuleApp.where(:key => "seminar").first
|
||||
|
||||
categories = module_app.categories
|
||||
|
||||
time_now = Time.now
|
||||
{
|
||||
"seminar" => seminar,
|
||||
"seminar_signup" => seminar_signup,
|
||||
"time_now" => time_now
|
||||
}
|
||||
end
|
||||
|
||||
def con_logout
|
||||
|
||||
# redirect_to page_for_seminar_url
|
||||
|
@ -733,6 +866,55 @@ class SeminarsController < ApplicationController
|
|||
|
||||
end
|
||||
|
||||
def reset_email
|
||||
end
|
||||
|
||||
def reset_password_page
|
||||
params = OrbitHelper.params
|
||||
seminar = SeminarMain.find_by(uid: params[:uid])
|
||||
seminar_signup = seminar.seminar_signups.where(:status=>'C', :id=> params[:cid], :token => params[:token]).first
|
||||
password_pattern = ""
|
||||
if(seminar.seminar_signup_field_sets.count != 0)
|
||||
password_pattern = seminar.seminar_signup_field_sets.where(:field_name => "password").first.validator rescue ""
|
||||
end
|
||||
status = false
|
||||
if(!seminar_signup.nil?)
|
||||
status = true
|
||||
end
|
||||
{
|
||||
"status" => status,
|
||||
"seminar" => seminar,
|
||||
"pattern" => password_pattern,
|
||||
"cid" => params[:cid],
|
||||
"token" => params[:token]
|
||||
}
|
||||
end
|
||||
|
||||
def confirm_email_page
|
||||
confirm = false
|
||||
params = OrbitHelper.params
|
||||
uid = params[:uid]
|
||||
if uid.nil?
|
||||
uid = params[:page].split('-').last
|
||||
end
|
||||
seminar = SeminarMain.where(:uid => uid).first
|
||||
if(!seminar.nil?)
|
||||
signup = seminar.seminar_signups.where(:id => params[:cid], :token => params[:token]).first
|
||||
if(!signup.nil?)
|
||||
signup.token = nil
|
||||
signup.is_confirmed = true
|
||||
signup.is_confirmed_date = DateTime.now
|
||||
signup.signup_confirmed_counter = signup.signup_confirmed_counter + 1
|
||||
signup.save
|
||||
confirm = true
|
||||
end
|
||||
end
|
||||
{
|
||||
"confirm" => confirm,
|
||||
"url" => OrbitHelper.url_to_show(seminar.to_param)
|
||||
}
|
||||
end
|
||||
|
||||
def con_login_proc
|
||||
|
||||
seminar = SeminarMain.find_by(id: params[:seminar_signup][:seminar_main_id])
|
||||
|
@ -751,6 +933,35 @@ class SeminarsController < ApplicationController
|
|||
|
||||
end
|
||||
|
||||
def reset_confirm_password_proc
|
||||
params = OrbitHelper.params
|
||||
seminar = SeminarMain.find(params[:seminar_id])
|
||||
redirect_to "#{params[:referer_url].to_s.chomp('/')}/?method=reset_password_page" if seminar.nil?
|
||||
|
||||
seminar_signup = seminar.seminar_signups.where(:status =>'C', :token => params[:reset_token], :id => params[:cid]).first
|
||||
if !seminar_signup.blank?
|
||||
seminar_signup.password = params[:password]
|
||||
seminar_signup.token = nil
|
||||
seminar_signup.save
|
||||
redirect_to "#{params[:referer_url].to_s.chomp('/')}/?method=con_login", :notice => t('seminar_signup.password_changed')
|
||||
else
|
||||
redirect_to "#{params[:referer_url].to_s.chomp('/')}/?method=con_login", :notice => t('seminar_signup.password_changed_not_ok')
|
||||
end
|
||||
end
|
||||
|
||||
def reset_password_proc
|
||||
@seminar = SeminarMain.find_by(id: params[:seminar_signup][:seminar_main_id])
|
||||
seminar_signup = SeminarSignup.where(:status=>'C', :email=> params[:user_name], :seminar_main_id => params[:seminar_signup][:seminar_main_id]).first
|
||||
if !seminar_signup.blank?
|
||||
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.click_here_to_confirm")}</a>"
|
||||
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')
|
||||
else
|
||||
redirect_to "#{params[:referer_url].to_s.chomp('/')}/?method=reset_email", :notice => t('seminar_signup.email_not_found')
|
||||
end
|
||||
end
|
||||
|
||||
def seminar_signup_params
|
||||
params.require(:seminar_signup).permit!
|
||||
end
|
||||
|
@ -762,22 +973,20 @@ class SeminarsController < ApplicationController
|
|||
def seminar_signup_values_params
|
||||
params.require(:seminar_signup_values).permit!
|
||||
end
|
||||
def send_mail(field_name,email,seminar_id,extra_text="")
|
||||
email_set = @seminar.seminar_email_sets.select{|v| v.field_name == field_name}
|
||||
if email_set.length==0
|
||||
mail = Email.create(mail_to:[email],
|
||||
module_app_key:"seminar",
|
||||
template:"email/#{field_name}_email.html.erb",
|
||||
mail_sentdate:Time.current,
|
||||
mail_subject: t("seminar.email_#{field_name}_success"),
|
||||
template_data:{'seminar_id'=>seminar_id,'locale'=>I18n.locale,'extra_text'=> extra_text})
|
||||
elsif !(email_set[0].disabled)
|
||||
mail = Email.create(mail_to:[email],
|
||||
module_app_key:"seminar",
|
||||
template:"email/#{field_name}_email.html.erb",
|
||||
mail_sentdate:Time.current,
|
||||
mail_subject: email_set[0].title[I18n.locale],
|
||||
template_data:{'seminar_id'=>seminar_id,'locale'=>I18n.locale,'extra_text'=> extra_text})
|
||||
end
|
||||
|
||||
private
|
||||
def show_alert(notice_words)
|
||||
respond_to do |format|
|
||||
format.js{
|
||||
render :js => "$('.rucaptcha-image').click();alert('#{notice_words}');"
|
||||
}
|
||||
end
|
||||
end
|
||||
def redirect_with_js(url)
|
||||
respond_to do |format|
|
||||
format.js{
|
||||
render :js => "window.location.href = '#{url}';"
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,6 +7,7 @@ module Admin::SeminarsFieldHelper
|
|||
include ActionView::Helpers::RenderingHelper
|
||||
include ActionView::Context
|
||||
include OrbitBasis::RenderAnywhere
|
||||
include ::MemberHelper
|
||||
|
||||
include OrbitFormHelper
|
||||
|
||||
|
@ -26,7 +27,21 @@ module Admin::SeminarsFieldHelper
|
|||
end
|
||||
|
||||
def lang_tab(str,lang)
|
||||
content_tag(:div,str,:class=>"tab-pane fade",:id=>(get_field_name_base+"tab_#{lang}"))
|
||||
content_tag(:div,str,:class=>"tab-pane fade",:id=>(get_field_name_base+"tab_#{lang}"))
|
||||
end
|
||||
|
||||
def render_instructions
|
||||
control_group_wrapper_for_sm do |key,value|
|
||||
if !@prefiled_value.nil?
|
||||
value = can_muti_lang_input_for_sm? ? @prefiled_value[key] : @prefiled_value
|
||||
else
|
||||
value = nil
|
||||
end
|
||||
key = can_muti_lang_input_for_sm? ? "#{key}" : I18n.locale
|
||||
instructions = (typeG["instructions"].blank? ? "" : typeG["instructions"][key])
|
||||
name1 = can_muti_lang_input_for_sm? ? (get_field_name_base + "[#{key}]") : get_field_name_base
|
||||
instructions.html_safe
|
||||
end
|
||||
end
|
||||
|
||||
def render_address
|
||||
|
@ -50,14 +65,14 @@ module Admin::SeminarsFieldHelper
|
|||
|
||||
def render_checkbox
|
||||
@prefiled_value ||=[]
|
||||
control_group_wrapper_for_sm do
|
||||
control_group_wrapper_for_sm do
|
||||
a = self.typeE[:option_list].collect do |key,value|
|
||||
label_tag("#{get_basic_field_name_org}_#{self.id}_#{key}",check_box_tag(get_field_name_base+"[#{key}]", true , (@prefiled_value.include?(key) ? true : false), { :id=>"#{get_basic_field_name_org}_#{self.id}_#{key}"})+value[I18n.locale.to_s],@markup_options.merge(:class=>"checkbox inline"))
|
||||
end.join.html_safe rescue ""
|
||||
end
|
||||
end
|
||||
|
||||
def render_date
|
||||
def render_date
|
||||
d = DateTime.now()
|
||||
|
||||
if date_is_range?
|
||||
|
@ -81,13 +96,13 @@ module Admin::SeminarsFieldHelper
|
|||
when 'format3'
|
||||
fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y/%m")
|
||||
fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y/%m/")
|
||||
buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy/MM')
|
||||
buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy/MM')
|
||||
buf << ' ~ '
|
||||
buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy/MM')
|
||||
when 'format4'
|
||||
fill_from = (@prefiled_value && @prefiled_value["from"] ) ? @prefiled_value["from"] : d.strftime("%Y")
|
||||
fill_to = (@prefiled_value && @prefiled_value["to"] ) ? @prefiled_value["to"] : d.strftime("%Y")
|
||||
buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy')
|
||||
buf = datetime_picker(get_field_name_base+'[from]', fill_from, 'yyyy')
|
||||
buf << ' ~ '
|
||||
buf << datetime_picker(get_field_name_base+'[to]', fill_to, 'yyyy')
|
||||
end
|
||||
|
@ -107,13 +122,13 @@ module Admin::SeminarsFieldHelper
|
|||
when 'format2'
|
||||
tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y/%m/%d")), 'yyyy/MM/dd')
|
||||
when 'format3'
|
||||
tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y/%m")), 'yyyy/MM')
|
||||
tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y/%m")), 'yyyy/MM')
|
||||
when 'format4'
|
||||
tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y")), 'yyyy')
|
||||
tmp = datetime_picker(get_field_name_base, (@prefiled_value ? @prefiled_value : d.strftime("%Y")), 'yyyy')
|
||||
end
|
||||
|
||||
control_group_wrapper_for_sm{tmp}
|
||||
# control_group_wrapper_for_sm{date_select(get_field_name_base,nil,@markup_options.merge(:default=>@prefiled_value),:class=>"input-small")}
|
||||
|
||||
control_group_wrapper_for_sm{tmp}
|
||||
# control_group_wrapper_for_sm{date_select(get_field_name_base,nil,@markup_options.merge(:default=>@prefiled_value),:class=>"input-small")}
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -131,7 +146,7 @@ module Admin::SeminarsFieldHelper
|
|||
end
|
||||
|
||||
def render_date_durnation #Need re-write low priority
|
||||
|
||||
|
||||
end
|
||||
|
||||
def render_radio_button
|
||||
|
@ -168,7 +183,7 @@ module Admin::SeminarsFieldHelper
|
|||
key = can_muti_lang_input_for_sm? ? "#{key}" : I18n.locale
|
||||
place_holder= typeD["placeholder"][key] rescue ''
|
||||
name1 = can_muti_lang_input_for_sm? ? (get_field_name_base + "[#{key}]") : get_field_name_base
|
||||
text_area_tag(name1, value, @markup_options.merge(:placeholder=>place_holder,:class=>'ckeditor input-medium form-control'))
|
||||
text_area_tag(name1, value, @markup_options.merge(:placeholder=>place_holder,:class=>'input-medium form-control', :maxlength=> 300, :style => "width:500px;height:200px"))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -179,7 +194,7 @@ module Admin::SeminarsFieldHelper
|
|||
place_holder= typeA["placeholder"][key_field] rescue ''
|
||||
name1 = can_muti_lang_input_for_sm? ? ([get_field_name_base,add_more_blank,"[#{key_field}]"].join) : ([get_field_name_base,add_more_blank].join)
|
||||
text_field_tag(name1, value, @markup_options.merge(:placeholder=>place_holder,:class=>'input-medium form-control'))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def render_file_field
|
||||
|
@ -187,21 +202,39 @@ module Admin::SeminarsFieldHelper
|
|||
add_more_blank = can_add_more ? "[]" : ""
|
||||
key_field = can_muti_lang_input? ? "[#{key}]" : ""
|
||||
field_name = [get_field_name_base,add_more_blank,key_field].join
|
||||
file_required =@require ? 'required="required"' : ''
|
||||
file_required =@require && !value ? 'required="required"' : ''
|
||||
"<div class=\"file-selector\"><label class=\"ui-button\">
|
||||
<input style=\"position: absolute;width:0.1em;opacity: 0;padding: 0;border: 0;opacity: 0;left: 50%;top: 0;\" class=\"upload\" name=\"#{field_name}\" #{file_required} type=\"file\" />
|
||||
<input style=\"position: absolute;width:0.1em;opacity: 0;padding: 0;border: 0;opacity: 0;left: 50%;top: 0;\" class=\"upload\" name=\"#{field_name}\" #{file_required} type=\"file\" accept=\".pdf,.png,.jpg,.odf\" onchange=\"if(this.files[0].size > 1048576*20){alert('#{I18n.t("seminar.file_limit_hint")}');this.value = '';}else{var ext = this.value.match(/\.([^\.]+)$/)[1];if (!['pdf','png','jpg','odf'].includes(ext)){alert('#{I18n.t("seminar.file_format_hint")}');this.value='';}}\" />
|
||||
<i class=\"fa fa-file\"></i> #{I18n.t('file.upload')}
|
||||
</label><div class=\"filename\"></div></div>#{value}".html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def render_email
|
||||
a = control_group_wrapper_for_sm do |key,value|
|
||||
place_holder= typeA["placeholder"][I18n.locale] rescue ''
|
||||
email_field_tag(get_field_name_base, value, @markup_options.merge(:placeholder=>place_holder,:class=>'input-medium form-control', title: I18n.t("seminar.email_hint"))) +
|
||||
(content_tag :div,:class=>"loader" do
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
def render_phone
|
||||
a = control_group_wrapper_for_sm do |key,value|
|
||||
place_holder= typeA["placeholder"][I18n.locale] rescue ''
|
||||
text_field_tag(get_field_name_base, value, @markup_options.merge(:placeholder=>place_holder,:class=>'input-medium form-control', pattern: "[\\d\\+\\-\\(\\)]{10,13}", title: I18n.t("seminar.phone_hint"))) + (content_tag :p do
|
||||
"(#{I18n.t("seminar.phone_hint")})"
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
def date_is_range?
|
||||
is_range = "false"
|
||||
data = get_data
|
||||
if !data.nil?
|
||||
is_range = data['is_range'] if data.has_key? "is_range"
|
||||
is_range = data['is_range'] if data.has_key? "is_range"
|
||||
end
|
||||
is_range == "true"
|
||||
is_range == "true"
|
||||
end
|
||||
|
||||
protected
|
||||
|
@ -239,7 +272,7 @@ protected
|
|||
div_class << (key == I18n.locale ? " active in" : '')
|
||||
content_tag(:div,yield(key,value), :id=>div_id,:class=>div_class)
|
||||
end# of VALID_LOCALES.collect for tabed input
|
||||
tmp2 = content_tag(:div,:class => 'btn-group', :data=>{:toggle=>"buttons-radio"}) do
|
||||
tmp2 = content_tag(:div,:class => 'btn-group', :data=>{:toggle=>"buttons-radio"}) do
|
||||
buff2 = valid_locales.each.collect do |key|
|
||||
# link_entry = self.add_more ? "#{add_more_tab(:tab_btn,loop_counter,key)}" : "#tab"+id.to_s+"_#{key}"
|
||||
if @show_set_field_for_sm && @markup=='text_area'
|
||||
|
@ -262,7 +295,7 @@ protected
|
|||
else
|
||||
|
||||
# tmp = content_tag :div,:class=> (add_more || self.markup=='address') ? "input-append" : "tab-content" do
|
||||
tmp1 =
|
||||
tmp1 =
|
||||
content_tag :div,:class=> "tab-content" do
|
||||
|
||||
buff = valid_locales.collect do |key|
|
||||
|
@ -289,7 +322,7 @@ protected
|
|||
|
||||
end
|
||||
|
||||
tmp2 = content_tag(:div,:class => 'btn-group', :data=>{:toggle=>"buttons-radio"}) do
|
||||
tmp2 = content_tag(:div,:class => 'btn-group', :data=>{:toggle=>"buttons-radio"}) do
|
||||
buff2 = valid_locales.each.collect do |key|
|
||||
# link_entry = self.add_more ? "#{add_more_tab(:tab_btn,loop_counter,key)}" : "#tab"+id.to_s+"_#{key}"
|
||||
link_entry_ary = ["##{get_pairing_tab_class({})}","_#{key}"]
|
||||
|
@ -304,7 +337,7 @@ protected
|
|||
end # of content ul
|
||||
|
||||
|
||||
|
||||
|
||||
tmp = content_tag :div,:class=> "input-append" do
|
||||
tmp1 << tmp2
|
||||
end
|
||||
|
@ -319,8 +352,8 @@ protected
|
|||
add_more_counter = ""
|
||||
|
||||
if can_add_more
|
||||
add_more_counter = add_more_params[0][:counter]
|
||||
add_more_value = add_more_params[0][:value]
|
||||
add_more_counter = add_more_params[0][:counter]
|
||||
add_more_value = add_more_params[0][:value]
|
||||
end
|
||||
|
||||
if can_muti_lang_input_for_sm?
|
||||
|
@ -330,7 +363,7 @@ protected
|
|||
else #cross lang field
|
||||
case can_add_more
|
||||
when true
|
||||
value = add_more_params[0][:value]
|
||||
value = add_more_params[0][:value]
|
||||
result << content_tag(:div,:class=>"input-append"){yield(nil,value) + link_to((content_tag :i,'',:class=>'icon-trash'),"#",:class=>"btn remove-input") }
|
||||
# result << add_more_unt
|
||||
else
|
||||
|
@ -346,7 +379,7 @@ protected
|
|||
|
||||
end # of def controls_wrapper_for_sm(&block)
|
||||
|
||||
def control_group_wrapper_for_sm(&block)
|
||||
def control_group_wrapper_for_sm(&block)
|
||||
div_class = can_muti_lang_input_for_sm? ? "col-sm-10 controls" : "col-sm-10 controls"
|
||||
# div_class = can_muti_lang_input_for_sm? ? "control-group language-swich" : "control-group"
|
||||
result = ""
|
||||
|
@ -357,7 +390,7 @@ protected
|
|||
|
||||
if can_add_more
|
||||
|
||||
multipleInputs =
|
||||
multipleInputs =
|
||||
content_tag(:div,:class=>"add-target") do
|
||||
@attribute_value.add_more_counter.times.collect do |t|
|
||||
controls_wrapper_for_sm(:value=>(@prefiled_value[t] rescue nil),:counter=>t,&block)
|
||||
|
@ -366,8 +399,8 @@ protected
|
|||
|
||||
|
||||
temp = content_tag(:div, multipleInputs + add_more_unt, :class=>'add-input')
|
||||
|
||||
result = form_label + content_tag(:div,temp,:class=>div_class)
|
||||
|
||||
result = form_label + content_tag(:div,temp,:class=>div_class)
|
||||
|
||||
# result = label + multipleInputs + add_more_unt
|
||||
# result = label + 一堆的輸入框(要用 multipleInput editMore 包起來) + add_more btn + hidden_fields
|
||||
|
@ -393,7 +426,7 @@ protected
|
|||
end
|
||||
|
||||
|
||||
def add_more_unt
|
||||
def add_more_unt
|
||||
temp_field_name = get_basic_field_name_base + '[temp]'
|
||||
add_more = content_tag :p,:class=> 'add-btn' do
|
||||
content = link_to (content_tag :i,I18n.t(:add),:class=>"icon-plus"),"#","data-roles"=>"role_a",:class=>"trigger #{can_muti_lang_input_for_sm? ? 'textLengInput' : 'textInput' } btn btn-small btn-primary"
|
||||
|
@ -432,7 +465,7 @@ protected
|
|||
prefix = opts[:prefix]
|
||||
suffix = opts[:suffix]
|
||||
str = get_basic_field_name_base.gsub("[","_").gsub("]",'')
|
||||
str = prefix.nil? ? str : prefix+ str
|
||||
str = prefix.nil? ? str : prefix+ str
|
||||
suffix.nil? ? str : str + suffix
|
||||
end
|
||||
|
||||
|
@ -454,7 +487,8 @@ protected
|
|||
|
||||
def form_label
|
||||
if self.markup == "text_area"
|
||||
plc = typeD["placeholder"][I18n.locale].to_s.blank? ? nil : "(#{typeD["placeholder"][I18n.locale]})"
|
||||
# plc = typeD["placeholder"][I18n.locale].to_s.blank? ? nil : "(#{typeD["placeholder"][I18n.locale]})"
|
||||
plc = nil
|
||||
label_tag(key, '' , :class=>"col-sm-2 control-label muted") do
|
||||
concat (!@require.blank? ? '*'+title : title)
|
||||
if plc
|
||||
|
@ -471,7 +505,7 @@ protected
|
|||
if self.markup == "address"
|
||||
return true
|
||||
else
|
||||
$seminar_list[:markups][markup]["muti_lang_input_supprt"] and !(get_data["cross_lang"] == "true")
|
||||
$seminar_list[:markups][markup]["muti_lang_input_supprt"] and !(get_data["cross_lang"] == "true")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -538,7 +572,7 @@ protected
|
|||
if markup=='text_field'
|
||||
if key_field == 'seminar_email_sets'
|
||||
inside = text_field_tag([get_field_name_base,"[#{key}]"].join,value,:class=>'input-medium form-control')
|
||||
else
|
||||
else
|
||||
inside = text_field_tag([get_field_name_base,"[#{key}]"].join,value)
|
||||
end
|
||||
else
|
||||
|
@ -552,4 +586,4 @@ protected
|
|||
@show_set_field_for_sm = nil
|
||||
return a.html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -50,6 +50,24 @@ module Admin::SeminarsHelper
|
|||
end
|
||||
# return "/#{I18n.locale}#{page.url}/#{seminar.to_param}"
|
||||
end
|
||||
def send_mail(field_name,email,seminar_id,extra_text="")
|
||||
email_set = @seminar.seminar_email_sets.select{|v| v.field_name == field_name}
|
||||
if email_set.length==0
|
||||
mail = Email.create(mail_to:[email],
|
||||
module_app_key:"seminar",
|
||||
template:"email/#{field_name}_email.html.erb",
|
||||
mail_sentdate:Time.current,
|
||||
mail_subject: t("seminar.email_#{field_name}_success"),
|
||||
template_data:{'seminar_id'=>seminar_id,'locale'=>I18n.locale,'extra_text'=> extra_text})
|
||||
elsif !(email_set[0].disabled)
|
||||
mail = Email.create(mail_to:[email],
|
||||
module_app_key:"seminar",
|
||||
template:"email/#{field_name}_email.html.erb",
|
||||
mail_sentdate:Time.current,
|
||||
mail_subject: email_set[0].title[I18n.locale],
|
||||
template_data:{'seminar_id'=>seminar_id,'locale'=>I18n.locale,'extra_text'=> extra_text})
|
||||
end
|
||||
end
|
||||
module MultiLang
|
||||
extend self
|
||||
extend ActionView::Helpers::FormTagHelper
|
||||
|
|
|
@ -6,5 +6,6 @@ class SeminarEmailSet
|
|||
field :title
|
||||
field :content
|
||||
field :disabled, type: Boolean, default: false
|
||||
field :is_confirmation, type: Boolean, default: false
|
||||
belongs_to :seminar_main
|
||||
end
|
||||
|
|
|
@ -18,6 +18,7 @@ class SeminarMain
|
|||
field :title, as: :slug_title, type: String, localize: true
|
||||
field :speaker, localize: true
|
||||
field :content, localize: true
|
||||
field :signup_success, localize: true
|
||||
field :act_place, localize: true
|
||||
field :enable_summary_choice, :type => Boolean, :default => false
|
||||
field :summary_chioice_type, :type => String, :default => "checkbox"
|
||||
|
@ -34,7 +35,7 @@ class SeminarMain
|
|||
|
||||
field :contribute_start_date, :type => Date
|
||||
field :contribute_end_date, :type => Date
|
||||
|
||||
|
||||
field :contribute_file_count, type: String
|
||||
|
||||
field :registration_status , :type => Array #C: 投稿者 G:一般
|
||||
|
@ -311,7 +312,7 @@ class SeminarMain
|
|||
r = "#{date1.strftime('%Y-%m-%d')}"
|
||||
|
||||
if date2
|
||||
r += " - #{date2.strftime('%Y-%m-%d')}"
|
||||
r += " - #{date2.strftime('%Y-%m-%d')}"
|
||||
else
|
||||
r += " - #{I18n.t(:no_deadline)}"
|
||||
end
|
||||
|
@ -401,7 +402,7 @@ class SeminarMain
|
|||
def get_attribute_values(attribute_type=nil)
|
||||
@attribute_values = attribute_type.seminar_signup_values rescue nil
|
||||
end
|
||||
|
||||
|
||||
def get_value_from_field_id(field_id,attribute_type=nil)
|
||||
values = get_attribute_values(attribute_type)
|
||||
value = values.detect {|value| value.seminar_signup_field_id == field_id} rescue nil
|
||||
|
@ -436,7 +437,7 @@ class SeminarMain
|
|||
seminar_signup = need_change_seminar_signups[i]
|
||||
if seminar_signup.seminar_session_ids.present?
|
||||
seminar_signup.seminar_session_ids = seminar_signup.seminar_session_ids.map{|id| @records_all["seminar_session_ids"][id]} rescue []
|
||||
end
|
||||
end
|
||||
end
|
||||
count_array = (0...self.seminar_reviews.to_a.count).to_a
|
||||
change_fields = [:seminar_signup_ids, :remove_seminar_signup_ids, :default_seminar_signup_ids]
|
||||
|
@ -515,7 +516,7 @@ class SeminarMain
|
|||
tmp_relations_fields << k
|
||||
else
|
||||
org_k = k.to_s
|
||||
result = other_has_many_class.map do |k|
|
||||
result = other_has_many_class.map do |k|
|
||||
belongs_to_class = k.classify.constantize.relations.select{|kk,v| v.macro == :belongs_to}.keys
|
||||
has_many_class = k.classify.constantize.relations.select{|kk,v| v.macro.to_s.start_with?('has') }.keys
|
||||
if (belongs_to_class - tmp_singularize_relations_fields - [org_k]).count == 0
|
||||
|
@ -693,4 +694,8 @@ class SeminarMain
|
|||
def enable_review_result
|
||||
self.assign_mode == 2
|
||||
end
|
||||
end
|
||||
def to_param
|
||||
tmp = super()
|
||||
URI.encode(tmp)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,11 +3,19 @@ class SeminarSignup
|
|||
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
HiddenFields = ['seminar_signup_id','_id', 'created_at', 'updated_at','seminar_main_id',"serial_number","final_session","final_sessions","preferred_sessions",'seminar_session_id',"seminar_session_ids","preferred_session","sort_number","abstract_number","presentation_type", "filename"]
|
||||
HiddenFields = ['seminar_signup_id','_id', 'created_at', 'updated_at','seminar_main_id',"serial_number","final_session","final_sessions","preferred_sessions",'seminar_session_id',"seminar_session_ids","preferred_session","sort_number","abstract_number","presentation_type", "filename", "token", "reset_token", "emails_sent"]
|
||||
DefaultEnableFields = ['status','name','tel','phone','email','password','recaptcha']
|
||||
field :sort_number , type: Integer, default: 10000
|
||||
|
||||
field :status
|
||||
field :token
|
||||
field :is_confirmed, type: Boolean, default: false # for email confirmation
|
||||
field :signup_confirmed, type: Boolean, default: false
|
||||
field :is_confirmed_date, type: DateTime
|
||||
field :signup_confirmed_date, type: DateTime
|
||||
field :signup_confirmed_counter, type: Integer, default: 0
|
||||
field :emails_sent, type: Array, default: []
|
||||
field :emails_sent_time, type: Array, default: []
|
||||
field :name # become Last Name for TICC
|
||||
field :tel, type: String # become First Name for TICC
|
||||
field :unit, localize: true #Only localize for preserving old record
|
||||
|
@ -26,7 +34,7 @@ class SeminarSignup
|
|||
field :seminar_session_ids, type: Array, default: []
|
||||
has_many :seminar_signup_values, :autosave => true, :dependent => :destroy
|
||||
has_many :seminar_signup_contributes, :autosave => true, :dependent => :destroy
|
||||
|
||||
|
||||
accepts_nested_attributes_for :seminar_signup_values, allow_destroy: true
|
||||
accepts_nested_attributes_for :seminar_signup_contributes, allow_destroy: true
|
||||
scope :sort_ordered, ->{ order_by(:sort_number=>1,:created_at=>1) }
|
||||
|
@ -51,10 +59,12 @@ class SeminarSignup
|
|||
[l, (tmp ? tmp : unit)]
|
||||
end.to_h
|
||||
if self.serial_number.nil?
|
||||
last_serial_number = SeminarMain.where(:id=>self.seminar_main_id).max(:last_serial_number).to_i
|
||||
self.serial_number = last_serial_number + 1
|
||||
SeminarMain.where(:id=>self.seminar_main_id).update_all({"$inc"=>{"last_serial_number"=>1}})
|
||||
# last_serial_number = SeminarMain.where(:id=>self.seminar_main_id).max(:last_serial_number).to_i
|
||||
# self.serial_number = last_serial_number + 1
|
||||
# SeminarMain.where(:id=>self.seminar_main_id).update_all({"$inc"=>{"last_serial_number"=>1}})
|
||||
self.serial_number = DateTime.now.to_i
|
||||
end
|
||||
self.token = SecureRandom.hex(5)
|
||||
end
|
||||
after_destroy do
|
||||
seminar_main = self.seminar_main
|
||||
|
@ -69,7 +79,7 @@ class SeminarSignup
|
|||
sr.save
|
||||
end
|
||||
end
|
||||
seminar_main.seminar_signups.delete(self) #avoid resave
|
||||
seminar_main.seminar_signups.delete(self) #avoid resave
|
||||
if seminar_main.unassigned_seminar_signup_ids.delete(id)
|
||||
seminar_main.save
|
||||
end
|
||||
|
@ -80,6 +90,13 @@ class SeminarSignup
|
|||
seminar_session.save
|
||||
end
|
||||
end
|
||||
|
||||
def generate_token
|
||||
token = SecureRandom.hex(5)
|
||||
self.token = token
|
||||
self.save
|
||||
return token
|
||||
end
|
||||
def display_serial_number
|
||||
display_format_string(self.serial_number,4)
|
||||
end
|
||||
|
@ -175,4 +192,8 @@ class SeminarSignup
|
|||
return all_fields
|
||||
end
|
||||
end
|
||||
|
||||
def emails_sent_groups
|
||||
emails_sent.zip([nil]*(emails_sent.length-emails_sent_time.length) + emails_sent_time.collect{|v| v.in_time_zone})
|
||||
end
|
||||
end
|
||||
|
|
|
@ -15,15 +15,16 @@ class SeminarSignupField
|
|||
field :built_in, type: Boolean, default: false
|
||||
field :disabled, type: Boolean, default: false
|
||||
# field :to_delete, type: Boolean, default: false
|
||||
|
||||
|
||||
field :to_require,type: Boolean, default: true
|
||||
|
||||
|
||||
field :typeA, type: Hash, default: {cross_lang: false}
|
||||
field :typeB, type: Hash, default: {}
|
||||
field :typeC, type: Hash, default: {calendar: "west_calendar", format: "format3"}
|
||||
field :typeD, type: Hash, default: {cross_lang: false}
|
||||
field :typeE, type: Hash, default: {}
|
||||
field :typeF, type: Hash, default: {}
|
||||
field :typeG, type: Hash, default: {}
|
||||
belongs_to :seminar_main
|
||||
has_many :seminar_signup_values, autosave: true, dependent: :destroy
|
||||
accepts_nested_attributes_for :seminar_signup_values, :allow_destroy => true
|
||||
|
@ -57,8 +58,8 @@ class SeminarSignupField
|
|||
|
||||
def option_list
|
||||
if self_defined_markup_options?
|
||||
#Class need to have corresponding field and value agent
|
||||
# Ex: For "status" the class must have field called "statuses" for the relation and "statuses_for_select" for the select function
|
||||
#Class need to have corresponding field and value agent
|
||||
# Ex: For "status" the class must have field called "statuses" for the relation and "statuses_for_select" for the select function
|
||||
method = self.seminar.method(self[:key].pluralize+"_for_"+markup)
|
||||
return (method.call rescue {})
|
||||
elsif self[:option_list].nil? || (self[:option_list].empty?)
|
||||
|
@ -103,7 +104,7 @@ class SeminarSignupField
|
|||
def is_built_in?
|
||||
self.built_in
|
||||
end
|
||||
|
||||
|
||||
def is_disabled?
|
||||
self.disabled
|
||||
end
|
||||
|
@ -131,7 +132,7 @@ class SeminarSignupField
|
|||
if self[field]["cross_lang"] != var["cross_lang"]
|
||||
case var["cross_lang"]
|
||||
when "true" #from no-add_more to add_more
|
||||
cross_lang_convert(:to_cross_lang)
|
||||
cross_lang_convert(:to_cross_lang)
|
||||
else #from add_more to no-add_more
|
||||
cross_lang_convert(:to_no_cross_lang)
|
||||
end # of case
|
||||
|
@ -142,23 +143,23 @@ class SeminarSignupField
|
|||
if self["typeA"]["add_more"] != var["add_more"]
|
||||
case var["add_more"]
|
||||
when "true" #from no-add_more to add_more
|
||||
add_more_convert(:to_add_more)
|
||||
add_more_convert(:to_add_more)
|
||||
else #from add_more to no-add_more
|
||||
add_more_convert(:to_no_add_more)
|
||||
end # of case
|
||||
end # of if
|
||||
end
|
||||
|
||||
def cross_lang_convert(opt)
|
||||
|
||||
def cross_lang_convert(opt)
|
||||
|
||||
end
|
||||
|
||||
def check_option_list
|
||||
self[:option_list] = self[panel]["option_list"] rescue nil
|
||||
end
|
||||
|
||||
def add_more_convert(opt)
|
||||
def add_more_convert(opt)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,6 +5,7 @@ class SeminarSignupFieldSet
|
|||
field :field_name, type: String
|
||||
field :placeholder
|
||||
field :name
|
||||
field :validator
|
||||
field :disabled, type: Boolean, default: false
|
||||
field :hidden, type: Boolean, default: false
|
||||
belongs_to :seminar_main
|
||||
|
|
|
@ -24,6 +24,7 @@ class SeminarSubmissionField
|
|||
field :typeD, type: Hash, default: {cross_lang: false}
|
||||
field :typeE, type: Hash, default: {}
|
||||
field :typeF, type: Hash, default: {cross_lang: "true"}
|
||||
field :typeG, type: Hash, default: {}
|
||||
belongs_to :seminar_main
|
||||
has_many :seminar_submission_values, autosave: true, dependent: :destroy
|
||||
accepts_nested_attributes_for :seminar_submission_values, :allow_destroy => true
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%= form_for @seminar_signup, url: admin_seminar_signup_path(@seminar_signup), html: {class: "form-horizontal main-forms"} do |f| %>
|
||||
<%= form_for @seminar_signup, url: admin_seminar_signup_path(@seminar_signup), html: {class: "form-horizontal main-forms", multipart: true} do |f| %>
|
||||
<fieldset>
|
||||
|
||||
<% content_for :page_specific_css do %>
|
||||
|
@ -14,7 +14,15 @@
|
|||
<%= javascript_include_tag "lib/file-type" %>
|
||||
<%= javascript_include_tag "lib/module-area" %>
|
||||
<% end %>
|
||||
|
||||
<style type="text/css">
|
||||
.emails_sent_groups{
|
||||
display: inline-block;
|
||||
}
|
||||
.emails_sent_time{
|
||||
min-height: 1em;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
<!-- Input Area -->
|
||||
<div class="input-area">
|
||||
|
||||
|
@ -92,6 +100,63 @@
|
|||
<div class="controls">
|
||||
<%= f.email_field :email, :class=>"input-block-level", :placeholder=> signup_field.placeholder[I18n.locale], :required => true %>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<label class="radio-inline">
|
||||
<%= f.check_box :is_confirmed, :checked => (@seminar_signup.is_confirmed)%>
|
||||
<%= f.hidden_field :is_confirmed_date %>
|
||||
<%= t('seminar_signup.is_confirmed') %>
|
||||
</label>
|
||||
</div>
|
||||
<br />
|
||||
<div class="controls">
|
||||
<label for="send_email" class="control-label muted"><%= t("seminar_signup.send_email") %></label>
|
||||
<div class="controls">
|
||||
<select name="send_email" id="send_email">
|
||||
<option value=""><%= t("seminar.select_email_type") %></option>
|
||||
<option value="reset_password"><%= t("seminar.reset_password") %></option>
|
||||
<option value="special_reminder"><%= t("seminar.special_reminder") %></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="controls">
|
||||
<label class="control-label muted"><%= t("seminar_signup.predefined_text") %></label>
|
||||
<div class="controls">
|
||||
<p id="predefined_text"> </p>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="controls">
|
||||
<label for="send_email_text" class="control-label muted"><%= t("seminar_signup.send_email_text") %></label>
|
||||
<div class="controls">
|
||||
<textarea class="" name="send_email_text" id="send_email_text" row="20" col="30"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="controls">
|
||||
<div class="controls">
|
||||
<a class="btn" id="send_email_button"><%= t("seminar.send_email_button") %></a>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="controls">
|
||||
<label for="" class="control-label muted"><%= t("seminar_signup.emails_already_sent") %></label>
|
||||
<div class="controls" id="emails_sent">
|
||||
<% @seminar_signup.emails_sent_groups.each do |em, em_date| %>
|
||||
<span class="emails_sent_groups">
|
||||
<span class="label label-success">
|
||||
<%= t("seminar.#{em}") %>
|
||||
</span>
|
||||
<br />
|
||||
<span class="emails_sent_time">
|
||||
<% if em_date %>
|
||||
<%= em_date.strftime("%Y/%m/%d %H:%M") %>
|
||||
<% end %>
|
||||
</span>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'note' %>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
|
@ -170,7 +235,7 @@
|
|||
|
||||
<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>
|
||||
|
||||
|
@ -178,7 +243,13 @@
|
|||
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="controls">
|
||||
<label class="radio-inline">
|
||||
<%= f.check_box :signup_confirmed, :checked => (@seminar_signup.signup_confirmed)%>
|
||||
<%= f.hidden_field :signup_confirmed_date %>
|
||||
<%= t('seminar_signup.registration_complete') %>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -193,4 +264,78 @@
|
|||
|
||||
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#send_email").on("change", function(){
|
||||
if($(this).val() != ""){
|
||||
let type = $(this).val();
|
||||
$.ajax({
|
||||
url : "/admin/seminars/get_predefined_text",
|
||||
data : {"type" : type, "seminar_id": "<%= @seminar.id %>"},
|
||||
dataType : "json",
|
||||
type : "get",
|
||||
success : function(data){
|
||||
if (type === 'reset_password'){
|
||||
$('#seminar_signup_status_c').click();
|
||||
}
|
||||
if( data.success == true ){
|
||||
$("#predefined_text").html(data.html);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
$("#send_email_button").on("click",function(){
|
||||
if($("#seminar_signup_email").val() == ""){
|
||||
alert("No email");
|
||||
return false;
|
||||
}
|
||||
if($("#send_email").val() != ""){
|
||||
$.ajax({
|
||||
url : "/admin/seminars/send_notifying_email",
|
||||
data : {
|
||||
"type" : $("#send_email").val(),
|
||||
"email" : $("#seminar_signup_email").val(),
|
||||
"text" : $("#send_email_text").val(),
|
||||
"seminar_id": "<%= @seminar.id %>"
|
||||
},
|
||||
dataType : "json",
|
||||
type : "post",
|
||||
success : function(data){
|
||||
if( data.success == true ){
|
||||
alert("Email Sent");
|
||||
$("#emails_sent").append('<span class="emails_sent_groups"><span class="label label-success">'+ data.type +'</span><br/><span class="emails_sent_time">' +data.sent_time +'</span></span>');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
return false;
|
||||
})
|
||||
})
|
||||
$(".upload").on("change",function(){
|
||||
filenamedom = $(this).parent().parent().find(".filename");
|
||||
filenameA = $(this).val().split('\\');
|
||||
filenamedom.text(filenameA[filenameA.length - 1]);
|
||||
})
|
||||
$("#seminar_signup_signup_confirmed").on("change",function () {
|
||||
if(this.checked){
|
||||
dt = new Date();
|
||||
format = dt.getFullYear() + "/" + (dt.getMonth() + 1) + "/" + dt.getDate() + " " + dt.getHours() + ":" + dt.getMinutes();
|
||||
$("#seminar_signup_signup_confirmed_date").val(format);
|
||||
}else{
|
||||
$("#seminar_signup_signup_confirmed_date").val("");
|
||||
}
|
||||
})
|
||||
|
||||
$("#seminar_signup_is_confirmed").on("change",function () {
|
||||
if(this.checked){
|
||||
dt = new Date();
|
||||
format = dt.getFullYear() + "/" + (dt.getMonth() + 1) + "/" + dt.getDate() + " " + dt.getHours() + ":" + dt.getMinutes();
|
||||
$("#seminar_signup_is_confirmed_date").val(format);
|
||||
}else{
|
||||
$("#seminar_signup_is_confirmed_date").val("");
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
|
@ -129,6 +129,34 @@
|
|||
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[seminar_signup_fields_attributes][#{@af_counter}][typeE][option_list]",:values=>attribute_field["typeE"]["option_list"]}%>
|
||||
<% end if show_seminar_type_panel(attribute_field,"typeE") != 'typeE hide' %>
|
||||
|
||||
<%= content_tag :div,:class=>"field-type default fade in #{show_seminar_type_panel(attribute_field,"typeG")}" do%>
|
||||
<% typeG_field_name = "#{@field_name}[seminar_signup_fields_attributes][#{@af_counter}][typeG][instructions]" %>
|
||||
<%= content_tag :div, class: "control-group" do %>
|
||||
<label class="control-label muted" for=""><%= t('lists.markups.instructions') %></label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<div class="btn-group-clearfix">
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
|
||||
<%= link_to t(locale).to_s,"##{name_to_id(typeG_field_name)}_#{locale}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<% active = (locale == @site_in_use_locales.first ? "active in" : "'") %>
|
||||
<%= content_tag :div, {class: "tab-pane fade #{active}", id: "#{name_to_id(typeG_field_name)}_#{locale}"} do %>
|
||||
<% locale_value = (attribute_field["typeG"].present? ? attribute_field["typeG"]["instructions"][locale.to_s] : "") %>
|
||||
<%= text_area(typeG_field_name, locale, value: locale_value, placeholder: "#{t(locale).to_s}", data: {:type=>"lang_#{locale}"}, class: 'ckeditor') %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end if show_seminar_type_panel(attribute_field,"typeG") != 'typeG hide' %>
|
||||
|
||||
<%= hidden_field "#{@field_name}[seminar_signup_fields_attributes][#{@af_counter}]","id",:value=>attribute_field.id%>
|
||||
|
||||
</div>
|
|
@ -128,6 +128,7 @@
|
|||
<%= content_tag :div,:class=>"field-type default fade in #{show_seminar_type_panel(attribute_submission_field,"typeE")}" do%>
|
||||
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[seminar_submission_fields_attributes][#{@af_counter}][typeE][option_list]",:values=>attribute_submission_field["typeE"]["option_list"]}%>
|
||||
<% end if show_seminar_type_panel(attribute_submission_field,"typeE") != 'typeE hide' %>
|
||||
|
||||
<%= content_tag :div,:class=>"field-type default fade in #{show_seminar_type_panel(attribute_submission_field,"typeF")}" do%>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted" for=""><%= t(:options)%></label>
|
||||
|
@ -140,6 +141,35 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end if show_seminar_type_panel(attribute_submission_field,"typeF") != 'typeF hide' %>
|
||||
|
||||
<%= content_tag :div,:class=>"field-type default fade in #{show_seminar_type_panel(attribute_submission_field,"typeG")}" do%>
|
||||
<% typeG_field_name = "#{@field_name}[seminar_signup_fields_attributes][#{@af_counter}][typeG][instructions]" %>
|
||||
<%= content_tag :div, class: "control-group" do %>
|
||||
<label class="control-label muted" for=""><%= t('lists.markups.instructions') %></label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<div class="btn-group-clearfix">
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
|
||||
<%= link_to t(locale).to_s,"##{name_to_id(typeG_field_name)}_#{locale}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<% active = (locale == @site_in_use_locales.first ? "active in" : "'") %>
|
||||
<%= content_tag :div, {class: "tab-pane fade #{active}", id: "#{name_to_id(typeG_field_name)}_#{locale}"} do %>
|
||||
<% locale_value = (attribute_submission_field["typeG"].present? ? attribute_submission_field["typeG"]["instructions"][locale.to_s] : "") %>
|
||||
<%= text_area(typeG_field_name, locale, value: locale_value, placeholder: "#{t(locale).to_s}", data: {:type=>"lang_#{locale}"}, class: 'ckeditor') %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end if show_seminar_type_panel(attribute_submission_field,"typeG") != 'typeG hide' %>
|
||||
|
||||
<%= hidden_field "#{@field_name}[seminar_submission_fields_attributes][#{@af_counter}]","id",:value=>attribute_submission_field.id%>
|
||||
|
||||
</div>
|
|
@ -184,6 +184,7 @@
|
|||
<th><%= t('seminar.placeholder') %></th>
|
||||
<th><%= t('seminar.disable') %></th>
|
||||
<th><%= t('seminar.hidden') %></th>
|
||||
<th><%= t('seminar.validator') %> <br /> (Use regex pattern)</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @signup_sets.each_with_index do |attr_signup,signup_index| %>
|
||||
|
@ -208,6 +209,13 @@
|
|||
<%= check_box_tag("seminar_main[seminar_signup_field_sets_attributes][#{signup_index}][hidden]", true ,attr_signup.hidden) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% if attr_signup.field_name == "password" %>
|
||||
<td>
|
||||
<%= text_field_tag("seminar_main[seminar_signup_field_sets_attributes][#{signup_index}][validator]", attr_signup.validator) %>
|
||||
</td>
|
||||
<% else %>
|
||||
<td> </td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
@ -325,9 +333,19 @@
|
|||
<%= t('seminar.email_edit_file') %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#email_set4" data-toggle="tab">
|
||||
<%= t('seminar.email_forgot_password') %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#email_set5" data-toggle="tab">
|
||||
<%= t('seminar.email_special_reminder') %>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<% (0..3).each do |index1| %>
|
||||
<% (0..5).each do |index1| %>
|
||||
<% active_email_set = index1==0 ? ' active' : '' %>
|
||||
<div class="tab-pane<%= active_email_set %>" id="email_set<%= index1 %>" style="padding: 1.2em;">
|
||||
<table style="width:100%;">
|
||||
|
@ -341,6 +359,17 @@
|
|||
<%= check_box_tag("seminar_main[seminar_email_sets_attributes][#{index1}][disabled]", true ,@email_set[index1].disabled) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% if index1 == 0 %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= t('seminar.is_confirmation') %>
|
||||
</td>
|
||||
<td>
|
||||
<input type="hidden" class="field_set" name='<%= "seminar_main[seminar_email_sets_attributes][#{index1}][is_confirmation]" %>' value="false">
|
||||
<%= check_box_tag("seminar_main[seminar_email_sets_attributes][#{index1}][is_confirmation]", true ,@email_set[index1].is_confirmation) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= t('seminar.email_title') %>
|
||||
|
|
|
@ -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/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_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="<%=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>
|
||||
|
@ -40,7 +41,7 @@
|
|||
</td>
|
||||
<td><%= SeminarMain.time_range(seminar.seminar_start_date, seminar.seminar_end_date) %></td>
|
||||
<td><%= SeminarMain.time_range(seminar.signup_start_date, seminar.signup_end_date) %></td>
|
||||
<td><a href="/admin/seminars/<%=seminar.id.to_s%>/seminar_signup">
|
||||
<td><a href="/admin/seminars/<%=seminar.id.to_s%>/seminar_signup?type=table">
|
||||
<% @seminar_review = seminar.seminar_reviews.where(:reviewer_id => current_user.member_profile_id.to_s).first %>
|
||||
<% if @seminar_review.present? && !@can_edit %>
|
||||
<%= @seminar_review.get_all_seminar_signup_ids.count %>
|
||||
|
|
|
@ -52,14 +52,39 @@
|
|||
val += "<div class=\"quick-edit\">
|
||||
<ul class=\"nav nav-pills\">"
|
||||
if @can_edit
|
||||
val += "<li><a href=\"/admin/seminar_signups/#{seminar_signup.id}/edit\">#{t(:edit)}</a></li>
|
||||
<li><a href=\"#{admin_seminar_signup_path(seminar_signup.id)}\" class=\"delete text-error\" rel=\"nofollow\" data-method=\"delete\" data-confirm=\"Are you sure?\">#{t(:delete_)}</a></li>"
|
||||
val += content_tag :li do
|
||||
link_to t(:edit), edit_admin_seminar_signup_path(seminar_signup.id)
|
||||
end
|
||||
val += content_tag :li do
|
||||
link_to t(:delete_), admin_seminar_signup_path(seminar_signup.id), class: "text-error", method: :delete, "data-confirm" => "Are you sure?"
|
||||
end
|
||||
end
|
||||
val += "</ul>
|
||||
</div>"
|
||||
%>
|
||||
<% 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 = "<span class='label label-success'>#{t("seminar_signup.email_confirmed")}(#{seminar_signup.signup_confirmed_counter.to_s})</span>"
|
||||
else
|
||||
val = "<span class='label label-danger'>#{t("seminar_signup.email_not_confirmed")}</span>"
|
||||
end
|
||||
%>
|
||||
<% elsif names[1] == 'signup_confirmed' %>
|
||||
<% if seminar_signup.signup_confirmed
|
||||
val = "<span class='label label-success'>#{t("seminar_signup.signup_confirmed")}</span>"
|
||||
else
|
||||
val = "<span class='label label-danger'>#{t("seminar_signup.signup_not_confirmed")}</span>"
|
||||
end
|
||||
%>
|
||||
<% elsif names[1] == 'signup_confirmed_date' %>
|
||||
<% val = seminar_signup.signup_confirmed_date.strftime("%Y/%m/%d %H:%M") rescue ""
|
||||
%>
|
||||
<% elsif names[1] == 'is_confirmed_date' %>
|
||||
<%
|
||||
val = seminar_signup.is_confirmed_date.strftime("%Y/%m/%d %H:%M") rescue ""
|
||||
%>
|
||||
<% elsif names[1] != 'recaptcha' %>
|
||||
<% val = seminar_signup.send("#{names[1]}") %>
|
||||
<% end %>
|
||||
|
@ -69,15 +94,19 @@
|
|||
val += "<div class=\"quick-edit\">
|
||||
<ul class=\"nav nav-pills\">"
|
||||
if @can_edit
|
||||
val += "<li><a href=\"/admin/seminar_signups/#{seminar_signup.id}/edit\">#{t(:edit)}</a></li>
|
||||
<li><a href=\"#{admin_seminar_signup_path(seminar_signup.id)}\" class=\"delete text-error\" rel=\"nofollow\" data-method=\"delete\" data-confirm=\"Are you sure?\">#{t(:delete_)}</a></li>"
|
||||
val += content_tag :li do
|
||||
link_to t(:edit), edit_admin_seminar_signup_path(seminar_signup.id)
|
||||
end
|
||||
val += content_tag :li do
|
||||
link_to t(:delete_), admin_seminar_signup_path(seminar_signup.id), class: "text-error", method: :delete, "data-confirm" => "Are you sure?"
|
||||
end
|
||||
end
|
||||
val += "</ul>
|
||||
</div>"
|
||||
%>
|
||||
<% 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" %>
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
|
||||
|
||||
<script id="template-type" type="text/x-tmpl">
|
||||
{{if templateType == 'typeA' || templateType == 'typeD' || templateType == 'typeG'}}
|
||||
{{if templateType == 'typeA' || templateType == 'typeD'}}
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t(:enabled_for)%></label>
|
||||
<div class="controls">
|
||||
|
@ -122,7 +122,7 @@
|
|||
<%= t(:cross_lang) %>
|
||||
</label>
|
||||
{{/if}}
|
||||
{{if templateType == 'typeA' || templateType == 'typeG'}}
|
||||
{{if templateType == 'typeA'}}
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" data-type="extendable_field" id="${_add_more[0]}" name="${_add_more[1]}" value="true">
|
||||
<%= t(:add_more)%>
|
||||
|
@ -257,6 +257,35 @@
|
|||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{if templateType == 'typeG'}}
|
||||
<div class="control-group">
|
||||
<label class="control-label muted">
|
||||
<%= t('lists.markups.instructions') %>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<div class="btn-group-clearfix">
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
|
||||
<a class="btn <%= active %>" href="${'#'+_instructions[0]+'_<%= locale %>'}" data-toggle="tab">
|
||||
<%= t(locale).to_s %>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<% @site_in_use_locales.each do |locale| %>
|
||||
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
|
||||
<div class="tab-pane <%= active %> fade in" id="${_instructions[0]+'_<%= locale %>'}">
|
||||
<textarea class="ckeditor" data-type="lang_<%= locale %>" placeholder="<%= t(locale).to_s %>" name="${_instructions[1]+'[<%= locale %>]'}"></textarea>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
<%= stylesheet_link_tag "lib/main-forms.css" %>
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
<%= stylesheet_link_tag "lib/main-forms.css" %>
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
|
||||
<%= javascript_include_tag "seminar-field-forms.js" %>
|
||||
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
|
||||
<%= javascript_include_tag "seminar-field-forms.js" %>
|
||||
<% end -%>
|
||||
|
||||
<%= form_for @attribute,:url => admin_seminar_path(@attribute) , :html => { :class=> "form-horizontal main-forms" } do |f| %>
|
||||
<%= form_for @attribute, url: admin_seminar_path(@attribute) , html: { class: "form-horizontal main-forms" } do |f| %>
|
||||
<% if flash.now[:notice].present? %>
|
||||
<%= flash.now[:notice]%>
|
||||
<% end %>
|
||||
|
@ -19,7 +19,7 @@
|
|||
<fieldset>
|
||||
|
||||
<div id="attributes-area" class="input-area sortable">
|
||||
<%= render partial: "attribute_field",collection: @attribute.seminar_signup_fields.asc(:sort_number, :_id)%>
|
||||
<%= render partial: "attribute_field", collection: @attribute.seminar_signup_fields.asc(:sort_number, :_id)%>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
|
|
|
@ -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,15 +1,15 @@
|
|||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
<%= stylesheet_link_tag "lib/main-forms.css" %>
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
<%= stylesheet_link_tag "lib/main-forms.css" %>
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
|
||||
<%= javascript_include_tag "seminar-field-forms-submission.js" %>
|
||||
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
|
||||
<%= javascript_include_tag "seminar-field-forms-submission.js" %>
|
||||
<% end -%>
|
||||
<%= form_for @attribute,:url => admin_seminar_path(@attribute) , :html => { :class=> "form-horizontal main-forms" } do |f| %>
|
||||
<%= form_for @attribute, url: admin_seminar_path(@attribute) , html: { class: "form-horizontal main-forms" } do |f| %>
|
||||
<% if flash.now[:notice].present? %>
|
||||
<%= flash.now[:notice]%>
|
||||
<% end %>
|
||||
|
|
|
@ -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 %>
|
|
@ -1,9 +1,9 @@
|
|||
<% 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[0].content.nil?) %>
|
||||
<%= email_set[0].content[@data['locale']].html_safe %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= t('seminar.email_signup_content') %>
|
||||
<% end %>
|
||||
<%= (@data['extra_text'] rescue "").to_s.html_safe %>
|
||||
<% end %>
|
|
@ -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 %>
|
|
@ -9,7 +9,7 @@
|
|||
color: red;
|
||||
}
|
||||
</style>
|
||||
<% if (@seminar.contribute_start_date <= @time_now && (@seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) rescue false) %>
|
||||
<% if (@seminar.contribute_start_date.nil? || @seminar.contribute_start_date <= @time_now) && (@seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) %>
|
||||
|
||||
<section id="main-wrap">
|
||||
<div class="sign-in have-other-sign-in">
|
||||
|
@ -39,6 +39,9 @@
|
|||
<%= password_field_tag :password, nil, :placeholder => t(:dots), :id=>"user_password" %>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="control-group clear">
|
||||
<a href="<%= request.original_url.split(request.env["HTTP_HOST"]).last.split('?').first + "?method=reset_email" %>"><%= t('seminar_signup.forgot_password') %></a>
|
||||
</div>
|
||||
<input type="hidden" name="referer_url" value="<%= request.original_url.split(request.env["HTTP_HOST"]).last.split('?').first %>">
|
||||
<input type="hidden" name="seminar_signup[seminar_main_id]" value="<%= @seminar.id %>">
|
||||
<button class="btn btn-primary" name="button" type="submit"><%= t('seminar_signup.login') %></button>
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
data1 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='title'}[0]
|
||||
data2 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='description'}[0]
|
||||
data3 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='file'}[0]
|
||||
show1 = !(data1.disabled) rescue false
|
||||
show2 = !(data2.disabled) rescue false
|
||||
show3 = !(data3.disabled) rescue false
|
||||
show1 = data1 ? !(data1.disabled) : false
|
||||
show2 = data2 ? !(data2.disabled) : false
|
||||
show3 = data3 ? !(data3.disabled) : false
|
||||
name1 = data1['name'][I18n.locale]
|
||||
name2 = data2['name'][I18n.locale]
|
||||
name3 = data3['name'][I18n.locale]
|
||||
|
@ -21,17 +21,17 @@
|
|||
else
|
||||
prefix_url = OrbitHelper.url_to_show(@seminar.to_param)
|
||||
end
|
||||
|
||||
%>
|
||||
<% if @seminar.contribute_start_date <= @time_now and ( @seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) %>
|
||||
<h3 style="display:block;"><%= @seminar.title %></h3>
|
||||
<% if (@seminar.contribute_start_date.nil? || @seminar.contribute_start_date <= @time_now) && ( @seminar.contribute_end_date.nil? || @seminar.contribute_end_date+1 >= @time_now ) %>
|
||||
<% begin %>
|
||||
<% if !session[:seminar_signup_id].blank? %>
|
||||
<%=t('seminar_signup.serial_number') %>: <%=@seminar_signup.display_serial_number rescue ""%>
|
||||
<a href="<%= prefix_url %>?method=con_logout&con_no=<%= @seminar.id %>" class='btn btn-primary'><%= t('seminar_signup.logout') %></a>
|
||||
|
||||
<%= t('seminar_signup.serial_number') %>: <%=@seminar_signup.display_serial_number rescue ""%>
|
||||
<a href="<%= prefix_url %>?method=con_logout&con_no=<%= @seminar.id %>" class='btn btn-primary' style="display:inline;"><%= t('seminar_signup.logout') %></a>
|
||||
<a href="<%= prefix_url %>?method=edit_login_seminar_signup&con_no=<%= @seminar.id %>" class='btn btn-primary' style="display:inline;"><%= t('seminar_signup.edit_form') %></a>
|
||||
<% if data["show"] %>
|
||||
<table class="table table-hover table-striped seminar-index">
|
||||
<caption>
|
||||
<h3><%= @seminar.title %></h3>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<% if show1 %>
|
||||
|
@ -91,6 +91,7 @@
|
|||
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('seminar_signup.new_'), prefix_url + '?method=add_file', :class => 'btn btn-primary' %>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<% # encoding: utf-8 %>
|
||||
<%
|
||||
data = action_data("confirm_email_page")
|
||||
if data["url"]
|
||||
url = data["url"]
|
||||
end
|
||||
%>
|
||||
<br>
|
||||
<% if (data['confirm'] == true) %>
|
||||
<%= t('seminar.confirm_ok') %>
|
||||
<br>
|
||||
<a href="<%= url %>?method=con_login" class="btn btn-primary">
|
||||
<%= t('seminar.click_to_contribute') %>
|
||||
</a>
|
||||
<% else %>
|
||||
<%= t('seminar.confirm_not_ok') %>
|
||||
<br>
|
||||
<a href="<%= url %>?method=show_data" class="btn btn-primary">
|
||||
<%= t('seminar.back') %>
|
||||
</a>
|
||||
<% end %>
|
|
@ -0,0 +1,506 @@
|
|||
<%
|
||||
data = action_data
|
||||
@seminar = data["seminar"]
|
||||
@seminar_signup = data["seminar_signup"]
|
||||
@time_now = data["time_now"]
|
||||
@form_index = 0
|
||||
if data["prefix_url"]
|
||||
prefix_url = data["prefix_url"]
|
||||
else
|
||||
prefix_url = OrbitHelper.url_to_show(@seminar.to_param)
|
||||
end
|
||||
registration_is_open = @seminar.registration_status.present?
|
||||
sign_up_not_yet = @seminar.signup_start_date && @time_now && @seminar.signup_start_date > @time_now
|
||||
sign_up_overdue = @seminar.signup_end_date && @time_now && (@seminar.signup_end_date + 1.day <= @time_now)
|
||||
signup_is_full = @seminar.signup_is_full?
|
||||
%>
|
||||
<style>
|
||||
.error {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<% if !registration_is_open %>
|
||||
|
||||
<%= t('seminar.sign_up_not_open') %>
|
||||
|
||||
<% elsif sign_up_not_yet %>
|
||||
|
||||
<%= t('seminar.sign_up_not_yet') %>
|
||||
|
||||
<% elsif sign_up_overdue %>
|
||||
|
||||
<%= t('seminar.sign_up_overdue') %>
|
||||
|
||||
<% elsif signup_is_full %>
|
||||
|
||||
<%= t('seminar.sign_up_is_full') %>
|
||||
|
||||
<% else %>
|
||||
<%#= stylesheet_link_tag "lib/main-forms" %>
|
||||
<%= stylesheet_link_tag "basic/bootstrap-datetimepicker" %>
|
||||
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
|
||||
<%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %>
|
||||
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
|
||||
<% notice = flash["notice"] || params[:notice] %>
|
||||
<% flash.each do |key, msg| %>
|
||||
<% next if key.to_s == "notice" %>
|
||||
<%= content_tag :p, msg, :class => [key, "alert alert-error in fade"], :style => "color: red; font-weight: bold;" %>
|
||||
<% end %>
|
||||
<% if notice.present? %>
|
||||
<%= content_tag :p, params[:notice], :class => ["notice alert alert-error in fade"], :style => "color: red; font-weight: bold;" %>
|
||||
<script type="text/javascript">
|
||||
window.alert("<%=notice%>");
|
||||
</script>
|
||||
<% end %>
|
||||
<style type="text/css">
|
||||
.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<%= form_for @seminar_signup, url: (@seminar_signup.new_record? ? seminars_path : update_signup_form_seminars_path), html: {class: "content form-horizontal" , :id=>"new-seminar-signup", multipart: true} do |f| %>
|
||||
<fieldset>
|
||||
|
||||
<!-- Title -->
|
||||
<div class="form-group">
|
||||
<label for="title" class="col-sm-2 control-label"><%#= t('seminar.title') %></label>
|
||||
<div class="col-sm-10">
|
||||
<h3><%= @seminar.title %></h3>
|
||||
</div>
|
||||
</div>
|
||||
<% if !@seminar.signup_note.blank? %>
|
||||
<div class="form-group">
|
||||
<label for="note" class="col-sm-2 control-label"><%= t('seminar.note') %></label>
|
||||
<div class="col-sm-10">
|
||||
<%= @seminar.signup_note.html_safe %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<div class="col-sm-12" style="text-align: center;"> *(<%= t('seminar.required') %>) </div>
|
||||
</div>
|
||||
<% if @seminar.seminar_signup_field_sets.count != 0 %>
|
||||
<% @seminar.seminar_signup_field_sets.each do |signup_field| %>
|
||||
<% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' && signup_field.field_name != 'password' %>
|
||||
<div class="form-group<%= (@seminar.registration_status[0] == 'G' && (signup_field.field_name == 'password' || signup_field.field_name == "status")) ? ' hide' : '' %>" id="<%= signup_field.field_name == 'password' ? 'registration_status' : '' %>">
|
||||
<label for="<%= signup_field['name'][I18n.locale] %>" class="col-sm-2 control-label">
|
||||
<% if !(['address','note'].include? signup_field.field_name) %>
|
||||
*
|
||||
<% end %>
|
||||
<%= signup_field['name'][I18n.locale] %>
|
||||
</label>
|
||||
<% if signup_field.field_name == 'status' %>
|
||||
<% status_translations = ['G','C'].map{|c| [c, t("seminar.registration_status_#{c}")] }.to_h %>
|
||||
<% status_translations = {'G'=>'No','C'=>'Yes'} if (signup_field.name.values.select{|v| v.include?('?') || v.include?('是否')}.count != 0 rescue false) %>
|
||||
<div class="col-sm-10">
|
||||
<% if @seminar.registration_status.include?('G') %>
|
||||
<label class="radio-inline">
|
||||
<%= f.radio_button :status, 'G', :checked => true , :onclick => "$('#registration_status').addClass('hide');" %> <%= status_translations['G'] %>
|
||||
</label>
|
||||
<% end %>
|
||||
<% if @seminar.registration_status.include?('C') %>
|
||||
<label class="radio-inline">
|
||||
<%= f.radio_button :status, 'C', :onclick => "$('#registration_status').removeClass('hide');", :checked => (@seminar.registration_status.count == 1 and @seminar.registration_status.include?('C') ? true : false) %> <%= status_translations['C'] %>
|
||||
</label>
|
||||
<% end %>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'unit' %>
|
||||
<div class="col-sm-10">
|
||||
<%= f.text_field 'unit', :class=>"input-medium form-control", :value => (@seminar_signup.send("unit_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}", :required => true %>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'address' %>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-append">
|
||||
<div class="tab-content">
|
||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="address_<%= locale %>">
|
||||
<%= f.fields_for "address_translations".to_sym do |f| %>
|
||||
<%= f.text_field locale, :class=>"input-medium form-control", :value => (@seminar_signup.send("address_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#address_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'email' %>
|
||||
<div class="col-sm-10">
|
||||
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true, :title => t("seminar_signup.email_check") %>
|
||||
<div class="loader"></div>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'password' %>
|
||||
<div class="col-sm-10">
|
||||
<%= 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") %>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'note' %>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-append">
|
||||
<div class="tab-content">
|
||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="note_<%= locale %>">
|
||||
<%= f.fields_for "note_translations".to_sym do |f| %>
|
||||
<%= f.text_area locale, rows: 5, :class=>"input-medium form-control", :value => (@seminar_signup.send("note_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<% @site_in_use_locales.each_with_index do |locale, i| %>
|
||||
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#note_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'tel' %>
|
||||
<div class="col-sm-10">
|
||||
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> signup_field.placeholder[I18n.locale], :required => true, pattern: "[\\d\\+\\-\\(\\)]{10,13}", title: t("seminar.phone_hint") %>
|
||||
<p>(<%= t("seminar.phone_hint") %>)</p>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="col-sm-10">
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-2 control-label"><%= t('seminar.registration_status') %></label>
|
||||
<div class="col-sm-10">
|
||||
<% if @seminar.registration_status.include?('G') %>
|
||||
<label class="radio-inline">
|
||||
<%= f.radio_button :status, 'G', :checked => true , :onclick => "$('#registration_status').addClass('hide');" %> <%= t('seminar.registration_status_G') %>
|
||||
</label>
|
||||
<% end %>
|
||||
<% if @seminar.registration_status.include?('C') %>
|
||||
<label class="radio-inline">
|
||||
<%= f.radio_button :status, 'C', :onclick => "$('#registration_status').removeClass('hide');", :checked => (@seminar.registration_status.count == 1 and @seminar.registration_status.include?('C') ? true : false) %> <%= t('seminar.registration_status_C') %>
|
||||
</label>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Name to Last Name -->
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">*<%= t('seminar_signup.name') %></label>
|
||||
<div class="col-sm-10">
|
||||
<%= f.text_field :name, :class=>"input-medium form-control", :id=>'name', :placeholder=> t('seminar_signup.name'), :required => true %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tel to First Name -->
|
||||
<div class="form-group">
|
||||
<label for="tel" class="col-sm-2 control-label">*<%= t('seminar_signup.tel') %></label>
|
||||
<div class="col-sm-10">
|
||||
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> t('seminar_signup.tel'), :required => true, pattern: "[\\d\\+\\-\\(\\)]+" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Email -->
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-sm-2 control-label">*<%= t(:email) %></label>
|
||||
<div class="col-sm-10">
|
||||
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> t(:email), :required => true %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group <%= @seminar.registration_status[0] == 'C' ? '' : 'hide' %>" id="registration_status">
|
||||
<label for="password" class="col-sm-2 control-label">*<%= t('seminar_signup.password') %></label>
|
||||
<div class="col-sm-10">
|
||||
<%= f.text_field :password, :class=>"input-medium form-control", :placeholder=> t('seminar_signup.password') %>
|
||||
<%= t('seminar_signup.password_message') %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
<%
|
||||
group = 1
|
||||
counter = 0
|
||||
%>
|
||||
|
||||
<% @seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each_with_index do |rf, idx| %>
|
||||
<% if(idx == 6) %>
|
||||
<div id="optional">
|
||||
<% end %>
|
||||
<% if(idx % 6 == 0) && idx != 0 %>
|
||||
<% group += 1 %>
|
||||
<% if @seminar_signup.seminar_signup_values[@form_index] && !@seminar_signup.seminar_signup_values[@form_index].value.blank? %>
|
||||
<div id="group<%= group %>">
|
||||
<% else %>
|
||||
<div id="group<%= group %>" style="display:none;">
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% counter += 1 %>
|
||||
<div class="form-group">
|
||||
|
||||
<%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.to_require) %>
|
||||
|
||||
</div>
|
||||
<% if(counter % 6 == 0) && idx != 5 %>
|
||||
<% counter = 0 %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if(idx == 30) %>
|
||||
<div id="optional">
|
||||
<% end %>
|
||||
<% @form_index = @form_index +1 %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form-group" style="text-align:center;margin:10px 0;">
|
||||
<button id="add-member" class="btn btn-primary" style="display:inline; width: 150px;position: relative;float: left;"><%= t("seminar_signup.add_member") %></button>
|
||||
<button id="remove-member" class="btn btn-primary" style="display:inline;position: relative;float: right; background:red; border-color:red;display: none;"><%= t("seminar_signup.remove_member") %></button>
|
||||
</div>
|
||||
|
||||
<!-- 驗證碼 -->
|
||||
<% if @seminar.seminar_signup_field_sets.count != 0 && @seminar_signup.new_record? %>
|
||||
<% if !(@seminar.seminar_signup_field_sets.select{|v| v.field_name=='recaptcha'}[0].disabled) %>
|
||||
<div class="form-group">
|
||||
<label for="note" class="col-sm-2 control-label"><%= t('seminar_signup.recaptcha') %></label>
|
||||
<div class="col-sm-10">
|
||||
<%= gotcha_error %>
|
||||
<%= gotcha %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label for="note" class="col-sm-2 control-label"><%#= t('nkuht_donate.recaptcha') %></label>
|
||||
<div class="col-sm-10">
|
||||
<%#= show_simple_captcha %>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<label>
|
||||
<input id="agree" name="agree" value="1" type="checkbox" required="required" <% if !@seminar_signup.new_record? %>checked="checked"<%end%>>
|
||||
<a href="<%= prefix_url %>?method=show_privacy" target="_blank" style="color: black;"><%= t("seminar_signup.agree")%></a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<input type="hidden" name="referer_url" value="<%= request.original_url.split(request.env["HTTP_HOST"]).last rescue "/" %>">
|
||||
<input type="hidden" name="seminar_signup[seminar_main_id]" value="<%= @seminar.id %>">
|
||||
<% if !@seminar_signup.new_record? %>
|
||||
<input type="hidden" name="signup_id" value="<%= @seminar_signup.id %>">
|
||||
<% end %>
|
||||
<%= f.submit "Submit", class: 'btn btn-primary', :id => 'button-mail' %>
|
||||
<%= f.button "Delete", type: 'reset', class: 'btn' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
function check_repeat_value(event) {
|
||||
var validated = true;
|
||||
var all_values = $.map($('input[name^="seminar_signup_values"]:visible'), function(v) {
|
||||
return [[v, $(v).val()]];
|
||||
}).filter(function(v){
|
||||
return v[1] != ''
|
||||
});
|
||||
var values = [];
|
||||
for (var i=0;i< all_values.length;i++){
|
||||
if (values.includes(all_values[i][1])){
|
||||
all_values[i][0].setCustomValidity("<%= t('seminar.repeat_hint') %>");
|
||||
all_values[i][0].focus();
|
||||
$(all_values[i][0]).parents('form')[0].reportValidity();
|
||||
validated = false;
|
||||
$(all_values[i][0]).one('keyup change', function(){
|
||||
this.setCustomValidity("");
|
||||
});
|
||||
break;
|
||||
}
|
||||
values.push(all_values[i][1]);
|
||||
}
|
||||
return validated;
|
||||
}
|
||||
function uploadSubmit(form){
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
method: 'post',
|
||||
async: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: "script",
|
||||
url: $(form).attr('action'),
|
||||
data: new FormData(form)
|
||||
});
|
||||
}
|
||||
$(".rucaptcha-image").siblings("input[type=\"text\"]").attr("placeholder","Verification");
|
||||
var validated = false,
|
||||
chks = false,
|
||||
pwd = $('#seminar_signup_password')
|
||||
$('input[type=submit]').on('click', function(){
|
||||
var form = $(this).parents('form')[0];
|
||||
if (form){
|
||||
window.setTimeout(function(){
|
||||
form.reportValidity();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
$("form.content").submit(function(event) {
|
||||
if (!check_repeat_value(event)){
|
||||
return false;
|
||||
}
|
||||
if ($('*[name^="seminar_signup_values"]:visible')){
|
||||
$('input[name^="seminar_signup_values"]:visible').map(function(k, v) {
|
||||
return $(v).val();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if ($('#seminar_signup_status_c:checked').val() == 'C'){
|
||||
if (pwd.val() == ''){
|
||||
pwd.attr('required', true);
|
||||
pwd.focus();
|
||||
alert( '<%= t('seminar_signup.password') %>' + ' is required');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
<%
|
||||
@seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each do |rf|
|
||||
|
||||
if rf.markup == 'checkbox'
|
||||
%>
|
||||
|
||||
var checkedCount = $("input[type=checkbox][id^=seminar_signup_values_<%= rf.id %>]:checked").length;
|
||||
if (checkedCount == 0){
|
||||
alert( '<%= rf.title %>' + ' is required');
|
||||
return false;
|
||||
}
|
||||
|
||||
<%
|
||||
end
|
||||
|
||||
end
|
||||
%>
|
||||
|
||||
var form = $(this),
|
||||
isChecked = $('#agree:checked').val()?true:false;
|
||||
|
||||
if(!isChecked){
|
||||
return false;
|
||||
}
|
||||
|
||||
uploadSubmit(this);
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
$('input[type="email"]').blur(function(){
|
||||
var type = $(this).attr("id"),
|
||||
loader = $(this).parent().find('.loader'),
|
||||
elem = $(this),
|
||||
value = $(this).val() || null;
|
||||
var checkAvailability = function(){
|
||||
$.ajax({
|
||||
url : "<%= "/xhr/seminars/check_email/#{@seminar.id}" %>",
|
||||
data : {"type" : type, "email" : value},
|
||||
dataType : "json",
|
||||
type : "get",
|
||||
success : function(data){
|
||||
if( data.success == true ){
|
||||
loader.removeClass("error");
|
||||
}else{
|
||||
loader.addClass("error");
|
||||
}
|
||||
loader.text(data.result);
|
||||
}
|
||||
});
|
||||
};
|
||||
if( value ){
|
||||
if (!this.checkValidity()){
|
||||
loader.addClass("error");
|
||||
loader.text("<%= t("seminar.email_hint") %>");
|
||||
return;
|
||||
}else{
|
||||
loader.removeClass("error");
|
||||
loader.text("");
|
||||
}
|
||||
if(type == "seminar_signup_email"){
|
||||
loader.text("Checking...")
|
||||
checkAvailability();
|
||||
}
|
||||
}
|
||||
});
|
||||
$(".upload").on("change",function(){
|
||||
let filenamedom = $(this).parent().parent().find(".filename");
|
||||
let filenameA = $(this).val().split('\\');
|
||||
filenamedom.text(filenameA[filenameA.length - 1]);
|
||||
})
|
||||
|
||||
$("#optional label").each(function(){
|
||||
if($(this).hasClass("control-label")){
|
||||
$(this).text("*" + $(this).text());
|
||||
}
|
||||
})
|
||||
|
||||
// $("#seminar_signup_values_3_value").removeAttr("placeholder");
|
||||
|
||||
let currentGroup = 1 + $("#new-seminar-signup div[id^=group]:visible").length;
|
||||
function showGroup($group, init){
|
||||
$group.show();
|
||||
$group.find('.fake-clean-file').remove();
|
||||
$group.find('input,textarea').attr("required", true);
|
||||
if(init){
|
||||
$group.find('input.tick').attr("checked", true);
|
||||
}
|
||||
}
|
||||
|
||||
function hideGroup($group){
|
||||
$group.hide();
|
||||
$group.find("input[type!=hidden], textarea").val("");
|
||||
$.each($group.find("input[type=file]"), function(k, v) {
|
||||
$(v).after("<input class=\"fake-clean-file\" type=\"hidden\" name=\""+$(v).attr('name')+"\" value=\"\">");
|
||||
});
|
||||
$group.find('input,textarea').attr("required", false);
|
||||
}
|
||||
|
||||
if (currentGroup > 1){
|
||||
$("#remove-member").show();
|
||||
for (var i = 1; i <= currentGroup; i++){
|
||||
showGroup($("#group" + i), true);
|
||||
}
|
||||
}
|
||||
$("input.first-tick").attr("checked",true);
|
||||
$("#add-member").on("click",function () {
|
||||
if(currentGroup < 5){
|
||||
$("#remove-member").show();
|
||||
currentGroup++;
|
||||
if(currentGroup == 5){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
showGroup($("#group" + currentGroup));
|
||||
return false;
|
||||
})
|
||||
$("#remove-member").on("click",function () {
|
||||
$("#add-member").show();
|
||||
if(currentGroup > 0){
|
||||
hideGroup($("#group" + currentGroup));
|
||||
currentGroup--;
|
||||
if(currentGroup == 1){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
<% end %>
|
|
@ -0,0 +1,50 @@
|
|||
<% # encoding: utf-8 %>
|
||||
<%
|
||||
data = action_data("con_login")
|
||||
@seminar = data["seminar"]
|
||||
@time_now = data["time_now"]
|
||||
%>
|
||||
<style type="text/css">
|
||||
.alert-error{
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
|
||||
<section id="main-wrap">
|
||||
<div class="sign-in have-other-sign-in">
|
||||
<% flash.each do |key, msg| %>
|
||||
<%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %>
|
||||
<% end %>
|
||||
<div class="form">
|
||||
<h2><%= @seminar.title %></h2>
|
||||
<h3 class="login-logo"><%= t('seminar_signup.forgot_password') %></h3>
|
||||
<div>
|
||||
<input name="utf8" type="hidden" value="" />
|
||||
<input name="authenticity_token" type="hidden" value="" />
|
||||
</div>
|
||||
<div class="form-block">
|
||||
<div class="form-list clearfix">
|
||||
<%= form_tag reset_password_proc_seminars_path, :class => 'content' do %>
|
||||
<div class="control-group clear">
|
||||
<label for="user_email">
|
||||
<i class="icon-user"></i><%=t('seminar_signup.email_address')%>
|
||||
</label>
|
||||
<%= text_field_tag :user_name, params[:user_name], :placeholder => t('seminar_signup.email_address'), :id=>"user_email" %>
|
||||
</div>
|
||||
<br/>
|
||||
<input type="hidden" name="referer_url" value="<%= request.original_url.split(request.env["HTTP_HOST"]).last.split('?').first %>">
|
||||
<input type="hidden" name="seminar_signup[seminar_main_id]" value="<%= @seminar.id %>">
|
||||
<button class="btn btn-primary" name="button" type="submit"><%= t('seminar_signup.reset') %></button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var max_width = Math.max.apply(null, $(".form .control-group label").map(function(i,el){return $(el).width()}));
|
||||
$(".form .control-group label").width(max_width);
|
||||
})
|
||||
</script>
|
|
@ -0,0 +1,74 @@
|
|||
<% # encoding: utf-8 %>
|
||||
<%
|
||||
data = action_data
|
||||
@seminar = data["seminar"]
|
||||
%>
|
||||
<style type="text/css">
|
||||
.alert-error{
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
|
||||
<section id="main-wrap">
|
||||
<% if data["status"] %>
|
||||
<div class="sign-in have-other-sign-in">
|
||||
<% flash.each do |key, msg| %>
|
||||
<%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %>
|
||||
<% end %>
|
||||
<div class="form">
|
||||
<h2><%= @seminar.title %></h2>
|
||||
<h3 class="login-logo"><%= t('seminar_signup.forgot_password') %></h3>
|
||||
<div>
|
||||
<input name="utf8" type="hidden" value="" />
|
||||
<input name="authenticity_token" type="hidden" value="" />
|
||||
</div>
|
||||
<div class="form-block">
|
||||
<div class="form-list clearfix">
|
||||
<%= form_tag reset_confirm_password_proc_seminars_path, :class => 'content', :id =>"change-password-form" do %>
|
||||
<div class="control-group clear">
|
||||
<label for="user_password">
|
||||
<i class="icon-user"></i><%=t('seminar_signup.password')%>
|
||||
</label>
|
||||
<%= password_field_tag :password, nil, :placeholder => t(:dots), :id=>"user_password", :required=> true, :pattern => data["pattern"], :title => t("seminar_signup.password_check") %>
|
||||
|
||||
</div>
|
||||
<div class="control-group clear">
|
||||
<label for="confirm_user_password">
|
||||
<i class="icon-user"></i><%=t('seminar_signup.confirm_password')%>
|
||||
</label>
|
||||
<%= password_field_tag :confirm_password, nil, :placeholder => t(:dots), :id=>"confirm_user_password", :required=> true %>
|
||||
</div>
|
||||
<p class="alert-error" id="confirm-error"></p>
|
||||
<br/>
|
||||
<input type="hidden" name="referer_url" value="<%= request.original_url.split(request.env["HTTP_HOST"]).last.split('?').first %>">
|
||||
<input type="hidden" name="seminar_id" value="<%= @seminar.id %>">
|
||||
<input type="hidden" name="cid" value="<%= params[:cid] %>">
|
||||
<input type="hidden" name="reset_token" value="<%= data['token'] %>" />
|
||||
<button class="btn btn-primary" name="button" type="submit"><%= t('seminar_signup.reset') %></button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<p>Invalid URL</p>
|
||||
<% end %>
|
||||
</section>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var max_width = Math.max.apply(null, $(".form .control-group label").map(function(i,el){return $(el).width()}));
|
||||
$(".form .control-group label").width(max_width);
|
||||
})
|
||||
form = document.querySelector("#change-password-form");
|
||||
form.onsubmit = function () {
|
||||
var up = document.querySelector("#user_password").value,
|
||||
cup = document.querySelector("#confirm_user_password").value
|
||||
if(up != cup){
|
||||
document.querySelector("#confirm-error").textContent = "<%= t("seminar_signup.password_mismatch") %>"
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -1,8 +1,8 @@
|
|||
<%
|
||||
data = action_data
|
||||
@seminar = data["seminar"]
|
||||
@seminar_signup = data["seminar_signup"]
|
||||
@time_now = data["time_now"]
|
||||
data = action_data
|
||||
@seminar = data["seminar"]
|
||||
@seminar_signup = data["seminar_signup"]
|
||||
@time_now = data["time_now"]
|
||||
@form_index = 0
|
||||
if data["prefix_url"]
|
||||
prefix_url = data["prefix_url"]
|
||||
|
@ -14,6 +14,11 @@
|
|||
sign_up_overdue = @seminar.signup_end_date && @time_now && (@seminar.signup_end_date + 1.day <= @time_now)
|
||||
signup_is_full = @seminar.signup_is_full?
|
||||
%>
|
||||
<style>
|
||||
.error {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
<% if !registration_is_open %>
|
||||
|
||||
<%= t('seminar.sign_up_not_open') %>
|
||||
|
@ -53,14 +58,14 @@
|
|||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<%= form_for @seminar_signup, url: seminars_path, html: {class: "content form-horizontal" , :id=>"new-seminar-signup", multipart: true} do |f| %>
|
||||
<%= form_for @seminar_signup, url: (@seminar_signup.new_record? ? seminars_path : update_signup_form_seminars_path), html: {class: "content form-horizontal" , :id=>"new-seminar-signup", multipart: true} do |f| %>
|
||||
<fieldset>
|
||||
|
||||
<!-- Title -->
|
||||
<div class="form-group">
|
||||
<label for="title" class="col-sm-2 control-label"><%= t('seminar.title') %></label>
|
||||
<label for="title" class="col-sm-2 control-label"><%#= t('seminar.title') %></label>
|
||||
<div class="col-sm-10">
|
||||
<%= @seminar.title %>
|
||||
<h3><%= @seminar.title %></h3>
|
||||
</div>
|
||||
</div>
|
||||
<% if !@seminar.signup_note.blank? %>
|
||||
|
@ -76,8 +81,8 @@
|
|||
</div>
|
||||
<% if @seminar.seminar_signup_field_sets.count != 0 %>
|
||||
<% @seminar.seminar_signup_field_sets.each do |signup_field| %>
|
||||
<% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' %>
|
||||
<div class="form-group<%= (@seminar.registration_status[0] == 'G' && signup_field.field_name == 'password') ? ' hide' : '' %>" id="<%= signup_field.field_name == 'password' ? 'registration_status' : '' %>">
|
||||
<% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' && signup_field.field_name != 'password' %>
|
||||
<div class="form-group<%= (@seminar.registration_status[0] == 'G' && (signup_field.field_name == 'password' || signup_field.field_name == "status")) ? ' hide' : '' %>" id="<%= signup_field.field_name == 'password' ? 'registration_status' : '' %>">
|
||||
<label for="<%= signup_field['name'][I18n.locale] %>" class="col-sm-2 control-label">
|
||||
<% if !(['address','note'].include? signup_field.field_name) %>
|
||||
*
|
||||
|
@ -124,7 +129,12 @@
|
|||
</div>
|
||||
<% elsif signup_field.field_name == 'email' %>
|
||||
<div class="col-sm-10">
|
||||
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true %> <a href="#" onclick="window.open(' <%= prefix_url %>?method=check_email&no=<%=@seminar.id%>&layout=false&email='+ $('input[type=email]').val() , 'check mail', config='height=100,width=300');" class="btn btn-primary">check mail</a>
|
||||
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true, :title => t("seminar_signup.email_check") %>
|
||||
<div class="loader"></div>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'password' %>
|
||||
<div class="col-sm-10">
|
||||
<%= 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") %>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'note' %>
|
||||
<div class="col-sm-10">
|
||||
|
@ -145,9 +155,19 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'tel' %>
|
||||
<div class="col-sm-10">
|
||||
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> signup_field.placeholder[I18n.locale], :required => true, pattern: "[\\d\\+\\-\\(\\)]{10,13}", title: t("seminar.phone_hint") %>
|
||||
<p>(<%= t("seminar.phone_hint") %>)</p>
|
||||
</div>
|
||||
<% elsif signup_field.field_name == 'name' %>
|
||||
<div class="col-sm-10">
|
||||
<%= 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 %>
|
||||
<div class="loader"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="col-sm-10">
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -182,7 +202,7 @@
|
|||
<div class="form-group">
|
||||
<label for="tel" class="col-sm-2 control-label">*<%= t('seminar_signup.tel') %></label>
|
||||
<div class="col-sm-10">
|
||||
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> t('seminar_signup.tel'), :required => true %>
|
||||
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> t('seminar_signup.tel'), :required => true, pattern: "[\\d\\+\\-\\(\\)]+" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -190,7 +210,7 @@
|
|||
<div class="form-group">
|
||||
<label for="email" class="col-sm-2 control-label">*<%= t(:email) %></label>
|
||||
<div class="col-sm-10">
|
||||
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> t(:email), :required => true %> <a href="#" onclick="window.open(' <%= prefix_url %>?method=check_email&no=<%=@seminar.id%>&layout=false&email='+ $('input[type=email]').val() , 'check mail', config='height=100,width=300');" class="btn btn-primary">check mail</a>
|
||||
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> t(:email), :required => true %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -203,21 +223,46 @@
|
|||
</div>
|
||||
|
||||
<% end %>
|
||||
<% @seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each do |rf| %>
|
||||
|
||||
<%
|
||||
group = 1
|
||||
counter = 0
|
||||
%>
|
||||
<% @seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each_with_index do |rf, idx| %>
|
||||
<% if(idx == 6) %>
|
||||
<div id="optional">
|
||||
<% end %>
|
||||
<% if(idx % 6 == 0) && idx != 0 %>
|
||||
<% group += 1 %>
|
||||
<% if @seminar_signup.seminar_signup_values[@form_index] && !@seminar_signup.seminar_signup_values[@form_index].value.blank? %>
|
||||
<div id="group<%= group %>">
|
||||
<% else %>
|
||||
<div id="group<%= group %>" style="display:none;">
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% counter += 1 %>
|
||||
<div class="form-group">
|
||||
|
||||
<%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.to_require) %>
|
||||
|
||||
</div>
|
||||
|
||||
<% if(counter % 6 == 0) && idx != 5 %>
|
||||
<% counter = 0 %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if(idx == 30) %>
|
||||
<div id="optional">
|
||||
<% end %>
|
||||
<% @form_index = @form_index +1 %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="form-group" style="text-align:center;margin:10px 0;">
|
||||
<button id="add-member" class="btn btn-primary" style="display:inline; width: 150px;position: relative;float: left;"><%= t("seminar_signup.add_member") %></button>
|
||||
<button id="remove-member" class="btn btn-primary" style="display:inline;position: relative;float: right; background:red; border-color:red;display: none;"><%= t("seminar_signup.remove_member") %></button>
|
||||
</div>
|
||||
|
||||
<!-- 驗證碼 -->
|
||||
<% if @seminar.seminar_signup_field_sets.count != 0 %>
|
||||
<% if @seminar.seminar_signup_field_sets.count != 0 && @seminar_signup.new_record? %>
|
||||
<% if !(@seminar.seminar_signup_field_sets.select{|v| v.field_name=='recaptcha'}[0].disabled) %>
|
||||
<div class="form-group">
|
||||
<label for="note" class="col-sm-2 control-label"><%= t('seminar_signup.recaptcha') %></label>
|
||||
|
@ -239,8 +284,8 @@
|
|||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<label>
|
||||
<input id="agree" name="agree" value="1" type="checkbox" required="required">
|
||||
<a href="<%= prefix_url %>?method=show_privacy" target="_blank"><%= t("seminar_signup.agree")%></a>
|
||||
<input id="agree" name="agree" value="1" type="checkbox" required="required" <% if !@seminar_signup.new_record? %>checked="checked"<%end%>>
|
||||
<a href="<%= prefix_url %>?method=show_privacy" target="_blank" style="color: black;"><%= t("seminar_signup.agree")%></a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -249,6 +294,9 @@
|
|||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<input type="hidden" name="referer_url" value="<%= request.original_url.split(request.env["HTTP_HOST"]).last rescue "/" %>">
|
||||
<input type="hidden" name="seminar_signup[seminar_main_id]" value="<%= @seminar.id %>">
|
||||
<% if !@seminar_signup.new_record? %>
|
||||
<input type="hidden" name="signup_id" value="<%= @seminar_signup.id %>">
|
||||
<% end %>
|
||||
<%= f.submit "Submit", class: 'btn btn-primary', :id => 'button-mail' %>
|
||||
<%= f.button "Delete", type: 'reset', class: 'btn' %>
|
||||
</div>
|
||||
|
@ -260,12 +308,62 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
function check_repeat_value(event) {
|
||||
var validated = true;
|
||||
var all_values = $.map($('input[name^="seminar_signup_values"]:visible'), function(v) {
|
||||
return [[v, $(v).val()]];
|
||||
}).filter(function(v){
|
||||
return v[1] != ''
|
||||
});
|
||||
var values = [];
|
||||
for (var i=0;i< all_values.length;i++){
|
||||
if (values.includes(all_values[i][1])){
|
||||
all_values[i][0].setCustomValidity("<%= t('seminar.repeat_hint') %>");
|
||||
all_values[i][0].focus();
|
||||
$(all_values[i][0]).parents('form')[0].reportValidity();
|
||||
validated = false;
|
||||
$(all_values[i][0]).one('keyup change', function(){
|
||||
this.setCustomValidity("");
|
||||
});
|
||||
break;
|
||||
}
|
||||
values.push(all_values[i][1]);
|
||||
}
|
||||
return validated;
|
||||
}
|
||||
function uploadSubmit(form){
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
method: 'post',
|
||||
async: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: "script",
|
||||
url: $(form).attr('action'),
|
||||
data: new FormData(form)
|
||||
});
|
||||
}
|
||||
$(".rucaptcha-image").siblings("input[type=\"text\"]").attr("placeholder","Verification");
|
||||
var validated = false,
|
||||
chks = false,
|
||||
pwd = $('#seminar_signup_password')
|
||||
|
||||
$('input[type=submit]').on('click', function(){
|
||||
var form = $(this).parents('form')[0];
|
||||
if (form){
|
||||
window.setTimeout(function(){
|
||||
form.reportValidity();
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
$("form.content").submit(function(event) {
|
||||
if (!check_repeat_value(event)){
|
||||
return false;
|
||||
}
|
||||
if ($('*[name^="seminar_signup_values"]:visible')){
|
||||
$('input[name^="seminar_signup_values"]:visible').map(function(k, v) {
|
||||
return $(v).val();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if ($('#seminar_signup_status_c:checked').val() == 'C'){
|
||||
|
@ -302,41 +400,129 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
uploadSubmit(this);
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
|
||||
$(".availibility").blur(function(){
|
||||
$('#name').blur(function(){
|
||||
var type = $(this).attr("id"),
|
||||
loader = $(this).parent().find('.loader'),
|
||||
elem = $(this),
|
||||
value = $(this).val().trim() || null;
|
||||
var checkAvailability = function(){
|
||||
$.ajax({
|
||||
url : "<%= "/xhr/seminars/check_name/#{@seminar.id}" %>",
|
||||
data : {"type" : type, "name" : value},
|
||||
dataType : "json",
|
||||
type : "get",
|
||||
success : function(data){
|
||||
if( data.success == true ){
|
||||
loader.removeClass("error");
|
||||
}else{
|
||||
loader.addClass("error");
|
||||
}
|
||||
loader.text(data.result);
|
||||
}
|
||||
})
|
||||
}
|
||||
loader.text("Checking...")
|
||||
checkAvailability();
|
||||
});
|
||||
$('input[type="email"]').blur(function(){
|
||||
var type = $(this).attr("id"),
|
||||
loader = $(this).parent().find('.loader'),
|
||||
elem = $(this),
|
||||
value = $(this).val() || null;
|
||||
var checkAvailability = function(){
|
||||
$.ajax({
|
||||
url : "<%= "#{prefix_url}?method=check_availability&no=#{@seminar.id}" %>",
|
||||
data : {"type" : type, "value" : value},
|
||||
url : "<%= "/xhr/seminars/check_email/#{@seminar.id}" %>",
|
||||
data : {"type" : type, "email" : value},
|
||||
dataType : "json",
|
||||
type : "get",
|
||||
success : function(data){
|
||||
if( data.success == true ){
|
||||
|
||||
alert("1tttt");
|
||||
loader.removeClass("error");
|
||||
}else{
|
||||
|
||||
alert("1ssss2");
|
||||
loader.addClass("error");
|
||||
}
|
||||
loader.text(data.result);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
if( value ){
|
||||
if (!this.checkValidity()){
|
||||
loader.addClass("error");
|
||||
loader.text("<%= t("seminar.email_hint") %>");
|
||||
return;
|
||||
}else{
|
||||
loader.removeClass("error");
|
||||
loader.text("");
|
||||
}
|
||||
if(type == "seminar_signup_email"){
|
||||
loader.text("Checking...")
|
||||
checkAvailability();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$(".upload").on("change",function(){
|
||||
let filenamedom = $(this).parent().parent().find(".filename");
|
||||
let filenameA = $(this).val().split('\\');
|
||||
filenamedom.text(filenameA[filenameA.length - 1]);
|
||||
})
|
||||
|
||||
$("#optional label").each(function(){
|
||||
if($(this).hasClass("control-label")){
|
||||
$(this).text("*" + $(this).text());
|
||||
}
|
||||
})
|
||||
|
||||
// $("#seminar_signup_values_3_value").removeAttr("placeholder");
|
||||
|
||||
let currentGroup = 1 + $("#new-seminar-signup div[id^=group]:visible").length;
|
||||
function showGroup($group){
|
||||
$group.show();
|
||||
$group.find('.fake-clean-file').remove();
|
||||
$group.find('input,textarea').attr("required", true);
|
||||
}
|
||||
|
||||
function hideGroup($group){
|
||||
$group.hide();
|
||||
$group.find("input[type!=hidden], textarea").val("");
|
||||
$.each($group.find("input[type=file]"), function(k, v) {
|
||||
$(v).after("<input class=\"fake-clean-file\" type=\"hidden\" name=\""+$(v).attr('name')+"\" value=\"\">");
|
||||
});
|
||||
$group.find('input,textarea').attr("required", false);
|
||||
}
|
||||
|
||||
if (currentGroup > 1){
|
||||
$("#remove-member").show();
|
||||
for (var i = 1; i < currentGroup; i++){
|
||||
showGroup($("#group" + i));
|
||||
}
|
||||
}
|
||||
|
||||
$("#add-member").on("click",function () {
|
||||
if(currentGroup < 5){
|
||||
$("#remove-member").show();
|
||||
currentGroup++;
|
||||
if(currentGroup == 5){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
showGroup($("#group" + currentGroup));
|
||||
return false;
|
||||
})
|
||||
$("#remove-member").on("click",function () {
|
||||
$("#add-member").show();
|
||||
if(currentGroup > 0){
|
||||
hideGroup($("#group" + currentGroup));
|
||||
currentGroup--;
|
||||
if(currentGroup == 1){
|
||||
$(this).hide();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
end
|
||||
%>
|
||||
|
||||
<%= t('seminar_signup.success_message') %>
|
||||
<%#= t('seminar_signup.success_message') %>
|
||||
<%= data["message"].html_safe %>
|
||||
<br>
|
||||
<%=t('seminar_signup.serial_number') %>: <%=data["serial_number"] rescue ""%>
|
||||
<% if !params['status'].nil? %>
|
||||
|
|
|
@ -45,3 +45,11 @@ markups:
|
|||
ext_support: false
|
||||
panel: typeF
|
||||
display_only: seminar_submission_field
|
||||
email:
|
||||
panel: typeA
|
||||
phone:
|
||||
panel: typeA
|
||||
instructions:
|
||||
muti_lang_input_supprt: false
|
||||
ext_support: false
|
||||
panel: typeG
|
||||
|
|
|
@ -5,7 +5,11 @@ en:
|
|||
label: ""
|
||||
lists:
|
||||
markups:
|
||||
seminar_preferred_session: Preferred Session
|
||||
seminar_preferred_session: Preferred Session
|
||||
email: Email
|
||||
phone: Phone
|
||||
instructions: Instructions
|
||||
|
||||
restful_actions:
|
||||
edit_seminar_review: Review
|
||||
copy: Copy
|
||||
|
@ -27,6 +31,12 @@ en:
|
|||
abstract_number: Abstract number
|
||||
presentation_type: Presentation
|
||||
seminar:
|
||||
repeat_hint: Input text must unique!
|
||||
phone_hint: "Can only include number, +, -, and ()!(length: 10~13)"
|
||||
email_hint: Email is not complete!
|
||||
text_area_hint: Limit 300 characters
|
||||
file_limit_hint: File Size cannot larger than 20MB!
|
||||
file_format_hint: only support .pdf, .png, .jpg, .odf extensions!
|
||||
signup_limit: Signup Limit
|
||||
participant_list: Participant list
|
||||
back: Back
|
||||
|
@ -46,12 +56,12 @@ en:
|
|||
home_setting: Home Setting
|
||||
sub_page_setting: Sub Page Setting
|
||||
menu:
|
||||
introduction: Introduction
|
||||
news: News
|
||||
registration: Registration
|
||||
registered_participants: Registered Participants
|
||||
submission: Submission
|
||||
album: Album
|
||||
introduction: Introduction
|
||||
news: News
|
||||
registration: Registration
|
||||
registered_participants: Registered Participants
|
||||
submission: Submission
|
||||
album: Album
|
||||
introduction: Introduction
|
||||
announcement_limit: Announcement ;imit
|
||||
album_limit: Album limit
|
||||
|
@ -86,7 +96,7 @@ en:
|
|||
dashboard: Dashboard
|
||||
display_field: Display field
|
||||
note: Note
|
||||
email_exist: "Email exist!"
|
||||
email_email_or_name_existexist: "Email or name exist!"
|
||||
email_signup_success: Signup success
|
||||
email_submission_success: Submission registration success
|
||||
email_add_file_success: Add file success
|
||||
|
@ -102,6 +112,20 @@ 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
|
||||
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_button: Send email
|
||||
click_here_to_confirm: Please click this link / 請點選此連結
|
||||
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 +143,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 #驗證碼
|
||||
|
@ -158,9 +181,11 @@ en:
|
|||
sign_up_is_full: "Sign up is FULL!"
|
||||
sign_up_failed: "Sign up failed!"
|
||||
contribute_file_count: Count of Contribute Files #投稿檔案數
|
||||
seminar_signup_success: Signup Success Message
|
||||
reset_password: Reset Password
|
||||
|
||||
frontend:
|
||||
seminar: Semianr #研討會前台
|
||||
seminar: Semianr #研討會前台
|
||||
|
||||
seminar_item:
|
||||
new_item: New Item #新增項目
|
||||
|
@ -190,12 +215,12 @@ en:
|
|||
note: Note #註解
|
||||
time: 'Start / End Time' #(開始/結束)時間
|
||||
place: Place #地點
|
||||
agree: "Accept Privacy and Personal Information Protection Policy of the Site"
|
||||
agree: "I agree with all terms"
|
||||
privacy_statement: 'Privacy and Personal Information Protection Policy of the Site'
|
||||
recaptcha: Verification code
|
||||
signup_field: Sign Up Field #圈選項目
|
||||
uploads: Uploads #上傳檔案
|
||||
con_login: Submission #投稿者登入
|
||||
con_login: Login #投稿者登入
|
||||
file_name: File Name #稿件名稱
|
||||
file_note: Summary #摘要
|
||||
files: Files #檔案
|
||||
|
@ -212,4 +237,32 @@ en:
|
|||
select: Select box
|
||||
checkbox: Multiple choice
|
||||
radio: Single choice
|
||||
choices: Choices
|
||||
choices: Choices
|
||||
forgot_password: Set 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
|
||||
edit_form: Edit Form
|
||||
emails_already_sent: Emails Already Sent
|
||||
is_confirmed_date: Email confirmed time
|
||||
signup_confirmed_date: Signup confirmed time
|
||||
add_member: Add Member
|
||||
remove_member: Remove Member
|
||||
send_email_text: Additional text to send
|
||||
predefined_text: Predifined email text
|
||||
|
|
|
@ -5,7 +5,10 @@ zh_tw:
|
|||
label: ""
|
||||
lists:
|
||||
markups:
|
||||
seminar_preferred_session: Preferred Session
|
||||
seminar_preferred_session: Preferred Session
|
||||
email: 電子信箱
|
||||
phone: 電話
|
||||
instructions: "說明文字 Instructions"
|
||||
|
||||
restful_actions:
|
||||
edit_seminar_review: 審查
|
||||
|
@ -28,6 +31,12 @@ zh_tw:
|
|||
abstract_number: 摘要編號
|
||||
presentation_type: 發表方式
|
||||
seminar:
|
||||
repeat_hint: 輸入內容不能重複
|
||||
phone_hint: "僅可輸入數字及+ - (),長度限制10~13"
|
||||
email_hint: Email信箱不完整
|
||||
text_area_hint: 字數最多只能300個字
|
||||
file_limit_hint: 檔案不能超過20MB!
|
||||
file_format_hint: 只能上傳.pdf, .png, .jpg, .odf格式
|
||||
signup_limit: 報名限制人數
|
||||
participant_list: 參加者名單
|
||||
back: 回上一頁
|
||||
|
@ -47,12 +56,12 @@ zh_tw:
|
|||
home_setting: 首頁設定
|
||||
sub_page_setting: 內頁設定
|
||||
menu:
|
||||
introduction: 介紹
|
||||
news: 公告
|
||||
registration: 註冊
|
||||
registered_participants: 註冊參與者
|
||||
submission: 投稿
|
||||
album: 相簿
|
||||
introduction: 介紹
|
||||
news: 公告
|
||||
registration: 註冊
|
||||
registered_participants: 註冊參與者
|
||||
submission: 投稿
|
||||
album: 相簿
|
||||
introduction: 介紹
|
||||
announcement_limit: 公告上限
|
||||
album_limit: 相簿上限
|
||||
|
@ -87,7 +96,7 @@ zh_tw:
|
|||
dashboard: 儀錶板
|
||||
display_field: 顯示的欄位
|
||||
note: 附註
|
||||
email_exist: "email已存在!"
|
||||
email_or_name_exist: 隊名或Email已存在
|
||||
email_signup_success: 報名成功
|
||||
email_submission_success: 投稿註冊成功
|
||||
email_add_file_success: 新增上傳成功
|
||||
|
@ -103,6 +112,20 @@ zh_tw:
|
|||
email_edit_file: 編輯上傳
|
||||
email_add_file: 新增上傳
|
||||
auto_send_email_set: 自動發信設定
|
||||
email_forgot_password: 忘記密碼
|
||||
email_special_reminder: 特殊通知
|
||||
special_reminder: 特殊通知
|
||||
email_reset_password_content: 忘記密碼
|
||||
email_reset_password_success: 忘記密碼
|
||||
email_special_reminder_content: 特殊通知
|
||||
email_special_reminder_success: 特殊通知
|
||||
is_confirmation: 認證Email
|
||||
click_here_to_confirm: Please click this link / 請點選此連結
|
||||
confirm_ok: 認證通過
|
||||
confirm_not_ok: 連結已失效
|
||||
select_email_type: 選擇Email種類
|
||||
send_email_button: 寄送Email
|
||||
validator: 驗證
|
||||
click_to_contribute: 按此登入投稿
|
||||
required: '必填, necessary'
|
||||
already_used: 已存在
|
||||
|
@ -120,7 +143,6 @@ zh_tw:
|
|||
reviewer: 審查委員
|
||||
review_end_date: 審查結束日期
|
||||
review_start_date: 審查開始日期
|
||||
review: 審稿
|
||||
blank_no_limit: 空白無限制
|
||||
export_csv: 匯出CSV
|
||||
recaptcha: 驗證碼
|
||||
|
@ -159,9 +181,11 @@ zh_tw:
|
|||
sign_up_is_full: "報名已額滿!"
|
||||
sign_up_failed: "報名失敗"
|
||||
contribute_file_count: 投稿檔案數
|
||||
seminar_signup_success: 送出註冊表單訊息頁
|
||||
reset_password: 設定密碼
|
||||
|
||||
frontend:
|
||||
seminar: 研討會前台
|
||||
seminar: 研討會前台
|
||||
|
||||
seminar_item:
|
||||
new_item: 新增項目
|
||||
|
@ -191,26 +215,53 @@ zh_tw:
|
|||
note: 註解
|
||||
time: (開始/結束)時間
|
||||
place: 地點
|
||||
agree: 同意接受本站個資及隱私權保護宣告(Agree upon personal data protection declaration of this web)
|
||||
agree: 已確認閱讀相關條款
|
||||
privacy_statement: '個資及隱私權保護宣告'
|
||||
recaptcha: 驗證碼
|
||||
signup_field: 圈選項目
|
||||
uploads: 上傳檔案
|
||||
con_login: Submission
|
||||
con_login: 登入
|
||||
file_name: 稿件名稱
|
||||
file_note: 摘要
|
||||
files: 檔案
|
||||
logout: Logout
|
||||
logout: 登出
|
||||
logouting: 登出中
|
||||
success_message: '您的報名已成功,感謝您的參與。'
|
||||
email_address: Email address
|
||||
_password: Password
|
||||
login: Login
|
||||
new_: '新增(load abstract)'
|
||||
load_file: load file
|
||||
email_address: Email位址
|
||||
_password: 密碼
|
||||
login: 登入
|
||||
new_: '新增(upload abstract)'
|
||||
load_file: 上傳檔案
|
||||
enable_summary_choice: 開啟摘要選項
|
||||
summary_choice_type: 摘要選項類型
|
||||
select: 下拉選單
|
||||
checkbox: 多選
|
||||
radio: 單選
|
||||
choices: 選項
|
||||
choices: 選項
|
||||
forgot_password: 設定密碼
|
||||
reset_email_sent: 重設密碼Email已送出
|
||||
login_failed: 登入失敗
|
||||
email_not_found: 找不到Email
|
||||
reset: 重設
|
||||
click_on_link: 請點選下方連結後重設密碼。
|
||||
confirm_password: 確認密碼
|
||||
password_mismatch: 密碼不正確
|
||||
password_changed: 密碼更新成功
|
||||
password_changed_not_ok: 更新密碼時發生錯誤
|
||||
password_check: 至少須包含數字及大小寫英文字母共8碼
|
||||
email_check: 不正確的Email格式
|
||||
is_confirmed: Email已確認
|
||||
signup_confirmed: 註冊已查核確認
|
||||
registration_complete: 註冊程序完成
|
||||
email_confirmed: Email已確認
|
||||
email_not_confirmed: Email尚未確認
|
||||
signup_not_confirmed: 註冊尚未查核確認
|
||||
send_email: 寄送Email
|
||||
edit_form: 編輯註冊表單
|
||||
emails_already_sent: 已寄送Email
|
||||
add_member: 增加組員
|
||||
remove_member: 移除組員
|
||||
is_confirmed_date: Email認證時間
|
||||
signup_confirmed_date: 註冊查核確認時間
|
||||
send_email_text: 附加額外文字內容
|
||||
predefined_text: 預設郵件內容
|
||||
|
|
|
@ -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
|
||||
|
@ -64,6 +64,8 @@ Rails.application.routes.draw do
|
|||
get 'seminar_signup'
|
||||
get 'seminar_item_content'
|
||||
get 'seminar_signup_field'
|
||||
get 'seminar_signup_success'
|
||||
patch 'seminar_signup_success_save'
|
||||
get 'seminar_submission_field'
|
||||
get 'seminar_signup_admin_setting'
|
||||
post 'update_seminar_signup_admin_setting'
|
||||
|
@ -81,6 +83,10 @@ Rails.application.routes.draw do
|
|||
patch 'update_template_setting'
|
||||
get 'sub_page_setting'
|
||||
end
|
||||
collection do
|
||||
post "send_notifying_email"
|
||||
get "get_predefined_text"
|
||||
end
|
||||
end
|
||||
get 'seminar/enquiry_for_applicants' => "seminars#enquiry_for_applicants"
|
||||
post 'seminar/update_seminar_review' => "seminars#update_seminar_review"
|
||||
|
@ -101,12 +107,16 @@ 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'
|
||||
patch 'update_signup_form', to: 'seminars#update_signup_form'
|
||||
end
|
||||
end
|
||||
|
||||
get "/xhr/seminars/check_email/:no" => "seminars#check_email"
|
||||
get "/xhr/seminars/check_name/:no" => "seminars#check_name"
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -320,9 +320,9 @@ module CustomAnnouncementsHelper
|
|||
if @target_action == "index"
|
||||
filename = overridehtml.nil? ? params[:layout_type] : overridehtml
|
||||
f = File.join(Rails.root, 'app', 'templates', "#{@key}", 'modules', 'custom_announcement', "#{filename}.html.erb")
|
||||
if !File.exists?f
|
||||
if !File.exist?(f)
|
||||
f = File.join(Rails.root, 'app', 'templates', "#{@key}", 'modules', 'custom_announcement', "index.html.erb")
|
||||
if !File.exists?f
|
||||
if !File.exist?(f)
|
||||
return "<div class='well'>Maybe the administrator has changed the theme, please select the index page design again from the page settings.</div>".html_safe
|
||||
end
|
||||
end
|
||||
|
@ -333,7 +333,7 @@ module CustomAnnouncementsHelper
|
|||
begin
|
||||
data = @data# rescue nil
|
||||
rescue Exception => e
|
||||
write_debug_file(e,'custom_announcements',@target_action) if Site::DEBUG
|
||||
write_debug_file(e,'custom_announcements',@target_action) if Site::DEBUG
|
||||
end
|
||||
if !data.nil?
|
||||
wrap_elements = doc.css("*[data-list][data-level='0']")
|
||||
|
@ -362,7 +362,7 @@ module CustomAnnouncementsHelper
|
|||
else
|
||||
filename = overridehtml.nil? ? @target_action : overridehtml
|
||||
f = File.join(Rails.root, 'app', 'templates', "#{@key}", 'modules', 'custom_announcement', "#{filename}.html.erb")
|
||||
if File.exists?f
|
||||
if File.exist?(f)
|
||||
file = File.open(f)
|
||||
doc = Nokogiri::HTML(file, nil, "UTF-8")
|
||||
file.close
|
||||
|
@ -464,7 +464,7 @@ module CustomAnnouncementsHelper
|
|||
layout_types = []
|
||||
@key = Site.first.template
|
||||
f = File.join("#{Rails.root}/app/templates/#{@key}/modules/#{module_app}/info.json")
|
||||
if File.exists?f
|
||||
if File.exist?(f)
|
||||
info = File.read(f)
|
||||
hash = JSON.parse(info) rescue {}
|
||||
frontends = hash["frontend"] || []
|
||||
|
|
|
@ -2,153 +2,155 @@ require "yaml"
|
|||
module CustomAnnouncement
|
||||
class Engine < ::Rails::Engine
|
||||
initializer "custom_announcement" do
|
||||
begin
|
||||
translate_data = Dir["#{CustomAnnouncement::Engine.root}/config/locales/*.yml"] .map{|yaml_file| YAML.load(File.read(yaml_file))}
|
||||
data = {}
|
||||
key1 = {}
|
||||
key2 = {}
|
||||
key3 = {}
|
||||
key4 = {}
|
||||
key1_attr = []
|
||||
key2_attr = []
|
||||
key3_attr = []
|
||||
key4_attr = []
|
||||
data_item = {}
|
||||
key_item1 = {}
|
||||
key_item2 = {}
|
||||
key_item3 = {}
|
||||
value_item1 = {}
|
||||
value_item2 = {}
|
||||
value_item3 = {}
|
||||
value2_item1 = {}
|
||||
value2_item2 = {}
|
||||
key1_options = ['small_size','medium_size','orignal_size']
|
||||
key2_options = ['not_enable_tabs','enable_tabs_with_categories_include_all','enable_tabs_with_categories']
|
||||
key3_options = ['default','upper_left','lower_left','upper_right','lower_right']
|
||||
key4_options = ['the_same_as_data_count','display_all_in_other_tabs']
|
||||
key1_options.each_with_index do |k,i|
|
||||
key1_attr[i] = {}
|
||||
end
|
||||
key2_options.each_with_index do |k,i|
|
||||
key2_attr[i] = {}
|
||||
end
|
||||
key3_options.each_with_index do |k,i|
|
||||
key3_attr[i] = {}
|
||||
end
|
||||
key4_options.each_with_index do |k,i|
|
||||
key4_attr[i] = {}
|
||||
end
|
||||
translate_data.each do |t_data|
|
||||
v = t_data.values
|
||||
k = t_data.keys[0]
|
||||
key1[k] = v[0]['custom_announcement']['picture_showing_size']
|
||||
key2[k] = v[0]['custom_announcement']['tabs_options']
|
||||
key3[k] = v[0]['custom_announcement']['read_more_position_options']
|
||||
key4[k] = v[0]['custom_announcement']['all_tabs_setting']
|
||||
key1_options.each_with_index do |kk,i|
|
||||
key1_attr[i][k] = v[0]['custom_announcement'][kk]
|
||||
end
|
||||
key2_options.each_with_index do |kk,i|
|
||||
key2_attr[i][k] = v[0]['custom_announcement'][kk]
|
||||
end
|
||||
key3_options.each_with_index do |kk,i|
|
||||
key3_attr[i][k] = v[0]['custom_announcement'][kk]
|
||||
end
|
||||
key4_options.each_with_index do |kk,i|
|
||||
key4_attr[i][k] = v[0]['custom_announcement'][kk]
|
||||
end
|
||||
key_item1[k] = v[0]['custom_announcement']['showing_back_and_next']
|
||||
key_item2[k] = v[0]['custom_announcement']['enable_search']
|
||||
value_item1[k] = v[0]['custom_announcement']['not_show']
|
||||
value_item2[k] = v[0]['custom_announcement']['show_bottom']
|
||||
value_item3[k] = v[0]['custom_announcement']['show_top']
|
||||
value2_item1[k] = v[0]['custom_announcement']['no']
|
||||
value2_item2[k] = v[0]['custom_announcement']['yes']
|
||||
end
|
||||
data[key1] = key1_attr
|
||||
data[key2] = key2_attr
|
||||
data[key3] = key3_attr
|
||||
data[key4] = key4_attr
|
||||
data_item[key_item1] = [value_item1,value_item2,value_item3]
|
||||
data_item[key_item2] = [value2_item1,value2_item2]
|
||||
require File.expand_path('../../../app/models/custom_anns_cache', __FILE__)
|
||||
if defined? CustomAnnsCache
|
||||
CustomAnnsCache.destroy_all
|
||||
end
|
||||
rescue => e
|
||||
puts ['error in custom_announcement',e]
|
||||
end
|
||||
OrbitApp.registration "CustomAnnouncement", :type => "ModuleApp" do
|
||||
module_label "custom_announcement.custom_announcement"
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
widget_methods ["widget","random_custom_announcement_widget", "tag_cloud"]
|
||||
widget_settings [{"data_count"=>30,"enable_custom_widget_data"=>true}]
|
||||
taggable "CustomBulletin"
|
||||
categorizable
|
||||
authorizable
|
||||
frontend_enabled
|
||||
feeds_url "/xhr/custom_announcements/feeds"
|
||||
data_count 1..30
|
||||
Rails.application.config.to_prepare do
|
||||
begin
|
||||
show_options data
|
||||
show_option_items data_item
|
||||
rescue => e
|
||||
puts ['there_was_no_show_option_method',e]
|
||||
translate_data = Dir["#{CustomAnnouncement::Engine.root}/config/locales/*.yml"] .map{|yaml_file| YAML.load(File.read(yaml_file))}
|
||||
data = {}
|
||||
key1 = {}
|
||||
key2 = {}
|
||||
key3 = {}
|
||||
key4 = {}
|
||||
key1_attr = []
|
||||
key2_attr = []
|
||||
key3_attr = []
|
||||
key4_attr = []
|
||||
data_item = {}
|
||||
key_item1 = {}
|
||||
key_item2 = {}
|
||||
key_item3 = {}
|
||||
value_item1 = {}
|
||||
value_item2 = {}
|
||||
value_item3 = {}
|
||||
value2_item1 = {}
|
||||
value2_item2 = {}
|
||||
key1_options = ['small_size','medium_size','orignal_size']
|
||||
key2_options = ['not_enable_tabs','enable_tabs_with_categories_include_all','enable_tabs_with_categories']
|
||||
key3_options = ['default','upper_left','lower_left','upper_right','lower_right']
|
||||
key4_options = ['the_same_as_data_count','display_all_in_other_tabs']
|
||||
key1_options.each_with_index do |k,i|
|
||||
key1_attr[i] = {}
|
||||
end
|
||||
key2_options.each_with_index do |k,i|
|
||||
key2_attr[i] = {}
|
||||
end
|
||||
key3_options.each_with_index do |k,i|
|
||||
key3_attr[i] = {}
|
||||
end
|
||||
key4_options.each_with_index do |k,i|
|
||||
key4_attr[i] = {}
|
||||
end
|
||||
translate_data.each do |t_data|
|
||||
v = t_data.values
|
||||
k = t_data.keys[0]
|
||||
key1[k] = v[0]['custom_announcement']['picture_showing_size']
|
||||
key2[k] = v[0]['custom_announcement']['tabs_options']
|
||||
key3[k] = v[0]['custom_announcement']['read_more_position_options']
|
||||
key4[k] = v[0]['custom_announcement']['all_tabs_setting']
|
||||
key1_options.each_with_index do |kk,i|
|
||||
key1_attr[i][k] = v[0]['custom_announcement'][kk]
|
||||
end
|
||||
key2_options.each_with_index do |kk,i|
|
||||
key2_attr[i][k] = v[0]['custom_announcement'][kk]
|
||||
end
|
||||
key3_options.each_with_index do |kk,i|
|
||||
key3_attr[i][k] = v[0]['custom_announcement'][kk]
|
||||
end
|
||||
key4_options.each_with_index do |kk,i|
|
||||
key4_attr[i][k] = v[0]['custom_announcement'][kk]
|
||||
end
|
||||
key_item1[k] = v[0]['custom_announcement']['showing_back_and_next']
|
||||
key_item2[k] = v[0]['custom_announcement']['enable_search']
|
||||
value_item1[k] = v[0]['custom_announcement']['not_show']
|
||||
value_item2[k] = v[0]['custom_announcement']['show_bottom']
|
||||
value_item3[k] = v[0]['custom_announcement']['show_top']
|
||||
value2_item1[k] = v[0]['custom_announcement']['no']
|
||||
value2_item2[k] = v[0]['custom_announcement']['yes']
|
||||
end
|
||||
data[key1] = key1_attr
|
||||
data[key2] = key2_attr
|
||||
data[key3] = key3_attr
|
||||
data[key4] = key4_attr
|
||||
data_item[key_item1] = [value_item1,value_item2,value_item3]
|
||||
data_item[key_item2] = [value2_item1,value2_item2]
|
||||
require File.expand_path('../../../app/models/custom_anns_cache', __FILE__)
|
||||
if defined? CustomAnnsCache
|
||||
CustomAnnsCache.destroy_all
|
||||
end
|
||||
rescue => e
|
||||
puts ['error in custom_announcement',e]
|
||||
end
|
||||
side_bar do
|
||||
set_sidebar_order(100) rescue nil
|
||||
head_label_i18n 'custom_announcement.custom_announcement', icon_class: "icon-bullhorn"
|
||||
available_for "users"
|
||||
active_for_controllers (['admin/custom_announcements'])
|
||||
head_link_path "admin_custom_announcements_path"
|
||||
OrbitApp.registration "CustomAnnouncement", :type => "ModuleApp" do
|
||||
module_label "custom_announcement.custom_announcement"
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
widget_methods ["widget","random_custom_announcement_widget", "tag_cloud"]
|
||||
widget_settings [{"data_count"=>30,"enable_custom_widget_data"=>true}]
|
||||
taggable "CustomBulletin"
|
||||
categorizable
|
||||
authorizable
|
||||
frontend_enabled
|
||||
feeds_url "/xhr/custom_announcements/feeds"
|
||||
data_count 1..30
|
||||
begin
|
||||
show_options data
|
||||
show_option_items data_item
|
||||
rescue => e
|
||||
puts ['there_was_no_show_option_method',e]
|
||||
end
|
||||
side_bar do
|
||||
set_sidebar_order(100) rescue nil
|
||||
head_label_i18n 'custom_announcement.custom_announcement', icon_class: "icon-bullhorn"
|
||||
available_for "users"
|
||||
active_for_controllers (['admin/custom_announcements'])
|
||||
head_link_path "admin_custom_announcements_path"
|
||||
|
||||
context_link 'custom_announcement.all_articles',
|
||||
:link_path=>"admin_custom_announcements_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'index'},
|
||||
:available_for => 'users'
|
||||
# context_link 'new_',
|
||||
# :link_path=>"new_admin_custom_announcement_path" ,
|
||||
# :priority=>2,
|
||||
# :active_for_action=>{'admin/custom_announcements'=>'new'},
|
||||
# :available_for => 'sub_managers'
|
||||
context_link 'categories',
|
||||
:link_path=>"admin_module_app_categories_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'custom_announcement').id}",
|
||||
:priority=>3,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'categories'},
|
||||
:active_for_category => 'CustomAnnouncement',
|
||||
:available_for => 'managers'
|
||||
context_link 'tags',
|
||||
:link_path=>"admin_module_app_tags_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'custom_announcement').id}",
|
||||
:priority=>4,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'tags'},
|
||||
:active_for_tag => 'CustomAnnouncement',
|
||||
:available_for => 'managers'
|
||||
context_link 'custom_announcement.feed_list',
|
||||
:link_path=>"admin_custom_announcement_feed_path" ,
|
||||
:priority=>5,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'feed'},
|
||||
:available_for => 'managers'
|
||||
context_link 'custom_announcement.import',
|
||||
:link_path=>"admin_custom_announcement_import_path" ,
|
||||
:priority=>6,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'import'},
|
||||
:available_for => 'managers'
|
||||
context_link 'custom_announcement.settings',
|
||||
:link_path=>"admin_custom_announcement_settings_path" ,
|
||||
:priority=>6,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'settings'},
|
||||
:available_for => 'managers'
|
||||
end
|
||||
|
||||
context_link 'custom_announcement.all_articles',
|
||||
:link_path=>"admin_custom_announcements_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'index'},
|
||||
:available_for => 'users'
|
||||
# context_link 'new_',
|
||||
# :link_path=>"new_admin_custom_announcement_path" ,
|
||||
# :priority=>2,
|
||||
# :active_for_action=>{'admin/custom_announcements'=>'new'},
|
||||
# :available_for => 'sub_managers'
|
||||
context_link 'categories',
|
||||
:link_path=>"admin_module_app_categories_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'custom_announcement').id}",
|
||||
:priority=>3,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'categories'},
|
||||
:active_for_category => 'CustomAnnouncement',
|
||||
:available_for => 'managers'
|
||||
context_link 'tags',
|
||||
:link_path=>"admin_module_app_tags_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'custom_announcement').id}",
|
||||
:priority=>4,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'tags'},
|
||||
:active_for_tag => 'CustomAnnouncement',
|
||||
:available_for => 'managers'
|
||||
context_link 'custom_announcement.feed_list',
|
||||
:link_path=>"admin_custom_announcement_feed_path" ,
|
||||
:priority=>5,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'feed'},
|
||||
:available_for => 'managers'
|
||||
context_link 'custom_announcement.import',
|
||||
:link_path=>"admin_custom_announcement_import_path" ,
|
||||
:priority=>6,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'import'},
|
||||
:available_for => 'managers'
|
||||
context_link 'custom_announcement.settings',
|
||||
:link_path=>"admin_custom_announcement_settings_path" ,
|
||||
:priority=>6,
|
||||
:active_for_action=>{'admin/custom_announcements'=>'settings'},
|
||||
:available_for => 'managers'
|
||||
end
|
||||
|
||||
# temp = YAML.load_file(File.join(Rails.root,"config","mongoid.yml"))
|
||||
# dbsettings = temp["production"]["sessions"]["default"]
|
||||
# s = Moped::Session.new(dbsettings["hosts"])
|
||||
# s.use dbsettings["database"]
|
||||
# s[:custom_bulletins].indexes.create({expirable_created_at: 1},{ expireAfterSeconds: 180 })
|
||||
end
|
||||
# temp = YAML.load_file(File.join(Rails.root,"config","mongoid.yml"))
|
||||
# dbsettings = temp["production"]["sessions"]["default"]
|
||||
# s = Moped::Session.new(dbsettings["hosts"])
|
||||
# s.use dbsettings["database"]
|
||||
# s[:custom_bulletins].indexes.create({expirable_created_at: 1},{ expireAfterSeconds: 180 })
|
||||
end
|
||||
end
|
||||
end
|
|
@ -502,7 +502,7 @@ class Admin::CustomGalleriesController < OrbitAdminController
|
|||
theater_link: admin_image_path(values),
|
||||
description: values.description,
|
||||
title: values.title,
|
||||
file: values.file.as_json[:file],
|
||||
file: values.file.as_json,
|
||||
custom_gallery_custom_album_id: values.custom_album_id,
|
||||
order: values.order,
|
||||
tags: values.tags}
|
||||
|
|
|
@ -242,7 +242,7 @@ class CustomGalleriesController < ApplicationController
|
|||
title: values.title,
|
||||
alt_title: alt_text,
|
||||
url: values.file.url,
|
||||
file: values.file.as_json[:file],
|
||||
file: values.file.as_json,
|
||||
custom_gallery_custom_album_id: values.custom_album_id,
|
||||
tags: values.tags}
|
||||
end
|
||||
|
|
|
@ -1,94 +1,96 @@
|
|||
module CustomGallery
|
||||
class Engine < ::Rails::Engine
|
||||
initializer "custom_gallery" do
|
||||
begin
|
||||
translate_data = Dir["#{CustomGallery::Engine.root}/config/locales/*.yml"] .map{|yaml_file| YAML.load(File.read(yaml_file))}
|
||||
data = {}
|
||||
key1 = {}
|
||||
value1 = {}
|
||||
value2 = {}
|
||||
value3 = {}
|
||||
translate_data.each do |t_data|
|
||||
v = t_data.values
|
||||
k = t_data.keys[0]
|
||||
key1[k] = v[0]['custom_gallery']['inner_page_layout']
|
||||
value1[k] = v[0]['custom_gallery']['grid_style']
|
||||
value2[k] = v[0]['custom_gallery']['card_style']
|
||||
value3[k] = v[0]['custom_gallery']['slideshow_style']
|
||||
Rails.application.config.to_prepare do
|
||||
begin
|
||||
translate_data = Dir["#{CustomGallery::Engine.root}/config/locales/*.yml"] .map{|yaml_file| YAML.load(File.read(yaml_file))}
|
||||
data = {}
|
||||
key1 = {}
|
||||
value1 = {}
|
||||
value2 = {}
|
||||
value3 = {}
|
||||
translate_data.each do |t_data|
|
||||
v = t_data.values
|
||||
k = t_data.keys[0]
|
||||
key1[k] = v[0]['custom_gallery']['inner_page_layout']
|
||||
value1[k] = v[0]['custom_gallery']['grid_style']
|
||||
value2[k] = v[0]['custom_gallery']['card_style']
|
||||
value3[k] = v[0]['custom_gallery']['slideshow_style']
|
||||
end
|
||||
data[key1] = [value1,value2,value3]
|
||||
rescue => e
|
||||
puts ['error in custom_gallery',e]
|
||||
end
|
||||
data[key1] = [value1,value2,value3]
|
||||
rescue => e
|
||||
puts ['error in custom_gallery',e]
|
||||
end
|
||||
|
||||
require File.expand_path('../../../app/models/custom_album_setting', __FILE__)
|
||||
if defined?(CustomAlbumSetting)
|
||||
if CustomAlbumSetting.first.nil?
|
||||
CustomAlbumSetting.create()
|
||||
elsif CustomAlbumSetting.count > 1
|
||||
CustomAlbumSetting.all.to_a[1..-1].each do |custom_album_setting|
|
||||
custom_album_setting.destroy
|
||||
require File.join(CustomGallery::Engine.root, 'app/models/custom_album_setting')
|
||||
if defined?(CustomAlbumSetting)
|
||||
if CustomAlbumSetting.first.nil?
|
||||
CustomAlbumSetting.create()
|
||||
elsif CustomAlbumSetting.count > 1
|
||||
CustomAlbumSetting.all.to_a[1..-1].each do |custom_album_setting|
|
||||
custom_album_setting.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
OrbitApp.registration "CustomGallery", :type => "ModuleApp" do
|
||||
module_label "custom_gallery.custom_gallery"
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
widget_methods ["widget","custom_album_widget"]
|
||||
# widget_settings []
|
||||
widget_settings [{"data_count"=>30,"enable_custom_widget_data"=>true}]
|
||||
models_to_cache [:custom_album,:custom_album_image]
|
||||
taggable "CustomAlbum"
|
||||
categorizable
|
||||
authorizable
|
||||
frontend_enabled
|
||||
data_count 1..30
|
||||
begin
|
||||
show_option_items data
|
||||
rescue => e
|
||||
puts ['there_was_no_show_option_method',e]
|
||||
end
|
||||
side_bar do
|
||||
set_sidebar_order(100) rescue nil
|
||||
head_label_i18n 'custom_gallery.custom_gallery', icon_class: "fa fa-file-image-o"
|
||||
available_for "users"
|
||||
active_for_controllers (['admin/custom_galleries','admin/images'])
|
||||
head_link_path "admin_custom_galleries_path"
|
||||
|
||||
OrbitApp.registration "CustomGallery", :type => "ModuleApp" do
|
||||
module_label "custom_gallery.custom_gallery"
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
widget_methods ["widget","custom_album_widget"]
|
||||
# widget_settings []
|
||||
widget_settings [{"data_count"=>30,"enable_custom_widget_data"=>true}]
|
||||
models_to_cache [:custom_album,:custom_album_image]
|
||||
taggable "CustomAlbum"
|
||||
categorizable
|
||||
authorizable
|
||||
frontend_enabled
|
||||
data_count 1..30
|
||||
begin
|
||||
show_option_items data
|
||||
rescue => e
|
||||
puts ['there_was_no_show_option_method',e]
|
||||
end
|
||||
side_bar do
|
||||
set_sidebar_order(100) rescue nil
|
||||
head_label_i18n 'custom_gallery.custom_gallery', icon_class: "fa fa-file-image-o"
|
||||
available_for "users"
|
||||
active_for_controllers (['admin/custom_galleries','admin/images'])
|
||||
head_link_path "admin_custom_galleries_path"
|
||||
|
||||
context_link 'custom_gallery.all',
|
||||
:link_path=>"admin_custom_galleries_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{'admin/custom_galleries'=>"index"},
|
||||
:available_for => 'users'
|
||||
context_link 'custom_gallery.all',
|
||||
:link_path=>"admin_custom_galleries_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{'admin/custom_galleries'=>"index"},
|
||||
:available_for => 'users'
|
||||
|
||||
# context_link 'custom_gallery.new',
|
||||
# :link_path=>"new_admin_custom_gallery_path" ,
|
||||
# :priority=>2,
|
||||
# :active_for_action=>{'admin/custom_galleries'=>"new"},
|
||||
# :available_for => 'sub_managers'
|
||||
# context_link 'custom_gallery.new',
|
||||
# :link_path=>"new_admin_custom_gallery_path" ,
|
||||
# :priority=>2,
|
||||
# :active_for_action=>{'admin/custom_galleries'=>"new"},
|
||||
# :available_for => 'sub_managers'
|
||||
|
||||
context_link 'categories',
|
||||
:link_path=>"admin_module_app_categories_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'custom_gallery').id}",
|
||||
:priority=>3,
|
||||
:active_for_action=>{'admin/custom_galleries'=>'categories'},
|
||||
:active_for_category => 'CustomGallery',
|
||||
:available_for => 'managers'
|
||||
|
||||
context_link 'tags',
|
||||
:link_path=>"admin_module_app_tags_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'custom_gallery').id}",
|
||||
:priority=>4,
|
||||
:active_for_action=>{'admin/custom_galleries'=>'tags'},
|
||||
:active_for_tag => 'CustomGallery',
|
||||
:available_for => 'managers'
|
||||
context_link 'setting',
|
||||
:link_path=>"admin_custom_galleries_setting_path" ,
|
||||
:priority=>5,
|
||||
:active_for_action=>{'admin/custom_galleries'=>'setting'},
|
||||
:available_for => 'managers'
|
||||
end
|
||||
context_link 'categories',
|
||||
:link_path=>"admin_module_app_categories_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'custom_gallery').id}",
|
||||
:priority=>3,
|
||||
:active_for_action=>{'admin/custom_galleries'=>'categories'},
|
||||
:active_for_category => 'CustomGallery',
|
||||
:available_for => 'managers'
|
||||
|
||||
context_link 'tags',
|
||||
:link_path=>"admin_module_app_tags_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'custom_gallery').id}",
|
||||
:priority=>4,
|
||||
:active_for_action=>{'admin/custom_galleries'=>'tags'},
|
||||
:active_for_tag => 'CustomGallery',
|
||||
:available_for => 'managers'
|
||||
context_link 'setting',
|
||||
:link_path=>"admin_custom_galleries_setting_path" ,
|
||||
:priority=>5,
|
||||
:active_for_action=>{'admin/custom_galleries'=>'setting'},
|
||||
:available_for => 'managers'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,55 +1,56 @@
|
|||
module Seminar
|
||||
class Engine < ::Rails::Engine
|
||||
initializer "seminar" do
|
||||
OrbitApp.registration "Seminar", :type => "ModuleApp" do
|
||||
module_label "seminar.seminar"
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
authorizable
|
||||
categorizable
|
||||
frontend_enabled
|
||||
data_count 1..20
|
||||
widget_methods ["widget"]
|
||||
widget_settings [{"data_count"=>30}]
|
||||
side_bar do
|
||||
head_label_i18n 'seminar.seminar', icon_class: "icon-globe"
|
||||
available_for "users"
|
||||
active_for_controllers (['admin/seminars'])
|
||||
head_link_path "admin_seminars_path"
|
||||
initializer "seminar" do
|
||||
Rails.application.config.to_prepare do
|
||||
OrbitApp.registration "Seminar", :type => "ModuleApp" do
|
||||
module_label "seminar.seminar"
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
authorizable
|
||||
categorizable
|
||||
frontend_enabled
|
||||
data_count 1..20
|
||||
widget_methods ["widget"]
|
||||
widget_settings [{"data_count"=>30}]
|
||||
side_bar do
|
||||
head_label_i18n 'seminar.seminar', icon_class: "icon-globe"
|
||||
available_for "users"
|
||||
active_for_controllers (['admin/seminars'])
|
||||
head_link_path "admin_seminars_path"
|
||||
|
||||
context_link 'list_',
|
||||
:link_path=>"admin_seminars_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{'admin/seminars'=>'index'},
|
||||
:available_for => 'users'
|
||||
context_link 'new_',
|
||||
:link_path=>"new_admin_seminar_path" ,
|
||||
:priority=>2,
|
||||
:active_for_action=>{'admin/seminars'=>'new'},
|
||||
:available_for => 'sub_managers'
|
||||
context_link 'categories',
|
||||
:link_path=>"admin_module_app_categories_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'seminar').id}",
|
||||
:priority=>3,
|
||||
:active_for_action=>{'admin/seminars'=>'categories'},
|
||||
:active_for_category => 'Seminar',
|
||||
:available_for => 'managers'
|
||||
context_link 'seminar.set_seminar_items',
|
||||
:link_path=>"admin_seminar_items_path" ,
|
||||
:priority=>4,
|
||||
:active_for_action=>{'admin/seminars'=>'seminar_items'},
|
||||
:available_for => 'managers'
|
||||
context_link 'seminar.set_seminar_agreements',
|
||||
:link_path=>"admin_seminar_agreements_path" ,
|
||||
:priority=>5,
|
||||
:active_for_action=>{'admin/seminars'=>'seminar_agreements'},
|
||||
:available_for => 'managers'
|
||||
context_link 'seminar.enquiry_for_applicants',
|
||||
:link_path=>"admin_seminar_enquiry_for_applicants_path" ,
|
||||
:priority=>6,
|
||||
:active_for_action=>{'admin/seminars'=>'enquiry_for_applicants'},
|
||||
:available_for => 'users'
|
||||
context_link 'list_',
|
||||
:link_path=>"admin_seminars_path" ,
|
||||
:priority=>1,
|
||||
:active_for_action=>{'admin/seminars'=>'index'},
|
||||
:available_for => 'users'
|
||||
context_link 'new_',
|
||||
:link_path=>"new_admin_seminar_path" ,
|
||||
:priority=>2,
|
||||
:active_for_action=>{'admin/seminars'=>'new'},
|
||||
:available_for => 'sub_managers'
|
||||
context_link 'categories',
|
||||
:link_path=>"admin_module_app_categories_path" ,
|
||||
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'seminar').id}",
|
||||
:priority=>3,
|
||||
:active_for_action=>{'admin/seminars'=>'categories'},
|
||||
:active_for_category => 'Seminar',
|
||||
:available_for => 'managers'
|
||||
context_link 'seminar.set_seminar_items',
|
||||
:link_path=>"admin_seminar_items_path" ,
|
||||
:priority=>4,
|
||||
:active_for_action=>{'admin/seminars'=>'seminar_items'},
|
||||
:available_for => 'managers'
|
||||
context_link 'seminar.set_seminar_agreements',
|
||||
:link_path=>"admin_seminar_agreements_path" ,
|
||||
:priority=>5,
|
||||
:active_for_action=>{'admin/seminars'=>'seminar_agreements'},
|
||||
:available_for => 'managers'
|
||||
context_link 'seminar.enquiry_for_applicants',
|
||||
:link_path=>"admin_seminar_enquiry_for_applicants_path" ,
|
||||
:priority=>6,
|
||||
:active_for_action=>{'admin/seminars'=>'enquiry_for_applicants'},
|
||||
:available_for => 'users'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue