Merge branch 'cxt_course' into develop
This commit is contained in:
commit
6fdab3c613
|
@ -888,23 +888,25 @@ class CoursesController < ApplicationController
|
|||
if params[:type].present?
|
||||
case params[:type]
|
||||
when "homework"
|
||||
@course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
@course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc')
|
||||
when "news"
|
||||
@course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
@course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc')
|
||||
when "message"
|
||||
@course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
@course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc')
|
||||
when "poll"
|
||||
@course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
@course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc')
|
||||
when "attachment"
|
||||
@course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
@course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc')
|
||||
when "journalsForMessage"
|
||||
@course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
@course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc')
|
||||
else
|
||||
@course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10)
|
||||
@course_activities = course_activities.order('updated_at desc')
|
||||
end
|
||||
else
|
||||
@course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10)
|
||||
@course_activities = course_activities.order('updated_at desc')
|
||||
end
|
||||
@course_activities_count = @course_activities.count
|
||||
@course_activities = @course_activities.limit(10).offset(@page * 10)
|
||||
@type = params[:type]
|
||||
|
||||
@left_nav_type = 1
|
||||
|
|
|
@ -56,6 +56,7 @@ class MessagesController < ApplicationController
|
|||
all
|
||||
@replies = paginateHelper messages_replies,10
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
@left_nav_type = 2
|
||||
render :action => "show", :layout => "base_courses"#by young
|
||||
elsif @project
|
||||
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
||||
|
|
|
@ -54,7 +54,7 @@ module ApplicationHelper
|
|||
# 获取用户单位
|
||||
# 优先获取高校信息,如果改信息不存在则获取occupation
|
||||
def get_occupation_from_user user
|
||||
School.where("id=?",user.user_extensions.school_id).first.try(:name).nil? ? user.user_extensions.occupation : School.where("id=?",user.user_extensions.school_id).first.try(:name)
|
||||
School.where("id=?",user.user_extensions.school_id).first.try(:name).nil? ? user.user_extensions.try(:occupation) : School.where("id=?",user.user_extensions.school_id).first.try(:name)
|
||||
end
|
||||
|
||||
def update_visiti_count container
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if course_activities.count == 10 %>
|
||||
<% if course_activities.count + page * 10 < @course_activities_count %>
|
||||
<!--<div id="show_more_course_activities" class="loadMore mt10 f_grey">点击展开更多<%#= link_to "", course_activity_path(@course.id, :type => type, :page => page), :id => "more_course_activities_link", :remote => "true", :class => "none" %></div>-->
|
||||
<%= link_to "点击展开更多",course_activity_path(@course.id, :type => type, :page => page),:id => "show_more_course_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% if params[:user_page].nil? %>
|
||||
$("#project_info_<%=@course.id %>").html('<%=escape_javascript(render :partial=>'layouts/project_info') %>');
|
||||
$("#project_info_<%=@course.id %>").html('<%=escape_javascript(render :partial=>'layouts/course_base_info') %>');
|
||||
if(document.getElementById("course_is_public")) {
|
||||
<% if @course.is_public == 0%>
|
||||
$("#course_is_public").attr("checked",false);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<div class="courseRSide fl" id="homework_page_right">
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_course_modify_settings)%></h2>
|
||||
</div>
|
||||
|
@ -6,6 +7,7 @@
|
|||
<% if @select_tab == 'member'%>
|
||||
$("#tb_2").click();
|
||||
<% end %>
|
||||
$("#homework_page_right").css("min-height",$("#courseLSide").height()+45);
|
||||
})
|
||||
</script>
|
||||
<div class="hwork_new">
|
||||
|
@ -144,3 +146,4 @@
|
|||
//$("#time").click(select);
|
||||
//$("#term").click(select);
|
||||
</script>
|
||||
</div>
|
|
@ -36,7 +36,7 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<!-- 老师身份才可以发布作业 -->
|
||||
<div class="HomeWork mb10" nhname='homework_common_form'>
|
||||
<div class="HomeWork mb10 ml10" nhname='homework_common_form'>
|
||||
<%= form_for @homework do |f| %>
|
||||
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/>
|
||||
<input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<span class=" mr15">主讲老师:<%= link_to(@course.teacher.show_name, user_path(@course.teacher), :class => 'sy_cblue') %></span>
|
||||
<span class=" mr15">学时:<span class="sy_cblack"><%= @course.class_period %>学时</span></span>
|
||||
<span class=" mr15">学期:<span class="sy_cblack"><%= current_time_and_term @course %></span></span>
|
||||
<span class=" mr15">单位:<span class="sy_cblack"><%= @course.school ? @course.school : '无' %></span></span>
|
||||
<span class=" mr15">单位:<span class="sy_cblack"><%= get_occupation_from_user(@course.teacher).blank? ? '无' : get_occupation_from_user(@course.teacher) %></span></span>
|
||||
</p>
|
||||
<!--<a href="javascript:void(0);" class="sy_btn_orange mr10" > 教师身份</a>-->
|
||||
<% unless is_teacher %>
|
||||
|
|
|
@ -52,9 +52,9 @@
|
|||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
||||
<% if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%>
|
||||
<span class="homepageLeftMenuMore"><a href="javascript:void(0);" data-init="0" onclick="toggle_all_syllabus_attr();" class="homepageLeftMenuMoreIcon2" id="show_all_syllabus_attr"></a></span>
|
||||
<% end %>
|
||||
<%# if User.current.logged? && (User.current == syllabus.user || User.current.admin?)&&(syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == ''||syllabus.credit.nil? || syllabus.credit == ''||syllabus.hours.nil? || syllabus.hours == ''||syllabus.theory_hours.nil? || syllabus.theory_hours == ''||syllabus.practice_hours.nil? || syllabus.practice_hours == ''||syllabus.applicable_major.nil? || syllabus.applicable_major == ''||syllabus.pre_course.nil? || syllabus.pre_course == '')%>
|
||||
<!--<span class="homepageLeftMenuMore"><a href="javascript:void(0);" data-init="0" onclick="toggle_all_syllabus_attr();" class="homepageLeftMenuMoreIcon2" 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}) %>");
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="">
|
||||
<div class="sy_class_infobox">
|
||||
<div class="sy_class_infobox" id="project_info_<%=@course.id %>">
|
||||
<%=render :partial => 'layouts/course_base_info' %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public','css/structure','css/courses','css/popup','prettify','syllabus','sy_public',:media => 'all' %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public','css/structure','css/courses','css/popup','prettify','syllabus','sy_public',:media => 'all'%>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_heads %>
|
||||
<%= javascript_include_tag "bootstrap","avatars","course",'attachments','prettify','syllabus','cookie'%>
|
||||
|
@ -15,8 +15,7 @@
|
|||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
<script type="text/javascript" src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<%= link_to "", {:controller => 'syllabuses', :action => 'syllabus_courselist', :id =>@syllabus, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} mt15 fl", :remote => true %>
|
||||
<% end %>
|
||||
<% if @syllabus.user == User.current %>
|
||||
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "sy_btn_green fr mt10 mr10", :target => '_blank'%>
|
||||
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "sy_btn_green fr mt10 mr15", :target => '_blank'%>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_syllabus();">发送</a>
|
||||
<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>
|
||||
|
|
|
@ -498,7 +498,7 @@ a:hover.testEdit{ background:url(../images/icons.png) -21px -272px no-repeat;}
|
|||
.courseMenuSetting {background:url(/images/homepage_icon2.png) -190px -365px no-repeat; width:15px; height:15px; margin-top:3px; float:right; margin-right:5px;}
|
||||
.courseMenuSetting:hover {background:url(/images/homepage_icon2.png) -190px -407px no-repeat;}
|
||||
.rankList {width:208px; background: #fff; border: 1px solid #e5e5e5; border-bottom: none; padding:10px 15px;}
|
||||
.rankList li {width:73px; padding:8px 0px 0px 0px; text-align:center; float:left; position:relative;}
|
||||
.rankList li {width:68px; padding:8px 0px 0px 0px; text-align:center; float:left; position:relative;}
|
||||
.rankList li p {width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#585858;word-wrap: normal; word-break: normal;}
|
||||
.rankPortrait {border-radius:50%; width:35px; height:35px;}
|
||||
.numIntro {position:absolute; text-align:left; z-index:999; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); border:1px solid #eaeaea; background-color:#ffffff; padding:3px 5px; left:15px; color:#585858; white-space: nowrap;}
|
||||
|
|
|
@ -144,7 +144,12 @@ a.pages-big{
|
|||
margin:20px auto 10px;
|
||||
}
|
||||
/* 输入框 */
|
||||
.sy_contanier input,.sy_contanier select{
|
||||
.sy_right_box input,.sy_right_box select{
|
||||
border:1px solid #ccc;
|
||||
padding:5px;
|
||||
background:#fff;
|
||||
}
|
||||
.sy_top_con input,.sy_top_con select{
|
||||
border:1px solid #ccc;
|
||||
padding:5px;
|
||||
background:#fff;
|
||||
|
|
Loading…
Reference in New Issue