add frontend pages

This commit is contained in:
BOHUNG 2020-01-31 21:46:35 +08:00
parent e4139e72ad
commit f2c38fe8c8
15 changed files with 190 additions and 0 deletions

View File

@ -0,0 +1,43 @@
$(document).ready(function(){
$('.class_setting_block input[type="reset"]').off('click').on('click',function(){
$('.col_input').val('');
});
$('.class_setting_block input[type="submit"]').off('click').on('click',function(){
var class_number_range = [];
class_number_range.push(Number($('.class_setting_block .col_input[name="MinClass"]').val()));
class_number_range.push(Number($('.class_setting_block .col_input[name="MaxClass"]').val()));
var enrollment_available = $('.class_setting_block .col_input#Person').val();
class_number_range.sort();
var params_array = (window.location.search.substring(1)=="") ? [] : window.location.search.substring(1).split('&').map(function(el){return el.split('=')});
var params = {};
params_array.forEach(function(el){params[el[0]] = el[1]});
var params_to_send = {'type':'class_setting','class_number_range':class_number_range,'enrollment_available':enrollment_available};
params_to_send = Object.assign(params,params_to_send);
var post_data = $.post('/admin/olympiamanagements/update_school_data',params_to_send);
post_data.done(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('<div id="SchoolName-E" class="errMsg"> '+((I18n.locale == "en") ? 'Required field': '必填欄位')+'</div>');
}else{
$el.eq(i).removeClass('errFld');
$el.eq(i).siblings('.col_r').find('.errMsg').remove();
};
};
if($('.fieldset_block .required.errFld').length != 0)
return false;
else
return true;
})
var $el = $('.fieldset_block select');
for(var i = 0 ; i < $el.length ; i++)
if($el.eq(i).attr('value') != "" && $el.eq(i).attr('value') != undefined)
$el.eq(i).find('option[value='+$el.eq(i).attr('value')+']').attr('selected','selected');
CKEDITOR.replaceAll();
});

View File

@ -1,6 +1,40 @@
class OlympiamanagementsController < ApplicationController
def initialize
super
@app_title = "olympiamanagement"
end
def index
uid = OrbitHelper.params[:uid] rescue ""
tags = OrbitHelper.widget_tags
categories = OrbitHelper.widget_categories || []
@sign_up_setting = SignUpSetting.last
@olympiamanagement_instruction = @sign_up_setting.registration_instructions[I18n.locale.to_s].to_s
@sign_up_setting.attributes.to_h.each do |key,value|
@olympiamanagement_instruction = @olympiamanagement_instruction.gsub("{{#{key}}}",value.to_s)
end
{
"olympiamanagement" => [],
"extras"=>{"instructions"=> @olympiamanagement_instruction}
}
end
def widget
uid = OrbitHelper.params[:uid] rescue ""
tags = OrbitHelper.widget_tags
categories = OrbitHelper.widget_categories || []
@sign_up_setting = SignUpSetting.last
@olympiamanagement_instruction = @sign_up_setting.registration_instructions[I18n.locale.to_s].to_s
@sign_up_setting.attributes.to_h.each do |key,value|
@olympiamanagement_instruction = @olympiamanagement_instruction.gsub("{{#{key}}}",value.to_s)
end
{
"olympiamanagement" => [],
"extras"=>{"instructions"=> @olympiamanagement_instruction}
}
end
def updata_school_data
#render :html => '123'
end
def updata_student_data
#render :html => '123'
end
end

View File

@ -0,0 +1,7 @@
<script type="text/javascript" src="/assets/jquery.smartmenus.min.js"></script>
<script type="text/javascript" src="/assets/jquery.smartmenus.bootstrap.min.js"></script>
<script type="text/javascript" src="/assets/cancer_predict.js"></script>
{{table}}
<link href="/assets/cancer_predict.scss" media="screen" rel="stylesheet">
<link href="/assets/bootstrap.min.print.css" media="print" rel="stylesheet">
<link href="/assets/cancer_predict_print.scss" media="print" rel="stylesheet">

View File

@ -0,0 +1,30 @@
{
"frontend": [
{
"filename" : "olympia_managements_index",
"name" : {
"zh_tw" : "1. 初選線上報名",
"en" : "1. Primary online registration"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "olympia_managements_instructions_index",
"name" : {
"zh_tw" : "2. 線上報名說明",
"en" : "1. Online registration instructions "
},
"thumbnail" : "thumb.png"
}
],
"widgets" : [
{
"filename" : "olympia_managements_widget",
"name" : {
"zh_tw" : "1. 初選線上報名",
"en" : "1. Primary online registration"
},
"thumbnail" : "thumb.png"
}
]
}

View File

@ -0,0 +1,7 @@
<script type="text/javascript" src="/assets/jquery.smartmenus.min.js"></script>
<script type="text/javascript" src="/assets/jquery.smartmenus.bootstrap.min.js"></script>
<script type="text/javascript" src="/assets/cancer_predict.js"></script>
{{table}}
<link href="/assets/cancer_predict.scss" media="screen" rel="stylesheet">
<link href="/assets/bootstrap.min.print.css" media="print" rel="stylesheet">
<link href="/assets/cancer_predict_print.scss" media="print" rel="stylesheet">

View File

@ -0,0 +1,7 @@
<script type="text/javascript" src="/assets/jquery.smartmenus.min.js"></script>
<script type="text/javascript" src="/assets/jquery.smartmenus.bootstrap.min.js"></script>
<script type="text/javascript" src="/assets/cancer_predict.js"></script>
{{table}}
<link href="/assets/cancer_predict.scss" media="screen" rel="stylesheet">
<link href="/assets/bootstrap.min.print.css" media="print" rel="stylesheet">
<link href="/assets/cancer_predict_print.scss" media="print" rel="stylesheet">

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1 @@
loading...

View File

@ -0,0 +1 @@
loading...

View File

@ -0,0 +1,5 @@
<script type="text/javascript" src="/assets/olympiamanagement.js"></script>
{{instructions}}
<link href="/assets/olympiamanagement.scss" media="screen" rel="stylesheet">
<link href="/assets/bootstrap.min.print.css" media="print" rel="stylesheet">
<link href="/assets/olympiamanagement.scss" media="print" rel="stylesheet">

View File

@ -0,0 +1,7 @@
<script type="text/javascript" src="/assets/jquery.smartmenus.min.js"></script>
<script type="text/javascript" src="/assets/jquery.smartmenus.bootstrap.min.js"></script>
<script type="text/javascript" src="/assets/cancer_predict.js"></script>
{{table}}
<link href="/assets/cancer_predict.scss" media="screen" rel="stylesheet">
<link href="/assets/bootstrap.min.print.css" media="print" rel="stylesheet">
<link href="/assets/cancer_predict_print.scss" media="print" rel="stylesheet">

View File

@ -0,0 +1,38 @@
{
"frontend": [
{
"filename" : "olympia_managements_index",
"name" : {
"zh_tw" : "1. 初選線上報名",
"en" : "1. Primary online registration"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "olympia_managements_instructions_index",
"name" : {
"zh_tw" : "2. 線上報名說明",
"en" : "2. Online registration instructions"
},
"thumbnail" : "thumb.png"
}
],
"widgets" : [
{
"filename" : "olympia_managements_widget",
"name" : {
"zh_tw" : "1. 初選線上報名",
"en" : "1. Primary online registration"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "olympia_managements_instructions_widget",
"name" : {
"zh_tw" : "2. 線上報名說明",
"en" : "2. Online registration instructions"
},
"thumbnail" : "thumb.png"
}
]
}

View File

@ -0,0 +1,5 @@
<script type="text/javascript" src="/assets/olympiamanagement.js"></script>
{{instructions}}
<link href="/assets/olympiamanagement.scss" media="screen" rel="stylesheet">
<link href="/assets/bootstrap.min.print.css" media="print" rel="stylesheet">
<link href="/assets/olympiamanagement.scss" media="print" rel="stylesheet">

View File

@ -0,0 +1,5 @@
<script type="text/javascript" src="/assets/olympiamanagement.js"></script>
{{instructions}}
<link href="/assets/olympiamanagement.scss" media="screen" rel="stylesheet">
<link href="/assets/bootstrap.min.print.css" media="print" rel="stylesheet">
<link href="/assets/olympiamanagement.scss" media="print" rel="stylesheet">

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB