diff --git a/app/assets/images/ok.gif b/app/assets/images/ok.gif
new file mode 100644
index 0000000..4154ffb
Binary files /dev/null and b/app/assets/images/ok.gif differ
diff --git a/app/assets/images/warning.gif b/app/assets/images/warning.gif
new file mode 100644
index 0000000..873bbb5
Binary files /dev/null and b/app/assets/images/warning.gif differ
diff --git a/app/assets/javascripts/admin/olympiamanagement.js b/app/assets/javascripts/admin/olympiamanagement.js
index 000f6ac..cf2cbbb 100644
--- a/app/assets/javascripts/admin/olympiamanagement.js
+++ b/app/assets/javascripts/admin/olympiamanagement.js
@@ -18,7 +18,26 @@ $(document).ready(function(){
window.location.search="";
});
});
+ $('.fieldset_block input[type="submit"]').click(function(){
+ $el = $('.fieldset_block li.required');
+ for(var i = 0; i< $el.length ; i++){
+ if($el.eq(i).siblings('.col_r').find('.required').val() == ""){
+ $el.eq(i).addClass('errFld');
+ if($el.eq(i).siblings('.col_r').find('.errMsg').length == 0)
+ $el.eq(i).siblings('.col_r').append('
+ <% @extra_class = ((field.values[0]["required"] == "true")? " required" : "")%>
+ <% @extra_text = ((field.values[0]["required"] == "true")? "*" : "")%>
+
<% if field.values[0][:type] != 'select' %>
- <%= t('olympiamanagement.'+field.keys[0]) %>" value="<%= @olympia_school_data_field[field.keys[0]] %>" size="<%=field.values[0][:size]%>" type="text" id="<%= field.keys[0] %>" class="col_input"/>
+
" value="<%= (field.keys[0]=="enrollment_limited"&&@olympia_school_data_field[field.keys[0]]== 0 ) ? "" : @olympia_school_data_field[field.keys[0]] %>" size="<%=field.values[0][:size]%>" type="text" id="<%= field.keys[0] %>" class="col_input<%= @extra_class%>"/>
<% else%>
<% @please_choice = (I18n.locale.to_s == "zh_tw") ? "請選擇" : "Please select." %>
-
<%= t('olympiamanagement.'+field.keys[0]) %>
-
+
<% end %>
+
<% if !field.values[0][:hint][I18n.locale.to_s].blank? %>
<%=field.values[0][:hint][I18n.locale.to_s]%>
<% end %>
diff --git a/app/views/admin/olympiamanagements/import_editing_number_of_school_class.html.erb b/app/views/admin/olympiamanagements/import_editing_number_of_school_class.html.erb
index e69de29..d54d701 100644
--- a/app/views/admin/olympiamanagements/import_editing_number_of_school_class.html.erb
+++ b/app/views/admin/olympiamanagements/import_editing_number_of_school_class.html.erb
@@ -0,0 +1,16 @@
+
+
※<%=t('olympiamanagement.import_hint_first')%>
+
※<%=t('olympiamanagement.import_hint_second')%>
+<%= form_tag admin_olympiamanagements_update_school_data_path(:type => "import_class_setting"), :multipart => true , :class=>"form-horizontal main-forms", :id=>"import_class_setting" do %>
+
<%=t('olympiamanagement.upload_file')%>
+ <%= file_field_tag :upload_file %>
+ <%= submit_tag t('olympiamanagement.submit') , :class=>"btn btn-default" %>
+<% end %>
+<% if params['error'] == "true" %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/admin/olympiamanagements/import_error_msg.html.erb b/app/views/admin/olympiamanagements/import_error_msg.html.erb
new file mode 100644
index 0000000..3837e03
--- /dev/null
+++ b/app/views/admin/olympiamanagements/import_error_msg.html.erb
@@ -0,0 +1,14 @@
+
+
<%= t('site.import_member_data.import_error')%>
+
+
+<% @error_msg.each do |a| %>
+
+- <%= a %>
+
+<% end %>
+
+
+
+
+<%= link_to t('back'), :back, :class => 'btn' %>
\ No newline at end of file
diff --git a/app/views/admin/olympiamanagements/school_data_list.html.erb b/app/views/admin/olympiamanagements/school_data_list.html.erb
index c11aa83..3ce8df2 100644
--- a/app/views/admin/olympiamanagements/school_data_list.html.erb
+++ b/app/views/admin/olympiamanagements/school_data_list.html.erb
@@ -33,7 +33,13 @@
<% else %>
"><%= t('olympiamanagement.edit') %>
+ "><%= t('olympiamanagement.sign_up_student_data') %>
"><%= t('olympiamanagement.delete') %>
+ <%if field.approved%>
+ "><%= t('olympiamanagement.unapproved') %>
+ <% else %>
+ "><%= t('olympiamanagement.approved') %>
+ <% end %>
|
<% end %>
<% end %>
@@ -41,4 +47,5 @@
<%end%>
-<%=create_pagination(params[:page].to_i,OlympiaSchoolDataFields).html_safe%>
\ No newline at end of file
+<% @extra_params = request.query_parameters.map{|key,value| key+'='+value}.join('&') %>
+<%=create_pagination(params[:page].to_i,@OlympiaSchoolDataFields,@extra_params).html_safe%>
\ No newline at end of file
diff --git a/app/views/admin/olympiamanagements/sign_up_setting.html.erb b/app/views/admin/olympiamanagements/sign_up_setting.html.erb
index e69de29..2db38bc 100644
--- a/app/views/admin/olympiamanagements/sign_up_setting.html.erb
+++ b/app/views/admin/olympiamanagements/sign_up_setting.html.erb
@@ -0,0 +1,92 @@
+
+
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 4494854..dd76b6e 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -18,7 +18,10 @@ en:
cancel: Cancel
action: Action
edit: Edit
+ sign_up_student_data: Sign up student data
delete: Delete
+ approved: Recover
+ unapproved: Suspended
search: Search
school_name: School name
school_code: School code
@@ -35,4 +38,22 @@ en:
school_contact_person_name: School contact person's name
prev_page: Previous page
next_page: Next page
-
\ No newline at end of file
+ download_import_file: Download import file
+ upload_file: Upload file
+ import_hint_first: Please download import file first,and import after editing number of school class.
+ import_hint_second: Please don't change school code in the import Excel file , or it will cause the error when import data.
+ delete_all_sign_up_data: Delete all sign up data
+ sign_up_start_time: Start time of sign up
+ sign_up_end_time: End time of sign up
+ default_password: Default password
+ sign_up_setting_hint: Update all accounts to default password.
+ last_edit_time: Last edit time
+ a_d_: A.D.
+ year: Year
+ month: Month
+ day: Day
+ o_clock: o'clock
+ minute: Min.
+ remark: Remarks
+ registration_instructions: Online registration instructions
+ print_registration_form: Print registration form
\ No newline at end of file
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index 3d9e94c..086dd8a 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -18,7 +18,10 @@ zh_tw:
cancel: 取消
action: 動作
edit: 編輯
+ sign_up_student_data: 學生報名資料
delete: 刪除
+ approved: 恢復
+ unapproved: 停用
search: 搜尋
school_name: 學校名稱
school_code: 學校代碼
@@ -34,4 +37,23 @@ zh_tw:
department_job_title: 單位職稱
school_contact_person_name: 學校聯絡人姓名
prev_page: 上一頁
- next_page: 下一頁
\ No newline at end of file
+ next_page: 下一頁
+ download_import_file: 下載匯入檔案
+ upload_file: 上傳檔案
+ import_hint_first: 請先下載匯入檔案,修改班級數之後再匯入。
+ import_hint_second: 請勿變更Excel檔案中的學校代碼,這會造成資料匯入異常。
+ delete_all_sign_up_data: 刪除所有報名者的資料
+ sign_up_start_time: 報名開始時間
+ sign_up_end_time: 報名結束時間
+ default_password: 預設密碼
+ sign_up_setting_hint: 更新全部帳號為預設密碼。
+ last_edit_time: 上次修改時間
+ a_d_: 西元
+ year: 年
+ month: 月
+ day: 日
+ o_clock: 時
+ minute: 分
+ remark: 注意事項
+ registration_instructions: 線上報名說明
+ print_registration_form: 列印報名表
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 1b0fd2a..0f28d04 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -16,6 +16,10 @@ Rails.application.routes.draw do
post 'olympiamanagements/update_school_data' , to: 'olympiamanagements#update_school_data'
patch 'olympiamanagements/update_school_data' , to: 'olympiamanagements#update_school_data'
get 'olympiamanagements/update_school_data' , to: 'olympiamanagements#update_school_data'
+ post 'olympiamanagements/update_sign_up_data' , to: 'olympiamanagements#update_sign_up_data'
+ patch 'olympiamanagements/update_sign_up_data' , to: 'olympiamanagements#update_sign_up_data'
+ get 'olympiamanagements/update_sign_up_data' , to: 'olympiamanagements#update_sign_up_data'
+ get 'olympiamanagements/download_import_file' , to: 'olympiamanagements#download_import_file'
resources :olympiamanagements
end
end