Merge branch 'cxt_course' into develop

dev_pull
cxt 9 years ago
commit b4e6561e50

@ -112,10 +112,10 @@ class AdminController < ApplicationController
def non_syllabus_courses def non_syllabus_courses
@name = params[:name].to_s.strip.downcase @name = params[:name].to_s.strip.downcase
if @name && @name != "" if @name && @name != ""
@courses = Course.where("syllabus_id is null").select{ |course| (course.teacher[:lastname].to_s.downcase + course.teacher[:firstname].to_s.downcase).include?(@name) || course.name.include?(@name)} @courses = Course.where("syllabus_id is null and is_delete = 0").select{ |course| (course.teacher[:lastname].to_s.downcase + course.teacher[:firstname].to_s.downcase).include?(@name) || course.name.include?(@name)}
@courses = @courses.sort{|x, y| y.created_at <=> x.created_at} @courses = @courses.sort{|x, y| y.created_at <=> x.created_at}
else else
@courses = Course.where("syllabus_id is null").order('created_at desc') @courses = Course.where("syllabus_id is null and is_delete = 0").order('created_at desc')
end end
@courses = paginateHelper @courses,30 @courses = paginateHelper @courses,30
@page = (params['page'] || 1).to_i - 1 @page = (params['page'] || 1).to_i - 1

@ -2023,7 +2023,7 @@ class UsersController < ApplicationController
@flag = true @flag = true
if params[:send_id].present? if params[:send_id].present?
rs = ResourcesService.new rs = ResourcesService.new
@ori, @flag, @save_message = rs.send_resource_to_course(params) @ori, @flag, @save_message = rs.send_resource_to_course(User.current, params)
elsif params[:send_ids].present? elsif params[:send_ids].present?
send_ids = params[:send_ids].split(",") send_ids = params[:send_ids].split(",")
course_ids = params[:course_ids] course_ids = params[:course_ids]

@ -7,7 +7,7 @@
</span> </span>
</td> </td>
<td align="center"> <td align="center">
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> <%= link_to(course.teacher.show_name.truncate(6, omission: '...'), user_path(course.teacher)) %>
</td> </td>
<td align="center"> <td align="center">
<%= course.class_period %> <%= course.class_period %>
@ -16,6 +16,8 @@
<%= checked_image course.is_public? %> <%= checked_image course.is_public? %>
</td> </td>
<td class="center"> <td class="center">
<%= course.is_delete == 0 ? '正常' : '归档' %>
</td><td class="center">
<%= format_date(course.created_at) %> <%= format_date(course.created_at) %>
</td> </td>
<td class="center"> <td class="center">

@ -27,10 +27,10 @@
<table class="list" style="width: 100%;table-layout: fixed"> <table class="list" style="width: 100%;table-layout: fixed">
<thead> <thead>
<tr> <tr>
<th style="width: 30px;"> <th style="width: 20px;">
序号 序号
</th> </th>
<th style="width: 85px;"> <th style="width: 70px;">
班级 班级
</th> </th>
<th style="width: 35px;"> <th style="width: 35px;">
@ -42,6 +42,9 @@
<th style="width: 15px;"> <th style="width: 15px;">
<%=l(:field_is_public)%> <%=l(:field_is_public)%>
</th> </th>
<th style="width: 20px;">
状态
</th>
<th style="width: 45px;"> <th style="width: 45px;">
<%=l(:field_created_on)%> <%=l(:field_created_on)%>
</th> </th>
@ -58,9 +61,11 @@
</thead> </thead>
<tbody> <tbody>
<% @courses.each do |course| %> <% @courses.each do |course| %>
<% unless course.teacher.nil? %>
<tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>"> <tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>">
<%=render :partial => 'courselist_detail_tr', :locals => {:course => course} %> <%=render :partial => 'courselist_detail_tr', :locals => {:course => course} %>
</tr> </tr>
<% end %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

@ -58,6 +58,7 @@
</thead> </thead>
<tbody> <tbody>
<% @courses.each do |course| %> <% @courses.each do |course| %>
<% unless course.teacher.nil? %>
<tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>"> <tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>">
<td style="text-align: center;"> <td style="text-align: center;">
<%= course.id %> <%= course.id %>
@ -68,7 +69,7 @@
</span> </span>
</td> </td>
<td align="center"> <td align="center">
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> <%= link_to(course.teacher.show_name.truncate(6, omission: '...'), user_path(course.teacher)) %>
</td> </td>
<td align="center"> <td align="center">
<%= course.class_period %> <%= course.class_period %>
@ -90,6 +91,7 @@
</td> </td>
</tr> </tr>
<% end %> <% end %>
<% end %>
</tbody> </tbody>
</table> </table>
</div> </div>

@ -8,7 +8,7 @@
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %> <% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %> <% end %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');"> <select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">课程</option> <option value="1">班级</option>
<option value="2">项目</option> <option value="2">项目</option>
<option value="3">组织</option> <option value="3">组织</option>
</select> </select>
@ -20,7 +20,7 @@
<%= form_tag search_user_course_user_path(user),:method => 'get', :remote=>true, :id=> 'search_user_course_form', :class=> 'resourcesSearchBox' do %> <%= form_tag search_user_course_user_path(user),:method => 'get', :remote=>true, :id=> 'search_user_course_form', :class=> 'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %> <%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入课程ID或者名称搜索" class="searchResourcePopup" /> <input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="searchResourcePopup" />
<script> <script>
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','file') observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','file')
</script> </script>

@ -5,8 +5,8 @@
</div> </div>
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>--> <!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
<div class="fl"> <div class="fl">
<!--<input type="text" name="search" placeholder="输入课程ID或者名称搜索" class="subjectSearch fr" />--> <!--<input type="text" name="search" placeholder="输入班级ID或者名称搜索" class="subjectSearch fr" />-->
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入课程ID或者名称搜索" class="mt10 mb10 course-search" /> <input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="mt10 mb10 course-search" />
</div> </div>
<div id="send_homework_to_course_form"> <div id="send_homework_to_course_form">
<%= render :partial => "users/send_homework_to_course_form", :locals => {:user => user, :courses => courses, :send_id => send_id} %> <%= render :partial => "users/send_homework_to_course_form", :locals => {:user => user, :courses => courses, :send_id => send_id} %>

@ -18,7 +18,7 @@
:remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %> :remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %> <%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入课程ID或者名称搜索" class="searchResourcePopup" /> <input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="searchResourcePopup" />
<script> <script>
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','message') observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','message')
</script> </script>

@ -18,7 +18,7 @@
:remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %> :remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %> <%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入课程ID或者名称搜索" class="searchResourcePopup" /> <input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="searchResourcePopup" />
<script> <script>
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','news') observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','news')
</script> </script>

@ -15,10 +15,13 @@ namespace :update_homework do
unless student_works.nil? unless student_works.nil?
student_works.each do |s| student_works.each do |s|
project = Project.find s.project_id project = Project.find s.project_id
unless project.nil? && project.gpid.nil? unless project.nil? && project.gpid.blank?
project_time=project.updated_on project_time=project.updated_on
project_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last project_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last
if time.strftime('%Y-%m-%d %H:%M:%S') < project_time.strftime('%Y-%m-%d %H:%M:%S') puts "the time is =========================> #{time}"
puts "the project_time is =========================> #{project_time}"
#if time.strftime('%Y-%m-%d %H:%M:%S') < project_time.strftime('%Y-%m-%d %H:%M:%S')
if format_time(time) < format_time(project_time)
time = project_time time = project_time
end end
begin begin
@ -28,7 +31,10 @@ namespace :update_homework do
changesets = g.commits(project.gpid, :ref_name => default_branch) changesets = g.commits(project.gpid, :ref_name => default_branch)
changesets_latest_coimmit = changesets[0] changesets_latest_coimmit = changesets[0]
unless changesets[0].blank? unless changesets[0].blank?
if time.strftime('%Y-%m-%d %H:%M:%S') <changesets_latest_coimmit.created_at.strftime('%Y-%m-%d %H:%M:%S') puts "the time is =========================> #{time}"
puts "the changesets_latest_coimmit is =========================> #{changesets_latest_coimmit.created_at}"
#if time.strftime('%Y-%m-%d %H:%M:%S') < changesets_latest_coimmit.created_at.strftime('%Y-%m-%d %H:%M:%S')
if format_time(time) < format_time(changesets_latest_coimmit.created_at)
time = changesets_latest_coimmit.created_at time = changesets_latest_coimmit.created_at
end end
end end

@ -1601,7 +1601,7 @@ function expand_course_list(id, target, btnid, count) {
target.show(); target.show();
}else{ }else{
btn.data('init',0); btn.data('init',0);
btn.html('共'+count+ '个课程,点击全部展开'); btn.html('共'+count+ '个班级,点击全部展开');
target.hide(); target.hide();
target.eq(0).show(); target.eq(0).show();
target.eq(1).show(); target.eq(1).show();

@ -57,7 +57,7 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
.hworkList60 {width:60px; text-align:center;} .hworkList60 {width:60px; text-align:center;}
.hworkList60 {width:60px; text-align:center;} .hworkList60 {width:60px; text-align:center;}
.hworkList70 {width:70px; text-align:center;} .hworkList70 {width:70px; text-align:center;}
.hworkList80 {width:90px; text-align:center;} .hworkList80 {width:80px; text-align:center;}
.hworkList90 {width:90px; text-align:center;} .hworkList90 {width:90px; text-align:center;}
.hworkList100 {width:100px; text-align:center;} .hworkList100 {width:100px; text-align:center;}
.hworkList110 {width:110px; text-align:center;} .hworkList110 {width:110px; text-align:center;}

@ -292,4 +292,18 @@ div.modal {
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} .resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a:hover.Blue-btn{ background:#3598db; color:#fff;} a:hover.Blue-btn{ background:#3598db; color:#fff;}
/***** end Ajax indicator ******/ /***** end Ajax indicator ******/
/*消息弹框*/
.shadowbox_news{ width:305px; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position: absolute; left: -131px; top: 45px; z-index: 9999;}
.shadowbox_news_title{ height:40px; line-height:40px;padding-left:10px; font-size:12px; color:#333;border-bottom:1px solid #eee;}
.shadowbox_news_p{ height:40px; line-height:40px; font-size:12px; color:#333;}
.shadowbox_news font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); }
.shadowbox_news_list{ max-height:400px; overflow:hidden;}
.shadowbox_news_list a{ color:#999;}
.shadowbox_news_list li{ height:40px; border-bottom:1px dashed #ebebeb; line-height:40px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; padding:0 10px;}
.shadowbox_news_list li:hover{ background-color:#eee;}
span.shadowbox_news_user{ color:#3b94d6;}
a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; color:#3b94d6; text-align:center;border-top:1px solid #eee;}
.undis {display:none;}
.text_c {text-align:center;}

Loading…
Cancel
Save