commit
8bc7863e5c
|
@ -66,7 +66,10 @@ class CoursesController < ApplicationController
|
||||||
@course_display=@course
|
@course_display=@course
|
||||||
@theparams=params
|
@theparams=params
|
||||||
@credit_isdegree, @credit_nodegree=cal_degree
|
@credit_isdegree, @credit_nodegree=cal_degree
|
||||||
|
end
|
||||||
|
|
||||||
|
def classtable
|
||||||
|
@course=current_user.courses
|
||||||
end
|
end
|
||||||
|
|
||||||
def credit#add credit method
|
def credit#add credit method
|
||||||
|
@ -89,6 +92,7 @@ class CoursesController < ApplicationController
|
||||||
redirect_to courses_path,flash: {:success=> "已经成功将 #{@course.name} 选为非学位课"}
|
redirect_to courses_path,flash: {:success=> "已经成功将 #{@course.name} 选为非学位课"}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def select
|
def select
|
||||||
@allcourse=current_user.courses
|
@allcourse=current_user.courses
|
||||||
@course=Course.find_by_id(params[:id])
|
@course=Course.find_by_id(params[:id])
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<%= render "shared/sidenav" %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-10">
|
||||||
|
|
||||||
|
<div class="panel panel-primary filterable">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<% if student_logged_in? %><h3 class="panel-title">已选课程</h3><% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<table class= "table table-bordered">
|
||||||
|
<caption>课程表</caption>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td> </td>
|
||||||
|
<td>周一</td>
|
||||||
|
<td>周二</td>
|
||||||
|
<td>周三</td>
|
||||||
|
<td>周四</td>
|
||||||
|
<td>周五</td>
|
||||||
|
<td>周六</td>
|
||||||
|
<td>周日</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</div>
|
||||||
|
<tbody>
|
||||||
|
<%op="一二三四五六日"%>
|
||||||
|
<%k=Array[0,0,0,0,0,0,0]%>
|
||||||
|
<%for i in 1..11 %>
|
||||||
|
<tr><td> <%=i%> </td>
|
||||||
|
<%for m in 0..6%>
|
||||||
|
<%k[m]=0%>
|
||||||
|
<%end%>
|
||||||
|
<%for j in 0..6 %>
|
||||||
|
<% @course.each do |h| %>
|
||||||
|
<%if(h.course_time.empty?)%>
|
||||||
|
<%next%>
|
||||||
|
<%end%>
|
||||||
|
<%if(h.course_time[1]==op[j]&&h.course_time[3].to_i<=i&&h.course_time[5,h.course_time.length-1].to_i>=i)%>
|
||||||
|
<td class="success",align="center"><%=h.name%></td>
|
||||||
|
<%k[j]=1%>
|
||||||
|
<%end%>
|
||||||
|
<%end%>
|
||||||
|
<%if k[j]==0%>
|
||||||
|
<td><%" "%></td>
|
||||||
|
<%end%>
|
||||||
|
<%end%>
|
||||||
|
</tr>
|
||||||
|
<%end%>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -10,7 +10,9 @@
|
||||||
<div class="panel panel-primary filterable">
|
<div class="panel panel-primary filterable">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<% if teacher_logged_in? %><h3 class="panel-title">授课列表</h3><% end %>
|
<% if teacher_logged_in? %><h3 class="panel-title">授课列表</h3><% end %>
|
||||||
<% if student_logged_in? %><h3 class="panel-title">已选课程</h3><% end %>
|
<% if student_logged_in? %><h3 class="panel-title">已选课程</h3>
|
||||||
|
<td><%= link_to "个人课表",classtable_course_url(@course), class: 'btn btn-xs btn-info' %></td>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
|
@ -24,6 +24,7 @@ Rails.application.routes.draw do
|
||||||
get :detail
|
get :detail
|
||||||
get :open
|
get :open
|
||||||
get :close
|
get :close
|
||||||
|
get :classtable
|
||||||
get :isdegree #add route isdegree
|
get :isdegree #add route isdegree
|
||||||
get :nodegree #add route nodegree
|
get :nodegree #add route nodegree
|
||||||
end
|
end
|
||||||
|
@ -32,7 +33,6 @@ Rails.application.routes.draw do
|
||||||
get :search
|
get :search
|
||||||
get :refresh_search
|
get :refresh_search
|
||||||
get :credit #add credit route
|
get :credit #add credit route
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue