Compare commits

..

1 Commits

Author SHA1 Message Date
邱博亞 1865d39ae9 tacf change 2023-09-28 00:24:41 +08:00
33 changed files with 721 additions and 659 deletions

View File

@ -110,7 +110,6 @@ 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]"],
@ -118,34 +117,6 @@ 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) {
@ -285,11 +256,11 @@ $(function() {
nameNumber = nameNumber.match(/[^[\D\]]+(?=])/g)[0];
seminar_mainType = $(this).data('seminar_mains')
if($(this).hasClass('textInput')) {
init_template_html($("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
$("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
} else if ($(this).hasClass('textLengInput')) {
init_template_html($("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
$("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
} else if ($(this).hasClass('address')) {
init_template_html($("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
$("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
}
inputAppendLength();
};
@ -317,7 +288,7 @@ $(function() {
};
attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
attributesLength = $('#attributes-area .attributes').length;
init_template_html($("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" ));
$("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" );
$('.toggle-check').togglebox();
});
@ -468,7 +439,7 @@ $(function() {
console.log(appendIndex)
attributeIndex = $(this).closest('.attributes').index();
templateType = $(this).closest('.attributes').find('.dataType').children("option:selected").attr('ref');
init_template_html($("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target')));
$("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target'));
inputAppendLength();
};
if($(this).hasClass('remove-input')) {
@ -483,7 +454,6 @@ $(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;
@ -497,7 +467,7 @@ $(function() {
if($(this).attr('ref')) {
templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
init_template_html($("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target));
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength();
}
@ -511,7 +481,7 @@ $(function() {
if($(this).attr('ref')) {
templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
init_template_html($("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target));
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength();
}

View File

@ -110,7 +110,6 @@ 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]"],
@ -118,34 +117,6 @@ 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) {
@ -285,11 +256,11 @@ $(function() {
nameNumber = nameNumber.match(/[^[\D\]]+(?=])/g)[0];
seminar_mainType = $(this).data('seminar_mains')
if($(this).hasClass('textInput')) {
init_template_html($("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
$("#template-text").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
} else if ($(this).hasClass('textLengInput')) {
init_template_html($("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
$("#template-text-language").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
} else if ($(this).hasClass('address')) {
init_template_html($("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target')));
$("#template-address").tmpl().appendTo($(this).closest('.controls').find('.add-target'));
}
inputAppendLength();
};
@ -317,7 +288,7 @@ $(function() {
};
attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
attributesLength = $('#attributes-area .attributes').length;
init_template_html($("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" ));
$("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" );
$('.toggle-check').togglebox();
});
@ -467,7 +438,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');
init_template_html($("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target')));
$("#template-input-append").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo($(this).closest('.controls').find('.add-target'));
inputAppendLength();
};
if($(this).hasClass('remove-input')) {
@ -482,7 +453,6 @@ $(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;
@ -496,7 +466,7 @@ $(function() {
if($(this).attr('ref')) {
templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
init_template_html($("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target));
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength();
}
@ -510,7 +480,7 @@ $(function() {
if($(this).attr('ref')) {
templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
init_template_html($("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target));
$("#template-type").tmpl(setData(attributeIndex, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength();
}

View File

@ -556,6 +556,13 @@ class Admin::SeminarsController < OrbitAdminController
render action: :edit and return
end
end
Rails.logger.info "&&&&&&&&&&&&&&"
if @seminar_params[:seminar_email_sets_attributes]
Rails.logger.info "*********************"
Rails.logger.info @seminar_params[:seminar_email_sets_attributes]
@seminar.update_attributes(@seminar_params[:seminar_email_sets_attributes])
flash.now[:notice] = "Updated Fields"
end
end
redirect_to admin_seminars_path
end

View File

@ -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.gsub!(/notice=[^&]*/,'').gsub!(/&+$/,'') #rescue nil
if uri_query.blank?
referer_url = referer_url + "?notice=#{notice_words}"
else
@ -334,7 +334,6 @@ class SeminarsController < ApplicationController
seminar_url = (@prefix_url ? @prefix_url : OrbitHelper.url_to_show(seminar.to_param))
if !registration_is_open
sign_up = t('seminar.sign_up_not_open')
sign_up_not_yet = true
elsif sign_up_not_yet
sign_up = t('seminar.sign_up_not_yet')
elsif sign_up_overdue
@ -346,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.nil? || 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 <= 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)
@ -361,7 +360,6 @@ class SeminarsController < ApplicationController
'sign_up' => sign_up,
'contribute_action' => contribute_action,
'time_now' => time_now,
'sign_up_not_yet' => sign_up_not_yet,
'contribute_time_range' => SeminarMain.time_range(seminar.contribute_start_date, seminar.contribute_end_date),
'sign_up_time_range' => SeminarMain.time_range(seminar.signup_start_date, seminar.signup_end_date),
'seminar_time_range' => SeminarMain.time_range(seminar.seminar_start_date, seminar.seminar_end_date)
@ -393,18 +391,18 @@ class SeminarsController < ApplicationController
def check_email
params = OrbitHelper.params
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
@ -524,13 +522,10 @@ class SeminarsController < ApplicationController
def add_file_proc
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'].to_h)
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'])
flag = true
update_params.permit!
if update_params['seminar_submission_values'].present?
if update_params['seminar_submission_values']['0']['value'].nil?
flag = false
else
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?
@ -543,7 +538,6 @@ class SeminarsController < ApplicationController
end
end
end
end
else
flag = false
end
@ -580,12 +574,9 @@ 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'].to_h)
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'])
update_params.permit!
if update_params['seminar_submission_values'].present?
if update_params['seminar_submission_values']['0']['value'].nil?
flag = false
else
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']
@ -599,7 +590,6 @@ class SeminarsController < ApplicationController
end
end
end
end
if flag
update_params['seminar_submission_values']['0']['value']['en'] = ' '
end
@ -743,6 +733,12 @@ class SeminarsController < ApplicationController
end
def reset_email
end
def reset_password_page
end
def con_login_proc
seminar = SeminarMain.find_by(id: params[:seminar_signup][:seminar_main_id])
@ -756,11 +752,43 @@ class SeminarsController < ApplicationController
redirect_to "#{params[:referer_url].to_s.chomp('/')}/?method=con_upload"
else
redirect_to "#{params[:referer_url].to_s.chomp('/')}/?method=con_login", :notice => '登入失敗'
redirect_to "#{params[:referer_url].to_s.chomp('/')}/?method=con_login", :notice => t('seminar_signup.login_failed')
end
end
def reset_confirm_password_proc
seminar_signup = SeminarSignup.where(:status=>'C', :reset_token=> params[:token], :seminar_main_id => params[:seminar_signup][:seminar_main_id]).first
if !seminar_signup.blank?
params.permit!
seminar_signup.password = params[:password]
seminar_signup.reset_token = ""
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"
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_reset_token
mail = Email.create(mail_to:params[:user_name],
module_app_key:"seminar",
template:"email/reset_password_email.html.erb",
mail_sentdate:Time.current,
mail_subject: t("seminar_signup.email_reset_password_success"),
template_data:{'url'=> request.protocol + request.host_with_port + "#{params[:referer_url].to_s.chomp('/')}/?method=reset_password_page&token=#{token}",'locale'=>I18n.locale})
# mail.deliver
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

View File

@ -29,20 +29,6 @@ module Admin::SeminarsFieldHelper
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
control_group_wrapper_for_sm do |key,value|
value = (can_muti_lang_input_for_sm? ? @prefiled_value[key] : @prefiled_value) rescue nil
@ -399,7 +385,7 @@ protected
result = address
else
result = form_label + content_tag(:div,controls_wrapper_for_sm(&block),:class=>div_class)
result = form_label + content_tag(:div, controls_wrapper_for_sm(&block),:class=>div_class, :id => "yessss")
end
result = result + end_block
result.html_safe
@ -547,19 +533,25 @@ protected
end
@attribute_value = field_sets
@prefiled_value = field_sets[field]
a = control_group_wrapper_for_sm do |key,value|
add_more_blank = ""
if markup=='text_field'
a = control_group_wrapper_for_sm do |key,value|
# debugger
if key_field == 'seminar_email_sets'
inside = text_field_tag([get_field_name_base,"[#{key}]"].join,value,:class=>'input-medium form-control')
else
inside = text_field_tag([get_field_name_base,"[#{key}]"].join,value)
end
else
inside = cktext_area("seminar_main[#{@key_field}][#{@key_index}][#{@field}]","#{key}",value:value)
end
inside
end
else
a = "<label>" + t(:en) + "</label>"
a = a + cktext_area("seminar_main[#{@key_field}][#{@key_index}][#{@field}]","en",value:@prefiled_value['en'])
a = a + "<label>" + t(:zh_tw) + "</label>"
a = a + cktext_area("seminar_main[#{@key_field}][#{@key_index}][#{@field}]","zh_tw",value:@prefiled_value['zh_tw'])
end
@key_field = nil
@key_index = nil
@field = nil

View File

@ -8,6 +8,7 @@ class SeminarSignup
field :sort_number , type: Integer, default: 10000
field :status
field :reset_token
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
@ -80,6 +81,13 @@ class SeminarSignup
seminar_session.save
end
end
def generate_reset_token
reset_token = SecureRandom.hex(5)
self.reset_token = reset_token
self.save
return reset_token
end
def display_serial_number
display_format_string(self.serial_number,4)
end

View File

@ -24,7 +24,6 @@ class SeminarSignupField
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

View File

@ -24,7 +24,6 @@ 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

View File

@ -129,34 +129,6 @@
<%= 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>

View File

@ -128,7 +128,6 @@
<%= 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>
@ -141,35 +140,6 @@
</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>

View File

@ -552,6 +552,8 @@
$(".summary_choice_block").css("display","none");
}
})
// $("div#seminar_main_seminar_email_sets_attributes_0_content_en").attr('id',"div_seminar_main_seminar_email_sets_attributes_0_content_en");
// $("div#seminar_main_seminar_email_sets_attributes_0_content_zh_tw").attr('id',"div_seminar_main_seminar_email_sets_attributes_0_content_zh_tw");
});
</script>
<% end %>

View File

@ -112,7 +112,7 @@
<script id="template-type" type="text/x-tmpl">
{{if templateType == 'typeA' || templateType == 'typeD'}}
{{if templateType == 'typeA' || templateType == 'typeD' || templateType == 'typeG'}}
<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'}}
{{if templateType == 'typeA' || templateType == 'typeG'}}
<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,35 +257,6 @@
</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>

View File

@ -10,7 +10,7 @@
<%= 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">

View File

@ -9,7 +9,7 @@
<%= 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 %>

View File

@ -0,0 +1,4 @@
<p><%= t("seminar_signup.click_on_link") %></p>
<div>
<a href="<%= @data['url'].html_safe %>" target="_blank"><%= t("seminar_signup.reset") %></a>
</div>

View File

@ -9,7 +9,7 @@
color: red;
}
</style>
<% 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 ) %>
<% if (@seminar.contribute_start_date <= @time_now && (@seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) rescue false) %>
<section id="main-wrap">
<div class="sign-in have-other-sign-in">
@ -39,8 +39,12 @@
<%= 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>
<% end %>
</div>

View File

@ -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 ? !(data1.disabled) : false
show2 = data2 ? !(data2.disabled) : false
show3 = data3 ? !(data3.disabled) : false
show1 = !(data1.disabled) rescue false
show2 = !(data2.disabled) rescue false
show3 = !(data3.disabled) rescue false
name1 = data1['name'][I18n.locale]
name2 = data2['name'][I18n.locale]
name3 = data3['name'][I18n.locale]
@ -22,11 +22,12 @@
prefix_url = OrbitHelper.url_to_show(@seminar.to_param)
end
%>
<% if (@seminar.contribute_start_date.nil? || @seminar.contribute_start_date <= @time_now) && ( @seminar.contribute_end_date.nil? || @seminar.contribute_end_date+1 >= @time_now ) %>
<% if @seminar.contribute_start_date <= @time_now and ( @seminar.contribute_end_date.nil? or @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>
<a href="<%= prefix_url %>?method=con_logout&con_no=<%= @seminar.id %>" class='btn btn-primary' style="display: block; width: 150px;"><%= t('seminar_signup.logout') %></a>
<table class="table table-hover table-striped seminar-index">
<caption>
@ -69,13 +70,19 @@
<td><%= description.html_safe %></td>
<% end %>
<% if show3 %>
<td><%= link_to seminar_signup_contribute.disp_filename, seminar_signup_contribute.file.url, {:target => '_blank', :title => Nokogiri::HTML(description.gsub("<br>"," , ")).text, :download=>seminar_signup_contribute.disp_filename} if seminar_signup_contribute.file.file %></td>
<td>
<% if show2 %>
<%= link_to seminar_signup_contribute.disp_filename, seminar_signup_contribute.file.url, {:target => '_blank', :title => Nokogiri::HTML(description.gsub("<br>"," , ")).text, :download=>seminar_signup_contribute.disp_filename} if seminar_signup_contribute.file.file %>
<% else %>
<%= link_to seminar_signup_contribute.disp_filename, seminar_signup_contribute.file.url, {:target => '_blank', :title => seminar_signup_contribute.disp_filename, :download=>seminar_signup_contribute.disp_filename} if seminar_signup_contribute.file.file %>
<% end %>
</td>
<% end %>
<% if seminar_submission_field %>
<td><%= seminar_signup_contribute.seminar_submission_values.where(:seminar_submission_field=>seminar_submission_field).first.get_value_by_locale(I18n.locale) %></td>
<% end %>
<td>
<%= link_to t(:edit), prefix_url + '?method=edit_file&con_no=' + seminar_signup_contribute.id, :class => 'btn btn-primary' %>
<%= link_to t(:edit), prefix_url + '?method=edit_file&con_no=' + seminar_signup_contribute.id, :class => 'btn btn-primary', :style => 'display:block; width: 150px;' %>
<%= form_tag(del_file_seminars_path, {method: "post"}) do |f| %>
<%= submit_tag t(:delete_), class: "btn btn-primary" %>
<%= hidden_field_tag "referer_url", request.original_url.split(request.env["HTTP_HOST"]).last.split('?').first %>
@ -89,7 +96,7 @@
<% if ( @seminar.contribute_file_count.blank? or @seminar_signup.seminar_signup_contributes.count < @seminar.contribute_file_count.to_i ) %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('seminar_signup.new_'), prefix_url + '?method=add_file', :class => 'btn btn-primary' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('seminar_signup.new_'), prefix_url + '?method=add_file', :class => 'btn btn-primary' , :style => 'display:block; width: 150px;' %>
<% end %>
<br />

View File

@ -6,11 +6,13 @@
@time_now = data["time_now"]
%>
<% begin %>
<table class="table table-hover table-striped seminar-index">
<table class="table seminar-index">
<caption>
<% page = OrbitHelper.page rescue Page.where(:page_id => OrbitHelper.params[:page_id]).first %>
<h3><%= page.name rescue t('seminar.seminar') %></h3>
</caption>
<%
=begin%>
<thead>
<tr>
<th class="col-md-2"><%= t(:category) %></th>
@ -20,6 +22,8 @@
<th class="col-md-2"><%= t('seminar.signup') %></th>
</tr>
</thead>
<%
=end%>
<tbody>
<%
@seminars.each do |seminar|
@ -43,9 +47,9 @@
seminar_title = seminar.title
%>
<tr>
<td><%= seminar.category.title %></td>
<td>
<%= link_to(seminar_title, seminar.get_frontend_url(seminar_url, :show_data), :target=>'_blank', :title=>seminar_title) %>
<%= seminar_title %>
<%#= link_to(seminar_title, seminar.get_frontend_url(seminar_url, :show_data), :target=>'_blank', :title=>seminar_title) %>
</td>
<td><%= SeminarMain.time_range(seminar.seminar_start_date, seminar.seminar_end_date) %></td>
<td><%= seminar.act_place %></td>

View File

@ -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>

View File

@ -0,0 +1,70 @@
<% # 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_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 %>
</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_signup[seminar_main_id]" value="<%= @seminar.id %>">
<input type="hidden" name="reset_token" value="<%= params['token'] %>" />
<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);
})
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>

View File

@ -36,6 +36,11 @@
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<style>
.error{
color: red;
}
</style>
<% notice = flash["notice"] || params[:notice] %>
<% flash.each do |key, msg| %>
<% next if key.to_s == "notice" %>
@ -58,8 +63,8 @@
<!-- Title -->
<div class="form-group">
<label for="title" class="col-sm-2 control-label"><%= t('seminar.title') %></label>
<div class="col-sm-10">
<label for="title" class="col-sm-2 control-label hide"><%= t('seminar.title') %></label>
<div class="col-sm-10 seminar-title">
<%= @seminar.title %>
</div>
</div>
@ -77,7 +82,7 @@
<% 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' : '' %>">
<div class="form-group<%= (@seminar.registration_status[0] == 'G' && signup_field.field_name == 'password') ? ' hide' : '' %><%= (signup_field.hidden) ? ' 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,8 @@
</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 %>
<div class="loader"></div>
</div>
<% elsif signup_field.field_name == 'note' %>
<div class="col-sm-10">
@ -203,18 +209,31 @@
</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 % 4 == 0) && idx != 0 %>
<% group += 1 %>
<div id="group<%= group %>" style="display:none;">
<% end %>
<% counter += 1 %>
<div class="form-group">
<%= rf.block_helper(@seminar,@form_index,false,"seminar_signup",@seminar_signup, rf.to_require) %>
</div>
<% if(counter % 4 == 0) && idx != 3 %>
<% counter = 0 %>
</div>
<% end %>
<% @form_index = @form_index +1 %>
<% end %>
<div class="form-group" style="text-align:center;margin:10px 0;">
<button id="add-member" class="btn btn-primary" style="display:inline; width: 150px">增加組員</button>
</div>
<!-- 驗證碼 -->
<% if @seminar.seminar_signup_field_sets.count != 0 %>
@ -312,31 +331,38 @@
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(type == "seminar_signup_email"){
loader.text("Checking...")
checkAvailability();
}
}
})
let currentGroup = 1;
$("#add-member").on("click",function () {
if(currentGroup < 5){
currentGroup++;
$("#group" + currentGroup).show();
if(currentGroup == 5){
$(this).attr("disabled","disabled").hide();
}
}
return false;
})
})();
</script>

View File

@ -10,7 +10,6 @@
@seminar_time_range = data["seminar_time_range"]
@contribute_time_range = data["contribute_time_range"]
@contribute_action = data["contribute_action"]
@sign_up_not_yet = data["sign_up_not_yet"]
%>
@ -20,7 +19,7 @@
<th class="seminarive-title-field"><%= t(:category) %></th>
<td class="seminarive-title-value"><%= @seminar.category.title %></td>
</tr>
<tr <%= 'class="hidden"'.html_safe if @seminar_time_range.blank? %>>
<tr>
<th class="seminarive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('seminar.event_during') %></th>
<td class="seminarive-title-value"><%= @seminar_time_range %></td>
</tr>
@ -40,7 +39,7 @@
<td class="seminarive-title-value"><%= nl2br(@seminar.content) %></td>
</tr>
<% end %>
<tr <%= 'class="hidden"'.html_safe if @sign_up_time_range.blank? %>>
<tr>
<th class="seminarive-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('seminar.signup_during') %></th>
<td class="seminarive-title-value"><%= @sign_up_time_range %></td>
</tr>
@ -50,7 +49,7 @@
<td class="seminarive-title-value"><%= @contribute_time_range %></td>
</tr>
<% end %>
<tr <%= 'class="hidden"'.html_safe if @sign_up_not_yet && @contribute_action.blank? %>>
<tr>
<th class="seminarive-title-field"><%= t('seminar.signup') %></th>
<td class="seminarive-title-value"><%= @sign_up %><br /><%= @contribute_action %></td>
</tr>

View File

@ -13,7 +13,7 @@
<%=t('seminar_signup.serial_number') %>: <%=data["serial_number"] rescue ""%>
<% if !params['status'].nil? %>
<br>
<a href="<%= prefix_url %>?method=con_login" class="btn btn-primary">
<a href="<%= prefix_url %>?method=con_login" class="btn btn-primary" style="display: block; width: 250px;">
<%= t('seminar.click_to_contribute') %>
</a>
<% else %>

View File

@ -45,7 +45,3 @@ markups:
ext_support: false
panel: typeF
display_only: seminar_submission_field
instructions:
muti_lang_input_supprt: false
ext_support: false
panel: typeG

View File

@ -6,8 +6,6 @@ en:
lists:
markups:
seminar_preferred_session: Preferred Session
instructions: Instructions
restful_actions:
edit_seminar_review: Review
copy: Copy
@ -207,7 +205,7 @@ en:
email_address: Email address
_password: Password
login: Login
new_: 'Load abstract'
new_: 'Upload'
load_file: load file
enable_summary_choice: Enable summary choice
summary_choice_type: Summary choice type
@ -215,3 +213,13 @@ en:
checkbox: Multiple choice
radio: Single choice
choices: Choices
forgot_password: Forgot Password
reset_email_sent: Reset Email Sent
login_failed: Login Failed
email_not_found: Email not found
reset: Reset
email_reset_password_success: Password reset
click_on_link: Please click on the link below to reset your password
confirm_password: Confirm Password
password_mismatch: Password missmatch
password_changed: Password changed successfully

View File

@ -6,7 +6,6 @@ zh_tw:
lists:
markups:
seminar_preferred_session: Preferred Session
instructions: "說明文字 Instructions"
restful_actions:
edit_seminar_review: 審查
@ -104,8 +103,8 @@ zh_tw:
email_edit_file: 編輯上傳
email_add_file: 新增上傳
auto_send_email_set: 自動發信設定
click_to_contribute: 按此登入投稿
required: '必填, necessary'
click_to_contribute: 按此登入上傳切結書
required: '必填'
already_used: 已存在
please_enter_email: 請輸入Email
available: 可使用
@ -192,7 +191,7 @@ zh_tw:
note: 註解
time: (開始/結束)時間
place: 地點
agree: 同意接受本站個資及隱私權保護宣告(Agree upon personal data protection declaration of this web)
agree: 參賽隊伍或其法定代理人皆同意「個人資料蒐集處理利用告知書」、「活動須知」。註冊表單填寫完成後將上傳每位參賽者的「參賽切結書」。
privacy_statement: '個資及隱私權保護宣告'
recaptcha: 驗證碼
signup_field: 圈選項目
@ -203,11 +202,11 @@ zh_tw:
files: 檔案
logout: Logout
logouting: 登出中
success_message: '您的報名已成功,感謝您的參與。'
success_message: '感謝您們報名「臺北程式設計節2023城市運行大黑客松」收到此Email代表您們已順利填寫註冊表單。請接續上傳每位參賽者的「參賽切結書」以完成報名流程作業。'
email_address: Email address
_password: Password
login: Login
new_: '新增(load abstract)'
new_: '新增'
load_file: load file
enable_summary_choice: 開啟摘要選項
summary_choice_type: 摘要選項類型
@ -215,3 +214,13 @@ zh_tw:
checkbox: 多選
radio: 單選
choices: 選項
forgot_password: Forgot Password
reset_email_sent: Reset Email Sent
login_failed: 登入失敗
email_not_found: Email not found
reset: Reset
email_reset_password_success: Password reset
click_on_link: 請點選下方連結後重設密碼。
confirm_password: Confirm Password
password_mismatch: Password missmatch
password_changed: Password changed successfully

View File

@ -100,13 +100,15 @@ Rails.application.routes.draw do
collection do
get ':slug_title-:uid', to: 'seminars#show'
post 'con_login_proc', to: 'seminars#con_login_proc'
post 'reset_password_proc', to: 'seminars#reset_password_proc'
post 'reset_confirm_password_proc', to: 'seminars#reset_confirm_password_proc'
post 'con_logout_proc', to: 'seminars#con_logout_proc'
post 'add_file_proc', to: 'seminars#add_file_proc'
post 'edit_file_proc', to: 'seminars#edit_file_proc'
post 'del_file', to: 'seminars#del_file'
end
end
get "/xhr/seminars/check_email/:no" => "seminars#check_email"
end
end

View File

@ -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.exist?(f)
if !File.exists?f
f = File.join(Rails.root, 'app', 'templates', "#{@key}", 'modules', 'custom_announcement', "index.html.erb")
if !File.exist?(f)
if !File.exists?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
@ -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.exist?(f)
if File.exists?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.exist?(f)
if File.exists?f
info = File.read(f)
hash = JSON.parse(info) rescue {}
frontends = hash["frontend"] || []

View File

@ -2,7 +2,6 @@ require "yaml"
module CustomAnnouncement
class Engine < ::Rails::Engine
initializer "custom_announcement" do
Rails.application.config.to_prepare do
begin
translate_data = Dir["#{CustomAnnouncement::Engine.root}/config/locales/*.yml"] .map{|yaml_file| YAML.load(File.read(yaml_file))}
data = {}
@ -152,5 +151,4 @@ module CustomAnnouncement
# s[:custom_bulletins].indexes.create({expirable_created_at: 1},{ expireAfterSeconds: 180 })
end
end
end
end

View File

@ -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: values.file.as_json[:file],
custom_gallery_custom_album_id: values.custom_album_id,
order: values.order,
tags: values.tags}

View File

@ -242,7 +242,7 @@ class CustomGalleriesController < ApplicationController
title: values.title,
alt_title: alt_text,
url: values.file.url,
file: values.file.as_json,
file: values.file.as_json[:file],
custom_gallery_custom_album_id: values.custom_album_id,
tags: values.tags}
end

View File

@ -1,7 +1,6 @@
module CustomGallery
class Engine < ::Rails::Engine
initializer "custom_gallery" do
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 = {}
@ -22,7 +21,7 @@ module CustomGallery
puts ['error in custom_gallery',e]
end
require File.join(CustomGallery::Engine.root, 'app/models/custom_album_setting')
require File.expand_path('../../../app/models/custom_album_setting', __FILE__)
if defined?(CustomAlbumSetting)
if CustomAlbumSetting.first.nil?
CustomAlbumSetting.create()
@ -93,5 +92,4 @@ module CustomGallery
end
end
end
end
end

View File

@ -1,7 +1,6 @@
module Seminar
class Engine < ::Rails::Engine
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__)
@ -50,7 +49,7 @@ module Seminar
:active_for_action=>{'admin/seminars'=>'enquiry_for_applicants'},
:available_for => 'users'
end
end
end
end
end