Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
Conflicts: db/schema.rbdev_shcool
commit
e74a2ba275
@ -1,2 +1,72 @@
|
||||
# encoding: utf-8
|
||||
module SyllabusesHelper
|
||||
def get_syllabuses_by_tag(tag_name)
|
||||
Syllabus.tagged_with(tag_name).order('updated_at desc')
|
||||
end
|
||||
|
||||
def teacher_count syllabus
|
||||
count = 0
|
||||
courses = syllabus.courses
|
||||
unless courses.empty?
|
||||
courses.each do |c|
|
||||
count += TeacherAndAssistantCount c
|
||||
end
|
||||
end
|
||||
count
|
||||
end
|
||||
|
||||
def student_count syllabus
|
||||
count = 0
|
||||
courses = syllabus.courses
|
||||
unless courses.empty?
|
||||
courses.each do |c|
|
||||
count += studentCount c
|
||||
end
|
||||
end
|
||||
count
|
||||
end
|
||||
|
||||
def file_count syllabus
|
||||
count = 0
|
||||
courses = syllabus.courses
|
||||
unless courses.empty?
|
||||
courses.each do |c|
|
||||
count += visable_attachemnts_incourse(c).count
|
||||
end
|
||||
end
|
||||
count
|
||||
end
|
||||
|
||||
#课程性质下拉框
|
||||
def syllabus_type
|
||||
type = []
|
||||
option1 = []
|
||||
option2 = []
|
||||
option3 = []
|
||||
option4 = []
|
||||
option5 = []
|
||||
option6 = []
|
||||
|
||||
option1 << "请选择"
|
||||
option1 << 1
|
||||
option2 << "公共必修课"
|
||||
option2 << 2
|
||||
option3 << "学科必修课"
|
||||
option3 << 3
|
||||
option4 << "专业选修课"
|
||||
option4 << 4
|
||||
option5 << "实践必修课"
|
||||
option5 << 5
|
||||
option6 << "实践选修课"
|
||||
option6 << 6
|
||||
|
||||
type << option1
|
||||
type << option2
|
||||
type << option3
|
||||
type << option4
|
||||
type << option5
|
||||
type << option6
|
||||
|
||||
type
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,3 @@
|
||||
class ApplyAddSchools < ActiveRecord::Base
|
||||
attr_accessible :address, :city, :name, :province, :remarks, :school_id, :status
|
||||
end
|
@ -1,5 +1,46 @@
|
||||
# encoding: utf-8
|
||||
class Syllabus < ActiveRecord::Base
|
||||
include Redmine::SafeAttributes
|
||||
include ApplicationHelper
|
||||
acts_as_taggable
|
||||
acts_as_attachable
|
||||
has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||
|
||||
belongs_to :user
|
||||
has_many :courses
|
||||
attr_accessible :description, :title
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
attr_accessible :description, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
|
||||
safe_attributes 'title', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course'
|
||||
|
||||
def delete_kindeditor_assets
|
||||
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::SYLLABUS
|
||||
end
|
||||
|
||||
def syllabus_type_str
|
||||
case self.syllabus_type
|
||||
when 1
|
||||
type = "公共必修课"
|
||||
when 2
|
||||
type = "学科必修课"
|
||||
when 3
|
||||
type = "专业选修课"
|
||||
when 4
|
||||
type = "实践必修课"
|
||||
when 5
|
||||
type = "实践选修课"
|
||||
end
|
||||
type
|
||||
end
|
||||
|
||||
###添加回复
|
||||
def self.add_syllabus_jour(user, notes, id , options = {})
|
||||
syllabus = Syllabus.find(id)
|
||||
if options.count == 0
|
||||
jfm = syllabus.journals_for_messages.build(:user_id => user.id, :notes => notes, :reply_id => 0)
|
||||
else
|
||||
jfm = syllabus.journals_for_messages.build(options)
|
||||
end
|
||||
jfm.save
|
||||
jfm
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,52 @@
|
||||
<div class="new_content">
|
||||
<div class="email_verify">
|
||||
<p class="email_verify_prompt"><span class="icons_email_prompt"></span>您的账号尚未激活,请先进入您的注册邮箱,激活您的账号。</p>
|
||||
<button class="email_verify_btn mt30 ml30" onclick = "resendMail('<%= resendmail_path(@user) %>','<%= @user.id %>');">重新发送激活邮件</button>
|
||||
<%#= link_to l(:label_mail_resend), { :controller => 'account', :action => 'resendmail',:user => @user}, :class=>"email_verify_btn mt30 ml30", :remote => true, :method => 'get' %>
|
||||
<ul class="email_prompt_txt ml30 mt30">
|
||||
<p class="email_prompt_p">如果您尚未收到激活邮件,请按照以下步骤操作:</p>
|
||||
<li>检查邮箱的“订阅邮件”、“垃圾邮件”,可能会发现激活邮件。 </li>
|
||||
<li>如果激活邮件已无效,请点击重新发送激活邮件按钮。</li>
|
||||
<li>如果您无法收到激活邮件,请您直接给我们管理员留言:</li>
|
||||
<div class=" mt10">
|
||||
<textarea style="resize: none;" class="email_prompt_mes" placeholder="请管理员尽快帮我解决邮箱激活问题"></textarea>
|
||||
<button class="email_sub_btn fr" onclick="leave_email_activation_message('<%= leave_email_activation_message_path(1)%>','<%= @user.id %>');">确定</button>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function resendMail(url,id)
|
||||
{
|
||||
$.get(
|
||||
url,
|
||||
{user: id },
|
||||
function (data) {
|
||||
console.log("1111111111");
|
||||
console.log(data);
|
||||
$(".email_verify_btn").replaceWith("<p class='email_verify_p mt30 ml30'>激活邮件已发送至您的注册邮箱,请及时登录邮箱进行验证。</p>");
|
||||
}
|
||||
);
|
||||
}
|
||||
function leave_email_activation_message(url,user)
|
||||
{
|
||||
if ($(".email_prompt_mes").val().length == 0){
|
||||
//弹框请他输入文字
|
||||
var htmlvalue = "</br><div style='width:550px;text-align:center'>您的留言不能为空</div></br><div style='width:67px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn' onclick='hideModal()'>确定</a></div>";
|
||||
pop_up_box(htmlvalue,580,30,50);
|
||||
return;
|
||||
}
|
||||
$.get(
|
||||
url,
|
||||
{user:user,text:$(".email_prompt_mes").val() },
|
||||
function (data) {
|
||||
console.log("2222222");
|
||||
console.log(data);
|
||||
var htmlvalue = "<div class='email_tancon'><h2 class='email_tan_title'>您的留言已发送</h2><p class='email_tan_p'>我们将尽快处理好,并通过邮件通知您。感谢您的反馈!</p></div>"
|
||||
pop_up_box(htmlvalue,580,30,50);
|
||||
$(".email_prompt_mes").val("");
|
||||
}
|
||||
);
|
||||
}
|
||||
</script>
|
@ -1,127 +0,0 @@
|
||||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- end -->
|
||||
|
||||
<h3><%= l(:label_register) %> <%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h3>
|
||||
|
||||
<%= labelled_form_for @user, :url => register_path do |f| %>
|
||||
<%= error_messages_for 'user' %>
|
||||
<div class="box tabular">
|
||||
|
||||
<% if @user.auth_source_id.nil? %>
|
||||
<p><%= f.text_field :login, :size => 25, :required => true %><span id="valid_user_login"></span>
|
||||
<em class="info" style="color: #acaeb1"><%= l(:label_max_number) %></em>
|
||||
</p>
|
||||
<p><%= f.password_field :password, :size => 25, :required => true %><span id="valid_user_password"></span>
|
||||
<em class="info" style="color: #acaeb1"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em>
|
||||
</p>
|
||||
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %><span id="valid_password" style="padding-left: 10px;"></span></p>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
<%= f.text_field :mail,:size => 25, :required => true %>
|
||||
<span id="valid_user_mail" ></span>
|
||||
</p>
|
||||
<p>
|
||||
<em class="info" style="color: #acaeb1">
|
||||
<p><%= "#{l(:label_mail_attention)} " %></p>
|
||||
<p><%= "#{l(:label_mail_attention1)} " %></p>
|
||||
</em>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<!-- end -->
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<table>
|
||||
<tr>
|
||||
<td><%= submit_tag l(:button_submit) %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
<% end %>
|
||||
<% if Setting.openid? %>
|
||||
<p><%= f.text_field :identity_url %></p>
|
||||
<% end %>
|
||||
<% @user.custom_field_values.select { |v| v.editable? || v.required? }.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :user, value %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% password_min_length = Setting.password_min_length %>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
var $login = $('#user_login')
|
||||
var $mail = $('#user_mail')
|
||||
var $password = $('#user_password')
|
||||
var $password_confirmation = $('#user_password_confirmation')
|
||||
$login.blur(function (event) {
|
||||
if ($(this).is('#user_login')) {
|
||||
$.get(
|
||||
'<%=account_valid_ajax_path%>',
|
||||
{ valid: "login",
|
||||
value: this.value },
|
||||
function (data) {
|
||||
if (data.valid) {
|
||||
$('#valid_user_login').html('<span class="green">' + data.message + "</span>");
|
||||
} else {
|
||||
$('#valid_user_login').html('<span class="red">' + data.message + "</span>");
|
||||
}
|
||||
});
|
||||
}
|
||||
;
|
||||
});
|
||||
|
||||
$mail.blur(function (event) {
|
||||
if ($(this).is('#user_mail')) {
|
||||
$.get('<%=account_valid_ajax_path%>',
|
||||
{ valid: "mail",
|
||||
value: this.value },
|
||||
function (data) {
|
||||
if (data.valid) {
|
||||
$('#valid_user_mail').html('<span class="green">' + data.message + "</span>");
|
||||
} else {
|
||||
$('#valid_user_mail').html('<span class="red">' + data.message + "</span>");
|
||||
}
|
||||
});
|
||||
}
|
||||
;
|
||||
});
|
||||
$password.blur(function () {
|
||||
var pas1 = document.getElementById("user_password").value;
|
||||
var password_min_length = <%= password_min_length %>
|
||||
if (pas1.length >= password_min_length) {
|
||||
|
||||
$('#valid_user_password').html('<span class="green">'+ "</span>");
|
||||
}
|
||||
else {
|
||||
$('#valid_user_password').html('<span class="red">' + "<%= l(:setting_password_min_length_limit, :count => password_min_length) %>" + "</span>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
$password_confirmation.blur(function () {
|
||||
var password_min_length = <%= password_min_length %>
|
||||
var pas1 = document.getElementById("user_password").value;
|
||||
var pas2 = document.getElementById("user_password_confirmation").value;
|
||||
if (pas1.length >= password_min_length && pas1 == pas2 ) {
|
||||
$('#valid_password').html('<span class="green">' + "<%= l(:setting_password_success) %>"+ "</span>");
|
||||
}
|
||||
else {
|
||||
$('#valid_password').html('<span class="red">' + "<%= l(:setting_password_error) %>" + "</span>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
@ -0,0 +1,58 @@
|
||||
<ul class="syllabus_leftinfo" id="all_syllabus_attr">
|
||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?) %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :class => 'fr', :onclick => "show_edit_base_info();"%>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<li><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 %>
|
||||
<li><label>课程性质:</label><%=syllabus.syllabus_type_str %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.credit.nil? || syllabus.credit == '' %>
|
||||
<li><label>学分:</label><%=syllabus.credit %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.hours.nil? || syllabus.hours == '' %>
|
||||
<li><label>总学时:</label><%=syllabus.hours %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.theory_hours.nil? || syllabus.theory_hours == '' %>
|
||||
<li><label>理论学时:</label><%=syllabus.theory_hours %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.practice_hours.nil? || syllabus.practice_hours == '' %>
|
||||
<li><label>实践学时:</label><%=syllabus.practice_hours %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.applicable_major.nil? || syllabus.applicable_major == '' %>
|
||||
<li><label>适用专业:</label><%=syllabus.applicable_major %></li>
|
||||
<% end %>
|
||||
<% unless syllabus.pre_course.nil? || syllabus.pre_course == '' %>
|
||||
<li><label>先修课程:</label><%=syllabus.pre_course %></li>
|
||||
<% end %>
|
||||
|
||||
<% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == '' %>
|
||||
<li class="none none_attr"><label>课程性质:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.credit.nil? || syllabus.credit == '' %>
|
||||
<li class="none none_attr"><label>学分:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.hours.nil? || syllabus.hours == '' %>
|
||||
<li class="none none_attr"><label>总学时:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.theory_hours.nil? || syllabus.theory_hours == '' %>
|
||||
<li class="none none_attr"><label>理论学时:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.practice_hours.nil? || syllabus.practice_hours == '' %>
|
||||
<li class="none none_attr"><label>实践学时:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.applicable_major.nil? || syllabus.applicable_major == '' %>
|
||||
<li class="none none_attr"><label>适用专业:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
<% if syllabus.pre_course.nil? || syllabus.pre_course == '' %>
|
||||
<li class="none none_attr"><label>先修课程:</label><span class="fontGrey3">空</span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?) %>
|
||||
<span class="homepageLeftMenuMore"><a href="javascript:void(0);" data-init="0" onclick="toggle_all_syllabus_attr();" class="homepageLeftMenuMoreIcon" id="show_all_syllabus_attr"></a></span>
|
||||
<% end %>
|
||||
<script>
|
||||
function show_edit_base_info() {
|
||||
$("#syllabus_base_info").html("<%=escape_javascript(render :partial => 'layouts/syllabus_edit_info', :locals => {:syllabus => @syllabus}) %>");
|
||||
}
|
||||
</script>
|
@ -0,0 +1,27 @@
|
||||
<ul class="syllabus_leftinfo" id="all_syllabus_attr">
|
||||
<%= form_for('syllabus',:url => update_base_info_syllabus_path(syllabus.id),:remote => true) do |f|%>
|
||||
<a href="javascript:void(0);" onclick="update_syllabus_info();" id="submit_edit_info" class="fr">保存</a>
|
||||
<!--<a href="javascript:void(0);" onclick="reset_syllabus_info();" id="submit_reset_info" class="fr mr10">取消</a>-->
|
||||
<div class="cl"></div>
|
||||
<li><label >创建教师:</label><span><%=syllabus.user.show_name %></span></li>
|
||||
<li><label>课程性质:</label>
|
||||
<%= select_tag :syllabus_type,options_for_select(syllabus_type,syllabus.syllabus_type), {:id=>"syllabus_type_input", :class=>"syllabus_select"} %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li><label >学分:</label>
|
||||
<input id="syllabus_credit_input" class="syllabus_input_min fl" name="credit" placeholder="5" value="<%=syllabus.credit %>"> 学分
|
||||
<span class="none c_red ml5" id="syllabus_credit_notice">请输入正整数</span><div class="cl"></div>
|
||||
</li>
|
||||
<li><label>总学时:</label><input id="syllabus_hours_input" class="syllabus_input_min fl" name="hours" placeholder="50" value="<%=syllabus.hours %>"> 学时
|
||||
<span class="none c_red ml5" id="syllabus_hours_notice">请输入正整数</span><div class="cl"></div>
|
||||
</li>
|
||||
<li><label>理论学时:</label><input id="syllabus_theory_hours_input" class="syllabus_input_min fl" name="theory_hours" placeholder="10" value="<%=syllabus.theory_hours %>"> 学时
|
||||
<span class="none c_red ml5" id="syllabus_theory_hours_notice">请输入正整数</span><div class="cl"></div>
|
||||
</li>
|
||||
<li><label>实践学时:</label><input id="syllabus_practice_hours_input" class="syllabus_input_min fl" name="practice_hours" placeholder="5" value="<%=syllabus.practice_hours %>"> 学时
|
||||
<span class="none c_red ml5" id="syllabus_practice_hours_notice">请输入正整数</span><div class="cl"></div>
|
||||
</li>
|
||||
<li><label>适用专业:</label><input id="syllabus_applicable_major_input" class="syllabus_input fl" name="applicable_major" placeholder="UI设计" value="<%=syllabus.applicable_major %>"><div class="cl"></div></li>
|
||||
<li><label>选修课程:</label><input id="syllabus_pre_course_input" class="syllabus_input fl" name="pre_course" placeholder="工业设计史" value="<%=syllabus.pre_course %>"><div class="cl"></div></li>
|
||||
<% end %>
|
||||
</ul>
|
@ -0,0 +1,8 @@
|
||||
<% if syllabus.eng_name && !syllabus.eng_name.empty? %>
|
||||
<span><%= syllabus.eng_name %></span>
|
||||
<% else%>
|
||||
<span class="fontGrey">课程英文名称</span>
|
||||
<% end %>
|
||||
<% if User.current == syllabus.user %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_eng_name();"%>
|
||||
<% end %>
|
@ -1,2 +1,6 @@
|
||||
<p><%= l(:mail_body_register) %><br />
|
||||
<%= link_to h(@url), @url %></p>
|
||||
<p>如果点击链接无效请复制该链接到浏览器中打开</p>
|
||||
<br>
|
||||
<p>感谢您的使用!</p>
|
||||
<p>Trustie团队</p><p></p>
|
||||
|
@ -0,0 +1,337 @@
|
||||
<h2 class="winbox_h2">添加新的高校(单位)</h2>
|
||||
<div class="cl"></div>
|
||||
<ul class="winbox_edit_new">
|
||||
<li>
|
||||
<label class="fl"><span class="c_red mr5">*</span>名称:</label>
|
||||
<input id = "schoolname" type="text" class="winbox_input fl" onBlur = 'ifNameRepeat()' onFocus = '$("#schoolrepeatnotice").text("");$("#schoolrepeatnotice").attr("value",1);$("#schoolrepeatnotice").hide(); '/>
|
||||
<span class="ml2" id="schoolrepeatnotice" style="color:red;" display="none"></span>
|
||||
</li>
|
||||
<li>
|
||||
<label class="fl"> </label>
|
||||
<span class="fl">例如:</span><span class="icons_right fl mt5 "></span><span class="fl">国防科学技术大学</span>
|
||||
<span class="icons_error fl mt5 ml10"></span><span class="fl">国防科大计算机1班</span>
|
||||
</li>
|
||||
<li>
|
||||
<label class="fl"><span class="c_red mr5">*</span>地区:</label>
|
||||
<select onchange="showcity(this.value, document.getElementById('schoolCity'));" name="province" id="schollProvince" class="winbox_select fl" style="height:28px;margin-left:2px;">
|
||||
<option value="">--请选择省份--</option>
|
||||
<option value="北京">北京</option>
|
||||
<option value="上海">上海</option>
|
||||
<option value="广东">广东</option>
|
||||
<option value="江苏">江苏</option>
|
||||
<option value="浙江">浙江</option>
|
||||
<option value="重庆">重庆</option>
|
||||
<option value="安徽">安徽</option>
|
||||
<option value="福建">福建</option>
|
||||
<option value="甘肃">甘肃</option>
|
||||
<option value="广西">广西</option>
|
||||
<option value="贵州">贵州</option>
|
||||
<option value="海南">海南</option>
|
||||
<option value="河北">河北</option>
|
||||
<option value="黑龙江">黑龙江</option>
|
||||
<option value="河南">河南</option>
|
||||
<option value="湖北">湖北</option>
|
||||
<option value="湖南">湖南</option>
|
||||
<option value="江西">江西</option>
|
||||
<option value="吉林">吉林</option>
|
||||
<option value="辽宁">辽宁</option>
|
||||
<option value="内蒙古">内蒙古</option>
|
||||
<option value="宁夏">宁夏</option>
|
||||
<option value="青海">青海</option>
|
||||
<option value="山东">山东</option>
|
||||
<option value="山西">山西</option>
|
||||
<option value="陕西">陕西</option>
|
||||
<option value="四川">四川</option>
|
||||
<option value="天津">天津</option>
|
||||
<option value="新疆">新疆</option>
|
||||
<option value="西藏">西藏</option>
|
||||
<option value="云南">云南</option>
|
||||
<option value="香港">香港特别行政区</option>
|
||||
<option value="澳门">澳门特别行政区</option>
|
||||
<option value="台湾">台湾</option>
|
||||
<option value="海外">海外</option>
|
||||
</select>
|
||||
<select name="city" id="schoolCity" class="winbox_select fl ml5" style="height:28px;"></select>
|
||||
<span class="ml2" id="provincenotice" style="color:red;" display="none"></span>
|
||||
</li>
|
||||
<li>
|
||||
<label class="fl"><span class="c_red mr5">*</span>详细地址:</label><input id="address" type="text" class="winbox_input fl" />
|
||||
<span class="ml2" id="addressnotice" style="color:red;" display="none"></span>
|
||||
</li>
|
||||
<li><label class="fl">说明:</label><textarea id = "remarks" class="winbox_textarea fl" placeholder="如果您有特别需要说明的内容请填入"></textarea></li>
|
||||
<div class="cl"></div>
|
||||
<li><label class="fl"> </label><button class="fl winbox_btn_blue mt10" onclick = "commit_add_school();">确定</button></li>
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
function commit_add_school(){
|
||||
var name,province,city,address,remarks;
|
||||
|
||||
name = $("#schoolname").val();
|
||||
province = $("#schollProvince").val();
|
||||
address = $("#address").val();
|
||||
|
||||
if(name == ""){
|
||||
$("#schoolname").focus();
|
||||
return;
|
||||
}
|
||||
if($("#schoolrepeatnotice").attr("value") == "1"){
|
||||
return;
|
||||
}
|
||||
if(province == ""){
|
||||
$("#provincenotice").text("请选择");
|
||||
$("#provincenotice").show();
|
||||
return;
|
||||
}
|
||||
city = $("#schoolCity").val();
|
||||
if(city == ""){
|
||||
return;
|
||||
}
|
||||
|
||||
if(address == ""){
|
||||
$("#address").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
remarks = $("#remarks").val();
|
||||
|
||||
$.ajax({
|
||||
url: '/school/apply_add_school',
|
||||
type: 'get',
|
||||
data: {name:name,province:province,city:city,address:address,remarks:remarks},
|
||||
success: function(data){
|
||||
if(data.result == 0){
|
||||
$("input[name='province']").val(data.name);
|
||||
$("input[name='occupation']").val(data.school_id);
|
||||
|
||||
var htmlvalue = "</br><div style='width:550px;text-align:center'>添加成功!您可以继续使用了。</div></br><div style='width:550px;text-align:center'>后续我们将对您的高校(单位)进行审核,如有问题我们再联系您。</div></br><div style='width:67px; margin:0 auto; text-align:center'></div>";
|
||||
pop_up_box(htmlvalue,500,30,50);
|
||||
}
|
||||
else if (data.result == 1){
|
||||
}
|
||||
else if (data.result == 2){
|
||||
$("#schoolrepeatnotice").text("名称已存在");
|
||||
$("#schoolrepeatnotice").show();
|
||||
$("#schoolrepeatnotice").attr("value",1);
|
||||
$("#schoolrepeatnotice").attr("style","color:red");
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showcity(province, cityField) {
|
||||
$("#provincenotice").hide();
|
||||
switch (province) {
|
||||
case "北京" :
|
||||
var cityOptions = new Array(
|
||||
"东城", "西城", "朝阳", "丰台", "石景山", "海淀", "门头沟",
|
||||
"房山", "通州", "顺义", "昌平", "大兴", "平谷", "怀柔", "密云", "延庆");
|
||||
break;
|
||||
case "上海" :
|
||||
var cityOptions = new Array(
|
||||
"崇明", "黄浦", "卢湾", "徐汇", "长宁", "静安", "普陀", "闸北", "虹口", "杨浦", "闵行",
|
||||
"宝山", "嘉定", "浦东", "金山", "松江", "青浦", "南汇", "奉贤");
|
||||
break;
|
||||
case "广东" :
|
||||
var cityOptions = new Array(
|
||||
"广州", "深圳", "珠海", "东莞", "中山", "佛山", "惠州", "河源", "潮州", "江门", "揭阳", "茂名",
|
||||
"梅州", "清远", "汕头", "汕尾", "韶关", "顺德", "阳江", "云浮", "湛江", "肇庆");
|
||||
break;
|
||||
case "江苏" :
|
||||
var cityOptions = new Array(
|
||||
"南京", "常熟", "常州", "海门", "淮安", "江都", "江阴", "昆山", "连云港", "南通",
|
||||
"启东", "沭阳", "宿迁", "苏州", "太仓", "泰州", "同里", "无锡", "徐州", "盐城",
|
||||
"扬州", "宜兴", "仪征", "张家港", "镇江", "周庄");
|
||||
break;
|
||||
case "重庆" :
|
||||
var cityOptions = new Array(
|
||||
"万州", "涪陵", "渝中", "大渡口", "江北", "沙坪坝", "九龙坡", "南岸", "北碚", "万盛",
|
||||
"双挢", "渝北", "巴南", "黔江", "长寿", "綦江", "潼南", "铜梁", "大足", "荣昌", "壁山",
|
||||
"梁平", "城口", "丰都", "垫江", "武隆", "忠县", "开县", "云阳", "奉节", "巫山", "巫溪",
|
||||
"石柱", "秀山", "酉阳", "彭水", "江津", "合川", "永川", "南川");
|
||||
break;
|
||||
case "安徽" :
|
||||
var cityOptions = new Array(
|
||||
"合肥", "安庆", "蚌埠", "亳州", "巢湖", "滁州", "阜阳", "贵池", "淮北", "淮化", "淮南",
|
||||
"黄山", "九华山", "六安", "马鞍山", "宿州", "铜陵", "屯溪", "芜湖", "宣城");
|
||||
break;
|
||||
case "福建" :
|
||||
var cityOptions = new Array(
|
||||
"福州", "厦门", "泉州", "漳州", "龙岩", "南平", "宁德", "莆田", "三明");
|
||||
break;
|
||||
case "甘肃" :
|
||||
var cityOptions = new Array(
|
||||
"兰州", "白银", "定西", "敦煌", "甘南", "金昌", "酒泉", "临夏", "平凉", "天水",
|
||||
"武都", "武威", "西峰", "张掖");
|
||||
break;
|
||||
case "广西" :
|
||||
var cityOptions = new Array(
|
||||
"南宁", "百色", "北海", "桂林", "防城港", "贵港", "河池", "贺州", "柳州", "钦州", "梧州", "玉林");
|
||||
break;
|
||||
case "贵州" :
|
||||
var cityOptions = new Array(
|
||||
"贵阳", "安顺", "毕节", "都匀", "凯里", "六盘水", "铜仁", "兴义", "玉屏", "遵义");
|
||||
break;
|
||||
case "海南" :
|
||||
var cityOptions = new Array(
|
||||
"海口", "儋县", "陵水", "琼海", "三亚", "通什", "万宁");
|
||||
break;
|
||||
case "河北" :
|
||||
var cityOptions = new Array(
|
||||
"石家庄", "保定", "北戴河", "沧州", "承德", "丰润", "邯郸", "衡水", "廊坊", "南戴河", "秦皇岛",
|
||||
"唐山", "新城", "邢台", "张家口");
|
||||
break;
|
||||
case "黑龙江" :
|
||||
var cityOptions = new Array(
|
||||
"哈尔滨", "北安", "大庆", "大兴安岭", "鹤岗", "黑河", "佳木斯", "鸡西", "牡丹江", "齐齐哈尔",
|
||||
"七台河", "双鸭山", "绥化", "伊春");
|
||||
break;
|
||||
case "河南" :
|
||||
var cityOptions = new Array(
|
||||
"郑州", "安阳", "鹤壁", "潢川", "焦作", "济源", "开封", "漯河", "洛阳", "南阳", "平顶山",
|
||||
"濮阳", "三门峡", "商丘", "新乡", "信阳", "许昌", "周口", "驻马店");
|
||||
break;
|
||||
case "香港" :
|
||||
var cityOptions = new Array(
|
||||
"香港", "九龙", "新界");
|
||||
break;
|
||||
case "湖北" :
|
||||
var cityOptions = new Array(
|
||||
"武汉", "恩施", "鄂州", "黄冈", "黄石", "荆门", "荆州", "潜江", "十堰", "随州", "武穴",
|
||||
"仙桃", "咸宁", "襄阳", "襄樊", "孝感", "宜昌");
|
||||
break;
|
||||
case "湖南" :
|
||||
var cityOptions = new Array(
|
||||
"长沙", "常德", "郴州", "衡阳", "怀化", "吉首", "娄底", "邵阳", "湘潭", "益阳", "岳阳",
|
||||
"永州", "张家界", "株洲");
|
||||
break;
|
||||
case "江西" :
|
||||
var cityOptions = new Array(
|
||||
"南昌", "抚州", "赣州", "吉安", "景德镇", "井冈山", "九江", "庐山", "萍乡",
|
||||
"上饶", "新余", "宜春", "鹰潭");
|
||||
break;
|
||||
case "吉林" :
|
||||
var cityOptions = new Array(
|
||||
"长春", "吉林", "白城", "白山", "珲春", "辽源", "梅河", "四平", "松原", "通化", "延吉");
|
||||
break;
|
||||
case "辽宁" :
|
||||
var cityOptions = new Array(
|
||||
"沈阳", "鞍山", "本溪", "朝阳", "大连", "丹东", "抚顺", "阜新", "葫芦岛", "锦州",
|
||||
"辽阳", "盘锦", "铁岭", "营口");
|
||||
break;
|
||||
case "澳门" :
|
||||
var cityOptions = new Array("澳门");
|
||||
break;
|
||||
case "内蒙古" :
|
||||
var cityOptions = new Array(
|
||||
"呼和浩特", "阿拉善盟", "包头", "赤峰", "东胜", "海拉尔", "集宁", "临河", "通辽", "乌海",
|
||||
"乌兰浩特", "锡林浩特");
|
||||
break;
|
||||
case "宁夏" :
|
||||
var cityOptions = new Array(
|
||||
"银川", "固源", "石嘴山", "吴忠");
|
||||
break;
|
||||
case "青海" :
|
||||
var cityOptions = new Array(
|
||||
"西宁", "德令哈", "格尔木", "共和", "海东", "海晏", "玛沁", "同仁", "玉树");
|
||||
break;
|
||||
case "山东" :
|
||||
var cityOptions = new Array(
|
||||
"济南", "滨州", "兖州", "德州", "东营", "菏泽", "济宁", "莱芜", "聊城", "临沂",
|
||||
"蓬莱", "青岛", "曲阜", "日照", "泰安", "潍坊", "威海", "烟台", "枣庄", "淄博");
|
||||
break;
|
||||
case "山西" :
|
||||
var cityOptions = new Array(
|
||||
"太原", "长治", "大同", "候马", "晋城", "离石", "临汾", "宁武", "朔州", "忻州",
|
||||
"阳泉", "榆次", "运城");
|
||||
break;
|
||||
case "陕西" :
|
||||
var cityOptions = new Array(
|
||||
"西安", "安康", "宝鸡", "汉中", "渭南", "商州", "绥德", "铜川", "咸阳", "延安", "榆林");
|
||||
break;
|
||||
case "四川" :
|
||||
var cityOptions = new Array(
|
||||
"成都", "巴中", "达川", "德阳", "都江堰", "峨眉山", "涪陵", "广安", "广元", "九寨沟",
|
||||
"康定", "乐山", "泸州", "马尔康", "绵阳", "眉山", "南充", "内江", "攀枝花", "遂宁",
|
||||
"汶川", "西昌", "雅安", "宜宾", "自贡", "资阳");
|
||||
break;
|
||||
case "台湾" :
|
||||
var cityOptions = new Array(
|
||||
"台北", "基隆", "台南", "台中", "高雄", "屏东", "南投", "云林", "新竹", "彰化", "苗栗",
|
||||
"嘉义", "花莲", "桃园", "宜兰", "台东", "金门", "马祖", "澎湖");
|
||||
break;
|
||||
case "天津" :
|
||||
var cityOptions = new Array(
|
||||
"天津", "和平", "东丽", "河东", "西青", "河西", "津南", "南开", "北辰", "河北", "武清", "红挢",
|
||||
"塘沽", "汉沽", "大港", "宁河", "静海", "宝坻", "蓟县");
|
||||
break;
|
||||
case "新疆" :
|
||||
var cityOptions = new Array(
|
||||
"乌鲁木齐", "阿克苏", "阿勒泰", "阿图什", "博乐", "昌吉", "东山", "哈密", "和田", "喀什",
|
||||
"克拉玛依", "库车", "库尔勒", "奎屯", "石河子", "塔城", "吐鲁番", "伊宁");
|
||||
break;
|
||||
case "西藏" :
|
||||
var cityOptions = new Array(
|
||||
"拉萨", "阿里", "昌都", "林芝", "那曲", "日喀则", "山南");
|
||||
break;
|
||||
case "云南" :
|
||||
var cityOptions = new Array(
|
||||
"昆明", "大理", "保山", "楚雄", "大理", "东川", "个旧", "景洪", "开远", "临沧", "丽江",
|
||||
"六库", "潞西", "曲靖", "思茅", "文山", "西双版纳", "玉溪", "中甸", "昭通");
|
||||
break;
|
||||
case "浙江" :
|
||||
var cityOptions = new Array(
|
||||
"杭州", "安吉", "慈溪", "定海", "奉化", "海盐", "黄岩", "湖州", "嘉兴", "金华", "临安",
|
||||
"临海", "丽水", "宁波", "瓯海", "平湖", "千岛湖", "衢州", "江山", "瑞安", "绍兴", "嵊州",
|
||||
"台州", "温岭", "温州", "余姚", "舟山");
|
||||
break;
|
||||
case "海外" :
|
||||
var cityOptions = new Array(
|
||||
"美国", "日本", "英国", "法国", "德国", "其他");
|
||||
break;
|
||||
default:
|
||||
var cityOptions = new Array("");
|
||||
break;
|
||||
}
|
||||
|
||||
cityField.options.length = 0;
|
||||
for (var i = 0; i < cityOptions.length; i++) {
|
||||
cityField.options[i] = new Option(cityOptions[i], cityOptions[i]);
|
||||
/*
|
||||
if (cityField.options[i].value==city)
|
||||
{
|
||||
//alert("here put City ok!");
|
||||
document.oblogform["city"].selectedIndex = i;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
function ifNameRepeat(){
|
||||
|
||||
//名称不能为空也不能重复
|
||||
if($("#schoolname").val() == ""){
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '/school/search_repeat_schoolname',
|
||||
type: 'get',
|
||||
data: {name:$("#schoolname").val()},
|
||||
success: function(data){
|
||||
if (data == 1){
|
||||
$("#schoolrepeatnotice").text("名称已存在");
|
||||
$("#schoolrepeatnotice").show();
|
||||
$("#schoolrepeatnotice").attr("value",1);
|
||||
$("#schoolrepeatnotice").attr("style","color:red");
|
||||
}
|
||||
else{
|
||||
$("#schoolrepeatnotice").text("可用");
|
||||
$("#schoolrepeatnotice").show();
|
||||
$("#schoolrepeatnotice").attr("value",0);
|
||||
$("#schoolrepeatnotice").attr("style","color:green");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1,47 @@
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false) %>
|
||||
<% end %>
|
||||
<div class="RightBanner" >
|
||||
<p >课程信息</p>
|
||||
</div>
|
||||
<div class="HomeWork">
|
||||
<p class="f16 mb10">课程信息</p>
|
||||
<div class="HomeWorkCon">
|
||||
<%= labelled_form_for @syllabus, :url =>syllabus_path(@syllabus),
|
||||
:html => {:nhname=>'form',:multipart => true, :id => 'syllabus-form'} do |f| %>
|
||||
<div>
|
||||
<div id="syllabus_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>
|
||||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
|
||||
<%= f.kindeditor :description, :editor_id => 'syllabus_description_editor',
|
||||
:owner_id => @syllabus.nil? ? 0: @syllabus.id,
|
||||
:owner_type => OwnerTypeHelper::SYLLABUS,
|
||||
:width => '100%',
|
||||
:height => 300,
|
||||
:minHeight=>300,
|
||||
:class => 'talk_text fl',
|
||||
:input_html => { :id => 'syllabus_content',
|
||||
:class => 'talk_text fl',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<div class="cl"></div>
|
||||
<p id="description_notice_span"></p>
|
||||
</div>
|
||||
|
||||
<div class="mt5">
|
||||
<div class="fl" id="syllabus_attachments">
|
||||
<%= render :partial => 'attachments/form_course', :locals => {:container => @syllabus, :isReply => false} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_syllabus();">发送</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" class="fr mr10 mt3" onclick="window.location.href = '<%=syllabus_path(@syllabus)%>';">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div><!--HomeWork end-->
|
@ -0,0 +1,3 @@
|
||||
$("#syllabus_eng_name_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus} %>");
|
||||
$("#syllabus_eng_name_show").show();
|
||||
$("#syllabus_eng_name_edit").hide();
|
@ -0,0 +1 @@
|
||||
<%= render :partial => 'syllabus_course_list'%>
|
@ -0,0 +1 @@
|
||||
$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'syllabus_course_list') %>');
|
@ -0,0 +1,2 @@
|
||||
$("#syllabus_base_info").html("<%=escape_javascript(render :partial => 'layouts/syllabus_edit_info', :locals => {:syllabus => @syllabus}) %>");
|
||||
$("#syllabus_base_info").html("<%=escape_javascript(render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus}) %>");
|
@ -0,0 +1,5 @@
|
||||
<div id="tags">
|
||||
<div id="tags_show">
|
||||
<%= render :partial => "tags/tag_syllabus_new_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,28 @@
|
||||
<% @tags = obj.reload.tag_list %>
|
||||
<% if non_list_all && @tags.size > 0 %>
|
||||
|
||||
<% else %>
|
||||
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
|
||||
<% if @tags.size > 0 %>
|
||||
<% @tags.each do |tag| %>
|
||||
<span class="re_tag f_l " id="tag">
|
||||
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
|
||||
<span class="del">
|
||||
<%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if obj.user == User.current %>
|
||||
</span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if User.current.logged?%>
|
||||
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();"><%= l(:label_add_tag)%></a>
|
||||
<span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l">
|
||||
<%= form_for "tag_for_save",:remote=>true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
|
||||
<%= f.text_field :name ,:id => "tags_name4",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
|
||||
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
|
||||
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
|
||||
<input type="button" class="submit f_l" onclick="$('#tags_name4').parent().submit();" />
|
||||
<% end %>
|
||||
</span>
|
||||
<% end%>
|
@ -0,0 +1,117 @@
|
||||
<div class="syllabus_box" id="course-list">
|
||||
<h2 class="syllabus_h2_top"><span class="icon_course fl mt7 mr5"></span>课程列表</h2>
|
||||
<div class="syllabus_category">
|
||||
<span class="grayTxt fl">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fl", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fl", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fl", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fl", :remote => true %>
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fl", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fl", :remote => true %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% if @syllabus.any? %>
|
||||
<% @syllabus.each_with_index do |syllabus, index|%>
|
||||
<div class="syllabus_courses_box">
|
||||
<% courses = @courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("time desc") %>
|
||||
<div class="syllabus_courses_list">
|
||||
<div class="<%=index == 0 ? 'sy_courses_open' : 'sy_courses_close' %>">
|
||||
<span class="<%=index == 0 ? 'icons_sy_open' : 'icons_sy_close' %> fl mr5"></span>
|
||||
<h3 class="syllabus_courses_title fl"><%=syllabus.title %></h3>
|
||||
</div>
|
||||
<p class="fl sy_p_grey">更新时间:<%=format_date syllabus.updated_at %>
|
||||
<span class="mr10"></span>创建老师:<%=syllabus.user.show_name %>
|
||||
<span class="mr10"></span>班级:<%=courses.count %>
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="syllabus_class_box <%=index == 0 ? '' : 'none' %>">
|
||||
<ul id="syllabus_course_ul_<%=syllabus.id %>">
|
||||
<% unless courses.nil? %>
|
||||
<% courses.each_with_index do |course, i| %>
|
||||
<li class="syllabus_class_list <%=i > 2 ? 'none' : '' %>">
|
||||
<a href="<%=course_path(course.id) %>" target="_blank">
|
||||
<span class="icons_sy_cir "></span>
|
||||
<div class="fl">
|
||||
<div class="syllabus_class_w ">
|
||||
<p class="syllabus_class_title fl"><%=course.name %></p>
|
||||
<span class="fr sy_p_grey">主讲老师:<%=course.teacher.show_name %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="">
|
||||
<p class="fl grayTxt ">更新:<%=format_date Time.at(course.updatetime) %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p>
|
||||
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(@course).count %></span><span>资源</span></p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="icons_sy_arrow fl mt19 ml10" ></span>
|
||||
<div class="cl"></div>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if courses.count > 3 %>
|
||||
<li class="syllabus_class_list_more" id="syllabus_class_list_more_<%=syllabus.id %>">
|
||||
<a href="javascript:void(0);" id="expand_list_<%=syllabus.id %>" data-init="0" onclick="expand_course_list(<%=syllabus.id %>,'#syllabus_course_ul_<%=syllabus.id %> li','#expand_list_<%=syllabus.id %>',<%=courses.count %>)">共<%=courses.count %>个课程,点击全部展开</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div><!--syllabus_class_box end-->
|
||||
|
||||
|
||||
<%=link_to '', syllabus_path(syllabus.id), :class => 'icons_sy_setting fr',:target =>'_blank', :title => '查看课程' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<ul class="wlist" id="pages" >
|
||||
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function() {
|
||||
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight) {
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".syllabus_box").height() + diffHeight;
|
||||
$(".syllabus_box").css("minHeight", tmpHeight);
|
||||
}
|
||||
|
||||
$(".syllabus_courses_list").each(function(){
|
||||
var syStaust = $(this).children(":first-child");
|
||||
|
||||
if (syStaust.hasClass("sy_courses_open")){
|
||||
$(this).toggle(function(){
|
||||
$(this).next().hide();
|
||||
$(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open");
|
||||
},function(){
|
||||
$(this).next().show();
|
||||
$(this).children(":first-child").children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close");
|
||||
});
|
||||
}else{
|
||||
$(this).toggle(function(){
|
||||
$(this).next().show();
|
||||
$(this).children(":first-child").children(":first-child").addClass("icons_sy_open").removeClass("icons_sy_close");
|
||||
},function(){
|
||||
$(this).next().hide();
|
||||
$(this).children(":first-child").children(":first-child").addClass("icons_sy_close").removeClass("icons_sy_open");
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
@ -1 +1 @@
|
||||
<%= render :partial => 'users/user_course_list'%>
|
||||
<%= render :partial => 'users/user_syllabus_list'%>
|
||||
|
@ -1 +1 @@
|
||||
$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_course_list') %>');
|
||||
$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'users/user_syllabus_list') %>');
|
@ -1 +1 @@
|
||||
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user, :page => @page} )%>");
|
||||
$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user,:type=>@type,:page => @page, :all_count => @all_count} )%>");
|
||||
|
@ -0,0 +1,12 @@
|
||||
class AddColumnToSyllabus < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :syllabuses, :eng_name, :string
|
||||
add_column :syllabuses, :type, :integer
|
||||
add_column :syllabuses, :credit, :integer
|
||||
add_column :syllabuses, :hours, :integer
|
||||
add_column :syllabuses, :theory_hours, :integer
|
||||
add_column :syllabuses, :practice_hours, :integer
|
||||
add_column :syllabuses, :applicable_major, :string
|
||||
add_column :syllabuses, :pre_course, :string
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddSchoolTypeToSchools < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :schools, :school_type, :integer, :default => false
|
||||
end
|
||||
end
|
@ -0,0 +1,15 @@
|
||||
class CreateApplyAddSchools < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :apply_add_schools do |t|
|
||||
t.string :name
|
||||
t.string :province
|
||||
t.string :city
|
||||
t.string :address
|
||||
t.string :remarks
|
||||
t.integer :school_id
|
||||
t.integer :status, :default => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddVisitsToSyllabus < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :syllabuses, :visits, :integer, :default => 0
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddDesStatusToSyllabus < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :syllabuses, :des_status, :integer, :default => 0
|
||||
end
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue